Skip to content

Commit

Permalink
feat: generate latest changes from OpenApi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Feb 2, 2024
1 parent af4b1e8 commit 29a457d
Show file tree
Hide file tree
Showing 18 changed files with 940 additions and 29 deletions.
2 changes: 1 addition & 1 deletion openapi/version.json
@@ -1,3 +1,3 @@
{
"version": "v796"
"version": "v808"
}
116 changes: 113 additions & 3 deletions src/resources/generated/account.rs
Expand Up @@ -10,7 +10,7 @@ use crate::params::{
Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp,
};
use crate::resources::{
Address, Currency, DelayDays, ExternalAccount, File, Person, PersonVerificationParams,
Address, Currency, DelayDays, ExternalAccount, File, Person, PersonVerificationParams, TaxId,
VerificationDocumentParams,
};

Expand Down Expand Up @@ -358,6 +358,10 @@ pub struct AccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort_payments: Option<AccountCapabilitiesSofortPayments>,

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

/// The status of the tax reporting 1099-K (US) capability of the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_reporting_us_1099_k: Option<CapabilityStatus>,
Expand Down Expand Up @@ -509,6 +513,9 @@ pub struct AccountSettings {

pub dashboard: DashboardSettings,

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

pub payments: PaymentsSettings,

#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -614,6 +621,14 @@ pub struct DeclineChargeOn {
pub cvc_failure: bool,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountInvoicesSettings {
/// The list of default Account Tax IDs to automatically include on invoices.
///
/// Account Tax IDs get added when an invoice is finalized.
pub default_account_tax_ids: Option<Vec<Expandable<TaxId>>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentsSettings {
/// The default text that appears on credit card statements when a charge is made.
Expand Down Expand Up @@ -935,7 +950,8 @@ pub struct CreateAccount<'a> {
///
/// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
/// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists.
/// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
/// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.
/// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
#[serde(skip_serializing_if = "Option::is_none")]
pub external_account: Option<&'a str>,

Expand Down Expand Up @@ -1098,7 +1114,8 @@ pub struct UpdateAccount<'a> {
///
/// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
/// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists.
/// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
/// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.
/// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
#[serde(skip_serializing_if = "Option::is_none")]
pub external_account: Option<&'a str>,

Expand Down Expand Up @@ -1416,6 +1433,10 @@ pub struct CreateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort_payments: Option<CreateAccountCapabilitiesSofortPayments>,

/// The swish_payments capability.
#[serde(skip_serializing_if = "Option::is_none")]
pub swish_payments: Option<CreateAccountCapabilitiesSwishPayments>,

/// The tax_reporting_us_1099_k capability.
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_reporting_us_1099_k: Option<CreateAccountCapabilitiesTaxReportingUs1099K>,
Expand Down Expand Up @@ -1569,6 +1590,10 @@ pub struct PersonParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub registered_address: Option<PersonParamsRegisteredAddress>,

/// Describes the person’s relationship to the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub relationship: Option<PersonParamsRelationship>,

/// The last four digits of the individual's Social Security Number (U.S.
///
/// only).
Expand Down Expand Up @@ -1706,6 +1731,10 @@ pub struct UpdateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort_payments: Option<UpdateAccountCapabilitiesSofortPayments>,

/// The swish_payments capability.
#[serde(skip_serializing_if = "Option::is_none")]
pub swish_payments: Option<UpdateAccountCapabilitiesSwishPayments>,

/// The tax_reporting_us_1099_k capability.
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_reporting_us_1099_k: Option<UpdateAccountCapabilitiesTaxReportingUs1099K>,
Expand Down Expand Up @@ -2177,6 +2206,16 @@ pub struct CreateAccountCapabilitiesSofortPayments {
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateAccountCapabilitiesSwishPayments {
/// Passing true requests the capability for the account, if it is not already requested.
///
/// A requested capability may not immediately become active.
/// Any requirements to activate the capability are returned in the `requirements` arrays.
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateAccountCapabilitiesTaxReportingUs1099K {
/// Passing true requests the capability for the account, if it is not already requested.
Expand Down Expand Up @@ -2363,6 +2402,31 @@ pub struct PersonParamsRegisteredAddress {
pub state: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PersonParamsRelationship {
/// Whether the person is a director of the account's legal entity.
///
/// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
#[serde(skip_serializing_if = "Option::is_none")]
pub director: Option<bool>,

/// Whether the person has significant responsibility to control, manage, or direct the organization.
#[serde(skip_serializing_if = "Option::is_none")]
pub executive: Option<bool>,

/// Whether the person is an owner of the account’s legal entity.
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<bool>,

/// The percent owned by the person of the account's legal entity.
#[serde(skip_serializing_if = "Option::is_none")]
pub percent_ownership: Option<f64>,

/// The person's title (e.g., CEO, Support Engineer).
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesAcssDebitPayments {
/// Passing true requests the capability for the account, if it is not already requested.
Expand Down Expand Up @@ -2673,6 +2737,16 @@ pub struct UpdateAccountCapabilitiesSofortPayments {
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesSwishPayments {
/// Passing true requests the capability for the account, if it is not already requested.
///
/// A requested capability may not immediately become active.
/// Any requirements to activate the capability are returned in the `requirements` arrays.
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesTaxReportingUs1099K {
/// Passing true requests the capability for the account, if it is not already requested.
Expand Down Expand Up @@ -3833,6 +3907,42 @@ impl std::default::Default for AccountCapabilitiesSofortPayments {
}
}

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

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

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

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

/// An enum representing the possible values of an `AccountCapabilities`'s `treasury` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
17 changes: 17 additions & 0 deletions src/resources/generated/charge.rs
Expand Up @@ -466,6 +466,9 @@ pub struct PaymentMethodDetails {
#[serde(skip_serializing_if = "Option::is_none")]
pub stripe_account: Option<PaymentMethodDetailsStripeAccount>,

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

/// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`.
/// An additional hash is included on `payment_method_details` with a name matching this value.
/// It contains information specific to the payment method.
Expand Down Expand Up @@ -1441,6 +1444,20 @@ pub struct PaymentMethodDetailsSofort {
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsStripeAccount {}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsSwish {
/// Uniquely identifies the payer's Swish account.
///
/// You can use this attribute to check whether two Swish transactions were paid for by the same payer.
pub fingerprint: Option<String>,

/// Payer bank reference number for the payment.
pub payment_reference: Option<String>,

/// The last four digits of the Swish account phone number.
pub verified_phone_last4: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsUsBankAccount {
/// Account holder type: individual or company.
Expand Down
32 changes: 28 additions & 4 deletions src/resources/generated/checkout_session.rs
Expand Up @@ -199,8 +199,7 @@ pub struct CheckoutSession {
/// Describes the type of transaction being performed by Checkout in order to customize
/// relevant text on the page, such as the submit button.
///
/// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode.
/// Possible values are `auto`, `pay`, `book`, `donate`.
/// `submit_type` can only be specified on Checkout Sessions in `payment` mode.
/// If blank or `auto`, `pay` is used.
pub submit_type: Option<CheckoutSessionSubmitType>,

Expand Down Expand Up @@ -338,6 +337,9 @@ pub struct CheckoutSessionPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort: Option<CheckoutSofortPaymentMethodOptions>,

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

#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<CheckoutUsBankAccountPaymentMethodOptions>,
}
Expand Down Expand Up @@ -741,6 +743,14 @@ pub struct CheckoutSofortPaymentMethodOptions {
pub setup_future_usage: Option<CheckoutSofortPaymentMethodOptionsSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutSwishPaymentMethodOptions {
/// The order reference that will be displayed to customers in the Swish application.
///
/// Defaults to the `id` of the Payment Intent.
pub reference: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutUsBankAccountPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1348,8 +1358,7 @@ pub struct CreateCheckoutSession<'a> {
/// Describes the type of transaction being performed by Checkout in order to customize
/// relevant text on the page, such as the submit button.
///
/// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode.
/// Possible values are `auto`, `pay`, `book`, `donate`.
/// `submit_type` can only be specified on Checkout Sessions in `payment` mode.
/// If blank or `auto`, `pay` is used.
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_type: Option<CheckoutSessionSubmitType>,
Expand Down Expand Up @@ -1873,6 +1882,10 @@ pub struct CreateCheckoutSessionPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub sofort: Option<CreateCheckoutSessionPaymentMethodOptionsSofort>,

/// contains details about the Swish payment method options.
#[serde(skip_serializing_if = "Option::is_none")]
pub swish: Option<CreateCheckoutSessionPaymentMethodOptionsSwish>,

/// contains details about the Us Bank Account payment method options.
#[serde(skip_serializing_if = "Option::is_none")]
pub us_bank_account: Option<CreateCheckoutSessionPaymentMethodOptionsUsBankAccount>,
Expand Down Expand Up @@ -2649,6 +2662,15 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsSofort {
pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsSwish {
/// The order reference that will be displayed to customers in the Swish application.
///
/// Defaults to the `id` of the Payment Intent.
#[serde(skip_serializing_if = "Option::is_none")]
pub reference: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount {
/// Additional fields for Financial Connections Session creation.
Expand Down Expand Up @@ -6818,6 +6840,7 @@ pub enum CreateCheckoutSessionPaymentMethodTypes {
RevolutPay,
SepaDebit,
Sofort,
Swish,
UsBankAccount,
WechatPay,
Zip,
Expand Down Expand Up @@ -6855,6 +6878,7 @@ impl CreateCheckoutSessionPaymentMethodTypes {
CreateCheckoutSessionPaymentMethodTypes::RevolutPay => "revolut_pay",
CreateCheckoutSessionPaymentMethodTypes::SepaDebit => "sepa_debit",
CreateCheckoutSessionPaymentMethodTypes::Sofort => "sofort",
CreateCheckoutSessionPaymentMethodTypes::Swish => "swish",
CreateCheckoutSessionPaymentMethodTypes::UsBankAccount => "us_bank_account",
CreateCheckoutSessionPaymentMethodTypes::WechatPay => "wechat_pay",
CreateCheckoutSessionPaymentMethodTypes::Zip => "zip",
Expand Down

0 comments on commit 29a457d

Please sign in to comment.