meteroid-rs 0.31.4

Official Rust SDK for Meteroid, the open-source billing platform: subscriptions, invoicing, usage-based billing and webhooks.
Documentation
// this file is @generated
use serde::{Deserialize, Serialize};

use super::bank_account_id::BankAccountId;

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct BankTransferPaymentMethodConfig {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_id: Option<BankAccountId>,

    pub r#type: String,

    /// Properties this version of the SDK does not know, sent back as received.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

impl BankTransferPaymentMethodConfig {
    /// Creates a value with every field unset.
    #[must_use]
    pub fn new() -> Self {
        Self {
            account_id: None,
            r#type: "bank_transfer".into(),
            extra: serde_json::Map::new(),
        }
    }

    /// Sets `account_id`.
    #[must_use]
    pub fn account_id(mut self, account_id: impl Into<BankAccountId>) -> Self {
        self.account_id = Some(account_id.into());
        self
    }
}

/// Sets `type` to `bank_transfer`.
impl Default for BankTransferPaymentMethodConfig {
    fn default() -> Self {
        Self {
            account_id: Default::default(),
            r#type: "bank_transfer".into(),
            extra: serde_json::Map::new(),
        }
    }
}