Skip to content

Commit 35960fd

Browse files
authored
Merge pull request #336 from arlyon/openapi-1675384030
Generate latest changes from OpenApi spec
2 parents ff3bc50 + 8e84508 commit 35960fd

12 files changed

+963
-8
lines changed

openapi/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "v221"
2+
"version": "v223"
33
}

src/resources.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ pub use {
192192
invoice_payment_method_options_customer_balance::*,
193193
invoice_payment_method_options_us_bank_account::*,
194194
invoiceitem::*,
195+
invoices_shipping_cost::*,
195196
line_item::*,
196197
plan::*,
197198
plan::PlanInterval,

src/resources/generated.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub mod billing {
7777
pub mod invoice_payment_method_options_konbini;
7878
pub mod invoice_payment_method_options_us_bank_account;
7979
pub mod invoiceitem;
80+
pub mod invoices_shipping_cost;
8081
pub mod line_item;
8182
pub mod plan;
8283
pub mod promotion_code;

src/resources/generated/checkout_session.rs

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use serde::{Deserialize, Serialize};
66

77
use crate::client::{Client, Response};
8-
use crate::ids::{CheckoutSessionId, CustomerId, PaymentIntentId, SubscriptionId};
8+
use crate::ids::{CheckoutSessionId, CustomerId, PaymentIntentId, PaymentLinkId, SubscriptionId};
99
use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp};
1010
use crate::resources::{
1111
Address, CheckoutSessionItem, Currency, Customer, Discount, Invoice,
@@ -1178,6 +1178,10 @@ pub struct ListCheckoutSessions<'a> {
11781178
#[serde(skip_serializing_if = "Option::is_none")]
11791179
pub payment_intent: Option<PaymentIntentId>,
11801180

1181+
/// Only return the Checkout Sessions for the Payment Link specified.
1182+
#[serde(skip_serializing_if = "Option::is_none")]
1183+
pub payment_link: Option<PaymentLinkId>,
1184+
11811185
/// A cursor for use in pagination.
11821186
///
11831187
/// `starting_after` is an object ID that defines your place in the list.
@@ -1199,6 +1203,7 @@ impl<'a> ListCheckoutSessions<'a> {
11991203
expand: Default::default(),
12001204
limit: Default::default(),
12011205
payment_intent: Default::default(),
1206+
payment_link: Default::default(),
12021207
starting_after: Default::default(),
12031208
subscription: Default::default(),
12041209
}
@@ -1631,6 +1636,10 @@ pub struct CreateCheckoutSessionSubscriptionData {
16311636
/// Has to be at least 1.
16321637
#[serde(skip_serializing_if = "Option::is_none")]
16331638
pub trial_period_days: Option<u32>,
1639+
1640+
/// Settings related to subscription trials.
1641+
#[serde(skip_serializing_if = "Option::is_none")]
1642+
pub trial_settings: Option<CreateCheckoutSessionSubscriptionDataTrialSettings>,
16341643
}
16351644

16361645
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
@@ -2240,6 +2249,12 @@ pub struct CreateCheckoutSessionSubscriptionDataTransferData {
22402249
pub destination: String,
22412250
}
22422251

2252+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2253+
pub struct CreateCheckoutSessionSubscriptionDataTrialSettings {
2254+
/// Defines how the subscription should behave when the user's free trial ends.
2255+
pub end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior,
2256+
}
2257+
22432258
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
22442259
pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields {
22452260
/// The name of the custom field.
@@ -2441,6 +2456,13 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
24412456
Option<CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions>,
24422457
}
24432458

2459+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
2460+
pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior {
2461+
/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
2462+
pub missing_payment_method:
2463+
CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod,
2464+
}
2465+
24442466
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
24452467
pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
24462468
/// The desired country code of the bank account information.
@@ -6532,6 +6554,48 @@ impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateD
65326554
}
65336555
}
65346556

6557+
/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field.
6558+
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
6559+
#[serde(rename_all = "snake_case")]
6560+
pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
6561+
Cancel,
6562+
CreateInvoice,
6563+
Pause,
6564+
}
6565+
6566+
impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
6567+
pub fn as_str(self) -> &'static str {
6568+
match self {
6569+
CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel",
6570+
CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice",
6571+
CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause",
6572+
}
6573+
}
6574+
}
6575+
6576+
impl AsRef<str>
6577+
for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6578+
{
6579+
fn as_ref(&self) -> &str {
6580+
self.as_str()
6581+
}
6582+
}
6583+
6584+
impl std::fmt::Display
6585+
for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6586+
{
6587+
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
6588+
self.as_str().fmt(f)
6589+
}
6590+
}
6591+
impl std::default::Default
6592+
for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6593+
{
6594+
fn default() -> Self {
6595+
Self::Cancel
6596+
}
6597+
}
6598+
65356599
/// An enum representing the possible values of an `PaymentPagesCheckoutSessionAutomaticTax`'s `status` field.
65366600
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
65376601
#[serde(rename_all = "snake_case")]

src/resources/generated/credit_note.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use crate::client::{Client, Response};
66
use crate::ids::{CreditNoteId, CustomerId, InvoiceId, RefundId};
77
use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp};
8-
use crate::resources::{CreditNoteLineItem, Currency, Customer, CustomerBalanceTransaction, Discount, Invoice, Refund, TaxRate};
8+
use crate::resources::{CreditNoteLineItem, Currency, Customer, CustomerBalanceTransaction, Discount, Invoice, InvoicesShippingCost, Refund, TaxRate};
99
use serde::{Deserialize, Serialize};
1010

1111
/// The resource representing a Stripe "CreditNote".
@@ -19,6 +19,9 @@ pub struct CreditNote {
1919
/// The integer amount in %s representing the total amount of the credit note, including tax.
2020
pub amount: i64,
2121

22+
/// This is the sum of all the shipping amounts.
23+
pub amount_shipping: i64,
24+
2225
/// Time at which the object was created.
2326
///
2427
/// Measured in seconds since the Unix epoch.
@@ -73,6 +76,9 @@ pub struct CreditNote {
7376
/// Refund related to this credit note.
7477
pub refund: Option<Expandable<Refund>>,
7578

79+
/// The details of the cost of shipping, including the ShippingRate applied to the invoice.
80+
pub shipping_cost: Option<InvoicesShippingCost>,
81+
7682
/// Status of this credit note, one of `issued` or `void`.
7783
///
7884
/// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
@@ -218,6 +224,10 @@ pub struct CreateCreditNote<'a> {
218224
/// If set, a refund will be created for the charge associated with the invoice.
219225
#[serde(skip_serializing_if = "Option::is_none")]
220226
pub refund_amount: Option<i64>,
227+
228+
/// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
229+
#[serde(skip_serializing_if = "Option::is_none")]
230+
pub shipping_cost: Option<CreateCreditNoteShippingCost>,
221231
}
222232

223233
impl<'a> CreateCreditNote<'a> {
@@ -234,6 +244,7 @@ impl<'a> CreateCreditNote<'a> {
234244
reason: Default::default(),
235245
refund: Default::default(),
236246
refund_amount: Default::default(),
247+
shipping_cost: Default::default(),
237248
}
238249
}
239250
}
@@ -372,6 +383,14 @@ pub struct CreateCreditNoteLines {
372383
pub unit_amount_decimal: Option<String>,
373384
}
374385

386+
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
387+
pub struct CreateCreditNoteShippingCost {
388+
389+
/// The ID of the shipping rate to use for this order.
390+
#[serde(skip_serializing_if = "Option::is_none")]
391+
pub shipping_rate: Option<String>,
392+
}
393+
375394
/// An enum representing the possible values of an `CreateCreditNoteLines`'s `type` field.
376395
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
377396
#[serde(rename_all = "snake_case")]

src/resources/generated/customer_cash_balance_transaction.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ impl std::default::Default for CustomerBalanceResourceCashBalanceTransactionReso
172172
pub enum CustomerCashBalanceTransactionType {
173173
AppliedToPayment,
174174
Funded,
175+
FundingReversed,
175176
RefundedFromPayment,
176177
ReturnCanceled,
177178
ReturnInitiated,
@@ -183,6 +184,7 @@ impl CustomerCashBalanceTransactionType {
183184
match self {
184185
CustomerCashBalanceTransactionType::AppliedToPayment => "applied_to_payment",
185186
CustomerCashBalanceTransactionType::Funded => "funded",
187+
CustomerCashBalanceTransactionType::FundingReversed => "funding_reversed",
186188
CustomerCashBalanceTransactionType::RefundedFromPayment => "refunded_from_payment",
187189
CustomerCashBalanceTransactionType::ReturnCanceled => "return_canceled",
188190
CustomerCashBalanceTransactionType::ReturnInitiated => "return_initiated",

0 commit comments

Comments
 (0)