/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 4b3f595
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// CreateCertificateResponse : Response to POST https://api.hetzner.cloud/v1/certificates
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateCertificateResponse {
    #[serde(
        rename = "action",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub action: Option<Option<Box<models::Action>>>,
    #[serde(rename = "certificate")]
    pub certificate: Box<models::Certificate>,
}

impl CreateCertificateResponse {
    /// Response to POST https://api.hetzner.cloud/v1/certificates
    pub fn new(certificate: models::Certificate) -> CreateCertificateResponse {
        CreateCertificateResponse {
            action: None,
            certificate: Box::new(certificate),
        }
    }
}
