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

use crate::google_rest_apis::compute_v1::models;

/// HttpFaultDelay : Specifies the delay introduced by the load balancer before forwarding the request to the backend service as part of fault injection.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HttpFaultDelay {
    #[serde(rename = "fixedDelay", skip_serializing_if = "Option::is_none")]
    pub fixed_delay: Option<Box<models::Duration>>,
    /// The percentage of traffic for connections, operations, or requests for which a delay is introduced 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 HttpFaultDelay {
    /// Specifies the delay introduced by the load balancer before forwarding the request to the backend service as part of fault injection.
    pub fn new() -> HttpFaultDelay {
        HttpFaultDelay {
            fixed_delay: None,
            percentage: None,
        }
    }
}
