Skip to content

Commit

Permalink
Merge pull request #372 from arlyon/openapi-1683246234
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
  • Loading branch information
arlyon committed May 9, 2023
2 parents a934735 + 9ae5a04 commit 82a4fa8
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 10 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": "v318"
"version": "v322"
}
2 changes: 2 additions & 0 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ pub use {
payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*,
linked_account_options_us_bank_account::*,
payment_method_details_card_checks::*,
payment_method_details_card_wallet_apple_pay::*,
payment_method_details_card_wallet_google_pay::*,
payment_method_options_customer_balance_eu_bank_account::*,
payout::*,
platform_tax_fee::*,
Expand Down
2 changes: 2 additions & 0 deletions src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ pub mod core {
pub mod payment_intent;
pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code;
pub mod payment_method_details_card_checks;
pub mod payment_method_details_card_wallet_apple_pay;
pub mod payment_method_details_card_wallet_google_pay;
pub mod payment_method_options_customer_balance_eu_bank_account;
pub mod payout;
pub mod platform_tax_fee;
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,7 @@ pub struct TransferScheduleParams {
/// May also be set to `minimum`, representing the lowest available value for the account country.
/// Default is `minimum`.
/// The `delay_days` parameter does not apply when the `interval` is `manual`.
/// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule).
#[serde(skip_serializing_if = "Option::is_none")]
pub delay_days: Option<DelayDays>,

Expand Down
9 changes: 2 additions & 7 deletions src/resources/generated/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use crate::resources::{
Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails,
ChargeSourceParams, Currency, Customer, Dispute, Invoice, Mandate, PaymentIntent,
PaymentMethod, PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardInstallmentsPlan,
PaymentSource, RadarRadarOptions, Refund, Review, Shipping, ThreeDSecureDetails, Transfer,
PaymentMethodDetailsCardWalletApplePay, PaymentMethodDetailsCardWalletGooglePay, PaymentSource,
RadarRadarOptions, Refund, Review, Shipping, ThreeDSecureDetails, Transfer,
};

/// The resource representing a Stripe "Charge".
Expand Down Expand Up @@ -909,12 +910,6 @@ pub struct PaymentMethodDetailsCardWallet {
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {}

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

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardWalletMasterpass {
/// Owner's verified billing address.
Expand Down
99 changes: 99 additions & 0 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ pub struct CheckoutSessionPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub konbini: Option<CheckoutKonbiniPaymentMethodOptions>,

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

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

Expand Down Expand Up @@ -596,6 +599,17 @@ pub struct CheckoutKonbiniPaymentMethodOptions {
pub setup_future_usage: Option<CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutLinkPaymentMethodOptions {
/// 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.
///
/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<CheckoutLinkPaymentMethodOptionsSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CheckoutOxxoPaymentMethodOptions {
/// The number of calendar days before an OXXO invoice expires.
Expand Down Expand Up @@ -1640,6 +1654,10 @@ pub struct CreateCheckoutSessionPaymentMethodOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub konbini: Option<CreateCheckoutSessionPaymentMethodOptionsKonbini>,

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

/// contains details about the OXXO payment method options.
#[serde(skip_serializing_if = "Option::is_none")]
pub oxxo: Option<CreateCheckoutSessionPaymentMethodOptionsOxxo>,
Expand Down Expand Up @@ -2262,6 +2280,17 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini {
Option<CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsLink {
/// 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.
///
/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
#[serde(skip_serializing_if = "Option::is_none")]
pub setup_future_usage: Option<CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo {
/// The number of calendar days before an OXXO voucher expires.
Expand Down Expand Up @@ -3568,6 +3597,40 @@ impl std::default::Default for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsa
}
}

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

impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage {
pub fn as_str(self) -> &'static str {
match self {
CheckoutLinkPaymentMethodOptionsSetupFutureUsage::None => "none",
CheckoutLinkPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session",
}
}
}

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

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

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

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

impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage {
pub fn as_str(self) -> &'static str {
match self {
CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::None => "none",
CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::OffSession => {
"off_session"
}
}
}
}

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

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

/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsOxxo`'s `setup_future_usage` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ======================================
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "payment_method_details_card_wallet_apple_pay".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardWalletApplePay {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ======================================
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "payment_method_details_card_wallet_google_pay".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodDetailsCardWalletGooglePay {}
114 changes: 112 additions & 2 deletions src/resources/generated/setup_attempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use crate::ids::{SetupAttemptId, SetupIntentId};
use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp};
use crate::resources::{
Account, ApiErrors, Application, Customer, Mandate, PaymentMethod,
PaymentMethodDetailsCardChecks, SetupIntent, ThreeDSecureDetails,
PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardWalletApplePay,
PaymentMethodDetailsCardWalletGooglePay, SetupIntent, ThreeDSecureDetails,
};

/// The resource representing a Stripe "PaymentFlowsSetupIntentSetupAttempt".
Expand Down Expand Up @@ -191,11 +192,68 @@ pub struct SetupAttemptPaymentMethodDetailsBoleto {}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct SetupAttemptPaymentMethodDetailsCard {
/// Check results by Card networks on Card address and CVC at time of payment.
/// Card brand.
///
/// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
pub brand: Option<String>,

/// Check results by Card networks on Card address and CVC at the time of authorization.
pub checks: Option<PaymentMethodDetailsCardChecks>,

/// Two-letter ISO code representing the country of the card.
///
/// You could use this attribute to get a sense of the international breakdown of cards you've collected.
pub country: Option<String>,

/// A high-level description of the type of cards issued in this range.
///
/// (For internal use only and not typically available in standard API requests.).
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,

/// Two-digit number representing the card's expiration month.
pub exp_month: Option<i64>,

/// Four-digit number representing the card's expiration year.
pub exp_year: Option<i64>,

/// Uniquely identifies this particular card number.
///
/// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example.
/// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*.
#[serde(skip_serializing_if = "Option::is_none")]
pub fingerprint: Option<String>,

/// Card funding type.
///
/// Can be `credit`, `debit`, `prepaid`, or `unknown`.
pub funding: Option<String>,

/// Issuer identification number of the card.
///
/// (For internal use only and not typically available in standard API requests.).
#[serde(skip_serializing_if = "Option::is_none")]
pub iin: Option<String>,

/// The name of the card's issuing bank.
///
/// (For internal use only and not typically available in standard API requests.).
#[serde(skip_serializing_if = "Option::is_none")]
pub issuer: Option<String>,

/// The last four digits of the card.
pub last4: Option<String>,

/// Identifies which network this charge was processed on.
///
/// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.
pub network: Option<String>,

/// Populated if this authorization used 3D Secure authentication.
pub three_d_secure: Option<ThreeDSecureDetails>,

/// If this Card is part of a card wallet, this contains the details of the card wallet.
pub wallet: Option<SetupAttemptPaymentMethodDetailsCardWallet>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand All @@ -204,6 +262,22 @@ pub struct SetupAttemptPaymentMethodDetailsCardPresent {
pub generated_card: Option<Expandable<PaymentMethod>>,
}

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

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

/// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`.
///
/// An additional hash is included on the Wallet subhash with a name matching this value.
/// It contains additional information specific to the card wallet type.
#[serde(rename = "type")]
pub type_: SetupAttemptPaymentMethodDetailsCardWalletType,
}

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

Expand Down Expand Up @@ -404,6 +478,42 @@ impl std::default::Default for SetupAttemptPaymentMethodDetailsBancontactPreferr
}
}

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

impl SetupAttemptPaymentMethodDetailsCardWalletType {
pub fn as_str(self) -> &'static str {
match self {
SetupAttemptPaymentMethodDetailsCardWalletType::ApplePay => "apple_pay",
SetupAttemptPaymentMethodDetailsCardWalletType::GooglePay => "google_pay",
SetupAttemptPaymentMethodDetailsCardWalletType::Link => "link",
}
}
}

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

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

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

0 comments on commit 82a4fa8

Please sign in to comment.