fireblocks-sdk 2.1.0

Rust implementation of the Fireblocks SDK
Documentation
// Fireblocks API
//
// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech

use {
    crate::models,
    serde::{Deserialize, Serialize},
};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateApiUser {
    #[serde(rename = "role")]
    pub role: models::ApiUserRole,
    /// User Name
    #[serde(rename = "name")]
    pub name: String,
    /// API requests are authenticated by providing in each request:   a. API Key in the `X-API-Key` header   b. Auth header - `Authorization: Bearer <JWT>` while the JWT is signed with an RSA 4096 private key.  When creating a new API Key, you need to generate an RSA 4096 private key and a CSR file.  The CSR file is uploaded to Fireblocks upon the user creation and used later on for signature validation (Auth JWT signature validation).  For more info read the following [article](https://developers.fireblocks.com/docs/manage-api-keys)
    #[serde(rename = "csrPem")]
    pub csr_pem: String,
    /// Required for Signer/Admin API users that planned to be paired with an API Co-Signer Machine.  - SGX_MACHINE: For SGX enabled servers - FIREBLOCKS_CCMT: Fireblocks Communal Co-Signer (for Testnet workspaces only) - NITRO_MACHINE: For AWS Nitro Enclave enabled servers  For more information about Fireblocks Co-Signer setup please read the following [article](https://support.fireblocks.io/hc/en-us/articles/12006018592156-API-Co-Signer-Overview).
    #[serde(rename = "coSignerSetupType", skip_serializing_if = "Option::is_none")]
    pub co_signer_setup_type: Option<CoSignerSetupType>,
    /// Pass as `true`` if this is the first user on the your Co-Signer machine
    #[serde(
        rename = "coSignerSetupIsFirstUser",
        skip_serializing_if = "Option::is_none"
    )]
    pub co_signer_setup_is_first_user: Option<bool>,
}

impl CreateApiUser {
    pub fn new(role: models::ApiUserRole, name: String, csr_pem: String) -> CreateApiUser {
        CreateApiUser {
            role,
            name,
            csr_pem,
            co_signer_setup_type: None,
            co_signer_setup_is_first_user: None,
        }
    }
}
/// Required for Signer/Admin API users that planned to be paired with an API Co-Signer Machine.  - SGX_MACHINE: For SGX enabled servers - FIREBLOCKS_CCMT: Fireblocks Communal Co-Signer (for Testnet workspaces only) - NITRO_MACHINE: For AWS Nitro Enclave enabled servers  For more information about Fireblocks Co-Signer setup please read the following [article](https://support.fireblocks.io/hc/en-us/articles/12006018592156-API-Co-Signer-Overview).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CoSignerSetupType {
    #[serde(rename = "SGX_MACHINE")]
    SgxMachine,
    #[serde(rename = "FIREBLOCKS_CCMT")]
    FireblocksCcmt,
    #[serde(rename = "NITRO_MACHINE")]
    NitroMachine,
}

impl Default for CoSignerSetupType {
    fn default() -> CoSignerSetupType {
        Self::SgxMachine
    }
}