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 Operation {
    /// Operation ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    /// ID of the user who performed the operation
    #[serde(rename = "ownerId", skip_serializing_if = "Option::is_none")]
    pub owner_id: Option<uuid::Uuid>,
    /// Date/time when the operation was logged
    #[serde(rename = "logged", skip_serializing_if = "Option::is_none")]
    pub logged: Option<String>,
    /// Type of the operation target
    #[serde(rename = "targetType", skip_serializing_if = "Option::is_none")]
    pub target_type: Option<String>,
    /// ID of the operation target. Can be null if the operation is not related to a specific resource.
    #[serde(rename = "targetId", skip_serializing_if = "Option::is_none")]
    pub target_id: Option<uuid::Uuid>,
    /// Value of the operation target as provided by the user.
    #[serde(rename = "targetValue", skip_serializing_if = "Option::is_none")]
    pub target_value: Option<String>,
    /// Type of the operation
    #[serde(rename = "operationType", skip_serializing_if = "Option::is_none")]
    pub operation_type: Option<String>,
    /// Positional arguments of the operation
    #[serde(rename = "args", skip_serializing_if = "Option::is_none")]
    pub args: Option<Vec<String>>,
    /// Keyword arguments of the operation
    #[serde(rename = "kwargs", skip_serializing_if = "Option::is_none")]
    pub kwargs: Option<serde_json::Value>,
    /// Result of the operation
    #[serde(rename = "result", skip_serializing_if = "Option::is_none")]
    pub result: Option<Result>,
    /// Error message if the operation failed
    #[serde(rename = "errorMsg", skip_serializing_if = "Option::is_none")]
    pub error_msg: Option<String>,
}

impl Operation {
    pub fn new() -> Operation {
        Operation {
            id: None,
            owner_id: None,
            logged: None,
            target_type: None,
            target_id: None,
            target_value: None,
            operation_type: None,
            args: None,
            kwargs: None,
            result: None,
            error_msg: None,
        }
    }
}

/// Result of the operation
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Result {
    #[serde(rename = "success")]
    Success,
    #[serde(rename = "failure")]
    Failure,
}

impl Default for Result {
    fn default() -> Result {
        Self::Success
    }
}