//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 armpolicy_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/resources/armpolicy"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listAllBuiltInPolicyDefinitionVersions.json
func ExampleDefinitionVersionsClient_ListAllBuiltins() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().ListAllBuiltins(ctx, 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
	// 	Value: []*armpolicy.DefinitionVersion{
	// 		{
	// 			Name: to.Ptr("1.2.1"),
	// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 			ID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1"),
	// 			Properties: &armpolicy.DefinitionVersionProperties{
	// 				Description: to.Ptr("Audit DB level audit setting for SQL databases"),
	// 				DisplayName: to.Ptr("Audit SQL DB Level Audit Setting"),
	// 				Mode: to.Ptr("All"),
	// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 					"setting": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						AllowedValues: []any{
	// 							"enabled",
	// 							"disabled"},
	// 							Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 								DisplayName: to.Ptr("Audit Setting"),
	// 							},
	// 						},
	// 					},
	// 					PolicyRule: map[string]any{
	// 						"if":map[string]any{
	// 							"equals": "Microsoft.Sql/servers/databases",
	// 							"field": "type",
	// 						},
	// 						"then":map[string]any{
	// 							"effect": "AuditIfNotExists",
	// 							"details":map[string]any{
	// 								"name": "default",
	// 								"type": "Microsoft.Sql/servers/databases/auditingSettings",
	// 								"existenceCondition":map[string]any{
	// 									"allOf":[]any{
	// 										map[string]any{
	// 											"equals": "[parameters('setting')]",
	// 											"field": "Microsoft.Sql/auditingSettings.state",
	// 										},
	// 									},
	// 								},
	// 							},
	// 						},
	// 					},
	// 					PolicyType: to.Ptr(armpolicy.PolicyTypeBuiltIn),
	// 					Version: to.Ptr("1.2.1"),
	// 				},
	// 			},
	// 			{
	// 				Name: to.Ptr("1.0.0"),
	// 				Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 				ID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0"),
	// 				Properties: &armpolicy.DefinitionVersionProperties{
	// 					Description: to.Ptr("Audit DB level audit setting for SQL databases"),
	// 					DisplayName: to.Ptr("Audit SQL DB Level Audit Setting"),
	// 					Mode: to.Ptr("All"),
	// 					Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 						"setting": &armpolicy.ParameterDefinitionsValue{
	// 							Type: to.Ptr(armpolicy.ParameterTypeString),
	// 							AllowedValues: []any{
	// 								"enabled",
	// 								"disabled",
	// 								"default"},
	// 								Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 									DisplayName: to.Ptr("Audit Setting"),
	// 								},
	// 							},
	// 						},
	// 						PolicyRule: map[string]any{
	// 							"if":map[string]any{
	// 								"equals": "Microsoft.Sql/servers/databases",
	// 								"field": "type",
	// 							},
	// 							"then":map[string]any{
	// 								"effect": "AuditIfNotExists",
	// 								"details":map[string]any{
	// 									"name": "default",
	// 									"type": "Microsoft.Sql/servers/databases/auditingSettings",
	// 									"existenceCondition":map[string]any{
	// 										"allOf":[]any{
	// 											map[string]any{
	// 												"equals": "[parameters('setting')]",
	// 												"field": "Microsoft.Sql/auditingSettings.state",
	// 											},
	// 										},
	// 									},
	// 								},
	// 							},
	// 						},
	// 						PolicyType: to.Ptr(armpolicy.PolicyTypeBuiltIn),
	// 						Version: to.Ptr("1.0.0"),
	// 					},
	// 			}},
	// 		}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json
func ExampleDefinitionVersionsClient_ListAllAtManagementGroup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().ListAllAtManagementGroup(ctx, "MyManagementGroup", 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
	// 	Value: []*armpolicy.DefinitionVersion{
	// 		{
	// 			Name: to.Ptr("1.2.1"),
	// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 			ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 			Properties: &armpolicy.DefinitionVersionProperties{
	// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 				DisplayName: to.Ptr("Naming Convention"),
	// 				Metadata: map[string]any{
	// 					"category": "Naming",
	// 				},
	// 				Mode: to.Ptr("All"),
	// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 					"prefix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name prefix"),
	// 							DisplayName: to.Ptr("Prefix"),
	// 						},
	// 					},
	// 					"suffix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name suffix"),
	// 							DisplayName: to.Ptr("Suffix"),
	// 						},
	// 					},
	// 				},
	// 				PolicyRule: map[string]any{
	// 					"if":map[string]any{
	// 						"not":map[string]any{
	// 							"field": "name",
	// 							"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 						},
	// 					},
	// 					"then":map[string]any{
	// 						"effect": "deny",
	// 					},
	// 				},
	// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 				Version: to.Ptr("1.2.1"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("1.0.0"),
	// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 			ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0"),
	// 			Properties: &armpolicy.DefinitionVersionProperties{
	// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 				DisplayName: to.Ptr("Naming Convention"),
	// 				Metadata: map[string]any{
	// 					"category": "Naming",
	// 				},
	// 				Mode: to.Ptr("All"),
	// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 					"prefix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name prefix"),
	// 							DisplayName: to.Ptr("Prefix"),
	// 						},
	// 					},
	// 					"suffix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name suffix"),
	// 							DisplayName: to.Ptr("Suffix"),
	// 						},
	// 					},
	// 				},
	// 				PolicyRule: map[string]any{
	// 					"if":map[string]any{
	// 						"not":map[string]any{
	// 							"field": "name",
	// 							"like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]",
	// 						},
	// 					},
	// 					"then":map[string]any{
	// 						"effect": "deny",
	// 					},
	// 				},
	// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 				Version: to.Ptr("1.2.1"),
	// 			},
	// 	}},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listAllPolicyDefinitionVersions.json
func ExampleDefinitionVersionsClient_ListAll() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().ListAll(ctx, 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
	// 	Value: []*armpolicy.DefinitionVersion{
	// 		{
	// 			Name: to.Ptr("1.2.1"),
	// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 			ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 			Properties: &armpolicy.DefinitionVersionProperties{
	// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 				DisplayName: to.Ptr("Naming Convention"),
	// 				Metadata: map[string]any{
	// 					"category": "Naming",
	// 				},
	// 				Mode: to.Ptr("All"),
	// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 					"prefix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name prefix"),
	// 							DisplayName: to.Ptr("Prefix"),
	// 						},
	// 					},
	// 					"suffix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name suffix"),
	// 							DisplayName: to.Ptr("Suffix"),
	// 						},
	// 					},
	// 				},
	// 				PolicyRule: map[string]any{
	// 					"if":map[string]any{
	// 						"not":map[string]any{
	// 							"field": "name",
	// 							"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 						},
	// 					},
	// 					"then":map[string]any{
	// 						"effect": "deny",
	// 					},
	// 				},
	// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 				Version: to.Ptr("1.2.1"),
	// 			},
	// 		},
	// 		{
	// 			Name: to.Ptr("1.0.0"),
	// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions"),
	// 			ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0"),
	// 			Properties: &armpolicy.DefinitionVersionProperties{
	// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 				DisplayName: to.Ptr("Naming Convention"),
	// 				Metadata: map[string]any{
	// 					"category": "Naming",
	// 				},
	// 				Mode: to.Ptr("All"),
	// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 					"prefix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name prefix"),
	// 							DisplayName: to.Ptr("Prefix"),
	// 						},
	// 					},
	// 					"suffix": &armpolicy.ParameterDefinitionsValue{
	// 						Type: to.Ptr(armpolicy.ParameterTypeString),
	// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 							Description: to.Ptr("Resource name suffix"),
	// 							DisplayName: to.Ptr("Suffix"),
	// 						},
	// 					},
	// 				},
	// 				PolicyRule: map[string]any{
	// 					"if":map[string]any{
	// 						"not":map[string]any{
	// 							"field": "name",
	// 							"like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]",
	// 						},
	// 					},
	// 					"then":map[string]any{
	// 						"effect": "deny",
	// 					},
	// 				},
	// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 				Version: to.Ptr("1.0.0"),
	// 			},
	// 	}},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/createOrUpdatePolicyDefinitionVersion.json
func ExampleDefinitionVersionsClient_CreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().CreateOrUpdate(ctx, "ResourceNaming", "1.2.1", armpolicy.DefinitionVersion{
		Properties: &armpolicy.DefinitionVersionProperties{
			Description: to.Ptr("Force resource names to begin with given 'prefix' and/or end with given 'suffix'"),
			DisplayName: to.Ptr("Enforce resource naming convention"),
			Metadata: map[string]any{
				"category": "Naming",
			},
			Mode: to.Ptr("All"),
			Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
				"prefix": {
					Type: to.Ptr(armpolicy.ParameterTypeString),
					Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
						Description: to.Ptr("Resource name prefix"),
						DisplayName: to.Ptr("Prefix"),
					},
				},
				"suffix": {
					Type: to.Ptr(armpolicy.ParameterTypeString),
					Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
						Description: to.Ptr("Resource name suffix"),
						DisplayName: to.Ptr("Suffix"),
					},
				},
			},
			PolicyRule: map[string]any{
				"if": map[string]any{
					"not": map[string]any{
						"field": "name",
						"like":  "[concat(parameters('prefix'), '*', parameters('suffix'))]",
					},
				},
				"then": map[string]any{
					"effect": "deny",
				},
			},
			Version: to.Ptr("1.2.1"),
		},
	}, 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.DefinitionVersion = armpolicy.DefinitionVersion{
	// 	Name: to.Ptr("1.2.1"),
	// 	Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 	ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 	Properties: &armpolicy.DefinitionVersionProperties{
	// 		Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 		DisplayName: to.Ptr("Naming Convention"),
	// 		Metadata: map[string]any{
	// 			"category": "Naming",
	// 		},
	// 		Mode: to.Ptr("All"),
	// 		Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 			"prefix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name prefix"),
	// 					DisplayName: to.Ptr("Prefix"),
	// 				},
	// 			},
	// 			"suffix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name suffix"),
	// 					DisplayName: to.Ptr("Suffix"),
	// 				},
	// 			},
	// 		},
	// 		PolicyRule: map[string]any{
	// 			"if":map[string]any{
	// 				"not":map[string]any{
	// 					"field": "name",
	// 					"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 				},
	// 			},
	// 			"then":map[string]any{
	// 				"effect": "deny",
	// 			},
	// 		},
	// 		PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 		Version: to.Ptr("1.2.1"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/deletePolicyDefinitionVersion.json
func ExampleDefinitionVersionsClient_Delete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDefinitionVersionsClient().Delete(ctx, "ResourceNaming", "1.2.1", 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/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/getPolicyDefinitionVersion.json
func ExampleDefinitionVersionsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().Get(ctx, "ResourceNaming", "1.2.1", 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.DefinitionVersion = armpolicy.DefinitionVersion{
	// 	Name: to.Ptr("1.2.1"),
	// 	Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 	ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 	Properties: &armpolicy.DefinitionVersionProperties{
	// 		Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 		DisplayName: to.Ptr("Naming Convention"),
	// 		Metadata: map[string]any{
	// 			"category": "Naming",
	// 		},
	// 		Mode: to.Ptr("All"),
	// 		Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 			"prefix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name prefix"),
	// 					DisplayName: to.Ptr("Prefix"),
	// 				},
	// 			},
	// 			"suffix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name suffix"),
	// 					DisplayName: to.Ptr("Suffix"),
	// 				},
	// 			},
	// 		},
	// 		PolicyRule: map[string]any{
	// 			"if":map[string]any{
	// 				"not":map[string]any{
	// 					"field": "name",
	// 					"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 				},
	// 			},
	// 			"then":map[string]any{
	// 				"effect": "deny",
	// 			},
	// 		},
	// 		PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 		Version: to.Ptr("1.2.1"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/getBuiltinPolicyDefinitionVersion.json
func ExampleDefinitionVersionsClient_GetBuiltIn() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().GetBuiltIn(ctx, "7433c107-6db4-4ad1-b57a-a76dce0154a1", "1.2.1", 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.DefinitionVersion = armpolicy.DefinitionVersion{
	// 	Name: to.Ptr("1.2.1"),
	// 	Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 	ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1/versions/1.2.1"),
	// 	Properties: &armpolicy.DefinitionVersionProperties{
	// 		Description: to.Ptr("This policy enables you to specify a set of storage account SKUs that your organization can deploy."),
	// 		DisplayName: to.Ptr("Allowed storage account SKUs"),
	// 		Mode: to.Ptr("All"),
	// 		Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 			"listOfAllowedSKUs": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeArray),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("The list of SKUs that can be specified for storage accounts."),
	// 					DisplayName: to.Ptr("Allowed SKUs"),
	// 					StrongType: to.Ptr("StorageSKUs"),
	// 				},
	// 			},
	// 		},
	// 		PolicyRule: map[string]any{
	// 			"if":map[string]any{
	// 				"allOf":[]any{
	// 					map[string]any{
	// 						"equals": "Microsoft.Storage/storageAccounts",
	// 						"field": "type",
	// 					},
	// 					map[string]any{
	// 						"not":map[string]any{
	// 							"field": "Microsoft.Storage/storageAccounts/sku.name",
	// 							"in": "[parameters('listOfAllowedSKUs')]",
	// 						},
	// 					},
	// 				},
	// 			},
	// 			"then":map[string]any{
	// 				"effect": "Deny",
	// 			},
	// 		},
	// 		PolicyType: to.Ptr(armpolicy.PolicyTypeBuiltIn),
	// 		Version: to.Ptr("1.2.1"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json
func ExampleDefinitionVersionsClient_CreateOrUpdateAtManagementGroup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().CreateOrUpdateAtManagementGroup(ctx, "MyManagementGroup", "ResourceNaming", "1.2.1", armpolicy.DefinitionVersion{
		Properties: &armpolicy.DefinitionVersionProperties{
			Description: to.Ptr("Force resource names to begin with given 'prefix' and/or end with given 'suffix'"),
			DisplayName: to.Ptr("Enforce resource naming convention"),
			Metadata: map[string]any{
				"category": "Naming",
			},
			Mode: to.Ptr("All"),
			Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
				"prefix": {
					Type: to.Ptr(armpolicy.ParameterTypeString),
					Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
						Description: to.Ptr("Resource name prefix"),
						DisplayName: to.Ptr("Prefix"),
					},
				},
				"suffix": {
					Type: to.Ptr(armpolicy.ParameterTypeString),
					Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
						Description: to.Ptr("Resource name suffix"),
						DisplayName: to.Ptr("Suffix"),
					},
				},
			},
			PolicyRule: map[string]any{
				"if": map[string]any{
					"not": map[string]any{
						"field": "name",
						"like":  "[concat(parameters('prefix'), '*', parameters('suffix'))]",
					},
				},
				"then": map[string]any{
					"effect": "deny",
				},
			},
			Version: to.Ptr("1.2.1"),
		},
	}, 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.DefinitionVersion = armpolicy.DefinitionVersion{
	// 	Name: to.Ptr("1.2.1"),
	// 	Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 	Properties: &armpolicy.DefinitionVersionProperties{
	// 		Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 		DisplayName: to.Ptr("Naming Convention"),
	// 		Metadata: map[string]any{
	// 			"category": "Naming",
	// 		},
	// 		Mode: to.Ptr("All"),
	// 		Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 			"prefix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name prefix"),
	// 					DisplayName: to.Ptr("Prefix"),
	// 				},
	// 			},
	// 			"suffix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name suffix"),
	// 					DisplayName: to.Ptr("Suffix"),
	// 				},
	// 			},
	// 		},
	// 		PolicyRule: map[string]any{
	// 			"if":map[string]any{
	// 				"not":map[string]any{
	// 					"field": "name",
	// 					"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 				},
	// 			},
	// 			"then":map[string]any{
	// 				"effect": "deny",
	// 			},
	// 		},
	// 		PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 		Version: to.Ptr("1.2.1"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json
func ExampleDefinitionVersionsClient_DeleteAtManagementGroup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewDefinitionVersionsClient().DeleteAtManagementGroup(ctx, "MyManagementGroup", "ResourceNaming", "1.2.1", 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/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/getPolicyDefinitionVersionAtManagementGroup.json
func ExampleDefinitionVersionsClient_GetAtManagementGroup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDefinitionVersionsClient().GetAtManagementGroup(ctx, "MyManagementGroup", "ResourceNaming", "1.2.1", 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.DefinitionVersion = armpolicy.DefinitionVersion{
	// 	Name: to.Ptr("1.2.1"),
	// 	Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
	// 	ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
	// 	Properties: &armpolicy.DefinitionVersionProperties{
	// 		Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
	// 		DisplayName: to.Ptr("Naming Convention"),
	// 		Metadata: map[string]any{
	// 			"category": "Naming",
	// 		},
	// 		Mode: to.Ptr("All"),
	// 		Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
	// 			"prefix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name prefix"),
	// 					DisplayName: to.Ptr("Prefix"),
	// 				},
	// 			},
	// 			"suffix": &armpolicy.ParameterDefinitionsValue{
	// 				Type: to.Ptr(armpolicy.ParameterTypeString),
	// 				Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
	// 					Description: to.Ptr("Resource name suffix"),
	// 					DisplayName: to.Ptr("Suffix"),
	// 				},
	// 			},
	// 		},
	// 		PolicyRule: map[string]any{
	// 			"if":map[string]any{
	// 				"not":map[string]any{
	// 					"field": "name",
	// 					"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
	// 				},
	// 			},
	// 			"then":map[string]any{
	// 				"effect": "deny",
	// 			},
	// 		},
	// 		PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
	// 		Version: to.Ptr("1.2.1"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listPolicyDefinitionVersions.json
func ExampleDefinitionVersionsClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDefinitionVersionsClient().NewListPager("ResourceNaming", &armpolicy.DefinitionVersionsClientListOptions{Top: 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
		// 	Value: []*armpolicy.DefinitionVersion{
		// 		{
		// 			Name: to.Ptr("1.2.1"),
		// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
		// 			ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
		// 			Properties: &armpolicy.DefinitionVersionProperties{
		// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
		// 				DisplayName: to.Ptr("Naming Convention"),
		// 				Metadata: map[string]any{
		// 					"category": "Naming",
		// 				},
		// 				Mode: to.Ptr("All"),
		// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 					"prefix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name prefix"),
		// 							DisplayName: to.Ptr("Prefix"),
		// 						},
		// 					},
		// 					"suffix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name suffix"),
		// 							DisplayName: to.Ptr("Suffix"),
		// 						},
		// 					},
		// 				},
		// 				PolicyRule: map[string]any{
		// 					"if":map[string]any{
		// 						"not":map[string]any{
		// 							"field": "name",
		// 							"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
		// 						},
		// 					},
		// 					"then":map[string]any{
		// 						"effect": "deny",
		// 					},
		// 				},
		// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
		// 				Version: to.Ptr("1.2.1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("1.0.0"),
		// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions"),
		// 			ID: to.Ptr("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/versions/1.0.0"),
		// 			Properties: &armpolicy.DefinitionVersionProperties{
		// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
		// 				DisplayName: to.Ptr("Naming Convention"),
		// 				Metadata: map[string]any{
		// 					"category": "Naming",
		// 				},
		// 				Mode: to.Ptr("All"),
		// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 					"prefix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name prefix"),
		// 							DisplayName: to.Ptr("Prefix"),
		// 						},
		// 					},
		// 					"suffix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name suffix"),
		// 							DisplayName: to.Ptr("Suffix"),
		// 						},
		// 					},
		// 				},
		// 				PolicyRule: map[string]any{
		// 					"if":map[string]any{
		// 						"not":map[string]any{
		// 							"field": "name",
		// 							"like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]",
		// 						},
		// 					},
		// 					"then":map[string]any{
		// 						"effect": "deny",
		// 					},
		// 				},
		// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
		// 				Version: to.Ptr("1.0.0"),
		// 			},
		// 	}},
		// }
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listBuiltInPolicyDefinitionVersions.json
func ExampleDefinitionVersionsClient_NewListBuiltInPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDefinitionVersionsClient().NewListBuiltInPager("06a78e20-9358-41c9-923c-fb736d382a12", &armpolicy.DefinitionVersionsClientListBuiltInOptions{Top: 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
		// 	Value: []*armpolicy.DefinitionVersion{
		// 		{
		// 			Name: to.Ptr("1.2.1"),
		// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
		// 			ID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.2.1"),
		// 			Properties: &armpolicy.DefinitionVersionProperties{
		// 				Description: to.Ptr("Audit DB level audit setting for SQL databases"),
		// 				DisplayName: to.Ptr("Audit SQL DB Level Audit Setting"),
		// 				Mode: to.Ptr("All"),
		// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 					"setting": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						AllowedValues: []any{
		// 							"enabled",
		// 							"disabled"},
		// 							Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 								DisplayName: to.Ptr("Audit Setting"),
		// 							},
		// 						},
		// 					},
		// 					PolicyRule: map[string]any{
		// 						"if":map[string]any{
		// 							"equals": "Microsoft.Sql/servers/databases",
		// 							"field": "type",
		// 						},
		// 						"then":map[string]any{
		// 							"effect": "AuditIfNotExists",
		// 							"details":map[string]any{
		// 								"name": "default",
		// 								"type": "Microsoft.Sql/servers/databases/auditingSettings",
		// 								"existenceCondition":map[string]any{
		// 									"allOf":[]any{
		// 										map[string]any{
		// 											"equals": "[parameters('setting')]",
		// 											"field": "Microsoft.Sql/auditingSettings.state",
		// 										},
		// 									},
		// 								},
		// 							},
		// 						},
		// 					},
		// 					PolicyType: to.Ptr(armpolicy.PolicyTypeBuiltIn),
		// 					Version: to.Ptr("1.2.1"),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("1.0.0"),
		// 				Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
		// 				ID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a12/versions/1.0.0"),
		// 				Properties: &armpolicy.DefinitionVersionProperties{
		// 					Description: to.Ptr("Audit DB level audit setting for SQL databases"),
		// 					DisplayName: to.Ptr("Audit SQL DB Level Audit Setting"),
		// 					Mode: to.Ptr("All"),
		// 					Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 						"setting": &armpolicy.ParameterDefinitionsValue{
		// 							Type: to.Ptr(armpolicy.ParameterTypeString),
		// 							AllowedValues: []any{
		// 								"enabled",
		// 								"disabled",
		// 								"default"},
		// 								Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 									DisplayName: to.Ptr("Audit Setting"),
		// 								},
		// 							},
		// 						},
		// 						PolicyRule: map[string]any{
		// 							"if":map[string]any{
		// 								"equals": "Microsoft.Sql/servers/databases",
		// 								"field": "type",
		// 							},
		// 							"then":map[string]any{
		// 								"effect": "AuditIfNotExists",
		// 								"details":map[string]any{
		// 									"name": "default",
		// 									"type": "Microsoft.Sql/servers/databases/auditingSettings",
		// 									"existenceCondition":map[string]any{
		// 										"allOf":[]any{
		// 											map[string]any{
		// 												"equals": "[parameters('setting')]",
		// 												"field": "Microsoft.Sql/auditingSettings.state",
		// 											},
		// 										},
		// 									},
		// 								},
		// 							},
		// 						},
		// 						PolicyType: to.Ptr(armpolicy.PolicyTypeBuiltIn),
		// 						Version: to.Ptr("1.0.0"),
		// 					},
		// 			}},
		// 		}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/219b2e3ef270f18149774eb2793b48baacde982f/specification/resources/resource-manager/Microsoft.Authorization/stable/2023-04-01/examples/listPolicyDefinitionVersionsByManagementGroup.json
func ExampleDefinitionVersionsClient_NewListByManagementGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armpolicy.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewDefinitionVersionsClient().NewListByManagementGroupPager("MyManagementGroup", "ResourceNaming", &armpolicy.DefinitionVersionsClientListByManagementGroupOptions{Top: 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.DefinitionVersionListResult = armpolicy.DefinitionVersionListResult{
		// 	Value: []*armpolicy.DefinitionVersion{
		// 		{
		// 			Name: to.Ptr("1.2.1"),
		// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.2.1"),
		// 			Properties: &armpolicy.DefinitionVersionProperties{
		// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
		// 				DisplayName: to.Ptr("Naming Convention"),
		// 				Metadata: map[string]any{
		// 					"category": "Naming",
		// 				},
		// 				Mode: to.Ptr("All"),
		// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 					"prefix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name prefix"),
		// 							DisplayName: to.Ptr("Prefix"),
		// 						},
		// 					},
		// 					"suffix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name suffix"),
		// 							DisplayName: to.Ptr("Suffix"),
		// 						},
		// 					},
		// 				},
		// 				PolicyRule: map[string]any{
		// 					"if":map[string]any{
		// 						"not":map[string]any{
		// 							"field": "name",
		// 							"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]",
		// 						},
		// 					},
		// 					"then":map[string]any{
		// 						"effect": "deny",
		// 					},
		// 				},
		// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
		// 				Version: to.Ptr("1.2.1"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("1.0.0"),
		// 			Type: to.Ptr("Microsoft.Authorization/policyDefinitions/versions"),
		// 			ID: to.Ptr("/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming/versions/1.0.0"),
		// 			Properties: &armpolicy.DefinitionVersionProperties{
		// 				Description: to.Ptr("Force resource names to begin with 'prefix' and end with 'suffix'"),
		// 				DisplayName: to.Ptr("Naming Convention"),
		// 				Metadata: map[string]any{
		// 					"category": "Naming",
		// 				},
		// 				Mode: to.Ptr("All"),
		// 				Parameters: map[string]*armpolicy.ParameterDefinitionsValue{
		// 					"prefix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name prefix"),
		// 							DisplayName: to.Ptr("Prefix"),
		// 						},
		// 					},
		// 					"suffix": &armpolicy.ParameterDefinitionsValue{
		// 						Type: to.Ptr(armpolicy.ParameterTypeString),
		// 						Metadata: &armpolicy.ParameterDefinitionsValueMetadata{
		// 							Description: to.Ptr("Resource name suffix"),
		// 							DisplayName: to.Ptr("Suffix"),
		// 						},
		// 					},
		// 				},
		// 				PolicyRule: map[string]any{
		// 					"if":map[string]any{
		// 						"not":map[string]any{
		// 							"field": "name",
		// 							"like": "[concat(parameters('prefix'), '-*', parameters('suffix'))]",
		// 						},
		// 					},
		// 					"then":map[string]any{
		// 						"effect": "deny",
		// 					},
		// 				},
		// 				PolicyType: to.Ptr(armpolicy.PolicyTypeCustom),
		// 				Version: to.Ptr("1.2.1"),
		// 			},
		// 	}},
		// }
	}
}
