/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetDefaultErrorOrRecoveryHandlerRequest {
    #[serde(rename = "handler_type")]
    pub handler_type: HandlerType,
    #[serde(rename = "override_existing")]
    pub override_existing: bool,
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[serde(rename = "extra_args", skip_serializing_if = "Option::is_none")]
    pub extra_args: Option<serde_json::Value>,
    #[serde(rename = "number_of_occurence", skip_serializing_if = "Option::is_none")]
    pub number_of_occurence: Option<i32>,
    #[serde(rename = "number_of_occurence_exact", skip_serializing_if = "Option::is_none")]
    pub number_of_occurence_exact: Option<bool>,
    #[serde(rename = "workspace_handler_muted", skip_serializing_if = "Option::is_none")]
    pub workspace_handler_muted: Option<bool>,
}

impl SetDefaultErrorOrRecoveryHandlerRequest {
    pub fn new(handler_type: HandlerType, override_existing: bool) -> SetDefaultErrorOrRecoveryHandlerRequest {
        SetDefaultErrorOrRecoveryHandlerRequest {
            handler_type,
            override_existing,
            path: None,
            extra_args: None,
            number_of_occurence: None,
            number_of_occurence_exact: None,
            workspace_handler_muted: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HandlerType {
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "recovery")]
    Recovery,
    #[serde(rename = "success")]
    Success,
}

impl Default for HandlerType {
    fn default() -> HandlerType {
        Self::Error
    }
}

