#![doc = "generated by AutoRust"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[doc = "An Azure action group."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActionGroup {
#[doc = "The short name of the action group. This will be used in SMS messages."]
#[serde(rename = "groupShortName")]
pub group_short_name: String,
#[doc = "Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications."]
pub enabled: bool,
#[doc = "The list of email receivers that are part of this action group."]
#[serde(rename = "emailReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub email_receivers: Vec<EmailReceiver>,
#[doc = "The list of SMS receivers that are part of this action group."]
#[serde(rename = "smsReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub sms_receivers: Vec<SmsReceiver>,
#[doc = "The list of webhook receivers that are part of this action group."]
#[serde(rename = "webhookReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub webhook_receivers: Vec<WebhookReceiver>,
#[doc = "The list of ITSM receivers that are part of this action group."]
#[serde(rename = "itsmReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub itsm_receivers: Vec<ItsmReceiver>,
#[doc = "The list of AzureAppPush receivers that are part of this action group."]
#[serde(rename = "azureAppPushReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub azure_app_push_receivers: Vec<AzureAppPushReceiver>,
#[doc = "The list of AutomationRunbook receivers that are part of this action group."]
#[serde(rename = "automationRunbookReceivers", default, skip_serializing_if = "Vec::is_empty")]
pub automation_runbook_receivers: Vec<AutomationRunbookReceiver>,
}
impl ActionGroup {
pub fn new(group_short_name: String, enabled: bool) -> Self {
Self {
group_short_name,
enabled,
email_receivers: Vec::new(),
sms_receivers: Vec::new(),
webhook_receivers: Vec::new(),
itsm_receivers: Vec::new(),
azure_app_push_receivers: Vec::new(),
automation_runbook_receivers: Vec::new(),
}
}
}
#[doc = "A list of action groups."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActionGroupList {
#[doc = "The list of action groups."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<ActionGroupResource>,
#[doc = "Provides the link to retrieve the next set of elements."]
#[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
impl ActionGroupList {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An Azure action group for patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActionGroupPatch {
#[doc = "Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
}
impl ActionGroupPatch {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An action group object for the body of patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActionGroupPatchBody {
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[doc = "An Azure action group for patch operations."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<ActionGroupPatch>,
}
impl ActionGroupPatchBody {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An action group resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActionGroupResource {
#[serde(flatten)]
pub resource: Resource,
#[doc = "An Azure action group."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<ActionGroup>,
}
impl ActionGroupResource {
pub fn new(resource: Resource) -> Self {
Self {
resource,
properties: None,
}
}
}
#[doc = "An Azure activity log alert."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActivityLogAlert {
#[doc = "A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item."]
pub scopes: Vec<String>,
#[doc = "Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[doc = "An Activity Log alert condition that is met when all its member conditions are met."]
pub condition: ActivityLogAlertAllOfCondition,
#[doc = "A list of activity log alert actions."]
pub actions: ActivityLogAlertActionList,
#[doc = "A description of this activity log alert."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
impl ActivityLogAlert {
pub fn new(scopes: Vec<String>, condition: ActivityLogAlertAllOfCondition, actions: ActivityLogAlertActionList) -> Self {
Self {
scopes,
enabled: None,
condition,
actions,
description: None,
}
}
}
#[doc = "A pointer to an Azure Action Group."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActivityLogAlertActionGroup {
#[doc = "The resourceId of the action group. This cannot be null or empty."]
#[serde(rename = "actionGroupId")]
pub action_group_id: String,
#[doc = "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload."]
#[serde(rename = "webhookProperties", default, skip_serializing_if = "Option::is_none")]
pub webhook_properties: Option<serde_json::Value>,
}
impl ActivityLogAlertActionGroup {
pub fn new(action_group_id: String) -> Self {
Self {
action_group_id,
webhook_properties: None,
}
}
}
#[doc = "A list of activity log alert actions."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActivityLogAlertActionList {
#[doc = "The list of activity log alerts."]
#[serde(rename = "actionGroups", default, skip_serializing_if = "Vec::is_empty")]
pub action_groups: Vec<ActivityLogAlertActionGroup>,
}
impl ActivityLogAlertActionList {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An Activity Log alert condition that is met when all its member conditions are met."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActivityLogAlertAllOfCondition {
#[doc = "The list of activity log alert conditions."]
#[serde(rename = "allOf")]
pub all_of: Vec<ActivityLogAlertLeafCondition>,
}
impl ActivityLogAlertAllOfCondition {
pub fn new(all_of: Vec<ActivityLogAlertLeafCondition>) -> Self {
Self { all_of }
}
}
#[doc = "An Activity Log alert condition that is met by comparing an activity log field and value."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActivityLogAlertLeafCondition {
#[doc = "The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'."]
pub field: String,
#[doc = "The field value will be compared to this value (case-insensitive) to determine if the condition is met."]
pub equals: String,
}
impl ActivityLogAlertLeafCondition {
pub fn new(field: String, equals: String) -> Self {
Self { field, equals }
}
}
#[doc = "A list of activity log alerts."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActivityLogAlertList {
#[doc = "The list of activity log alerts."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<ActivityLogAlertResource>,
#[doc = "Provides the link to retrieve the next set of elements."]
#[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
impl ActivityLogAlertList {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An Azure activity log alert for patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActivityLogAlertPatch {
#[doc = "Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
}
impl ActivityLogAlertPatch {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An activity log alert object for the body of patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ActivityLogAlertPatchBody {
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[doc = "An Azure activity log alert for patch operations."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<ActivityLogAlertPatch>,
}
impl ActivityLogAlertPatchBody {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An activity log alert resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActivityLogAlertResource {
#[serde(flatten)]
pub resource: Resource,
#[doc = "An Azure activity log alert."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<ActivityLogAlert>,
}
impl ActivityLogAlertResource {
pub fn new(resource: Resource) -> Self {
Self {
resource,
properties: None,
}
}
}
#[doc = "An alert rule."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AlertRule {
#[doc = "the name of the alert rule."]
pub name: String,
#[doc = "the description of the alert rule that will be included in the alert email."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[doc = "the provisioning state."]
#[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
pub provisioning_state: Option<String>,
#[doc = "the flag that indicates whether the alert rule is enabled."]
#[serde(rename = "isEnabled")]
pub is_enabled: bool,
#[doc = "The condition that results in the alert rule being activated."]
pub condition: RuleCondition,
#[doc = "The action that is performed when the alert rule becomes active, and when an alert condition is resolved."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub action: Option<RuleAction>,
#[doc = "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub actions: Vec<RuleAction>,
#[doc = "Last time the rule was updated in ISO8601 format."]
#[serde(rename = "lastUpdatedTime", default, skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<String>,
}
impl AlertRule {
pub fn new(name: String, is_enabled: bool, condition: RuleCondition) -> Self {
Self {
name,
description: None,
provisioning_state: None,
is_enabled,
condition,
action: None,
actions: Vec::new(),
last_updated_time: None,
}
}
}
#[doc = "The alert rule resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AlertRuleResource {
#[serde(flatten)]
pub resource: Resource,
#[doc = "An alert rule."]
pub properties: AlertRule,
}
impl AlertRuleResource {
pub fn new(resource: Resource, properties: AlertRule) -> Self {
Self { resource, properties }
}
}
#[doc = "Represents a collection of alert rule resources."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct AlertRuleResourceCollection {
#[doc = "the values for the alert rule resources."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<AlertRuleResource>,
}
impl AlertRuleResourceCollection {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The alert rule object for patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct AlertRuleResourcePatch {
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[doc = "An alert rule."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<AlertRule>,
}
impl AlertRuleResourcePatch {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The Azure Automation Runbook notification receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutomationRunbookReceiver {
#[doc = "The Azure automation account Id which holds this runbook and authenticate to Azure resource."]
#[serde(rename = "automationAccountId")]
pub automation_account_id: String,
#[doc = "The name for this runbook."]
#[serde(rename = "runbookName")]
pub runbook_name: String,
#[doc = "The resource id for webhook linked to this runbook."]
#[serde(rename = "webhookResourceId")]
pub webhook_resource_id: String,
#[doc = "Indicates whether this instance is global runbook."]
#[serde(rename = "isGlobalRunbook")]
pub is_global_runbook: bool,
#[doc = "Indicates name of the webhook."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "The URI where webhooks should be sent."]
#[serde(rename = "serviceUri", default, skip_serializing_if = "Option::is_none")]
pub service_uri: Option<String>,
}
impl AutomationRunbookReceiver {
pub fn new(automation_account_id: String, runbook_name: String, webhook_resource_id: String, is_global_runbook: bool) -> Self {
Self {
automation_account_id,
runbook_name,
webhook_resource_id,
is_global_runbook,
name: None,
service_uri: None,
}
}
}
#[doc = "Autoscale notification."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscaleNotification {
#[doc = "the operation associated with the notification and its value must be \"scale\""]
pub operation: autoscale_notification::Operation,
#[doc = "Email notification of an autoscale event."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub email: Option<EmailNotification>,
#[doc = "the collection of webhook notifications."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub webhooks: Vec<WebhookNotification>,
}
impl AutoscaleNotification {
pub fn new(operation: autoscale_notification::Operation) -> Self {
Self {
operation,
email: None,
webhooks: Vec::new(),
}
}
}
pub mod autoscale_notification {
use super::*;
#[doc = "the operation associated with the notification and its value must be \"scale\""]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Operation {
Scale,
}
}
#[doc = "Autoscale profile."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscaleProfile {
#[doc = "the name of the profile."]
pub name: String,
#[doc = "The number of instances that can be used during this profile."]
pub capacity: ScaleCapacity,
#[doc = "the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified."]
pub rules: Vec<ScaleRule>,
#[doc = "A specific date-time for the profile."]
#[serde(rename = "fixedDate", default, skip_serializing_if = "Option::is_none")]
pub fixed_date: Option<TimeWindow>,
#[doc = "The repeating times at which this profile begins. This element is not used if the FixedDate element is used."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub recurrence: Option<Recurrence>,
}
impl AutoscaleProfile {
pub fn new(name: String, capacity: ScaleCapacity, rules: Vec<ScaleRule>) -> Self {
Self {
name,
capacity,
rules,
fixed_date: None,
recurrence: None,
}
}
}
#[doc = "A setting that contains all of the configuration for the automatic scaling of a resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscaleSetting {
#[doc = "the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified."]
pub profiles: Vec<AutoscaleProfile>,
#[doc = "the collection of notifications."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub notifications: Vec<AutoscaleNotification>,
#[doc = "the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[doc = "the name of the autoscale setting."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "the resource identifier of the resource that the autoscale setting should be added to."]
#[serde(rename = "targetResourceUri", default, skip_serializing_if = "Option::is_none")]
pub target_resource_uri: Option<String>,
#[doc = "the location of the resource that the autoscale setting should be added to."]
#[serde(rename = "targetResourceLocation", default, skip_serializing_if = "Option::is_none")]
pub target_resource_location: Option<String>,
}
impl AutoscaleSetting {
pub fn new(profiles: Vec<AutoscaleProfile>) -> Self {
Self {
profiles,
notifications: Vec::new(),
enabled: None,
name: None,
target_resource_uri: None,
target_resource_location: None,
}
}
}
#[doc = "The autoscale setting resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscaleSettingResource {
#[serde(flatten)]
pub resource: Resource,
#[doc = "A setting that contains all of the configuration for the automatic scaling of a resource."]
pub properties: AutoscaleSetting,
}
impl AutoscaleSettingResource {
pub fn new(resource: Resource, properties: AutoscaleSetting) -> Self {
Self { resource, properties }
}
}
#[doc = "Represents a collection of autoscale setting resources."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AutoscaleSettingResourceCollection {
#[doc = "the values for the autoscale setting resources."]
pub value: Vec<AutoscaleSettingResource>,
#[doc = "URL to get the next set of results."]
#[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
impl AutoscaleSettingResourceCollection {
pub fn new(value: Vec<AutoscaleSettingResource>) -> Self {
Self { value, next_link: None }
}
}
#[doc = "The autoscale setting object for patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct AutoscaleSettingResourcePatch {
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[doc = "A setting that contains all of the configuration for the automatic scaling of a resource."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<AutoscaleSetting>,
}
impl AutoscaleSettingResourcePatch {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The Azure mobile App push notification receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AzureAppPushReceiver {
#[doc = "The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group."]
pub name: String,
#[doc = "The email address registered for the Azure mobile app."]
#[serde(rename = "emailAddress")]
pub email_address: String,
}
impl AzureAppPushReceiver {
pub fn new(name: String, email_address: String) -> Self {
Self { name, email_address }
}
}
#[doc = "Operators allowed in the rule condition."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ConditionOperator {
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqual,
}
#[doc = "The diagnostic settings."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettings {
#[doc = "The resource ID of the storage account to which you would like to send Diagnostic Logs."]
#[serde(rename = "storageAccountId", default, skip_serializing_if = "Option::is_none")]
pub storage_account_id: Option<String>,
#[doc = "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility."]
#[serde(rename = "serviceBusRuleId", default, skip_serializing_if = "Option::is_none")]
pub service_bus_rule_id: Option<String>,
#[doc = "The resource Id for the event hub authorization rule."]
#[serde(rename = "eventHubAuthorizationRuleId", default, skip_serializing_if = "Option::is_none")]
pub event_hub_authorization_rule_id: Option<String>,
#[doc = "The name of the event hub. If none is specified, the default event hub will be selected."]
#[serde(rename = "eventHubName", default, skip_serializing_if = "Option::is_none")]
pub event_hub_name: Option<String>,
#[doc = "The list of metric settings."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub metrics: Vec<MetricSettings>,
#[doc = "The list of logs settings."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub logs: Vec<LogSettings>,
#[doc = "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2"]
#[serde(rename = "workspaceId", default, skip_serializing_if = "Option::is_none")]
pub workspace_id: Option<String>,
#[doc = "A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.)"]
#[serde(rename = "logAnalyticsDestinationType", default, skip_serializing_if = "Option::is_none")]
pub log_analytics_destination_type: Option<String>,
}
impl DiagnosticSettings {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The diagnostic settings Category."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettingsCategory {
#[doc = "The type of the diagnostic settings category."]
#[serde(rename = "categoryType", default, skip_serializing_if = "Option::is_none")]
pub category_type: Option<diagnostic_settings_category::CategoryType>,
}
impl DiagnosticSettingsCategory {
pub fn new() -> Self {
Self::default()
}
}
pub mod diagnostic_settings_category {
use super::*;
#[doc = "The type of the diagnostic settings category."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum CategoryType {
Metrics,
Logs,
}
}
#[doc = "The diagnostic settings category resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettingsCategoryResource {
#[serde(flatten)]
pub proxy_only_resource: ProxyOnlyResource,
#[doc = "The diagnostic settings Category."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<DiagnosticSettingsCategory>,
}
impl DiagnosticSettingsCategoryResource {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Represents a collection of diagnostic setting category resources."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettingsCategoryResourceCollection {
#[doc = "The collection of diagnostic settings category resources."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<DiagnosticSettingsCategoryResource>,
}
impl DiagnosticSettingsCategoryResourceCollection {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The diagnostic setting resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettingsResource {
#[serde(flatten)]
pub proxy_only_resource: ProxyOnlyResource,
#[doc = "The diagnostic settings."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<DiagnosticSettings>,
}
impl DiagnosticSettingsResource {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Represents a collection of alert rule resources."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct DiagnosticSettingsResourceCollection {
#[doc = "The collection of diagnostic settings resources;."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<DiagnosticSettingsResource>,
}
impl DiagnosticSettingsResourceCollection {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Email notification of an autoscale event."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct EmailNotification {
#[doc = "a value indicating whether to send email to subscription administrator."]
#[serde(rename = "sendToSubscriptionAdministrator", default, skip_serializing_if = "Option::is_none")]
pub send_to_subscription_administrator: Option<bool>,
#[doc = "a value indicating whether to send email to subscription co-administrators."]
#[serde(rename = "sendToSubscriptionCoAdministrators", default, skip_serializing_if = "Option::is_none")]
pub send_to_subscription_co_administrators: Option<bool>,
#[doc = "the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored."]
#[serde(rename = "customEmails", default, skip_serializing_if = "Vec::is_empty")]
pub custom_emails: Vec<String>,
}
impl EmailNotification {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An email receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct EmailReceiver {
#[doc = "The name of the email receiver. Names must be unique across all receivers within an action group."]
pub name: String,
#[doc = "The email address of this receiver."]
#[serde(rename = "emailAddress")]
pub email_address: String,
#[doc = "Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<ReceiverStatus>,
}
impl EmailReceiver {
pub fn new(name: String, email_address: String) -> Self {
Self {
name,
email_address,
status: None,
}
}
}
#[doc = "Describes a receiver that should be resubscribed."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct EnableRequest {
#[doc = "The name of the receiver to resubscribe."]
#[serde(rename = "receiverName")]
pub receiver_name: String,
}
impl EnableRequest {
pub fn new(receiver_name: String) -> Self {
Self { receiver_name }
}
}
#[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 = "An alert incident indicates the activation status of an alert rule."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct Incident {
#[doc = "Incident name."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Rule name that is associated with the incident."]
#[serde(rename = "ruleName", default, skip_serializing_if = "Option::is_none")]
pub rule_name: Option<String>,
#[doc = "A boolean to indicate whether the incident is active or resolved."]
#[serde(rename = "isActive", default, skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[doc = "The time at which the incident was activated in ISO8601 format."]
#[serde(rename = "activatedTime", default, skip_serializing_if = "Option::is_none")]
pub activated_time: Option<String>,
#[doc = "The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active."]
#[serde(rename = "resolvedTime", default, skip_serializing_if = "Option::is_none")]
pub resolved_time: Option<String>,
}
impl Incident {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The List incidents operation response."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct IncidentListResult {
#[doc = "the incident collection."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub value: Vec<Incident>,
}
impl IncidentListResult {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "An Itsm receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItsmReceiver {
#[doc = "The name of the Itsm receiver. Names must be unique across all receivers within an action group."]
pub name: String,
#[doc = "OMS LA instance identifier."]
#[serde(rename = "workspaceId")]
pub workspace_id: String,
#[doc = "Unique identification of ITSM connection among multiple defined in above workspace."]
#[serde(rename = "connectionId")]
pub connection_id: String,
#[doc = "JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well."]
#[serde(rename = "ticketConfiguration")]
pub ticket_configuration: String,
#[doc = "Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'"]
pub region: String,
}
impl ItsmReceiver {
pub fn new(name: String, workspace_id: String, connection_id: String, ticket_configuration: String, region: String) -> Self {
Self {
name,
workspace_id,
connection_id,
ticket_configuration,
region,
}
}
}
#[doc = "A rule condition based on a certain number of locations failing."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LocationThresholdRuleCondition {
#[serde(flatten)]
pub rule_condition: RuleCondition,
#[doc = "the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day."]
#[serde(rename = "windowSize", default, skip_serializing_if = "Option::is_none")]
pub window_size: Option<String>,
#[doc = "the number of locations that must fail to activate the alert."]
#[serde(rename = "failedLocationCount")]
pub failed_location_count: i32,
}
impl LocationThresholdRuleCondition {
pub fn new(rule_condition: RuleCondition, failed_location_count: i32) -> Self {
Self {
rule_condition,
window_size: None,
failed_location_count,
}
}
}
#[doc = "Represents a collection of log profiles."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogProfileCollection {
#[doc = "the values of the log profiles."]
pub value: Vec<LogProfileResource>,
}
impl LogProfileCollection {
pub fn new(value: Vec<LogProfileResource>) -> Self {
Self { value }
}
}
#[doc = "The log profile properties."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogProfileProperties {
#[doc = "the resource id of the storage account to which you would like to send the Activity Log."]
#[serde(rename = "storageAccountId", default, skip_serializing_if = "Option::is_none")]
pub storage_account_id: Option<String>,
#[doc = "The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'."]
#[serde(rename = "serviceBusRuleId", default, skip_serializing_if = "Option::is_none")]
pub service_bus_rule_id: Option<String>,
#[doc = "List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location."]
pub locations: Vec<String>,
#[doc = "the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'"]
pub categories: Vec<String>,
#[doc = "Specifies the retention policy for the log."]
#[serde(rename = "retentionPolicy")]
pub retention_policy: RetentionPolicy,
}
impl LogProfileProperties {
pub fn new(locations: Vec<String>, categories: Vec<String>, retention_policy: RetentionPolicy) -> Self {
Self {
storage_account_id: None,
service_bus_rule_id: None,
locations,
categories,
retention_policy,
}
}
}
#[doc = "The log profile resource."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogProfileResource {
#[serde(flatten)]
pub resource: Resource,
#[doc = "The log profile properties."]
pub properties: LogProfileProperties,
}
impl LogProfileResource {
pub fn new(resource: Resource, properties: LogProfileProperties) -> Self {
Self { resource, properties }
}
}
#[doc = "The log profile resource for patch operations."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct LogProfileResourcePatch {
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[doc = "The log profile properties."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<LogProfileProperties>,
}
impl LogProfileResourcePatch {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogSettings {
#[doc = "Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = "a value indicating whether this log is enabled."]
pub enabled: bool,
#[doc = "Specifies the retention policy for the log."]
#[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")]
pub retention_policy: Option<RetentionPolicy>,
}
impl LogSettings {
pub fn new(enabled: bool) -> Self {
Self {
category: None,
enabled,
retention_policy: None,
}
}
}
#[doc = "How the data that is collected should be combined over time."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ManagementEventAggregationCondition {
#[doc = "Operators allowed in the rule condition."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub operator: Option<ConditionOperator>,
#[doc = "The threshold value that activates the alert."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub threshold: Option<f64>,
#[doc = "the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day."]
#[serde(rename = "windowSize", default, skip_serializing_if = "Option::is_none")]
pub window_size: Option<String>,
}
impl ManagementEventAggregationCondition {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "A management event rule condition."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ManagementEventRuleCondition {
#[serde(flatten)]
pub rule_condition: RuleCondition,
#[doc = "How the data that is collected should be combined over time."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub aggregation: Option<ManagementEventAggregationCondition>,
}
impl ManagementEventRuleCondition {
pub fn new(rule_condition: RuleCondition) -> Self {
Self {
rule_condition,
aggregation: None,
}
}
}
#[doc = "Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetricSettings {
#[doc = "the timegrain of the metric in ISO8601 format."]
#[serde(rename = "timeGrain", default, skip_serializing_if = "Option::is_none")]
pub time_grain: Option<String>,
#[doc = "Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
#[doc = "a value indicating whether this category is enabled."]
pub enabled: bool,
#[doc = "Specifies the retention policy for the log."]
#[serde(rename = "retentionPolicy", default, skip_serializing_if = "Option::is_none")]
pub retention_policy: Option<RetentionPolicy>,
}
impl MetricSettings {
pub fn new(enabled: bool) -> Self {
Self {
time_grain: None,
category: None,
enabled,
retention_policy: None,
}
}
}
#[doc = "The trigger that results in a scaling action."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetricTrigger {
#[doc = "the name of the metric that defines what the rule monitors."]
#[serde(rename = "metricName")]
pub metric_name: String,
#[doc = "the namespace of the metric that defines what the rule monitors."]
#[serde(rename = "metricNamespace", default, skip_serializing_if = "Option::is_none")]
pub metric_namespace: Option<String>,
#[doc = "the resource identifier of the resource the rule monitors."]
#[serde(rename = "metricResourceUri")]
pub metric_resource_uri: String,
#[doc = "the location of the resource the rule monitors."]
#[serde(rename = "metricResourceLocation", default, skip_serializing_if = "Option::is_none")]
pub metric_resource_location: Option<String>,
#[doc = "the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute."]
#[serde(rename = "timeGrain")]
pub time_grain: String,
#[doc = "the metric statistic type. How the metrics from multiple instances are combined."]
pub statistic: metric_trigger::Statistic,
#[doc = "the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes."]
#[serde(rename = "timeWindow")]
pub time_window: String,
#[doc = "time aggregation type. How the data that is collected should be combined over time. The default value is Average."]
#[serde(rename = "timeAggregation")]
pub time_aggregation: metric_trigger::TimeAggregation,
#[doc = "the operator that is used to compare the metric data and the threshold."]
pub operator: metric_trigger::Operator,
#[doc = "the threshold of the metric that triggers the scale action."]
pub threshold: f64,
#[doc = "List of dimension conditions. For example: [{\"DimensionName\":\"AppName\",\"Operator\":\"Equals\",\"Values\":[\"App1\"]},{\"DimensionName\":\"Deployment\",\"Operator\":\"Equals\",\"Values\":[\"default\"]}]."]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub dimensions: Vec<ScaleRuleMetricDimension>,
#[doc = "a value indicating whether metric should divide per instance."]
#[serde(rename = "dividePerInstance", default, skip_serializing_if = "Option::is_none")]
pub divide_per_instance: Option<bool>,
}
impl MetricTrigger {
pub fn new(
metric_name: String,
metric_resource_uri: String,
time_grain: String,
statistic: metric_trigger::Statistic,
time_window: String,
time_aggregation: metric_trigger::TimeAggregation,
operator: metric_trigger::Operator,
threshold: f64,
) -> Self {
Self {
metric_name,
metric_namespace: None,
metric_resource_uri,
metric_resource_location: None,
time_grain,
statistic,
time_window,
time_aggregation,
operator,
threshold,
dimensions: Vec::new(),
divide_per_instance: None,
}
}
}
pub mod metric_trigger {
use super::*;
#[doc = "the metric statistic type. How the metrics from multiple instances are combined."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Statistic {
Average,
Min,
Max,
Sum,
Count,
}
#[doc = "time aggregation type. How the data that is collected should be combined over time. The default value is Average."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum TimeAggregation {
Average,
Minimum,
Maximum,
Total,
Count,
Last,
}
#[doc = "the operator that is used to compare the metric data and the threshold."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Operator {
Equals,
NotEquals,
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqual,
}
}
#[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 = "Display metadata associated with the operation."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub display: Option<operation::Display>,
}
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 = "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>,
}
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 = "A proxy only azure resource object"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ProxyOnlyResource {
#[doc = "Azure resource Id"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = "Azure resource name"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Azure resource type"]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
impl ProxyOnlyResource {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ReceiverStatus {
NotSpecified,
Enabled,
Disabled,
}
#[doc = "The repeating times at which this profile begins. This element is not used if the FixedDate element is used."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Recurrence {
#[doc = "the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly."]
pub frequency: recurrence::Frequency,
#[doc = "The scheduling constraints for when the profile begins."]
pub schedule: RecurrentSchedule,
}
impl Recurrence {
pub fn new(frequency: recurrence::Frequency, schedule: RecurrentSchedule) -> Self {
Self { frequency, schedule }
}
}
pub mod recurrence {
use super::*;
#[doc = "the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Frequency {
None,
Second,
Minute,
Hour,
Day,
Week,
Month,
Year,
}
}
#[doc = "The scheduling constraints for when the profile begins."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RecurrentSchedule {
#[doc = "the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time"]
#[serde(rename = "timeZone")]
pub time_zone: String,
#[doc = "the collection of days that the profile takes effect on. Possible values are Sunday through Saturday."]
pub days: Vec<String>,
#[doc = "A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported)."]
pub hours: Vec<i32>,
#[doc = "A collection of minutes at which the profile takes effect at."]
pub minutes: Vec<i32>,
}
impl RecurrentSchedule {
pub fn new(time_zone: String, days: Vec<String>, hours: Vec<i32>, minutes: Vec<i32>) -> Self {
Self {
time_zone,
days,
hours,
minutes,
}
}
}
#[doc = "An azure resource object"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Resource {
#[doc = "Azure resource Id"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[doc = "Azure resource name"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "Azure resource type"]
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[doc = "Resource location"]
pub location: String,
#[doc = "Resource tags"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
}
impl Resource {
pub fn new(location: String) -> Self {
Self {
id: None,
name: None,
type_: None,
location,
tags: None,
}
}
}
#[doc = "Specifies the retention policy for the log."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RetentionPolicy {
#[doc = "a value indicating whether the retention policy is enabled."]
pub enabled: bool,
#[doc = "the number of days for the retention in days. A value of 0 will retain the events indefinitely."]
pub days: i32,
}
impl RetentionPolicy {
pub fn new(enabled: bool, days: i32) -> Self {
Self { enabled, days }
}
}
#[doc = "The action that is performed when the alert rule becomes active, and when an alert condition is resolved."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleAction {
#[doc = "specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction."]
#[serde(rename = "odata.type")]
pub odata_type: String,
}
impl RuleAction {
pub fn new(odata_type: String) -> Self {
Self { odata_type }
}
}
#[doc = "The condition that results in the alert rule being activated."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleCondition {
#[doc = "specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of management events), LocationThresholdRuleCondition (based on the number of failures of a web test), and ThresholdRuleCondition (based on the threshold of a metric)."]
#[serde(rename = "odata.type")]
pub odata_type: String,
#[doc = "The resource from which the rule collects its data."]
#[serde(rename = "dataSource", default, skip_serializing_if = "Option::is_none")]
pub data_source: Option<RuleDataSource>,
}
impl RuleCondition {
pub fn new(odata_type: String) -> Self {
Self {
odata_type,
data_source: None,
}
}
}
#[doc = "The resource from which the rule collects its data."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleDataSource {
#[doc = "specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource"]
#[serde(rename = "odata.type")]
pub odata_type: String,
#[doc = "the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule."]
#[serde(rename = "resourceUri", default, skip_serializing_if = "Option::is_none")]
pub resource_uri: Option<String>,
#[doc = "the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule."]
#[serde(rename = "legacyResourceId", default, skip_serializing_if = "Option::is_none")]
pub legacy_resource_id: Option<String>,
#[doc = "the location of the resource."]
#[serde(rename = "resourceLocation", default, skip_serializing_if = "Option::is_none")]
pub resource_location: Option<String>,
#[doc = "the namespace of the metric."]
#[serde(rename = "metricNamespace", default, skip_serializing_if = "Option::is_none")]
pub metric_namespace: Option<String>,
}
impl RuleDataSource {
pub fn new(odata_type: String) -> Self {
Self {
odata_type,
resource_uri: None,
legacy_resource_id: None,
resource_location: None,
metric_namespace: None,
}
}
}
#[doc = "Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleEmailAction {
#[serde(flatten)]
pub rule_action: RuleAction,
#[doc = "Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated."]
#[serde(rename = "sendToServiceOwners", default, skip_serializing_if = "Option::is_none")]
pub send_to_service_owners: Option<bool>,
#[doc = "the list of administrator's custom email addresses to notify of the activation of the alert."]
#[serde(rename = "customEmails", default, skip_serializing_if = "Vec::is_empty")]
pub custom_emails: Vec<String>,
}
impl RuleEmailAction {
pub fn new(rule_action: RuleAction) -> Self {
Self {
rule_action,
send_to_service_owners: None,
custom_emails: Vec::new(),
}
}
}
#[doc = "The claims for a rule management event data source."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct RuleManagementEventClaimsDataSource {
#[doc = "the email address."]
#[serde(rename = "emailAddress", default, skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
}
impl RuleManagementEventClaimsDataSource {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleManagementEventDataSource {
#[serde(flatten)]
pub rule_data_source: RuleDataSource,
#[doc = "the event name."]
#[serde(rename = "eventName", default, skip_serializing_if = "Option::is_none")]
pub event_name: Option<String>,
#[doc = "the event source."]
#[serde(rename = "eventSource", default, skip_serializing_if = "Option::is_none")]
pub event_source: Option<String>,
#[doc = "the level."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub level: Option<String>,
#[doc = "The name of the operation that should be checked for. If no name is provided, any operation will match."]
#[serde(rename = "operationName", default, skip_serializing_if = "Option::is_none")]
pub operation_name: Option<String>,
#[doc = "the resource group name."]
#[serde(rename = "resourceGroupName", default, skip_serializing_if = "Option::is_none")]
pub resource_group_name: Option<String>,
#[doc = "the resource provider name."]
#[serde(rename = "resourceProviderName", default, skip_serializing_if = "Option::is_none")]
pub resource_provider_name: Option<String>,
#[doc = "The status of the operation that should be checked for. If no status is provided, any status will match."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[doc = "the substatus."]
#[serde(rename = "subStatus", default, skip_serializing_if = "Option::is_none")]
pub sub_status: Option<String>,
#[doc = "The claims for a rule management event data source."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub claims: Option<RuleManagementEventClaimsDataSource>,
}
impl RuleManagementEventDataSource {
pub fn new(rule_data_source: RuleDataSource) -> Self {
Self {
rule_data_source,
event_name: None,
event_source: None,
level: None,
operation_name: None,
resource_group_name: None,
resource_provider_name: None,
status: None,
sub_status: None,
claims: None,
}
}
}
#[doc = "A rule metric data source. The discriminator value is always RuleMetricDataSource in this case."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleMetricDataSource {
#[serde(flatten)]
pub rule_data_source: RuleDataSource,
#[doc = "the name of the metric that defines what the rule monitors."]
#[serde(rename = "metricName", default, skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
}
impl RuleMetricDataSource {
pub fn new(rule_data_source: RuleDataSource) -> Self {
Self {
rule_data_source,
metric_name: None,
}
}
}
#[doc = "Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this case."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleWebhookAction {
#[serde(flatten)]
pub rule_action: RuleAction,
#[doc = "the service uri to Post the notification when the alert activates or resolves."]
#[serde(rename = "serviceUri", default, skip_serializing_if = "Option::is_none")]
pub service_uri: Option<String>,
#[doc = "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<serde_json::Value>,
}
impl RuleWebhookAction {
pub fn new(rule_action: RuleAction) -> Self {
Self {
rule_action,
service_uri: None,
properties: None,
}
}
}
#[doc = "The parameters for the scaling action."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScaleAction {
#[doc = "the scale direction. Whether the scaling action increases or decreases the number of instances."]
pub direction: scale_action::Direction,
#[doc = "the type of action that should occur when the scale rule fires."]
#[serde(rename = "type")]
pub type_: scale_action::Type,
#[doc = "the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
#[doc = "the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format."]
pub cooldown: String,
}
impl ScaleAction {
pub fn new(direction: scale_action::Direction, type_: scale_action::Type, cooldown: String) -> Self {
Self {
direction,
type_,
value: None,
cooldown,
}
}
}
pub mod scale_action {
use super::*;
#[doc = "the scale direction. Whether the scaling action increases or decreases the number of instances."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Direction {
None,
Increase,
Decrease,
}
#[doc = "the type of action that should occur when the scale rule fires."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Type {
ChangeCount,
PercentChangeCount,
ExactCount,
ServiceAllowedNextValue,
}
}
#[doc = "The number of instances that can be used during this profile."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScaleCapacity {
#[doc = "the minimum number of instances for the resource."]
pub minimum: String,
#[doc = "the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription."]
pub maximum: String,
#[doc = "the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default."]
pub default: String,
}
impl ScaleCapacity {
pub fn new(minimum: String, maximum: String, default: String) -> Self {
Self { minimum, maximum, default }
}
}
#[doc = "A rule that provide the triggers and parameters for the scaling action."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScaleRule {
#[doc = "The trigger that results in a scaling action."]
#[serde(rename = "metricTrigger")]
pub metric_trigger: MetricTrigger,
#[doc = "The parameters for the scaling action."]
#[serde(rename = "scaleAction")]
pub scale_action: ScaleAction,
}
impl ScaleRule {
pub fn new(metric_trigger: MetricTrigger, scale_action: ScaleAction) -> Self {
Self {
metric_trigger,
scale_action,
}
}
}
#[doc = "Specifies an auto scale rule metric dimension."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScaleRuleMetricDimension {
#[doc = "Name of the dimension."]
#[serde(rename = "DimensionName")]
pub dimension_name: String,
#[doc = "the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values"]
#[serde(rename = "Operator")]
pub operator: scale_rule_metric_dimension::Operator,
#[doc = "list of dimension values. For example: [\"App1\",\"App2\"]."]
#[serde(rename = "Values")]
pub values: Vec<String>,
}
impl ScaleRuleMetricDimension {
pub fn new(dimension_name: String, operator: scale_rule_metric_dimension::Operator, values: Vec<String>) -> Self {
Self {
dimension_name,
operator,
values,
}
}
}
pub mod scale_rule_metric_dimension {
use super::*;
#[doc = "the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values"]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Operator {
Equals,
NotEquals,
}
}
#[doc = "An SMS receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SmsReceiver {
#[doc = "The name of the SMS receiver. Names must be unique across all receivers within an action group."]
pub name: String,
#[doc = "The country code of the SMS receiver."]
#[serde(rename = "countryCode")]
pub country_code: String,
#[doc = "The phone number of the SMS receiver."]
#[serde(rename = "phoneNumber")]
pub phone_number: String,
#[doc = "Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<ReceiverStatus>,
}
impl SmsReceiver {
pub fn new(name: String, country_code: String, phone_number: String) -> Self {
Self {
name,
country_code,
phone_number,
status: None,
}
}
}
#[doc = "A rule condition based on a metric crossing a threshold."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ThresholdRuleCondition {
#[serde(flatten)]
pub rule_condition: RuleCondition,
#[doc = "Operators allowed in the rule condition."]
pub operator: ConditionOperator,
#[doc = "the threshold value that activates the alert."]
pub threshold: f64,
#[doc = "the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day."]
#[serde(rename = "windowSize", default, skip_serializing_if = "Option::is_none")]
pub window_size: Option<String>,
#[doc = "Aggregation operators allowed in a rule."]
#[serde(rename = "timeAggregation", default, skip_serializing_if = "Option::is_none")]
pub time_aggregation: Option<TimeAggregationOperator>,
}
impl ThresholdRuleCondition {
pub fn new(rule_condition: RuleCondition, operator: ConditionOperator, threshold: f64) -> Self {
Self {
rule_condition,
operator,
threshold,
window_size: None,
time_aggregation: None,
}
}
}
#[doc = "Aggregation operators allowed in a rule."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum TimeAggregationOperator {
Average,
Minimum,
Maximum,
Total,
Last,
}
#[doc = "A specific date-time for the profile."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TimeWindow {
#[doc = "the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time"]
#[serde(rename = "timeZone", default, skip_serializing_if = "Option::is_none")]
pub time_zone: Option<String>,
#[doc = "the start time for the profile in ISO 8601 format."]
pub start: String,
#[doc = "the end time for the profile in ISO 8601 format."]
pub end: String,
}
impl TimeWindow {
pub fn new(start: String, end: String) -> Self {
Self {
time_zone: None,
start,
end,
}
}
}
#[doc = "Webhook notification of an autoscale event."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct WebhookNotification {
#[doc = "the service address to receive the notification."]
#[serde(rename = "serviceUri", default, skip_serializing_if = "Option::is_none")]
pub service_uri: Option<String>,
#[doc = "a property bag of settings. This value can be empty."]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<serde_json::Value>,
}
impl WebhookNotification {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "A webhook receiver."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookReceiver {
#[doc = "The name of the webhook receiver. Names must be unique across all receivers within an action group."]
pub name: String,
#[doc = "The URI where webhooks should be sent."]
#[serde(rename = "serviceUri")]
pub service_uri: String,
}
impl WebhookReceiver {
pub fn new(name: String, service_uri: String) -> Self {
Self { name, service_uri }
}
}