use stripe_client_core::{
RequestBuilder, StripeBlockingClient, StripeClient, StripeMethod, StripeRequest,
};
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct ListSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
attach_to_self: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
created: Option<stripe_types::RangeQueryTs>,
#[serde(skip_serializing_if = "Option::is_none")]
customer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
customer_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
ending_before: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
starting_after: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ListSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ListSetupIntentBuilder").finish_non_exhaustive()
}
}
impl ListSetupIntentBuilder {
fn new() -> Self {
Self {
attach_to_self: None,
created: None,
customer: None,
customer_account: None,
ending_before: None,
expand: None,
limit: None,
payment_method: None,
starting_after: None,
}
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ListSetupIntent {
inner: ListSetupIntentBuilder,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ListSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ListSetupIntent").finish_non_exhaustive()
}
}
impl ListSetupIntent {
pub fn new() -> Self {
Self { inner: ListSetupIntentBuilder::new() }
}
pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
self.inner.attach_to_self = Some(attach_to_self.into());
self
}
pub fn created(mut self, created: impl Into<stripe_types::RangeQueryTs>) -> Self {
self.inner.created = Some(created.into());
self
}
pub fn customer(mut self, customer: impl Into<String>) -> Self {
self.inner.customer = Some(customer.into());
self
}
pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
self.inner.customer_account = Some(customer_account.into());
self
}
pub fn ending_before(mut self, ending_before: impl Into<String>) -> Self {
self.inner.ending_before = Some(ending_before.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
pub fn limit(mut self, limit: impl Into<i64>) -> Self {
self.inner.limit = Some(limit.into());
self
}
pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
self.inner.payment_method = Some(payment_method.into());
self
}
pub fn starting_after(mut self, starting_after: impl Into<String>) -> Self {
self.inner.starting_after = Some(starting_after.into());
self
}
}
impl Default for ListSetupIntent {
fn default() -> Self {
Self::new()
}
}
impl ListSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
pub fn paginate(
&self,
) -> stripe_client_core::ListPaginator<stripe_types::List<stripe_shared::SetupIntent>> {
stripe_client_core::ListPaginator::new_list("/setup_intents", &self.inner)
}
}
impl StripeRequest for ListSetupIntent {
type Output = stripe_types::List<stripe_shared::SetupIntent>;
fn build(&self) -> RequestBuilder {
RequestBuilder::new(StripeMethod::Get, "/setup_intents").query(&self.inner)
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct RetrieveSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
client_secret: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for RetrieveSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("RetrieveSetupIntentBuilder").finish_non_exhaustive()
}
}
impl RetrieveSetupIntentBuilder {
fn new() -> Self {
Self { client_secret: None, expand: None }
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct RetrieveSetupIntent {
inner: RetrieveSetupIntentBuilder,
intent: stripe_shared::SetupIntentId,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for RetrieveSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("RetrieveSetupIntent").finish_non_exhaustive()
}
}
impl RetrieveSetupIntent {
pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
Self { intent: intent.into(), inner: RetrieveSetupIntentBuilder::new() }
}
pub fn client_secret(mut self, client_secret: impl Into<String>) -> Self {
self.inner.client_secret = Some(client_secret.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
}
impl RetrieveSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for RetrieveSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
let intent = &self.intent;
RequestBuilder::new(StripeMethod::Get, format!("/setup_intents/{intent}"))
.query(&self.inner)
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct CreateSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
attach_to_self: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
automatic_payment_methods: Option<CreateSetupIntentAutomaticPaymentMethods>,
#[serde(skip_serializing_if = "Option::is_none")]
confirm: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
confirmation_token: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
customer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
customer_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
excluded_payment_method_types:
Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
#[serde(skip_serializing_if = "Option::is_none")]
mandate_data: Option<CreateSetupIntentMandateData>,
#[serde(skip_serializing_if = "Option::is_none")]
metadata: Option<std::collections::HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
on_behalf_of: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_configuration: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_data: Option<CreateSetupIntentPaymentMethodData>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_options: Option<CreateSetupIntentPaymentMethodOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_types: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
return_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
single_use: Option<CreateSetupIntentSingleUse>,
#[serde(skip_serializing_if = "Option::is_none")]
usage: Option<CreateSetupIntentUsage>,
#[serde(skip_serializing_if = "Option::is_none")]
use_stripe_sdk: Option<bool>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentBuilder").finish_non_exhaustive()
}
}
impl CreateSetupIntentBuilder {
fn new() -> Self {
Self {
attach_to_self: None,
automatic_payment_methods: None,
confirm: None,
confirmation_token: None,
customer: None,
customer_account: None,
description: None,
excluded_payment_method_types: None,
expand: None,
flow_directions: None,
mandate_data: None,
metadata: None,
on_behalf_of: None,
payment_method: None,
payment_method_configuration: None,
payment_method_data: None,
payment_method_options: None,
payment_method_types: None,
return_url: None,
single_use: None,
usage: None,
use_stripe_sdk: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentAutomaticPaymentMethods {
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_redirects: Option<CreateSetupIntentAutomaticPaymentMethodsAllowRedirects>,
pub enabled: bool,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethods {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentAutomaticPaymentMethods").finish_non_exhaustive()
}
}
impl CreateSetupIntentAutomaticPaymentMethods {
pub fn new(enabled: impl Into<bool>) -> Self {
Self { allow_redirects: None, enabled: enabled.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
Always,
Never,
Unknown(String),
}
impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
pub fn as_str(&self) -> &str {
use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
match self {
Always => "always",
Never => "never",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*;
match s {
"always" => Ok(Always),
"never" => Ok(Never),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentAutomaticPaymentMethodsAllowRedirects"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentAutomaticPaymentMethodsAllowRedirects))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentMandateData {
pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentMandateData {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentMandateData").finish_non_exhaustive()
}
}
impl CreateSetupIntentMandateData {
pub fn new(
customer_acceptance: impl Into<CreateSetupIntentMandateDataCustomerAcceptance>,
) -> Self {
Self { customer_acceptance: customer_acceptance.into() }
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentMandateDataCustomerAcceptance {
#[serde(skip_serializing_if = "Option::is_none")]
pub accepted_at: Option<stripe_types::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub offline: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub online: Option<OnlineParam>,
#[serde(rename = "type")]
pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptance {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentMandateDataCustomerAcceptance").finish_non_exhaustive()
}
}
impl CreateSetupIntentMandateDataCustomerAcceptance {
pub fn new(type_: impl Into<CreateSetupIntentMandateDataCustomerAcceptanceType>) -> Self {
Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentMandateDataCustomerAcceptanceType {
Offline,
Online,
Unknown(String),
}
impl CreateSetupIntentMandateDataCustomerAcceptanceType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
match self {
Offline => "offline",
Online => "online",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentMandateDataCustomerAcceptanceType::*;
match s {
"offline" => Ok(Offline),
"online" => Ok(Online),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentMandateDataCustomerAcceptanceType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentMandateDataCustomerAcceptanceType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentMandateDataCustomerAcceptanceType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodData {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<PaymentMethodParam>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub affirm: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub afterpay_clearpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alipay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_redisplay: Option<CreateSetupIntentPaymentMethodDataAllowRedisplay>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alma: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub au_becs_debit: Option<CreateSetupIntentPaymentMethodDataAuBecsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<CreateSetupIntentPaymentMethodDataBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub bancontact: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub billie: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_details: Option<BillingDetailsInnerParams>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub blik: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub boleto: Option<CreateSetupIntentPaymentMethodDataBoleto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub cashapp: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub crypto: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub customer_balance: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub eps: Option<CreateSetupIntentPaymentMethodDataEps>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fpx: Option<CreateSetupIntentPaymentMethodDataFpx>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub giropay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub grabpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ideal: Option<CreateSetupIntentPaymentMethodDataIdeal>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub interac_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kakao_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<CreateSetupIntentPaymentMethodDataKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub konbini: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kr_card: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub link: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mb_way: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mobilepay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub multibanco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub naver_pay: Option<CreateSetupIntentPaymentMethodDataNaverPay>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nz_bank_account: Option<CreateSetupIntentPaymentMethodDataNzBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub oxxo: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub p24: Option<CreateSetupIntentPaymentMethodDataP24>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pay_by_bank: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub payco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paynow: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paypal: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<CreateSetupIntentPaymentMethodDataPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pix: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub promptpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub radar_options: Option<RadarOptionsWithHiddenOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub revolut_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub samsung_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub satispay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<CreateSetupIntentPaymentMethodDataSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort: Option<CreateSetupIntentPaymentMethodDataSofort>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub swish: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub twint: Option<miniserde::json::Value>,
#[serde(rename = "type")]
pub type_: CreateSetupIntentPaymentMethodDataType,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<CreateSetupIntentPaymentMethodDataUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<CreateSetupIntentPaymentMethodDataUsBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub wechat_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub zip: Option<miniserde::json::Value>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodData {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodData").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodData {
pub fn new(type_: impl Into<CreateSetupIntentPaymentMethodDataType>) -> Self {
Self {
acss_debit: None,
affirm: None,
afterpay_clearpay: None,
alipay: None,
allow_redisplay: None,
alma: None,
amazon_pay: None,
au_becs_debit: None,
bacs_debit: None,
bancontact: None,
billie: None,
billing_details: None,
blik: None,
boleto: None,
cashapp: None,
crypto: None,
customer_balance: None,
eps: None,
fpx: None,
giropay: None,
grabpay: None,
ideal: None,
interac_present: None,
kakao_pay: None,
klarna: None,
konbini: None,
kr_card: None,
link: None,
mb_way: None,
metadata: None,
mobilepay: None,
multibanco: None,
naver_pay: None,
nz_bank_account: None,
oxxo: None,
p24: None,
pay_by_bank: None,
payco: None,
paynow: None,
paypal: None,
payto: None,
pix: None,
promptpay: None,
radar_options: None,
revolut_pay: None,
samsung_pay: None,
satispay: None,
sepa_debit: None,
sofort: None,
swish: None,
twint: None,
type_: type_.into(),
upi: None,
us_bank_account: None,
wechat_pay: None,
zip: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataAllowRedisplay {
Always,
Limited,
Unspecified,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataAllowRedisplay {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
match self {
Always => "always",
Limited => "limited",
Unspecified => "unspecified",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataAllowRedisplay {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataAllowRedisplay::*;
match s {
"always" => Ok(Always),
"limited" => Ok(Limited),
"unspecified" => Ok(Unspecified),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataAllowRedisplay"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataAllowRedisplay))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataAllowRedisplay {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataAllowRedisplay {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit {
pub account_number: String,
pub bsb_number: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataAuBecsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataAuBecsDebit {
pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_code: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataBacsDebit {
pub fn new() -> Self {
Self { account_number: None, sort_code: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataBoleto {
pub tax_id: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataBoleto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataBoleto {
pub fn new(tax_id: impl Into<String>) -> Self {
Self { tax_id: tax_id.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataEps {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<CreateSetupIntentPaymentMethodDataEpsBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEps {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataEps {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataEps {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataEpsBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataEpsBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataEpsBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataEpsBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataFpx {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type: Option<CreateSetupIntentPaymentMethodDataFpxAccountHolderType>,
pub bank: CreateSetupIntentPaymentMethodDataFpxBank,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpx {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataFpx {
pub fn new(bank: impl Into<CreateSetupIntentPaymentMethodDataFpxBank>) -> Self {
Self { account_holder_type: None, bank: bank.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataFpxAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataFpxAccountHolderType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(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,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataFpxBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataFpxBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataFpxBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataFpxBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataIdeal {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<CreateSetupIntentPaymentMethodDataIdealBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdeal {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataIdeal {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataIdeal {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataIdealBank {
AbnAmro,
Adyen,
AsnBank,
Bunq,
Buut,
Finom,
Handelsbanken,
Ing,
Knab,
Mollie,
Moneyou,
N26,
Nn,
Rabobank,
Regiobank,
Revolut,
SnsBank,
TriodosBank,
VanLanschot,
Yoursafe,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataIdealBank {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataIdealBank::*;
match self {
AbnAmro => "abn_amro",
Adyen => "adyen",
AsnBank => "asn_bank",
Bunq => "bunq",
Buut => "buut",
Finom => "finom",
Handelsbanken => "handelsbanken",
Ing => "ing",
Knab => "knab",
Mollie => "mollie",
Moneyou => "moneyou",
N26 => "n26",
Nn => "nn",
Rabobank => "rabobank",
Regiobank => "regiobank",
Revolut => "revolut",
SnsBank => "sns_bank",
TriodosBank => "triodos_bank",
VanLanschot => "van_lanschot",
Yoursafe => "yoursafe",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataIdealBank::*;
match s {
"abn_amro" => Ok(AbnAmro),
"adyen" => Ok(Adyen),
"asn_bank" => Ok(AsnBank),
"bunq" => Ok(Bunq),
"buut" => Ok(Buut),
"finom" => Ok(Finom),
"handelsbanken" => Ok(Handelsbanken),
"ing" => Ok(Ing),
"knab" => Ok(Knab),
"mollie" => Ok(Mollie),
"moneyou" => Ok(Moneyou),
"n26" => Ok(N26),
"nn" => Ok(Nn),
"rabobank" => Ok(Rabobank),
"regiobank" => Ok(Regiobank),
"revolut" => Ok(Revolut),
"sns_bank" => Ok(SnsBank),
"triodos_bank" => Ok(TriodosBank),
"van_lanschot" => Ok(VanLanschot),
"yoursafe" => Ok(Yoursafe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataIdealBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataIdealBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataIdealBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub dob: Option<DateOfBirth>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataKlarna {
pub fn new() -> Self {
Self { dob: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataNaverPay {
#[serde(skip_serializing_if = "Option::is_none")]
pub funding: Option<CreateSetupIntentPaymentMethodDataNaverPayFunding>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataNaverPay {
pub fn new() -> Self {
Self { funding: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataNaverPay {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataNaverPayFunding {
Card,
Points,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataNaverPayFunding {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
match self {
Card => "card",
Points => "points",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataNaverPayFunding {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataNaverPayFunding::*;
match s {
"card" => Ok(Card),
"points" => Ok(Points),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataNaverPayFunding"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataNaverPayFunding))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataNaverPayFunding {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataNaverPayFunding {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataNzBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_name: Option<String>,
pub account_number: String,
pub bank_code: String,
pub branch_code: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
pub suffix: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataNzBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataNzBankAccount {
pub fn new(
account_number: impl Into<String>,
bank_code: impl Into<String>,
branch_code: impl Into<String>,
suffix: impl Into<String>,
) -> Self {
Self {
account_holder_name: None,
account_number: account_number.into(),
bank_code: bank_code.into(),
branch_code: branch_code.into(),
reference: None,
suffix: suffix.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataP24 {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<CreateSetupIntentPaymentMethodDataP24Bank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24 {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataP24 {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataP24 {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Velobank,
VolkswagenBank,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataP24Bank {
pub fn as_str(&self) -> &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",
Velobank => "velobank",
VolkswagenBank => "volkswagen_bank",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
"velobank" => Ok(Velobank),
"volkswagen_bank" => Ok(VolkswagenBank),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataP24Bank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataP24Bank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataP24Bank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bsb_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pay_id: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataPayto {
pub fn new() -> Self {
Self { account_number: None, bsb_number: None, pay_id: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataSepaDebit {
pub iban: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataSepaDebit {
pub fn new(iban: impl Into<String>) -> Self {
Self { iban: iban.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataSofort {
pub country: CreateSetupIntentPaymentMethodDataSofortCountry,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofort {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataSofort {
pub fn new(country: impl Into<CreateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
Self { country: country.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataSofortCountry {
At,
Be,
De,
Es,
It,
Nl,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataSofortCountry {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataSofortCountry::*;
match self {
At => "AT",
Be => "BE",
De => "DE",
Es => "ES",
It => "IT",
Nl => "NL",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataSofortCountry::*;
match s {
"AT" => Ok(At),
"BE" => Ok(Be),
"DE" => Ok(De),
"ES" => Ok(Es),
"IT" => Ok(It),
"NL" => Ok(Nl),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataSofortCountry"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataSofortCountry))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataSofortCountry {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataType {
AcssDebit,
Affirm,
AfterpayClearpay,
Alipay,
Alma,
AmazonPay,
AuBecsDebit,
BacsDebit,
Bancontact,
Billie,
Blik,
Boleto,
Cashapp,
Crypto,
CustomerBalance,
Eps,
Fpx,
Giropay,
Grabpay,
Ideal,
KakaoPay,
Klarna,
Konbini,
KrCard,
Link,
MbWay,
Mobilepay,
Multibanco,
NaverPay,
NzBankAccount,
Oxxo,
P24,
PayByBank,
Payco,
Paynow,
Paypal,
Payto,
Pix,
Promptpay,
RevolutPay,
SamsungPay,
Satispay,
SepaDebit,
Sofort,
Swish,
Twint,
Upi,
UsBankAccount,
WechatPay,
Zip,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataType::*;
match self {
AcssDebit => "acss_debit",
Affirm => "affirm",
AfterpayClearpay => "afterpay_clearpay",
Alipay => "alipay",
Alma => "alma",
AmazonPay => "amazon_pay",
AuBecsDebit => "au_becs_debit",
BacsDebit => "bacs_debit",
Bancontact => "bancontact",
Billie => "billie",
Blik => "blik",
Boleto => "boleto",
Cashapp => "cashapp",
Crypto => "crypto",
CustomerBalance => "customer_balance",
Eps => "eps",
Fpx => "fpx",
Giropay => "giropay",
Grabpay => "grabpay",
Ideal => "ideal",
KakaoPay => "kakao_pay",
Klarna => "klarna",
Konbini => "konbini",
KrCard => "kr_card",
Link => "link",
MbWay => "mb_way",
Mobilepay => "mobilepay",
Multibanco => "multibanco",
NaverPay => "naver_pay",
NzBankAccount => "nz_bank_account",
Oxxo => "oxxo",
P24 => "p24",
PayByBank => "pay_by_bank",
Payco => "payco",
Paynow => "paynow",
Paypal => "paypal",
Payto => "payto",
Pix => "pix",
Promptpay => "promptpay",
RevolutPay => "revolut_pay",
SamsungPay => "samsung_pay",
Satispay => "satispay",
SepaDebit => "sepa_debit",
Sofort => "sofort",
Swish => "swish",
Twint => "twint",
Upi => "upi",
UsBankAccount => "us_bank_account",
WechatPay => "wechat_pay",
Zip => "zip",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataType::*;
match s {
"acss_debit" => Ok(AcssDebit),
"affirm" => Ok(Affirm),
"afterpay_clearpay" => Ok(AfterpayClearpay),
"alipay" => Ok(Alipay),
"alma" => Ok(Alma),
"amazon_pay" => Ok(AmazonPay),
"au_becs_debit" => Ok(AuBecsDebit),
"bacs_debit" => Ok(BacsDebit),
"bancontact" => Ok(Bancontact),
"billie" => Ok(Billie),
"blik" => Ok(Blik),
"boleto" => Ok(Boleto),
"cashapp" => Ok(Cashapp),
"crypto" => Ok(Crypto),
"customer_balance" => Ok(CustomerBalance),
"eps" => Ok(Eps),
"fpx" => Ok(Fpx),
"giropay" => Ok(Giropay),
"grabpay" => Ok(Grabpay),
"ideal" => Ok(Ideal),
"kakao_pay" => Ok(KakaoPay),
"klarna" => Ok(Klarna),
"konbini" => Ok(Konbini),
"kr_card" => Ok(KrCard),
"link" => Ok(Link),
"mb_way" => Ok(MbWay),
"mobilepay" => Ok(Mobilepay),
"multibanco" => Ok(Multibanco),
"naver_pay" => Ok(NaverPay),
"nz_bank_account" => Ok(NzBankAccount),
"oxxo" => Ok(Oxxo),
"p24" => Ok(P24),
"pay_by_bank" => Ok(PayByBank),
"payco" => Ok(Payco),
"paynow" => Ok(Paynow),
"paypal" => Ok(Paypal),
"payto" => Ok(Payto),
"pix" => Ok(Pix),
"promptpay" => Ok(Promptpay),
"revolut_pay" => Ok(RevolutPay),
"samsung_pay" => Ok(SamsungPay),
"satispay" => Ok(Satispay),
"sepa_debit" => Ok(SepaDebit),
"sofort" => Ok(Sofort),
"swish" => Ok(Swish),
"twint" => Ok(Twint),
"upi" => Ok(Upi),
"us_bank_account" => Ok(UsBankAccount),
"wechat_pay" => Ok(WechatPay),
"zip" => Ok(Zip),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodDataUpiMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataUpi {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for CreateSetupIntentPaymentMethodDataUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodDataUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type:
Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_type: Option<CreateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_number: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodDataUsBankAccount {
pub fn new() -> Self {
Self {
account_holder_type: None,
account_number: None,
account_type: None,
financial_connections_account: None,
routing_number: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodDataUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
Checking,
Savings,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodDataUsBankAccountAccountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodDataUsBankAccountAccountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<CreateSetupIntentPaymentMethodOptionsAcssDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<CreateSetupIntentPaymentMethodOptionsBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card: Option<CreateSetupIntentPaymentMethodOptionsCard>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub card_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<CreateSetupIntentPaymentMethodOptionsKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<SetupIntentPaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paypal: Option<PaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<CreateSetupIntentPaymentMethodOptionsPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<CreateSetupIntentPaymentMethodOptionsSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<CreateSetupIntentPaymentMethodOptionsUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccount>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptions").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptions {
pub fn new() -> Self {
Self {
acss_debit: None,
amazon_pay: None,
bacs_debit: None,
card: None,
card_present: None,
klarna: None,
link: None,
paypal: None,
payto: None,
sepa_debit: None,
upi: None,
us_bank_account: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebit {
pub fn new() -> Self {
Self { currency: None, mandate_options: None, verification_method: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
Cad,
Usd,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match self {
Cad => "cad",
Usd => "usd",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match s {
"cad" => Ok(Cad),
"usd" => Ok(Usd),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_mandate_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default_for:
Option<Vec<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_type:
Option<CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
pub fn new() -> Self {
Self {
custom_mandate_url: None,
default_for: None,
interval_description: None,
payment_schedule: None,
transaction_type: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
Invoice,
Subscription,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match self {
Invoice => "invoice",
Subscription => "subscription",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match s {
"invoice" => Ok(Invoice),
"subscription" => Ok(Subscription),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
Combined,
Interval,
Sporadic,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match self {
Combined => "combined",
Interval => "interval",
Sporadic => "sporadic",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match s {
"combined" => Ok(Combined),
"interval" => Ok(Interval),
"sporadic" => Ok(Sporadic),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
Business,
Personal,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match self {
Business => "business",
Personal => "personal",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match s {
"business" => Ok(Business),
"personal" => Ok(Personal),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsBacsDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsCardMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub moto: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network: Option<CreateSetupIntentPaymentMethodOptionsCardNetwork>,
#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Option<CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
#[serde(skip_serializing_if = "Option::is_none")]
pub three_d_secure: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCard {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsCard {
pub fn new() -> Self {
Self {
mandate_options: None,
moto: None,
network: None,
request_three_d_secure: None,
three_d_secure: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsCard {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
pub amount: i64,
pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
pub currency: stripe_types::Currency,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
pub reference: String,
pub start_date: stripe_types::Timestamp,
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_types:
Option<Vec<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsCardMandateOptions {
pub fn new(
amount: impl Into<i64>,
amount_type: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
currency: impl Into<stripe_types::Currency>,
interval: impl Into<CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
reference: impl Into<String>,
start_date: impl Into<stripe_types::Timestamp>,
) -> Self {
Self {
amount: amount.into(),
amount_type: amount_type.into(),
currency: currency.into(),
description: None,
end_date: None,
interval: interval.into(),
interval_count: None,
reference: reference.into(),
start_date: start_date.into(),
supported_types: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
Day,
Month,
Sporadic,
Week,
Year,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match self {
Day => "day",
Month => "month",
Sporadic => "sporadic",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"sporadic" => Ok(Sporadic),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
India,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match self {
India => "india",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match s {
"india" => Ok(India),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork {
Amex,
CartesBancaires,
Diners,
Discover,
EftposAu,
Girocard,
Interac,
Jcb,
Link,
Mastercard,
Unionpay,
Unknown,
Visa,
_Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardNetwork {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
match self {
Amex => "amex",
CartesBancaires => "cartes_bancaires",
Diners => "diners",
Discover => "discover",
EftposAu => "eftpos_au",
Girocard => "girocard",
Interac => "interac",
Jcb => "jcb",
Link => "link",
Mastercard => "mastercard",
Unionpay => "unionpay",
Unknown => "unknown",
Visa => "visa",
_Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardNetwork::*;
match s {
"amex" => Ok(Amex),
"cartes_bancaires" => Ok(CartesBancaires),
"diners" => Ok(Diners),
"discover" => Ok(Discover),
"eftpos_au" => Ok(EftposAu),
"girocard" => Ok(Girocard),
"interac" => Ok(Interac),
"jcb" => Ok(Jcb),
"link" => Ok(Link),
"mastercard" => Ok(Mastercard),
"unionpay" => Ok(Unionpay),
"unknown" => Ok(Unknown),
"visa" => Ok(Visa),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardNetwork"
);
Ok(_Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardNetwork))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardNetwork {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
Any,
Automatic,
Challenge,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match self {
Any => "any",
Automatic => "automatic",
Challenge => "challenge",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match s {
"any" => Ok(Any),
"automatic" => Ok(Automatic),
"challenge" => Ok(Challenge),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
#[serde(skip_serializing_if = "Option::is_none")]
pub ares_trans_status:
Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cryptogram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub electronic_commerce_indicator:
Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network_options:
Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub requestor_challenge_indicator: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardThreeDSecure")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
pub fn new() -> Self {
Self {
ares_trans_status: None,
cryptogram: None,
electronic_commerce_indicator: None,
network_options: None,
requestor_challenge_indicator: None,
transaction_id: None,
version: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
A,
C,
I,
N,
R,
U,
Y,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match self {
A => "A",
C => "C",
I => "I",
N => "N",
R => "R",
U => "U",
Y => "Y",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match s {
"A" => Ok(A),
"C" => Ok(C),
"I" => Ok(I),
"N" => Ok(N),
"R" => Ok(R),
"U" => Ok(U),
"Y" => Ok(Y),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
V01,
V02,
V05,
V06,
V07,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match self {
V01 => "01",
V02 => "02",
V05 => "05",
V06 => "06",
V07 => "07",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match s {
"01" => Ok(V01),
"02" => Ok(V02),
"05" => Ok(V05),
"06" => Ok(V06),
"07" => Ok(V07),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub cartes_bancaires:
Option<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
pub fn new() -> Self {
Self { cartes_bancaires: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub cb_avalgo:
CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_exemption: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_score: Option<i64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
)
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub fn new(
cb_avalgo: impl Into<CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
) -> Self {
Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
V0,
V1,
V2,
V3,
V4,
A,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match self {
V0 => "0",
V1 => "1",
V2 => "2",
V3 => "3",
V4 => "4",
A => "A",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match s {
"0" => Ok(V0),
"1" => Ok(V1),
"2" => Ok(V2),
"3" => Ok(V3),
"4" => Ok(V4),
"A" => Ok(A),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
V1_0_2,
V2_1_0,
V2_2_0,
V2_3_0,
V2_3_1,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match self {
V1_0_2 => "1.0.2",
V2_1_0 => "2.1.0",
V2_2_0 => "2.2.0",
V2_3_0 => "2.3.0",
V2_3_1 => "2.3.1",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match s {
"1.0.2" => Ok(V1_0_2),
"2.1.0" => Ok(V2_1_0),
"2.2.0" => Ok(V2_2_0),
"2.3.0" => Ok(V2_3_0),
"2.3.1" => Ok(V2_3_1),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<stripe_types::Currency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand: Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_locale: Option<CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscriptions: Option<Vec<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsKlarna {
pub fn new() -> Self {
Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
#[serde(skip_serializing_if = "Option::is_none")]
pub average_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval:
Option<CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval_count: Option<u64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
pub fn new() -> Self {
Self {
average_amount: None,
maximum_amount: None,
minimum_amount: None,
purchase_interval: None,
purchase_interval_count: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
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,
EnMinusRo,
EnMinusSe,
EnMinusUs,
EsMinusEs,
EsMinusUs,
FiMinusFi,
FrMinusBe,
FrMinusCa,
FrMinusCh,
FrMinusFr,
ItMinusCh,
ItMinusIt,
NbMinusNo,
NlMinusBe,
NlMinusNl,
PlMinusPl,
PtMinusPt,
RoMinusRo,
SvMinusFi,
SvMinusSe,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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",
EnMinusRo => "en-RO",
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",
RoMinusRo => "ro-RO",
SvMinusFi => "sv-FI",
SvMinusSe => "sv-SE",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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-RO" => Ok(EnMinusRo),
"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),
"ro-RO" => Ok(RoMinusRo),
"sv-FI" => Ok(SvMinusFi),
"sv-SE" => Ok(SvMinusSe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub interval: CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub next_billing: SubscriptionNextBillingParam,
pub reference: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub fn new(
interval: impl Into<CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
next_billing: impl Into<SubscriptionNextBillingParam>,
reference: impl Into<String>,
) -> Self {
Self {
interval: interval.into(),
interval_count: None,
name: None,
next_billing: next_billing.into(),
reference: reference.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsPayto {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payments_per_period: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purpose: Option<CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
pub fn new() -> Self {
Self {
amount: None,
amount_type: None,
end_date: None,
payment_schedule: None,
payments_per_period: None,
purpose: None,
start_date: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
Adhoc,
Annual,
Daily,
Fortnightly,
Monthly,
Quarterly,
SemiAnnual,
Weekly,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match self {
Adhoc => "adhoc",
Annual => "annual",
Daily => "daily",
Fortnightly => "fortnightly",
Monthly => "monthly",
Quarterly => "quarterly",
SemiAnnual => "semi_annual",
Weekly => "weekly",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match s {
"adhoc" => Ok(Adhoc),
"annual" => Ok(Annual),
"daily" => Ok(Daily),
"fortnightly" => Ok(Fortnightly),
"monthly" => Ok(Monthly),
"quarterly" => Ok(Quarterly),
"semi_annual" => Ok(SemiAnnual),
"weekly" => Ok(Weekly),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
DependantSupport,
Government,
Loan,
Mortgage,
Other,
Pension,
Personal,
Retail,
Salary,
Tax,
Utility,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match self {
DependantSupport => "dependant_support",
Government => "government",
Loan => "loan",
Mortgage => "mortgage",
Other => "other",
Pension => "pension",
Personal => "personal",
Retail => "retail",
Salary => "salary",
Tax => "tax",
Utility => "utility",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match s {
"dependant_support" => Ok(DependantSupport),
"government" => Ok(Government),
"loan" => Ok(Loan),
"mortgage" => Ok(Mortgage),
"other" => Ok(Other),
"pension" => Ok(Pension),
"personal" => Ok(Personal),
"retail" => Ok(Retail),
"salary" => Ok(Salary),
"tax" => Ok(Tax),
"utility" => Ok(Utility),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsSepaDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub reference_prefix: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
pub fn new() -> Self {
Self { reference_prefix: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUpiMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUpi {
pub fn new() -> Self {
Self { mandate_options: None, setup_future_usage: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
None,
OffSession,
OnSession,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match self {
None => "none",
OffSession => "off_session",
OnSession => "on_session",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match s {
"none" => Ok(None),
"off_session" => Ok(OffSession),
"on_session" => Ok(OnSession),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections:
Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccount").finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccount {
pub fn new() -> Self {
Self {
financial_connections: None,
mandate_options: None,
networks: None,
verification_method: None,
}
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
#[serde(skip_serializing_if = "Option::is_none")]
pub filters:
Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
#[serde(skip_serializing_if = "Option::is_none")]
pub permissions: Option<
Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prefetch:
Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub return_url: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
pub fn new() -> Self {
Self { filters: None, permissions: None, prefetch: None, return_url: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_subcategories: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
)
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
pub fn new() -> Self {
Self { account_subcategories: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
{
Checking,
Savings,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
Balances,
Ownership,
PaymentMethod,
Transactions,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match self {
Balances => "balances",
Ownership => "ownership",
PaymentMethod => "payment_method",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"payment_method" => Ok(PaymentMethod),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
Balances,
Ownership,
Transactions,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match self {
Balances => "balances",
Ownership => "ownership",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub collection_method:
Option<CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
pub fn new() -> Self {
Self { collection_method: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
Paper,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match self {
Paper => "paper",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match s {
"paper" => Ok(Paper),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<Vec<CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
.finish_non_exhaustive()
}
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
pub fn new() -> Self {
Self { requested: None }
}
}
impl Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
Ach,
UsDomesticWire,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match self {
Ach => "ach",
UsDomesticWire => "us_domestic_wire",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match s {
"ach" => Ok(Ach),
"us_domestic_wire" => Ok(UsDomesticWire),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
pub fn as_str(&self) -> &str {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntentSingleUse {
pub amount: i64,
pub currency: stripe_types::Currency,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentSingleUse {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntentSingleUse").finish_non_exhaustive()
}
}
impl CreateSetupIntentSingleUse {
pub fn new(amount: impl Into<i64>, currency: impl Into<stripe_types::Currency>) -> Self {
Self { amount: amount.into(), currency: currency.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CreateSetupIntentUsage {
OffSession,
OnSession,
Unknown(String),
}
impl CreateSetupIntentUsage {
pub fn as_str(&self) -> &str {
use CreateSetupIntentUsage::*;
match self {
OffSession => "off_session",
OnSession => "on_session",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for CreateSetupIntentUsage {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use CreateSetupIntentUsage::*;
match s {
"off_session" => Ok(OffSession),
"on_session" => Ok(OnSession),
v => {
tracing::warn!("Unknown value '{}' for enum '{}'", v, "CreateSetupIntentUsage");
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for CreateSetupIntentUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CreateSetupIntentUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntentUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(CreateSetupIntentUsage)).finish_non_exhaustive()
}
}
impl serde::Serialize for CreateSetupIntentUsage {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CreateSetupIntentUsage {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CreateSetupIntent {
inner: CreateSetupIntentBuilder,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CreateSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CreateSetupIntent").finish_non_exhaustive()
}
}
impl CreateSetupIntent {
pub fn new() -> Self {
Self { inner: CreateSetupIntentBuilder::new() }
}
pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
self.inner.attach_to_self = Some(attach_to_self.into());
self
}
pub fn automatic_payment_methods(
mut self,
automatic_payment_methods: impl Into<CreateSetupIntentAutomaticPaymentMethods>,
) -> Self {
self.inner.automatic_payment_methods = Some(automatic_payment_methods.into());
self
}
pub fn confirm(mut self, confirm: impl Into<bool>) -> Self {
self.inner.confirm = Some(confirm.into());
self
}
pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
self.inner.confirmation_token = Some(confirmation_token.into());
self
}
pub fn customer(mut self, customer: impl Into<String>) -> Self {
self.inner.customer = Some(customer.into());
self
}
pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
self.inner.customer_account = Some(customer_account.into());
self
}
pub fn description(mut self, description: impl Into<String>) -> Self {
self.inner.description = Some(description.into());
self
}
pub fn excluded_payment_method_types(
mut self,
excluded_payment_method_types: impl Into<
Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
>,
) -> Self {
self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
pub fn flow_directions(
mut self,
flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
) -> Self {
self.inner.flow_directions = Some(flow_directions.into());
self
}
pub fn mandate_data(mut self, mandate_data: impl Into<CreateSetupIntentMandateData>) -> Self {
self.inner.mandate_data = Some(mandate_data.into());
self
}
pub fn metadata(
mut self,
metadata: impl Into<std::collections::HashMap<String, String>>,
) -> Self {
self.inner.metadata = Some(metadata.into());
self
}
pub fn on_behalf_of(mut self, on_behalf_of: impl Into<String>) -> Self {
self.inner.on_behalf_of = Some(on_behalf_of.into());
self
}
pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
self.inner.payment_method = Some(payment_method.into());
self
}
pub fn payment_method_configuration(
mut self,
payment_method_configuration: impl Into<String>,
) -> Self {
self.inner.payment_method_configuration = Some(payment_method_configuration.into());
self
}
pub fn payment_method_data(
mut self,
payment_method_data: impl Into<CreateSetupIntentPaymentMethodData>,
) -> Self {
self.inner.payment_method_data = Some(payment_method_data.into());
self
}
pub fn payment_method_options(
mut self,
payment_method_options: impl Into<CreateSetupIntentPaymentMethodOptions>,
) -> Self {
self.inner.payment_method_options = Some(payment_method_options.into());
self
}
pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
self.inner.payment_method_types = Some(payment_method_types.into());
self
}
pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
self.inner.return_url = Some(return_url.into());
self
}
pub fn single_use(mut self, single_use: impl Into<CreateSetupIntentSingleUse>) -> Self {
self.inner.single_use = Some(single_use.into());
self
}
pub fn usage(mut self, usage: impl Into<CreateSetupIntentUsage>) -> Self {
self.inner.usage = Some(usage.into());
self
}
pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
self
}
}
impl Default for CreateSetupIntent {
fn default() -> Self {
Self::new()
}
}
impl CreateSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for CreateSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
RequestBuilder::new(StripeMethod::Post, "/setup_intents").form(&self.inner)
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct UpdateSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
attach_to_self: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
customer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
customer_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
excluded_payment_method_types:
Option<Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
flow_directions: Option<Vec<stripe_shared::SetupIntentFlowDirections>>,
#[serde(skip_serializing_if = "Option::is_none")]
metadata: Option<std::collections::HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_configuration: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_data: Option<UpdateSetupIntentPaymentMethodData>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_options: Option<UpdateSetupIntentPaymentMethodOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_types: Option<Vec<String>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentBuilder").finish_non_exhaustive()
}
}
impl UpdateSetupIntentBuilder {
fn new() -> Self {
Self {
attach_to_self: None,
customer: None,
customer_account: None,
description: None,
excluded_payment_method_types: None,
expand: None,
flow_directions: None,
metadata: None,
payment_method: None,
payment_method_configuration: None,
payment_method_data: None,
payment_method_options: None,
payment_method_types: None,
}
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodData {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<PaymentMethodParam>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub affirm: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub afterpay_clearpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alipay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_redisplay: Option<UpdateSetupIntentPaymentMethodDataAllowRedisplay>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alma: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub au_becs_debit: Option<UpdateSetupIntentPaymentMethodDataAuBecsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<UpdateSetupIntentPaymentMethodDataBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub bancontact: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub billie: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_details: Option<BillingDetailsInnerParams>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub blik: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub boleto: Option<UpdateSetupIntentPaymentMethodDataBoleto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub cashapp: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub crypto: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub customer_balance: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub eps: Option<UpdateSetupIntentPaymentMethodDataEps>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fpx: Option<UpdateSetupIntentPaymentMethodDataFpx>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub giropay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub grabpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ideal: Option<UpdateSetupIntentPaymentMethodDataIdeal>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub interac_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kakao_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<UpdateSetupIntentPaymentMethodDataKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub konbini: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kr_card: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub link: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mb_way: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mobilepay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub multibanco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub naver_pay: Option<UpdateSetupIntentPaymentMethodDataNaverPay>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nz_bank_account: Option<UpdateSetupIntentPaymentMethodDataNzBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub oxxo: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub p24: Option<UpdateSetupIntentPaymentMethodDataP24>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pay_by_bank: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub payco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paynow: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paypal: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<UpdateSetupIntentPaymentMethodDataPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pix: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub promptpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub radar_options: Option<RadarOptionsWithHiddenOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub revolut_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub samsung_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub satispay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<UpdateSetupIntentPaymentMethodDataSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort: Option<UpdateSetupIntentPaymentMethodDataSofort>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub swish: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub twint: Option<miniserde::json::Value>,
#[serde(rename = "type")]
pub type_: UpdateSetupIntentPaymentMethodDataType,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<UpdateSetupIntentPaymentMethodDataUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<UpdateSetupIntentPaymentMethodDataUsBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub wechat_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub zip: Option<miniserde::json::Value>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodData {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodData").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodData {
pub fn new(type_: impl Into<UpdateSetupIntentPaymentMethodDataType>) -> Self {
Self {
acss_debit: None,
affirm: None,
afterpay_clearpay: None,
alipay: None,
allow_redisplay: None,
alma: None,
amazon_pay: None,
au_becs_debit: None,
bacs_debit: None,
bancontact: None,
billie: None,
billing_details: None,
blik: None,
boleto: None,
cashapp: None,
crypto: None,
customer_balance: None,
eps: None,
fpx: None,
giropay: None,
grabpay: None,
ideal: None,
interac_present: None,
kakao_pay: None,
klarna: None,
konbini: None,
kr_card: None,
link: None,
mb_way: None,
metadata: None,
mobilepay: None,
multibanco: None,
naver_pay: None,
nz_bank_account: None,
oxxo: None,
p24: None,
pay_by_bank: None,
payco: None,
paynow: None,
paypal: None,
payto: None,
pix: None,
promptpay: None,
radar_options: None,
revolut_pay: None,
samsung_pay: None,
satispay: None,
sepa_debit: None,
sofort: None,
swish: None,
twint: None,
type_: type_.into(),
upi: None,
us_bank_account: None,
wechat_pay: None,
zip: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataAllowRedisplay {
Always,
Limited,
Unspecified,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataAllowRedisplay {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
match self {
Always => "always",
Limited => "limited",
Unspecified => "unspecified",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataAllowRedisplay::*;
match s {
"always" => Ok(Always),
"limited" => Ok(Limited),
"unspecified" => Ok(Unspecified),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataAllowRedisplay"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataAllowRedisplay))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataAllowRedisplay {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit {
pub account_number: String,
pub bsb_number: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataAuBecsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataAuBecsDebit {
pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_code: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataBacsDebit {
pub fn new() -> Self {
Self { account_number: None, sort_code: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataBoleto {
pub tax_id: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataBoleto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataBoleto {
pub fn new(tax_id: impl Into<String>) -> Self {
Self { tax_id: tax_id.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataEps {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<UpdateSetupIntentPaymentMethodDataEpsBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEps {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataEps {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataEps {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataEpsBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataEpsBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataEpsBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataEpsBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataFpx {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type: Option<UpdateSetupIntentPaymentMethodDataFpxAccountHolderType>,
pub bank: UpdateSetupIntentPaymentMethodDataFpxBank,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpx {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataFpx {
pub fn new(bank: impl Into<UpdateSetupIntentPaymentMethodDataFpxBank>) -> Self {
Self { account_holder_type: None, bank: bank.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataFpxAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataFpxAccountHolderType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(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,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataFpxBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataFpxBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataFpxBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataFpxBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataIdeal {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<UpdateSetupIntentPaymentMethodDataIdealBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdeal {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataIdeal {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataIdeal {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataIdealBank {
AbnAmro,
Adyen,
AsnBank,
Bunq,
Buut,
Finom,
Handelsbanken,
Ing,
Knab,
Mollie,
Moneyou,
N26,
Nn,
Rabobank,
Regiobank,
Revolut,
SnsBank,
TriodosBank,
VanLanschot,
Yoursafe,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataIdealBank {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataIdealBank::*;
match self {
AbnAmro => "abn_amro",
Adyen => "adyen",
AsnBank => "asn_bank",
Bunq => "bunq",
Buut => "buut",
Finom => "finom",
Handelsbanken => "handelsbanken",
Ing => "ing",
Knab => "knab",
Mollie => "mollie",
Moneyou => "moneyou",
N26 => "n26",
Nn => "nn",
Rabobank => "rabobank",
Regiobank => "regiobank",
Revolut => "revolut",
SnsBank => "sns_bank",
TriodosBank => "triodos_bank",
VanLanschot => "van_lanschot",
Yoursafe => "yoursafe",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataIdealBank::*;
match s {
"abn_amro" => Ok(AbnAmro),
"adyen" => Ok(Adyen),
"asn_bank" => Ok(AsnBank),
"bunq" => Ok(Bunq),
"buut" => Ok(Buut),
"finom" => Ok(Finom),
"handelsbanken" => Ok(Handelsbanken),
"ing" => Ok(Ing),
"knab" => Ok(Knab),
"mollie" => Ok(Mollie),
"moneyou" => Ok(Moneyou),
"n26" => Ok(N26),
"nn" => Ok(Nn),
"rabobank" => Ok(Rabobank),
"regiobank" => Ok(Regiobank),
"revolut" => Ok(Revolut),
"sns_bank" => Ok(SnsBank),
"triodos_bank" => Ok(TriodosBank),
"van_lanschot" => Ok(VanLanschot),
"yoursafe" => Ok(Yoursafe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataIdealBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataIdealBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataIdealBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub dob: Option<DateOfBirth>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataKlarna {
pub fn new() -> Self {
Self { dob: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataNaverPay {
#[serde(skip_serializing_if = "Option::is_none")]
pub funding: Option<UpdateSetupIntentPaymentMethodDataNaverPayFunding>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataNaverPay {
pub fn new() -> Self {
Self { funding: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataNaverPay {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataNaverPayFunding {
Card,
Points,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataNaverPayFunding {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
match self {
Card => "card",
Points => "points",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataNaverPayFunding::*;
match s {
"card" => Ok(Card),
"points" => Ok(Points),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataNaverPayFunding"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataNaverPayFunding))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataNaverPayFunding {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataNzBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_name: Option<String>,
pub account_number: String,
pub bank_code: String,
pub branch_code: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
pub suffix: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataNzBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataNzBankAccount {
pub fn new(
account_number: impl Into<String>,
bank_code: impl Into<String>,
branch_code: impl Into<String>,
suffix: impl Into<String>,
) -> Self {
Self {
account_holder_name: None,
account_number: account_number.into(),
bank_code: bank_code.into(),
branch_code: branch_code.into(),
reference: None,
suffix: suffix.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataP24 {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<UpdateSetupIntentPaymentMethodDataP24Bank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24 {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataP24 {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataP24 {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Velobank,
VolkswagenBank,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataP24Bank {
pub fn as_str(&self) -> &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",
Velobank => "velobank",
VolkswagenBank => "volkswagen_bank",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
"velobank" => Ok(Velobank),
"volkswagen_bank" => Ok(VolkswagenBank),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataP24Bank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataP24Bank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataP24Bank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bsb_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pay_id: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataPayto {
pub fn new() -> Self {
Self { account_number: None, bsb_number: None, pay_id: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataSepaDebit {
pub iban: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataSepaDebit {
pub fn new(iban: impl Into<String>) -> Self {
Self { iban: iban.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataSofort {
pub country: UpdateSetupIntentPaymentMethodDataSofortCountry,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofort {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataSofort {
pub fn new(country: impl Into<UpdateSetupIntentPaymentMethodDataSofortCountry>) -> Self {
Self { country: country.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataSofortCountry {
At,
Be,
De,
Es,
It,
Nl,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataSofortCountry {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
match self {
At => "AT",
Be => "BE",
De => "DE",
Es => "ES",
It => "IT",
Nl => "NL",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataSofortCountry::*;
match s {
"AT" => Ok(At),
"BE" => Ok(Be),
"DE" => Ok(De),
"ES" => Ok(Es),
"IT" => Ok(It),
"NL" => Ok(Nl),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataSofortCountry"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataSofortCountry))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataSofortCountry {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataType {
AcssDebit,
Affirm,
AfterpayClearpay,
Alipay,
Alma,
AmazonPay,
AuBecsDebit,
BacsDebit,
Bancontact,
Billie,
Blik,
Boleto,
Cashapp,
Crypto,
CustomerBalance,
Eps,
Fpx,
Giropay,
Grabpay,
Ideal,
KakaoPay,
Klarna,
Konbini,
KrCard,
Link,
MbWay,
Mobilepay,
Multibanco,
NaverPay,
NzBankAccount,
Oxxo,
P24,
PayByBank,
Payco,
Paynow,
Paypal,
Payto,
Pix,
Promptpay,
RevolutPay,
SamsungPay,
Satispay,
SepaDebit,
Sofort,
Swish,
Twint,
Upi,
UsBankAccount,
WechatPay,
Zip,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataType::*;
match self {
AcssDebit => "acss_debit",
Affirm => "affirm",
AfterpayClearpay => "afterpay_clearpay",
Alipay => "alipay",
Alma => "alma",
AmazonPay => "amazon_pay",
AuBecsDebit => "au_becs_debit",
BacsDebit => "bacs_debit",
Bancontact => "bancontact",
Billie => "billie",
Blik => "blik",
Boleto => "boleto",
Cashapp => "cashapp",
Crypto => "crypto",
CustomerBalance => "customer_balance",
Eps => "eps",
Fpx => "fpx",
Giropay => "giropay",
Grabpay => "grabpay",
Ideal => "ideal",
KakaoPay => "kakao_pay",
Klarna => "klarna",
Konbini => "konbini",
KrCard => "kr_card",
Link => "link",
MbWay => "mb_way",
Mobilepay => "mobilepay",
Multibanco => "multibanco",
NaverPay => "naver_pay",
NzBankAccount => "nz_bank_account",
Oxxo => "oxxo",
P24 => "p24",
PayByBank => "pay_by_bank",
Payco => "payco",
Paynow => "paynow",
Paypal => "paypal",
Payto => "payto",
Pix => "pix",
Promptpay => "promptpay",
RevolutPay => "revolut_pay",
SamsungPay => "samsung_pay",
Satispay => "satispay",
SepaDebit => "sepa_debit",
Sofort => "sofort",
Swish => "swish",
Twint => "twint",
Upi => "upi",
UsBankAccount => "us_bank_account",
WechatPay => "wechat_pay",
Zip => "zip",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataType::*;
match s {
"acss_debit" => Ok(AcssDebit),
"affirm" => Ok(Affirm),
"afterpay_clearpay" => Ok(AfterpayClearpay),
"alipay" => Ok(Alipay),
"alma" => Ok(Alma),
"amazon_pay" => Ok(AmazonPay),
"au_becs_debit" => Ok(AuBecsDebit),
"bacs_debit" => Ok(BacsDebit),
"bancontact" => Ok(Bancontact),
"billie" => Ok(Billie),
"blik" => Ok(Blik),
"boleto" => Ok(Boleto),
"cashapp" => Ok(Cashapp),
"crypto" => Ok(Crypto),
"customer_balance" => Ok(CustomerBalance),
"eps" => Ok(Eps),
"fpx" => Ok(Fpx),
"giropay" => Ok(Giropay),
"grabpay" => Ok(Grabpay),
"ideal" => Ok(Ideal),
"kakao_pay" => Ok(KakaoPay),
"klarna" => Ok(Klarna),
"konbini" => Ok(Konbini),
"kr_card" => Ok(KrCard),
"link" => Ok(Link),
"mb_way" => Ok(MbWay),
"mobilepay" => Ok(Mobilepay),
"multibanco" => Ok(Multibanco),
"naver_pay" => Ok(NaverPay),
"nz_bank_account" => Ok(NzBankAccount),
"oxxo" => Ok(Oxxo),
"p24" => Ok(P24),
"pay_by_bank" => Ok(PayByBank),
"payco" => Ok(Payco),
"paynow" => Ok(Paynow),
"paypal" => Ok(Paypal),
"payto" => Ok(Payto),
"pix" => Ok(Pix),
"promptpay" => Ok(Promptpay),
"revolut_pay" => Ok(RevolutPay),
"samsung_pay" => Ok(SamsungPay),
"satispay" => Ok(Satispay),
"sepa_debit" => Ok(SepaDebit),
"sofort" => Ok(Sofort),
"swish" => Ok(Swish),
"twint" => Ok(Twint),
"upi" => Ok(Upi),
"us_bank_account" => Ok(UsBankAccount),
"wechat_pay" => Ok(WechatPay),
"zip" => Ok(Zip),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodDataUpiMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataUpi {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodDataUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type:
Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_type: Option<UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_number: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodDataUsBankAccount {
pub fn new() -> Self {
Self {
account_holder_type: None,
account_number: None,
account_type: None,
financial_connections_account: None,
routing_number: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodDataUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
Checking,
Savings,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<UpdateSetupIntentPaymentMethodOptionsBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card: Option<UpdateSetupIntentPaymentMethodOptionsCard>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub card_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<UpdateSetupIntentPaymentMethodOptionsKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<SetupIntentPaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paypal: Option<PaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<UpdateSetupIntentPaymentMethodOptionsPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<UpdateSetupIntentPaymentMethodOptionsUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccount>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptions").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptions {
pub fn new() -> Self {
Self {
acss_debit: None,
amazon_pay: None,
bacs_debit: None,
card: None,
card_present: None,
klarna: None,
link: None,
paypal: None,
payto: None,
sepa_debit: None,
upi: None,
us_bank_account: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebit {
pub fn new() -> Self {
Self { currency: None, mandate_options: None, verification_method: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
Cad,
Usd,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match self {
Cad => "cad",
Usd => "usd",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match s {
"cad" => Ok(Cad),
"usd" => Ok(Usd),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_mandate_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default_for:
Option<Vec<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_type:
Option<UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
pub fn new() -> Self {
Self {
custom_mandate_url: None,
default_for: None,
interval_description: None,
payment_schedule: None,
transaction_type: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
Invoice,
Subscription,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match self {
Invoice => "invoice",
Subscription => "subscription",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match s {
"invoice" => Ok(Invoice),
"subscription" => Ok(Subscription),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
Combined,
Interval,
Sporadic,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match self {
Combined => "combined",
Interval => "interval",
Sporadic => "sporadic",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match s {
"combined" => Ok(Combined),
"interval" => Ok(Interval),
"sporadic" => Ok(Sporadic),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
Business,
Personal,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match self {
Business => "business",
Personal => "personal",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match s {
"business" => Ok(Business),
"personal" => Ok(Personal),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsBacsDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsCardMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub moto: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network: Option<UpdateSetupIntentPaymentMethodOptionsCardNetwork>,
#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Option<UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
#[serde(skip_serializing_if = "Option::is_none")]
pub three_d_secure: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCard {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsCard {
pub fn new() -> Self {
Self {
mandate_options: None,
moto: None,
network: None,
request_three_d_secure: None,
three_d_secure: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsCard {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
pub amount: i64,
pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
pub currency: stripe_types::Currency,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
pub reference: String,
pub start_date: stripe_types::Timestamp,
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_types:
Option<Vec<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptions {
pub fn new(
amount: impl Into<i64>,
amount_type: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
currency: impl Into<stripe_types::Currency>,
interval: impl Into<UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
reference: impl Into<String>,
start_date: impl Into<stripe_types::Timestamp>,
) -> Self {
Self {
amount: amount.into(),
amount_type: amount_type.into(),
currency: currency.into(),
description: None,
end_date: None,
interval: interval.into(),
interval_count: None,
reference: reference.into(),
start_date: start_date.into(),
supported_types: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
Day,
Month,
Sporadic,
Week,
Year,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match self {
Day => "day",
Month => "month",
Sporadic => "sporadic",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"sporadic" => Ok(Sporadic),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
India,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match self {
India => "india",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match s {
"india" => Ok(India),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork {
Amex,
CartesBancaires,
Diners,
Discover,
EftposAu,
Girocard,
Interac,
Jcb,
Link,
Mastercard,
Unionpay,
Unknown,
Visa,
_Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardNetwork {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
match self {
Amex => "amex",
CartesBancaires => "cartes_bancaires",
Diners => "diners",
Discover => "discover",
EftposAu => "eftpos_au",
Girocard => "girocard",
Interac => "interac",
Jcb => "jcb",
Link => "link",
Mastercard => "mastercard",
Unionpay => "unionpay",
Unknown => "unknown",
Visa => "visa",
_Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*;
match s {
"amex" => Ok(Amex),
"cartes_bancaires" => Ok(CartesBancaires),
"diners" => Ok(Diners),
"discover" => Ok(Discover),
"eftpos_au" => Ok(EftposAu),
"girocard" => Ok(Girocard),
"interac" => Ok(Interac),
"jcb" => Ok(Jcb),
"link" => Ok(Link),
"mastercard" => Ok(Mastercard),
"unionpay" => Ok(Unionpay),
"unknown" => Ok(Unknown),
"visa" => Ok(Visa),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardNetwork"
);
Ok(_Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardNetwork))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardNetwork {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
Any,
Automatic,
Challenge,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match self {
Any => "any",
Automatic => "automatic",
Challenge => "challenge",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match s {
"any" => Ok(Any),
"automatic" => Ok(Automatic),
"challenge" => Ok(Challenge),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
#[serde(skip_serializing_if = "Option::is_none")]
pub ares_trans_status:
Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cryptogram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub electronic_commerce_indicator:
Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network_options:
Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub requestor_challenge_indicator: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
pub fn new() -> Self {
Self {
ares_trans_status: None,
cryptogram: None,
electronic_commerce_indicator: None,
network_options: None,
requestor_challenge_indicator: None,
transaction_id: None,
version: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
A,
C,
I,
N,
R,
U,
Y,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match self {
A => "A",
C => "C",
I => "I",
N => "N",
R => "R",
U => "U",
Y => "Y",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match s {
"A" => Ok(A),
"C" => Ok(C),
"I" => Ok(I),
"N" => Ok(N),
"R" => Ok(R),
"U" => Ok(U),
"Y" => Ok(Y),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
V01,
V02,
V05,
V06,
V07,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match self {
V01 => "01",
V02 => "02",
V05 => "05",
V06 => "06",
V07 => "07",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match s {
"01" => Ok(V01),
"02" => Ok(V02),
"05" => Ok(V05),
"06" => Ok(V06),
"07" => Ok(V07),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub cartes_bancaires:
Option<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
pub fn new() -> Self {
Self { cartes_bancaires: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub cb_avalgo:
UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_exemption: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_score: Option<i64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
)
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub fn new(
cb_avalgo: impl Into<UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
) -> Self {
Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
V0,
V1,
V2,
V3,
V4,
A,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match self {
V0 => "0",
V1 => "1",
V2 => "2",
V3 => "3",
V4 => "4",
A => "A",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match s {
"0" => Ok(V0),
"1" => Ok(V1),
"2" => Ok(V2),
"3" => Ok(V3),
"4" => Ok(V4),
"A" => Ok(A),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
V1_0_2,
V2_1_0,
V2_2_0,
V2_3_0,
V2_3_1,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match self {
V1_0_2 => "1.0.2",
V2_1_0 => "2.1.0",
V2_2_0 => "2.2.0",
V2_3_0 => "2.3.0",
V2_3_1 => "2.3.1",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match s {
"1.0.2" => Ok(V1_0_2),
"2.1.0" => Ok(V2_1_0),
"2.2.0" => Ok(V2_2_0),
"2.3.0" => Ok(V2_3_0),
"2.3.1" => Ok(V2_3_1),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<stripe_types::Currency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_locale: Option<UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscriptions: Option<Vec<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsKlarna {
pub fn new() -> Self {
Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
#[serde(skip_serializing_if = "Option::is_none")]
pub average_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval:
Option<UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval_count: Option<u64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
pub fn new() -> Self {
Self {
average_amount: None,
maximum_amount: None,
minimum_amount: None,
purchase_interval: None,
purchase_interval_count: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
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,
EnMinusRo,
EnMinusSe,
EnMinusUs,
EsMinusEs,
EsMinusUs,
FiMinusFi,
FrMinusBe,
FrMinusCa,
FrMinusCh,
FrMinusFr,
ItMinusCh,
ItMinusIt,
NbMinusNo,
NlMinusBe,
NlMinusNl,
PlMinusPl,
PtMinusPt,
RoMinusRo,
SvMinusFi,
SvMinusSe,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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",
EnMinusRo => "en-RO",
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",
RoMinusRo => "ro-RO",
SvMinusFi => "sv-FI",
SvMinusSe => "sv-SE",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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-RO" => Ok(EnMinusRo),
"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),
"ro-RO" => Ok(RoMinusRo),
"sv-FI" => Ok(SvMinusFi),
"sv-SE" => Ok(SvMinusSe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub interval: UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub next_billing: SubscriptionNextBillingParam,
pub reference: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub fn new(
interval: impl Into<UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
next_billing: impl Into<SubscriptionNextBillingParam>,
reference: impl Into<String>,
) -> Self {
Self {
interval: interval.into(),
interval_count: None,
name: None,
next_billing: next_billing.into(),
reference: reference.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsPayto {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payments_per_period: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purpose: Option<UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
pub fn new() -> Self {
Self {
amount: None,
amount_type: None,
end_date: None,
payment_schedule: None,
payments_per_period: None,
purpose: None,
start_date: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
Adhoc,
Annual,
Daily,
Fortnightly,
Monthly,
Quarterly,
SemiAnnual,
Weekly,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match self {
Adhoc => "adhoc",
Annual => "annual",
Daily => "daily",
Fortnightly => "fortnightly",
Monthly => "monthly",
Quarterly => "quarterly",
SemiAnnual => "semi_annual",
Weekly => "weekly",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match s {
"adhoc" => Ok(Adhoc),
"annual" => Ok(Annual),
"daily" => Ok(Daily),
"fortnightly" => Ok(Fortnightly),
"monthly" => Ok(Monthly),
"quarterly" => Ok(Quarterly),
"semi_annual" => Ok(SemiAnnual),
"weekly" => Ok(Weekly),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
DependantSupport,
Government,
Loan,
Mortgage,
Other,
Pension,
Personal,
Retail,
Salary,
Tax,
Utility,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match self {
DependantSupport => "dependant_support",
Government => "government",
Loan => "loan",
Mortgage => "mortgage",
Other => "other",
Pension => "pension",
Personal => "personal",
Retail => "retail",
Salary => "salary",
Tax => "tax",
Utility => "utility",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match s {
"dependant_support" => Ok(DependantSupport),
"government" => Ok(Government),
"loan" => Ok(Loan),
"mortgage" => Ok(Mortgage),
"other" => Ok(Other),
"pension" => Ok(Pension),
"personal" => Ok(Personal),
"retail" => Ok(Retail),
"salary" => Ok(Salary),
"tax" => Ok(Tax),
"utility" => Ok(Utility),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsSepaDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub reference_prefix: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
pub fn new() -> Self {
Self { reference_prefix: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUpi {
pub fn new() -> Self {
Self { mandate_options: None, setup_future_usage: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
None,
OffSession,
OnSession,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match self {
None => "none",
OffSession => "off_session",
OnSession => "on_session",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match s {
"none" => Ok(None),
"off_session" => Ok(OffSession),
"on_session" => Ok(OnSession),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections:
Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccount").finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
pub fn new() -> Self {
Self {
financial_connections: None,
mandate_options: None,
networks: None,
verification_method: None,
}
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
#[serde(skip_serializing_if = "Option::is_none")]
pub filters:
Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
#[serde(skip_serializing_if = "Option::is_none")]
pub permissions: Option<
Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prefetch:
Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub return_url: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
pub fn new() -> Self {
Self { filters: None, permissions: None, prefetch: None, return_url: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_subcategories: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
)
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
pub fn new() -> Self {
Self { account_subcategories: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
{
Checking,
Savings,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
Balances,
Ownership,
PaymentMethod,
Transactions,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match self {
Balances => "balances",
Ownership => "ownership",
PaymentMethod => "payment_method",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"payment_method" => Ok(PaymentMethod),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
Balances,
Ownership,
Transactions,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match self {
Balances => "balances",
Ownership => "ownership",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub collection_method:
Option<UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
pub fn new() -> Self {
Self { collection_method: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
Paper,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match self {
Paper => "paper",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match s {
"paper" => Ok(Paper),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<Vec<UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
.finish_non_exhaustive()
}
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
pub fn new() -> Self {
Self { requested: None }
}
}
impl Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
Ach,
UsDomesticWire,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match self {
Ach => "ach",
UsDomesticWire => "us_domestic_wire",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match s {
"ach" => Ok(Ach),
"us_domestic_wire" => Ok(UsDomesticWire),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
pub fn as_str(&self) -> &str {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct UpdateSetupIntent {
inner: UpdateSetupIntentBuilder,
intent: stripe_shared::SetupIntentId,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for UpdateSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("UpdateSetupIntent").finish_non_exhaustive()
}
}
impl UpdateSetupIntent {
pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
Self { intent: intent.into(), inner: UpdateSetupIntentBuilder::new() }
}
pub fn attach_to_self(mut self, attach_to_self: impl Into<bool>) -> Self {
self.inner.attach_to_self = Some(attach_to_self.into());
self
}
pub fn customer(mut self, customer: impl Into<String>) -> Self {
self.inner.customer = Some(customer.into());
self
}
pub fn customer_account(mut self, customer_account: impl Into<String>) -> Self {
self.inner.customer_account = Some(customer_account.into());
self
}
pub fn description(mut self, description: impl Into<String>) -> Self {
self.inner.description = Some(description.into());
self
}
pub fn excluded_payment_method_types(
mut self,
excluded_payment_method_types: impl Into<
Vec<stripe_shared::SetupIntentExcludedPaymentMethodTypes>,
>,
) -> Self {
self.inner.excluded_payment_method_types = Some(excluded_payment_method_types.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
pub fn flow_directions(
mut self,
flow_directions: impl Into<Vec<stripe_shared::SetupIntentFlowDirections>>,
) -> Self {
self.inner.flow_directions = Some(flow_directions.into());
self
}
pub fn metadata(
mut self,
metadata: impl Into<std::collections::HashMap<String, String>>,
) -> Self {
self.inner.metadata = Some(metadata.into());
self
}
pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
self.inner.payment_method = Some(payment_method.into());
self
}
pub fn payment_method_configuration(
mut self,
payment_method_configuration: impl Into<String>,
) -> Self {
self.inner.payment_method_configuration = Some(payment_method_configuration.into());
self
}
pub fn payment_method_data(
mut self,
payment_method_data: impl Into<UpdateSetupIntentPaymentMethodData>,
) -> Self {
self.inner.payment_method_data = Some(payment_method_data.into());
self
}
pub fn payment_method_options(
mut self,
payment_method_options: impl Into<UpdateSetupIntentPaymentMethodOptions>,
) -> Self {
self.inner.payment_method_options = Some(payment_method_options.into());
self
}
pub fn payment_method_types(mut self, payment_method_types: impl Into<Vec<String>>) -> Self {
self.inner.payment_method_types = Some(payment_method_types.into());
self
}
}
impl UpdateSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for UpdateSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
let intent = &self.intent;
RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}"))
.form(&self.inner)
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct CancelSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
cancellation_reason: Option<stripe_shared::SetupIntentCancellationReason>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CancelSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CancelSetupIntentBuilder").finish_non_exhaustive()
}
}
impl CancelSetupIntentBuilder {
fn new() -> Self {
Self { cancellation_reason: None, expand: None }
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct CancelSetupIntent {
inner: CancelSetupIntentBuilder,
intent: stripe_shared::SetupIntentId,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CancelSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CancelSetupIntent").finish_non_exhaustive()
}
}
impl CancelSetupIntent {
pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
Self { intent: intent.into(), inner: CancelSetupIntentBuilder::new() }
}
pub fn cancellation_reason(
mut self,
cancellation_reason: impl Into<stripe_shared::SetupIntentCancellationReason>,
) -> Self {
self.inner.cancellation_reason = Some(cancellation_reason.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
}
impl CancelSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for CancelSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
let intent = &self.intent;
RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/cancel"))
.form(&self.inner)
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct ConfirmSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
confirmation_token: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
mandate_data: Option<ConfirmSetupIntentMandateData>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_data: Option<ConfirmSetupIntentPaymentMethodData>,
#[serde(skip_serializing_if = "Option::is_none")]
payment_method_options: Option<ConfirmSetupIntentPaymentMethodOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
return_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
use_stripe_sdk: Option<bool>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentBuilder").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentBuilder {
fn new() -> Self {
Self {
confirmation_token: None,
expand: None,
mandate_data: None,
payment_method: None,
payment_method_data: None,
payment_method_options: None,
return_url: None,
use_stripe_sdk: None,
}
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ConfirmSetupIntentMandateData {
#[serde(untagged)]
SecretKeyParam(ConfirmSetupIntentSecretKeyParam),
#[serde(untagged)]
ClientKeyParam(ConfirmSetupIntentClientKeyParam),
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentMandateData {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentMandateData").finish_non_exhaustive()
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentSecretKeyParam {
pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentSecretKeyParam").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentSecretKeyParam {
pub fn new(
customer_acceptance: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptance>,
) -> Self {
Self { customer_acceptance: customer_acceptance.into() }
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
#[serde(skip_serializing_if = "Option::is_none")]
pub accepted_at: Option<stripe_types::Timestamp>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub offline: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub online: Option<OnlineParam>,
#[serde(rename = "type")]
pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentSecretKeyParamCustomerAcceptance").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentSecretKeyParamCustomerAcceptance {
pub fn new(type_: impl Into<ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType>) -> Self {
Self { accepted_at: None, offline: None, online: None, type_: type_.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
Offline,
Online,
Unknown(String),
}
impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
match self {
Offline => "offline",
Online => "online",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*;
match s {
"offline" => Ok(Offline),
"online" => Ok(Online),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentClientKeyParam {
pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentClientKeyParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentClientKeyParam").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentClientKeyParam {
pub fn new(
customer_acceptance: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptance>,
) -> Self {
Self { customer_acceptance: customer_acceptance.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance {
pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline,
#[serde(rename = "type")]
pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptance {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentClientKeyParamCustomerAcceptance").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentClientKeyParamCustomerAcceptance {
pub fn new(
online: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline>,
type_: impl Into<ConfirmSetupIntentClientKeyParamCustomerAcceptanceType>,
) -> Self {
Self { online: online.into(), type_: type_.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub user_agent: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
pub fn new() -> Self {
Self { ip_address: None, user_agent: None }
}
}
impl Default for ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
Online,
Unknown(String),
}
impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
match self {
Online => "online",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*;
match s {
"online" => Ok(Online),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentClientKeyParamCustomerAcceptanceType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentClientKeyParamCustomerAcceptanceType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodData {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<PaymentMethodParam>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub affirm: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub afterpay_clearpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alipay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_redisplay: Option<ConfirmSetupIntentPaymentMethodDataAllowRedisplay>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub alma: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub au_becs_debit: Option<ConfirmSetupIntentPaymentMethodDataAuBecsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodDataBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub bancontact: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub billie: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_details: Option<BillingDetailsInnerParams>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub blik: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub boleto: Option<ConfirmSetupIntentPaymentMethodDataBoleto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub cashapp: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub crypto: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub customer_balance: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub eps: Option<ConfirmSetupIntentPaymentMethodDataEps>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fpx: Option<ConfirmSetupIntentPaymentMethodDataFpx>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub giropay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub grabpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ideal: Option<ConfirmSetupIntentPaymentMethodDataIdeal>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub interac_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kakao_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<ConfirmSetupIntentPaymentMethodDataKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub konbini: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub kr_card: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub link: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mb_way: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub mobilepay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub multibanco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub naver_pay: Option<ConfirmSetupIntentPaymentMethodDataNaverPay>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nz_bank_account: Option<ConfirmSetupIntentPaymentMethodDataNzBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub oxxo: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub p24: Option<ConfirmSetupIntentPaymentMethodDataP24>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pay_by_bank: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub payco: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paynow: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub paypal: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<ConfirmSetupIntentPaymentMethodDataPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub pix: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub promptpay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub radar_options: Option<RadarOptionsWithHiddenOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub revolut_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub samsung_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub satispay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodDataSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort: Option<ConfirmSetupIntentPaymentMethodDataSofort>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub swish: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub twint: Option<miniserde::json::Value>,
#[serde(rename = "type")]
pub type_: ConfirmSetupIntentPaymentMethodDataType,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<ConfirmSetupIntentPaymentMethodDataUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccount>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub wechat_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub zip: Option<miniserde::json::Value>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodData {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodData").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodData {
pub fn new(type_: impl Into<ConfirmSetupIntentPaymentMethodDataType>) -> Self {
Self {
acss_debit: None,
affirm: None,
afterpay_clearpay: None,
alipay: None,
allow_redisplay: None,
alma: None,
amazon_pay: None,
au_becs_debit: None,
bacs_debit: None,
bancontact: None,
billie: None,
billing_details: None,
blik: None,
boleto: None,
cashapp: None,
crypto: None,
customer_balance: None,
eps: None,
fpx: None,
giropay: None,
grabpay: None,
ideal: None,
interac_present: None,
kakao_pay: None,
klarna: None,
konbini: None,
kr_card: None,
link: None,
mb_way: None,
metadata: None,
mobilepay: None,
multibanco: None,
naver_pay: None,
nz_bank_account: None,
oxxo: None,
p24: None,
pay_by_bank: None,
payco: None,
paynow: None,
paypal: None,
payto: None,
pix: None,
promptpay: None,
radar_options: None,
revolut_pay: None,
samsung_pay: None,
satispay: None,
sepa_debit: None,
sofort: None,
swish: None,
twint: None,
type_: type_.into(),
upi: None,
us_bank_account: None,
wechat_pay: None,
zip: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
Always,
Limited,
Unspecified,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
match self {
Always => "always",
Limited => "limited",
Unspecified => "unspecified",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataAllowRedisplay::*;
match s {
"always" => Ok(Always),
"limited" => Ok(Limited),
"unspecified" => Ok(Unspecified),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataAllowRedisplay"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataAllowRedisplay))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataAllowRedisplay {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
pub account_number: String,
pub bsb_number: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataAuBecsDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataAuBecsDebit {
pub fn new(account_number: impl Into<String>, bsb_number: impl Into<String>) -> Self {
Self { account_number: account_number.into(), bsb_number: bsb_number.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_code: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataBacsDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataBacsDebit {
pub fn new() -> Self {
Self { account_number: None, sort_code: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataBoleto {
pub tax_id: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataBoleto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataBoleto").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataBoleto {
pub fn new(tax_id: impl Into<String>) -> Self {
Self { tax_id: tax_id.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataEps {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<ConfirmSetupIntentPaymentMethodDataEpsBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEps {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataEps").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataEps {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataEps {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataEpsBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataEpsBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataEpsBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataEpsBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataFpx {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type: Option<ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType>,
pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpx {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataFpx").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataFpx {
pub fn new(bank: impl Into<ConfirmSetupIntentPaymentMethodDataFpxBank>) -> Self {
Self { account_holder_type: None, bank: bank.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(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,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataFpxBank {
pub fn as_str(&self) -> &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(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataFpxBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataFpxBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataFpxBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataIdeal {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<ConfirmSetupIntentPaymentMethodDataIdealBank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdeal {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataIdeal").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataIdeal {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataIdeal {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataIdealBank {
AbnAmro,
Adyen,
AsnBank,
Bunq,
Buut,
Finom,
Handelsbanken,
Ing,
Knab,
Mollie,
Moneyou,
N26,
Nn,
Rabobank,
Regiobank,
Revolut,
SnsBank,
TriodosBank,
VanLanschot,
Yoursafe,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataIdealBank {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
match self {
AbnAmro => "abn_amro",
Adyen => "adyen",
AsnBank => "asn_bank",
Bunq => "bunq",
Buut => "buut",
Finom => "finom",
Handelsbanken => "handelsbanken",
Ing => "ing",
Knab => "knab",
Mollie => "mollie",
Moneyou => "moneyou",
N26 => "n26",
Nn => "nn",
Rabobank => "rabobank",
Regiobank => "regiobank",
Revolut => "revolut",
SnsBank => "sns_bank",
TriodosBank => "triodos_bank",
VanLanschot => "van_lanschot",
Yoursafe => "yoursafe",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataIdealBank::*;
match s {
"abn_amro" => Ok(AbnAmro),
"adyen" => Ok(Adyen),
"asn_bank" => Ok(AsnBank),
"bunq" => Ok(Bunq),
"buut" => Ok(Buut),
"finom" => Ok(Finom),
"handelsbanken" => Ok(Handelsbanken),
"ing" => Ok(Ing),
"knab" => Ok(Knab),
"mollie" => Ok(Mollie),
"moneyou" => Ok(Moneyou),
"n26" => Ok(N26),
"nn" => Ok(Nn),
"rabobank" => Ok(Rabobank),
"regiobank" => Ok(Regiobank),
"revolut" => Ok(Revolut),
"sns_bank" => Ok(SnsBank),
"triodos_bank" => Ok(TriodosBank),
"van_lanschot" => Ok(VanLanschot),
"yoursafe" => Ok(Yoursafe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataIdealBank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataIdealBank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataIdealBank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub dob: Option<DateOfBirth>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataKlarna").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataKlarna {
pub fn new() -> Self {
Self { dob: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataNaverPay {
#[serde(skip_serializing_if = "Option::is_none")]
pub funding: Option<ConfirmSetupIntentPaymentMethodDataNaverPayFunding>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataNaverPay").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataNaverPay {
pub fn new() -> Self {
Self { funding: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataNaverPay {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
Card,
Points,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
match self {
Card => "card",
Points => "points",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataNaverPayFunding::*;
match s {
"card" => Ok(Card),
"points" => Ok(Points),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataNaverPayFunding"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataNaverPayFunding))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataNaverPayFunding {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataNzBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_name: Option<String>,
pub account_number: String,
pub bank_code: String,
pub branch_code: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
pub suffix: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataNzBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataNzBankAccount").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataNzBankAccount {
pub fn new(
account_number: impl Into<String>,
bank_code: impl Into<String>,
branch_code: impl Into<String>,
suffix: impl Into<String>,
) -> Self {
Self {
account_holder_name: None,
account_number: account_number.into(),
bank_code: bank_code.into(),
branch_code: branch_code.into(),
reference: None,
suffix: suffix.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataP24 {
#[serde(skip_serializing_if = "Option::is_none")]
pub bank: Option<ConfirmSetupIntentPaymentMethodDataP24Bank>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24 {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataP24").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataP24 {
pub fn new() -> Self {
Self { bank: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataP24 {
fn default() -> Self {
Self::new()
}
}
#[derive(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,
Velobank,
VolkswagenBank,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataP24Bank {
pub fn as_str(&self) -> &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",
Velobank => "velobank",
VolkswagenBank => "volkswagen_bank",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
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),
"velobank" => Ok(Velobank),
"volkswagen_bank" => Ok(VolkswagenBank),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataP24Bank"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataP24Bank))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataP24Bank {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bsb_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pay_id: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataPayto").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataPayto {
pub fn new() -> Self {
Self { account_number: None, bsb_number: None, pay_id: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit {
pub iban: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataSepaDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataSepaDebit {
pub fn new(iban: impl Into<String>) -> Self {
Self { iban: iban.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataSofort {
pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofort {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataSofort").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataSofort {
pub fn new(country: impl Into<ConfirmSetupIntentPaymentMethodDataSofortCountry>) -> Self {
Self { country: country.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry {
At,
Be,
De,
Es,
It,
Nl,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataSofortCountry {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
match self {
At => "AT",
Be => "BE",
De => "DE",
Es => "ES",
It => "IT",
Nl => "NL",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataSofortCountry::*;
match s {
"AT" => Ok(At),
"BE" => Ok(Be),
"DE" => Ok(De),
"ES" => Ok(Es),
"IT" => Ok(It),
"NL" => Ok(Nl),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataSofortCountry"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataSofortCountry))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataSofortCountry {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataType {
AcssDebit,
Affirm,
AfterpayClearpay,
Alipay,
Alma,
AmazonPay,
AuBecsDebit,
BacsDebit,
Bancontact,
Billie,
Blik,
Boleto,
Cashapp,
Crypto,
CustomerBalance,
Eps,
Fpx,
Giropay,
Grabpay,
Ideal,
KakaoPay,
Klarna,
Konbini,
KrCard,
Link,
MbWay,
Mobilepay,
Multibanco,
NaverPay,
NzBankAccount,
Oxxo,
P24,
PayByBank,
Payco,
Paynow,
Paypal,
Payto,
Pix,
Promptpay,
RevolutPay,
SamsungPay,
Satispay,
SepaDebit,
Sofort,
Swish,
Twint,
Upi,
UsBankAccount,
WechatPay,
Zip,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataType::*;
match self {
AcssDebit => "acss_debit",
Affirm => "affirm",
AfterpayClearpay => "afterpay_clearpay",
Alipay => "alipay",
Alma => "alma",
AmazonPay => "amazon_pay",
AuBecsDebit => "au_becs_debit",
BacsDebit => "bacs_debit",
Bancontact => "bancontact",
Billie => "billie",
Blik => "blik",
Boleto => "boleto",
Cashapp => "cashapp",
Crypto => "crypto",
CustomerBalance => "customer_balance",
Eps => "eps",
Fpx => "fpx",
Giropay => "giropay",
Grabpay => "grabpay",
Ideal => "ideal",
KakaoPay => "kakao_pay",
Klarna => "klarna",
Konbini => "konbini",
KrCard => "kr_card",
Link => "link",
MbWay => "mb_way",
Mobilepay => "mobilepay",
Multibanco => "multibanco",
NaverPay => "naver_pay",
NzBankAccount => "nz_bank_account",
Oxxo => "oxxo",
P24 => "p24",
PayByBank => "pay_by_bank",
Payco => "payco",
Paynow => "paynow",
Paypal => "paypal",
Payto => "payto",
Pix => "pix",
Promptpay => "promptpay",
RevolutPay => "revolut_pay",
SamsungPay => "samsung_pay",
Satispay => "satispay",
SepaDebit => "sepa_debit",
Sofort => "sofort",
Swish => "swish",
Twint => "twint",
Upi => "upi",
UsBankAccount => "us_bank_account",
WechatPay => "wechat_pay",
Zip => "zip",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataType::*;
match s {
"acss_debit" => Ok(AcssDebit),
"affirm" => Ok(Affirm),
"afterpay_clearpay" => Ok(AfterpayClearpay),
"alipay" => Ok(Alipay),
"alma" => Ok(Alma),
"amazon_pay" => Ok(AmazonPay),
"au_becs_debit" => Ok(AuBecsDebit),
"bacs_debit" => Ok(BacsDebit),
"bancontact" => Ok(Bancontact),
"billie" => Ok(Billie),
"blik" => Ok(Blik),
"boleto" => Ok(Boleto),
"cashapp" => Ok(Cashapp),
"crypto" => Ok(Crypto),
"customer_balance" => Ok(CustomerBalance),
"eps" => Ok(Eps),
"fpx" => Ok(Fpx),
"giropay" => Ok(Giropay),
"grabpay" => Ok(Grabpay),
"ideal" => Ok(Ideal),
"kakao_pay" => Ok(KakaoPay),
"klarna" => Ok(Klarna),
"konbini" => Ok(Konbini),
"kr_card" => Ok(KrCard),
"link" => Ok(Link),
"mb_way" => Ok(MbWay),
"mobilepay" => Ok(Mobilepay),
"multibanco" => Ok(Multibanco),
"naver_pay" => Ok(NaverPay),
"nz_bank_account" => Ok(NzBankAccount),
"oxxo" => Ok(Oxxo),
"p24" => Ok(P24),
"pay_by_bank" => Ok(PayByBank),
"payco" => Ok(Payco),
"paynow" => Ok(Paynow),
"paypal" => Ok(Paypal),
"payto" => Ok(Payto),
"pix" => Ok(Pix),
"promptpay" => Ok(Promptpay),
"revolut_pay" => Ok(RevolutPay),
"samsung_pay" => Ok(SamsungPay),
"satispay" => Ok(Satispay),
"sepa_debit" => Ok(SepaDebit),
"sofort" => Ok(Sofort),
"swish" => Ok(Swish),
"twint" => Ok(Twint),
"upi" => Ok(Upi),
"us_bank_account" => Ok(UsBankAccount),
"wechat_pay" => Ok(WechatPay),
"zip" => Ok(Zip),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataType)).finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodDataUpiMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataUpi").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataUpi {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodDataUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_type:
Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub account_type: Option<ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections_account: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_number: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodDataUsBankAccount").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodDataUsBankAccount {
pub fn new() -> Self {
Self {
account_holder_type: None,
account_number: None,
account_type: None,
financial_connections_account: None,
routing_number: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodDataUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
Company,
Individual,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match self {
Company => "company",
Individual => "individual",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*;
match s {
"company" => Ok(Company),
"individual" => Ok(Individual),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
Checking,
Savings,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub acss_debit: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub amazon_pay: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bacs_debit: Option<ConfirmSetupIntentPaymentMethodOptionsBacsDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card: Option<ConfirmSetupIntentPaymentMethodOptionsCard>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(with = "stripe_types::with_serde_json_opt")]
pub card_present: Option<miniserde::json::Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub klarna: Option<ConfirmSetupIntentPaymentMethodOptionsKlarna>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<SetupIntentPaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paypal: Option<PaymentMethodOptionsParam>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payto: Option<ConfirmSetupIntentPaymentMethodOptionsPayto>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebit>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upi: Option<ConfirmSetupIntentPaymentMethodOptionsUpi>,
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccount>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptions").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptions {
pub fn new() -> Self {
Self {
acss_debit: None,
amazon_pay: None,
bacs_debit: None,
card: None,
card_present: None,
klarna: None,
link: None,
paypal: None,
payto: None,
sepa_debit: None,
upi: None,
us_bank_account: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsAcssDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
pub fn new() -> Self {
Self { currency: None, mandate_options: None, verification_method: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
Cad,
Usd,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match self {
Cad => "cad",
Usd => "usd",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*;
match s {
"cad" => Ok(Cad),
"usd" => Ok(Usd),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_mandate_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub default_for:
Option<Vec<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_type:
Option<ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
pub fn new() -> Self {
Self {
custom_mandate_url: None,
default_for: None,
interval_description: None,
payment_schedule: None,
transaction_type: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
Invoice,
Subscription,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match self {
Invoice => "invoice",
Subscription => "subscription",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*;
match s {
"invoice" => Ok(Invoice),
"subscription" => Ok(Subscription),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
Combined,
Interval,
Sporadic,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match self {
Combined => "combined",
Interval => "interval",
Sporadic => "sporadic",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*;
match s {
"combined" => Ok(Combined),
"interval" => Ok(Interval),
"sporadic" => Ok(Sporadic),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
Business,
Personal,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match self {
Business => "business",
Personal => "personal",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*;
match s {
"business" => Ok(Business),
"personal" => Ok(Personal),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<PaymentMethodOptionsMandateOptionsParam>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsBacsDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsBacsDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub moto: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network: Option<ConfirmSetupIntentPaymentMethodOptionsCardNetwork>,
#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Option<ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure>,
#[serde(skip_serializing_if = "Option::is_none")]
pub three_d_secure: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCard {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCard").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsCard {
pub fn new() -> Self {
Self {
mandate_options: None,
moto: None,
network: None,
request_three_d_secure: None,
three_d_secure: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsCard {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
pub amount: i64,
pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType,
pub currency: stripe_types::Currency,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
pub reference: String,
pub start_date: stripe_types::Timestamp,
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_types:
Option<Vec<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions {
pub fn new(
amount: impl Into<i64>,
amount_type: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType>,
currency: impl Into<stripe_types::Currency>,
interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval>,
reference: impl Into<String>,
start_date: impl Into<stripe_types::Timestamp>,
) -> Self {
Self {
amount: amount.into(),
amount_type: amount_type.into(),
currency: currency.into(),
description: None,
end_date: None,
interval: interval.into(),
interval_count: None,
reference: reference.into(),
start_date: start_date.into(),
supported_types: None,
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
Day,
Month,
Sporadic,
Week,
Year,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match self {
Day => "day",
Month => "month",
Sporadic => "sporadic",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"sporadic" => Ok(Sporadic),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
India,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match self {
India => "india",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*;
match s {
"india" => Ok(India),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
Amex,
CartesBancaires,
Diners,
Discover,
EftposAu,
Girocard,
Interac,
Jcb,
Link,
Mastercard,
Unionpay,
Unknown,
Visa,
_Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
match self {
Amex => "amex",
CartesBancaires => "cartes_bancaires",
Diners => "diners",
Discover => "discover",
EftposAu => "eftpos_au",
Girocard => "girocard",
Interac => "interac",
Jcb => "jcb",
Link => "link",
Mastercard => "mastercard",
Unionpay => "unionpay",
Unknown => "unknown",
Visa => "visa",
_Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*;
match s {
"amex" => Ok(Amex),
"cartes_bancaires" => Ok(CartesBancaires),
"diners" => Ok(Diners),
"discover" => Ok(Discover),
"eftpos_au" => Ok(EftposAu),
"girocard" => Ok(Girocard),
"interac" => Ok(Interac),
"jcb" => Ok(Jcb),
"link" => Ok(Link),
"mastercard" => Ok(Mastercard),
"unionpay" => Ok(Unionpay),
"unknown" => Ok(Unknown),
"visa" => Ok(Visa),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardNetwork"
);
Ok(_Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardNetwork))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsCardNetwork {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
Any,
Automatic,
Challenge,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match self {
Any => "any",
Automatic => "automatic",
Challenge => "challenge",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*;
match s {
"any" => Ok(Any),
"automatic" => Ok(Automatic),
"challenge" => Ok(Challenge),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
#[serde(skip_serializing_if = "Option::is_none")]
pub ares_trans_status:
Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cryptogram: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub electronic_commerce_indicator:
Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network_options:
Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub requestor_challenge_indicator: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
pub fn new() -> Self {
Self {
ares_trans_status: None,
cryptogram: None,
electronic_commerce_indicator: None,
network_options: None,
requestor_challenge_indicator: None,
transaction_id: None,
version: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
A,
C,
I,
N,
R,
U,
Y,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match self {
A => "A",
C => "C",
I => "I",
N => "N",
R => "R",
U => "U",
Y => "Y",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*;
match s {
"A" => Ok(A),
"C" => Ok(C),
"I" => Ok(I),
"N" => Ok(N),
"R" => Ok(R),
"U" => Ok(U),
"Y" => Ok(Y),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
V01,
V02,
V05,
V06,
V07,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match self {
V01 => "01",
V02 => "02",
V05 => "05",
V06 => "06",
V07 => "07",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*;
match s {
"01" => Ok(V01),
"02" => Ok(V02),
"05" => Ok(V05),
"06" => Ok(V06),
"07" => Ok(V07),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub cartes_bancaires:
Option<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
pub fn new() -> Self {
Self { cartes_bancaires: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub cb_avalgo:
ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_exemption: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cb_score: Option<i64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires",
)
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires {
pub fn new(
cb_avalgo: impl Into<ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo>,
) -> Self {
Self { cb_avalgo: cb_avalgo.into(), cb_exemption: None, cb_score: None }
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
V0,
V1,
V2,
V3,
V4,
A,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match self {
V0 => "0",
V1 => "1",
V2 => "2",
V3 => "3",
V4 => "4",
A => "A",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*;
match s {
"0" => Ok(V0),
"1" => Ok(V1),
"2" => Ok(V2),
"3" => Ok(V3),
"4" => Ok(V4),
"A" => Ok(A),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo)).finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
V1_0_2,
V2_1_0,
V2_2_0,
V2_3_0,
V2_3_1,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match self {
V1_0_2 => "1.0.2",
V2_1_0 => "2.1.0",
V2_2_0 => "2.2.0",
V2_3_0 => "2.3.0",
V2_3_1 => "2.3.1",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*;
match s {
"1.0.2" => Ok(V1_0_2),
"2.1.0" => Ok(V2_1_0),
"2.2.0" => Ok(V2_2_0),
"2.3.0" => Ok(V2_3_0),
"2.3.1" => Ok(V2_3_1),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsKlarna {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<stripe_types::Currency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub on_demand: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand>,
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_locale: Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale>,
#[serde(skip_serializing_if = "Option::is_none")]
pub subscriptions: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarna {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarna").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarna {
pub fn new() -> Self {
Self { currency: None, on_demand: None, preferred_locale: None, subscriptions: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarna {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
#[serde(skip_serializing_if = "Option::is_none")]
pub average_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval:
Option<ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purchase_interval_count: Option<u64>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
pub fn new() -> Self {
Self {
average_amount: None,
maximum_amount: None,
minimum_amount: None,
purchase_interval: None,
purchase_interval_count: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemand {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsKlarnaOnDemandPurchaseInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
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,
EnMinusRo,
EnMinusSe,
EnMinusUs,
EsMinusEs,
EsMinusUs,
FiMinusFi,
FrMinusBe,
FrMinusCa,
FrMinusCh,
FrMinusFr,
ItMinusCh,
ItMinusIt,
NbMinusNo,
NlMinusBe,
NlMinusNl,
PlMinusPl,
PtMinusPt,
RoMinusRo,
SvMinusFi,
SvMinusSe,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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",
EnMinusRo => "en-RO",
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",
RoMinusRo => "ro-RO",
SvMinusFi => "sv-FI",
SvMinusSe => "sv-SE",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale::*;
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-RO" => Ok(EnMinusRo),
"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),
"ro-RO" => Ok(RoMinusRo),
"sv-FI" => Ok(SvMinusFi),
"sv-SE" => Ok(SvMinusSe),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsKlarnaPreferredLocale {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub interval: ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval,
#[serde(skip_serializing_if = "Option::is_none")]
pub interval_count: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub next_billing: SubscriptionNextBillingParam,
pub reference: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptions {
pub fn new(
interval: impl Into<ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval>,
next_billing: impl Into<SubscriptionNextBillingParam>,
reference: impl Into<String>,
) -> Self {
Self {
interval: interval.into(),
interval_count: None,
name: None,
next_billing: next_billing.into(),
reference: reference.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
Day,
Month,
Week,
Year,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match self {
Day => "day",
Month => "month",
Week => "week",
Year => "year",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval::*;
match s {
"day" => Ok(Day),
"month" => Ok(Month),
"week" => Ok(Week),
"year" => Ok(Year),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsKlarnaSubscriptionsInterval
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsPayto {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPayto {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPayto").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsPayto {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsPayto {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_schedule:
Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payments_per_period: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purpose: Option<ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_date: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
pub fn new() -> Self {
Self {
amount: None,
amount_type: None,
end_date: None,
payment_schedule: None,
payments_per_period: None,
purpose: None,
start_date: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
Adhoc,
Annual,
Daily,
Fortnightly,
Monthly,
Quarterly,
SemiAnnual,
Weekly,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match self {
Adhoc => "adhoc",
Annual => "annual",
Daily => "daily",
Fortnightly => "fortnightly",
Monthly => "monthly",
Quarterly => "quarterly",
SemiAnnual => "semi_annual",
Weekly => "weekly",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule::*;
match s {
"adhoc" => Ok(Adhoc),
"annual" => Ok(Annual),
"daily" => Ok(Daily),
"fortnightly" => Ok(Fortnightly),
"monthly" => Ok(Monthly),
"quarterly" => Ok(Quarterly),
"semi_annual" => Ok(SemiAnnual),
"weekly" => Ok(Weekly),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPaymentSchedule
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
DependantSupport,
Government,
Loan,
Mortgage,
Other,
Pension,
Personal,
Retail,
Salary,
Tax,
Utility,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match self {
DependantSupport => "dependant_support",
Government => "government",
Loan => "loan",
Mortgage => "mortgage",
Other => "other",
Pension => "pension",
Personal => "personal",
Retail => "retail",
Salary => "salary",
Tax => "tax",
Utility => "utility",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose::*;
match s {
"dependant_support" => Ok(DependantSupport),
"government" => Ok(Government),
"loan" => Ok(Loan),
"mortgage" => Ok(Mortgage),
"other" => Ok(Other),
"pension" => Ok(Pension),
"personal" => Ok(Personal),
"retail" => Ok(Retail),
"salary" => Ok(Salary),
"tax" => Ok(Tax),
"utility" => Ok(Utility),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsPaytoMandateOptionsPurpose
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsSepaDebit").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
pub fn new() -> Self {
Self { mandate_options: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebit {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub reference_prefix: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
pub fn new() -> Self {
Self { reference_prefix: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUpi {
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpi {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUpi").finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUpi {
pub fn new() -> Self {
Self { mandate_options: None, setup_future_usage: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUpi {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_type: Option<ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<stripe_types::Timestamp>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
pub fn new() -> Self {
Self { amount: None, amount_type: None, description: None, end_date: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
Fixed,
Maximum,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match self {
Fixed => "fixed",
Maximum => "maximum",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType::*;
match s {
"fixed" => Ok(Fixed),
"maximum" => Ok(Maximum),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUpiMandateOptionsAmountType
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
None,
OffSession,
OnSession,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match self {
None => "none",
OffSession => "off_session",
OnSession => "on_session",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage::*;
match s {
"none" => Ok(None),
"off_session" => Ok(OffSession),
"on_session" => Ok(OnSession),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUpiSetupFutureUsage {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub financial_connections:
Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mandate_options: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub networks: Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_method:
Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccount")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
pub fn new() -> Self {
Self {
financial_connections: None,
mandate_options: None,
networks: None,
verification_method: None,
}
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccount {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
#[serde(skip_serializing_if = "Option::is_none")]
pub filters:
Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters>,
#[serde(skip_serializing_if = "Option::is_none")]
pub permissions: Option<
Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>,
>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prefetch: Option<
Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>,
>,
#[serde(skip_serializing_if = "Option::is_none")]
pub return_url: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
pub fn new() -> Self {
Self { filters: None, permissions: None, prefetch: None, return_url: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_subcategories: Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters",
)
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
pub fn new() -> Self {
Self { account_subcategories: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories
{
Checking,
Savings,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match self {
Checking => "checking",
Savings => "savings",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories::*;
match s {
"checking" => Ok(Checking),
"savings" => Ok(Savings),
v => { tracing::warn!("Unknown value '{}' for enum '{}'", v, "ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories"); Ok(Unknown(v.to_owned())) }
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories)).finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsFiltersAccountSubcategories {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
Balances,
Ownership,
PaymentMethod,
Transactions,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match self {
Balances => "balances",
Ownership => "ownership",
PaymentMethod => "payment_method",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"payment_method" => Ok(PaymentMethod),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
Balances,
Ownership,
Transactions,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match self {
Balances => "balances",
Ownership => "ownership",
Transactions => "transactions",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*;
match s {
"balances" => Ok(Balances),
"ownership" => Ok(Ownership),
"transactions" => Ok(Transactions),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub collection_method:
Option<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
pub fn new() -> Self {
Self { collection_method: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
Paper,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match self {
Paper => "paper",
Unknown(v) => v,
}
}
}
impl std::str::FromStr
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*;
match s {
"paper" => Ok(Paper),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
#[serde(skip_serializing_if = "Option::is_none")]
pub requested:
Option<Vec<ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks")
.finish_non_exhaustive()
}
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
pub fn new() -> Self {
Self { requested: None }
}
}
impl Default for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
Ach,
UsDomesticWire,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match self {
Ach => "ach",
UsDomesticWire => "us_domestic_wire",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*;
match s {
"ach" => Ok(Ach),
"us_domestic_wire" => Ok(UsDomesticWire),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
Automatic,
Instant,
Microdeposits,
Unknown(String),
}
impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
pub fn as_str(&self) -> &str {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match self {
Automatic => "automatic",
Instant => "instant",
Microdeposits => "microdeposits",
Unknown(v) => v,
}
}
}
impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*;
match s {
"automatic" => Ok(Automatic),
"instant" => Ok(Instant),
"microdeposits" => Ok(Microdeposits),
v => {
tracing::warn!(
"Unknown value '{}' for enum '{}'",
v,
"ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod"
);
Ok(Unknown(v.to_owned()))
}
}
}
}
impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct(stringify!(
ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
))
.finish_non_exhaustive()
}
}
impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de>
for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod
{
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
use std::str::FromStr;
let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
Ok(Self::from_str(&s).expect("infallible"))
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct ConfirmSetupIntent {
inner: ConfirmSetupIntentBuilder,
intent: stripe_shared::SetupIntentId,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for ConfirmSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ConfirmSetupIntent").finish_non_exhaustive()
}
}
impl ConfirmSetupIntent {
pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
Self { intent: intent.into(), inner: ConfirmSetupIntentBuilder::new() }
}
pub fn confirmation_token(mut self, confirmation_token: impl Into<String>) -> Self {
self.inner.confirmation_token = Some(confirmation_token.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
pub fn mandate_data(mut self, mandate_data: impl Into<ConfirmSetupIntentMandateData>) -> Self {
self.inner.mandate_data = Some(mandate_data.into());
self
}
pub fn payment_method(mut self, payment_method: impl Into<String>) -> Self {
self.inner.payment_method = Some(payment_method.into());
self
}
pub fn payment_method_data(
mut self,
payment_method_data: impl Into<ConfirmSetupIntentPaymentMethodData>,
) -> Self {
self.inner.payment_method_data = Some(payment_method_data.into());
self
}
pub fn payment_method_options(
mut self,
payment_method_options: impl Into<ConfirmSetupIntentPaymentMethodOptions>,
) -> Self {
self.inner.payment_method_options = Some(payment_method_options.into());
self
}
pub fn return_url(mut self, return_url: impl Into<String>) -> Self {
self.inner.return_url = Some(return_url.into());
self
}
pub fn use_stripe_sdk(mut self, use_stripe_sdk: impl Into<bool>) -> Self {
self.inner.use_stripe_sdk = Some(use_stripe_sdk.into());
self
}
}
impl ConfirmSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for ConfirmSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
let intent = &self.intent;
RequestBuilder::new(StripeMethod::Post, format!("/setup_intents/{intent}/confirm"))
.form(&self.inner)
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
struct VerifyMicrodepositsSetupIntentBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
amounts: Option<Vec<i64>>,
#[serde(skip_serializing_if = "Option::is_none")]
descriptor_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
expand: Option<Vec<String>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for VerifyMicrodepositsSetupIntentBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("VerifyMicrodepositsSetupIntentBuilder").finish_non_exhaustive()
}
}
impl VerifyMicrodepositsSetupIntentBuilder {
fn new() -> Self {
Self { amounts: None, descriptor_code: None, expand: None }
}
}
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct VerifyMicrodepositsSetupIntent {
inner: VerifyMicrodepositsSetupIntentBuilder,
intent: stripe_shared::SetupIntentId,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for VerifyMicrodepositsSetupIntent {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("VerifyMicrodepositsSetupIntent").finish_non_exhaustive()
}
}
impl VerifyMicrodepositsSetupIntent {
pub fn new(intent: impl Into<stripe_shared::SetupIntentId>) -> Self {
Self { intent: intent.into(), inner: VerifyMicrodepositsSetupIntentBuilder::new() }
}
pub fn amounts(mut self, amounts: impl Into<Vec<i64>>) -> Self {
self.inner.amounts = Some(amounts.into());
self
}
pub fn descriptor_code(mut self, descriptor_code: impl Into<String>) -> Self {
self.inner.descriptor_code = Some(descriptor_code.into());
self
}
pub fn expand(mut self, expand: impl Into<Vec<String>>) -> Self {
self.inner.expand = Some(expand.into());
self
}
}
impl VerifyMicrodepositsSetupIntent {
pub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send(client).await
}
pub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err> {
self.customize().send_blocking(client)
}
}
impl StripeRequest for VerifyMicrodepositsSetupIntent {
type Output = stripe_shared::SetupIntent;
fn build(&self) -> RequestBuilder {
let intent = &self.intent;
RequestBuilder::new(
StripeMethod::Post,
format!("/setup_intents/{intent}/verify_microdeposits"),
)
.form(&self.inner)
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct OnlineParam {
pub ip_address: String,
pub user_agent: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for OnlineParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("OnlineParam").finish_non_exhaustive()
}
}
impl OnlineParam {
pub fn new(ip_address: impl Into<String>, user_agent: impl Into<String>) -> Self {
Self { ip_address: ip_address.into(), user_agent: user_agent.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct PaymentMethodParam {
pub account_number: String,
pub institution_number: String,
pub transit_number: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for PaymentMethodParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("PaymentMethodParam").finish_non_exhaustive()
}
}
impl PaymentMethodParam {
pub fn new(
account_number: impl Into<String>,
institution_number: impl Into<String>,
transit_number: impl Into<String>,
) -> Self {
Self {
account_number: account_number.into(),
institution_number: institution_number.into(),
transit_number: transit_number.into(),
}
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct BillingDetailsAddress {
#[serde(skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub line1: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub line2: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postal_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for BillingDetailsAddress {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("BillingDetailsAddress").finish_non_exhaustive()
}
}
impl BillingDetailsAddress {
pub fn new() -> Self {
Self { city: None, country: None, line1: None, line2: None, postal_code: None, state: None }
}
}
impl Default for BillingDetailsAddress {
fn default() -> Self {
Self::new()
}
}
#[derive(Copy, Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct DateOfBirth {
pub day: i64,
pub month: i64,
pub year: i64,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for DateOfBirth {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DateOfBirth").finish_non_exhaustive()
}
}
impl DateOfBirth {
pub fn new(day: impl Into<i64>, month: impl Into<i64>, year: impl Into<i64>) -> Self {
Self { day: day.into(), month: month.into(), year: year.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct RadarOptionsWithHiddenOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub session: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for RadarOptionsWithHiddenOptions {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("RadarOptionsWithHiddenOptions").finish_non_exhaustive()
}
}
impl RadarOptionsWithHiddenOptions {
pub fn new() -> Self {
Self { session: None }
}
}
impl Default for RadarOptionsWithHiddenOptions {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct PaymentMethodOptionsMandateOptionsParam {
#[serde(skip_serializing_if = "Option::is_none")]
pub reference_prefix: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for PaymentMethodOptionsMandateOptionsParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("PaymentMethodOptionsMandateOptionsParam").finish_non_exhaustive()
}
}
impl PaymentMethodOptionsMandateOptionsParam {
pub fn new() -> Self {
Self { reference_prefix: None }
}
}
impl Default for PaymentMethodOptionsMandateOptionsParam {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct SubscriptionNextBillingParam {
pub amount: i64,
pub date: String,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for SubscriptionNextBillingParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("SubscriptionNextBillingParam").finish_non_exhaustive()
}
}
impl SubscriptionNextBillingParam {
pub fn new(amount: impl Into<i64>, date: impl Into<String>) -> Self {
Self { amount: amount.into(), date: date.into() }
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct SetupIntentPaymentMethodOptionsParam {
#[serde(skip_serializing_if = "Option::is_none")]
pub persistent_token: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for SetupIntentPaymentMethodOptionsParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("SetupIntentPaymentMethodOptionsParam").finish_non_exhaustive()
}
}
impl SetupIntentPaymentMethodOptionsParam {
pub fn new() -> Self {
Self { persistent_token: None }
}
}
impl Default for SetupIntentPaymentMethodOptionsParam {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct PaymentMethodOptionsParam {
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_agreement_id: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for PaymentMethodOptionsParam {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("PaymentMethodOptionsParam").finish_non_exhaustive()
}
}
impl PaymentMethodOptionsParam {
pub fn new() -> Self {
Self { billing_agreement_id: None }
}
}
impl Default for PaymentMethodOptionsParam {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Eq, PartialEq)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[derive(serde::Serialize)]
pub struct BillingDetailsInnerParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<BillingDetailsAddress>,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_id: Option<String>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for BillingDetailsInnerParams {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("BillingDetailsInnerParams").finish_non_exhaustive()
}
}
impl BillingDetailsInnerParams {
pub fn new() -> Self {
Self { address: None, email: None, name: None, phone: None, tax_id: None }
}
}
impl Default for BillingDetailsInnerParams {
fn default() -> Self {
Self::new()
}
}