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

/// Error : Error message for the Action if an error occurred, otherwise null.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Error {
    /// Fixed error code for machines.
    #[serde(rename = "code")]
    pub code: String,
    /// Error message for humans.
    #[serde(rename = "message")]
    pub message: String,
}

impl Error {
    /// Error message for the Action if an error occurred, otherwise null.
    pub fn new(code: String, message: String) -> Error {
        Error { code, message }
    }
}
