Skip to content

Commit

Permalink
Regenerate latest changes from OpenApi spec with Default impls
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Feb 1, 2022
1 parent 2cdc7b4 commit 5048353
Show file tree
Hide file tree
Showing 117 changed files with 3,023 additions and 928 deletions.
347 changes: 241 additions & 106 deletions src/resources/generated/account.rs

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion src/resources/generated/account_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::params::{Expand, Object, Timestamp};
/// The resource representing a Stripe "AccountLink".
///
/// For more details see <https://stripe.com/docs/api/account_links/object>
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountLink {
/// Time at which the object was created.
///
Expand Down Expand Up @@ -116,6 +116,11 @@ impl std::fmt::Display for AccountLinkCollect {
self.as_str().fmt(f)
}
}
impl std::default::Default for AccountLinkCollect {
fn default() -> Self {
Self::CurrentlyDue
}
}

/// An enum representing the possible values of an `CreateAccountLink`'s `type_` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -145,3 +150,8 @@ impl std::fmt::Display for AccountLinkType {
self.as_str().fmt(f)
}
}
impl std::default::Default for AccountLinkType {
fn default() -> Self {
Self::AccountOnboarding
}
}
2 changes: 1 addition & 1 deletion src/resources/generated/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use serde_derive::{Deserialize, Serialize};

/// The resource representing a Stripe "Address".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Address {
/// City, district, suburb, town, or village.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/alipay_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::params::{Expandable, Metadata, Object, Timestamp};
use crate::resources::{Currency, Customer};

/// The resource representing a Stripe "AlipayAccount".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AlipayAccount {
/// Unique identifier for the object.
pub id: AlipayAccountId,
Expand Down
12 changes: 11 additions & 1 deletion src/resources/generated/api_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_derive::{Deserialize, Serialize};
use crate::resources::{BankAccount, Card, PaymentIntent, PaymentMethod, SetupIntent, Source};

/// The resource representing a Stripe "APIErrors".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ApiErrors {
/// For card errors, the ID of the failed charge.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -70,6 +70,11 @@ pub enum ApiErrorsSourceUnion {
Card(Card),
Source(Source),
}
impl std::default::Default for ApiErrorsSourceUnion {
fn default() -> Self {
Self::BankAccount(Default::default())
}
}

/// An enum representing the possible values of an `ApiErrors`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -103,3 +108,8 @@ impl std::fmt::Display for ApiErrorsType {
self.as_str().fmt(f)
}
}
impl std::default::Default for ApiErrorsType {
fn default() -> Self {
Self::ApiError
}
}
2 changes: 1 addition & 1 deletion src/resources/generated/apple_pay_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::ids::ApplePayDomainId;
use crate::params::{Object, Timestamp};

/// The resource representing a Stripe "ApplePayDomain".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ApplePayDomain {
/// Unique identifier for the object.
pub id: ApplePayDomainId,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_derive::{Deserialize, Serialize};
use crate::params::Object;

/// The resource representing a Stripe "Application".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Application {
/// The name of the application.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion src/resources/generated/application_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::resources::{
/// The resource representing a Stripe "PlatformFee".
///
/// For more details see <https://stripe.com/docs/api/application_fees/object>
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct ApplicationFee {
/// Unique identifier for the object.
pub id: ApplicationFeeId,
Expand Down
8 changes: 4 additions & 4 deletions src/resources/generated/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::params::{Expand, List, Object, RangeQuery, Timestamp};
use crate::resources::Currency;

/// The resource representing a Stripe "Balance".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Balance {
/// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts).
///
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Object for Balance {
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BalanceAmount {
/// Balance amount.
pub amount: i64,
Expand All @@ -70,7 +70,7 @@ pub struct BalanceAmount {
pub source_types: Option<Box<BalanceAmountBySourceType>>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BalanceAmountBySourceType {
/// Amount for bank account.
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -85,7 +85,7 @@ pub struct BalanceAmountBySourceType {
pub fpx: Option<Box<i64>>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BalanceDetail {
/// Funds that are available for use.
pub available: Vec<BalanceAmount>,
Expand Down
14 changes: 12 additions & 2 deletions src/resources/generated/balance_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::resources::{
/// The resource representing a Stripe "BalanceTransaction".
///
/// For more details see <https://stripe.com/docs/api/balance_transactions/object>
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BalanceTransaction {
/// Unique identifier for the object.
pub id: BalanceTransactionId,
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Object for BalanceTransaction {
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Fee {
/// Amount of the fee, in cents.
pub amount: i64,
Expand Down Expand Up @@ -234,6 +234,11 @@ pub enum BalanceTransactionSourceUnion {
Transfer(Transfer),
TransferReversal(TransferReversal),
}
impl std::default::Default for BalanceTransactionSourceUnion {
fn default() -> Self {
Self::ApplicationFee(Default::default())
}
}

/// An enum representing the possible values of an `BalanceTransaction`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -323,3 +328,8 @@ impl std::fmt::Display for BalanceTransactionType {
self.as_str().fmt(f)
}
}
impl std::default::Default for BalanceTransactionType {
fn default() -> Self {
Self::Adjustment
}
}
7 changes: 6 additions & 1 deletion src/resources/generated/bank_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::params::{Expandable, Metadata, Object};
use crate::resources::{Account, BankAccountStatus, Currency, Customer};

/// The resource representing a Stripe "BankAccount".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BankAccount {
/// Unique identifier for the object.
pub id: BankAccountId,
Expand Down Expand Up @@ -137,3 +137,8 @@ impl std::fmt::Display for BankAccountAvailablePayoutMethods {
self.as_str().fmt(f)
}
}
impl std::default::Default for BankAccountAvailablePayoutMethods {
fn default() -> Self {
Self::Instant
}
}
2 changes: 1 addition & 1 deletion src/resources/generated/billing_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde_derive::{Deserialize, Serialize};
use crate::resources::Address;

/// The resource representing a Stripe "billing_details".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BillingDetails {
/// Billing address.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
52 changes: 41 additions & 11 deletions src/resources/generated/billing_portal_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::ids::BillingPortalConfigurationId;
use crate::params::{Metadata, Object, Timestamp};

/// The resource representing a Stripe "PortalConfiguration".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BillingPortalConfiguration {
/// Unique identifier for the object.
pub id: BillingPortalConfigurationId,
Expand Down Expand Up @@ -65,7 +65,7 @@ impl Object for BillingPortalConfiguration {
}
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalBusinessProfile {
/// The messaging shown to customers in the portal.
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -78,7 +78,7 @@ pub struct PortalBusinessProfile {
pub terms_of_service_url: String,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalFeatures {
pub customer_update: PortalCustomerUpdate,

Expand All @@ -93,7 +93,7 @@ pub struct PortalFeatures {
pub subscription_update: PortalSubscriptionUpdate,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalCustomerUpdate {
/// The types of customer updates that are supported.
///
Expand All @@ -104,19 +104,19 @@ pub struct PortalCustomerUpdate {
pub enabled: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalInvoiceList {
/// Whether the feature is enabled.
pub enabled: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalPaymentMethodUpdate {
/// Whether the feature is enabled.
pub enabled: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalSubscriptionCancel {
pub cancellation_reason: PortalSubscriptionCancellationReason,

Expand All @@ -132,7 +132,7 @@ pub struct PortalSubscriptionCancel {
pub proration_behavior: PortalSubscriptionCancelProrationBehavior,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalSubscriptionCancellationReason {
/// Whether the feature is enabled.
pub enabled: bool,
Expand All @@ -141,13 +141,13 @@ pub struct PortalSubscriptionCancellationReason {
pub options: Vec<PortalSubscriptionCancellationReasonOptions>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalSubscriptionPause {
/// Whether the feature is enabled.
pub enabled: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalSubscriptionUpdate {
/// The types of subscription updates that are supported for items listed in the `products` attribute.
///
Expand All @@ -167,7 +167,7 @@ pub struct PortalSubscriptionUpdate {
pub proration_behavior: PortalSubscriptionUpdateProrationBehavior,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PortalSubscriptionUpdateProduct {
/// The list of price IDs which, when subscribed to, a subscription can be updated.
pub prices: Vec<String>,
Expand Down Expand Up @@ -210,6 +210,11 @@ impl std::fmt::Display for PortalCustomerUpdateAllowedUpdates {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalCustomerUpdateAllowedUpdates {
fn default() -> Self {
Self::Address
}
}

/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `mode` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -239,6 +244,11 @@ impl std::fmt::Display for PortalSubscriptionCancelMode {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalSubscriptionCancelMode {
fn default() -> Self {
Self::AtPeriodEnd
}
}

/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `proration_behavior` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -270,6 +280,11 @@ impl std::fmt::Display for PortalSubscriptionCancelProrationBehavior {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalSubscriptionCancelProrationBehavior {
fn default() -> Self {
Self::AlwaysInvoice
}
}

/// An enum representing the possible values of an `PortalSubscriptionCancellationReason`'s `options` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -311,6 +326,11 @@ impl std::fmt::Display for PortalSubscriptionCancellationReasonOptions {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalSubscriptionCancellationReasonOptions {
fn default() -> Self {
Self::CustomerService
}
}

/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `default_allowed_updates` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -342,6 +362,11 @@ impl std::fmt::Display for PortalSubscriptionUpdateDefaultAllowedUpdates {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalSubscriptionUpdateDefaultAllowedUpdates {
fn default() -> Self {
Self::Price
}
}

/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `proration_behavior` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -373,3 +398,8 @@ impl std::fmt::Display for PortalSubscriptionUpdateProrationBehavior {
self.as_str().fmt(f)
}
}
impl std::default::Default for PortalSubscriptionUpdateProrationBehavior {
fn default() -> Self {
Self::AlwaysInvoice
}
}
7 changes: 6 additions & 1 deletion src/resources/generated/billing_portal_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::params::{Expand, Expandable, Object, Timestamp};
use crate::resources::BillingPortalConfiguration;

/// The resource representing a Stripe "PortalSession".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BillingPortalSession {
/// Unique identifier for the object.
pub id: BillingPortalSessionId,
Expand Down Expand Up @@ -248,3 +248,8 @@ impl std::fmt::Display for BillingPortalSessionLocale {
self.as_str().fmt(f)
}
}
impl std::default::Default for BillingPortalSessionLocale {
fn default() -> Self {
Self::Auto
}
}
2 changes: 1 addition & 1 deletion src/resources/generated/bitcoin_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::params::{List, Metadata, Object, Timestamp};
use crate::resources::{BitcoinTransaction, Currency};

/// The resource representing a Stripe "BitcoinReceiver".
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BitcoinReceiver {
/// Unique identifier for the object.
pub id: BitcoinReceiverId,
Expand Down
Loading

0 comments on commit 5048353

Please sign in to comment.