Skip to content

Commit

Permalink
Merge pull request arlyon#435 from arlyon/openapi-1694132506
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
  • Loading branch information
arlyon authored Sep 11, 2023
2 parents 26e9538 + 48181f1 commit 47d079e
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 31 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": "v484"
"version": "v516"
}
104 changes: 104 additions & 0 deletions src/resources/generated/account_session.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// ======================================
// This file was automatically generated.
// ======================================

use crate::client::{Client, Response};
use crate::ids::{AccountId};
use crate::params::{Expand, Object, Timestamp};
use serde::{Deserialize, Serialize};

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

/// The ID of the account the AccountSession was created for.
pub account: String,

/// The client secret of this AccountSession.
///
/// Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend.
/// It should not be stored, logged, or exposed to anyone other than the connected account.
/// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled.
pub client_secret: String,

pub components: ConnectEmbeddedAccountSessionCreateComponents,

/// The timestamp at which this AccountSession will expire.
pub expires_at: Timestamp,

/// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
pub livemode: bool,
}

impl AccountSession {

/// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
pub fn create(client: &Client, params: CreateAccountSession<'_>) -> Response<AccountSession> {
client.post_form("/account_sessions", &params)
}
}

impl Object for AccountSession {
type Id = ();
fn id(&self) -> Self::Id {}
fn object(&self) -> &'static str {
"account_session"
}
}

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

pub account_onboarding: ConnectEmbeddedBaseConfig,
}

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

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

/// The parameters for `AccountSession::create`.
#[derive(Clone, Debug, Serialize)]
pub struct CreateAccountSession<'a> {

/// The identifier of the account to create an Account Session for.
pub account: AccountId,

/// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g.
///
/// whether it has been enabled or not).
pub components: CreateAccountSessionComponents,

/// Specifies which fields in the response should be expanded.
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],
}

impl<'a> CreateAccountSession<'a> {
pub fn new(account: AccountId, components: CreateAccountSessionComponents) -> Self {
CreateAccountSession {
account,
components,
expand: Default::default(),
}
}
}

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

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

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

/// Whether the embedded component is enabled.
pub enabled: bool,
}
16 changes: 14 additions & 2 deletions src/resources/generated/balance_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct BalanceTransaction {
/// Either `available` or `pending`.
pub status: BalanceTransactionStatus,

/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
///
/// [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent.
/// If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
Expand Down Expand Up @@ -180,7 +180,7 @@ pub struct ListBalanceTransactions<'a> {

/// Only returns transactions of the given type.
///
/// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
/// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<&'a str>,
Expand Down Expand Up @@ -224,6 +224,12 @@ pub enum BalanceTransactionType {
IssuingAuthorizationRelease,
IssuingDispute,
IssuingTransaction,
ObligationInbound,
ObligationOutbound,
ObligationPayout,
ObligationPayoutFailure,
ObligationReversalInbound,
ObligationReversalOutbound,
Payment,
PaymentFailureRefund,
PaymentRefund,
Expand Down Expand Up @@ -262,6 +268,12 @@ impl BalanceTransactionType {
BalanceTransactionType::IssuingAuthorizationRelease => "issuing_authorization_release",
BalanceTransactionType::IssuingDispute => "issuing_dispute",
BalanceTransactionType::IssuingTransaction => "issuing_transaction",
BalanceTransactionType::ObligationInbound => "obligation_inbound",
BalanceTransactionType::ObligationOutbound => "obligation_outbound",
BalanceTransactionType::ObligationPayout => "obligation_payout",
BalanceTransactionType::ObligationPayoutFailure => "obligation_payout_failure",
BalanceTransactionType::ObligationReversalInbound => "obligation_reversal_inbound",
BalanceTransactionType::ObligationReversalOutbound => "obligation_reversal_outbound",
BalanceTransactionType::Payment => "payment",
BalanceTransactionType::PaymentFailureRefund => "payment_failure_refund",
BalanceTransactionType::PaymentRefund => "payment_refund",
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/bank_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct BankAccount {
#[serde(skip_serializing_if = "Option::is_none")]
pub fingerprint: Option<String>,

/// Information about upcoming new requirements for the bank account, including what information needs to be collected.
/// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when.
#[serde(skip_serializing_if = "Option::is_none")]
pub future_requirements: Option<ExternalAccountRequirements>,

Expand Down
7 changes: 6 additions & 1 deletion src/resources/generated/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ pub struct PaymentMethodDetailsGrabpay {
pub struct PaymentMethodDetailsIdeal {
/// The customer's bank.
///
/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
pub bank: Option<PaymentMethodDetailsIdealBank>,

/// The Bank Identifier Code of the customer's bank.
Expand Down Expand Up @@ -2242,6 +2242,7 @@ pub enum PaymentMethodDetailsIdealBank {
Ing,
Knab,
Moneyou,
N26,
Rabobank,
Regiobank,
Revolut,
Expand All @@ -2261,6 +2262,7 @@ impl PaymentMethodDetailsIdealBank {
PaymentMethodDetailsIdealBank::Ing => "ing",
PaymentMethodDetailsIdealBank::Knab => "knab",
PaymentMethodDetailsIdealBank::Moneyou => "moneyou",
PaymentMethodDetailsIdealBank::N26 => "n26",
PaymentMethodDetailsIdealBank::Rabobank => "rabobank",
PaymentMethodDetailsIdealBank::Regiobank => "regiobank",
PaymentMethodDetailsIdealBank::Revolut => "revolut",
Expand Down Expand Up @@ -2311,6 +2313,8 @@ pub enum PaymentMethodDetailsIdealBic {
Knabnl2h,
#[serde(rename = "MOYONL21")]
Moyonl21,
#[serde(rename = "NTSBDEB1")]
Ntsbdeb1,
#[serde(rename = "RABONL2U")]
Rabonl2u,
#[serde(rename = "RBRBNL21")]
Expand All @@ -2337,6 +2341,7 @@ impl PaymentMethodDetailsIdealBic {
PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A",
PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H",
PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21",
PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1",
PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U",
PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21",
PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23",
Expand Down
6 changes: 2 additions & 4 deletions src/resources/generated/checkout_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct CheckoutSession {
pub custom_text: PaymentPagesCheckoutSessionCustomText,

/// The ID of the customer for this Session.
/// For Checkout Sessions in `payment` or `subscription` mode, Checkout
/// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout
/// will create a new customer object based on information provided
/// during the payment flow unless an existing customer was provided when
/// the Session was created.
Expand Down Expand Up @@ -1104,7 +1104,7 @@ pub struct CreateCheckoutSession<'a> {
///
/// In `payment` mode, the customer’s most recent card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page.
/// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it’s a card, and otherwise the most recent card will be used.
/// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
/// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.
#[serde(skip_serializing_if = "Option::is_none")]
pub customer: Option<CustomerId>,

Expand Down Expand Up @@ -2704,8 +2704,6 @@ pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer
pub requested_address_types: Option<Vec<CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,

/// The list of bank transfer types that this PaymentIntent is allowed to use for funding.
///
/// Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
#[serde(rename = "type")]
pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType,
}
Expand Down
11 changes: 4 additions & 7 deletions src/resources/generated/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ pub struct Invoice {

/// Indicates the reason why the invoice was created.
///
/// `subscription_cycle` indicates an invoice created by a subscription advancing into a new period.
/// `subscription_create` indicates an invoice created due to creating a subscription.
/// `subscription_update` indicates an invoice created due to updating a subscription.
/// `subscription` is set for all old invoices to indicate either a change to a subscription or a period advancement.
/// `manual` is set for all invoices unrelated to a subscription (for example: created via the invoice editor).
/// The `upcoming` value is reserved for simulated invoices per the upcoming invoice endpoint.
/// `subscription_threshold` indicates an invoice created due to a billing threshold being reached.
/// * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
/// * `subscription`: No longer in use.
///
/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_reason: Option<InvoiceBillingReason>,

Expand Down
10 changes: 7 additions & 3 deletions src/resources/generated/payment_intent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ impl PaymentIntent {

/// Retrieves the details of a PaymentIntent that has previously been created.
///
/// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string.
/// When retrieved with a publishable key, only a subset of properties will be returned.
/// Please refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details.
/// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string.
/// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties.
/// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details.
pub fn retrieve(
client: &Client,
id: &PaymentIntentId,
Expand Down Expand Up @@ -4988,6 +4988,7 @@ pub enum CreatePaymentIntentPaymentMethodDataIdealBank {
Ing,
Knab,
Moneyou,
N26,
Rabobank,
Regiobank,
Revolut,
Expand All @@ -5007,6 +5008,7 @@ impl CreatePaymentIntentPaymentMethodDataIdealBank {
CreatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing",
CreatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab",
CreatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou",
CreatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26",
CreatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank",
CreatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank",
CreatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut",
Expand Down Expand Up @@ -10265,6 +10267,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataIdealBank {
Ing,
Knab,
Moneyou,
N26,
Rabobank,
Regiobank,
Revolut,
Expand All @@ -10284,6 +10287,7 @@ impl UpdatePaymentIntentPaymentMethodDataIdealBank {
UpdatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing",
UpdatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab",
UpdatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou",
UpdatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26",
UpdatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank",
UpdatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank",
UpdatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut",
Expand Down
6 changes: 5 additions & 1 deletion src/resources/generated/payment_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use crate::client::{Client, Response};
use crate::ids::PaymentLinkId;
use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable};
use crate::resources::{
Account, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, ShippingRate, TaxId,
Account, Application, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions,
ShippingRate, TaxId,
};

/// The resource representing a Stripe "PaymentLink".
Expand All @@ -29,6 +30,9 @@ pub struct PaymentLink {
/// Whether user redeemable promotion codes are enabled.
pub allow_promotion_codes: bool,

/// The ID of the Connect application that created the Payment Link.
pub application: Option<Expandable<Application>>,

/// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.
pub application_fee_amount: Option<i64>,

Expand Down
Loading

0 comments on commit 47d079e

Please sign in to comment.