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

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computelimit/armcomputelimit"
	"log"
)

// Generated from example definition: 2026-07-31/TrustedHostSubscriptions_Create.json
func ExampleTrustedHostSubscriptionsClient_Create() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcomputelimit.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTrustedHostSubscriptionsClient().Create(ctx, "eastus", "22222222-2222-2222-2222-222222222222", armcomputelimit.TrustedHostSubscription{}, 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 = armcomputelimit.TrustedHostSubscriptionsClientCreateResponse{
	// 	TrustedHostSubscription: armcomputelimit.TrustedHostSubscription{
	// 		ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222"),
	// 		Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
	// 		Type: to.Ptr("Microsoft.ComputeLimit/locations/trustedHostSubscriptions"),
	// 	},
	// }
}

// Generated from example definition: 2026-07-31/TrustedHostSubscriptions_Delete.json
func ExampleTrustedHostSubscriptionsClient_Delete() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcomputelimit.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTrustedHostSubscriptionsClient().Delete(ctx, "eastus", "22222222-2222-2222-2222-222222222222", 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 = armcomputelimit.TrustedHostSubscriptionsClientDeleteResponse{
	// }
}

// Generated from example definition: 2026-07-31/TrustedHostSubscriptions_Get.json
func ExampleTrustedHostSubscriptionsClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcomputelimit.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTrustedHostSubscriptionsClient().Get(ctx, "eastus", "22222222-2222-2222-2222-222222222222", 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 = armcomputelimit.TrustedHostSubscriptionsClientGetResponse{
	// 	TrustedHostSubscription: armcomputelimit.TrustedHostSubscription{
	// 		ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222"),
	// 		Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
	// 		Type: to.Ptr("Microsoft.ComputeLimit/locations/trustedHostSubscriptions"),
	// 	},
	// }
}

// Generated from example definition: 2026-07-31/TrustedHostSubscriptions_List.json
func ExampleTrustedHostSubscriptionsClient_NewListBySubscriptionLocationResourcePager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcomputelimit.NewClientFactory("11111111-1111-1111-1111-111111111111", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTrustedHostSubscriptionsClient().NewListBySubscriptionLocationResourcePager("eastus", 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 = armcomputelimit.TrustedHostSubscriptionsClientListBySubscriptionLocationResourceResponse{
		// 	TrustedHostSubscriptionListResult: armcomputelimit.TrustedHostSubscriptionListResult{
		// 		Value: []*armcomputelimit.TrustedHostSubscription{
		// 			{
		// 				ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222"),
		// 				Name: to.Ptr("22222222-2222-2222-2222-222222222222"),
		// 				Type: to.Ptr("Microsoft.ComputeLimit/locations/trustedHostSubscriptions"),
		// 			},
		// 			{
		// 				ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/33333333-3333-3333-3333-333333333333"),
		// 				Name: to.Ptr("33333333-3333-3333-3333-333333333333"),
		// 				Type: to.Ptr("Microsoft.ComputeLimit/locations/trustedHostSubscriptions"),
		// 			},
		// 		},
		// 	},
		// }
	}
}
