/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponseError {
    /// Error code for machines.
    #[serde(rename = "code")]
    pub code: String,
    /// Details about the error.
    #[serde(
        rename = "details",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub details: Option<Option<serde_json::Value>>,
    /// Error message for humans.
    #[serde(rename = "message")]
    pub message: String,
}

impl ErrorResponseError {
    pub fn new(code: String, message: String) -> ErrorResponseError {
        ErrorResponseError {
            code,
            details: None,
            message,
        }
    }
}
