// 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 armmachinelearning_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/machinelearning/armmachinelearning/v5"
	"log"
)

// Generated from example definition: 2026-03-15-preview/Registry/EnvironmentVersion/createOrUpdate.json
func ExampleRegistryEnvironmentVersionsClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmachinelearning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistryEnvironmentVersionsClient().BeginCreateOrUpdate(ctx, "test-rg", "my-aml-registry", "string", "string", armmachinelearning.EnvironmentVersion{
		Properties: &armmachinelearning.EnvironmentVersionProperties{
			Description: to.Ptr("string"),
			Build: &armmachinelearning.BuildContext{
				ContextURI:     to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"),
				DockerfilePath: to.Ptr("prod/Dockerfile"),
			},
			CondaFile: to.Ptr("string"),
			Image:     to.Ptr("docker.io/tensorflow/serving:latest"),
			InferenceConfig: &armmachinelearning.InferenceContainerProperties{
				LivenessRoute: &armmachinelearning.Route{
					Path: to.Ptr("string"),
					Port: to.Ptr[int32](1),
				},
				ReadinessRoute: &armmachinelearning.Route{
					Path: to.Ptr("string"),
					Port: to.Ptr[int32](1),
				},
				ScoringRoute: &armmachinelearning.Route{
					Path: to.Ptr("string"),
					Port: to.Ptr[int32](1),
				},
			},
			IsAnonymous: to.Ptr(false),
			Properties: map[string]*string{
				"string": to.Ptr("string"),
			},
			Tags: map[string]*string{
				"string": to.Ptr("string"),
			},
		},
	}, 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 = armmachinelearning.RegistryEnvironmentVersionsClientCreateOrUpdateResponse{
	// 	EnvironmentVersion: armmachinelearning.EnvironmentVersion{
	// 		Name: to.Ptr("string"),
	// 		Type: to.Ptr("string"),
	// 		ID: to.Ptr("string"),
	// 		Properties: &armmachinelearning.EnvironmentVersionProperties{
	// 			Description: to.Ptr("string"),
	// 			Build: &armmachinelearning.BuildContext{
	// 				ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"),
	// 				DockerfilePath: to.Ptr("prod/Dockerfile"),
	// 			},
	// 			CondaFile: to.Ptr("string"),
	// 			EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated),
	// 			Image: to.Ptr("docker.io/tensorflow/serving:latest"),
	// 			InferenceConfig: &armmachinelearning.InferenceContainerProperties{
	// 				LivenessRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 				ReadinessRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 				ScoringRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 			},
	// 			IsAnonymous: to.Ptr(false),
	// 			Properties: map[string]*string{
	// 				"string": to.Ptr("string"),
	// 			},
	// 			Tags: map[string]*string{
	// 				"string": to.Ptr("string"),
	// 			},
	// 		},
	// 		SystemData: &armmachinelearning.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-03-15-preview/Registry/EnvironmentVersion/delete.json
func ExampleRegistryEnvironmentVersionsClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmachinelearning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistryEnvironmentVersionsClient().BeginDelete(ctx, "test-rg", "my-aml-registry", "string", "string", 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 = armmachinelearning.RegistryEnvironmentVersionsClientDeleteResponse{
	// }
}

// Generated from example definition: 2026-03-15-preview/Registry/EnvironmentVersion/get.json
func ExampleRegistryEnvironmentVersionsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmachinelearning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistryEnvironmentVersionsClient().Get(ctx, "test-rg", "my-aml-registry", "string", "string", 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 = armmachinelearning.RegistryEnvironmentVersionsClientGetResponse{
	// 	EnvironmentVersion: armmachinelearning.EnvironmentVersion{
	// 		Name: to.Ptr("string"),
	// 		Type: to.Ptr("string"),
	// 		ID: to.Ptr("string"),
	// 		Properties: &armmachinelearning.EnvironmentVersionProperties{
	// 			Description: to.Ptr("string"),
	// 			Build: &armmachinelearning.BuildContext{
	// 				ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"),
	// 				DockerfilePath: to.Ptr("prod/Dockerfile"),
	// 			},
	// 			CondaFile: to.Ptr("string"),
	// 			EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated),
	// 			Image: to.Ptr("docker.io/tensorflow/serving:latest"),
	// 			InferenceConfig: &armmachinelearning.InferenceContainerProperties{
	// 				LivenessRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 				ReadinessRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 				ScoringRoute: &armmachinelearning.Route{
	// 					Path: to.Ptr("string"),
	// 					Port: to.Ptr[int32](1),
	// 				},
	// 			},
	// 			IsAnonymous: to.Ptr(false),
	// 			Properties: map[string]*string{
	// 				"string": to.Ptr("string"),
	// 			},
	// 			Tags: map[string]*string{
	// 				"string": to.Ptr("string"),
	// 			},
	// 		},
	// 		SystemData: &armmachinelearning.SystemData{
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
	// 			CreatedBy: to.Ptr("string"),
	// 			CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("string"),
	// 			LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-03-15-preview/Registry/EnvironmentVersion/list.json
func ExampleRegistryEnvironmentVersionsClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armmachinelearning.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegistryEnvironmentVersionsClient().NewListPager("test-rg", "my-aml-regsitry", "string", &armmachinelearning.RegistryEnvironmentVersionsClientListOptions{
		OrderBy: to.Ptr("string"),
		Top:     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 = armmachinelearning.RegistryEnvironmentVersionsClientListResponse{
		// 	EnvironmentVersionResourceArmPaginatedResult: armmachinelearning.EnvironmentVersionResourceArmPaginatedResult{
		// 		NextLink: to.Ptr("https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/registries/registries123/environments/string/versions?api-version=2025-07-01-preview&$skip=2"),
		// 		Value: []*armmachinelearning.EnvironmentVersion{
		// 			{
		// 				Name: to.Ptr("string"),
		// 				Type: to.Ptr("string"),
		// 				ID: to.Ptr("string"),
		// 				Properties: &armmachinelearning.EnvironmentVersionProperties{
		// 					Description: to.Ptr("string"),
		// 					Build: &armmachinelearning.BuildContext{
		// 						ContextURI: to.Ptr("https://storage-account.blob.core.windows.net/azureml/DockerBuildContext/95ddede6b9b8c4e90472db3acd0a8d28/"),
		// 						DockerfilePath: to.Ptr("prod/Dockerfile"),
		// 					},
		// 					CondaFile: to.Ptr("string"),
		// 					EnvironmentType: to.Ptr(armmachinelearning.EnvironmentTypeCurated),
		// 					Image: to.Ptr("docker.io/tensorflow/serving:latest"),
		// 					InferenceConfig: &armmachinelearning.InferenceContainerProperties{
		// 						LivenessRoute: &armmachinelearning.Route{
		// 							Path: to.Ptr("string"),
		// 							Port: to.Ptr[int32](1),
		// 						},
		// 						ReadinessRoute: &armmachinelearning.Route{
		// 							Path: to.Ptr("string"),
		// 							Port: to.Ptr[int32](1),
		// 						},
		// 						ScoringRoute: &armmachinelearning.Route{
		// 							Path: to.Ptr("string"),
		// 							Port: to.Ptr[int32](1),
		// 						},
		// 					},
		// 					IsAnonymous: to.Ptr(false),
		// 					Properties: map[string]*string{
		// 						"string": to.Ptr("string"),
		// 					},
		// 					Tags: map[string]*string{
		// 						"string": to.Ptr("string"),
		// 					},
		// 				},
		// 				SystemData: &armmachinelearning.SystemData{
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
		// 					CreatedBy: to.Ptr("string"),
		// 					CreatedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T12:34:56.999Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("string"),
		// 					LastModifiedByType: to.Ptr(armmachinelearning.CreatedByTypeUser),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}
