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 UpgradePremiumToOrganizationRequest {
    #[serde(rename = "organizationName", alias = "OrganizationName")]
    pub organization_name: String,
    #[serde(rename = "key", alias = "Key")]
    pub key: String,
    #[serde(rename = "publicKey", alias = "PublicKey")]
    pub public_key: String,
    #[serde(rename = "encryptedPrivateKey", alias = "EncryptedPrivateKey")]
    pub encrypted_private_key: String,
    #[serde(
        rename = "collectionName",
        alias = "CollectionName",
        skip_serializing_if = "Option::is_none"
    )]
    pub collection_name: Option<String>,
    #[serde(rename = "targetProductTierType", alias = "TargetProductTierType")]
    pub target_product_tier_type: models::ProductTierType,
    #[serde(rename = "billingAddress", alias = "BillingAddress")]
    pub billing_address: Box<models::CheckoutBillingAddressRequest>,
}

impl UpgradePremiumToOrganizationRequest {
    pub fn new(
        organization_name: String,
        key: String,
        public_key: String,
        encrypted_private_key: String,
        target_product_tier_type: models::ProductTierType,
        billing_address: models::CheckoutBillingAddressRequest,
    ) -> UpgradePremiumToOrganizationRequest {
        UpgradePremiumToOrganizationRequest {
            organization_name,
            key,
            public_key,
            encrypted_private_key,
            collection_name: None,
            target_product_tier_type,
            billing_address: Box::new(billing_address),
        }
    }
}