Skip to content

Commit

Permalink
Generate latest changes from OpenApi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon authored Aug 25, 2023
1 parent 3dd6fec commit 2e6e574
Show file tree
Hide file tree
Showing 109 changed files with 3,941 additions and 3,846 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": "v446"
"version": "v484"
}
213 changes: 176 additions & 37 deletions src/resources/generated/account.rs

Large diffs are not rendered by default.

12 changes: 5 additions & 7 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 @@ -128,17 +130,13 @@ impl std::default::Default for AccountLinkCollect {
pub enum AccountLinkType {
AccountOnboarding,
AccountUpdate,
CustomAccountUpdate,
CustomAccountVerification,
}

impl AccountLinkType {
pub fn as_str(self) -> &'static str {
match self {
AccountLinkType::AccountOnboarding => "account_onboarding",
AccountLinkType::AccountUpdate => "account_update",
AccountLinkType::CustomAccountUpdate => "custom_account_update",
AccountLinkType::CustomAccountVerification => "custom_account_verification",
}
}
}
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
88 changes: 23 additions & 65 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 @@ -233,9 +233,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 @@ -256,9 +254,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 Down Expand Up @@ -305,9 +301,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 @@ -324,56 +318,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 @@ -388,9 +354,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 @@ -401,9 +365,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 @@ -414,19 +376,15 @@ impl ApiErrorsCode {
ApiErrorsCode::StatusTransitionInvalid => "status_transition_invalid",
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::TerminalReaderOffline => "terminal_reader_offline",
ApiErrorsCode::TerminalReaderTimeout => "terminal_reader_timeout",
ApiErrorsCode::TestmodeChargesOnly => "testmode_charges_only",
ApiErrorsCode::TlsVersionUnsupported => "tls_version_unsupported",
ApiErrorsCode::TokenAlreadyUsed => "token_already_used",
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
30 changes: 11 additions & 19 deletions src/resources/generated/application_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

use crate::client::{Client, Response};
use crate::ids::{ApplicationFeeId, ChargeId};
use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp};
use crate::resources::{
Account, Application, ApplicationFeeRefund, BalanceTransaction, Charge, Currency,
};
use crate::resources::{Account, Application, ApplicationFeeRefund, BalanceTransaction, Charge, Currency};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "PlatformFee".
///
Expand Down Expand Up @@ -63,24 +60,19 @@ pub struct ApplicationFee {
}

impl ApplicationFee {

/// Returns a list of application fees you’ve previously collected.
///
/// The application fees are returned in sorted order, with the most recent fees appearing first.
pub fn list(
client: &Client,
params: &ListApplicationFees<'_>,
) -> Response<List<ApplicationFee>> {
client.get_query("/application_fees", &params)
}
pub fn list(client: &Client, params: &ListApplicationFees<'_>) -> Response<List<ApplicationFee>> {
client.get_query("/application_fees", &params)
}


/// Retrieves the details of an application fee that your account has collected.
///
/// The same information is returned when refunding the application fee.
pub fn retrieve(
client: &Client,
id: &ApplicationFeeId,
expand: &[&str],
) -> Response<ApplicationFee> {
pub fn retrieve(client: &Client, id: &ApplicationFeeId, expand: &[&str]) -> Response<ApplicationFee> {
client.get_query(&format!("/application_fees/{}", id), &Expand { expand })
}
}
Expand All @@ -98,6 +90,7 @@ impl Object for ApplicationFee {
/// The parameters for `ApplicationFee::list`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct ListApplicationFees<'a> {

/// Only return application fees for the charge specified by this charge ID.
#[serde(skip_serializing_if = "Option::is_none")]
pub charge: Option<ChargeId>,
Expand Down Expand Up @@ -145,6 +138,5 @@ impl<'a> ListApplicationFees<'a> {
impl Paginable for ListApplicationFees<'_> {
type O = ApplicationFee;
fn set_last(&mut self, item: Self::O) {
self.starting_after = Some(item.id());
}
}
self.starting_after = Some(item.id());
}}
9 changes: 6 additions & 3 deletions src/resources/generated/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// This file was automatically generated.
// ======================================

use crate::params::{Object};
use crate::resources::{Currency};
use serde::{Deserialize, Serialize};

use crate::params::Object;
use crate::resources::Currency;

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

/// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts).
///
/// The available balance for each currency and payment type can be found in the `source_types` property.
Expand Down Expand Up @@ -49,6 +49,7 @@ impl Object for Balance {

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

/// Balance amount.
pub amount: i64,

Expand All @@ -63,6 +64,7 @@ pub struct BalanceAmount {

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

/// Amount for bank account.
#[serde(skip_serializing_if = "Option::is_none")]
pub bank_account: Option<i64>,
Expand All @@ -78,6 +80,7 @@ pub struct BalanceAmountBySourceType {

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

/// Funds that are available for use.
pub available: Vec<BalanceAmount>,
}
Loading

0 comments on commit 2e6e574

Please sign in to comment.