// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package arm

import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"

type ActivityLogAlert_Spec struct {
	// Location: The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North
	// Europe regions.
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: The Activity Log Alert rule properties of the resource.
	Properties *AlertRuleProperties `json:"properties,omitempty"`

	// Tags: The tags of the resource.
	Tags map[string]string `json:"tags,omitempty"`
}

var _ genruntime.ARMResourceSpec = &ActivityLogAlert_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2020-10-01"
func (alert ActivityLogAlert_Spec) GetAPIVersion() string {
	return "2020-10-01"
}

// GetName returns the Name of the resource
func (alert *ActivityLogAlert_Spec) GetName() string {
	return alert.Name
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/activityLogAlerts"
func (alert *ActivityLogAlert_Spec) GetType() string {
	return "Microsoft.Insights/activityLogAlerts"
}

// An Azure Activity Log Alert rule.
type AlertRuleProperties struct {
	// Actions: The actions that will activate when the condition is met.
	Actions *ActionList `json:"actions,omitempty"`

	// Condition: The condition that will cause this alert to activate.
	Condition *AlertRuleAllOfCondition `json:"condition,omitempty"`

	// Description: A description of this Activity Log Alert rule.
	Description *string `json:"description,omitempty"`

	// Enabled: Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then
	// none of its actions will be activated.
	Enabled *bool `json:"enabled,omitempty"`

	// Scopes: A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with
	// resource IDs that fall under one of these prefixes. This list must include at least one item.
	Scopes []string `json:"scopes,omitempty"`
}

// A list of Activity Log Alert rule actions.
type ActionList struct {
	// ActionGroups: The list of the Action Groups.
	ActionGroups []ActionGroupReference `json:"actionGroups,omitempty"`
}

// An Activity Log Alert rule condition that is met when all its member conditions are met.
type AlertRuleAllOfCondition struct {
	// AllOf: The list of Activity Log Alert rule conditions.
	AllOf []AlertRuleAnyOfOrLeafCondition `json:"allOf,omitempty"`
}

// A pointer to an Azure Action Group.
type ActionGroupReference struct {
	// ActionGroupId: The resource ID of the Action Group. This cannot be null or empty.
	ActionGroupId *string `json:"actionGroupId,omitempty"`

	// WebhookProperties: the dictionary of custom properties to include with the post operation. These data are appended to
	// the webhook payload.
	WebhookProperties map[string]string `json:"webhookProperties,omitempty"`
}

// An Activity Log Alert rule condition that is met when all its member conditions are met.
// Each condition can be of one of
// the following types:
// __Important__: Each type has its unique subset of properties. Properties from different types
// CANNOT exist in one condition.
// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'.
// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._
// * __AnyOf Condition -__ must contain __only__
// 'anyOf' (which is an array of Leaf Conditions).
// _Please note, 'field', 'equals' and 'containsAny' should __not__ be
// set in an AnyOf Condition._
type AlertRuleAnyOfOrLeafCondition struct {
	// AnyOf: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.
	AnyOf []AlertRuleLeafCondition `json:"anyOf,omitempty"`

	// ContainsAny: The value of the event's field will be compared to the values in this array (case-insensitive) to determine
	// if the condition is met.
	ContainsAny []string `json:"containsAny,omitempty"`

	// Equals: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition
	// is met.
	Equals *string `json:"equals,omitempty"`

	// Field: The name of the Activity Log event's 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'.
	Field *string `json:"field,omitempty"`
}

// An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event.
// This
// condition must contain 'field' and either 'equals' or 'containsAny'.
type AlertRuleLeafCondition struct {
	// ContainsAny: The value of the event's field will be compared to the values in this array (case-insensitive) to determine
	// if the condition is met.
	ContainsAny []string `json:"containsAny,omitempty"`

	// Equals: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition
	// is met.
	Equals *string `json:"equals,omitempty"`

	// Field: The name of the Activity Log event's 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'.
	Field *string `json:"field,omitempty"`
}
