//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 armappcontainers_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/appcontainers/armappcontainers/v4"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_ListBySubscription.json
func ExampleManagedEnvironmentsClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedEnvironmentsClient().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.ManagedEnvironmentsCollection = armappcontainers.ManagedEnvironmentsCollection{
		// 	Value: []*armappcontainers.ManagedEnvironment{
		// 		{
		// 			Name: to.Ptr("jlaw-demo1"),
		// 			Type: to.Ptr("Microsoft.App/managedEnvironments"),
		// 			ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"),
		// 			Location: to.Ptr("North Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Properties: &armappcontainers.ManagedEnvironmentProperties{
		// 				AvailabilityZones: []*string{
		// 					to.Ptr("1"),
		// 					to.Ptr("2"),
		// 					to.Ptr("3")},
		// 					CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
		// 						CustomDomainVerificationID: to.Ptr("custom domain verification id"),
		// 						DNSSuffix: to.Ptr("www.my-name.com"),
		// 						ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
		// 						SubjectName: to.Ptr("CN=www.my-name.com"),
		// 						Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
		// 					},
		// 					DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"),
		// 					EventStreamEndpoint: to.Ptr("testEndpoint"),
		// 					InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"),
		// 					ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
		// 					StaticIP: to.Ptr("20.42.33.145"),
		// 					VnetConfiguration: &armappcontainers.VnetConfiguration{
		// 						InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
		// 					},
		// 					WorkloadProfiles: []*armappcontainers.WorkloadProfile{
		// 						{
		// 							Name: to.Ptr("My-GP-01"),
		// 							EnableFips: to.Ptr(true),
		// 							MaximumCount: to.Ptr[int32](12),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("GeneralPurpose"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-MO-01"),
		// 							MaximumCount: to.Ptr[int32](6),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("MemoryOptimized"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-CO-01"),
		// 							MaximumCount: to.Ptr[int32](6),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("ComputeOptimized"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-consumption-01"),
		// 							WorkloadProfileType: to.Ptr("Consumption"),
		// 					}},
		// 					ZoneRedundant: to.Ptr(true),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("demo1"),
		// 				Type: to.Ptr("Microsoft.App/managedEnvironments"),
		// 				ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.App/managedEnvironments/demo1"),
		// 				Location: to.Ptr("North Central US"),
		// 				Tags: map[string]*string{
		// 				},
		// 				Properties: &armappcontainers.ManagedEnvironmentProperties{
		// 					AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
		// 						Destination: to.Ptr("log-analytics"),
		// 						LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
		// 							CustomerID: to.Ptr("9ccccd4a-268f-4a9a-8d03-9bfe77c3fbd2"),
		// 							DynamicJSONColumns: to.Ptr(true),
		// 						},
		// 					},
		// 					AvailabilityZones: []*string{
		// 						to.Ptr("1"),
		// 						to.Ptr("2"),
		// 						to.Ptr("3")},
		// 						CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
		// 							CustomDomainVerificationID: to.Ptr("custom domain verification id"),
		// 							DNSSuffix: to.Ptr("www.my-name2.com"),
		// 							ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
		// 							SubjectName: to.Ptr("CN=www.my-name2.com"),
		// 							Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
		// 						},
		// 						DefaultDomain: to.Ptr("demo1.k4apps.io"),
		// 						EventStreamEndpoint: to.Ptr("testEndpoint"),
		// 						InfrastructureResourceGroup: to.Ptr("capp-svc-demo1-northcentralus"),
		// 						ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
		// 						StaticIP: to.Ptr("52.142.21.61"),
		// 						VnetConfiguration: &armappcontainers.VnetConfiguration{
		// 							InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
		// 						},
		// 						ZoneRedundant: to.Ptr(true),
		// 					},
		// 				},
		// 				{
		// 					Name: to.Ptr("pl1"),
		// 					Type: to.Ptr("Microsoft.App/managedEnvironments"),
		// 					ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.App/managedEnvironments/pl1"),
		// 					Location: to.Ptr("North Central US"),
		// 					Tags: map[string]*string{
		// 					},
		// 					Properties: &armappcontainers.ManagedEnvironmentProperties{
		// 						AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
		// 							Destination: to.Ptr("log-analytics"),
		// 							LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
		// 								CustomerID: to.Ptr("9ccccd4a-268f-4a9a-8d03-9bfe77c3fbd2"),
		// 								DynamicJSONColumns: to.Ptr(true),
		// 							},
		// 						},
		// 						AvailabilityZones: []*string{
		// 							to.Ptr("1"),
		// 							to.Ptr("2"),
		// 							to.Ptr("3")},
		// 							CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
		// 								CustomDomainVerificationID: to.Ptr("custom domain verification id"),
		// 								DNSSuffix: to.Ptr("www.my-name2.com"),
		// 								ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
		// 								SubjectName: to.Ptr("CN=www.my-name2.com"),
		// 								Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
		// 							},
		// 							DefaultDomain: to.Ptr("pl1.k4apps.io"),
		// 							EventStreamEndpoint: to.Ptr("testEndpoint"),
		// 							PrivateEndpointConnections: []*armappcontainers.PrivateEndpointConnection{
		// 								{
		// 									Name: to.Ptr("96101496-ed84-44f9-a28c-d4798f053023-d1908429-ca41-48a0-a026-6a4014e6e615"),
		// 									Type: to.Ptr("Microsoft.App/managedEnvironments/privateEndpointConnections"),
		// 									ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.App/managedEnvironments/pl1/privateEndpointConnections/96101496-ed84-44f9-a28c-d4798f053023-d1908429-ca41-48a0-a026-6a4014e6e615"),
		// 									Properties: &armappcontainers.PrivateEndpointConnectionProperties{
		// 										GroupIDs: []*string{
		// 											to.Ptr("managedEnvironments")},
		// 											PrivateEndpoint: &armappcontainers.PrivateEndpoint{
		// 												ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.Network/privateEndpoints/96101496-ed84-44f9-a28c-d4798f053023"),
		// 											},
		// 											PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{
		// 												Description: to.Ptr("please approve"),
		// 												ActionsRequired: to.Ptr("None"),
		// 												Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusApproved),
		// 											},
		// 											ProvisioningState: to.Ptr(armappcontainers.PrivateEndpointConnectionProvisioningStateSucceeded),
		// 										},
		// 								}},
		// 								PrivateLinkDefaultDomain: to.Ptr("privatelink.pl1.k4apps.io"),
		// 								ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
		// 								StaticIP: to.Ptr("52.142.21.61"),
		// 								VnetConfiguration: &armappcontainers.VnetConfiguration{
		// 									InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
		// 								},
		// 								ZoneRedundant: to.Ptr(true),
		// 							},
		// 					}},
		// 				}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json
func ExampleManagedEnvironmentsClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedEnvironmentsClient().NewListByResourceGroupPager("examplerg", 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.ManagedEnvironmentsCollection = armappcontainers.ManagedEnvironmentsCollection{
		// 	Value: []*armappcontainers.ManagedEnvironment{
		// 		{
		// 			Name: to.Ptr("jlaw-demo1"),
		// 			Type: to.Ptr("Microsoft.App/managedEnvironments"),
		// 			ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"),
		// 			Location: to.Ptr("North Central US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Properties: &armappcontainers.ManagedEnvironmentProperties{
		// 				AvailabilityZones: []*string{
		// 					to.Ptr("1"),
		// 					to.Ptr("2"),
		// 					to.Ptr("3")},
		// 					CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
		// 						CustomDomainVerificationID: to.Ptr("custom domain verification id"),
		// 						DNSSuffix: to.Ptr("www.my-name.com"),
		// 						ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
		// 						SubjectName: to.Ptr("CN=www.my-name.com"),
		// 						Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
		// 					},
		// 					DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"),
		// 					EventStreamEndpoint: to.Ptr("testEndpoint"),
		// 					InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"),
		// 					IngressConfiguration: &armappcontainers.IngressConfiguration{
		// 						HeaderCountLimit: to.Ptr[int32](50),
		// 						Scale: &armappcontainers.IngressConfigurationScale{
		// 							MaxReplicas: to.Ptr[int32](2),
		// 							MinReplicas: to.Ptr[int32](2),
		// 						},
		// 						TerminationGracePeriodSeconds: to.Ptr[int32](600),
		// 						WorkloadProfileName: to.Ptr("My-GP-01"),
		// 					},
		// 					ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
		// 					StaticIP: to.Ptr("20.42.33.145"),
		// 					VnetConfiguration: &armappcontainers.VnetConfiguration{
		// 						InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
		// 					},
		// 					WorkloadProfiles: []*armappcontainers.WorkloadProfile{
		// 						{
		// 							Name: to.Ptr("My-GP-01"),
		// 							EnableFips: to.Ptr(true),
		// 							MaximumCount: to.Ptr[int32](12),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("GeneralPurpose"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-MO-01"),
		// 							MaximumCount: to.Ptr[int32](6),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("MemoryOptimized"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-CO-01"),
		// 							MaximumCount: to.Ptr[int32](6),
		// 							MinimumCount: to.Ptr[int32](3),
		// 							WorkloadProfileType: to.Ptr("ComputeOptimized"),
		// 						},
		// 						{
		// 							Name: to.Ptr("My-consumption-01"),
		// 							WorkloadProfileType: to.Ptr("Consumption"),
		// 					}},
		// 					ZoneRedundant: to.Ptr(true),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("demo1"),
		// 				Type: to.Ptr("Microsoft.App/managedEnvironments"),
		// 				ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/demo1"),
		// 				Location: to.Ptr("North Central US"),
		// 				Tags: map[string]*string{
		// 				},
		// 				Properties: &armappcontainers.ManagedEnvironmentProperties{
		// 					AvailabilityZones: []*string{
		// 						to.Ptr("1"),
		// 						to.Ptr("2"),
		// 						to.Ptr("3")},
		// 						CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
		// 							CustomDomainVerificationID: to.Ptr("custom domain verification id"),
		// 							DNSSuffix: to.Ptr("www.my-name2.com"),
		// 							ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
		// 							SubjectName: to.Ptr("CN=www.my-name2.com"),
		// 							Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
		// 						},
		// 						DefaultDomain: to.Ptr("demo1.k4apps.io"),
		// 						EventStreamEndpoint: to.Ptr("testEndpoint"),
		// 						InfrastructureResourceGroup: to.Ptr("capp-svc-demo1-northcentralus"),
		// 						ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
		// 						StaticIP: to.Ptr("52.142.21.61"),
		// 						VnetConfiguration: &armappcontainers.VnetConfiguration{
		// 							InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
		// 						},
		// 						ZoneRedundant: to.Ptr(true),
		// 					},
		// 			}},
		// 		}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json
func ExampleManagedEnvironmentsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedEnvironmentsClient().Get(ctx, "examplerg", "jlaw-demo1", 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.ManagedEnvironment = armappcontainers.ManagedEnvironment{
	// 	Name: to.Ptr("jlaw-demo1"),
	// 	Type: to.Ptr("Microsoft.App/managedEnvironments"),
	// 	ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"),
	// 	Location: to.Ptr("North Central US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armappcontainers.ManagedEnvironmentProperties{
	// 		AvailabilityZones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2"),
	// 			to.Ptr("3")},
	// 			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
	// 				CustomDomainVerificationID: to.Ptr("custom domain verification id"),
	// 				DNSSuffix: to.Ptr("www.my-name.com"),
	// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
	// 				SubjectName: to.Ptr("CN=www.my-name.com"),
	// 				Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
	// 			},
	// 			DaprConfiguration: &armappcontainers.DaprConfiguration{
	// 				Version: to.Ptr("1.9"),
	// 			},
	// 			DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"),
	// 			EventStreamEndpoint: to.Ptr("testEndpoint"),
	// 			InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"),
	// 			IngressConfiguration: &armappcontainers.IngressConfiguration{
	// 				HeaderCountLimit: to.Ptr[int32](30),
	// 				RequestIdleTimeout: to.Ptr[int32](5),
	// 				Scale: &armappcontainers.IngressConfigurationScale{
	// 					MaxReplicas: to.Ptr[int32](4),
	// 					MinReplicas: to.Ptr[int32](2),
	// 				},
	// 				TerminationGracePeriodSeconds: to.Ptr[int32](3600),
	// 				WorkloadProfileName: to.Ptr("My-CO-01"),
	// 			},
	// 			KedaConfiguration: &armappcontainers.KedaConfiguration{
	// 				Version: to.Ptr("2.8.1"),
	// 			},
	// 			PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{
	// 				Mtls: &armappcontainers.Mtls{
	// 					Enabled: to.Ptr(true),
	// 				},
	// 			},
	// 			PeerTrafficConfiguration: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfiguration{
	// 				Encryption: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption{
	// 					Enabled: to.Ptr(true),
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
	// 			StaticIP: to.Ptr("20.42.33.145"),
	// 			VnetConfiguration: &armappcontainers.VnetConfiguration{
	// 				InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
	// 			},
	// 			WorkloadProfiles: []*armappcontainers.WorkloadProfile{
	// 				{
	// 					Name: to.Ptr("My-GP-01"),
	// 					EnableFips: to.Ptr(true),
	// 					MaximumCount: to.Ptr[int32](12),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("GeneralPurpose"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-MO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("MemoryOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-CO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("ComputeOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-consumption-01"),
	// 					WorkloadProfileType: to.Ptr("Consumption"),
	// 			}},
	// 			ZoneRedundant: to.Ptr(true),
	// 		},
	// 	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json
func ExampleManagedEnvironmentsClient_BeginCreateOrUpdate_createEnvironmentWithCustomInfrastructureResourceGroup() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedEnvironmentsClient().BeginCreateOrUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{
		Location: to.Ptr("East US"),
		Properties: &armappcontainers.ManagedEnvironmentProperties{
			AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
				LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
					CustomerID: to.Ptr("string"),
					SharedKey:  to.Ptr("string"),
				},
			},
			AvailabilityZones: []*string{
				to.Ptr("1"),
				to.Ptr("2"),
				to.Ptr("3")},
			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
				CertificatePassword: to.Ptr("1234"),
				CertificateValue:    []byte("Y2VydA=="),
				DNSSuffix:           to.Ptr("www.my-name.com"),
			},
			DaprAIConnectionString:      to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"),
			InfrastructureResourceGroup: to.Ptr("myInfrastructureRgName"),
			VnetConfiguration: &armappcontainers.VnetConfiguration{
				InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
			},
			WorkloadProfiles: []*armappcontainers.WorkloadProfile{
				{
					Name:                to.Ptr("My-GP-01"),
					EnableFips:          to.Ptr(true),
					MaximumCount:        to.Ptr[int32](12),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("GeneralPurpose"),
				},
				{
					Name:                to.Ptr("My-MO-01"),
					MaximumCount:        to.Ptr[int32](6),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("MemoryOptimized"),
				},
				{
					Name:                to.Ptr("My-CO-01"),
					MaximumCount:        to.Ptr[int32](6),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("ComputeOptimized"),
				},
				{
					Name:                to.Ptr("My-consumption-01"),
					WorkloadProfileType: to.Ptr("Consumption"),
				}},
			ZoneRedundant: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %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.ManagedEnvironment = armappcontainers.ManagedEnvironment{
	// 	Name: to.Ptr("testcontainerenv"),
	// 	Type: to.Ptr("Microsoft.App/managedEnvironments"),
	// 	ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armappcontainers.ManagedEnvironmentProperties{
	// 		AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
	// 			LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
	// 				CustomerID: to.Ptr("string"),
	// 			},
	// 		},
	// 		AvailabilityZones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2"),
	// 			to.Ptr("3")},
	// 			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
	// 				CustomDomainVerificationID: to.Ptr("custom domain verification id"),
	// 				DNSSuffix: to.Ptr("www.my-name.com"),
	// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
	// 				SubjectName: to.Ptr("CN=www.my-name.com"),
	// 				Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
	// 			},
	// 			DefaultDomain: to.Ptr("testcontainerenv.k4apps.io"),
	// 			EventStreamEndpoint: to.Ptr("testEndpoint"),
	// 			InfrastructureResourceGroup: to.Ptr("myInfrastructureRgName"),
	// 			ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
	// 			StaticIP: to.Ptr("1.2.3.4"),
	// 			VnetConfiguration: &armappcontainers.VnetConfiguration{
	// 				InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
	// 			},
	// 			WorkloadProfiles: []*armappcontainers.WorkloadProfile{
	// 				{
	// 					Name: to.Ptr("My-GP-01"),
	// 					EnableFips: to.Ptr(true),
	// 					MaximumCount: to.Ptr[int32](12),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("GeneralPurpose"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-MO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("MemoryOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-CO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("ComputeOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-consumption-01"),
	// 					WorkloadProfileType: to.Ptr("Consumption"),
	// 			}},
	// 			ZoneRedundant: to.Ptr(true),
	// 		},
	// 	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json
func ExampleManagedEnvironmentsClient_BeginCreateOrUpdate_createEnvironments() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedEnvironmentsClient().BeginCreateOrUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{
		Location: to.Ptr("East US"),
		Identity: &armappcontainers.ManagedServiceIdentity{
			Type: to.Ptr(armappcontainers.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
			UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{
				"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {},
			},
		},
		Properties: &armappcontainers.ManagedEnvironmentProperties{
			AppInsightsConfiguration: &armappcontainers.AppInsightsConfiguration{
				ConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/"),
			},
			AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
				LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
					CustomerID:         to.Ptr("string"),
					DynamicJSONColumns: to.Ptr(true),
					SharedKey:          to.Ptr("string"),
				},
			},
			AvailabilityZones: []*string{
				to.Ptr("1"),
				to.Ptr("2"),
				to.Ptr("3")},
			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
				CertificatePassword: to.Ptr("1234"),
				CertificateValue:    []byte("Y2VydA=="),
				DNSSuffix:           to.Ptr("www.my-name.com"),
			},
			DaprAIConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"),
			DiskEncryptionConfiguration: &armappcontainers.DiskEncryptionConfiguration{
				KeyVaultConfiguration: &armappcontainers.DiskEncryptionConfigurationKeyVaultConfiguration{
					Auth: &armappcontainers.DiskEncryptionConfigurationKeyVaultConfigurationAuth{
						Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"),
					},
					KeyURL: to.Ptr("https://contoso.vault.azure.net/mykey/19ff8313ca394b89b9e824bbbdc8c521"),
				},
			},
			IngressConfiguration: &armappcontainers.IngressConfiguration{
				HeaderCountLimit:   to.Ptr[int32](30),
				RequestIdleTimeout: to.Ptr[int32](5),
				Scale: &armappcontainers.IngressConfigurationScale{
					MaxReplicas: to.Ptr[int32](4),
					MinReplicas: to.Ptr[int32](2),
				},
				TerminationGracePeriodSeconds: to.Ptr[int32](3600),
				WorkloadProfileName:           to.Ptr("My-CO-01"),
			},
			OpenTelemetryConfiguration: &armappcontainers.OpenTelemetryConfiguration{
				DestinationsConfiguration: &armappcontainers.DestinationsConfiguration{
					DataDogConfiguration: &armappcontainers.DataDogConfiguration{
						Key:  to.Ptr("000000000000000000000000"),
						Site: to.Ptr("string"),
					},
					OtlpConfigurations: []*armappcontainers.OtlpConfiguration{
						{
							Name:     to.Ptr("dashboard"),
							Endpoint: to.Ptr("dashboard.k8s.region.azurecontainerapps.io:80"),
							Headers: []*armappcontainers.Header{
								{
									Key:   to.Ptr("api-key"),
									Value: to.Ptr("xxxxxxxxxxx"),
								}},
							Insecure: to.Ptr(true),
						}},
				},
				LogsConfiguration: &armappcontainers.LogsConfiguration{
					Destinations: []*string{
						to.Ptr("appInsights")},
				},
				MetricsConfiguration: &armappcontainers.MetricsConfiguration{
					Destinations: []*string{
						to.Ptr("dataDog")},
					IncludeKeda: to.Ptr(true),
				},
				TracesConfiguration: &armappcontainers.TracesConfiguration{
					Destinations: []*string{
						to.Ptr("appInsights")},
					IncludeDapr: to.Ptr(true),
				},
			},
			PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{
				Mtls: &armappcontainers.Mtls{
					Enabled: to.Ptr(true),
				},
			},
			PeerTrafficConfiguration: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfiguration{
				Encryption: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption{
					Enabled: to.Ptr(true),
				},
			},
			VnetConfiguration: &armappcontainers.VnetConfiguration{
				InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
			},
			WorkloadProfiles: []*armappcontainers.WorkloadProfile{
				{
					Name:                to.Ptr("My-GP-01"),
					EnableFips:          to.Ptr(true),
					MaximumCount:        to.Ptr[int32](12),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("GeneralPurpose"),
				},
				{
					Name:                to.Ptr("My-MO-01"),
					MaximumCount:        to.Ptr[int32](6),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("MemoryOptimized"),
				},
				{
					Name:                to.Ptr("My-CO-01"),
					MaximumCount:        to.Ptr[int32](6),
					MinimumCount:        to.Ptr[int32](3),
					WorkloadProfileType: to.Ptr("ComputeOptimized"),
				},
				{
					Name:                to.Ptr("My-consumption-01"),
					WorkloadProfileType: to.Ptr("Consumption"),
				}},
			ZoneRedundant: to.Ptr(true),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %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.ManagedEnvironment = armappcontainers.ManagedEnvironment{
	// 	Name: to.Ptr("testcontainerenv"),
	// 	Type: to.Ptr("Microsoft.App/managedEnvironments"),
	// 	ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv"),
	// 	Location: to.Ptr("East US"),
	// 	Identity: &armappcontainers.ManagedServiceIdentity{
	// 		Type: to.Ptr(armappcontainers.ManagedServiceIdentityType("SystemAssigned, UserAssigned")),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{
	// 			"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armappcontainers.UserAssignedIdentity{
	// 				ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armappcontainers.ManagedEnvironmentProperties{
	// 		AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{
	// 			LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{
	// 				CustomerID: to.Ptr("string"),
	// 				DynamicJSONColumns: to.Ptr(true),
	// 			},
	// 		},
	// 		AvailabilityZones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2"),
	// 			to.Ptr("3")},
	// 			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
	// 				CustomDomainVerificationID: to.Ptr("custom domain verification id"),
	// 				DNSSuffix: to.Ptr("www.my-name.com"),
	// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
	// 				SubjectName: to.Ptr("CN=www.my-name.com"),
	// 				Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
	// 			},
	// 			DefaultDomain: to.Ptr("testcontainerenv.k4apps.io"),
	// 			DiskEncryptionConfiguration: &armappcontainers.DiskEncryptionConfiguration{
	// 				KeyVaultConfiguration: &armappcontainers.DiskEncryptionConfigurationKeyVaultConfiguration{
	// 					Auth: &armappcontainers.DiskEncryptionConfigurationKeyVaultConfigurationAuth{
	// 						Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"),
	// 					},
	// 					KeyURL: to.Ptr("https://contoso.vault.azure.net/mykey/19ff8313ca394b89b9e824bbbdc8c521"),
	// 				},
	// 			},
	// 			EventStreamEndpoint: to.Ptr("testEndpoint"),
	// 			InfrastructureResourceGroup: to.Ptr("capp-svc-testcontainerenv-eastus"),
	// 			IngressConfiguration: &armappcontainers.IngressConfiguration{
	// 				HeaderCountLimit: to.Ptr[int32](30),
	// 				RequestIdleTimeout: to.Ptr[int32](5),
	// 				Scale: &armappcontainers.IngressConfigurationScale{
	// 					MaxReplicas: to.Ptr[int32](4),
	// 					MinReplicas: to.Ptr[int32](2),
	// 				},
	// 				TerminationGracePeriodSeconds: to.Ptr[int32](3600),
	// 				WorkloadProfileName: to.Ptr("My-CO-01"),
	// 			},
	// 			OpenTelemetryConfiguration: &armappcontainers.OpenTelemetryConfiguration{
	// 				DestinationsConfiguration: &armappcontainers.DestinationsConfiguration{
	// 					DataDogConfiguration: &armappcontainers.DataDogConfiguration{
	// 						Site: to.Ptr("datadoghq.com"),
	// 					},
	// 					OtlpConfigurations: []*armappcontainers.OtlpConfiguration{
	// 						{
	// 							Name: to.Ptr("dashboard"),
	// 							Endpoint: to.Ptr("dashboard.k8s.region.azurecontainerapps.io:80"),
	// 							Insecure: to.Ptr(true),
	// 					}},
	// 				},
	// 				LogsConfiguration: &armappcontainers.LogsConfiguration{
	// 					Destinations: []*string{
	// 						to.Ptr("appInsights")},
	// 					},
	// 					MetricsConfiguration: &armappcontainers.MetricsConfiguration{
	// 						Destinations: []*string{
	// 							to.Ptr("dataDog")},
	// 						},
	// 						TracesConfiguration: &armappcontainers.TracesConfiguration{
	// 							Destinations: []*string{
	// 								to.Ptr("appInsights")},
	// 							},
	// 						},
	// 						PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{
	// 							Mtls: &armappcontainers.Mtls{
	// 								Enabled: to.Ptr(true),
	// 							},
	// 						},
	// 						ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
	// 						StaticIP: to.Ptr("1.2.3.4"),
	// 						VnetConfiguration: &armappcontainers.VnetConfiguration{
	// 							InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"),
	// 						},
	// 						WorkloadProfiles: []*armappcontainers.WorkloadProfile{
	// 							{
	// 								Name: to.Ptr("My-GP-01"),
	// 								EnableFips: to.Ptr(true),
	// 								MaximumCount: to.Ptr[int32](12),
	// 								MinimumCount: to.Ptr[int32](3),
	// 								WorkloadProfileType: to.Ptr("GeneralPurpose"),
	// 							},
	// 							{
	// 								Name: to.Ptr("My-MO-01"),
	// 								MaximumCount: to.Ptr[int32](6),
	// 								MinimumCount: to.Ptr[int32](3),
	// 								WorkloadProfileType: to.Ptr("MemoryOptimized"),
	// 							},
	// 							{
	// 								Name: to.Ptr("My-CO-01"),
	// 								MaximumCount: to.Ptr[int32](6),
	// 								MinimumCount: to.Ptr[int32](3),
	// 								WorkloadProfileType: to.Ptr("ComputeOptimized"),
	// 							},
	// 							{
	// 								Name: to.Ptr("My-consumption-01"),
	// 								WorkloadProfileType: to.Ptr("Consumption"),
	// 						}},
	// 						ZoneRedundant: to.Ptr(true),
	// 					},
	// 				}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_Delete.json
func ExampleManagedEnvironmentsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedEnvironmentsClient().BeginDelete(ctx, "examplerg", "examplekenv", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_Patch.json
func ExampleManagedEnvironmentsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewManagedEnvironmentsClient().BeginUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{
		Location: to.Ptr("East US"),
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %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.ManagedEnvironment = armappcontainers.ManagedEnvironment{
	// 	Name: to.Ptr("jlaw-demo1"),
	// 	Type: to.Ptr("Microsoft.App/managedEnvironments"),
	// 	ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Properties: &armappcontainers.ManagedEnvironmentProperties{
	// 		AvailabilityZones: []*string{
	// 			to.Ptr("1"),
	// 			to.Ptr("2"),
	// 			to.Ptr("3")},
	// 			CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{
	// 				CustomDomainVerificationID: to.Ptr("custom domain verification id"),
	// 				DNSSuffix: to.Ptr("www.my-name.com"),
	// 				ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()),
	// 				SubjectName: to.Ptr("CN=www.my-name.com"),
	// 				Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"),
	// 			},
	// 			DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"),
	// 			EventStreamEndpoint: to.Ptr("testEndpoint"),
	// 			InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"),
	// 			ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded),
	// 			StaticIP: to.Ptr("20.42.33.145"),
	// 			WorkloadProfiles: []*armappcontainers.WorkloadProfile{
	// 				{
	// 					Name: to.Ptr("My-GP-01"),
	// 					EnableFips: to.Ptr(true),
	// 					MaximumCount: to.Ptr[int32](12),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("GeneralPurpose"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-MO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("MemoryOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-CO-01"),
	// 					MaximumCount: to.Ptr[int32](6),
	// 					MinimumCount: to.Ptr[int32](3),
	// 					WorkloadProfileType: to.Ptr("ComputeOptimized"),
	// 				},
	// 				{
	// 					Name: to.Ptr("My-consumption-01"),
	// 					WorkloadProfileType: to.Ptr("Consumption"),
	// 			}},
	// 			ZoneRedundant: to.Ptr(true),
	// 		},
	// 	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_GetAuthToken.json
func ExampleManagedEnvironmentsClient_GetAuthToken() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewManagedEnvironmentsClient().GetAuthToken(ctx, "rg", "testenv", 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.EnvironmentAuthToken = armappcontainers.EnvironmentAuthToken{
	// 	Name: to.Ptr("testenv"),
	// 	Type: to.Ptr("Microsoft.App/environments/accesstoken"),
	// 	ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testenv"),
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armappcontainers.EnvironmentAuthTokenProperties{
	// 		Expires: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-14T19:22:50.308Z"); return t}()),
	// 		Token: to.Ptr("testToken"),
	// 	},
	// }
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1d2097f1ed03e8a61eed4fe63602a641bedd77ae/specification/app/resource-manager/Microsoft.App/ContainerApps/preview/2025-02-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json
func ExampleManagedEnvironmentsClient_NewListWorkloadProfileStatesPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armappcontainers.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewManagedEnvironmentsClient().NewListWorkloadProfileStatesPager("examplerg", "jlaw-demo1", 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.WorkloadProfileStatesCollection = armappcontainers.WorkloadProfileStatesCollection{
		// 	Value: []*armappcontainers.WorkloadProfileStates{
		// 		{
		// 			Name: to.Ptr("GP1"),
		// 			Type: to.Ptr("/providers/Microsoft.App/workloadProfileStates"),
		// 			ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/workloadProfileStates/GP1"),
		// 			Properties: &armappcontainers.WorkloadProfileStatesProperties{
		// 				CurrentCount: to.Ptr[int32](3),
		// 				MaximumCount: to.Ptr[int32](10),
		// 				MinimumCount: to.Ptr[int32](3),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("MO3"),
		// 			Type: to.Ptr("/providers/Microsoft.App/workloadProfileStates"),
		// 			ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/workloadProfileStates/MO3"),
		// 			Properties: &armappcontainers.WorkloadProfileStatesProperties{
		// 				CurrentCount: to.Ptr[int32](0),
		// 				MaximumCount: to.Ptr[int32](2),
		// 				MinimumCount: to.Ptr[int32](0),
		// 			},
		// 	}},
		// }
	}
}
