// 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 armcontainerserviceaimanager_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/containerserviceaimanager/armcontainerserviceaimanager"
	"log"
)

// Generated from example definition: 2026-05-02-preview/AIManagers_CreateOrUpdate.json
func ExampleAIManagersClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAIManagersClient().BeginCreateOrUpdate(ctx, "rg1", "aimanager1", armcontainerserviceaimanager.AIManager{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
		},
		Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
			Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
		},
		Properties: &armcontainerserviceaimanager.AIManagerProperties{
			DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
		},
	}, 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 = armcontainerserviceaimanager.AIManagersClientCreateOrUpdateResponse{
	// 	AIManager: armcontainerserviceaimanager.AIManager{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/aiManagers/aimanager1"),
	// 		Name: to.Ptr("aimanager1"),
	// 		Type: to.Ptr("Microsoft.ContainerService/aiManagers"),
	// 		Location: to.Ptr("eastus"),
	// 		Tags: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SystemData: &armcontainerserviceaimanager.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 		},
	// 		ETag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""),
	// 		Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
	// 			Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
	// 			PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 		Properties: &armcontainerserviceaimanager.AIManagerProperties{
	// 			ProvisioningState: to.Ptr(armcontainerserviceaimanager.AIManagerProvisioningStateSucceeded),
	// 			DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
	// 			ManagedResourceGroupName: to.Ptr("AIM_rg1_aimanager1_eastus"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-02-preview/AIManagers_Delete.json
func ExampleAIManagersClient_BeginDelete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAIManagersClient().BeginDelete(ctx, "rg1", "aimanager1", 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: 2026-05-02-preview/AIManagers_Get.json
func ExampleAIManagersClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAIManagersClient().Get(ctx, "rg1", "aimanager1", 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 = armcontainerserviceaimanager.AIManagersClientGetResponse{
	// 	AIManager: armcontainerserviceaimanager.AIManager{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/aiManagers/aimanager1"),
	// 		Name: to.Ptr("aimanager1"),
	// 		Type: to.Ptr("Microsoft.ContainerService/aiManagers"),
	// 		Location: to.Ptr("eastus"),
	// 		Tags: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 		},
	// 		SystemData: &armcontainerserviceaimanager.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 		},
	// 		ETag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""),
	// 		Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
	// 			Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
	// 			PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 		Properties: &armcontainerserviceaimanager.AIManagerProperties{
	// 			ProvisioningState: to.Ptr(armcontainerserviceaimanager.AIManagerProvisioningStateSucceeded),
	// 			DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
	// 			ManagedResourceGroupName: to.Ptr("AIM_rg1_aimanager1_eastus"),
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-02-preview/AIManagers_ListByResourceGroup.json
func ExampleAIManagersClient_NewListByResourceGroupPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAIManagersClient().NewListByResourceGroupPager("rg1", 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 = armcontainerserviceaimanager.AIManagersClientListByResourceGroupResponse{
		// 	AIManagerListResult: armcontainerserviceaimanager.AIManagerListResult{
		// 		Value: []*armcontainerserviceaimanager.AIManager{
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/aiManagers/aimanager1"),
		// 				Name: to.Ptr("aimanager1"),
		// 				Type: to.Ptr("Microsoft.ContainerService/aiManagers"),
		// 				Location: to.Ptr("eastus"),
		// 				Tags: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				SystemData: &armcontainerserviceaimanager.SystemData{
		// 					CreatedBy: to.Ptr("user@example.com"),
		// 					CreatedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user@example.com"),
		// 					LastModifiedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 				},
		// 				ETag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""),
		// 				Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
		// 					Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
		// 					PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				},
		// 				Properties: &armcontainerserviceaimanager.AIManagerProperties{
		// 					ProvisioningState: to.Ptr(armcontainerserviceaimanager.AIManagerProvisioningStateSucceeded),
		// 					DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
		// 					ManagedResourceGroupName: to.Ptr("AIM_rg1_aimanager1_eastus"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-05-02-preview/AIManagers_ListBySubscription.json
func ExampleAIManagersClient_NewListBySubscriptionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAIManagersClient().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 = armcontainerserviceaimanager.AIManagersClientListBySubscriptionResponse{
		// 	AIManagerListResult: armcontainerserviceaimanager.AIManagerListResult{
		// 		Value: []*armcontainerserviceaimanager.AIManager{
		// 			{
		// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/aiManagers/aimanager1"),
		// 				Name: to.Ptr("aimanager1"),
		// 				Type: to.Ptr("Microsoft.ContainerService/aiManagers"),
		// 				Location: to.Ptr("eastus"),
		// 				Tags: map[string]*string{
		// 					"key1": to.Ptr("value1"),
		// 				},
		// 				SystemData: &armcontainerserviceaimanager.SystemData{
		// 					CreatedBy: to.Ptr("user@example.com"),
		// 					CreatedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
		// 					CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 					LastModifiedBy: to.Ptr("user@example.com"),
		// 					LastModifiedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
		// 					LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
		// 				},
		// 				ETag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""),
		// 				Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
		// 					Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
		// 					PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				},
		// 				Properties: &armcontainerserviceaimanager.AIManagerProperties{
		// 					ProvisioningState: to.Ptr(armcontainerserviceaimanager.AIManagerProvisioningStateSucceeded),
		// 					DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
		// 					ManagedResourceGroupName: to.Ptr("AIM_rg1_aimanager1_eastus"),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2026-05-02-preview/AIManagers_ListCredential.json
func ExampleAIManagersClient_ListCredential() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAIManagersClient().ListCredential(ctx, "rg1", "aimanager1", 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 = armcontainerserviceaimanager.AIManagersClientListCredentialResponse{
	// 	CredentialResults: armcontainerserviceaimanager.CredentialResults{
	// 		Kubeconfigs: []*armcontainerserviceaimanager.CredentialResult{
	// 			{
	// 				Name: to.Ptr("clusterUser"),
	// 				Value: []byte("YWJj"),
	// 			},
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2026-05-02-preview/AIManagers_Update.json
func ExampleAIManagersClient_Update() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerserviceaimanager.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAIManagersClient().Update(ctx, "rg1", "aimanager1", armcontainerserviceaimanager.AIManagerPatch{
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
			"key2": to.Ptr("value2"),
		},
		Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
			Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
		},
	}, 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 = armcontainerserviceaimanager.AIManagersClientUpdateResponse{
	// 	AIManager: armcontainerserviceaimanager.AIManager{
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/aiManagers/aimanager1"),
	// 		Name: to.Ptr("aimanager1"),
	// 		Type: to.Ptr("Microsoft.ContainerService/aiManagers"),
	// 		Location: to.Ptr("eastus"),
	// 		Tags: map[string]*string{
	// 			"key1": to.Ptr("value1"),
	// 			"key2": to.Ptr("value2"),
	// 		},
	// 		SystemData: &armcontainerserviceaimanager.SystemData{
	// 			CreatedBy: to.Ptr("user@example.com"),
	// 			CreatedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 			LastModifiedBy: to.Ptr("user@example.com"),
	// 			LastModifiedByType: to.Ptr(armcontainerserviceaimanager.CreatedByTypeUser),
	// 			LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()),
	// 		},
	// 		ETag: to.Ptr("\"00000000-0000-0000-0000-000000000000\""),
	// 		Identity: &armcontainerserviceaimanager.ManagedServiceIdentity{
	// 			Type: to.Ptr(armcontainerserviceaimanager.ManagedServiceIdentityTypeSystemAssigned),
	// 			PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		},
	// 		Properties: &armcontainerserviceaimanager.AIManagerProperties{
	// 			ProvisioningState: to.Ptr(armcontainerserviceaimanager.AIManagerProvisioningStateSucceeded),
	// 			DeletePolicy: to.Ptr(armcontainerserviceaimanager.DeletePolicyKeep),
	// 			ManagedResourceGroupName: to.Ptr("AIM_rg1_aimanager1_eastus"),
	// 		},
	// 	},
	// }
}
