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 authored Dec 8, 2023
1 parent 31686c6 commit 4c25649
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 76 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": "v692"
"version": "v706"
}
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

0 comments on commit 4c25649

Please sign in to comment.