/*
 * NetHSM
 *
 * All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.
 *
 * The version of the OpenAPI document: v1
 * Contact: Nitrokey <info@nitrokey.com>
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct KeyGenerateRequestData {
    #[serde(rename = "mechanisms")]
    pub mechanisms: Vec<crate::models::KeyMechanism>,
    #[serde(rename = "type")]
    pub r#type: crate::models::KeyType,
    #[serde(rename = "length", skip_serializing_if = "Option::is_none")]
    pub length: Option<i32>,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "restrictions", skip_serializing_if = "Option::is_none")]
    pub restrictions: Option<Box<crate::models::KeyRestrictions>>,
}

impl KeyGenerateRequestData {
    pub fn new(
        mechanisms: Vec<crate::models::KeyMechanism>,
        r#type: crate::models::KeyType,
    ) -> KeyGenerateRequestData {
        KeyGenerateRequestData {
            mechanisms,
            r#type,
            length: None,
            id: None,
            restrictions: None,
        }
    }
}
