Skip to content

Commit

Permalink
Merge pull request arlyon#253 from arlyon/openapi-1658839035
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
  • Loading branch information
arlyon authored Jul 30, 2022
2 parents b40493c + 650eb1a commit c1ed246
Show file tree
Hide file tree
Showing 5 changed files with 303 additions and 0 deletions.
100 changes: 100 additions & 0 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ pub struct CheckoutBoletoPaymentMethodOptions {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutCardPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub installments: Option<CheckoutCardInstallmentsOptions>,

/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
///
/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
Expand All @@ -453,6 +456,13 @@ pub struct CheckoutCardPaymentMethodOptions {
pub statement_descriptor_suffix_kanji: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutCardInstallmentsOptions {
/// Indicates if installments are enabled.
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutEpsPaymentMethodOptions {
/// Indicates that you intend to make future payments with this PaymentIntent's payment method.
Expand Down Expand Up @@ -1441,6 +1451,9 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub installments: Option<CreateCheckoutSessionPaymentMethodOptionsCardInstallments>,

#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage>,

Expand Down Expand Up @@ -1676,6 +1689,15 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions {
Option<CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments {
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,

#[serde(skip_serializing_if = "Option::is_none")]
pub plan: Option<CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlan>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1706,6 +1728,16 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
Option<CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlan {
pub count: u64,

pub interval: CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval,

#[serde(rename = "type")]
pub type_: CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum {
pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit,
Expand Down Expand Up @@ -3700,6 +3732,74 @@ impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBoletoSe
}
}

/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval {
Month,
}

impl CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval {
pub fn as_str(self) -> &'static str {
match self {
CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval::Month => "month",
}
}
}

impl AsRef<str> for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default
for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanInterval
{
fn default() -> Self {
Self::Month
}
}

/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlan`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType {
FixedCount,
}

impl CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType {
pub fn as_str(self) -> &'static str {
match self {
CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => {
"fixed_count"
}
}
}
}

impl AsRef<str> for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCardInstallmentsPlanType {
fn default() -> Self {
Self::FixedCount
}
}

/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCard`'s `setup_future_usage` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
106 changes: 106 additions & 0 deletions src/resources/generated/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ pub struct InvoicesPaymentMethodOptions {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct InvoicePaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub installments: Option<InvoiceInstallmentsCard>,

/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
///
/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
Expand All @@ -591,6 +594,13 @@ pub struct InvoicePaymentMethodOptionsCard {
pub request_three_d_secure: Option<InvoicePaymentMethodOptionsCardRequestThreeDSecure>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct InvoiceInstallmentsCard {
/// Whether Installments are enabled for this Invoice.
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct InvoicesResourceInvoiceTaxId {
/// The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown`.
Expand Down Expand Up @@ -970,6 +980,9 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard {
#[serde(skip_serializing_if = "Option::is_none")]
pub installments: Option<CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments>,

#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Option<CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure>,
Expand Down Expand Up @@ -1007,6 +1020,15 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptio
>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments {
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,

#[serde(skip_serializing_if = "Option::is_none")]
pub plan: Option<CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -1026,6 +1048,16 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancia
pub permissions: Option<Vec<CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan {
pub count: u64,

pub interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval,

#[serde(rename = "type")]
pub type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
{
Expand Down Expand Up @@ -1224,6 +1256,80 @@ impl std::default::Default
}
}

/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval {
Month,
}

impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval {
pub fn as_str(self) -> &'static str {
match self {
CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::Month => {
"month"
}
}
}
}

impl AsRef<str> for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display
for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default
for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval
{
fn default() -> Self {
Self::Month
}
}

/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType {
FixedCount,
}

impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType {
pub fn as_str(self) -> &'static str {
match self {
CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => "fixed_count",
}
}
}

impl AsRef<str> for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display
for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default
for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType
{
fn default() -> Self {
Self::FixedCount
}
}

/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
Loading

0 comments on commit c1ed246

Please sign in to comment.