#![doc = "generated by AutoRust"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[doc = "Type of operation: get, read, delete, etc."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DimensionProperties {
#[doc = "Name of dimension."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Display name of dimension."]
#[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[doc = "Legacy usage, should not set."]
#[serde(rename = "toBeExportedForShoebox", default, skip_serializing_if = "Option::is_none")]
pub to_be_exported_for_shoebox: Option<bool>,
#[doc = "When set, the dimension is hidden from the customer, used in conjunction with the defaultDimensionValues field below"]
#[serde(rename = "isHidden", default, skip_serializing_if = "Option::is_none")]
pub is_hidden: Option<bool>,
#[doc = "Default dimension value to be sent down for the hidden dimension during query"]
#[serde(rename = "defaultDimensionValues", default, skip_serializing_if = "Option::is_none")]
pub default_dimension_values: Option<serde_json::Value>,
}
impl DimensionProperties {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ErrorContract {
#[doc = "Describes the format of Error response."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub error: Option<ErrorResponse>,
}
impl ErrorContract {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Describes the format of Error response."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ErrorResponse {
#[doc = "Error code"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[doc = "Error message indicating why the operation failed."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
impl ErrorResponse {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The localizable string class."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LocalizableString {
#[doc = "the invariant value."]
pub value: String,
#[doc = "the locale specific value."]
#[serde(rename = "localizedValue", default, skip_serializing_if = "Option::is_none")]
pub localized_value: Option<String>,
}
impl LocalizableString {
pub fn new(value: String) -> Self {
Self {
value,
localized_value: None,
}
}
}
#[doc = "Log specification of operation."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct LogSpecification {
#[doc = "Name of log specification."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Display name of log specification."]
#[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[doc = "Blob duration of specification."]
#[serde(rename = "blobDuration", default, skip_serializing_if = "Option::is_none")]
pub blob_duration: Option<String>,
}
impl LogSpecification {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "A set of metric values in a time range."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Metric {
#[doc = "the id, resourceId, of the metric."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = "the resource type of the metric resource."]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[doc = "The localizable string class."]
pub name: LocalizableString,
#[doc = "Number representing the unit of the metric. 0=Count, 1=Bytes, 2=Seconds, 3=CountPerSecond, 4=BytesPerSecond, 5=Percent, 6=MilliSeconds, 7=ByteSeconds"]
pub unit: Unit,
#[doc = "Array of data points representing the metric values."]
pub data: Vec<MetricValue>,
}
impl Metric {
pub fn new(name: LocalizableString, unit: Unit, data: Vec<MetricValue>) -> Self {
Self {
id: None,
type_: None,
name,
unit,
data,
}
}
}
#[doc = "The collection of metric value sets."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetricCollection {
#[doc = "the value of the collection."]
pub value: Vec<Metric>,
}
impl MetricCollection {
pub fn new(value: Vec<Metric>) -> Self {
Self { value }
}
}
#[doc = "Metric specification of operation."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct MetricSpecification {
#[doc = "The name of the metric."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Display name of the metric."]
#[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[doc = "Display description of the metric."]
#[serde(rename = "displayDescription", default, skip_serializing_if = "Option::is_none")]
pub display_description: Option<String>,
#[doc = "The metric unit. Possible values include: Count,Bytes,Seconds,Percent,CountPerSecond,BytesPerSecond,MilliSeconds,ByteSeconds,Unspecified,BitsPerSecond,Cores,MilliCores,NanoCores"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
#[doc = "The default metric aggregation type. Possible values include: Total,Average,Maximum,Minimum,Count"]
#[serde(rename = "aggregationType", default, skip_serializing_if = "Option::is_none")]
pub aggregation_type: Option<String>,
#[doc = "The supported aggregation types for the metrics."]
#[serde(rename = "supportedAggregationTypes", default, skip_serializing_if = "Vec::is_empty")]
pub supported_aggregation_types: Vec<String>,
#[doc = "The supported time grain types for the metrics."]
#[serde(rename = "supportedTimeGrainTypes", default, skip_serializing_if = "Vec::is_empty")]
pub supported_time_grain_types: Vec<String>,
#[doc = "The supported time grain types for the metrics."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub availabilities: Vec<String>,
#[doc = "The metric lock aggregation type."]
#[serde(rename = "lockAggregationType", default, skip_serializing_if = "Option::is_none")]
pub lock_aggregation_type: Option<String>,
#[doc = "Category or type of metric."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = "The dimensions of metric."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub dimensions: Vec<DimensionProperties>,
#[doc = "Property to specify whether to fill empty gaps with zero."]
#[serde(rename = "fillGapWithZero", default, skip_serializing_if = "Option::is_none")]
pub fill_gap_with_zero: Option<bool>,
#[doc = "The internal metric name."]
#[serde(rename = "internalMetricName", default, skip_serializing_if = "Option::is_none")]
pub internal_metric_name: Option<String>,
}
impl MetricSpecification {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Represents a metric value."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetricValue {
#[doc = "the timestamp for the metric value in ISO 8601 format."]
#[serde(rename = "timeStamp")]
pub time_stamp: String,
#[doc = "the average value in the time range."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub average: Option<f64>,
#[doc = "the least value in the time range."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub minimum: Option<f64>,
#[doc = "the greatest value in the time range."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub maximum: Option<f64>,
#[doc = "the sum of all of the values in the time range."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total: Option<f64>,
#[doc = "the number of samples in the time range. Can be used to determine the number of values that contributed to the average value."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
}
impl MetricValue {
pub fn new(time_stamp: String) -> Self {
Self {
time_stamp,
average: None,
minimum: None,
maximum: None,
total: None,
count: None,
}
}
}
#[doc = "Microsoft Insights API operation definition."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Operation {
#[doc = "Operation name: {provider}/{resource}/{operation}"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Property to specify whether the action is a data action."]
#[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")]
pub is_data_action: Option<bool>,
#[doc = "Display metadata associated with the operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub display: Option<operation::Display>,
#[doc = "Properties of operation, include metric specifications."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<OperationProperties>,
}
impl Operation {
pub fn new() -> Self {
Self::default()
}
}
pub mod operation {
use super::*;
#[doc = "Display metadata associated with the operation."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Display {
#[doc = "The publisher of this operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub publisher: Option<String>,
#[doc = "Service provider: Microsoft.Insights"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
#[doc = "Resource on which the operation is performed: AlertRules, Autoscale, etc."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub resource: Option<String>,
#[doc = "Operation type: Read, write, delete, etc."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub operation: Option<String>,
#[doc = "The description of the operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
impl Display {
pub fn new() -> Self {
Self::default()
}
}
}
#[doc = "Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the next set of results."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct OperationListResult {
#[doc = "List of operations supported by the Microsoft.Insights provider."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<Operation>,
#[doc = "URL to get the next set of operation list results if there are any."]
#[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
impl OperationListResult {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Properties of operation, include metric specifications."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct OperationProperties {
#[doc = "One property of operation, include log specifications."]
#[serde(rename = "serviceSpecification", default, skip_serializing_if = "Option::is_none")]
pub service_specification: Option<ServiceSpecification>,
}
impl OperationProperties {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "One property of operation, include log specifications."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ServiceSpecification {
#[doc = "Log specifications of operation."]
#[serde(rename = "logSpecifications", default, skip_serializing_if = "Vec::is_empty")]
pub log_specifications: Vec<LogSpecification>,
#[doc = "Metric specifications of operation."]
#[serde(rename = "metricSpecifications", default, skip_serializing_if = "Vec::is_empty")]
pub metric_specifications: Vec<MetricSpecification>,
#[doc = "Legacy Metric specifications for operation. Deprecated, do not use."]
#[serde(rename = "legacyMetricSpecifications", default, skip_serializing_if = "Option::is_none")]
pub legacy_metric_specifications: Option<serde_json::Value>,
}
impl ServiceSpecification {
pub fn new() -> Self {
Self::default()
}
}
pub type Unit = String;