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;

/// AllocateQuotaResponse : Response message for the AllocateQuota method.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AllocateQuotaResponse {
    /// Indicates the decision of the allocate.
    #[serde(rename = "allocateErrors", skip_serializing_if = "Option::is_none")]
    pub allocate_errors: Option<Vec<models::QuotaError>>,
    #[serde(rename = "allocateInfo", skip_serializing_if = "Option::is_none")]
    pub allocate_info: Option<Box<models::AllocateInfo>>,
    /// The same operation_id value used in the AllocateQuotaRequest. Used for logging and diagnostics purposes.
    #[serde(rename = "operationId", skip_serializing_if = "Option::is_none")]
    pub operation_id: Option<String>,
    /// Quota metrics to indicate the result of allocation. Depending on the request, one or more of the following metrics will be included: 1. Per quota group or per quota metric incremental usage will be specified using the following delta metric : \"serviceruntime.googleapis.com/api/consumer/quota_used_count\" 2. The quota limit reached condition will be specified using the following boolean metric : \"serviceruntime.googleapis.com/quota/exceeded\"
    #[serde(rename = "quotaMetrics", skip_serializing_if = "Option::is_none")]
    pub quota_metrics: Option<Vec<models::MetricValueSet>>,
    /// ID of the actual config used to process the request.
    #[serde(rename = "serviceConfigId", skip_serializing_if = "Option::is_none")]
    pub service_config_id: Option<String>,
}

impl AllocateQuotaResponse {
    /// Response message for the AllocateQuota method.
    pub fn new() -> AllocateQuotaResponse {
        AllocateQuotaResponse {
            allocate_errors: None,
            allocate_info: None,
            operation_id: None,
            quota_metrics: None,
            service_config_id: None,
        }
    }
}
