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;
/// Operation : Represents information regarding an operation.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Operation {
/// Identity of the consumer who is using the service. This field should be filled in for the operations initiated by a consumer, but not for service-initiated operations that are not related to a specific consumer. - This can be in one of the following formats: - project:PROJECT_ID, - project`_`number:PROJECT_NUMBER, - projects/PROJECT_ID or PROJECT_NUMBER, - folders/FOLDER_NUMBER, - organizations/ORGANIZATION_NUMBER, - api`_`key:API_KEY.
#[serde(rename = "consumerId", skip_serializing_if = "Option::is_none")]
pub consumer_id: Option<String>,
/// End time of the operation. Required when the operation is used in ServiceController.Report, but optional when the operation is used in ServiceController.Check.
#[serde(rename = "endTime", skip_serializing_if = "Option::is_none")]
pub end_time: Option<String>,
/// DO NOT USE. This is an experimental field.
#[serde(rename = "importance", skip_serializing_if = "Option::is_none")]
pub importance: Option<Importance>,
/// Labels describing the operation. Only the following labels are allowed: - Labels describing monitored resources as defined in the service configuration. - Default labels of metric values. When specified, labels defined in the metric value override these default. - The following labels defined by Google Cloud Platform: - `cloud.googleapis.com/location` describing the location where the operation happened, - `servicecontrol.googleapis.com/user_agent` describing the user agent of the API request, - `servicecontrol.googleapis.com/service_agent` describing the service used to handle the API request (e.g. ESP), - `servicecontrol.googleapis.com/platform` describing the platform where the API is served, such as App Engine, Compute Engine, or Kubernetes Engine.
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<std::collections::HashMap<String, String>>,
/// Represents information to be logged.
#[serde(rename = "logEntries", skip_serializing_if = "Option::is_none")]
pub log_entries: Option<Vec<models::LogEntry>>,
/// Represents information about this operation. Each MetricValueSet corresponds to a metric defined in the service configuration. The data type used in the MetricValueSet must agree with the data type specified in the metric definition. Within a single operation, it is not allowed to have more than one MetricValue instances that have the same metric names and identical label value combinations. If a request has such duplicated MetricValue instances, the entire request is rejected with an invalid argument error.
#[serde(rename = "metricValueSets", skip_serializing_if = "Option::is_none")]
pub metric_value_sets: Option<Vec<models::MetricValueSet>>,
/// Identity of the operation. This must be unique within the scope of the service that generated the operation. If the service calls Check() and Report() on the same operation, the two calls should carry the same id. UUID version 4 is recommended, though not required. In scenarios where an operation is computed from existing information and an idempotent id is desirable for deduplication purpose, UUID version 5 is recommended. See RFC 4122 for details.
#[serde(rename = "operationId", skip_serializing_if = "Option::is_none")]
pub operation_id: Option<String>,
/// Fully qualified name of the operation. Reserved for future use.
#[serde(rename = "operationName", skip_serializing_if = "Option::is_none")]
pub operation_name: Option<String>,
#[serde(rename = "quotaProperties", skip_serializing_if = "Option::is_none")]
pub quota_properties: Option<Box<models::QuotaProperties>>,
/// The resources that are involved in the operation. The maximum supported number of entries in this field is 100.
#[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<models::ResourceInfo>>,
/// Required. Start time of the operation.
#[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
pub start_time: Option<String>,
/// Unimplemented. A list of Cloud Trace spans. The span names shall contain the id of the destination project which can be either the produce or the consumer project.
#[serde(rename = "traceSpans", skip_serializing_if = "Option::is_none")]
pub trace_spans: Option<Vec<models::TraceSpan>>,
/// Private Preview. This feature is only available for approved services. User defined labels for the resource that this operation is associated with.
#[serde(rename = "userLabels", skip_serializing_if = "Option::is_none")]
pub user_labels: Option<std::collections::HashMap<String, String>>,
}
impl Operation {
/// Represents information regarding an operation.
pub fn new() -> Operation {
Operation {
consumer_id: None,
end_time: None,
importance: None,
labels: None,
log_entries: None,
metric_value_sets: None,
operation_id: None,
operation_name: None,
quota_properties: None,
resources: None,
start_time: None,
trace_spans: None,
user_labels: None,
}
}
}
/// DO NOT USE. This is an experimental field.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Importance {
#[serde(rename = "LOW")]
Low,
#[serde(rename = "HIGH")]
High,
#[serde(rename = "DEBUG")]
Debug,
#[serde(rename = "PROMOTED")]
Promoted,
}
impl Default for Importance {
fn default() -> Importance {
Self::Low
}
}