// 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) Go Code Generator. DO NOT EDIT.

package armalertprocessingrules_test

import (
	"context"
	"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/alertprocessingrules/armalertprocessingrules"
	"log"
)

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_add_action_group_all_alerts_in_subscription.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatAddsAnActionGroupToAllAlertsInASubscription() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupToSubscription", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Add ActionGroup1 to all alerts in the subscription"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.AddActionGroups{
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1"),
					},
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
				},
			},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Add ActionGroup1 to all alerts in the subscription"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.AddActionGroups{
	// 					ActionGroupIDs: []*string{
	// 						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1"),
	// 					},
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
	// 				},
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1"),
	// 			},
	// 		},
	// 		SystemData: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-12T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-13T16:15:34Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_add_two_action_groups_all_Sev0_Sev1_two_resource_groups.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatAddsTwoActionGroupsToAllSev0AndSev1AlertsInTwoResourceGroups() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupsBySeverity", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.AddActionGroups{
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1"),
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2"),
					},
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
				},
			},
			Conditions: []*armalertprocessingrules.Condition{
				{
					Field:    to.Ptr(armalertprocessingrules.FieldSeverity),
					Operator: to.Ptr(armalertprocessingrules.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"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.AddActionGroups{
	// 					ActionGroupIDs: []*string{
	// 						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1"),
	// 						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2"),
	// 					},
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
	// 				},
	// 			},
	// 			Conditions: []*armalertprocessingrules.Condition{
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldSeverity),
	// 					Operator: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-13T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_remove_all_action_groups_from_specific_alert_rule.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsInASubscriptionComingFromASpecificAlertRule() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsSpecificAlertRule", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts that fire on above AlertRule"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
				},
			},
			Conditions: []*armalertprocessingrules.Condition{
				{
					Field:    to.Ptr(armalertprocessingrules.FieldAlertRuleID),
					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
					Values: []*string{
						to.Ptr("/subscriptions/suubId1/resourceGroups/Rgid2/providers/microsoft.insights/activityLogAlerts/RuleName"),
					},
				},
			},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Removes all ActionGroups from all Alerts that fire on above AlertRule"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.RemoveAllActionGroups{
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
	// 				},
	// 			},
	// 			Conditions: []*armalertprocessingrules.Condition{
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldAlertRuleID),
	// 					Operator: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_remove_all_action_groups_outside_business_hours.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsOutsideBusinessHoursMonFri09001700EasternStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsOutsideBusinessHours", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups outside business hours"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
				},
			},
			Enabled: to.Ptr(true),
			Schedule: &armalertprocessingrules.Schedule{
				Recurrences: []armalertprocessingrules.RecurrenceClassification{
					&armalertprocessingrules.DailyRecurrence{
						EndTime:        to.Ptr("09:00:00"),
						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeDaily),
						StartTime:      to.Ptr("17:00:00"),
					},
					&armalertprocessingrules.WeeklyRecurrence{
						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
							to.Ptr(armalertprocessingrules.DaysOfWeekSaturday),
							to.Ptr(armalertprocessingrules.DaysOfWeekSunday),
						},
						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
					},
				},
				TimeZone: to.Ptr("Eastern Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Remove all ActionGroups outside business hours"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.RemoveAllActionGroups{
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
	// 				},
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Schedule: &armalertprocessingrules.Schedule{
	// 				Recurrences: []armalertprocessingrules.RecurrenceClassification{
	// 					&armalertprocessingrules.DailyRecurrence{
	// 						EndTime: to.Ptr("09:00:00"),
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeDaily),
	// 						StartTime: to.Ptr("17:00:00"),
	// 					},
	// 					&armalertprocessingrules.WeeklyRecurrence{
	// 						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSaturday),
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSunday),
	// 						},
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
	// 					},
	// 				},
	// 				TimeZone: to.Ptr("Eastern Standard Time"),
	// 			},
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1"),
	// 			},
	// 		},
	// 		SystemData: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_remove_all_action_groups_recurring_maintenance_window.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsOnAnyVMInTwoResourceGroupsDuringARecurringMaintenanceWindow22000400EverySatAndSunIndiaStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsRecurringMaintenance", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
				},
			},
			Conditions: []*armalertprocessingrules.Condition{
				{
					Field:    to.Ptr(armalertprocessingrules.FieldTargetResourceType),
					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
					Values: []*string{
						to.Ptr("microsoft.compute/virtualmachines"),
					},
				},
			},
			Enabled: to.Ptr(true),
			Schedule: &armalertprocessingrules.Schedule{
				Recurrences: []armalertprocessingrules.RecurrenceClassification{
					&armalertprocessingrules.WeeklyRecurrence{
						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
							to.Ptr(armalertprocessingrules.DaysOfWeekSaturday),
							to.Ptr(armalertprocessingrules.DaysOfWeekSunday),
						},
						EndTime:        to.Ptr("04:00:00"),
						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
						StartTime:      to.Ptr("22:00:00"),
					},
				},
				TimeZone: to.Ptr("India Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.RemoveAllActionGroups{
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
	// 				},
	// 			},
	// 			Conditions: []*armalertprocessingrules.Condition{
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldTargetResourceType),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("microsoft.compute/virtualmachines"),
	// 					},
	// 				},
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Schedule: &armalertprocessingrules.Schedule{
	// 				Recurrences: []armalertprocessingrules.RecurrenceClassification{
	// 					&armalertprocessingrules.WeeklyRecurrence{
	// 						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSaturday),
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSunday),
	// 						},
	// 						EndTime: to.Ptr("04:00:00"),
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
	// 						StartTime: to.Ptr("22:00:00"),
	// 					},
	// 				},
	// 				TimeZone: to.Ptr("India Standard Time"),
	// 			},
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
	// 				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2"),
	// 			},
	// 		},
	// 		SystemData: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-11T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Create_or_update_remove_all_action_groups_specific_VM_one-off_maintenance_window.json
func ExampleClient_CreateOrUpdate_createOrUpdateARuleThatRemovesAllActionGroupsFromAlertsOnASpecificVMDuringAOneOffMaintenanceWindow18002000AtASpecificDatePacificStandardTime() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsMaintenanceWindow", armalertprocessingrules.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
			Actions: []armalertprocessingrules.ActionClassification{
				&armalertprocessingrules.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
				},
			},
			Enabled: to.Ptr(true),
			Schedule: &armalertprocessingrules.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"),
			},
		},
		Tags: map[string]*string{},
	}, 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 = armalertprocessingrules.ClientCreateOrUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.RemoveAllActionGroups{
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
	// 				},
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Schedule: &armalertprocessingrules.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: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T20:13:29Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Delete.json
func ExampleClient_Delete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Delete(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 = armalertprocessingrules.ClientDeleteResponse{
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_GetById.json
func ExampleClient_GetByName() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().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 = armalertprocessingrules.ClientGetByNameResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Alert processing rule on resource group for daily and weekly scheduling"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.AddActionGroups{
	// 					ActionGroupIDs: []*string{
	// 						to.Ptr("actiongGroup1"),
	// 						to.Ptr("actiongGroup2"),
	// 					},
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
	// 				},
	// 			},
	// 			Conditions: []*armalertprocessingrules.Condition{
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldSeverity),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Sev0"),
	// 						to.Ptr("Sev2"),
	// 					},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldMonitorService),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Platform"),
	// 						to.Ptr("Application Insights"),
	// 					},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldMonitorCondition),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Fired"),
	// 					},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldTargetResourceType),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorNotEquals),
	// 					Values: []*string{
	// 						to.Ptr("Microsoft.Compute/VirtualMachines"),
	// 					},
	// 				},
	// 			},
	// 			Enabled: to.Ptr(true),
	// 			Schedule: &armalertprocessingrules.Schedule{
	// 				EffectiveFrom: to.Ptr("2018-01-10T22:05:09"),
	// 				EffectiveUntil: to.Ptr("2018-12-10T22:05:09"),
	// 				Recurrences: []armalertprocessingrules.RecurrenceClassification{
	// 					&armalertprocessingrules.DailyRecurrence{
	// 						EndTime: to.Ptr("14:00:00"),
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeDaily),
	// 						StartTime: to.Ptr("06:00:00"),
	// 					},
	// 					&armalertprocessingrules.WeeklyRecurrence{
	// 						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSaturday),
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekSunday),
	// 						},
	// 						EndTime: to.Ptr("20:00:00"),
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
	// 						StartTime: to.Ptr("10:00:00"),
	// 					},
	// 				},
	// 				TimeZone: to.Ptr("Pacific Standard Time"),
	// 			},
	// 			Scopes: []*string{
	// 				to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg"),
	// 			},
	// 		},
	// 		SystemData: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_List_ResourceGroup.json
func ExampleClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().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 = armalertprocessingrules.ClientListByResourceGroupResponse{
		// 	List: armalertprocessingrules.List{
		// 		NextLink: to.Ptr("https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules?api-version=2021-08-08&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1"),
		// 		Value: []*armalertprocessingrules.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"),
		// 				Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
		// 					Description: to.Ptr("Alert processing rule on resource group for daily suppression"),
		// 					Actions: []armalertprocessingrules.ActionClassification{
		// 						&armalertprocessingrules.RemoveAllActionGroups{
		// 							ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
		// 						},
		// 					},
		// 					Conditions: []*armalertprocessingrules.Condition{
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldSeverity),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Sev0"),
		// 								to.Ptr("Sev2"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldMonitorService),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Platform"),
		// 								to.Ptr("Application Insights"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldTargetResourceType),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorNotEquals),
		// 							Values: []*string{
		// 								to.Ptr("Microsoft.Compute/VirtualMachines"),
		// 							},
		// 						},
		// 					},
		// 					Enabled: to.Ptr(true),
		// 					Schedule: &armalertprocessingrules.Schedule{
		// 						EffectiveFrom: to.Ptr("2018-09-12T06:00:00"),
		// 						EffectiveUntil: to.Ptr("2018-09-20T14:00:00"),
		// 						Recurrences: []armalertprocessingrules.RecurrenceClassification{
		// 							&armalertprocessingrules.DailyRecurrence{
		// 								EndTime: to.Ptr("14:00:00"),
		// 								RecurrenceType: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					CreatedBy: to.Ptr("abc@microsoft.com"),
		// 					CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 					LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 			{
		// 				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"),
		// 				Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
		// 					Description: to.Ptr("Alert processing rule on resource group for sending email"),
		// 					Actions: []armalertprocessingrules.ActionClassification{
		// 						&armalertprocessingrules.AddActionGroups{
		// 							ActionGroupIDs: []*string{
		// 								to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.insights/actiongroups/testAG"),
		// 							},
		// 							ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
		// 						},
		// 					},
		// 					Conditions: []*armalertprocessingrules.Condition{
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldMonitorCondition),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Fired"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldDescription),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorContains),
		// 							Values: []*string{
		// 								to.Ptr("Percentage CPU greater than 80%"),
		// 								to.Ptr("Metric alert on resource foo"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldAlertContext),
		// 							Operator: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					CreatedBy: to.Ptr("abc@microsoft.com"),
		// 					CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 					LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_List_Subscription.json
func ExampleClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewClient().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 = armalertprocessingrules.ClientListBySubscriptionResponse{
		// 	List: armalertprocessingrules.List{
		// 		NextLink: to.Ptr("https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/actionRules?api-version=2021-08-08&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1"),
		// 		Value: []*armalertprocessingrules.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"),
		// 				Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
		// 					Description: to.Ptr("Alert processing rule on resource group for daily suppression"),
		// 					Actions: []armalertprocessingrules.ActionClassification{
		// 						&armalertprocessingrules.RemoveAllActionGroups{
		// 							ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
		// 						},
		// 					},
		// 					Conditions: []*armalertprocessingrules.Condition{
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldSeverity),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Sev0"),
		// 								to.Ptr("Sev2"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldMonitorService),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Platform"),
		// 								to.Ptr("Application Insights"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldTargetResourceType),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorNotEquals),
		// 							Values: []*string{
		// 								to.Ptr("Microsoft.Compute/VirtualMachines"),
		// 							},
		// 						},
		// 					},
		// 					Enabled: to.Ptr(true),
		// 					Schedule: &armalertprocessingrules.Schedule{
		// 						EffectiveFrom: to.Ptr("2018-01-10T22:05:09"),
		// 						EffectiveUntil: to.Ptr("2018-12-10T22:05:09"),
		// 						Recurrences: []armalertprocessingrules.RecurrenceClassification{
		// 							&armalertprocessingrules.DailyRecurrence{
		// 								EndTime: to.Ptr("14:00:00"),
		// 								RecurrenceType: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					CreatedBy: to.Ptr("abc@microsoft.com"),
		// 					CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 					LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 			{
		// 				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"),
		// 				Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
		// 					Description: to.Ptr("Alert processing rule on resource group for adding action group"),
		// 					Actions: []armalertprocessingrules.ActionClassification{
		// 						&armalertprocessingrules.AddActionGroups{
		// 							ActionGroupIDs: []*string{
		// 								to.Ptr("actiongGroup1"),
		// 							},
		// 							ActionType: to.Ptr(armalertprocessingrules.ActionTypeAddActionGroups),
		// 						},
		// 					},
		// 					Conditions: []*armalertprocessingrules.Condition{
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldMonitorCondition),
		// 							Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
		// 							Values: []*string{
		// 								to.Ptr("Fired"),
		// 							},
		// 						},
		// 						{
		// 							Field: to.Ptr(armalertprocessingrules.FieldDescription),
		// 							Operator: to.Ptr(armalertprocessingrules.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: &armalertprocessingrules.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					CreatedBy: to.Ptr("abc@microsoft.com"),
		// 					CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("xyz@microsoft.com"),
		// 					LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
		// 				},
		// 				Tags: map[string]*string{
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2021-08-08/AlertProcessingRules_Patch.json
func ExampleClient_Update() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armalertprocessingrules.NewClientFactory("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewClient().Update(ctx, "alertscorrelationrg", "WeeklySuppression", armalertprocessingrules.PatchObject{
		Properties: &armalertprocessingrules.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 = armalertprocessingrules.ClientUpdateResponse{
	// 	AlertProcessingRule: armalertprocessingrules.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"),
	// 		Properties: &armalertprocessingrules.AlertProcessingRuleProperties{
	// 			Description: to.Ptr("Alert processing rule on resource group for weekly suppression"),
	// 			Actions: []armalertprocessingrules.ActionClassification{
	// 				&armalertprocessingrules.RemoveAllActionGroups{
	// 					ActionType: to.Ptr(armalertprocessingrules.ActionTypeRemoveAllActionGroups),
	// 				},
	// 			},
	// 			Conditions: []*armalertprocessingrules.Condition{
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldSeverity),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Sev0"),
	// 						to.Ptr("Sev2"),
	// 					},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldMonitorService),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorEquals),
	// 					Values: []*string{
	// 						to.Ptr("Platform"),
	// 						to.Ptr("Application Insights"),
	// 					},
	// 				},
	// 				{
	// 					Field: to.Ptr(armalertprocessingrules.FieldTargetResourceType),
	// 					Operator: to.Ptr(armalertprocessingrules.OperatorNotEquals),
	// 					Values: []*string{
	// 						to.Ptr("Microsoft.Compute/VirtualMachines"),
	// 					},
	// 				},
	// 			},
	// 			Enabled: to.Ptr(false),
	// 			Schedule: &armalertprocessingrules.Schedule{
	// 				EffectiveFrom: to.Ptr("2018-12-10T22:05:09"),
	// 				EffectiveUntil: to.Ptr("2018-12-05T22:05:09"),
	// 				Recurrences: []armalertprocessingrules.RecurrenceClassification{
	// 					&armalertprocessingrules.WeeklyRecurrence{
	// 						DaysOfWeek: []*armalertprocessingrules.DaysOfWeek{
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekTuesday),
	// 							to.Ptr(armalertprocessingrules.DaysOfWeekFriday),
	// 						},
	// 						EndTime: to.Ptr("14:00:00"),
	// 						RecurrenceType: to.Ptr(armalertprocessingrules.RecurrenceTypeWeekly),
	// 						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: &armalertprocessingrules.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			CreatedBy: to.Ptr("abc@microsoft.com"),
	// 			CreatedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-12T22:05:09Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("xyz@microsoft.com"),
	// 			LastModifiedByType: to.Ptr(armalertprocessingrules.CreatedByTypeUser),
	// 		},
	// 		Tags: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 	},
	// }
}
