Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate latest changes from OpenApi spec #457

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openapi/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v692"
"version": "v706"
}
1 change: 1 addition & 0 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

mod currency;
pub mod generated;
mod placeholders;

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

file is loaded as a module multiple times: `src/resources/placeholders.rs`
mod types;

#[path = "resources"]
Expand Down Expand Up @@ -97,7 +97,7 @@
}

#[rustfmt::skip]
pub use {

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

ambiguous glob re-exports

Check warning on line 100 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

ambiguous glob re-exports
currency::*,
types::*,

Expand Down Expand Up @@ -229,6 +229,7 @@
// need to import this afterwards so that the SubscriptionItemPriceDataRecurring
// isn't silently ignored
subscription::*,
subscriptions_trials_resource_trial_settings::*,
subscription::PlanInterval as SubscriptionInterval,
subscription::SubscriptionItemPriceDataRecurring as SubscriptionPriceDataRecurring,
subscription::SubscriptionItemPriceData as SubscriptionPriceData,
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub mod billing {
pub mod subscription_item;
pub mod subscription_item_billing_thresholds;
pub mod subscription_schedule;
pub mod subscriptions_trials_resource_trial_settings;
pub mod tax_id;
pub mod tax_rate;
pub mod usage_record;
Expand Down
152 changes: 152 additions & 0 deletions src/resources/generated/account_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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 @@ -52,13 +53,63 @@ impl Object for AccountSession {
pub struct ConnectEmbeddedAccountSessionCreateComponents {

pub account_onboarding: ConnectEmbeddedBaseConfigClaim,

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

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

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

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

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

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

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

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

pub features: ConnectEmbeddedBaseFeatures,
}

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

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

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

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

/// Whether to allow capturing and cancelling payment intents.
///
/// This is `true` by default.
pub capture_payments: bool,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
pub dispute_management: bool,

/// Whether to allow sending refunds.
///
/// This is `true` by default.
pub refund_management: bool,
}

/// The parameters for `AccountSession::create`.
Expand Down Expand Up @@ -94,11 +145,112 @@ pub struct CreateAccountSessionComponents {
/// Configuration for the account onboarding embedded component.
#[serde(skip_serializing_if = "Option::is_none")]
pub account_onboarding: Option<CreateAccountSessionComponentsAccountOnboarding>,

/// Configuration for the payment details embedded component.
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_details: Option<CreateAccountSessionComponentsPaymentDetails>,

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

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

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

/// 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<CreateAccountSessionComponentsAccountOnboardingFeatures>,
}

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

/// 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<CreateAccountSessionComponentsPaymentDetailsFeatures>,
}

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

/// 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<CreateAccountSessionComponentsPaymentsFeatures>,
}

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

/// 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<CreateAccountSessionComponentsPayoutsFeatures>,
}

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

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

/// Whether to allow capturing and cancelling payment intents.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_payments: Option<bool>,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub dispute_management: Option<bool>,

/// Whether to allow sending refunds.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub refund_management: Option<bool>,
}

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

/// Whether to allow capturing and cancelling payment intents.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_payments: Option<bool>,

/// Whether to allow responding to disputes, including submitting evidence and accepting disputes.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub dispute_management: Option<bool>,

/// Whether to allow sending refunds.
///
/// This is `true` by default.
#[serde(skip_serializing_if = "Option::is_none")]
pub refund_management: Option<bool>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateAccountSessionComponentsPayoutsFeatures {
}
6 changes: 6 additions & 0 deletions src/resources/generated/api_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ pub enum ApiErrorsCode {
CouponExpired,
CustomerMaxPaymentMethods,
CustomerMaxSubscriptions,
CustomerTaxLocationInvalid,
DebitNotAuthorized,
EmailInvalid,
ExpiredCard,
FinancialConnectionsAccountInactive,
FinancialConnectionsNoSuccessfulTransactionRefresh,
IdempotencyKeyInUse,
IncorrectAddress,
IncorrectCvc,
Expand Down Expand Up @@ -282,12 +284,16 @@ impl ApiErrorsCode {
ApiErrorsCode::CouponExpired => "coupon_expired",
ApiErrorsCode::CustomerMaxPaymentMethods => "customer_max_payment_methods",
ApiErrorsCode::CustomerMaxSubscriptions => "customer_max_subscriptions",
ApiErrorsCode::CustomerTaxLocationInvalid => "customer_tax_location_invalid",
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::IdempotencyKeyInUse => "idempotency_key_in_use",
ApiErrorsCode::IncorrectAddress => "incorrect_address",
ApiErrorsCode::IncorrectCvc => "incorrect_cvc",
Expand Down
3 changes: 1 addition & 2 deletions src/resources/generated/climate_product.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ pub struct ClimateProduct {
pub livemode: bool,

/// The quantity of metric tons available for reservation.
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_tons_available: Option<String>,
pub metric_tons_available: String,

/// The Climate product's name.
pub name: String,
Expand Down
2 changes: 0 additions & 2 deletions src/resources/generated/climate_supplier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ pub enum ClimateSupplierRemovalPathway {
BiomassCarbonRemovalAndStorage,
DirectAirCapture,
EnhancedWeathering,
Various,
}

impl ClimateSupplierRemovalPathway {
Expand All @@ -75,7 +74,6 @@ impl ClimateSupplierRemovalPathway {
ClimateSupplierRemovalPathway::BiomassCarbonRemovalAndStorage => "biomass_carbon_removal_and_storage",
ClimateSupplierRemovalPathway::DirectAirCapture => "direct_air_capture",
ClimateSupplierRemovalPathway::EnhancedWeathering => "enhanced_weathering",
ClimateSupplierRemovalPathway::Various => "various",
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/resources/generated/connect_embedded_base_features.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// ======================================
// This file was automatically generated.
// ======================================

use serde::{Deserialize, Serialize};

/// The resource representing a Stripe "ConnectEmbeddedBaseFeatures".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ConnectEmbeddedBaseFeatures {
}
15 changes: 3 additions & 12 deletions src/resources/generated/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,7 @@ pub struct PaymentIntentPaymentMethodOptionsCard {
/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
///
/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
/// Permitted values include: `automatic` or `any`.
/// If not provided, defaults to `automatic`.
/// If not provided, this value defaults to `automatic`.
/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
pub request_three_d_secure: Option<PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure>,

Expand Down Expand Up @@ -3067,8 +3066,7 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCard {
/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
///
/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
/// Permitted values include: `automatic` or `any`.
/// If not provided, defaults to `automatic`.
/// If not provided, this value defaults to `automatic`.
/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Expand Down Expand Up @@ -3951,8 +3949,7 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCard {
/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
///
/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
/// Permitted values include: `automatic` or `any`.
/// If not provided, defaults to `automatic`.
/// If not provided, this value defaults to `automatic`.
/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
#[serde(skip_serializing_if = "Option::is_none")]
pub request_three_d_secure:
Expand Down Expand Up @@ -9108,19 +9105,13 @@ impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestOverc
pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
Any,
Automatic,
Challenge,
ChallengeOnly,
}

impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure {
pub fn as_str(self) -> &'static str {
match self {
PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any",
PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic",
PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge",
PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::ChallengeOnly => {
"challenge_only"
}
}
}
}
Expand Down
Loading
Loading