Skip to content

Commit

Permalink
Merge pull request #206 from arlyon/openapi-1648778506
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
  • Loading branch information
arlyon committed Apr 2, 2022
2 parents 729e4a9 + afc40d2 commit d691b7c
Show file tree
Hide file tree
Showing 12 changed files with 603 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ pub use {
invoice_payment_method_options_bancontact::*,
invoice_payment_method_options_card::*,
invoice_payment_method_options_konbini::*,
invoice_payment_method_options_customer_balance::*,
invoice_payment_method_options_us_bank_account::*,
invoiceitem::*,
line_item::*,
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub mod billing {
pub mod invoice_payment_method_options_acss_debit;
pub mod invoice_payment_method_options_bancontact;
pub mod invoice_payment_method_options_card;
pub mod invoice_payment_method_options_customer_balance;
pub mod invoice_payment_method_options_konbini;
pub mod invoice_payment_method_options_us_bank_account;
pub mod invoiceitem;
Expand Down
118 changes: 117 additions & 1 deletion src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub struct Account {
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<String>,

/// Time at which the object was created.
/// Time at which the account was connected.
///
/// Measured in seconds since the Unix epoch.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -222,6 +222,10 @@ pub struct AccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub bancontact_payments: Option<AccountCapabilitiesBancontactPayments>,

/// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges.
#[serde(skip_serializing_if = "Option::is_none")]
pub bank_transfer_payments: Option<AccountCapabilitiesBankTransferPayments>,

/// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges.
#[serde(skip_serializing_if = "Option::is_none")]
pub boleto_payments: Option<AccountCapabilitiesBoletoPayments>,
Expand Down Expand Up @@ -305,6 +309,10 @@ pub struct AccountCapabilities {
/// The status of the transfers capability of the account, or whether your platform can transfer funds to the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub transfers: Option<CapabilityStatus>,

/// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges.
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account_ach_payments: Option<AccountCapabilitiesUsBankAccountAchPayments>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -1122,6 +1130,9 @@ pub struct CreateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub bancontact_payments: Option<CreateAccountCapabilitiesBancontactPayments>,

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

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

Expand Down Expand Up @@ -1184,6 +1195,9 @@ pub struct CreateAccountCapabilities {

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

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -1293,6 +1307,9 @@ pub struct UpdateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub bancontact_payments: Option<UpdateAccountCapabilitiesBancontactPayments>,

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

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

Expand Down Expand Up @@ -1355,6 +1372,9 @@ pub struct UpdateAccountCapabilities {

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

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -1462,6 +1482,12 @@ pub struct CreateAccountCapabilitiesBancontactPayments {
pub requested: Option<bool>,
}

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateAccountCapabilitiesBoletoPayments {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1588,6 +1614,12 @@ pub struct CreateAccountCapabilitiesTransfers {
pub requested: Option<bool>,
}

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateAccountDocumentsBankAccountOwnershipVerification {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1693,6 +1725,12 @@ pub struct UpdateAccountCapabilitiesBancontactPayments {
pub requested: Option<bool>,
}

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesBoletoPayments {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1819,6 +1857,12 @@ pub struct UpdateAccountCapabilitiesTransfers {
pub requested: Option<bool>,
}

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateAccountDocumentsBankAccountOwnershipVerification {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -2091,6 +2135,42 @@ impl std::default::Default for AccountCapabilitiesBancontactPayments {
}
}

/// An enum representing the possible values of an `AccountCapabilities`'s `bank_transfer_payments` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum AccountCapabilitiesBankTransferPayments {
Active,
Inactive,
Pending,
}

impl AccountCapabilitiesBankTransferPayments {
pub fn as_str(self) -> &'static str {
match self {
AccountCapabilitiesBankTransferPayments::Active => "active",
AccountCapabilitiesBankTransferPayments::Inactive => "inactive",
AccountCapabilitiesBankTransferPayments::Pending => "pending",
}
}
}

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

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

/// An enum representing the possible values of an `AccountCapabilities`'s `boleto_payments` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down Expand Up @@ -2595,6 +2675,42 @@ impl std::default::Default for AccountCapabilitiesSofortPayments {
}
}

/// An enum representing the possible values of an `AccountCapabilities`'s `us_bank_account_ach_payments` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum AccountCapabilitiesUsBankAccountAchPayments {
Active,
Inactive,
Pending,
}

impl AccountCapabilitiesUsBankAccountAchPayments {
pub fn as_str(self) -> &'static str {
match self {
AccountCapabilitiesUsBankAccountAchPayments::Active => "active",
AccountCapabilitiesUsBankAccountAchPayments::Inactive => "inactive",
AccountCapabilitiesUsBankAccountAchPayments::Pending => "pending",
}
}
}

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

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

/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
16 changes: 14 additions & 2 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::client::{Client, Response};
use crate::ids::{CheckoutSessionId, CustomerId, PaymentIntentId, SubscriptionId};
use crate::params::{Expand, Expandable, List, Metadata, Object, Timestamp};
use crate::resources::{
CheckoutSessionItem, Currency, Customer, Discount, PaymentIntent, PaymentLink, SetupIntent,
Shipping, ShippingRate, Subscription, TaxRate,
Address, CheckoutSessionItem, Currency, Customer, Discount, PaymentIntent, PaymentLink,
SetupIntent, Shipping, ShippingRate, Subscription, TaxRate,
};

/// The resource representing a Stripe "Session".
Expand Down Expand Up @@ -372,11 +372,23 @@ pub struct PaymentPagesCheckoutSessionConsentCollection {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionCustomerDetails {
/// The customer's address at the time of checkout.
///
/// Note: This property is populated only for sessions on or after March 30, 2022.
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Address>,

/// The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry.
/// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form.
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,

/// The customer's name at the time of checkout.
///
/// Note: This property is populated only for sessions on or after March 30, 2022.
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,

/// The customer's phone number at the time of checkout.
#[serde(skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
Expand Down
45 changes: 42 additions & 3 deletions src/resources/generated/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use crate::params::{Deleted, Expand, Expandable, List, Metadata, Object, RangeQu
use crate::resources::{
Account, Address, ApiErrors, Charge, Currency, Customer, Discount, InvoiceLineItem,
InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact,
InvoicePaymentMethodOptionsKonbini, InvoicePaymentMethodOptionsUsBankAccount, PaymentIntent,
PaymentMethod, PaymentSource, Quote, Shipping, Subscription, TaxId, TaxRate,
TestHelpersTestClock,
InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini,
InvoicePaymentMethodOptionsUsBankAccount, PaymentIntent, PaymentMethod, PaymentSource, Quote,
Shipping, Subscription, TaxId, TaxRate, TestHelpersTestClock,
};

/// The resource representing a Stripe "Invoice".
Expand Down Expand Up @@ -539,6 +539,10 @@ pub struct InvoicesPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub card: Option<InvoicePaymentMethodOptionsCard>,

/// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
#[serde(skip_serializing_if = "Option::is_none")]
pub customer_balance: Option<InvoicePaymentMethodOptionsCustomerBalance>,

/// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
#[serde(skip_serializing_if = "Option::is_none")]
pub konbini: Option<InvoicePaymentMethodOptionsKonbini>,
Expand Down Expand Up @@ -881,6 +885,9 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub card: Option<CreateInvoicePaymentSettingsPaymentMethodOptionsCard>,

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

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

Expand Down Expand Up @@ -913,6 +920,16 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard {
Option<CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure>,
}

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

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsKonbini {}

Expand All @@ -931,6 +948,24 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptio
>,
}

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

#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
{
pub country: String,
}

/// An enum representing the possible values of an `AutomaticTax`'s `status` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down Expand Up @@ -1215,6 +1250,7 @@ pub enum CreateInvoicePaymentSettingsPaymentMethodTypes {
Bancontact,
Boleto,
Card,
CustomerBalance,
Fpx,
Giropay,
Grabpay,
Expand All @@ -1240,6 +1276,7 @@ impl CreateInvoicePaymentSettingsPaymentMethodTypes {
CreateInvoicePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact",
CreateInvoicePaymentSettingsPaymentMethodTypes::Boleto => "boleto",
CreateInvoicePaymentSettingsPaymentMethodTypes::Card => "card",
CreateInvoicePaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance",
CreateInvoicePaymentSettingsPaymentMethodTypes::Fpx => "fpx",
CreateInvoicePaymentSettingsPaymentMethodTypes::Giropay => "giropay",
CreateInvoicePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay",
Expand Down Expand Up @@ -1521,6 +1558,7 @@ pub enum InvoicesPaymentSettingsPaymentMethodTypes {
Bancontact,
Boleto,
Card,
CustomerBalance,
Fpx,
Giropay,
Grabpay,
Expand All @@ -1544,6 +1582,7 @@ impl InvoicesPaymentSettingsPaymentMethodTypes {
InvoicesPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact",
InvoicesPaymentSettingsPaymentMethodTypes::Boleto => "boleto",
InvoicesPaymentSettingsPaymentMethodTypes::Card => "card",
InvoicesPaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance",
InvoicesPaymentSettingsPaymentMethodTypes::Fpx => "fpx",
InvoicesPaymentSettingsPaymentMethodTypes::Giropay => "giropay",
InvoicesPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay",
Expand Down
Loading

0 comments on commit d691b7c

Please sign in to comment.