// 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 armquota_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/quota/armquota/v2"
	"log"
)

// Generated from example definition: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json
func ExampleGroupQuotaLimitsRequestClient_Get() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armquota.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewGroupQuotaLimitsRequestClient().Get(ctx, "E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "requestId", 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 = armquota.GroupQuotaLimitsRequestClientGetResponse{
	// 	SubmittedResourceRequestStatus: &armquota.SubmittedResourceRequestStatus{
	// 		Name: to.Ptr("requestId"),
	// 		Type: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimitsRequests"),
	// 		ID: to.Ptr("/providers/Microsoft.Management/managementGroups/E7EC67B3-7657-4966-BFFC-41EFD36BAA09/providers/Microsoft.Quota/groupQuotas/groupquota1/resourceProviders/Microsoft.Compute/groupQuotaLimitsRequests/requestId"),
	// 		Properties: &armquota.SubmittedResourceRequestStatusProperties{
	// 			FaultCode: to.Ptr("ResourceNotAvailableForOffer"),
	// 			ProvisioningState: to.Ptr(armquota.RequestStateFailed),
	// 			RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-20T05:29:34.144Z"); return t}()),
	// 			RequestedResource: &armquota.GroupQuotaRequestBase{
	// 				Properties: &armquota.GroupQuotaRequestBaseProperties{
	// 					Name: &armquota.GroupQuotaRequestBasePropertiesName{
	// 						LocalizedValue: to.Ptr("standard DDv4 Family vCPUs"),
	// 						Value: to.Ptr("standardddv4family"),
	// 					},
	// 					Comments: to.Ptr(""),
	// 					Limit: to.Ptr[int64](100),
	// 					Region: to.Ptr("westus"),
	// 				},
	// 			},
	// 		},
	// 	},
	// }
}

// Generated from example definition: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json
func ExampleGroupQuotaLimitsRequestClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armquota.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewGroupQuotaLimitsRequestClient().NewListPager("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "location eq westus", 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 = armquota.GroupQuotaLimitsRequestClientListResponse{
		// 	SubmittedResourceRequestStatusList: armquota.SubmittedResourceRequestStatusList{
		// 		NextLink: to.Ptr("https://yourLinkHere.com"),
		// 		Value: []*armquota.SubmittedResourceRequestStatus{
		// 			{
		// 				Name: to.Ptr("requestId1"),
		// 				Type: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimitsRequests"),
		// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/E7EC67B3-7657-4966-BFFC-41EFD36BAA09/providers/Microsoft.Quota/groupQuotas/groupquota1/resourceProviders/Microsoft.Compute/groupQuotaLimitsRequests/requestId1"),
		// 				Properties: &armquota.SubmittedResourceRequestStatusProperties{
		// 					FaultCode: to.Ptr("ResourceNotAvailableForOffer"),
		// 					ProvisioningState: to.Ptr(armquota.RequestStateFailed),
		// 					RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-18T00:12:34.004Z"); return t}()),
		// 					RequestedResource: &armquota.GroupQuotaRequestBase{
		// 						Properties: &armquota.GroupQuotaRequestBaseProperties{
		// 							Name: &armquota.GroupQuotaRequestBasePropertiesName{
		// 								LocalizedValue: to.Ptr("standard DDv4 Family vCPUs"),
		// 								Value: to.Ptr("standardddv4family"),
		// 							},
		// 							Comments: to.Ptr("Contoso requires more quota."),
		// 							Limit: to.Ptr[int64](100),
		// 							Region: to.Ptr("westus"),
		// 						},
		// 					},
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("requestId2"),
		// 				Type: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimitsRequests"),
		// 				ID: to.Ptr("/providers/Microsoft.Management/managementGroups/E7EC67B3-7657-4966-BFFC-41EFD36BAA09/providers/Microsoft.Quota/groupQuotas/groupquota1/resourceProviders/Microsoft.Compute/groupQuotaLimitsRequests/requestId2"),
		// 				Properties: &armquota.SubmittedResourceRequestStatusProperties{
		// 					FaultCode: to.Ptr(""),
		// 					ProvisioningState: to.Ptr(armquota.RequestStateSucceeded),
		// 					RequestSubmitTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-11-17T00:57:43.410Z"); return t}()),
		// 					RequestedResource: &armquota.GroupQuotaRequestBase{
		// 						Properties: &armquota.GroupQuotaRequestBaseProperties{
		// 							Name: &armquota.GroupQuotaRequestBasePropertiesName{
		// 								LocalizedValue: to.Ptr("standardav2family"),
		// 								Value: to.Ptr("standardav2family"),
		// 							},
		// 							Comments: to.Ptr("Contoso requires more quota."),
		// 							Limit: to.Ptr[int64](150),
		// 							Region: to.Ptr("westus"),
		// 						},
		// 					},
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2025-09-01/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json
func ExampleGroupQuotaLimitsRequestClient_BeginUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armquota.NewClientFactory(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewGroupQuotaLimitsRequestClient().BeginUpdate(ctx, "E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", armquota.GroupQuotaLimitList{
		Properties: &armquota.GroupQuotaLimitListProperties{
			Value: []*armquota.GroupQuotaLimit{
				{
					Properties: &armquota.GroupQuotaLimitProperties{
						Comment:      to.Ptr("Contoso requires more quota."),
						Limit:        to.Ptr[int64](110),
						ResourceName: to.Ptr("standardddv4family"),
					},
				},
				{
					Properties: &armquota.GroupQuotaLimitProperties{
						Comment:      to.Ptr("Contoso requires more quota."),
						Limit:        to.Ptr[int64](110),
						ResourceName: to.Ptr("standardav2family"),
					},
				},
			},
		},
	}, 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 pull 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 = armquota.GroupQuotaLimitsRequestClientUpdateResponse{
	// 	GroupQuotaLimitList: &armquota.GroupQuotaLimitList{
	// 		Name: to.Ptr("westus"),
	// 		Type: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimits"),
	// 		ID: to.Ptr("/providers/Microsoft.Management/managementGroups/E7EC67B3-7657-4966-BFFC-41EFD36BAA09/providers/Microsoft.Quota/groupQuotas/groupquota1/resourceProviders/Microsoft.Compute/groupQuotaLimits/westus"),
	// 		Properties: &armquota.GroupQuotaLimitListProperties{
	// 			NextLink: to.Ptr("https://yourLinkHere.com"),
	// 			ProvisioningState: to.Ptr(armquota.RequestStateSucceeded),
	// 			Value: []*armquota.GroupQuotaLimit{
	// 				{
	// 					Properties: &armquota.GroupQuotaLimitProperties{
	// 						Name: &armquota.GroupQuotaDetailsName{
	// 							LocalizedValue: to.Ptr("standard DDv4 Family vCPUs"),
	// 							Value: to.Ptr("standardddv4family"),
	// 						},
	// 						AllocatedToSubscriptions: &armquota.AllocatedQuotaToSubscriptionList{
	// 							Value: []*armquota.AllocatedToSubscription{
	// 								{
	// 									QuotaAllocated: to.Ptr[int64](20),
	// 									SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 								},
	// 								{
	// 									QuotaAllocated: to.Ptr[int64](30),
	// 									SubscriptionID: to.Ptr("A000000-0000-0000-0000-000000000000"),
	// 								},
	// 							},
	// 						},
	// 						AvailableLimit: to.Ptr[int64](50),
	// 						Limit: to.Ptr[int64](100),
	// 						ResourceName: to.Ptr("standardddv4family"),
	// 						Unit: to.Ptr("count"),
	// 					},
	// 				},
	// 				{
	// 					Properties: &armquota.GroupQuotaLimitProperties{
	// 						Name: &armquota.GroupQuotaDetailsName{
	// 							LocalizedValue: to.Ptr("Standard AV2 Family vCPUs"),
	// 							Value: to.Ptr("standardav2family"),
	// 						},
	// 						AllocatedToSubscriptions: &armquota.AllocatedQuotaToSubscriptionList{
	// 							Value: []*armquota.AllocatedToSubscription{
	// 								{
	// 									QuotaAllocated: to.Ptr[int64](20),
	// 									SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 								},
	// 							},
	// 						},
	// 						AvailableLimit: to.Ptr[int64](80),
	// 						Limit: to.Ptr[int64](100),
	// 						ResourceName: to.Ptr("standardav2family"),
	// 						Unit: to.Ptr("count"),
	// 					},
	// 				},
	// 			},
	// 		},
	// 	},
	// }
}
