// 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 armadvisor_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/advisor/armadvisor/v2"
	"log"
	"time"
)

// Generated from example definition: 2025-05-01-preview/GenerateRecommendations.json
func ExampleRecommendationsClient_Generate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecommendationsClient().Generate(ctx, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

// Generated from example definition: 2025-05-01-preview/GetRecommendationDetailServiceGroupResourceUri.json
func ExampleRecommendationsClient_Get_getRecommendationDetailServiceGroupResourceUri() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecommendationsClient().Get(ctx, "providers/microsoft.management/serviceGroup/serviceGroupXYZ", "37c93209-4bfb-4f3b-8874-ccc718f7a467", 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 = armadvisor.RecommendationsClientGetResponse{
	// 	ResourceRecommendationBase: armadvisor.ResourceRecommendationBase{
	// 		ID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ/providers/Microsoft.Advisor/recommendations/37c93209-4bfb-4f3b-8874-ccc718f7a467"),
	// 		Name: to.Ptr("37c93209-4bfb-4f3b-8874-ccc718f7a467"),
	// 		Properties: &armadvisor.RecommendationProperties{
	// 			Category: to.Ptr(armadvisor.CategoryHighAvailability),
	// 			Impact: to.Ptr(armadvisor.ImpactMedium),
	// 			ImpactedField: to.Ptr("Microsoft.Management/serviceGroup"),
	// 			ImpactedValue: to.Ptr("serviceGroupXYZ"),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-04-24T22:24:43.3216408Z"); return t}()),
	// 			Risk: to.Ptr(armadvisor.RiskWarning),
	// 			ShortDescription: &armadvisor.ShortDescription{
	// 				Problem: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
	// 				Solution: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
	// 			},
	// 			ResourceMetadata: &armadvisor.ResourceMetadata{
	// 				ResourceID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ"),
	// 				Action: map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link3",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
	// 					},
	// 				},
	// 				Singular: to.Ptr("Availability set"),
	// 				Plural: to.Ptr("Availability sets"),
	// 			},
	// 			Actions: []map[string]any{
	// 				map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link1",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
	// 					},
	// 				},
	// 			},
	// 			Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
	// 			Label: to.Ptr("Enable Soft Delete"),
	// 			LearnMoreLink: to.Ptr("https://link2"),
	// 			PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
	// 			Tracked: to.Ptr(false),
	// 		},
	// 		Type: to.Ptr("Microsoft.Advisor/recommendations"),
	// 	},
	// }
}

// Generated from example definition: 2025-05-01-preview/GetRecommendationDetailSubscriptionResourceUri.json
func ExampleRecommendationsClient_Get_getRecommendationDetailSubscriptionResourceUri() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecommendationsClient().Get(ctx, "subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset", "bd27ddc6-1312-4067-b4af-cbb45e32cfd7", 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 = armadvisor.RecommendationsClientGetResponse{
	// 	ResourceRecommendationBase: armadvisor.ResourceRecommendationBase{
	// 		ID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset/providers/Microsoft.Advisor/recommendations/bd27ddc6-1312-4067-b4af-cbb45e32cfd7"),
	// 		Name: to.Ptr("bd27ddc6-1312-4067-b4af-cbb45e32cfd7"),
	// 		Properties: &armadvisor.RecommendationProperties{
	// 			Category: to.Ptr(armadvisor.CategorySecurity),
	// 			Impact: to.Ptr(armadvisor.ImpactMedium),
	// 			ImpactedField: to.Ptr("Microsoft.Compute/availabilitysets"),
	// 			ImpactedValue: to.Ptr("armavset"),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-24T22:24:43.3216408Z"); return t}()),
	// 			Risk: to.Ptr(armadvisor.RiskWarning),
	// 			ShortDescription: &armadvisor.ShortDescription{
	// 				Problem: to.Ptr("Monitoring agent should be installed on your machines"),
	// 				Solution: to.Ptr("Monitoring agent should be installed on your machines"),
	// 			},
	// 			Remediation: map[string]any{
	// 				"additionalProperties": map[string]any{
	// 					"httpMethod": "POST",
	// 					"uri": "uri",
	// 					"details": "link to document",
	// 				},
	// 			},
	// 			ResourceMetadata: &armadvisor.ResourceMetadata{
	// 				ResourceID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset"),
	// 				Source: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset/providers/Microsoft.Security/assessments/15e912ef-221a-4efe-80d2-df5671cdd5f5"),
	// 				Action: map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link3",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset",
	// 					},
	// 				},
	// 				Singular: to.Ptr("Availability set"),
	// 				Plural: to.Ptr("Availability sets"),
	// 			},
	// 			Actions: []map[string]any{
	// 				map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link1",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc",
	// 					},
	// 				},
	// 			},
	// 			Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
	// 			Label: to.Ptr("Enable Soft Delete"),
	// 			LearnMoreLink: to.Ptr("https://link2"),
	// 			PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
	// 			Tracked: to.Ptr(false),
	// 		},
	// 		Type: to.Ptr("Microsoft.Advisor/recommendations"),
	// 	},
	// }
}

// Generated from example definition: 2025-05-01-preview/EmptyResponse.json
func ExampleRecommendationsClient_GetGenerateStatus() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("12345678-1234-1234-1234-123456789012", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewRecommendationsClient().GetGenerateStatus(ctx, "123e4567-e89b-12d3-a456-426614174000", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}

// Generated from example definition: 2025-05-01-preview/ListRecommendationsSubscriptionResourceUri.json
func ExampleRecommendationsClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("a5481ee1-95df-47d0-85d4-dd3f0dfa19bc", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecommendationsClient().NewListPager(&armadvisor.RecommendationsClientListOptions{
		Top: to.Ptr[int32](10)})
	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 = armadvisor.RecommendationsClientListResponse{
		// 	ResourceRecommendationBaseListResult: armadvisor.ResourceRecommendationBaseListResult{
		// 		NextLink: to.Ptr("https://management.azure.com/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/providers/Microsoft.Advisor/recommendations?api-version=2025-05-01-preview&$top=10&$skiptoken=skiptoken"),
		// 		Value: []*armadvisor.ResourceRecommendationBase{
		// 			{
		// 				ID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset/providers/Microsoft.Advisor/recommendations/bd27ddc6-1312-4067-b4af-cbb45e32cfd7"),
		// 				Name: to.Ptr("bd27ddc6-1312-4067-b4af-cbb45e32cfd7"),
		// 				Type: to.Ptr("Microsoft.Advisor/recommendations"),
		// 				Properties: &armadvisor.RecommendationProperties{
		// 					Category: to.Ptr(armadvisor.CategoryHighAvailability),
		// 					Impact: to.Ptr(armadvisor.ImpactMedium),
		// 					ImpactedField: to.Ptr("Microsoft.Compute/availabilitySets"),
		// 					ImpactedValue: to.Ptr("armavset"),
		// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-24T22:24:43.3216408Z"); return t}()),
		// 					Risk: to.Ptr(armadvisor.RiskWarning),
		// 					Remediation: map[string]any{
		// 						"additionalProperties": map[string]any{
		// 							"httpMethod": "POST",
		// 							"uri": "uri",
		// 							"details": "link to document",
		// 						},
		// 					},
		// 					ShortDescription: &armadvisor.ShortDescription{
		// 						Problem: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 						Solution: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 					},
		// 					ResourceMetadata: &armadvisor.ResourceMetadata{
		// 						ResourceID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/availabilitysets/armavset"),
		// 						Action: map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link3",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc",
		// 							},
		// 						},
		// 						Singular: to.Ptr("Availability set"),
		// 						Plural: to.Ptr("Availability sets"),
		// 					},
		// 					Actions: []map[string]any{
		// 						map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link1",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc",
		// 							},
		// 						},
		// 					},
		// 					Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
		// 					Label: to.Ptr("Enable Soft Delete"),
		// 					LearnMoreLink: to.Ptr("https://link2"),
		// 					PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
		// 					Tracked: to.Ptr(false),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/virtualMachines/xyz/providers/Microsoft.Advisor/recommendations/1b266c91-3a92-4423-8aa2-ee13a6d90f47"),
		// 				Name: to.Ptr("1b266c91-3a92-4423-8aa2-ee13a6d90f47"),
		// 				Type: to.Ptr("Microsoft.Advisor/recommendations"),
		// 				Properties: &armadvisor.RecommendationProperties{
		// 					Category: to.Ptr(armadvisor.CategorySecurity),
		// 					Impact: to.Ptr(armadvisor.ImpactMedium),
		// 					ImpactedField: to.Ptr("Microsoft.Compute/virtualMachines"),
		// 					ImpactedValue: to.Ptr("xyz"),
		// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-24T22:24:43.3216408Z"); return t}()),
		// 					Risk: to.Ptr(armadvisor.RiskWarning),
		// 					ShortDescription: &armadvisor.ShortDescription{
		// 						Problem: to.Ptr("Monitoring agent should be installed on your machines"),
		// 						Solution: to.Ptr("Monitoring agent should be installed on your machines"),
		// 					},
		// 					ResourceMetadata: &armadvisor.ResourceMetadata{
		// 						ResourceID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/virtualMachines/xyz"),
		// 						Source: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/resourceGroups/resourceGroup/providers/Microsoft.Compute/virtualMachines/xyz/providers/Microsoft.Security/assessments/15e912ef-221a-4efe-80d2-df5671cdd5f5"),
		// 						Action: map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link3",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc",
		// 							},
		// 						},
		// 						Singular: to.Ptr("Virtual machine"),
		// 						Plural: to.Ptr("Virtual machines"),
		// 					},
		// 					Actions: []map[string]any{
		// 						map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link1",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc",
		// 							},
		// 						},
		// 					},
		// 					Description: to.Ptr("Monitoring agent should be installed on your machines."),
		// 					Label: to.Ptr("Enable monitoring agent"),
		// 					LearnMoreLink: to.Ptr("https://link2"),
		// 					PotentialBenefits: to.Ptr("Protect and monitor machine"),
		// 					Tracked: to.Ptr(true),
		// 					TrackedProperties: &armadvisor.TrackedRecommendationProperties{
		// 						State: to.Ptr(armadvisor.StatePostponed),
		// 						PostponedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-01T00:00:00Z"); return t}()),
		// 						Reason: to.Ptr(armadvisor.ReasonRiskAccepted),
		// 						Priority: to.Ptr(armadvisor.PriorityHigh),
		// 					},
		// 					ResourceWorkload: &armadvisor.RecommendationPropertiesResourceWorkload{
		// 						ID: to.Ptr("0560dbdb-f207-4690-b4ba-1fc0c3a0f082"),
		// 						Name: to.Ptr("Critical VM Workload"),
		// 					},
		// 					Review: &armadvisor.RecommendationPropertiesReview{
		// 						ID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/providers/Microsoft.Advisor/assessments/MCWAR1"),
		// 						Name: to.Ptr("Monthly WAF Review 09/23"),
		// 					},
		// 					SourceSystem: to.Ptr("CxObserve"),
		// 					Notes: to.Ptr("This is a note"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-05-01-preview/ListRecommendationsServiceGroupResourceUri.json
func ExampleRecommendationsClient_NewListByTenantPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRecommendationsClient().NewListByTenantPager("providers/microsoft.management/serviceGroups/serviceGroupXYZ", &armadvisor.RecommendationsClientListByTenantOptions{
		Top: to.Ptr[int32](10)})
	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 = armadvisor.RecommendationsClientListByTenantResponse{
		// 	ResourceRecommendationBaseListResult: armadvisor.ResourceRecommendationBaseListResult{
		// 		NextLink: to.Ptr("https://management.azure.com/providers/microsoft.management/serviceGroup/serviceGroupXYZ/providers/Microsoft.Advisor/recommendations?api-version=2025-05-01-preview&$top=10&$skiptoken=skiptoken"),
		// 		Value: []*armadvisor.ResourceRecommendationBase{
		// 			{
		// 				ID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ/providers/Microsoft.Advisor/recommendations/37c93209-4bfb-4f3b-8874-ccc718f7a467"),
		// 				Name: to.Ptr("37c93209-4bfb-4f3b-8874-ccc718f7a467"),
		// 				Type: to.Ptr("Microsoft.Advisor/recommendations"),
		// 				Properties: &armadvisor.RecommendationProperties{
		// 					Category: to.Ptr(armadvisor.CategoryHighAvailability),
		// 					Impact: to.Ptr(armadvisor.ImpactMedium),
		// 					ImpactedField: to.Ptr("Microsoft.Management/serviceGroup"),
		// 					ImpactedValue: to.Ptr("serviceGroupXYZ"),
		// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-04-24T22:24:43.3216408Z"); return t}()),
		// 					Risk: to.Ptr(armadvisor.RiskWarning),
		// 					ShortDescription: &armadvisor.ShortDescription{
		// 						Problem: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 						Solution: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 					},
		// 					ResourceMetadata: &armadvisor.ResourceMetadata{
		// 						ResourceID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ"),
		// 						Action: map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link3",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
		// 							},
		// 						},
		// 						Singular: to.Ptr("Availability set"),
		// 						Plural: to.Ptr("Availability sets"),
		// 					},
		// 					Actions: []map[string]any{
		// 						map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link1",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
		// 							},
		// 						},
		// 					},
		// 					Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
		// 					Label: to.Ptr("Enable Soft Delete"),
		// 					LearnMoreLink: to.Ptr("https://link2"),
		// 					PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
		// 					Tracked: to.Ptr(false),
		// 				},
		// 			},
		// 			{
		// 				ID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ/providers/Microsoft.Advisor/recommendations/de0eb863-583e-ac10-eb7f-cb0f6b570e2b"),
		// 				Name: to.Ptr("de0eb863-583e-ac10-eb7f-cb0f6b570e2b"),
		// 				Type: to.Ptr("Microsoft.Advisor/recommendations"),
		// 				Properties: &armadvisor.RecommendationProperties{
		// 					Category: to.Ptr(armadvisor.CategoryHighAvailability),
		// 					Impact: to.Ptr(armadvisor.ImpactMedium),
		// 					ImpactedField: to.Ptr("Microsoft.Management/serviceGroup"),
		// 					ImpactedValue: to.Ptr("serviceGroupXYZ"),
		// 					LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-04-24T22:24:43.3216408Z"); return t}()),
		// 					Risk: to.Ptr(armadvisor.RiskWarning),
		// 					ShortDescription: &armadvisor.ShortDescription{
		// 						Problem: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 						Solution: to.Ptr("To ensure high availability add one or more virtual machines to this availability set"),
		// 					},
		// 					ResourceMetadata: &armadvisor.ResourceMetadata{
		// 						ResourceID: to.Ptr("/providers/microsoft.management/serviceGroup/serviceGroupXYZ"),
		// 						Action: map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link3",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
		// 							},
		// 						},
		// 						Singular: to.Ptr("Availability set"),
		// 						Plural: to.Ptr("Availability sets"),
		// 					},
		// 					Actions: []map[string]any{
		// 						map[string]any{
		// 							"additionalProperties": map[string]any{
		// 								"actionType": "Document",
		// 								"link": "https://link1",
		// 								"caption": "Enable Soft Delete to protect blob data",
		// 								"description": "Enable Soft Delete to protect blob data",
		// 							},
		// 							"metadata": map[string]any{
		// 								"id": "/providers/microsoft.management/serviceGroup/serviceGroupXYZ",
		// 							},
		// 						},
		// 					},
		// 					Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
		// 					Label: to.Ptr("Enable Soft Delete"),
		// 					LearnMoreLink: to.Ptr("https://link2"),
		// 					PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
		// 					Tracked: to.Ptr(false),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-05-01-preview/UpdateTrackedRecommendation.json
func ExampleRecommendationsClient_Patch() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armadvisor.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRecommendationsClient().Patch(ctx, "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/xyz", "c5532a76-8605-4328-ad27-f37ae87c086c", armadvisor.TrackedRecommendationPropertiesPayload{
		Properties: &armadvisor.TrackedRecommendationPropertiesPayloadProperties{
			TrackedProperties: &armadvisor.TrackedRecommendationProperties{
				State:         to.Ptr(armadvisor.StatePostponed),
				PostponedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-01T00:00:00Z"); return t }()),
			},
		},
	}, 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 = armadvisor.RecommendationsClientPatchResponse{
	// 	ResourceRecommendationBase: armadvisor.ResourceRecommendationBase{
	// 		ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/xyz/providers/Microsoft.Advisor/recommendations/c5532a76-8605-4328-ad27-f37ae87c086c"),
	// 		Name: to.Ptr("c5532a76-8605-4328-ad27-f37ae87c086c"),
	// 		Type: to.Ptr("Microsoft.Advisor/recommendations"),
	// 		Properties: &armadvisor.RecommendationProperties{
	// 			Category: to.Ptr(armadvisor.CategorySecurity),
	// 			Impact: to.Ptr(armadvisor.ImpactMedium),
	// 			ImpactedField: to.Ptr("Microsoft.Compute/virtualMachines"),
	// 			ImpactedValue: to.Ptr("armavset"),
	// 			LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-24T22:24:43.3216408Z"); return t}()),
	// 			Risk: to.Ptr(armadvisor.RiskWarning),
	// 			ShortDescription: &armadvisor.ShortDescription{
	// 				Problem: to.Ptr("Monitoring agent should be installed on your machines"),
	// 				Solution: to.Ptr("Monitoring agent should be installed on your machines"),
	// 			},
	// 			Remediation: map[string]any{
	// 				"additionalProperties": map[string]any{
	// 					"httpMethod": "POST",
	// 					"uri": "uri",
	// 					"details": "link to document",
	// 				},
	// 			},
	// 			ResourceMetadata: &armadvisor.ResourceMetadata{
	// 				ResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/xyz"),
	// 				Source: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/xyz/providers/Microsoft.Security/assessments/7d5f6ba5-307e-452e-b3c4-7d636f722055"),
	// 				Action: map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link3",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/xyz",
	// 					},
	// 				},
	// 				Singular: to.Ptr("Virtual machine"),
	// 				Plural: to.Ptr("Virtual machines"),
	// 			},
	// 			Actions: []map[string]any{
	// 				map[string]any{
	// 					"additionalProperties": map[string]any{
	// 						"actionType": "Document",
	// 						"link": "https://link1",
	// 						"caption": "Enable Soft Delete to protect blob data",
	// 						"description": "Enable Soft Delete to protect blob data",
	// 					},
	// 					"metadata": map[string]any{
	// 						"id": "/subscriptions/00000000-1111-2222-3333-444444444444",
	// 					},
	// 				},
	// 			},
	// 			Description: to.Ptr("After enabling Soft Delete, deleted data transitions to a soft deleted state instead of being permanently deleted. When data is overwritten, a soft deleted snapshot is generated to save the state of the overwritten data. You can configure the amount of time soft deleted data is recoverable before it permanently expires."),
	// 			Label: to.Ptr("Enable Soft Delete"),
	// 			LearnMoreLink: to.Ptr("https://link2"),
	// 			PotentialBenefits: to.Ptr("Save and recover your data when blobs or blob snapshots are accidentally overwritten or deleted"),
	// 			Tracked: to.Ptr(true),
	// 			TrackedProperties: &armadvisor.TrackedRecommendationProperties{
	// 				State: to.Ptr(armadvisor.StatePostponed),
	// 				PostponedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-01T00:00:00Z"); return t}()),
	// 				Priority: to.Ptr(armadvisor.PriorityHigh),
	// 			},
	// 			ResourceWorkload: &armadvisor.RecommendationPropertiesResourceWorkload{
	// 				ID: to.Ptr("0560dbdb-f207-4690-b4ba-1fc0c3a0f082"),
	// 				Name: to.Ptr("Critical VM Workload"),
	// 			},
	// 			Review: &armadvisor.RecommendationPropertiesReview{
	// 				ID: to.Ptr("/subscriptions/a5481ee1-95df-47d0-85d4-dd3f0dfa19bc/providers/Microsoft.Advisor/assessments/MCWAR1"),
	// 				Name: to.Ptr("Monthly WAF Review 09/23"),
	// 			},
	// 			SourceSystem: to.Ptr("CxObserve"),
	// 			Notes: to.Ptr("This is a note"),
	// 		},
	// 	},
	// }
}
