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 Mar 29, 2024
1 parent ee601fd commit feb3d20
Show file tree
Hide file tree
Showing 163 changed files with 7,852 additions and 5,790 deletions.
2 changes: 1 addition & 1 deletion openapi/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v814"
"version": "v915"
}
342 changes: 308 additions & 34 deletions src/resources/generated/account.rs

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/resources/generated/account_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::AccountId;
use crate::ids::{AccountId};
use crate::params::{Expand, Object, Timestamp};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "AccountLink".
///
/// For more details see <https://stripe.com/docs/api/account_links/object>
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountLink {

/// Time at which the object was created.
///
/// Measured in seconds since the Unix epoch.
Expand All @@ -26,6 +26,7 @@ pub struct AccountLink {
}

impl AccountLink {

/// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
pub fn create(client: &Client, params: CreateAccountLink<'_>) -> Response<AccountLink> {
client.post_form("/account_links", &params)
Expand All @@ -43,6 +44,7 @@ impl Object for AccountLink {
/// The parameters for `AccountLink::create`.
#[derive(Clone, Debug, Serialize)]
pub struct CreateAccountLink<'a> {

/// The identifier of the account to create an account link for.
pub account: AccountId,

Expand Down Expand Up @@ -94,6 +96,7 @@ impl<'a> CreateAccountLink<'a> {

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

/// Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`).
///
/// If you don't specify `collection_options`, the default value is `currently_due`.
Expand Down
54 changes: 53 additions & 1 deletion src/resources/generated/account_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ impl Object for AccountSession {
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ConnectEmbeddedAccountSessionCreateComponents {

pub account_onboarding: ConnectEmbeddedBaseConfigClaim,
pub account_onboarding: ConnectEmbeddedAccountConfig,

pub documents: ConnectEmbeddedBaseConfigClaim,

pub payment_details: ConnectEmbeddedPaymentsConfig,

Expand All @@ -60,6 +62,19 @@ pub struct ConnectEmbeddedAccountSessionCreateComponents {
pub payouts: ConnectEmbeddedPayoutsConfig,
}

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

/// Whether the embedded component is enabled.
pub enabled: bool,

pub features: ConnectEmbeddedAccountFeatures,
}

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

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

Expand Down Expand Up @@ -90,6 +105,12 @@ pub struct ConnectEmbeddedPaymentsFeatures {
/// This is `true` by default.
pub capture_payments: bool,

/// Whether to allow connected accounts to manage destination charges that are created on behalf of them.
///
/// This is `false` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_on_behalf_of_charge_management: Option<bool>,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
Expand Down Expand Up @@ -163,6 +184,10 @@ pub struct CreateAccountSessionComponents {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_onboarding: Option<CreateAccountSessionComponentsAccountOnboarding>,

/// Configuration for the documents embedded component.
#[serde(skip_serializing_if = "Option::is_none")]
pub documents: Option<CreateAccountSessionComponentsDocuments>,

/// Configuration for the payment details embedded component.
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_details: Option<CreateAccountSessionComponentsPaymentDetails>,
Expand All @@ -187,6 +212,17 @@ pub struct CreateAccountSessionComponentsAccountOnboarding {
pub features: Option<CreateAccountSessionComponentsAccountOnboardingFeatures>,
}

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

/// Whether the embedded component is enabled.
pub enabled: bool,

/// The list of features enabled in the embedded component.
#[serde(skip_serializing_if = "Option::is_none")]
pub features: Option<CreateAccountSessionComponentsDocumentsFeatures>,
}

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

Expand Down Expand Up @@ -224,6 +260,10 @@ pub struct CreateAccountSessionComponentsPayouts {
pub struct CreateAccountSessionComponentsAccountOnboardingFeatures {
}

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

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

Expand All @@ -233,6 +273,12 @@ pub struct CreateAccountSessionComponentsPaymentDetailsFeatures {
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_payments: Option<bool>,

/// Whether to allow connected accounts to manage destination charges that are created on behalf of them.
///
/// This is `false` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_on_behalf_of_charge_management: Option<bool>,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
Expand All @@ -255,6 +301,12 @@ pub struct CreateAccountSessionComponentsPaymentsFeatures {
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_payments: Option<bool>,

/// Whether to allow connected accounts to manage destination charges that are created on behalf of them.
///
/// This is `false` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_on_behalf_of_charge_management: Option<bool>,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize};
/// The resource representing a Stripe "Address".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Address {

/// City, district, suburb, town, or village.
pub city: Option<String>,

Expand Down
104 changes: 33 additions & 71 deletions src/resources/generated/api_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::resources::{PaymentIntent, PaymentMethod, PaymentSource, SetupIntent};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "APIErrors".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ApiErrors {

/// For card errors, the ID of the failed charge.
#[serde(skip_serializing_if = "Option::is_none")]
pub charge: Option<String>,
Expand Down Expand Up @@ -118,6 +118,10 @@ pub enum ApiErrorsCode {
ExpiredCard,
FinancialConnectionsAccountInactive,
FinancialConnectionsNoSuccessfulTransactionRefresh,
ForwardingApiInactive,
ForwardingApiInvalidParameter,
ForwardingApiUpstreamConnectionError,
ForwardingApiUpstreamConnectionTimeout,
IdempotencyKeyInUse,
IncorrectAddress,
IncorrectCvc,
Expand Down Expand Up @@ -240,9 +244,7 @@ impl ApiErrorsCode {
match self {
ApiErrorsCode::AccountClosed => "account_closed",
ApiErrorsCode::AccountCountryInvalidAddress => "account_country_invalid_address",
ApiErrorsCode::AccountErrorCountryChangeRequiresAdditionalSteps => {
"account_error_country_change_requires_additional_steps"
}
ApiErrorsCode::AccountErrorCountryChangeRequiresAdditionalSteps => "account_error_country_change_requires_additional_steps",
ApiErrorsCode::AccountInformationMismatch => "account_information_mismatch",
ApiErrorsCode::AccountInvalid => "account_invalid",
ApiErrorsCode::AccountNumberInvalid => "account_number_invalid",
Expand All @@ -264,9 +266,7 @@ impl ApiErrorsCode {
ApiErrorsCode::BankAccountVerificationFailed => "bank_account_verification_failed",
ApiErrorsCode::BillingInvalidMandate => "billing_invalid_mandate",
ApiErrorsCode::BitcoinUpgradeRequired => "bitcoin_upgrade_required",
ApiErrorsCode::CaptureChargeAuthorizationExpired => {
"capture_charge_authorization_expired"
}
ApiErrorsCode::CaptureChargeAuthorizationExpired => "capture_charge_authorization_expired",
ApiErrorsCode::CaptureUnauthorizedPayment => "capture_unauthorized_payment",
ApiErrorsCode::CardDeclineRateLimitExceeded => "card_decline_rate_limit_exceeded",
ApiErrorsCode::CardDeclined => "card_declined",
Expand All @@ -288,12 +288,12 @@ impl ApiErrorsCode {
ApiErrorsCode::DebitNotAuthorized => "debit_not_authorized",
ApiErrorsCode::EmailInvalid => "email_invalid",
ApiErrorsCode::ExpiredCard => "expired_card",
ApiErrorsCode::FinancialConnectionsAccountInactive => {
"financial_connections_account_inactive"
}
ApiErrorsCode::FinancialConnectionsNoSuccessfulTransactionRefresh => {
"financial_connections_no_successful_transaction_refresh"
}
ApiErrorsCode::FinancialConnectionsAccountInactive => "financial_connections_account_inactive",
ApiErrorsCode::FinancialConnectionsNoSuccessfulTransactionRefresh => "financial_connections_no_successful_transaction_refresh",
ApiErrorsCode::ForwardingApiInactive => "forwarding_api_inactive",
ApiErrorsCode::ForwardingApiInvalidParameter => "forwarding_api_invalid_parameter",
ApiErrorsCode::ForwardingApiUpstreamConnectionError => "forwarding_api_upstream_connection_error",
ApiErrorsCode::ForwardingApiUpstreamConnectionTimeout => "forwarding_api_upstream_connection_timeout",
ApiErrorsCode::IdempotencyKeyInUse => "idempotency_key_in_use",
ApiErrorsCode::IncorrectAddress => "incorrect_address",
ApiErrorsCode::IncorrectCvc => "incorrect_cvc",
Expand All @@ -320,9 +320,7 @@ impl ApiErrorsCode {
ApiErrorsCode::InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items",
ApiErrorsCode::InvoiceNotEditable => "invoice_not_editable",
ApiErrorsCode::InvoiceOnBehalfOfNotEditable => "invoice_on_behalf_of_not_editable",
ApiErrorsCode::InvoicePaymentIntentRequiresAction => {
"invoice_payment_intent_requires_action"
}
ApiErrorsCode::InvoicePaymentIntentRequiresAction => "invoice_payment_intent_requires_action",
ApiErrorsCode::InvoiceUpcomingNone => "invoice_upcoming_none",
ApiErrorsCode::LivemodeMismatch => "livemode_mismatch",
ApiErrorsCode::LockTimeout => "lock_timeout",
Expand All @@ -339,56 +337,28 @@ impl ApiErrorsCode {
ApiErrorsCode::ParameterUnknown => "parameter_unknown",
ApiErrorsCode::ParametersExclusive => "parameters_exclusive",
ApiErrorsCode::PaymentIntentActionRequired => "payment_intent_action_required",
ApiErrorsCode::PaymentIntentAuthenticationFailure => {
"payment_intent_authentication_failure"
}
ApiErrorsCode::PaymentIntentIncompatiblePaymentMethod => {
"payment_intent_incompatible_payment_method"
}
ApiErrorsCode::PaymentIntentAuthenticationFailure => "payment_intent_authentication_failure",
ApiErrorsCode::PaymentIntentIncompatiblePaymentMethod => "payment_intent_incompatible_payment_method",
ApiErrorsCode::PaymentIntentInvalidParameter => "payment_intent_invalid_parameter",
ApiErrorsCode::PaymentIntentKonbiniRejectedConfirmationNumber => {
"payment_intent_konbini_rejected_confirmation_number"
}
ApiErrorsCode::PaymentIntentKonbiniRejectedConfirmationNumber => "payment_intent_konbini_rejected_confirmation_number",
ApiErrorsCode::PaymentIntentMandateInvalid => "payment_intent_mandate_invalid",
ApiErrorsCode::PaymentIntentPaymentAttemptExpired => {
"payment_intent_payment_attempt_expired"
}
ApiErrorsCode::PaymentIntentPaymentAttemptFailed => {
"payment_intent_payment_attempt_failed"
}
ApiErrorsCode::PaymentIntentPaymentAttemptExpired => "payment_intent_payment_attempt_expired",
ApiErrorsCode::PaymentIntentPaymentAttemptFailed => "payment_intent_payment_attempt_failed",
ApiErrorsCode::PaymentIntentUnexpectedState => "payment_intent_unexpected_state",
ApiErrorsCode::PaymentMethodBankAccountAlreadyVerified => {
"payment_method_bank_account_already_verified"
}
ApiErrorsCode::PaymentMethodBankAccountAlreadyVerified => "payment_method_bank_account_already_verified",
ApiErrorsCode::PaymentMethodBankAccountBlocked => "payment_method_bank_account_blocked",
ApiErrorsCode::PaymentMethodBillingDetailsAddressMissing => {
"payment_method_billing_details_address_missing"
}
ApiErrorsCode::PaymentMethodConfigurationFailures => {
"payment_method_configuration_failures"
}
ApiErrorsCode::PaymentMethodBillingDetailsAddressMissing => "payment_method_billing_details_address_missing",
ApiErrorsCode::PaymentMethodConfigurationFailures => "payment_method_configuration_failures",
ApiErrorsCode::PaymentMethodCurrencyMismatch => "payment_method_currency_mismatch",
ApiErrorsCode::PaymentMethodCustomerDecline => "payment_method_customer_decline",
ApiErrorsCode::PaymentMethodInvalidParameter => "payment_method_invalid_parameter",
ApiErrorsCode::PaymentMethodInvalidParameterTestmode => {
"payment_method_invalid_parameter_testmode"
}
ApiErrorsCode::PaymentMethodInvalidParameterTestmode => "payment_method_invalid_parameter_testmode",
ApiErrorsCode::PaymentMethodMicrodepositFailed => "payment_method_microdeposit_failed",
ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsInvalid => {
"payment_method_microdeposit_verification_amounts_invalid"
}
ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsMismatch => {
"payment_method_microdeposit_verification_amounts_mismatch"
}
ApiErrorsCode::PaymentMethodMicrodepositVerificationAttemptsExceeded => {
"payment_method_microdeposit_verification_attempts_exceeded"
}
ApiErrorsCode::PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => {
"payment_method_microdeposit_verification_descriptor_code_mismatch"
}
ApiErrorsCode::PaymentMethodMicrodepositVerificationTimeout => {
"payment_method_microdeposit_verification_timeout"
}
ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsInvalid => "payment_method_microdeposit_verification_amounts_invalid",
ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsMismatch => "payment_method_microdeposit_verification_amounts_mismatch",
ApiErrorsCode::PaymentMethodMicrodepositVerificationAttemptsExceeded => "payment_method_microdeposit_verification_attempts_exceeded",
ApiErrorsCode::PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => "payment_method_microdeposit_verification_descriptor_code_mismatch",
ApiErrorsCode::PaymentMethodMicrodepositVerificationTimeout => "payment_method_microdeposit_verification_timeout",
ApiErrorsCode::PaymentMethodNotAvailable => "payment_method_not_available",
ApiErrorsCode::PaymentMethodProviderDecline => "payment_method_provider_decline",
ApiErrorsCode::PaymentMethodProviderTimeout => "payment_method_provider_timeout",
Expand All @@ -403,9 +373,7 @@ impl ApiErrorsCode {
ApiErrorsCode::PostalCodeInvalid => "postal_code_invalid",
ApiErrorsCode::ProcessingError => "processing_error",
ApiErrorsCode::ProductInactive => "product_inactive",
ApiErrorsCode::ProgressiveOnboardingLimitExceeded => {
"progressive_onboarding_limit_exceeded"
}
ApiErrorsCode::ProgressiveOnboardingLimitExceeded => "progressive_onboarding_limit_exceeded",
ApiErrorsCode::RateLimit => "rate_limit",
ApiErrorsCode::ReferToCustomer => "refer_to_customer",
ApiErrorsCode::RefundDisputedPayment => "refund_disputed_payment",
Expand All @@ -416,9 +384,7 @@ impl ApiErrorsCode {
ApiErrorsCode::SecretKeyRequired => "secret_key_required",
ApiErrorsCode::SepaUnsupportedAccount => "sepa_unsupported_account",
ApiErrorsCode::SetupAttemptFailed => "setup_attempt_failed",
ApiErrorsCode::SetupIntentAuthenticationFailure => {
"setup_intent_authentication_failure"
}
ApiErrorsCode::SetupIntentAuthenticationFailure => "setup_intent_authentication_failure",
ApiErrorsCode::SetupIntentInvalidParameter => "setup_intent_invalid_parameter",
ApiErrorsCode::SetupIntentMandateInvalid => "setup_intent_mandate_invalid",
ApiErrorsCode::SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired",
Expand All @@ -430,9 +396,7 @@ impl ApiErrorsCode {
ApiErrorsCode::StripeTaxInactive => "stripe_tax_inactive",
ApiErrorsCode::TaxIdInvalid => "tax_id_invalid",
ApiErrorsCode::TaxesCalculationFailed => "taxes_calculation_failed",
ApiErrorsCode::TerminalLocationCountryUnsupported => {
"terminal_location_country_unsupported"
}
ApiErrorsCode::TerminalLocationCountryUnsupported => "terminal_location_country_unsupported",
ApiErrorsCode::TerminalReaderBusy => "terminal_reader_busy",
ApiErrorsCode::TerminalReaderHardwareFault => "terminal_reader_hardware_fault",
ApiErrorsCode::TerminalReaderOffline => "terminal_reader_offline",
Expand All @@ -442,9 +406,7 @@ impl ApiErrorsCode {
ApiErrorsCode::TokenAlreadyUsed => "token_already_used",
ApiErrorsCode::TokenCardNetworkInvalid => "token_card_network_invalid",
ApiErrorsCode::TokenInUse => "token_in_use",
ApiErrorsCode::TransferSourceBalanceParametersMismatch => {
"transfer_source_balance_parameters_mismatch"
}
ApiErrorsCode::TransferSourceBalanceParametersMismatch => "transfer_source_balance_parameters_mismatch",
ApiErrorsCode::TransfersNotAllowed => "transfers_not_allowed",
ApiErrorsCode::UrlInvalid => "url_invalid",
}
Expand Down
5 changes: 2 additions & 3 deletions src/resources/generated/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// This file was automatically generated.
// ======================================

use crate::ids::{ApplicationId};
use crate::params::{Object};
use serde::{Deserialize, Serialize};

use crate::ids::ApplicationId;
use crate::params::Object;

/// The resource representing a Stripe "Application".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Application {
Expand Down
Loading

0 comments on commit feb3d20

Please sign in to comment.