//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// DO NOT EDIT.

package armalertsmanagement_test

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_List_Subscription.json
func ExampleAlertProcessingRulesClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAlertProcessingRulesClient().NewListBySubscriptionPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AlertProcessingRulesList = armalertsmanagement.AlertProcessingRulesList{
		// 	Value: []*armalertsmanagement.AlertProcessingRule{
		// 		{
		// 			Name: to.Ptr("DailySuppression"),
		// 			Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
		// 			ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression"),
		// 			Location: to.Ptr("Global"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Properties: &armalertsmanagement.AlertProcessingRuleProperties{
		// 				Description: to.Ptr("Alert processing rule on resource group for daily suppression"),
		// 				Actions: []armalertsmanagement.ActionClassification{
		// 					&armalertsmanagement.RemoveAllActionGroups{
		// 						ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
		// 				}},
		// 				Conditions: []*armalertsmanagement.Condition{
		// 					{
		// 						Field: to.Ptr(armalertsmanagement.FieldSeverity),
		// 						Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 						Values: []*string{
		// 							to.Ptr("Sev0"),
		// 							to.Ptr("Sev2")},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertsmanagement.FieldMonitorService),
		// 							Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Platform"),
		// 								to.Ptr("Application Insights")},
		// 							},
		// 							{
		// 								Field: to.Ptr(armalertsmanagement.FieldTargetResourceType),
		// 								Operator: to.Ptr(armalertsmanagement.OperatorNotEquals),
		// 								Values: []*string{
		// 									to.Ptr("Microsoft.Compute/VirtualMachines")},
		// 							}},
		// 							Enabled: to.Ptr(true),
		// 							Schedule: &armalertsmanagement.Schedule{
		// 								EffectiveFrom: to.Ptr("2018-01-10T22:05:09"),
		// 								EffectiveUntil: to.Ptr("2018-12-10T22:05:09"),
		// 								Recurrences: []armalertsmanagement.RecurrenceClassification{
		// 									&armalertsmanagement.DailyRecurrence{
		// 										EndTime: to.Ptr("14:00:00"),
		// 										RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
		// 										StartTime: to.Ptr("06:00:00"),
		// 								}},
		// 								TimeZone: to.Ptr("Pacific Standard Time"),
		// 							},
		// 							Scopes: []*string{
		// 								to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")},
		// 							},
		// 							SystemData: &armalertsmanagement.SystemData{
		// 								CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 								CreatedBy: to.Ptr("abc@microsoft.com"),
		// 								CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 								LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 								LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 								LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("WeeklySuppression"),
		// 							Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
		// 							ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression"),
		// 							Location: to.Ptr("Global"),
		// 							Tags: map[string]*string{
		// 							},
		// 							Properties: &armalertsmanagement.AlertProcessingRuleProperties{
		// 								Description: to.Ptr("Alert processing rule on resource group for adding action group"),
		// 								Actions: []armalertsmanagement.ActionClassification{
		// 									&armalertsmanagement.AddActionGroups{
		// 										ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
		// 										ActionGroupIDs: []*string{
		// 											to.Ptr("actiongGroup1")},
		// 									}},
		// 									Conditions: []*armalertsmanagement.Condition{
		// 										{
		// 											Field: to.Ptr(armalertsmanagement.FieldMonitorCondition),
		// 											Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 											Values: []*string{
		// 												to.Ptr("Fired")},
		// 											},
		// 											{
		// 												Field: to.Ptr(armalertsmanagement.FieldDescription),
		// 												Operator: to.Ptr(armalertsmanagement.OperatorContains),
		// 												Values: []*string{
		// 													to.Ptr("Percentage CPU greater than 80%"),
		// 													to.Ptr("Metric alert on resource foo")},
		// 											}},
		// 											Enabled: to.Ptr(true),
		// 											Scopes: []*string{
		// 												to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource")},
		// 											},
		// 											SystemData: &armalertsmanagement.SystemData{
		// 												CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 												CreatedBy: to.Ptr("abc@microsoft.com"),
		// 												CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 												LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 												LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 												LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 											},
		// 									}},
		// 								}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_List_ResourceGroup.json
func ExampleAlertProcessingRulesClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAlertProcessingRulesClient().NewListByResourceGroupPager("alertscorrelationrg", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AlertProcessingRulesList = armalertsmanagement.AlertProcessingRulesList{
		// 	Value: []*armalertsmanagement.AlertProcessingRule{
		// 		{
		// 			Name: to.Ptr("DailySuppression"),
		// 			Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
		// 			ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression"),
		// 			Location: to.Ptr("Global"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Properties: &armalertsmanagement.AlertProcessingRuleProperties{
		// 				Description: to.Ptr("Alert processing rule on resource group for daily suppression"),
		// 				Actions: []armalertsmanagement.ActionClassification{
		// 					&armalertsmanagement.RemoveAllActionGroups{
		// 						ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
		// 				}},
		// 				Conditions: []*armalertsmanagement.Condition{
		// 					{
		// 						Field: to.Ptr(armalertsmanagement.FieldSeverity),
		// 						Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 						Values: []*string{
		// 							to.Ptr("Sev0"),
		// 							to.Ptr("Sev2")},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertsmanagement.FieldMonitorService),
		// 							Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Platform"),
		// 								to.Ptr("Application Insights")},
		// 							},
		// 							{
		// 								Field: to.Ptr(armalertsmanagement.FieldTargetResourceType),
		// 								Operator: to.Ptr(armalertsmanagement.OperatorNotEquals),
		// 								Values: []*string{
		// 									to.Ptr("Microsoft.Compute/VirtualMachines")},
		// 							}},
		// 							Enabled: to.Ptr(true),
		// 							Schedule: &armalertsmanagement.Schedule{
		// 								EffectiveFrom: to.Ptr("2018-09-12T06:00:00"),
		// 								EffectiveUntil: to.Ptr("2018-09-20T14:00:00"),
		// 								Recurrences: []armalertsmanagement.RecurrenceClassification{
		// 									&armalertsmanagement.DailyRecurrence{
		// 										EndTime: to.Ptr("14:00:00"),
		// 										RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
		// 										StartTime: to.Ptr("06:00:00"),
		// 								}},
		// 								TimeZone: to.Ptr("Pacific Standard Time"),
		// 							},
		// 							Scopes: []*string{
		// 								to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")},
		// 							},
		// 							SystemData: &armalertsmanagement.SystemData{
		// 								CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 								CreatedBy: to.Ptr("abc@microsoft.com"),
		// 								CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 								LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 								LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 								LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 							},
		// 						},
		// 						{
		// 							Name: to.Ptr("WeeklySuppression"),
		// 							Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
		// 							ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression"),
		// 							Location: to.Ptr("Global"),
		// 							Tags: map[string]*string{
		// 							},
		// 							Properties: &armalertsmanagement.AlertProcessingRuleProperties{
		// 								Description: to.Ptr("Alert processing rule on resource group for sending email"),
		// 								Actions: []armalertsmanagement.ActionClassification{
		// 									&armalertsmanagement.AddActionGroups{
		// 										ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
		// 										ActionGroupIDs: []*string{
		// 											to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.insights/actiongroups/testAG")},
		// 									}},
		// 									Conditions: []*armalertsmanagement.Condition{
		// 										{
		// 											Field: to.Ptr(armalertsmanagement.FieldMonitorCondition),
		// 											Operator: to.Ptr(armalertsmanagement.OperatorEquals),
		// 											Values: []*string{
		// 												to.Ptr("Fired")},
		// 											},
		// 											{
		// 												Field: to.Ptr(armalertsmanagement.FieldDescription),
		// 												Operator: to.Ptr(armalertsmanagement.OperatorContains),
		// 												Values: []*string{
		// 													to.Ptr("Percentage CPU greater than 80%"),
		// 													to.Ptr("Metric alert on resource foo")},
		// 												},
		// 												{
		// 													Field: to.Ptr(armalertsmanagement.FieldAlertContext),
		// 													Operator: to.Ptr(armalertsmanagement.OperatorDoesNotContain),
		// 													Values: []*string{
		// 														to.Ptr("testresource"),
		// 														to.Ptr("foo")},
		// 												}},
		// 												Enabled: to.Ptr(true),
		// 												Scopes: []*string{
		// 													to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.Compute/VirtualMachines/testResource")},
		// 												},
		// 												SystemData: &armalertsmanagement.SystemData{
		// 													CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 													CreatedBy: to.Ptr("abc@microsoft.com"),
		// 													CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 													LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
		// 													LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 													LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
		// 												},
		// 										}},
		// 									}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_GetById.json
func ExampleAlertProcessingRulesClient_GetByName() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().GetByName(ctx, "alertscorrelationrg", "DailySuppression", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("DailySuppression"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Alert processing rule on resource group for daily and weekly scheduling"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.AddActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
	// 				ActionGroupIDs: []*string{
	// 					to.Ptr("actiongGroup1"),
	// 					to.Ptr("actiongGroup2")},
	// 			}},
	// 			Conditions: []*armalertsmanagement.Condition{
	// 				{
	// 					Field: to.Ptr(armalertsmanagement.FieldSeverity),
	// 					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Sev0"),
	// 						to.Ptr("Sev2")},
	// 					},
	// 					{
	// 						Field: to.Ptr(armalertsmanagement.FieldMonitorService),
	// 						Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 						Values: []*string{
	// 							to.Ptr("Platform"),
	// 							to.Ptr("Application Insights")},
	// 						},
	// 						{
	// 							Field: to.Ptr(armalertsmanagement.FieldMonitorCondition),
	// 							Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 							Values: []*string{
	// 								to.Ptr("Fired")},
	// 							},
	// 							{
	// 								Field: to.Ptr(armalertsmanagement.FieldTargetResourceType),
	// 								Operator: to.Ptr(armalertsmanagement.OperatorNotEquals),
	// 								Values: []*string{
	// 									to.Ptr("Microsoft.Compute/VirtualMachines")},
	// 							}},
	// 							Enabled: to.Ptr(true),
	// 							Schedule: &armalertsmanagement.Schedule{
	// 								EffectiveFrom: to.Ptr("2018-01-10T22:05:09"),
	// 								EffectiveUntil: to.Ptr("2018-12-10T22:05:09"),
	// 								Recurrences: []armalertsmanagement.RecurrenceClassification{
	// 									&armalertsmanagement.DailyRecurrence{
	// 										EndTime: to.Ptr("14:00:00"),
	// 										RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
	// 										StartTime: to.Ptr("06:00:00"),
	// 									},
	// 									&armalertsmanagement.WeeklyRecurrence{
	// 										EndTime: to.Ptr("20:00:00"),
	// 										RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
	// 										StartTime: to.Ptr("10:00:00"),
	// 										DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
	// 											to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
	// 											to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
	// 									}},
	// 									TimeZone: to.Ptr("Pacific Standard Time"),
	// 								},
	// 								Scopes: []*string{
	// 									to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")},
	// 								},
	// 								SystemData: &armalertsmanagement.SystemData{
	// 									CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 									CreatedBy: to.Ptr("abc@microsoft.com"),
	// 									CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 									LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 									LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 									LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 								},
	// 							}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_add_action_group_all_alerts_in_subscription.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatAddsAnActionGroupToAllAlertsInASubscription() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupToSubscription", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Add ActionGroup1 to all alerts in the subscription"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.AddActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("AddActionGroupToSubscription"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/AddActionGroupToSubscription"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Add ActionGroup1 to all alerts in the subscription"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.AddActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
	// 				ActionGroupIDs: []*string{
	// 					to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1")},
	// 			}},
	// 			Enabled: to.Ptr(true),
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1")},
	// 			},
	// 			SystemData: &armalertsmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-12T22:05:09.000Z"); return t}()),
	// 				CreatedBy: to.Ptr("abc@microsoft.com"),
	// 				CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-13T16:15:34.000Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 				LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 			},
	// 		}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_add_two_action_groups_all_Sev0_Sev1_two_resource_groups.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatAddsTwoActionGroupsToAllSev0AndSev1AlertsInTwoResourceGroups() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupsBySeverity", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.AddActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1"),
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2")},
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldSeverity),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("sev0"),
						to.Ptr("sev1")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("AddActionGroupsBySeverity"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/AddActionGroupsBySeverity"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.AddActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
	// 				ActionGroupIDs: []*string{
	// 					to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1"),
	// 					to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2")},
	// 			}},
	// 			Conditions: []*armalertsmanagement.Condition{
	// 				{
	// 					Field: to.Ptr(armalertsmanagement.FieldSeverity),
	// 					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("sev0"),
	// 						to.Ptr("sev1")},
	// 				}},
	// 				Enabled: to.Ptr(true),
	// 				Scopes: []*string{
	// 					to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
	// 					to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
	// 				},
	// 				SystemData: &armalertsmanagement.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 					CreatedBy: to.Ptr("abc@microsoft.com"),
	// 					CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-13T22:05:09.000Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 					LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 				},
	// 			}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_specific_VM_one-off_maintenance_window.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAlertsOnASpecificVmDuringAOneOffMaintenanceWindow18002000AtASpecificDatePacificStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsMaintenanceWindow", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				EffectiveFrom:  to.Ptr("2021-04-15T18:00:00"),
				EffectiveUntil: to.Ptr("2021-04-15T20:00:00"),
				TimeZone:       to.Ptr("Pacific Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("RemoveActionGroupsMaintenanceWindow"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/RemoveActionGroupsMaintenanceWindow"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.RemoveAllActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
	// 		}},
	// 		Enabled: to.Ptr(true),
	// 		Schedule: &armalertsmanagement.Schedule{
	// 			EffectiveFrom: to.Ptr("2021-04-15T18:00:00"),
	// 			EffectiveUntil: to.Ptr("2021-04-15T20:00:00"),
	// 			TimeZone: to.Ptr("Pacific Standard Time"),
	// 		},
	// 		Scopes: []*string{
	// 			to.Ptr("/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName")},
	// 		},
	// 		SystemData: &armalertsmanagement.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T20:13:29.000Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 		},
	// 	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_from_specific_alert_rule.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsInASubscriptionComingFromASpecificAlertRule() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsSpecificAlertRule", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts that fire on above AlertRule"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldAlertRuleID),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("/subscriptions/suubId1/resourceGroups/Rgid2/providers/microsoft.insights/activityLogAlerts/RuleName")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("RemoveActionGroupsSpecificAlertRule"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/RemoveActionGroupsSpecificAlertRule"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Removes all ActionGroups from all Alerts that fire on above AlertRule"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.RemoveAllActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
	// 		}},
	// 		Conditions: []*armalertsmanagement.Condition{
	// 			{
	// 				Field: to.Ptr(armalertsmanagement.FieldAlertRuleID),
	// 				Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 				Values: []*string{
	// 					to.Ptr("/subscriptions/suubId1/resourceGroups/Rgid2/providers/microsoft.insights/activityLogAlerts/RuleName")},
	// 			}},
	// 			Enabled: to.Ptr(true),
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1")},
	// 			},
	// 			SystemData: &armalertsmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09.000Z"); return t}()),
	// 				CreatedBy: to.Ptr("abc@microsoft.com"),
	// 				CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 				LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 			},
	// 		}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_recurring_maintenance_window.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsOnAnyVmInTwoResourceGroupsDuringARecurringMaintenanceWindow22000400EverySatAndSunIndiaStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsRecurringMaintenance", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldTargetResourceType),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("microsoft.compute/virtualmachines")},
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				Recurrences: []armalertsmanagement.RecurrenceClassification{
					&armalertsmanagement.WeeklyRecurrence{
						EndTime:        to.Ptr("04:00:00"),
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
						StartTime:      to.Ptr("22:00:00"),
						DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
							to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
							to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
					}},
				TimeZone: to.Ptr("India Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("RemoveActionGroupsRecurringMaintenance"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/RemoveActionGroupsRecurringMaintenance"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.RemoveAllActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
	// 		}},
	// 		Conditions: []*armalertsmanagement.Condition{
	// 			{
	// 				Field: to.Ptr(armalertsmanagement.FieldTargetResourceType),
	// 				Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 				Values: []*string{
	// 					to.Ptr("microsoft.compute/virtualmachines")},
	// 			}},
	// 			Enabled: to.Ptr(true),
	// 			Schedule: &armalertsmanagement.Schedule{
	// 				Recurrences: []armalertsmanagement.RecurrenceClassification{
	// 					&armalertsmanagement.WeeklyRecurrence{
	// 						EndTime: to.Ptr("04:00:00"),
	// 						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
	// 						StartTime: to.Ptr("22:00:00"),
	// 						DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
	// 							to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
	// 							to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
	// 					}},
	// 					TimeZone: to.Ptr("India Standard Time"),
	// 				},
	// 				Scopes: []*string{
	// 					to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
	// 					to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
	// 				},
	// 				SystemData: &armalertsmanagement.SystemData{
	// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09.000Z"); return t}()),
	// 					CreatedBy: to.Ptr("abc@microsoft.com"),
	// 					CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 					LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 				},
	// 			}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_outside_business_hours.json
func ExampleAlertProcessingRulesClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsOutsideBusinessHoursMonFri09001700EasternStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsOutsideBusinessHours", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups outside business hours"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				Recurrences: []armalertsmanagement.RecurrenceClassification{
					&armalertsmanagement.DailyRecurrence{
						EndTime:        to.Ptr("09:00:00"),
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
						StartTime:      to.Ptr("17:00:00"),
					},
					&armalertsmanagement.WeeklyRecurrence{
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
						DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
							to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
							to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
					}},
				TimeZone: to.Ptr("Eastern Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("RemoveActionGroupsOutsideBusinessHours"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/subId1/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/RemoveActionGroupsOutsideBusinessHours"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Remove all ActionGroups outside business hours"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.RemoveAllActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
	// 		}},
	// 		Enabled: to.Ptr(true),
	// 		Schedule: &armalertsmanagement.Schedule{
	// 			Recurrences: []armalertsmanagement.RecurrenceClassification{
	// 				&armalertsmanagement.DailyRecurrence{
	// 					EndTime: to.Ptr("09:00:00"),
	// 					RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
	// 					StartTime: to.Ptr("17:00:00"),
	// 				},
	// 				&armalertsmanagement.WeeklyRecurrence{
	// 					RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
	// 					DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
	// 						to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
	// 						to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
	// 				}},
	// 				TimeZone: to.Ptr("Eastern Standard Time"),
	// 			},
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1")},
	// 			},
	// 			SystemData: &armalertsmanagement.SystemData{
	// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09.000Z"); return t}()),
	// 				CreatedBy: to.Ptr("abc@microsoft.com"),
	// 				CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 				LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 				LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 			},
	// 		}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Delete.json
func ExampleAlertProcessingRulesClient_Delete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewAlertProcessingRulesClient().Delete(ctx, "alertscorrelationrg", "DailySuppression", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6d2438481021a94793b07b226df06d5f3c61d51d/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Patch.json
func ExampleAlertProcessingRulesClient_Update() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertsmanagement.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAlertProcessingRulesClient().Update(ctx, "alertscorrelationrg", "WeeklySuppression", armalertsmanagement.PatchObject{
		Properties: &armalertsmanagement.PatchProperties{
			Enabled: to.Ptr(false),
		},
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
			"key2": to.Ptr("value2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AlertProcessingRule = armalertsmanagement.AlertProcessingRule{
	// 	Name: to.Ptr("WeeklySuppression"),
	// 	Type: to.Ptr("Microsoft.AlertsManagement/actionRules"),
	// 	ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/WeeklySuppression"),
	// 	Location: to.Ptr("Global"),
	// 	Tags: map[string]*string{
	// 		"key1": to.Ptr("value1"),
	// 		"key2": to.Ptr("value2"),
	// 	},
	// 	Properties: &armalertsmanagement.AlertProcessingRuleProperties{
	// 		Description: to.Ptr("Alert processing rule on resource group for weekly suppression"),
	// 		Actions: []armalertsmanagement.ActionClassification{
	// 			&armalertsmanagement.RemoveAllActionGroups{
	// 				ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
	// 		}},
	// 		Conditions: []*armalertsmanagement.Condition{
	// 			{
	// 				Field: to.Ptr(armalertsmanagement.FieldSeverity),
	// 				Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 				Values: []*string{
	// 					to.Ptr("Sev0"),
	// 					to.Ptr("Sev2")},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertsmanagement.FieldMonitorService),
	// 					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Platform"),
	// 						to.Ptr("Application Insights")},
	// 					},
	// 					{
	// 						Field: to.Ptr(armalertsmanagement.FieldTargetResourceType),
	// 						Operator: to.Ptr(armalertsmanagement.OperatorNotEquals),
	// 						Values: []*string{
	// 							to.Ptr("Microsoft.Compute/VirtualMachines")},
	// 					}},
	// 					Enabled: to.Ptr(false),
	// 					Schedule: &armalertsmanagement.Schedule{
	// 						EffectiveFrom: to.Ptr("2018-12-10T22:05:09"),
	// 						EffectiveUntil: to.Ptr("2018-12-05T22:05:09"),
	// 						Recurrences: []armalertsmanagement.RecurrenceClassification{
	// 							&armalertsmanagement.WeeklyRecurrence{
	// 								EndTime: to.Ptr("14:00:00"),
	// 								RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
	// 								StartTime: to.Ptr("06:00:00"),
	// 								DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
	// 									to.Ptr(armalertsmanagement.DaysOfWeekTuesday),
	// 									to.Ptr(armalertsmanagement.DaysOfWeekFriday)},
	// 							}},
	// 							TimeZone: to.Ptr("Pacific Standard Time"),
	// 						},
	// 						Scopes: []*string{
	// 							to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")},
	// 						},
	// 						SystemData: &armalertsmanagement.SystemData{
	// 							CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 							CreatedBy: to.Ptr("abc@microsoft.com"),
	// 							CreatedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 							LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09.000Z"); return t}()),
	// 							LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 							LastModifiedByType: to.Ptr(armalertsmanagement.CreatedByTypeUser),
	// 						},
	// 					}
}
