bitwarden-api-api 3.0.0

Api bindings for the Bitwarden API.
Documentation
/*
 * Bitwarden Internal API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: latest
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::{Deserialize, Serialize};

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProviderSetupRequestModel {
    #[serde(rename = "name", alias = "Name")]
    pub name: String,
    #[serde(
        rename = "businessName",
        alias = "BusinessName",
        skip_serializing_if = "Option::is_none"
    )]
    pub business_name: Option<String>,
    #[serde(rename = "billingEmail", alias = "BillingEmail")]
    pub billing_email: String,
    #[serde(rename = "token", alias = "Token")]
    pub token: String,
    #[serde(rename = "key", alias = "Key")]
    pub key: String,
    #[serde(rename = "paymentMethod", alias = "PaymentMethod")]
    pub payment_method: Box<models::MinimalTokenizedPaymentMethodRequest>,
    #[serde(rename = "billingAddress", alias = "BillingAddress")]
    pub billing_address: Box<models::BillingAddressRequest>,
}

impl ProviderSetupRequestModel {
    pub fn new(
        name: String,
        billing_email: String,
        token: String,
        key: String,
        payment_method: models::MinimalTokenizedPaymentMethodRequest,
        billing_address: models::BillingAddressRequest,
    ) -> ProviderSetupRequestModel {
        ProviderSetupRequestModel {
            name,
            business_name: None,
            billing_email,
            token,
            key,
            payment_method: Box::new(payment_method),
            billing_address: Box::new(billing_address),
        }
    }
}