// 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 armazurestackhci_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci/v3"
	"log"
)

// Generated from example definition: 2026-04-30/PutExtension.json
func ExampleExtensionsClient_BeginCreate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewExtensionsClient().BeginCreate(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", armazurestackhci.Extension{
		Properties: &armazurestackhci.ExtensionProperties{
			ExtensionParameters: &armazurestackhci.ExtensionParameters{
				Type:                   to.Ptr("MicrosoftMonitoringAgent"),
				EnableAutomaticUpgrade: to.Ptr(false),
				ProtectedSettings: map[string]any{
					"workspaceKey": "xx",
				},
				Publisher: to.Ptr("Microsoft.Compute"),
				Settings: map[string]any{
					"workspaceId": "xx",
				},
				TypeHandlerVersion: to.Ptr("1.10"),
			},
		},
	}, 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 poll 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 = armazurestackhci.ExtensionsClientCreateResponse{
	// 	Extension: armazurestackhci.Extension{
	// 		Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 		Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"),
	// 		ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"),
	// 		Properties: &armazurestackhci.ExtensionProperties{
	// 			AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded),
	// 			ExtensionParameters: &armazurestackhci.ExtensionParameters{
	// 				Type: to.Ptr("string"),
	// 				AutoUpgradeMinorVersion: to.Ptr(false),
	// 				EnableAutomaticUpgrade: to.Ptr(false),
	// 				Publisher: to.Ptr("Microsoft.Compute"),
	// 				Settings: map[string]any{
	// 					"workspaceId": "xx",
	// 				},
	// 				TypeHandlerVersion: to.Ptr("1.10.3"),
	// 			},
	// 			ManagedBy: to.Ptr(armazurestackhci.ExtensionManagedByUser),
	// 			PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{
	// 				{
	// 					Name: to.Ptr("Node-1"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("success"),
	// 							DisplayStatus: to.Ptr("Provisioning succeeded"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypes("Information")),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.0"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded),
	// 					TypeHandlerVersion: to.Ptr("1.10.0"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Node-2"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("error"),
	// 							DisplayStatus: to.Ptr("Provisioning failed"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypesError),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.3"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateFailed),
	// 					TypeHandlerVersion: to.Ptr("1.10.3"),
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded),
	// 		},
	// 		SystemData: &armazurestackhci.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-04-30/DeleteExtension.json
func ExampleExtensionsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", 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 poll 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 = armazurestackhci.ExtensionsClientDeleteResponse{
	// }
}

// Generated from example definition: 2026-04-30/GetExtension.json
func ExampleExtensionsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewExtensionsClient().Get(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", 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 = armazurestackhci.ExtensionsClientGetResponse{
	// 	Extension: armazurestackhci.Extension{
	// 		Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 		Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"),
	// 		ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"),
	// 		Properties: &armazurestackhci.ExtensionProperties{
	// 			AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded),
	// 			ExtensionParameters: &armazurestackhci.ExtensionParameters{
	// 				Type: to.Ptr("string"),
	// 				AutoUpgradeMinorVersion: to.Ptr(false),
	// 				EnableAutomaticUpgrade: to.Ptr(true),
	// 				Publisher: to.Ptr("Microsoft.Compute"),
	// 				Settings: map[string]any{
	// 					"workspaceId": "xx",
	// 				},
	// 				TypeHandlerVersion: to.Ptr("1.10.3"),
	// 			},
	// 			ManagedBy: to.Ptr(armazurestackhci.ExtensionManagedByAzure),
	// 			PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{
	// 				{
	// 					Name: to.Ptr("Node-1"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("success"),
	// 							DisplayStatus: to.Ptr("Provisioning succeeded"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypes("Information")),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.0"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded),
	// 					TypeHandlerVersion: to.Ptr("1.10.0"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Node-2"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("error"),
	// 							DisplayStatus: to.Ptr("Provisioning failed"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypesError),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.3"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateFailed),
	// 					TypeHandlerVersion: to.Ptr("1.10.3"),
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded),
	// 		},
	// 		SystemData: &armazurestackhci.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-04-30/ListExtensionsByArcSetting.json
func ExampleExtensionsClient_NewListByArcSettingPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewExtensionsClient().NewListByArcSettingPager("test-rg", "myCluster", "default", 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 = armazurestackhci.ExtensionsClientListByArcSettingResponse{
		// 	ExtensionList: armazurestackhci.ExtensionList{
		// 		Value: []*armazurestackhci.Extension{
		// 			{
		// 				Name: to.Ptr("MicrosoftMonitoringAgent"),
		// 				Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"),
		// 				ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"),
		// 				Properties: &armazurestackhci.ExtensionProperties{
		// 					AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallyConnected),
		// 					ExtensionParameters: &armazurestackhci.ExtensionParameters{
		// 						Type: to.Ptr("string"),
		// 						AutoUpgradeMinorVersion: to.Ptr(false),
		// 						Publisher: to.Ptr("Microsoft.Compute"),
		// 						Settings: map[string]any{
		// 							"workspaceId": "xx",
		// 						},
		// 						TypeHandlerVersion: to.Ptr("1.10.3"),
		// 					},
		// 					ManagedBy: to.Ptr(armazurestackhci.ExtensionManagedByAzure),
		// 					PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{
		// 						{
		// 							Name: to.Ptr("Node-1"),
		// 							Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"),
		// 							State: to.Ptr(armazurestackhci.NodeExtensionStateConnected),
		// 						},
		// 						{
		// 							Name: to.Ptr("Node-2"),
		// 							Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"),
		// 							State: to.Ptr(armazurestackhci.NodeExtensionStateDisconnected),
		// 						},
		// 					},
		// 					ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded),
		// 				},
		// 				SystemData: &armazurestackhci.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("CustomScriptExtension"),
		// 				Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"),
		// 				ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/Extensions/SecurityExtension"),
		// 				Properties: &armazurestackhci.ExtensionProperties{
		// 					AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallySucceeded),
		// 					ExtensionParameters: &armazurestackhci.ExtensionParameters{
		// 						Type: to.Ptr("string"),
		// 						AutoUpgradeMinorVersion: to.Ptr(false),
		// 						Publisher: to.Ptr("Microsoft.CustomScriptExtension"),
		// 						Settings: map[string]any{
		// 							"scriptLocation": "xx",
		// 						},
		// 						TypeHandlerVersion: to.Ptr("1.10.3"),
		// 					},
		// 					ManagedBy: to.Ptr(armazurestackhci.ExtensionManagedByAzure),
		// 					PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{
		// 						{
		// 							Name: to.Ptr("Node-1"),
		// 							Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/SecurityExtension"),
		// 							State: to.Ptr(armazurestackhci.NodeExtensionStateSucceeded),
		// 						},
		// 						{
		// 							Name: to.Ptr("Node-2"),
		// 							Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/SecurityExtension"),
		// 							State: to.Ptr(armazurestackhci.NodeExtensionStateFailed),
		// 						},
		// 					},
		// 					ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded),
		// 				},
		// 				SystemData: &armazurestackhci.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()),
		// 					CreatedBy: to.Ptr("user1"),
		// 					CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user2"),
		// 					LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-04-30/PatchExtension.json
func ExampleExtensionsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewExtensionsClient().BeginUpdate(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", armazurestackhci.ExtensionPatch{
		Properties: &armazurestackhci.ExtensionPatchProperties{
			ExtensionParameters: &armazurestackhci.ExtensionPatchParameters{
				EnableAutomaticUpgrade: to.Ptr(false),
				ProtectedSettings: map[string]any{
					"workspaceKey": "xx",
				},
				Settings: map[string]any{
					"workspaceId": "xx",
				},
				TypeHandlerVersion: to.Ptr("1.10"),
			},
		},
	}, 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 poll 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 = armazurestackhci.ExtensionsClientUpdateResponse{
	// 	Extension: armazurestackhci.Extension{
	// 		Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 		Type: to.Ptr("Microsoft.AzureStackHCI/clusters/arcSettings/extensions"),
	// 		ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/clusters/myCluster/arcSettings/default/extensions/MicrosoftMonitoringAgent"),
	// 		Properties: &armazurestackhci.ExtensionProperties{
	// 			AggregateState: to.Ptr(armazurestackhci.ExtensionAggregateStatePartiallyConnected),
	// 			ExtensionParameters: &armazurestackhci.ExtensionParameters{
	// 				Type: to.Ptr("string"),
	// 				AutoUpgradeMinorVersion: to.Ptr(false),
	// 				EnableAutomaticUpgrade: to.Ptr(false),
	// 				Publisher: to.Ptr("Microsoft.Compute"),
	// 				Settings: map[string]any{
	// 					"workspaceId": "xx",
	// 				},
	// 				TypeHandlerVersion: to.Ptr("1.10"),
	// 			},
	// 			ManagedBy: to.Ptr(armazurestackhci.ExtensionManagedByUser),
	// 			PerNodeExtensionDetails: []*armazurestackhci.PerNodeExtensionState{
	// 				{
	// 					Name: to.Ptr("Node-1"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("success"),
	// 							DisplayStatus: to.Ptr("Provisioning succeeded"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypes("Information")),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.0"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateConnected),
	// 					TypeHandlerVersion: to.Ptr("1.10.0"),
	// 				},
	// 				{
	// 					Name: to.Ptr("Node-2"),
	// 					Extension: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/Extensions/MicrosoftMonitoringAgent"),
	// 					InstanceView: &armazurestackhci.ExtensionInstanceView{
	// 						Name: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Type: to.Ptr("MicrosoftMonitoringAgent"),
	// 						Status: &armazurestackhci.ExtensionInstanceViewStatus{
	// 							Code: to.Ptr("error"),
	// 							DisplayStatus: to.Ptr("Provisioning failed"),
	// 							Level: to.Ptr(armazurestackhci.StatusLevelTypesError),
	// 							Message: to.Ptr("Finished executing command, StdOut: , StdErr:"),
	// 							Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-08T20:42:10.999Z"); return t}()),
	// 						},
	// 						TypeHandlerVersion: to.Ptr("1.10.3"),
	// 					},
	// 					State: to.Ptr(armazurestackhci.NodeExtensionStateDisconnected),
	// 					TypeHandlerVersion: to.Ptr("1.10.3"),
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateSucceeded),
	// 		},
	// 		SystemData: &armazurestackhci.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-01T17:18:19.1234567Z"); return t}()),
	// 			CreatedBy: to.Ptr("user1"),
	// 			CreatedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-02T17:18:19.1234567Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user2"),
	// 			LastModifiedByType: to.Ptr(armazurestackhci.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-04-30/Extensions_Upgrade.json
func ExampleExtensionsClient_BeginUpgrade() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armazurestackhci.NewClientFactory("fd3c3665-1729-4b7b-9a38-238e83b0f98b", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewExtensionsClient().BeginUpgrade(ctx, "test-rg", "myCluster", "default", "MicrosoftMonitoringAgent", armazurestackhci.ExtensionUpgradeParameters{
		TargetVersion: to.Ptr("1.0.18062.0"),
	}, 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 poll the result: %v", err)
	}
}
