Skip to content

Commit

Permalink
Generate latest changes from OpenApi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Feb 13, 2021
1 parent 2445c13 commit 6685be5
Show file tree
Hide file tree
Showing 4 changed files with 362 additions and 6 deletions.
53 changes: 53 additions & 0 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ pub struct BusinessProfile {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AccountCapabilities {
/// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges.
#[serde(skip_serializing_if = "Option::is_none")]
pub afterpay_clearpay_payments: Option<AccountCapabilitiesAfterpayClearpayPayments>,

/// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges.
#[serde(skip_serializing_if = "Option::is_none")]
pub au_becs_debit_payments: Option<CapabilityStatus>,
Expand Down Expand Up @@ -949,6 +953,9 @@ pub struct CompanyParams {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CreateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub afterpay_clearpay_payments: Option<CreateAccountCapabilitiesAfterpayClearpayPayments>,

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

Expand Down Expand Up @@ -1096,6 +1103,9 @@ pub struct PersonParams {

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct UpdateAccountCapabilities {
#[serde(skip_serializing_if = "Option::is_none")]
pub afterpay_clearpay_payments: Option<UpdateAccountCapabilitiesAfterpayClearpayPayments>,

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

Expand Down Expand Up @@ -1211,6 +1221,12 @@ pub struct CompanyVerificationParams {
pub document: Option<VerificationDocumentParams>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CreateAccountCapabilitiesAfterpayClearpayPayments {
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CreateAccountCapabilitiesAuBecsDebitPayments {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1391,6 +1407,12 @@ pub struct PayoutSettingsParams {
pub statement_descriptor: Option<String>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesAfterpayClearpayPayments {
#[serde(skip_serializing_if = "Option::is_none")]
pub requested: Option<bool>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct UpdateAccountCapabilitiesAuBecsDebitPayments {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -1578,6 +1600,37 @@ pub enum ExternalAccount {
Card(Card),
}

/// An enum representing the possible values of an `AccountCapabilities`'s `afterpay_clearpay_payments` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum AccountCapabilitiesAfterpayClearpayPayments {
Active,
Inactive,
Pending,
}

impl AccountCapabilitiesAfterpayClearpayPayments {
pub fn as_str(self) -> &'static str {
match self {
AccountCapabilitiesAfterpayClearpayPayments::Active => "active",
AccountCapabilitiesAfterpayClearpayPayments::Inactive => "inactive",
AccountCapabilitiesAfterpayClearpayPayments::Pending => "pending",
}
}
}

impl AsRef<str> for AccountCapabilitiesAfterpayClearpayPayments {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for AccountCapabilitiesAfterpayClearpayPayments {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}

/// An enum representing the possible values of an `AccountCapabilities`'s `bacs_debit_payments` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
Loading

0 comments on commit 6685be5

Please sign in to comment.