use serde::{Deserialize, Serialize}; /*
                                      * Service Control API
                                      *
                                      * Provides admission control and telemetry reporting for services integrated with Service Infrastructure.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::servicecontrol_v1::models;

/// ExponentialBuckets : Describing buckets with exponentially growing width.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExponentialBuckets {
    /// The i'th exponential bucket covers the interval [scale * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive. Must be larger than 1.0.
    #[serde(rename = "growthFactor", skip_serializing_if = "Option::is_none")]
    pub growth_factor: Option<f64>,
    /// The number of finite buckets. With the underflow and overflow buckets, the total number of buckets is `num_finite_buckets` + 2. See comments on `bucket_options` for details.
    #[serde(rename = "numFiniteBuckets", skip_serializing_if = "Option::is_none")]
    pub num_finite_buckets: Option<i32>,
    /// The i'th exponential bucket covers the interval [scale * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to num_finite_buckets inclusive. Must be > 0.
    #[serde(rename = "scale", skip_serializing_if = "Option::is_none")]
    pub scale: Option<f64>,
}

impl ExponentialBuckets {
    /// Describing buckets with exponentially growing width.
    pub fn new() -> ExponentialBuckets {
        ExponentialBuckets {
            growth_factor: None,
            num_finite_buckets: None,
            scale: None,
        }
    }
}
