diff --git a/sdk/resourcemanager/quota/armquota/client.go b/sdk/resourcemanager/quota/armquota/client.go index 43d5cd731e82..c55c76454568 100644 --- a/sdk/resourcemanager/quota/armquota/client.go +++ b/sdk/resourcemanager/quota/armquota/client.go @@ -24,7 +24,7 @@ type Client struct { // NewClient creates a new instance of Client with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -101,6 +101,9 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceN return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -152,6 +155,9 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceName string, return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -208,6 +214,9 @@ func (client *Client) NewListPager(scope string, options *ClientListOptions) *ru // listCreateRequest creates the List request. func (client *Client) listCreateRequest(ctx context.Context, scope string, _ *ClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Quota/quotas" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -294,6 +303,9 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceName stri return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/client_example_test.go b/sdk/resourcemanager/quota/armquota/client_example_test.go index 87ef4202a258..06d277419c0b 100644 --- a/sdk/resourcemanager/quota/armquota/client_example_test.go +++ b/sdk/resourcemanager/quota/armquota/client_example_test.go @@ -6,10 +6,11 @@ package armquota_test import ( "context" + "log" + "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/putComputeOneSkuQuotaRequest.json diff --git a/sdk/resourcemanager/quota/armquota/groupquotalimits_client.go b/sdk/resourcemanager/quota/armquota/groupquotalimits_client.go index ed3ba8ed835d..0ab10585a610 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotalimits_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotalimits_client.go @@ -24,7 +24,7 @@ type GroupQuotaLimitsClient struct { // NewGroupQuotaLimitsClient creates a new instance of GroupQuotaLimitsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaLimitsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaLimitsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotalimitsrequest_client.go b/sdk/resourcemanager/quota/armquota/groupquotalimitsrequest_client.go index 8d3d0163115f..be2008e8c4d3 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotalimitsrequest_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotalimitsrequest_client.go @@ -24,7 +24,7 @@ type GroupQuotaLimitsRequestClient struct { // NewGroupQuotaLimitsRequestClient creates a new instance of GroupQuotaLimitsRequestClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaLimitsRequestClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaLimitsRequestClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotalocationsettings_client.go b/sdk/resourcemanager/quota/armquota/groupquotalocationsettings_client.go index 9f23136ba903..e059703b75c2 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotalocationsettings_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotalocationsettings_client.go @@ -24,7 +24,7 @@ type GroupQuotaLocationSettingsClient struct { // NewGroupQuotaLocationSettingsClient creates a new instance of GroupQuotaLocationSettingsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaLocationSettingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaLocationSettingsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotas_client.go b/sdk/resourcemanager/quota/armquota/groupquotas_client.go index 560a21e8ab30..92c20481de14 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotas_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotas_client.go @@ -7,14 +7,13 @@ package armquota import ( "context" "errors" - "net/http" - "net/url" - "strings" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" ) // GroupQuotasClient contains the methods for the GroupQuotas group. @@ -25,7 +24,7 @@ type GroupQuotasClient struct { // NewGroupQuotasClient creates a new instance of GroupQuotasClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotasClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotasClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotas_client_example_test.go b/sdk/resourcemanager/quota/armquota/groupquotas_client_example_test.go index a85fbeb0a531..53b3cd7b0b5b 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotas_client_example_test.go +++ b/sdk/resourcemanager/quota/armquota/groupquotas_client_example_test.go @@ -6,11 +6,10 @@ package armquota_test import ( "context" - "log" - "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/GroupQuotas/PutGroupQuotas.json @@ -159,7 +158,7 @@ func ExampleGroupQuotasClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewGroupQuotasClient().BeginUpdate(ctx, "E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", armquota.GroupQuotasEntityPatch{}, &armquota.GroupQuotasClientBeginUpdateOptions{}) + poller, err := clientFactory.NewGroupQuotasClient().BeginUpdate(ctx, "E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", armquota.GroupQuotasEntityPatch{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocation_client.go b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocation_client.go index 9b1e8cf61dad..a944cace3115 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocation_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocation_client.go @@ -26,7 +26,7 @@ type GroupQuotaSubscriptionAllocationClient struct { // NewGroupQuotaSubscriptionAllocationClient creates a new instance of GroupQuotaSubscriptionAllocationClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaSubscriptionAllocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaSubscriptionAllocationClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocationrequest_client.go b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocationrequest_client.go index dcc3801977ee..21b1f990056e 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocationrequest_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionallocationrequest_client.go @@ -7,14 +7,13 @@ package armquota import ( "context" "errors" - "net/http" - "net/url" - "strings" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" ) // GroupQuotaSubscriptionAllocationRequestClient contains the methods for the GroupQuotaSubscriptionAllocationRequest group. @@ -27,7 +26,7 @@ type GroupQuotaSubscriptionAllocationRequestClient struct { // NewGroupQuotaSubscriptionAllocationRequestClient creates a new instance of GroupQuotaSubscriptionAllocationRequestClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaSubscriptionAllocationRequestClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaSubscriptionAllocationRequestClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionrequests_client.go b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionrequests_client.go index be891698fce7..f2b027976d38 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotasubscriptionrequests_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotasubscriptionrequests_client.go @@ -24,7 +24,7 @@ type GroupQuotaSubscriptionRequestsClient struct { // NewGroupQuotaSubscriptionRequestsClient creates a new instance of GroupQuotaSubscriptionRequestsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaSubscriptionRequestsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaSubscriptionRequestsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client.go b/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client.go index 227ef804d84f..80f4fd7ff579 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client.go @@ -26,7 +26,7 @@ type GroupQuotaSubscriptionsClient struct { // NewGroupQuotaSubscriptionsClient creates a new instance of GroupQuotaSubscriptionsClient with the specified values. // - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaSubscriptionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client_example_test.go b/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client_example_test.go index c90833ccd173..7e0c7554733c 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client_example_test.go +++ b/sdk/resourcemanager/quota/armquota/groupquotasubscriptions_client_example_test.go @@ -6,10 +6,9 @@ package armquota_test import ( "context" - "log" - "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/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json diff --git a/sdk/resourcemanager/quota/armquota/groupquotausages_client.go b/sdk/resourcemanager/quota/armquota/groupquotausages_client.go index f2bf55a47482..18ea7fb66a72 100644 --- a/sdk/resourcemanager/quota/armquota/groupquotausages_client.go +++ b/sdk/resourcemanager/quota/armquota/groupquotausages_client.go @@ -24,7 +24,7 @@ type GroupQuotaUsagesClient struct { // NewGroupQuotaUsagesClient creates a new instance of GroupQuotaUsagesClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewGroupQuotaUsagesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupQuotaUsagesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/operation_client.go b/sdk/resourcemanager/quota/armquota/operation_client.go index 18f79f2df394..2bcb8f790f1b 100644 --- a/sdk/resourcemanager/quota/armquota/operation_client.go +++ b/sdk/resourcemanager/quota/armquota/operation_client.go @@ -21,7 +21,7 @@ type OperationClient struct { // NewOperationClient creates a new instance of OperationClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/operation_client_example_test.go b/sdk/resourcemanager/quota/armquota/operation_client_example_test.go new file mode 100644 index 000000000000..bc3448d8348c --- /dev/null +++ b/sdk/resourcemanager/quota/armquota/operation_client_example_test.go @@ -0,0 +1,187 @@ +// 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/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/quota/armquota/v2" + "log" +) + +// Generated from example definition: 2025-09-01/GetOperations.json +func ExampleOperationClient_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.NewOperationClient().NewListPager(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.OperationClientListResponse{ + // OperationList: armquota.OperationList{ + // Value: []*armquota.OperationResponse{ + // { + // Name: to.Ptr("Microsoft.Quota/quotas/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the current Service limit or quota of the specified resource"), + // Operation: to.Ptr("Get resource Quota limit"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Resource Quota limit"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/quotas/write"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Creates the service limit or quota request for the specified resource"), + // Operation: to.Ptr("Creates resource Quota limit request"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Resource Quota limit"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/quotaRequests/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get any service limit request for the specified resource"), + // Operation: to.Ptr("Get Quota limit request"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Resource Quota limit request"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/usages/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the usages for resource providers"), + // Operation: to.Ptr("Get the usages for providers"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("usages information"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/operations/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the Operations supported by Microsoft.Quota"), + // Operation: to.Ptr("Get the Operations supported by Microsoft.Quota"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Read Operation"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/register/action"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Register the subscription with Microsoft.Quota Resource Provider"), + // Operation: to.Ptr("Register the subscription with Microsoft.Quota Resource Provider"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Subscription registration with Resource provider"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the GroupQuota"), + // Operation: to.Ptr("Get GroupQuota resource"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/write"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Creates the GroupQuota resource"), + // Operation: to.Ptr("Creates GroupQuota resource"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota Resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/subscriptions/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the GroupQuota subscriptions"), + // Operation: to.Ptr("Get GroupQuota subscriptions"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("Subscriptions added to GroupQuota resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/subscriptions/write"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Add Subscriptions to GroupQuota resource"), + // Operation: to.Ptr("Adds subscription to GroupQuota resource"), + // Provider: to.Ptr("Creates request to add subscription to GroupQuota resource"), + // Resource: to.Ptr("Subscriptions added to GroupQuota resource"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimits/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the current GroupQuota of the specified resource"), + // Operation: to.Ptr("Get GroupQuota resource Quota limit"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota Resource Quota limit"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaLimits/write"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Creates the GroupQuota request for the specified resource"), + // Operation: to.Ptr("Creates GroupQuota resource Quota limit request"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota Resource Quota limit"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/groupQuotaRequests/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the GroupQuota request status for the specific request"), + // Operation: to.Ptr("Get GroupQuota request status"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota request"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/quotaAllocations/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the current GroupQuota to Subscription Quota allocation"), + // Operation: to.Ptr("Get GroupQuota to Subscription Quota allocation"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota to Subscription Quota allocation"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/quotaAllocations/write"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Creates the GroupQuota to subscription Quota limit request for the specified resource"), + // Operation: to.Ptr("Creates GroupQuota to subscription Quota limit request"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota to Subscription Quota allocation"), + // }, + // }, + // { + // Name: to.Ptr("Microsoft.Quota/groupQuotas/quotaAllocationRequests/read"), + // Display: &armquota.OperationDisplay{ + // Description: to.Ptr("Get the GroupQuota to Subscription Quota allocation request status for the specific request"), + // Operation: to.Ptr("Get GroupQuota to Subscription Quota allocation request status"), + // Provider: to.Ptr("Microsoft.Quota"), + // Resource: to.Ptr("GroupQuota to Subscription Quota allocation request"), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/quota/armquota/requeststatus_client.go b/sdk/resourcemanager/quota/armquota/requeststatus_client.go index 0f9d46eb3d99..33ffb7dcd465 100644 --- a/sdk/resourcemanager/quota/armquota/requeststatus_client.go +++ b/sdk/resourcemanager/quota/armquota/requeststatus_client.go @@ -25,7 +25,7 @@ type RequestStatusClient struct { // NewRequestStatusClient creates a new instance of RequestStatusClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewRequestStatusClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*RequestStatusClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -72,6 +72,9 @@ func (client *RequestStatusClient) getCreateRequest(ctx context.Context, id stri return nil, errors.New("parameter id cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -125,6 +128,9 @@ func (client *RequestStatusClient) NewListPager(scope string, options *RequestSt // listCreateRequest creates the List request. func (client *RequestStatusClient) listCreateRequest(ctx context.Context, scope string, options *RequestStatusClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Quota/quotaRequests" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { diff --git a/sdk/resourcemanager/quota/armquota/testdata/_metadata.json b/sdk/resourcemanager/quota/armquota/testdata/_metadata.json index bffb78354bba..401de651829d 100644 --- a/sdk/resourcemanager/quota/armquota/testdata/_metadata.json +++ b/sdk/resourcemanager/quota/armquota/testdata/_metadata.json @@ -1,4 +1,4 @@ { "apiVersion": "2025-09-01", - "emitterVersion": "0.8.2" + "emitterVersion": "0.8.6" } \ No newline at end of file diff --git a/sdk/resourcemanager/quota/armquota/tsp-location.yaml b/sdk/resourcemanager/quota/armquota/tsp-location.yaml index 5fa25be2f323..040345ab25b3 100644 --- a/sdk/resourcemanager/quota/armquota/tsp-location.yaml +++ b/sdk/resourcemanager/quota/armquota/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/quota/Quota.Management -commit: 6fb604853ab1c56f2adbe6e4922c31e772425cba +directory: specification/quota/resource-manager/Microsoft.Quota/Quota +commit: 2ec4c94bd944ea1230297b26ba6bbfa94becdcce repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/quota/armquota/usages_client.go b/sdk/resourcemanager/quota/armquota/usages_client.go index b4b29d489865..7576a0a7901d 100644 --- a/sdk/resourcemanager/quota/armquota/usages_client.go +++ b/sdk/resourcemanager/quota/armquota/usages_client.go @@ -24,7 +24,7 @@ type UsagesClient struct { // NewUsagesClient creates a new instance of UsagesClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewUsagesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -70,6 +70,9 @@ func (client *UsagesClient) getCreateRequest(ctx context.Context, resourceName s return nil, errors.New("parameter resourceName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -125,6 +128,9 @@ func (client *UsagesClient) NewListPager(scope string, options *UsagesClientList // listCreateRequest creates the List request. func (client *UsagesClient) listCreateRequest(ctx context.Context, scope string, _ *UsagesClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Quota/usages" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil {