//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 armmigrationassessment_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/migrationassessment/armmigrationassessment"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dd668996bc8ba729784c02c7a99b6b0042612bb3/specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-01-01-preview/examples/MachinesOperations_ListByAssessmentProject_MaximumSet_Gen.json
func ExampleMachinesOperationsClient_NewListByAssessmentProjectPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmigrationassessment.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewMachinesOperationsClient().NewListByAssessmentProjectPager("ayagrawrg", "app18700project", &armmigrationassessment.MachinesOperationsClientListByAssessmentProjectOptions{Filter: nil,
		PageSize:          to.Ptr[int32](1),
		ContinuationToken: nil,
		TotalRecordCount:  to.Ptr[int32](1),
	})
	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.MachineListResult = armmigrationassessment.MachineListResult{
		// 	Value: []*armmigrationassessment.Machine{
		// 		{
		// 			Name: to.Ptr("55082b89-99e2-4c40-b63f-d4f4d6ba961d"),
		// 			Type: to.Ptr("Microsoft.Migrate/assessmentprojects/machines"),
		// 			ID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/machines/55082b89-99e2-4c40-b63f-d4f4d6ba961d"),
		// 			SystemData: &armmigrationassessment.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()),
		// 			},
		// 			Properties: &armmigrationassessment.MachineProperties{
		// 				Description: to.Ptr(""),
		// 				BootType: to.Ptr(armmigrationassessment.MachineBootTypeBios),
		// 				CreatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T14:31:19.465Z"); return t}()),
		// 				DatacenterManagementServerArmID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/app48697site/vcenters/idclab-vcen65-fareast-corp-micr-7071f35f-082c-4333-9ca9-3fdd5254db17"),
		// 				DatacenterManagementServerName: to.Ptr("idclab-vcen65.fareast.corp.microsoft.com"),
		// 				DiscoveryMachineArmID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawrg/providers/microsoft.offazure/vmwaresites/app48697site/machines/idclab-vcen65-fareast-corp-micr-7071f35f-082c-4333-9ca9-3fdd5254db17_50379cec-8534-dcd7-0c7e-b16f6572bf94"),
		// 				Disks: map[string]*armmigrationassessment.Disk{
		// 					"6000C295-4e9d-4322-6690-aff91beffb82": &armmigrationassessment.Disk{
		// 						DisplayName: to.Ptr("scsi0:2"),
		// 						GigabytesAllocated: to.Ptr[float32](50),
		// 					},
		// 					"6000C297-a876-f49f-c202-0289620d5223": &armmigrationassessment.Disk{
		// 						DisplayName: to.Ptr("scsi0:1"),
		// 						GigabytesAllocated: to.Ptr[float32](250),
		// 					},
		// 					"6000C29d-4e28-24a9-eaee-02fa5a17dadf": &armmigrationassessment.Disk{
		// 						DisplayName: to.Ptr("scsi0:0"),
		// 						GigabytesAllocated: to.Ptr[float32](150),
		// 					},
		// 				},
		// 				DisplayName: to.Ptr("a410-r1w12r2-7"),
		// 				Errors: []*armmigrationassessment.Error{
		// 				},
		// 				Groups: []*string{
		// 					to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/groups/azure-vmwaresolution-ame-15389"),
		// 					to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/groups/rajoshtest")},
		// 					MegabytesOfMemory: to.Ptr[float32](30720),
		// 					NetworkAdapters: map[string]*armmigrationassessment.NetworkAdapter{
		// 						"4000": &armmigrationassessment.NetworkAdapter{
		// 							DisplayName: to.Ptr("VM Network"),
		// 							IPAddresses: []*string{
		// 							},
		// 							MacAddress: to.Ptr("00:50:56:b7:04:06"),
		// 						},
		// 					},
		// 					NumberOfCores: to.Ptr[int32](8),
		// 					OperatingSystemName: to.Ptr("Microsoft Windows Server 2012 (64-bit)"),
		// 					OperatingSystemType: to.Ptr("windowsGuest"),
		// 					ProductSupportStatus: &armmigrationassessment.ProductSupportStatus{
		// 						CurrentEsuYear: to.Ptr("Unknown"),
		// 						EsuStatus: to.Ptr("Unknown"),
		// 						Eta: to.Ptr[int32](0),
		// 						ExtendedSecurityUpdateYear1EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-08T00:00:00.000Z"); return t}()),
		// 						ExtendedSecurityUpdateYear2EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-14T00:00:00.000Z"); return t}()),
		// 						ExtendedSecurityUpdateYear3EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-10-13T00:00:00.000Z"); return t}()),
		// 						ExtendedSupportEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T00:00:00.000Z"); return t}()),
		// 						MainstreamEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-09T00:00:00.000Z"); return t}()),
		// 						ServicePackStatus: to.Ptr("Unknown"),
		// 						SupportStatus: to.Ptr("Extended"),
		// 					},
		// 					SQLInstances: []*string{
		// 					},
		// 					UpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-03T16:22:11.261Z"); return t}()),
		// 					WebApplications: []*string{
		// 					},
		// 					WorkloadSummary: &armmigrationassessment.WorkloadSummary{
		// 						OracleInstances: to.Ptr[int32](0),
		// 						SpringApps: to.Ptr[int32](0),
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dd668996bc8ba729784c02c7a99b6b0042612bb3/specification/migrate/resource-manager/Microsoft.Migrate/AssessmentProjects/preview/2024-01-01-preview/examples/MachinesOperations_Get_MaximumSet_Gen.json
func ExampleMachinesOperationsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmigrationassessment.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewMachinesOperationsClient().Get(ctx, "ayagrawrg", "app18700project", "55082b89-99e2-4c40-b63f-d4f4d6ba961d", 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.Machine = armmigrationassessment.Machine{
	// 	Name: to.Ptr("55082b89-99e2-4c40-b63f-d4f4d6ba961d"),
	// 	Type: to.Ptr("Microsoft.Migrate/assessmentprojects/machines"),
	// 	ID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/machines/55082b89-99e2-4c40-b63f-d4f4d6ba961d"),
	// 	SystemData: &armmigrationassessment.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0-12-31T15:54:17.000Z"); return t}()),
	// 	},
	// 	Properties: &armmigrationassessment.MachineProperties{
	// 		Description: to.Ptr(""),
	// 		BootType: to.Ptr(armmigrationassessment.MachineBootTypeBios),
	// 		CreatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T14:31:19.465Z"); return t}()),
	// 		DatacenterManagementServerArmID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawRG/providers/Microsoft.OffAzure/VMwareSites/app48697site/vcenters/idclab-vcen65-fareast-corp-micr-7071f35f-082c-4333-9ca9-3fdd5254db17"),
	// 		DatacenterManagementServerName: to.Ptr("idclab-vcen65.fareast.corp.microsoft.com"),
	// 		DiscoveryMachineArmID: to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourcegroups/ayagrawrg/providers/microsoft.offazure/vmwaresites/app48697site/machines/idclab-vcen65-fareast-corp-micr-7071f35f-082c-4333-9ca9-3fdd5254db17_50379cec-8534-dcd7-0c7e-b16f6572bf94"),
	// 		Disks: map[string]*armmigrationassessment.Disk{
	// 			"6000C295-4e9d-4322-6690-aff91beffb82": &armmigrationassessment.Disk{
	// 				DisplayName: to.Ptr("scsi0:2"),
	// 				GigabytesAllocated: to.Ptr[float32](50),
	// 			},
	// 			"6000C297-a876-f49f-c202-0289620d5223": &armmigrationassessment.Disk{
	// 				DisplayName: to.Ptr("scsi0:1"),
	// 				GigabytesAllocated: to.Ptr[float32](250),
	// 			},
	// 			"6000C29d-4e28-24a9-eaee-02fa5a17dadf": &armmigrationassessment.Disk{
	// 				DisplayName: to.Ptr("scsi0:0"),
	// 				GigabytesAllocated: to.Ptr[float32](150),
	// 			},
	// 		},
	// 		DisplayName: to.Ptr("a410-r1w12r2-7"),
	// 		Errors: []*armmigrationassessment.Error{
	// 		},
	// 		Groups: []*string{
	// 			to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/groups/azure-vmwaresolution-ame-15389"),
	// 			to.Ptr("/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/ayagrawrg/providers/Microsoft.Migrate/assessmentprojects/app18700project/groups/rajoshtest")},
	// 			MegabytesOfMemory: to.Ptr[float32](30720),
	// 			NetworkAdapters: map[string]*armmigrationassessment.NetworkAdapter{
	// 				"4000": &armmigrationassessment.NetworkAdapter{
	// 					DisplayName: to.Ptr("VM Network"),
	// 					IPAddresses: []*string{
	// 					},
	// 					MacAddress: to.Ptr("00:50:56:b7:04:06"),
	// 				},
	// 			},
	// 			NumberOfCores: to.Ptr[int32](8),
	// 			OperatingSystemName: to.Ptr("Microsoft Windows Server 2012 (64-bit)"),
	// 			OperatingSystemType: to.Ptr("windowsGuest"),
	// 			ProductSupportStatus: &armmigrationassessment.ProductSupportStatus{
	// 				CurrentEsuYear: to.Ptr("Unknown"),
	// 				EsuStatus: to.Ptr("Unknown"),
	// 				Eta: to.Ptr[int32](0),
	// 				ExtendedSecurityUpdateYear1EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-08T00:00:00.000Z"); return t}()),
	// 				ExtendedSecurityUpdateYear2EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-10-14T00:00:00.000Z"); return t}()),
	// 				ExtendedSecurityUpdateYear3EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2026-10-13T00:00:00.000Z"); return t}()),
	// 				ExtendedSupportEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-10-10T00:00:00.000Z"); return t}()),
	// 				MainstreamEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-09T00:00:00.000Z"); return t}()),
	// 				ServicePackStatus: to.Ptr("Unknown"),
	// 				SupportStatus: to.Ptr("Extended"),
	// 			},
	// 			SQLInstances: []*string{
	// 			},
	// 			UpdatedTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-03T16:22:11.261Z"); return t}()),
	// 			WebApplications: []*string{
	// 			},
	// 			WorkloadSummary: &armmigrationassessment.WorkloadSummary{
	// 				OracleInstances: to.Ptr[int32](0),
	// 				SpringApps: to.Ptr[int32](0),
	// 			},
	// 		},
	// 	}
}
