// 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 armworkloadorchestration_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/workloadorchestration/armworkloadorchestration"
	"log"
)

// Generated from example definition: 2025-06-01/SolutionVersions_CreateOrUpdate_MaximumSet_Gen.json
func ExampleSolutionVersionsClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armworkloadorchestration.NewClientFactory("9D54FE4C-00AF-4836-8F48-B6A9C4E47192", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionVersionsClient().BeginCreateOrUpdate(ctx, "rgconfigurationmanager", "testname", "testname", "testname", armworkloadorchestration.SolutionVersion{
		Properties: &armworkloadorchestration.SolutionVersionProperties{
			Specification: map[string]any{},
			State:         to.Ptr(armworkloadorchestration.StateInReview),
			ErrorDetails:  &armworkloadorchestration.ErrorDetail{},
		},
		ExtendedLocation: &armworkloadorchestration.ExtendedLocation{
			Name: to.Ptr("szjrwimeqyiue"),
			Type: to.Ptr(armworkloadorchestration.ExtendedLocationTypeEdgeZone),
		},
	}, 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 = armworkloadorchestration.SolutionVersionsClientCreateOrUpdateResponse{
	// 	SolutionVersion: armworkloadorchestration.SolutionVersion{
	// 		Properties: &armworkloadorchestration.SolutionVersionProperties{
	// 			SolutionTemplateVersionID: to.Ptr("ykgyybnfeqxcz"),
	// 			Revision: to.Ptr[int32](17),
	// 			TargetDisplayName: to.Ptr("phndhpa"),
	// 			Configuration: to.Ptr("qg"),
	// 			TargetLevelConfiguration: to.Ptr("t"),
	// 			Specification: map[string]any{
	// 			},
	// 			ReviewID: to.Ptr("bcnlj"),
	// 			ExternalValidationID: to.Ptr("yxabw"),
	// 			State: to.Ptr(armworkloadorchestration.StateInReview),
	// 			SolutionInstanceName: to.Ptr("testname"),
	// 			SolutionDependencies: []*armworkloadorchestration.SolutionDependency{
	// 				{
	// 					SolutionVersionID: to.Ptr("jtyhpdivvfbf"),
	// 					SolutionInstanceName: to.Ptr("testname"),
	// 					SolutionTemplateVersionID: to.Ptr("zoagjfizf"),
	// 					TargetID: to.Ptr("qcbujg"),
	// 					Dependencies: []*armworkloadorchestration.SolutionDependency{
	// 					},
	// 				},
	// 			},
	// 			ErrorDetails: &armworkloadorchestration.ErrorDetail{
	// 				Code: to.Ptr("lzmwkzmn"),
	// 				Message: to.Ptr("zjdfzawocrbkgawgampjjulgesr"),
	// 				Target: to.Ptr("rncdbnknqkhjwqzkqqit"),
	// 				Details: []*armworkloadorchestration.ErrorDetail{
	// 				},
	// 				AdditionalInfo: []*armworkloadorchestration.ErrorAdditionalInfo{
	// 					{
	// 						Type: to.Ptr("betjppbcspfewqw"),
	// 						Info: map[string]any{
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armworkloadorchestration.ProvisioningStateSucceeded),
	// 		},
	// 		ExtendedLocation: &armworkloadorchestration.ExtendedLocation{
	// 			Name: to.Ptr("szjrwimeqyiue"),
	// 			Type: to.Ptr(armworkloadorchestration.ExtendedLocationTypeEdgeZone),
	// 		},
	// 		ETag: to.Ptr("btoclmueznpoouhnxqlboavqnsztrz"),
	// 		ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"),
	// 		Name: to.Ptr("lk"),
	// 		Type: to.Ptr("czkgymlhmhlxxpbgcmhstxwtczthq"),
	// 		SystemData: &armworkloadorchestration.SystemData{
	// 			CreatedBy: to.Ptr("nvjczgdguyvllp"),
	// 			CreatedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("uzbznzjgvaspvtqhyg"),
	// 			LastModifiedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-06-01/SolutionVersions_Delete_MaximumSet_Gen.json
func ExampleSolutionVersionsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armworkloadorchestration.NewClientFactory("9D54FE4C-00AF-4836-8F48-B6A9C4E47192", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionVersionsClient().BeginDelete(ctx, "rgconfigurationmanager", "testname", "testname", "testname", 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)
	}
}

// Generated from example definition: 2025-06-01/SolutionVersions_Get_MaximumSet_Gen.json
func ExampleSolutionVersionsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armworkloadorchestration.NewClientFactory("9D54FE4C-00AF-4836-8F48-B6A9C4E47192", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewSolutionVersionsClient().Get(ctx, "rgconfigurationmanager", "testname", "testname", "testname", 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 = armworkloadorchestration.SolutionVersionsClientGetResponse{
	// 	SolutionVersion: armworkloadorchestration.SolutionVersion{
	// 		Properties: &armworkloadorchestration.SolutionVersionProperties{
	// 			SolutionTemplateVersionID: to.Ptr("ykgyybnfeqxcz"),
	// 			Revision: to.Ptr[int32](17),
	// 			TargetDisplayName: to.Ptr("phndhpa"),
	// 			Configuration: to.Ptr("qg"),
	// 			TargetLevelConfiguration: to.Ptr("t"),
	// 			Specification: map[string]any{
	// 			},
	// 			ReviewID: to.Ptr("bcnlj"),
	// 			ExternalValidationID: to.Ptr("yxabw"),
	// 			State: to.Ptr(armworkloadorchestration.StateInReview),
	// 			SolutionInstanceName: to.Ptr("testname"),
	// 			SolutionDependencies: []*armworkloadorchestration.SolutionDependency{
	// 				{
	// 					SolutionVersionID: to.Ptr("jtyhpdivvfbf"),
	// 					SolutionInstanceName: to.Ptr("testname"),
	// 					SolutionTemplateVersionID: to.Ptr("zoagjfizf"),
	// 					TargetID: to.Ptr("qcbujg"),
	// 					Dependencies: []*armworkloadorchestration.SolutionDependency{
	// 					},
	// 				},
	// 			},
	// 			ErrorDetails: &armworkloadorchestration.ErrorDetail{
	// 				Code: to.Ptr("lzmwkzmn"),
	// 				Message: to.Ptr("zjdfzawocrbkgawgampjjulgesr"),
	// 				Target: to.Ptr("rncdbnknqkhjwqzkqqit"),
	// 				Details: []*armworkloadorchestration.ErrorDetail{
	// 				},
	// 				AdditionalInfo: []*armworkloadorchestration.ErrorAdditionalInfo{
	// 					{
	// 						Type: to.Ptr("betjppbcspfewqw"),
	// 						Info: map[string]any{
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armworkloadorchestration.ProvisioningStateSucceeded),
	// 		},
	// 		ExtendedLocation: &armworkloadorchestration.ExtendedLocation{
	// 			Name: to.Ptr("szjrwimeqyiue"),
	// 			Type: to.Ptr(armworkloadorchestration.ExtendedLocationTypeEdgeZone),
	// 		},
	// 		ETag: to.Ptr("btoclmueznpoouhnxqlboavqnsztrz"),
	// 		ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"),
	// 		Name: to.Ptr("lk"),
	// 		Type: to.Ptr("czkgymlhmhlxxpbgcmhstxwtczthq"),
	// 		SystemData: &armworkloadorchestration.SystemData{
	// 			CreatedBy: to.Ptr("nvjczgdguyvllp"),
	// 			CreatedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("uzbznzjgvaspvtqhyg"),
	// 			LastModifiedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-06-01/SolutionVersions_ListBySolution_MaximumSet_Gen.json
func ExampleSolutionVersionsClient_NewListBySolutionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armworkloadorchestration.NewClientFactory("9D54FE4C-00AF-4836-8F48-B6A9C4E47192", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewSolutionVersionsClient().NewListBySolutionPager("rgconfigurationmanager", "testname", "testname", 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 = armworkloadorchestration.SolutionVersionsClientListBySolutionResponse{
		// 	SolutionVersionListResult: armworkloadorchestration.SolutionVersionListResult{
		// 		Value: []*armworkloadorchestration.SolutionVersion{
		// 			{
		// 				Properties: &armworkloadorchestration.SolutionVersionProperties{
		// 					SolutionTemplateVersionID: to.Ptr("ykgyybnfeqxcz"),
		// 					Revision: to.Ptr[int32](17),
		// 					TargetDisplayName: to.Ptr("phndhpa"),
		// 					Configuration: to.Ptr("qg"),
		// 					TargetLevelConfiguration: to.Ptr("t"),
		// 					Specification: map[string]any{
		// 					},
		// 					ReviewID: to.Ptr("bcnlj"),
		// 					ExternalValidationID: to.Ptr("yxabw"),
		// 					State: to.Ptr(armworkloadorchestration.StateInReview),
		// 					SolutionInstanceName: to.Ptr("testname"),
		// 					SolutionDependencies: []*armworkloadorchestration.SolutionDependency{
		// 						{
		// 							SolutionVersionID: to.Ptr("jtyhpdivvfbf"),
		// 							SolutionInstanceName: to.Ptr("testname"),
		// 							SolutionTemplateVersionID: to.Ptr("zoagjfizf"),
		// 							TargetID: to.Ptr("qcbujg"),
		// 							Dependencies: []*armworkloadorchestration.SolutionDependency{
		// 							},
		// 						},
		// 					},
		// 					ErrorDetails: &armworkloadorchestration.ErrorDetail{
		// 						Code: to.Ptr("lzmwkzmn"),
		// 						Message: to.Ptr("zjdfzawocrbkgawgampjjulgesr"),
		// 						Target: to.Ptr("rncdbnknqkhjwqzkqqit"),
		// 						Details: []*armworkloadorchestration.ErrorDetail{
		// 						},
		// 						AdditionalInfo: []*armworkloadorchestration.ErrorAdditionalInfo{
		// 							{
		// 								Type: to.Ptr("betjppbcspfewqw"),
		// 								Info: map[string]any{
		// 								},
		// 							},
		// 						},
		// 					},
		// 					ProvisioningState: to.Ptr(armworkloadorchestration.ProvisioningStateSucceeded),
		// 				},
		// 				ExtendedLocation: &armworkloadorchestration.ExtendedLocation{
		// 					Name: to.Ptr("szjrwimeqyiue"),
		// 					Type: to.Ptr(armworkloadorchestration.ExtendedLocationTypeEdgeZone),
		// 				},
		// 				ETag: to.Ptr("btoclmueznpoouhnxqlboavqnsztrz"),
		// 				ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"),
		// 				Name: to.Ptr("lk"),
		// 				Type: to.Ptr("czkgymlhmhlxxpbgcmhstxwtczthq"),
		// 				SystemData: &armworkloadorchestration.SystemData{
		// 					CreatedBy: to.Ptr("nvjczgdguyvllp"),
		// 					CreatedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("uzbznzjgvaspvtqhyg"),
		// 					LastModifiedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
		// 				},
		// 			},
		// 		},
		// 		NextLink: to.Ptr("https://microsoft.com/aidpqswh"),
		// 	},
		// }
	}
}

// Generated from example definition: 2025-06-01/SolutionVersions_Update_MaximumSet_Gen.json
func ExampleSolutionVersionsClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armworkloadorchestration.NewClientFactory("9D54FE4C-00AF-4836-8F48-B6A9C4E47192", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewSolutionVersionsClient().BeginUpdate(ctx, "rgconfigurationmanager", "testname", "testname", "testname", armworkloadorchestration.SolutionVersion{
		Properties: &armworkloadorchestration.SolutionVersionProperties{
			Specification: map[string]any{},
		},
	}, 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 = armworkloadorchestration.SolutionVersionsClientUpdateResponse{
	// 	SolutionVersion: armworkloadorchestration.SolutionVersion{
	// 		Properties: &armworkloadorchestration.SolutionVersionProperties{
	// 			SolutionTemplateVersionID: to.Ptr("ykgyybnfeqxcz"),
	// 			Revision: to.Ptr[int32](17),
	// 			TargetDisplayName: to.Ptr("phndhpa"),
	// 			Configuration: to.Ptr("qg"),
	// 			TargetLevelConfiguration: to.Ptr("t"),
	// 			Specification: map[string]any{
	// 			},
	// 			ReviewID: to.Ptr("bcnlj"),
	// 			ExternalValidationID: to.Ptr("yxabw"),
	// 			State: to.Ptr(armworkloadorchestration.StateInReview),
	// 			SolutionInstanceName: to.Ptr("testname"),
	// 			SolutionDependencies: []*armworkloadorchestration.SolutionDependency{
	// 				{
	// 					SolutionVersionID: to.Ptr("jtyhpdivvfbf"),
	// 					SolutionInstanceName: to.Ptr("testname"),
	// 					SolutionTemplateVersionID: to.Ptr("zoagjfizf"),
	// 					TargetID: to.Ptr("qcbujg"),
	// 					Dependencies: []*armworkloadorchestration.SolutionDependency{
	// 					},
	// 				},
	// 			},
	// 			ErrorDetails: &armworkloadorchestration.ErrorDetail{
	// 				Code: to.Ptr("lzmwkzmn"),
	// 				Message: to.Ptr("zjdfzawocrbkgawgampjjulgesr"),
	// 				Target: to.Ptr("rncdbnknqkhjwqzkqqit"),
	// 				Details: []*armworkloadorchestration.ErrorDetail{
	// 				},
	// 				AdditionalInfo: []*armworkloadorchestration.ErrorAdditionalInfo{
	// 					{
	// 						Type: to.Ptr("betjppbcspfewqw"),
	// 						Info: map[string]any{
	// 						},
	// 					},
	// 				},
	// 			},
	// 			ProvisioningState: to.Ptr(armworkloadorchestration.ProvisioningStateSucceeded),
	// 		},
	// 		ExtendedLocation: &armworkloadorchestration.ExtendedLocation{
	// 			Name: to.Ptr("szjrwimeqyiue"),
	// 			Type: to.Ptr(armworkloadorchestration.ExtendedLocationTypeEdgeZone),
	// 		},
	// 		ETag: to.Ptr("btoclmueznpoouhnxqlboavqnsztrz"),
	// 		ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"),
	// 		Name: to.Ptr("lk"),
	// 		Type: to.Ptr("czkgymlhmhlxxpbgcmhstxwtczthq"),
	// 		SystemData: &armworkloadorchestration.SystemData{
	// 			CreatedBy: to.Ptr("nvjczgdguyvllp"),
	// 			CreatedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("uzbznzjgvaspvtqhyg"),
	// 			LastModifiedByType: to.Ptr(armworkloadorchestration.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-09T10:11:50.747Z"); return t}()),
	// 		},
	// 	},
	// }
}
