use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

/// HttpFaultAbort : Specification for how requests are aborted as part of fault injection.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct HttpFaultAbort {
    /// The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director.
    #[serde(rename = "httpStatus", skip_serializing_if = "Option::is_none")]
    pub http_status: Option<i32>,
    /// The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive.
    #[serde(rename = "percentage", skip_serializing_if = "Option::is_none")]
    pub percentage: Option<f64>,
}

impl HttpFaultAbort {
    /// Specification for how requests are aborted as part of fault injection.
    pub fn new() -> HttpFaultAbort {
        HttpFaultAbort {
            http_status: None,
            percentage: None,
        }
    }
}
