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 Jan 10, 2024
1 parent 09ca099 commit 32e802e
Show file tree
Hide file tree
Showing 26 changed files with 1,240 additions and 62 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": "v706"
"version": "v751"
}
1 change: 1 addition & 0 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ pub use {
payment_method_details_card_wallet_apple_pay::*,
payment_method_details_card_wallet_google_pay::*,
payment_method_options_customer_balance_eu_bank_account::*,
payment_method_options_us_bank_account_mandate_options::*,
payment_method_config_biz_payment_method_configuration_details::*,
payout::*,
platform_tax_fee::*,
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub mod core {
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 payment_method_options_us_bank_account_mandate_options;
pub mod payout;
pub mod platform_tax_fee;
pub mod price;
Expand Down
71 changes: 53 additions & 18 deletions src/resources/generated/account_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use crate::client::{Client, Response};
use crate::ids::{AccountId};
use crate::params::{Expand, Object, Timestamp};
use crate::resources::{ConnectEmbeddedBaseFeatures};
use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession".
Expand Down Expand Up @@ -54,33 +53,24 @@ pub struct ConnectEmbeddedAccountSessionCreateComponents {

pub account_onboarding: ConnectEmbeddedBaseConfigClaim,

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

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

#[serde(skip_serializing_if = "Option::is_none")]
pub payouts: Option<ConnectEmbeddedBaseConfig>,
pub payouts: ConnectEmbeddedPayoutsConfig,
}

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

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

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

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

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

pub features: ConnectEmbeddedBaseFeatures,
pub struct ConnectEmbeddedBaseFeatures {
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand All @@ -89,8 +79,7 @@ pub struct ConnectEmbeddedPaymentsConfig {
/// Whether the embedded component is enabled.
pub enabled: bool,

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

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
Expand All @@ -112,6 +101,34 @@ pub struct ConnectEmbeddedPaymentsFeatures {
pub refund_management: bool,
}

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

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

pub features: ConnectEmbeddedPayoutsFeatures,
}

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

/// Whether to allow payout schedule to be changed.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
pub edit_payout_schedule: bool,

/// Whether to allow creation of instant payouts.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
pub instant_payouts: bool,

/// Whether to allow creation of standard payouts.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
pub standard_payouts: bool,
}

/// The parameters for `AccountSession::create`.
#[derive(Clone, Debug, Serialize)]
pub struct CreateAccountSession<'a> {
Expand Down Expand Up @@ -253,4 +270,22 @@ pub struct CreateAccountSessionComponentsPaymentsFeatures {

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

/// Whether to allow payout schedule to be changed.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
#[serde(skip_serializing_if = "Option::is_none")]
pub edit_payout_schedule: Option<bool>,

/// Whether to allow creation of instant payouts.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
#[serde(skip_serializing_if = "Option::is_none")]
pub instant_payouts: Option<bool>,

/// Whether to allow creation of standard payouts.
///
/// Default `true` when Stripe owns Loss Liability, default `false` otherwise.
#[serde(skip_serializing_if = "Option::is_none")]
pub standard_payouts: Option<bool>,
}
123 changes: 123 additions & 0 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ pub struct CheckoutSession {
/// 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`.
/// If blank or `auto`, `pay` is used.
pub submit_type: Option<CheckoutSessionSubmitType>,

/// The ID of the subscription for Checkout Sessions in `subscription` mode.
Expand Down Expand Up @@ -804,6 +806,10 @@ pub struct PaymentPagesCheckoutSessionConsent {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionConsentCollection {
/// If set to `hidden`, it will hide legal text related to the reuse of a payment method.
pub payment_method_reuse_agreement:
Option<PaymentPagesCheckoutSessionPaymentMethodReuseAgreement>,

/// If set to `auto`, enables the collection of customer consent for promotional communications.
///
/// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale.
Expand Down Expand Up @@ -921,6 +927,9 @@ pub struct PaymentPagesCheckoutSessionCustomFieldsText {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionCustomText {
/// Custom text that should be displayed after the payment confirmation button.
pub after_submit: Option<PaymentPagesCheckoutSessionCustomTextPosition>,

/// Custom text that should be displayed alongside shipping address collection.
pub shipping_address: Option<PaymentPagesCheckoutSessionCustomTextPosition>,

Expand Down Expand Up @@ -1005,6 +1014,14 @@ pub struct InvoiceSettingCustomField {
pub value: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionPaymentMethodReuseAgreement {
/// Determines the position and visibility of the payment method reuse agreement in the UI.
///
/// When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
pub position: PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentPagesCheckoutSessionPhoneNumberCollection {
/// Indicates whether phone number collection is enabled for the session.
Expand Down Expand Up @@ -1321,6 +1338,8 @@ pub struct CreateCheckoutSession<'a> {
/// 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`.
/// If blank or `auto`, `pay` is used.
#[serde(skip_serializing_if = "Option::is_none")]
pub submit_type: Option<CheckoutSessionSubmitType>,

Expand Down Expand Up @@ -1486,6 +1505,13 @@ pub struct CreateCheckoutSessionAutomaticTax {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionConsentCollection {
/// Determines the display of payment method reuse agreement text in the UI.
///
/// If set to `hidden`, it will hide legal text related to the reuse of a payment method.
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method_reuse_agreement:
Option<CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement>,

/// If set to `auto`, enables the collection of customer consent for promotional communications.
///
/// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale.
Expand Down Expand Up @@ -1534,6 +1560,10 @@ pub struct CreateCheckoutSessionCustomFields {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomText {
/// Custom text that should be displayed after the payment confirmation button.
#[serde(skip_serializing_if = "Option::is_none")]
pub after_submit: Option<CreateCheckoutSessionCustomTextAfterSubmit>,

/// Custom text that should be displayed alongside shipping address collection.
#[serde(skip_serializing_if = "Option::is_none")]
pub shipping_address: Option<CreateCheckoutSessionCustomTextShippingAddress>,
Expand Down Expand Up @@ -1976,6 +2006,15 @@ pub struct CreateCheckoutSessionAfterExpirationRecovery {
pub enabled: bool,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement {
/// Determines the position and visibility of the payment method reuse agreement in the UI.
///
/// When set to `auto`, Stripe's defaults will be used.
/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
pub position: CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomFieldsDropdown {
/// The options available for the customer to select.
Expand Down Expand Up @@ -2018,6 +2057,12 @@ pub struct CreateCheckoutSessionCustomFieldsText {
pub minimum_length: Option<i64>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomTextAfterSubmit {
/// Text may be up to 1200 characters in length.
pub message: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateCheckoutSessionCustomTextShippingAddress {
/// Text may be up to 1200 characters in length.
Expand Down Expand Up @@ -4579,6 +4624,48 @@ impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsVerifica
}
}

/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement`'s `position` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
Auto,
Hidden,
}

impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition {
pub fn as_str(self) -> &'static str {
match self {
CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::Auto => {
"auto"
}
CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::Hidden => {
"hidden"
}
}
}
}

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

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

/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollection`'s `promotions` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down Expand Up @@ -6373,12 +6460,14 @@ impl std::default::Default
#[serde(rename_all = "snake_case")]
pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
Balances,
Transactions,
}

impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
pub fn as_str(self) -> &'static str {
match self {
CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances",
CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions",
}
}
}
Expand Down Expand Up @@ -8015,6 +8104,40 @@ impl std::default::Default for PaymentPagesCheckoutSessionCustomerDetailsTaxExem
}
}

/// An enum representing the possible values of an `PaymentPagesCheckoutSessionPaymentMethodReuseAgreement`'s `position` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition {
Auto,
Hidden,
}

impl PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition {
pub fn as_str(self) -> &'static str {
match self {
PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::Auto => "auto",
PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::Hidden => "hidden",
}
}
}

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

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

/// An enum representing the possible values of an `PaymentPagesCheckoutSessionShippingAddressCollection`'s `allowed_countries` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/customer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ pub struct CreateCustomerTax {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CustomerInvoiceSettings {
/// Default custom fields to be displayed on invoices for this customer.
/// The list of up to 4 default custom fields to be displayed on invoices for this customer.
///
/// When updating, pass an empty string to remove previously-defined fields.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
Loading

0 comments on commit 32e802e

Please sign in to comment.