ash_api 0.1.7

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Hai (Ash API) specifications.
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.1.7
 * Contact: E36 Knots
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewWalletSecret {
    /// Secret name
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "secretType")]
    pub secret_type: Box<crate::models::SecretType>,
    /// P Chain address of the wallet
    #[serde(rename = "pChainAddress", skip_serializing_if = "Option::is_none")]
    pub p_chain_address: Option<String>,
    /// Private key of the wallet
    #[serde(rename = "privateKey", skip_serializing_if = "Option::is_none")]
    pub private_key: Option<String>,
    /// Format of the wallet private key
    #[serde(rename = "privateKeyFormat", skip_serializing_if = "Option::is_none")]
    pub private_key_format: Option<PrivateKeyFormat>,
}

impl NewWalletSecret {
    pub fn new(name: String, secret_type: crate::models::SecretType) -> NewWalletSecret {
        NewWalletSecret {
            name,
            secret_type: Box::new(secret_type),
            p_chain_address: None,
            private_key: None,
            private_key_format: None,
        }
    }
}

/// Format of the wallet private key
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PrivateKeyFormat {
    #[serde(rename = "cb58")]
    Cb58,
    #[serde(rename = "hex")]
    Hex,
}

impl Default for PrivateKeyFormat {
    fn default() -> PrivateKeyFormat {
        Self::Cb58
    }
}