#![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 = "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 = "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 = "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 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 = "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 = "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 = "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 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 }
}
}