Skip to content

Commit

Permalink
Merge pull request arlyon#232 from arlyon/openapi-1654221359
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
  • Loading branch information
arlyon authored Jun 3, 2022
2 parents 527e1cb + b394068 commit 3de5293
Show file tree
Hide file tree
Showing 19 changed files with 271 additions and 63 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ runtime-async-std-surf = ["async-std", "surf", "async"]
hyper-client = ["hyper", "http-types/hyperium_http"]

[dependencies]
async-std = { version = "1.9", optional = true }
async-std = {version = "1.8,<1.11", optional = true}
async-global-executor = {version = "2.0, <2.1", optional = true}

chrono = { version = "0.4", features = ["serde"], optional = true }
thiserror = "1.0.24"
http-types = { version = "2.12.0", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ pub use {
payment_method_options_wechat_pay::*,
payout::*,
platform_tax_fee::*,
product::*,
price::*,
product::*,
radar_radar_options::*,
refund::*,
reserve_transaction::*,
setup_attempt::*,
Expand Down
1 change: 1 addition & 0 deletions src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub mod core {
pub mod platform_tax_fee;
pub mod price;
pub mod product;
pub mod radar_radar_options;
pub mod refund;
pub mod reserve_transaction;
pub mod setup_attempt;
Expand Down
24 changes: 20 additions & 4 deletions src/resources/generated/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::params::{Expand, Expandable, List, Metadata, Object, RangeQuery, Time
use crate::resources::{
Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails,
ChargeSourceParams, Currency, Customer, Invoice, Mandate, PaymentIntent, PaymentMethod,
PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodDetailsCardPresent, Refund, Review,
Shipping, ThreeDSecureDetails, Transfer,
PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodDetailsCardPresent, RadarRadarOptions,
Refund, Review, Shipping, ThreeDSecureDetails, Transfer,
};

/// The resource representing a Stripe "Charge".
Expand Down Expand Up @@ -144,6 +144,9 @@ pub struct Charge {
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_method_details: Option<PaymentMethodDetails>,

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

/// This is the email address that the receipt for this charge was sent to.
#[serde(skip_serializing_if = "Option::is_none")]
pub receipt_email: Option<String>,
Expand Down Expand Up @@ -1053,7 +1056,7 @@ pub struct PaymentMethodDetailsKlarna {
pub payment_method_category: Option<String>,

/// Preferred language of the Klarna authorization page that the customer is redirected to.
/// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, or `en-FR`.
/// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `en-AU`, or `en-NZ`.
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_locale: Option<String>,
}
Expand Down Expand Up @@ -1268,7 +1271,7 @@ pub struct CreateCharge<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub application_fee: Option<i64>,

/// A fee in %s that will be applied to the charge and transferred to the application owner's Stripe account.
/// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account.
///
/// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee.
/// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees).
Expand Down Expand Up @@ -1327,6 +1330,12 @@ pub struct CreateCharge<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub on_behalf_of: Option<&'a str>,

/// Options to configure Radar.
///
/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
#[serde(skip_serializing_if = "Option::is_none")]
pub radar_options: Option<CreateChargeRadarOptions>,

/// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent.
///
/// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges.
Expand Down Expand Up @@ -1390,6 +1399,7 @@ impl<'a> CreateCharge<'a> {
expand: Default::default(),
metadata: Default::default(),
on_behalf_of: Default::default(),
radar_options: Default::default(),
receipt_email: Default::default(),
shipping: Default::default(),
source: Default::default(),
Expand Down Expand Up @@ -1530,6 +1540,12 @@ impl<'a> UpdateCharge<'a> {
}
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateChargeRadarOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub session: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FraudDetailsParams {
pub user_report: FraudDetailsParamsUserReport,
Expand Down
8 changes: 4 additions & 4 deletions src/resources/generated/credit_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ pub struct DiscountsResourceDiscountAmount {
/// The parameters for `CreditNote::create`.
#[derive(Clone, Debug, Serialize)]
pub struct CreateCreditNote<'a> {
/// The integer amount in %s representing the total amount of the credit note.
/// The integer amount in cents (or local equivalent) representing the total amount of the credit note.
#[serde(skip_serializing_if = "Option::is_none")]
pub amount: Option<i64>,

/// The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
/// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
#[serde(skip_serializing_if = "Option::is_none")]
pub credit_amount: Option<i64>,

Expand All @@ -205,7 +205,7 @@ pub struct CreateCreditNote<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Metadata>,

/// The integer amount in %s representing the amount that is credited outside of Stripe.
/// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
#[serde(skip_serializing_if = "Option::is_none")]
pub out_of_band_amount: Option<i64>,

Expand All @@ -217,7 +217,7 @@ pub struct CreateCreditNote<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub refund: Option<RefundId>,

/// The integer amount in %s representing the amount to refund.
/// The integer amount in cents (or local equivalent) representing the amount to refund.
///
/// If set, a refund will be created for the charge associated with the invoice.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
4 changes: 2 additions & 2 deletions src/resources/generated/customer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub struct CreateCustomer<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Address>,

/// An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices.
/// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices.
///
/// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -455,7 +455,7 @@ pub struct UpdateCustomer<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<Address>,

/// An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices.
/// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices.
///
/// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
32 changes: 31 additions & 1 deletion src/resources/generated/funding_instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,37 @@ pub struct FundingInstructionsBankTransferFinancialAddress {
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferZenginRecord {}
pub struct FundingInstructionsBankTransferZenginRecord {
/// The account holder name.
#[serde(skip_serializing_if = "Option::is_none")]
pub account_holder_name: Option<String>,

/// The account number.
#[serde(skip_serializing_if = "Option::is_none")]
pub account_number: Option<String>,

/// The bank account type.
///
/// In Japan, this can only be `futsu` or `toza`.
#[serde(skip_serializing_if = "Option::is_none")]
pub account_type: Option<String>,

/// The bank code of the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub bank_code: Option<String>,

/// The bank name of the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub bank_name: Option<String>,

/// The branch code of the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub branch_code: Option<String>,

/// The branch name of the account.
#[serde(skip_serializing_if = "Option::is_none")]
pub branch_name: Option<String>,
}

/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `supported_networks` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/invoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ pub struct CreateInvoice<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_tax_ids: Option<Vec<String>>,

/// A fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account.
/// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account.
///
/// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee.
/// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct InvoicePaymentMethodOptionsCustomerBalance {
pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer {
/// The bank transfer type that can be used 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`.
/// Permitted values include: `jp_bank_transfer`.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
Expand Down
12 changes: 6 additions & 6 deletions src/resources/generated/invoiceitem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl Object for InvoiceItem {
/// The parameters for `InvoiceItem::create`.
#[derive(Clone, Debug, Serialize)]
pub struct CreateInvoiceItem<'a> {
/// The integer amount in %s of the charge to be applied to the upcoming invoice.
/// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.
///
/// Passing in a negative `amount` will reduce the `amount_due` on the invoice.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -260,14 +260,14 @@ pub struct CreateInvoiceItem<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_rates: Option<Vec<String>>,

/// The integer unit amount in %s of the charge to be applied to the upcoming invoice.
/// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.
///
/// This `unit_amount` will be multiplied by the quantity to get the full amount.
/// Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice.
#[serde(skip_serializing_if = "Option::is_none")]
pub unit_amount: Option<i64>,

/// Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places.
/// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
///
/// Only one of `unit_amount` and `unit_amount_decimal` can be set.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -367,7 +367,7 @@ impl<'a> ListInvoiceItems<'a> {
/// The parameters for `InvoiceItem::update`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct UpdateInvoiceItem<'a> {
/// The integer amount in %s of the charge to be applied to the upcoming invoice.
/// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.
///
/// If you want to apply a credit to the customer's account, pass a negative amount.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -432,14 +432,14 @@ pub struct UpdateInvoiceItem<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub tax_rates: Option<Vec<String>>,

/// The integer unit amount in %s of the charge to be applied to the upcoming invoice.
/// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.
///
/// This unit_amount will be multiplied by the quantity to get the full amount.
/// If you want to apply a credit to the customer's account, pass a negative unit_amount.
#[serde(skip_serializing_if = "Option::is_none")]
pub unit_amount: Option<i64>,

/// Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places.
/// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
///
/// Only one of `unit_amount` and `unit_amount_decimal` can be set.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
12 changes: 12 additions & 0 deletions src/resources/generated/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,8 @@ pub enum CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
DeDe,
#[serde(rename = "en-AT")]
EnAt,
#[serde(rename = "en-AU")]
EnAu,
#[serde(rename = "en-BE")]
EnBe,
#[serde(rename = "en-DE")]
Expand All @@ -2378,6 +2380,8 @@ pub enum CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
EnNl,
#[serde(rename = "en-NO")]
EnNo,
#[serde(rename = "en-NZ")]
EnNz,
#[serde(rename = "en-SE")]
EnSe,
#[serde(rename = "en-US")]
Expand Down Expand Up @@ -2413,6 +2417,7 @@ impl CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK",
Expand All @@ -2424,6 +2429,7 @@ impl CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US",
CreateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES",
Expand Down Expand Up @@ -4423,6 +4429,8 @@ pub enum UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
DeDe,
#[serde(rename = "en-AT")]
EnAt,
#[serde(rename = "en-AU")]
EnAu,
#[serde(rename = "en-BE")]
EnBe,
#[serde(rename = "en-DE")]
Expand All @@ -4445,6 +4453,8 @@ pub enum UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
EnNl,
#[serde(rename = "en-NO")]
EnNo,
#[serde(rename = "en-NZ")]
EnNz,
#[serde(rename = "en-SE")]
EnSe,
#[serde(rename = "en-US")]
Expand Down Expand Up @@ -4480,6 +4490,7 @@ impl UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK",
Expand All @@ -4491,6 +4502,7 @@ impl UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale {
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US",
UpdateOrderPaymentSettingsPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES",
Expand Down
Loading

0 comments on commit 3de5293

Please sign in to comment.