// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.

package armcontainerinstance_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v3"
	"log"
)

// Generated from example definition: 2025-09-01/ContainerGroupProfilesListByResourceGroup.json
func ExampleCGProfilesClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerinstance.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCGProfilesClient().NewListByResourceGroupPager("demo", 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 = armcontainerinstance.CGProfilesClientListByResourceGroupResponse{
		// 	ContainerGroupProfileListResult: armcontainerinstance.ContainerGroupProfileListResult{
		// 		Value: []*armcontainerinstance.ContainerGroupProfile{
		// 			{
		// 				Name: to.Ptr("demo1"),
		// 				Type: to.Ptr("Microsoft.ContainerInstance/containerGroupProfiles"),
		// 				ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1"),
		// 				Location: to.Ptr("WestUs"),
		// 				Properties: &armcontainerinstance.ContainerGroupProfileProperties{
		// 					Containers: []*armcontainerinstance.Container{
		// 						{
		// 							Name: to.Ptr("demo1"),
		// 							Properties: &armcontainerinstance.ContainerProperties{
		// 								Command: []*string{
		// 								},
		// 								EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
		// 								},
		// 								Image: to.Ptr("nginx"),
		// 								Ports: []*armcontainerinstance.ContainerPort{
		// 									{
		// 										Port: to.Ptr[int32](80),
		// 									},
		// 								},
		// 								Resources: &armcontainerinstance.ResourceRequirements{
		// 									Requests: &armcontainerinstance.ResourceRequests{
		// 										CPU: to.Ptr[float64](1),
		// 										MemoryInGB: to.Ptr[float64](1.5),
		// 									},
		// 								},
		// 								VolumeMounts: []*armcontainerinstance.VolumeMount{
		// 									{
		// 										Name: to.Ptr("volume1"),
		// 										MountPath: to.Ptr("/mnt/volume1"),
		// 										ReadOnly: to.Ptr(false),
		// 									},
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
		// 						{
		// 							Server: to.Ptr("azcloudconsoleregistry.azurecr.io"),
		// 							Username: to.Ptr("azcloudconsoleregistry"),
		// 						},
		// 					},
		// 					IPAddress: &armcontainerinstance.IPAddress{
		// 						Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
		// 						IP: to.Ptr("10.0.0.1"),
		// 						Ports: []*armcontainerinstance.Port{
		// 							{
		// 								Port: to.Ptr[int32](80),
		// 								Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
		// 							},
		// 						},
		// 					},
		// 					OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
		// 					Revision: to.Ptr[int32](1),
		// 					SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
		// 					Volumes: []*armcontainerinstance.Volume{
		// 						{
		// 							Name: to.Ptr("volume1"),
		// 							AzureFile: &armcontainerinstance.AzureFileVolume{
		// 								ReadOnly: to.Ptr(false),
		// 								ShareName: to.Ptr("share1"),
		// 								StorageAccountName: to.Ptr("storage1"),
		// 							},
		// 						},
		// 					},
		// 				},
		// 				Zones: []*string{
		// 					to.Ptr("1"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-09-01/ContainerGroupProfilesList.json
func ExampleCGProfilesClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerinstance.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCGProfilesClient().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 = armcontainerinstance.CGProfilesClientListBySubscriptionResponse{
		// 	ContainerGroupProfileListResult: armcontainerinstance.ContainerGroupProfileListResult{
		// 		Value: []*armcontainerinstance.ContainerGroupProfile{
		// 			{
		// 				Name: to.Ptr("demo1"),
		// 				Type: to.Ptr("Microsoft.ContainerInstance/containerGroupProfiles"),
		// 				ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroupProfiles/demo1"),
		// 				Location: to.Ptr("WestUs"),
		// 				Properties: &armcontainerinstance.ContainerGroupProfileProperties{
		// 					Containers: []*armcontainerinstance.Container{
		// 						{
		// 							Name: to.Ptr("demo1"),
		// 							Properties: &armcontainerinstance.ContainerProperties{
		// 								Command: []*string{
		// 								},
		// 								EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{
		// 								},
		// 								Image: to.Ptr("nginx"),
		// 								Ports: []*armcontainerinstance.ContainerPort{
		// 									{
		// 										Port: to.Ptr[int32](80),
		// 									},
		// 								},
		// 								Resources: &armcontainerinstance.ResourceRequirements{
		// 									Requests: &armcontainerinstance.ResourceRequests{
		// 										CPU: to.Ptr[float64](1),
		// 										MemoryInGB: to.Ptr[float64](1.5),
		// 									},
		// 								},
		// 								VolumeMounts: []*armcontainerinstance.VolumeMount{
		// 									{
		// 										Name: to.Ptr("volume1"),
		// 										MountPath: to.Ptr("/mnt/volume1"),
		// 										ReadOnly: to.Ptr(false),
		// 									},
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{
		// 						{
		// 							Server: to.Ptr("azcloudconsoleregistry.azurecr.io"),
		// 							Username: to.Ptr("azcloudconsoleregistry"),
		// 						},
		// 					},
		// 					IPAddress: &armcontainerinstance.IPAddress{
		// 						Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic),
		// 						IP: to.Ptr("10.0.0.1"),
		// 						Ports: []*armcontainerinstance.Port{
		// 							{
		// 								Port: to.Ptr[int32](80),
		// 								Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP),
		// 							},
		// 						},
		// 					},
		// 					OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux),
		// 					Revision: to.Ptr[int32](1),
		// 					SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard),
		// 					Volumes: []*armcontainerinstance.Volume{
		// 						{
		// 							Name: to.Ptr("volume1"),
		// 							AzureFile: &armcontainerinstance.AzureFileVolume{
		// 								ReadOnly: to.Ptr(false),
		// 								ShareName: to.Ptr("share1"),
		// 								StorageAccountName: to.Ptr("storage1"),
		// 							},
		// 						},
		// 					},
		// 				},
		// 				Zones: []*string{
		// 					to.Ptr("1"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
