diff --git a/sdk/resourcemanager/batch/armbatch/CHANGELOG.md b/sdk/resourcemanager/batch/armbatch/CHANGELOG.md index 4cd8abd55b45..7372ac0be74f 100644 --- a/sdk/resourcemanager/batch/armbatch/CHANGELOG.md +++ b/sdk/resourcemanager/batch/armbatch/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 5.0.0 (2026-08-18) +### Breaking Changes + +- Field `ETag` of struct `PoolClientCreateResponse` has been removed +- Field `ETag` of struct `PoolClientDisableAutoScaleResponse` has been removed +- Field `ETag` of struct `PoolClientGetResponse` has been removed +- Field `ETag` of struct `PoolClientStopResizeResponse` has been removed +- Field `ETag` of struct `PoolClientUpdateResponse` has been removed + +### Features Added + +- New field `Etag` in struct `PoolClientCreateResponse` +- New field `Etag` in struct `PoolClientDisableAutoScaleResponse` +- New field `Etag` in struct `PoolClientGetResponse` +- New field `Etag` in struct `PoolClientStopResizeResponse` +- New field `Etag` in struct `PoolClientUpdateResponse` + + ## 4.0.0 (2026-02-11) ### Breaking Changes diff --git a/sdk/resourcemanager/batch/armbatch/README.md b/sdk/resourcemanager/batch/armbatch/README.md index d6eaed2c11b7..4be146fd1309 100644 --- a/sdk/resourcemanager/batch/armbatch/README.md +++ b/sdk/resourcemanager/batch/armbatch/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Batch module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5 ``` ## Authorization diff --git a/sdk/resourcemanager/batch/armbatch/account_client.go b/sdk/resourcemanager/batch/armbatch/account_client.go index ae1d0c0e2228..e2fdc724e61b 100644 --- a/sdk/resourcemanager/batch/armbatch/account_client.go +++ b/sdk/resourcemanager/batch/armbatch/account_client.go @@ -18,6 +18,8 @@ import ( // AccountClient contains the methods for the Account group. // Don't use this type directly, use NewAccountClient() instead. +// +// Generated from API version 2025-06-01 type AccountClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewAccountClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this // API and should instead be updated with the Update Batch Account API. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -70,8 +70,6 @@ func (client *AccountClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and // should instead be updated with the Update Batch Account API. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *AccountClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AccountClient.BeginCreate" @@ -87,8 +85,7 @@ func (client *AccountClient) create(ctx context.Context, resourceGroupName strin return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -113,8 +110,8 @@ func (client *AccountClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,8 +122,6 @@ func (client *AccountClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -151,8 +146,6 @@ func (client *AccountClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *AccountClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AccountClient.BeginDelete" @@ -168,8 +161,7 @@ func (client *AccountClient) deleteOperation(ctx context.Context, resourceGroupN return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -194,15 +186,13 @@ func (client *AccountClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -222,12 +212,7 @@ func (client *AccountClient) Get(ctx context.Context, resourceGroupName string, if err != nil { return AccountClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -250,15 +235,18 @@ func (client *AccountClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *AccountClient) getHandleResponse(resp *http.Response) (AccountClientGetResponse, error) { +func (client *AccountClient) getHandleResponse(resp *http.Response, successCodes ...int) (AccountClientGetResponse, error) { result := AccountClientGetResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil { return AccountClientGetResponse{}, err } @@ -267,8 +255,6 @@ func (client *AccountClient) getHandleResponse(resp *http.Response) (AccountClie // GetDetector - Gets information about the given detector for a given Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -289,12 +275,7 @@ func (client *AccountClient) GetDetector(ctx context.Context, resourceGroupName if err != nil { return AccountClientGetDetectorResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountClientGetDetectorResponse{}, err - } - resp, err := client.getDetectorHandleResponse(httpResp) - return resp, err + return client.getDetectorHandleResponse(httpResp, http.StatusOK) } // getDetectorCreateRequest creates the GetDetector request. @@ -321,15 +302,18 @@ func (client *AccountClient) getDetectorCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getDetectorHandleResponse handles the GetDetector response. -func (client *AccountClient) getDetectorHandleResponse(resp *http.Response) (AccountClientGetDetectorResponse, error) { +func (client *AccountClient) getDetectorHandleResponse(resp *http.Response, successCodes ...int) (AccountClientGetDetectorResponse, error) { result := AccountClientGetDetectorResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponse); err != nil { return AccountClientGetDetectorResponse{}, err } @@ -342,8 +326,6 @@ func (client *AccountClient) getDetectorHandleResponse(resp *http.Response) (Acc // doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must // use another allowedAuthenticationModes instead. In this case, getting the keys will fail. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -363,12 +345,7 @@ func (client *AccountClient) GetKeys(ctx context.Context, resourceGroupName stri if err != nil { return AccountClientGetKeysResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountClientGetKeysResponse{}, err - } - resp, err := client.getKeysHandleResponse(httpResp) - return resp, err + return client.getKeysHandleResponse(httpResp, http.StatusOK) } // getKeysCreateRequest creates the GetKeys request. @@ -391,15 +368,18 @@ func (client *AccountClient) getKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getKeysHandleResponse handles the GetKeys response. -func (client *AccountClient) getKeysHandleResponse(resp *http.Response) (AccountClientGetKeysResponse, error) { +func (client *AccountClient) getKeysHandleResponse(resp *http.Response, successCodes ...int) (AccountClientGetKeysResponse, error) { result := AccountClientGetKeysResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.AccountKeys); err != nil { return AccountClientGetKeysResponse{}, err } @@ -407,8 +387,6 @@ func (client *AccountClient) getKeysHandleResponse(resp *http.Response) (Account } // NewListPager - Gets information about the Batch accounts associated with the subscription. -// -// Generated from API version 2025-06-01 // - options - AccountClientListOptions contains the optional parameters for the AccountClient.NewListPager method. func (client *AccountClient) NewListPager(options *AccountClientListOptions) *runtime.Pager[AccountClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountClientListResponse]{ @@ -421,39 +399,53 @@ func (client *AccountClient) NewListPager(options *AccountClientListOptions) *ru if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) + req, err := client.listCreateRequest(ctx, nextLink, options) if err != nil { return AccountClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountClientListResponse{}, err + } + return client.listHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listCreateRequest creates the List request. -func (client *AccountClient) listCreateRequest(ctx context.Context, _ *AccountClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *AccountClient) listCreateRequest(ctx context.Context, nextLink string, _ *AccountClientListOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listHandleResponse handles the List response. -func (client *AccountClient) listHandleResponse(resp *http.Response) (AccountClientListResponse, error) { +func (client *AccountClient) listHandleResponse(resp *http.Response, successCodes ...int) (AccountClientListResponse, error) { result := AccountClientListResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil { return AccountClientListResponse{}, err } @@ -461,8 +453,6 @@ func (client *AccountClient) listHandleResponse(resp *http.Response) (AccountCli } // NewListByResourceGroupPager - Gets information about the Batch accounts associated with the specified resource group. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AccountClientListByResourceGroupOptions contains the optional parameters for the AccountClient.NewListByResourceGroupPager // method. @@ -477,43 +467,57 @@ func (client *AccountClient) NewListByResourceGroupPager(resourceGroupName strin if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) + req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, nextLink, options) if err != nil { return AccountClientListByResourceGroupResponse{}, err } - return client.listByResourceGroupHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AccountClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AccountClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AccountClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") +func (client *AccountClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, nextLink string, _ *AccountClientListByResourceGroupOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *AccountClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountClientListByResourceGroupResponse, error) { +func (client *AccountClient) listByResourceGroupHandleResponse(resp *http.Response, successCodes ...int) (AccountClientListByResourceGroupResponse, error) { result := AccountClientListByResourceGroupResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil { return AccountClientListByResourceGroupResponse{}, err } @@ -521,8 +525,6 @@ func (client *AccountClient) listByResourceGroupHandleResponse(resp *http.Respon } // NewListDetectorsPager - Gets information about the detectors available for a given Batch account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -540,47 +542,61 @@ func (client *AccountClient) NewListDetectorsPager(resourceGroupName string, acc if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listDetectorsCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listDetectorsCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) + if err != nil { + return AccountClientListDetectorsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountClientListDetectorsResponse{}, err } - return client.listDetectorsHandleResponse(resp) + return client.listDetectorsHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listDetectorsCreateRequest creates the ListDetectors request. -func (client *AccountClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountClientListDetectorsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *AccountClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, _ *AccountClientListDetectorsOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listDetectorsHandleResponse handles the ListDetectors response. -func (client *AccountClient) listDetectorsHandleResponse(resp *http.Response) (AccountClientListDetectorsResponse, error) { +func (client *AccountClient) listDetectorsHandleResponse(resp *http.Response, successCodes ...int) (AccountClientListDetectorsResponse, error) { result := AccountClientListDetectorsResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.DetectorListResult); err != nil { return AccountClientListDetectorsResponse{}, err } @@ -592,8 +608,6 @@ func (client *AccountClient) listDetectorsHandleResponse(resp *http.Response) (A // you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may // cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, // see https://learn.microsoft.com/azure/batch/batch-virtual-network. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -611,47 +625,61 @@ func (client *AccountClient) NewListOutboundNetworkDependenciesEndpointsPager(re if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) + if err != nil { + return AccountClientListOutboundNetworkDependenciesEndpointsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountClientListOutboundNetworkDependenciesEndpointsResponse{}, err } - return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) + return client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listOutboundNetworkDependenciesEndpointsCreateRequest creates the ListOutboundNetworkDependenciesEndpoints request. -func (client *AccountClient) listOutboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountClientListOutboundNetworkDependenciesEndpointsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *AccountClient) listOutboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, _ *AccountClientListOutboundNetworkDependenciesEndpointsOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listOutboundNetworkDependenciesEndpointsHandleResponse handles the ListOutboundNetworkDependenciesEndpoints response. -func (client *AccountClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (AccountClientListOutboundNetworkDependenciesEndpointsResponse, error) { +func (client *AccountClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response, successCodes ...int) (AccountClientListOutboundNetworkDependenciesEndpointsResponse, error) { result := AccountClientListOutboundNetworkDependenciesEndpointsResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.OutboundEnvironmentEndpointCollection); err != nil { return AccountClientListOutboundNetworkDependenciesEndpointsResponse{}, err } @@ -664,8 +692,6 @@ func (client *AccountClient) listOutboundNetworkDependenciesEndpointsHandleRespo // doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must // use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -686,12 +712,7 @@ func (client *AccountClient) RegenerateKey(ctx context.Context, resourceGroupNam if err != nil { return AccountClientRegenerateKeyResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountClientRegenerateKeyResponse{}, err - } - resp, err := client.regenerateKeyHandleResponse(httpResp) - return resp, err + return client.regenerateKeyHandleResponse(httpResp, http.StatusOK) } // regenerateKeyCreateRequest creates the RegenerateKey request. @@ -714,8 +735,8 @@ func (client *AccountClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -725,8 +746,11 @@ func (client *AccountClient) regenerateKeyCreateRequest(ctx context.Context, res } // regenerateKeyHandleResponse handles the RegenerateKey response. -func (client *AccountClient) regenerateKeyHandleResponse(resp *http.Response) (AccountClientRegenerateKeyResponse, error) { +func (client *AccountClient) regenerateKeyHandleResponse(resp *http.Response, successCodes ...int) (AccountClientRegenerateKeyResponse, error) { result := AccountClientRegenerateKeyResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.AccountKeys); err != nil { return AccountClientRegenerateKeyResponse{}, err } @@ -736,8 +760,6 @@ func (client *AccountClient) regenerateKeyHandleResponse(resp *http.Response) (A // SynchronizeAutoStorageKeys - Synchronizes access keys for the auto-storage account configured for the specified Batch account, // only if storage key authentication is being used. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -759,8 +781,7 @@ func (client *AccountClient) SynchronizeAutoStorageKeys(ctx context.Context, res return AccountClientSynchronizeAutoStorageKeysResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AccountClientSynchronizeAutoStorageKeysResponse{}, err + return AccountClientSynchronizeAutoStorageKeysResponse{}, runtime.NewResponseError(httpResp) } return AccountClientSynchronizeAutoStorageKeysResponse{}, nil } @@ -785,15 +806,13 @@ func (client *AccountClient) synchronizeAutoStorageKeysCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Update - Updates the properties of an existing Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -814,12 +833,7 @@ func (client *AccountClient) Update(ctx context.Context, resourceGroupName strin if err != nil { return AccountClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return client.updateHandleResponse(httpResp, http.StatusOK) } // updateCreateRequest creates the Update request. @@ -842,8 +856,8 @@ func (client *AccountClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -853,8 +867,11 @@ func (client *AccountClient) updateCreateRequest(ctx context.Context, resourceGr } // updateHandleResponse handles the Update response. -func (client *AccountClient) updateHandleResponse(resp *http.Response) (AccountClientUpdateResponse, error) { +func (client *AccountClient) updateHandleResponse(resp *http.Response, successCodes ...int) (AccountClientUpdateResponse, error) { result := AccountClientUpdateResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil { return AccountClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/account_client_example_test.go b/sdk/resourcemanager/batch/armbatch/account_client_example_test.go index f4a1e9f0e4bb..4de6b46ff4f3 100644 --- a/sdk/resourcemanager/batch/armbatch/account_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/account_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -41,13 +41,13 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateByos() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.AccountClientCreateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -59,7 +59,7 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateByos() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -101,13 +101,13 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateDefault() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.AccountClientCreateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -119,7 +119,7 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateDefault() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -160,13 +160,13 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateSystemAssignedIdentity() } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.AccountClientCreateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -180,7 +180,7 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateSystemAssignedIdentity() // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -224,13 +224,13 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateUserAssignedIdentity() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.AccountClientCreateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -248,7 +248,7 @@ func ExampleAccountClient_BeginCreate_batchAccountCreateUserAssignedIdentity() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -291,13 +291,13 @@ func ExampleAccountClient_BeginCreate_privateBatchAccountCreate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.AccountClientCreateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -309,7 +309,7 @@ func ExampleAccountClient_BeginCreate_privateBatchAccountCreate() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -344,7 +344,7 @@ func ExampleAccountClient_BeginDelete() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res @@ -372,7 +372,7 @@ func ExampleAccountClient_Get_batchAccountGet() { _ = 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 = armbatch.AccountClientGetResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -384,7 +384,7 @@ func ExampleAccountClient_Get_batchAccountGet() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -417,7 +417,7 @@ func ExampleAccountClient_Get_privateBatchAccountGet() { _ = 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 = armbatch.AccountClientGetResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -426,7 +426,7 @@ func ExampleAccountClient_Get_privateBatchAccountGet() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -475,7 +475,7 @@ func ExampleAccountClient_GetDetector() { _ = 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 = armbatch.AccountClientGetDetectorResponse{ - // DetectorResponse: &armbatch.DetectorResponse{ + // DetectorResponse: armbatch.DetectorResponse{ // Name: to.Ptr("poolsAndNodes"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/detectors"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/detectors/poolsAndNodes"), @@ -505,7 +505,7 @@ func ExampleAccountClient_GetKeys() { _ = 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 = armbatch.AccountClientGetKeysResponse{ - // AccountKeys: &armbatch.AccountKeys{ + // AccountKeys: armbatch.AccountKeys{ // AccountName: to.Ptr("sampleacct"), // Primary: to.Ptr("AAAA=="), // Secondary: to.Ptr("BBBB=="), @@ -550,7 +550,7 @@ func ExampleAccountClient_NewListPager() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -604,7 +604,7 @@ func ExampleAccountClient_NewListByResourceGroupPager() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), @@ -804,7 +804,7 @@ func ExampleAccountClient_RegenerateKey() { _ = 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 = armbatch.AccountClientRegenerateKeyResponse{ - // AccountKeys: &armbatch.AccountKeys{ + // AccountKeys: armbatch.AccountKeys{ // AccountName: to.Ptr("sampleacct"), // Primary: to.Ptr("AAAA=="), // Secondary: to.Ptr("BBBB=="), @@ -854,7 +854,7 @@ func ExampleAccountClient_Update() { _ = 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 = armbatch.AccountClientUpdateResponse{ - // Account: &armbatch.Account{ + // Account: armbatch.Account{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), @@ -866,7 +866,7 @@ func ExampleAccountClient_Update() { // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), // AutoStorage: &armbatch.AutoStorageProperties{ - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), + // LastKeySync: to.Ptr(time.Date(2016, time.March, 10, 23, 48, 38, 987847900, time.UTC)), // StorageAccountID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), // }, // DedicatedCoreQuota: to.Ptr[int32](20), diff --git a/sdk/resourcemanager/batch/armbatch/application_client.go b/sdk/resourcemanager/batch/armbatch/application_client.go index 83d6a4225949..b8f47263ea9b 100644 --- a/sdk/resourcemanager/batch/armbatch/application_client.go +++ b/sdk/resourcemanager/batch/armbatch/application_client.go @@ -19,6 +19,8 @@ import ( // ApplicationClient contains the methods for the Application group. // Don't use this type directly, use NewApplicationClient() instead. +// +// Generated from API version 2025-06-01 type ApplicationClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewApplicationClient(subscriptionID string, credential azcore.TokenCredenti // Create - Adds an application to the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -65,12 +65,7 @@ func (client *ApplicationClient) Create(ctx context.Context, resourceGroupName s if err != nil { return ApplicationClientCreateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err + return client.createHandleResponse(httpResp, http.StatusOK) } // createCreateRequest creates the Create request. @@ -97,8 +92,8 @@ func (client *ApplicationClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -108,8 +103,11 @@ func (client *ApplicationClient) createCreateRequest(ctx context.Context, resour } // createHandleResponse handles the Create response. -func (client *ApplicationClient) createHandleResponse(resp *http.Response) (ApplicationClientCreateResponse, error) { +func (client *ApplicationClient) createHandleResponse(resp *http.Response, successCodes ...int) (ApplicationClientCreateResponse, error) { result := ApplicationClientCreateResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationClientCreateResponse{}, err } @@ -118,8 +116,6 @@ func (client *ApplicationClient) createHandleResponse(resp *http.Response) (Appl // Delete - Deletes an application. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -141,8 +137,7 @@ func (client *ApplicationClient) Delete(ctx context.Context, resourceGroupName s return ApplicationClientDeleteResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return ApplicationClientDeleteResponse{}, err + return ApplicationClientDeleteResponse{}, runtime.NewResponseError(httpResp) } return ApplicationClientDeleteResponse{}, nil } @@ -171,15 +166,13 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified application. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -200,12 +193,7 @@ func (client *ApplicationClient) Get(ctx context.Context, resourceGroupName stri if err != nil { return ApplicationClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -232,15 +220,18 @@ func (client *ApplicationClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *ApplicationClient) getHandleResponse(resp *http.Response) (ApplicationClientGetResponse, error) { +func (client *ApplicationClient) getHandleResponse(resp *http.Response, successCodes ...int) (ApplicationClientGetResponse, error) { result := ApplicationClientGetResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationClientGetResponse{}, err } @@ -248,8 +239,6 @@ func (client *ApplicationClient) getHandleResponse(resp *http.Response) (Applica } // NewListPager - Lists all of the applications in the specified account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -266,50 +255,64 @@ func (client *ApplicationClient) NewListPager(resourceGroupName string, accountN if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) if err != nil { return ApplicationClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationClientListResponse{}, err + } + return client.listHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listCreateRequest creates the List request. -func (client *ApplicationClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *ApplicationClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *ApplicationClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, options *ApplicationClientListOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listHandleResponse handles the List response. -func (client *ApplicationClient) listHandleResponse(resp *http.Response) (ApplicationClientListResponse, error) { +func (client *ApplicationClient) listHandleResponse(resp *http.Response, successCodes ...int) (ApplicationClientListResponse, error) { result := ApplicationClientListResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ListApplicationsResult); err != nil { return ApplicationClientListResponse{}, err } @@ -318,8 +321,6 @@ func (client *ApplicationClient) listHandleResponse(resp *http.Response) (Applic // Update - Updates settings for the specified application. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -341,12 +342,7 @@ func (client *ApplicationClient) Update(ctx context.Context, resourceGroupName s if err != nil { return ApplicationClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return client.updateHandleResponse(httpResp, http.StatusOK) } // updateCreateRequest creates the Update request. @@ -373,8 +369,8 @@ func (client *ApplicationClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -384,8 +380,11 @@ func (client *ApplicationClient) updateCreateRequest(ctx context.Context, resour } // updateHandleResponse handles the Update response. -func (client *ApplicationClient) updateHandleResponse(resp *http.Response) (ApplicationClientUpdateResponse, error) { +func (client *ApplicationClient) updateHandleResponse(resp *http.Response, successCodes ...int) (ApplicationClientUpdateResponse, error) { result := ApplicationClientUpdateResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/application_client_example_test.go b/sdk/resourcemanager/batch/armbatch/application_client_example_test.go index 538899bfda15..606c33186e01 100644 --- a/sdk/resourcemanager/batch/armbatch/application_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/application_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -36,7 +36,7 @@ func ExampleApplicationClient_Create() { _ = 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 = armbatch.ApplicationClientCreateResponse{ - // Application: &armbatch.Application{ + // Application: armbatch.Application{ // Name: to.Ptr("app1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), @@ -89,7 +89,7 @@ func ExampleApplicationClient_Get() { _ = 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 = armbatch.ApplicationClientGetResponse{ - // Application: &armbatch.Application{ + // Application: armbatch.Application{ // Name: to.Ptr("app1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), @@ -176,7 +176,7 @@ func ExampleApplicationClient_Update() { _ = 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 = armbatch.ApplicationClientUpdateResponse{ - // Application: &armbatch.Application{ + // Application: armbatch.Application{ // Name: to.Ptr("app1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), diff --git a/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go b/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go index 1a4798dbc660..f082b101fd08 100644 --- a/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go +++ b/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go @@ -19,6 +19,8 @@ import ( // ApplicationPackageClient contains the methods for the ApplicationPackage group. // Don't use this type directly, use NewApplicationPackageClient() instead. +// +// Generated from API version 2025-06-01 type ApplicationPackageClient struct { internal *arm.Client subscriptionID string @@ -43,8 +45,6 @@ func NewApplicationPackageClient(subscriptionID string, credential azcore.TokenC // Activate - Activates the specified application package. This should be done after the `ApplicationPackage` was created // and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -68,12 +68,7 @@ func (client *ApplicationPackageClient) Activate(ctx context.Context, resourceGr if err != nil { return ApplicationPackageClientActivateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationPackageClientActivateResponse{}, err - } - resp, err := client.activateHandleResponse(httpResp) - return resp, err + return client.activateHandleResponse(httpResp, http.StatusOK) } // activateCreateRequest creates the Activate request. @@ -104,8 +99,8 @@ func (client *ApplicationPackageClient) activateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,8 +110,11 @@ func (client *ApplicationPackageClient) activateCreateRequest(ctx context.Contex } // activateHandleResponse handles the Activate response. -func (client *ApplicationPackageClient) activateHandleResponse(resp *http.Response) (ApplicationPackageClientActivateResponse, error) { +func (client *ApplicationPackageClient) activateHandleResponse(resp *http.Response, successCodes ...int) (ApplicationPackageClientActivateResponse, error) { result := ApplicationPackageClientActivateResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationPackage); err != nil { return ApplicationPackageClientActivateResponse{}, err } @@ -127,8 +125,6 @@ func (client *ApplicationPackageClient) activateHandleResponse(resp *http.Respon // Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. // If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -152,12 +148,7 @@ func (client *ApplicationPackageClient) Create(ctx context.Context, resourceGrou if err != nil { return ApplicationPackageClientCreateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationPackageClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err + return client.createHandleResponse(httpResp, http.StatusOK) } // createCreateRequest creates the Create request. @@ -188,8 +179,8 @@ func (client *ApplicationPackageClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -199,8 +190,11 @@ func (client *ApplicationPackageClient) createCreateRequest(ctx context.Context, } // createHandleResponse handles the Create response. -func (client *ApplicationPackageClient) createHandleResponse(resp *http.Response) (ApplicationPackageClientCreateResponse, error) { +func (client *ApplicationPackageClient) createHandleResponse(resp *http.Response, successCodes ...int) (ApplicationPackageClientCreateResponse, error) { result := ApplicationPackageClientCreateResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationPackage); err != nil { return ApplicationPackageClientCreateResponse{}, err } @@ -209,8 +203,6 @@ func (client *ApplicationPackageClient) createHandleResponse(resp *http.Response // Delete - Deletes an application package record and its associated binary file. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -234,8 +226,7 @@ func (client *ApplicationPackageClient) Delete(ctx context.Context, resourceGrou return ApplicationPackageClientDeleteResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return ApplicationPackageClientDeleteResponse{}, err + return ApplicationPackageClientDeleteResponse{}, runtime.NewResponseError(httpResp) } return ApplicationPackageClientDeleteResponse{}, nil } @@ -268,15 +259,13 @@ func (client *ApplicationPackageClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified application package. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -298,12 +287,7 @@ func (client *ApplicationPackageClient) Get(ctx context.Context, resourceGroupNa if err != nil { return ApplicationPackageClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ApplicationPackageClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -334,15 +318,18 @@ func (client *ApplicationPackageClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *ApplicationPackageClient) getHandleResponse(resp *http.Response) (ApplicationPackageClientGetResponse, error) { +func (client *ApplicationPackageClient) getHandleResponse(resp *http.Response, successCodes ...int) (ApplicationPackageClientGetResponse, error) { result := ApplicationPackageClientGetResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationPackage); err != nil { return ApplicationPackageClientGetResponse{}, err } @@ -350,8 +337,6 @@ func (client *ApplicationPackageClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists all of the application packages in the specified application. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -370,54 +355,68 @@ func (client *ApplicationPackageClient) NewListPager(resourceGroupName string, a if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, accountName, applicationName, options) - }, nil) + req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, applicationName, nextLink, options) if err != nil { return ApplicationPackageClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationPackageClientListResponse{}, err + } + return client.listHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listCreateRequest creates the List request. -func (client *ApplicationPackageClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, applicationName string, options *ApplicationPackageClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if applicationName == "" { - return nil, errors.New("parameter applicationName cannot be empty") +func (client *ApplicationPackageClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, applicationName string, nextLink string, options *ApplicationPackageClientListOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if applicationName == "" { + return nil, errors.New("parameter applicationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{applicationName}", url.PathEscape(applicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listHandleResponse handles the List response. -func (client *ApplicationPackageClient) listHandleResponse(resp *http.Response) (ApplicationPackageClientListResponse, error) { +func (client *ApplicationPackageClient) listHandleResponse(resp *http.Response, successCodes ...int) (ApplicationPackageClientListResponse, error) { result := ApplicationPackageClientListResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ListApplicationPackagesResult); err != nil { return ApplicationPackageClientListResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go b/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go index 5ed1d2601d0f..9773006ca9c0 100644 --- a/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -33,13 +33,13 @@ func ExampleApplicationPackageClient_Activate() { _ = 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 = armbatch.ApplicationPackageClientActivateResponse{ - // ApplicationPackage: &armbatch.ApplicationPackage{ + // ApplicationPackage: armbatch.ApplicationPackage{ // Name: to.Ptr("1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), // Properties: &armbatch.ApplicationPackageProperties{ // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), + // LastActivationTime: to.Ptr(time.Date(2017, time.June, 27, 18, 48, 9, 933099100, time.UTC)), // State: to.Ptr(armbatch.PackageStateActive), // }, // }, @@ -65,14 +65,14 @@ func ExampleApplicationPackageClient_Create() { _ = 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 = armbatch.ApplicationPackageClientCreateResponse{ - // ApplicationPackage: &armbatch.ApplicationPackage{ + // ApplicationPackage: armbatch.ApplicationPackage{ // Name: to.Ptr("1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), // Properties: &armbatch.ApplicationPackageProperties{ // State: to.Ptr(armbatch.PackageStatePending), // StorageURL: to.Ptr("http://mystorage1.blob.core.windows.net/myapp?mysas"), - // StorageURLExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), + // StorageURLExpiry: to.Ptr(time.Date(2017, time.June, 27, 18, 48, 9, 933099100, time.UTC)), // }, // }, // } @@ -119,13 +119,13 @@ func ExampleApplicationPackageClient_Get() { _ = 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 = armbatch.ApplicationPackageClientGetResponse{ - // ApplicationPackage: &armbatch.ApplicationPackage{ + // ApplicationPackage: armbatch.ApplicationPackage{ // Name: to.Ptr("1"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), // Properties: &armbatch.ApplicationPackageProperties{ // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), + // LastActivationTime: to.Ptr(time.Date(2017, time.June, 27, 18, 48, 9, 933099100, time.UTC)), // State: to.Ptr(armbatch.PackageStateActive), // }, // }, @@ -171,7 +171,7 @@ func ExampleApplicationPackageClient_NewListPager() { // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/2.0"), // Properties: &armbatch.ApplicationPackageProperties{ // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), + // LastActivationTime: to.Ptr(time.Date(2017, time.June, 27, 18, 48, 9, 933099100, time.UTC)), // State: to.Ptr(armbatch.PackageStateActive), // }, // }, diff --git a/sdk/resourcemanager/batch/armbatch/batchmanagement_live_test.go b/sdk/resourcemanager/batch/armbatch/batchmanagement_live_test.go index 9cc8aa9199cd..89d63c2a196c 100644 --- a/sdk/resourcemanager/batch/armbatch/batchmanagement_live_test.go +++ b/sdk/resourcemanager/batch/armbatch/batchmanagement_live_test.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armdeployments" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/batch/armbatch/constants.go b/sdk/resourcemanager/batch/armbatch/constants.go index 519a18b79f6e..1b174bce4b0b 100644 --- a/sdk/resourcemanager/batch/armbatch/constants.go +++ b/sdk/resourcemanager/batch/armbatch/constants.go @@ -4,6 +4,10 @@ package armbatch +const ( + version20250601 string = "2025-06-01" +) + // AccessRuleDirection - Direction of Access Rule type AccessRuleDirection string @@ -587,13 +591,21 @@ func PossibleNetworkSecurityGroupRuleAccessValues() []NetworkSecurityGroupRuleAc type NetworkSecurityPerimeterConfigurationProvisioningState string const ( - NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" - NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" - NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" - NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" - NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + // NetworkSecurityPerimeterConfigurationProvisioningStateAccepted - The configuration request was accepted and provisioning + // has not started yet. + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" + // NetworkSecurityPerimeterConfigurationProvisioningStateCanceled - The configuration provisioning was canceled. + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" + // NetworkSecurityPerimeterConfigurationProvisioningStateCreating - The configuration is being created. + NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" + // NetworkSecurityPerimeterConfigurationProvisioningStateDeleting - The configuration is being deleted. + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" + // NetworkSecurityPerimeterConfigurationProvisioningStateFailed - The configuration failed to provision. + NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + // NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded - The configuration was provisioned successfully. NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" - NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" + // NetworkSecurityPerimeterConfigurationProvisioningStateUpdating - The configuration is being updated. + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" ) // PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type. @@ -910,7 +922,9 @@ func PossibleSecurityTypesValues() []SecurityTypes { type Severity string const ( - SeverityError Severity = "Error" + // SeverityError - The issue is an error and prevents the configuration from being applied. + SeverityError Severity = "Error" + // SeverityWarning - The issue is a warning and does not prevent the configuration from being applied. SeverityWarning Severity = "Warning" ) diff --git a/sdk/resourcemanager/batch/armbatch/fake/account_server.go b/sdk/resourcemanager/batch/armbatch/fake/account_server.go index cdb00fa79edd..d5cc24442711 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/account_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/account_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" ) // AccountServer is a fake server for instances of the armbatch.AccountClient type. @@ -108,9 +109,7 @@ func (a *AccountServerTransport) Do(req *http.Request) (*http.Response, error) { } func (a *AccountServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -148,10 +147,7 @@ func (a *AccountServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -199,7 +195,7 @@ func (a *AccountServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { a.beginCreate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } @@ -243,7 +239,7 @@ func (a *AccountServerTransport) dispatchBeginDelete(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -277,7 +273,7 @@ func (a *AccountServerTransport) dispatchGet(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Account, req) @@ -314,7 +310,7 @@ func (a *AccountServerTransport) dispatchGetDetector(req *http.Request) (*http.R return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DetectorResponse, req) @@ -347,7 +343,7 @@ func (a *AccountServerTransport) dispatchGetKeys(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AccountKeys, req) @@ -380,7 +376,7 @@ func (a *AccountServerTransport) dispatchNewListPager(req *http.Request) (*http. if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -417,7 +413,7 @@ func (a *AccountServerTransport) dispatchNewListByResourceGroupPager(req *http.R if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -458,7 +454,7 @@ func (a *AccountServerTransport) dispatchNewListDetectorsPager(req *http.Request if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListDetectorsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -499,7 +495,7 @@ func (a *AccountServerTransport) dispatchNewListOutboundNetworkDependenciesEndpo if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListOutboundNetworkDependenciesEndpointsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -536,7 +532,7 @@ func (a *AccountServerTransport) dispatchRegenerateKey(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AccountKeys, req) @@ -569,7 +565,7 @@ func (a *AccountServerTransport) dispatchSynchronizeAutoStorageKeys(req *http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -606,7 +602,7 @@ func (a *AccountServerTransport) dispatchUpdate(req *http.Request) (*http.Respon return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Account, req) diff --git a/sdk/resourcemanager/batch/armbatch/fake/application_server.go b/sdk/resourcemanager/batch/armbatch/fake/application_server.go index e63cbb0ddddc..438777360092 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/application_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/application_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -71,9 +72,7 @@ func (a *ApplicationServerTransport) Do(req *http.Request) (*http.Response, erro } func (a *ApplicationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -97,10 +96,7 @@ func (a *ApplicationServerTransport) dispatchToMethodFake(req *http.Request, met } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -142,7 +138,7 @@ func (a *ApplicationServerTransport) dispatchCreate(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Application, req) @@ -179,7 +175,7 @@ func (a *ApplicationServerTransport) dispatchDelete(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -216,7 +212,7 @@ func (a *ApplicationServerTransport) dispatchGet(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Application, req) @@ -247,11 +243,7 @@ func (a *ApplicationServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -278,7 +270,7 @@ func (a *ApplicationServerTransport) dispatchNewListPager(req *http.Request) (*h if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -319,7 +311,7 @@ func (a *ApplicationServerTransport) dispatchUpdate(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Application, req) diff --git a/sdk/resourcemanager/batch/armbatch/fake/applicationpackage_server.go b/sdk/resourcemanager/batch/armbatch/fake/applicationpackage_server.go index ca106a8b3a6d..ccd3032acd1d 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/applicationpackage_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/applicationpackage_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -71,9 +72,7 @@ func (a *ApplicationPackageServerTransport) Do(req *http.Request) (*http.Respons } func (a *ApplicationPackageServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -97,10 +96,7 @@ func (a *ApplicationPackageServerTransport) dispatchToMethodFake(req *http.Reque } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -146,7 +142,7 @@ func (a *ApplicationPackageServerTransport) dispatchActivate(req *http.Request) return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationPackage, req) @@ -191,7 +187,7 @@ func (a *ApplicationPackageServerTransport) dispatchCreate(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationPackage, req) @@ -232,7 +228,7 @@ func (a *ApplicationPackageServerTransport) dispatchDelete(req *http.Request) (* return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} } resp, err := server.NewResponse(respContent, req, nil) @@ -273,7 +269,7 @@ func (a *ApplicationPackageServerTransport) dispatchGet(req *http.Request) (*htt return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApplicationPackage, req) @@ -308,11 +304,7 @@ func (a *ApplicationPackageServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -339,7 +331,7 @@ func (a *ApplicationPackageServerTransport) dispatchNewListPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/internal.go b/sdk/resourcemanager/batch/armbatch/fake/internal.go index d46bc9665f2e..1bd30c238b33 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/internal.go +++ b/sdk/resourcemanager/batch/armbatch/fake/internal.go @@ -24,15 +24,6 @@ func (nonRetriableError) NonRetriable() { // marker method } -func contains[T comparable](s []T, v T) bool { - for _, vv := range s { - if vv == v { - return true - } - } - return false -} - func getHeaderValue(h http.Header, k string) string { v := h[k] if len(v) == 0 { @@ -48,6 +39,14 @@ func getOptional[T any](v T) *T { return &v } +func initServer[T any](mu *sync.Mutex, dst **T, src func() *T) { + mu.Lock() + if *dst == nil { + *dst = src() + } + mu.Unlock() +} + func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { if v == "" { return nil, nil @@ -56,7 +55,7 @@ func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) if err != nil { return nil, err } - return &t, err + return &t, nil } func newTracker[T any]() *tracker[T] { diff --git a/sdk/resourcemanager/batch/armbatch/fake/location_server.go b/sdk/resourcemanager/batch/armbatch/fake/location_server.go index 5119c451c6fa..48ef8885aa01 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/location_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/location_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -63,9 +64,7 @@ func (l *LocationServerTransport) Do(req *http.Request) (*http.Response, error) } func (l *LocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -85,10 +84,7 @@ func (l *LocationServerTransport) dispatchToMethodFake(req *http.Request, method } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -122,7 +118,7 @@ func (l *LocationServerTransport) dispatchCheckNameAvailability(req *http.Reques return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CheckNameAvailabilityResult, req) @@ -151,7 +147,7 @@ func (l *LocationServerTransport) dispatchGetQuotas(req *http.Request) (*http.Re return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LocationQuota, req) @@ -178,11 +174,7 @@ func (l *LocationServerTransport) dispatchNewListSupportedVirtualMachineSKUsPage if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -192,11 +184,7 @@ func (l *LocationServerTransport) dispatchNewListSupportedVirtualMachineSKUsPage if err != nil { return nil, err } - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) + filterParam := getOptional(qp.Get("$filter")) var options *armbatch.LocationClientListSupportedVirtualMachineSKUsOptions if maxresultsParam != nil || filterParam != nil { options = &armbatch.LocationClientListSupportedVirtualMachineSKUsOptions{ @@ -215,7 +203,7 @@ func (l *LocationServerTransport) dispatchNewListSupportedVirtualMachineSKUsPage if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { l.newListSupportedVirtualMachineSKUsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/networksecurityperimeter_server.go b/sdk/resourcemanager/batch/armbatch/fake/networksecurityperimeter_server.go index f42091b2ac51..a55ab716ee61 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/networksecurityperimeter_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/networksecurityperimeter_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" ) // NetworkSecurityPerimeterServer is a fake server for instances of the armbatch.NetworkSecurityPerimeterClient type. @@ -64,9 +65,7 @@ func (n *NetworkSecurityPerimeterServerTransport) Do(req *http.Request) (*http.R } func (n *NetworkSecurityPerimeterServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -86,10 +85,7 @@ func (n *NetworkSecurityPerimeterServerTransport) dispatchToMethodFake(req *http } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -127,7 +123,7 @@ func (n *NetworkSecurityPerimeterServerTransport) dispatchGetConfiguration(req * return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) @@ -168,7 +164,7 @@ func (n *NetworkSecurityPerimeterServerTransport) dispatchNewListConfigurationsP if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { n.newListConfigurationsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -215,7 +211,7 @@ func (n *NetworkSecurityPerimeterServerTransport) dispatchBeginReconcileConfigur return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginReconcileConfiguration.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/operations_server.go b/sdk/resourcemanager/batch/armbatch/fake/operations_server.go index f4d721121386..49215b1fd71b 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/operations_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/operations_server.go @@ -11,8 +11,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" + "slices" ) // OperationsServer is a fake server for instances of the armbatch.OperationsClient type. @@ -51,9 +52,7 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error } func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -69,10 +68,7 @@ func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, meth } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -100,7 +96,7 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { o.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/pool_server.go b/sdk/resourcemanager/batch/armbatch/fake/pool_server.go index 281859aefa33..26119cdd2955 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/pool_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/pool_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -81,9 +82,7 @@ func (p *PoolServerTransport) Do(req *http.Request) (*http.Response, error) { } func (p *PoolServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -111,10 +110,7 @@ func (p *PoolServerTransport) dispatchToMethodFake(req *http.Request, method str } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -165,15 +161,15 @@ func (p *PoolServerTransport) dispatchCreate(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Pool, req) if err != nil { return nil, err } - if val := server.GetResponse(respr).ETag; val != nil { - resp.Header.Set("ETag", *val) + if val := server.GetResponse(respr).Etag; val != nil { + resp.Header.Set("Etag", *val) } return resp, nil } @@ -215,7 +211,7 @@ func (p *PoolServerTransport) dispatchBeginDelete(req *http.Request) (*http.Resp return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -253,15 +249,15 @@ func (p *PoolServerTransport) dispatchDisableAutoScale(req *http.Request) (*http return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Pool, req) if err != nil { return nil, err } - if val := server.GetResponse(respr).ETag; val != nil { - resp.Header.Set("ETag", *val) + if val := server.GetResponse(respr).Etag; val != nil { + resp.Header.Set("Etag", *val) } return resp, nil } @@ -293,15 +289,15 @@ func (p *PoolServerTransport) dispatchGet(req *http.Request) (*http.Response, er return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Pool, req) if err != nil { return nil, err } - if val := server.GetResponse(respr).ETag; val != nil { - resp.Header.Set("ETag", *val) + if val := server.GetResponse(respr).Etag; val != nil { + resp.Header.Set("Etag", *val) } return resp, nil } @@ -327,11 +323,7 @@ func (p *PoolServerTransport) dispatchNewListByBatchAccountPager(req *http.Reque if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -341,16 +333,8 @@ func (p *PoolServerTransport) dispatchNewListByBatchAccountPager(req *http.Reque if err != nil { return nil, err } - selectUnescaped, err := url.QueryUnescape(qp.Get("$select")) - if err != nil { - return nil, err - } - selectParam := getOptional(selectUnescaped) - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) + selectParam := getOptional(qp.Get("$select")) + filterParam := getOptional(qp.Get("$filter")) var options *armbatch.PoolClientListByBatchAccountOptions if maxresultsParam != nil || selectParam != nil || filterParam != nil { options = &armbatch.PoolClientListByBatchAccountOptions{ @@ -370,7 +354,7 @@ func (p *PoolServerTransport) dispatchNewListByBatchAccountPager(req *http.Reque if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListByBatchAccountPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -407,15 +391,15 @@ func (p *PoolServerTransport) dispatchStopResize(req *http.Request) (*http.Respo return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Pool, req) if err != nil { return nil, err } - if val := server.GetResponse(respr).ETag; val != nil { - resp.Header.Set("ETag", *val) + if val := server.GetResponse(respr).Etag; val != nil { + resp.Header.Set("Etag", *val) } return resp, nil } @@ -458,15 +442,15 @@ func (p *PoolServerTransport) dispatchUpdate(req *http.Request) (*http.Response, return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Pool, req) if err != nil { return nil, err } - if val := server.GetResponse(respr).ETag; val != nil { - resp.Header.Set("ETag", *val) + if val := server.GetResponse(respr).Etag; val != nil { + resp.Header.Set("Etag", *val) } return resp, nil } diff --git a/sdk/resourcemanager/batch/armbatch/fake/privateendpointconnection_server.go b/sdk/resourcemanager/batch/armbatch/fake/privateendpointconnection_server.go index 98d76d87f59a..6f4f9d733843 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/privateendpointconnection_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/privateendpointconnection_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -71,9 +72,7 @@ func (p *PrivateEndpointConnectionServerTransport) Do(req *http.Request) (*http. } func (p *PrivateEndpointConnectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -95,10 +94,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchToMethodFake(req *htt } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -146,7 +142,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } @@ -184,7 +180,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchGet(req *http.Request return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateEndpointConnection, req) @@ -215,11 +211,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchNewListByBatchAccount if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -246,7 +238,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchNewListByBatchAccount if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListByBatchAccountPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } @@ -304,7 +296,7 @@ func (p *PrivateEndpointConnectionServerTransport) dispatchBeginUpdate(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/privatelinkresource_server.go b/sdk/resourcemanager/batch/armbatch/fake/privatelinkresource_server.go index 39c8634375f1..1bfcffaeda0e 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/privatelinkresource_server.go +++ b/sdk/resourcemanager/batch/armbatch/fake/privatelinkresource_server.go @@ -12,10 +12,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "net/http" "net/url" "regexp" + "slices" "strconv" ) @@ -59,9 +60,7 @@ func (p *PrivateLinkResourceServerTransport) Do(req *http.Request) (*http.Respon } func (p *PrivateLinkResourceServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - + resultChan := make(chan result, 1) go func() { var intercepted bool var res result @@ -79,10 +78,7 @@ func (p *PrivateLinkResourceServerTransport) dispatchToMethodFake(req *http.Requ } } - select { - case resultChan <- res: - case <-req.Context().Done(): - } + resultChan <- res }() select { @@ -120,7 +116,7 @@ func (p *PrivateLinkResourceServerTransport) dispatchGet(req *http.Request) (*ht return nil, respErr } respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + if !slices.Contains([]int{http.StatusOK}, respContent.HTTPStatus) { return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} } resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).PrivateLinkResource, req) @@ -151,11 +147,7 @@ func (p *PrivateLinkResourceServerTransport) dispatchNewListByBatchAccountPager( if err != nil { return nil, err } - maxresultsUnescaped, err := url.QueryUnescape(qp.Get("maxresults")) - if err != nil { - return nil, err - } - maxresultsParam, err := parseOptional(maxresultsUnescaped, func(v string) (int32, error) { + maxresultsParam, err := parseOptional(qp.Get("maxresults"), func(v string) (int32, error) { p, parseErr := strconv.ParseInt(v, 10, 32) if parseErr != nil { return 0, parseErr @@ -182,7 +174,7 @@ func (p *PrivateLinkResourceServerTransport) dispatchNewListByBatchAccountPager( if err != nil { return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !slices.Contains([]int{http.StatusOK}, resp.StatusCode) { p.newListByBatchAccountPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } diff --git a/sdk/resourcemanager/batch/armbatch/fake/server_factory.go b/sdk/resourcemanager/batch/armbatch/fake/server_factory.go index 66c765a93e03..1a3868da52a0 100644 --- a/sdk/resourcemanager/batch/armbatch/fake/server_factory.go +++ b/sdk/resourcemanager/batch/armbatch/fake/server_factory.go @@ -82,37 +82,37 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { switch client { case "AccountClient": - initServer(s, &s.trAccountServer, func() *AccountServerTransport { return NewAccountServerTransport(&s.srv.AccountServer) }) + initServer(&s.trMu, &s.trAccountServer, func() *AccountServerTransport { return NewAccountServerTransport(&s.srv.AccountServer) }) resp, err = s.trAccountServer.Do(req) case "ApplicationClient": - initServer(s, &s.trApplicationServer, func() *ApplicationServerTransport { return NewApplicationServerTransport(&s.srv.ApplicationServer) }) + initServer(&s.trMu, &s.trApplicationServer, func() *ApplicationServerTransport { return NewApplicationServerTransport(&s.srv.ApplicationServer) }) resp, err = s.trApplicationServer.Do(req) case "ApplicationPackageClient": - initServer(s, &s.trApplicationPackageServer, func() *ApplicationPackageServerTransport { + initServer(&s.trMu, &s.trApplicationPackageServer, func() *ApplicationPackageServerTransport { return NewApplicationPackageServerTransport(&s.srv.ApplicationPackageServer) }) resp, err = s.trApplicationPackageServer.Do(req) case "LocationClient": - initServer(s, &s.trLocationServer, func() *LocationServerTransport { return NewLocationServerTransport(&s.srv.LocationServer) }) + initServer(&s.trMu, &s.trLocationServer, func() *LocationServerTransport { return NewLocationServerTransport(&s.srv.LocationServer) }) resp, err = s.trLocationServer.Do(req) case "NetworkSecurityPerimeterClient": - initServer(s, &s.trNetworkSecurityPerimeterServer, func() *NetworkSecurityPerimeterServerTransport { + initServer(&s.trMu, &s.trNetworkSecurityPerimeterServer, func() *NetworkSecurityPerimeterServerTransport { return NewNetworkSecurityPerimeterServerTransport(&s.srv.NetworkSecurityPerimeterServer) }) resp, err = s.trNetworkSecurityPerimeterServer.Do(req) case "OperationsClient": - initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + initServer(&s.trMu, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) case "PoolClient": - initServer(s, &s.trPoolServer, func() *PoolServerTransport { return NewPoolServerTransport(&s.srv.PoolServer) }) + initServer(&s.trMu, &s.trPoolServer, func() *PoolServerTransport { return NewPoolServerTransport(&s.srv.PoolServer) }) resp, err = s.trPoolServer.Do(req) case "PrivateEndpointConnectionClient": - initServer(s, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { + initServer(&s.trMu, &s.trPrivateEndpointConnectionServer, func() *PrivateEndpointConnectionServerTransport { return NewPrivateEndpointConnectionServerTransport(&s.srv.PrivateEndpointConnectionServer) }) resp, err = s.trPrivateEndpointConnectionServer.Do(req) case "PrivateLinkResourceClient": - initServer(s, &s.trPrivateLinkResourceServer, func() *PrivateLinkResourceServerTransport { + initServer(&s.trMu, &s.trPrivateLinkResourceServer, func() *PrivateLinkResourceServerTransport { return NewPrivateLinkResourceServerTransport(&s.srv.PrivateLinkResourceServer) }) resp, err = s.trPrivateLinkResourceServer.Do(req) @@ -126,11 +126,3 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } - -func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { - s.trMu.Lock() - if *dst == nil { - *dst = src() - } - s.trMu.Unlock() -} diff --git a/sdk/resourcemanager/batch/armbatch/go.mod b/sdk/resourcemanager/batch/armbatch/go.mod index ea05a17ccbe9..4144fef96d2b 100644 --- a/sdk/resourcemanager/batch/armbatch/go.mod +++ b/sdk/resourcemanager/batch/armbatch/go.mod @@ -1,9 +1,9 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5 go 1.25.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.2.0 diff --git a/sdk/resourcemanager/batch/armbatch/go.sum b/sdk/resourcemanager/batch/armbatch/go.sum index 3d9cede65b8d..4a313b7cea46 100644 --- a/sdk/resourcemanager/batch/armbatch/go.sum +++ b/sdk/resourcemanager/batch/armbatch/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 h1:aokoqcHvaGjiM3VpjKDfMMnF/8epJ+Q1HLJ7CudztqE= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0/go.mod h1:/WYEx9pcM9Y+Dd/APJaNlSvVSvzl54rrMdZT5+Oi2LM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.0 h1:4gRPBpN1f6xt88yi4WR26m7XaD9OlWtVT6bWPdGUIok= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.0/go.mod h1:G7QVLxw1j1JVyrO1MA95S8m8HStaaleDZYTcfGgjB2o= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 h1:CU4+EJeJi3TKYWEcYuSdWsjzw0nVsK/H0MSQOiPcymU= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0/go.mod h1:q0+UTSRvShwUCrR/s5HtyInYphN7Wvxb7snFM3u+SLA= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0 h1:xFaZZ+IubdftrDHnGGwZ6QvQ3KHTtWl2MCK+GMt2vxs= diff --git a/sdk/resourcemanager/batch/armbatch/location_client.go b/sdk/resourcemanager/batch/armbatch/location_client.go index 8fd3d2176c85..68697f18c9d1 100644 --- a/sdk/resourcemanager/batch/armbatch/location_client.go +++ b/sdk/resourcemanager/batch/armbatch/location_client.go @@ -19,6 +19,8 @@ import ( // LocationClient contains the methods for the Location group. // Don't use this type directly, use NewLocationClient() instead. +// +// Generated from API version 2025-06-01 type LocationClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewLocationClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks whether the Batch account name is available in the specified region. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - locationName - The desired region for the name check. // - parameters - Properties needed to check the availability of a name. // - options - LocationClientCheckNameAvailabilityOptions contains the optional parameters for the LocationClient.CheckNameAvailability @@ -62,12 +62,7 @@ func (client *LocationClient) CheckNameAvailability(ctx context.Context, locatio if err != nil { return LocationClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LocationClientCheckNameAvailabilityResponse{}, err - } - resp, err := client.checkNameAvailabilityHandleResponse(httpResp) - return resp, err + return client.checkNameAvailabilityHandleResponse(httpResp, http.StatusOK) } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -86,8 +81,8 @@ func (client *LocationClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -97,8 +92,11 @@ func (client *LocationClient) checkNameAvailabilityCreateRequest(ctx context.Con } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. -func (client *LocationClient) checkNameAvailabilityHandleResponse(resp *http.Response) (LocationClientCheckNameAvailabilityResponse, error) { +func (client *LocationClient) checkNameAvailabilityHandleResponse(resp *http.Response, successCodes ...int) (LocationClientCheckNameAvailabilityResponse, error) { result := LocationClientCheckNameAvailabilityResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResult); err != nil { return LocationClientCheckNameAvailabilityResponse{}, err } @@ -107,8 +105,6 @@ func (client *LocationClient) checkNameAvailabilityHandleResponse(resp *http.Res // GetQuotas - Gets the Batch service quotas for the specified subscription at the given location. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - locationName - The region for which to retrieve Batch service quotas. // - options - LocationClientGetQuotasOptions contains the optional parameters for the LocationClient.GetQuotas method. func (client *LocationClient) GetQuotas(ctx context.Context, locationName string, options *LocationClientGetQuotasOptions) (LocationClientGetQuotasResponse, error) { @@ -125,12 +121,7 @@ func (client *LocationClient) GetQuotas(ctx context.Context, locationName string if err != nil { return LocationClientGetQuotasResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LocationClientGetQuotasResponse{}, err - } - resp, err := client.getQuotasHandleResponse(httpResp) - return resp, err + return client.getQuotasHandleResponse(httpResp, http.StatusOK) } // getQuotasCreateRequest creates the GetQuotas request. @@ -149,15 +140,18 @@ func (client *LocationClient) getQuotasCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getQuotasHandleResponse handles the GetQuotas response. -func (client *LocationClient) getQuotasHandleResponse(resp *http.Response) (LocationClientGetQuotasResponse, error) { +func (client *LocationClient) getQuotasHandleResponse(resp *http.Response, successCodes ...int) (LocationClientGetQuotasResponse, error) { result := LocationClientGetQuotasResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.LocationQuota); err != nil { return LocationClientGetQuotasResponse{}, err } @@ -166,8 +160,6 @@ func (client *LocationClient) getQuotasHandleResponse(resp *http.Response) (Loca // NewListSupportedVirtualMachineSKUsPager - Gets the list of Batch supported Virtual Machine VM sizes available at the given // location. -// -// Generated from API version 2025-06-01 // - locationName - The region for which to retrieve Batch service supported SKUs. // - options - LocationClientListSupportedVirtualMachineSKUsOptions contains the optional parameters for the LocationClient.NewListSupportedVirtualMachineSKUsPager // method. @@ -182,49 +174,63 @@ func (client *LocationClient) NewListSupportedVirtualMachineSKUsPager(locationNa if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listSupportedVirtualMachineSKUsCreateRequest(ctx, locationName, options) - }, nil) + req, err := client.listSupportedVirtualMachineSKUsCreateRequest(ctx, locationName, nextLink, options) + if err != nil { + return LocationClientListSupportedVirtualMachineSKUsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationClientListSupportedVirtualMachineSKUsResponse{}, err } - return client.listSupportedVirtualMachineSKUsHandleResponse(resp) + return client.listSupportedVirtualMachineSKUsHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listSupportedVirtualMachineSKUsCreateRequest creates the ListSupportedVirtualMachineSKUs request. -func (client *LocationClient) listSupportedVirtualMachineSKUsCreateRequest(ctx context.Context, locationName string, options *LocationClientListSupportedVirtualMachineSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if locationName == "" { - return nil, errors.New("parameter locationName cannot be empty") +func (client *LocationClient) listSupportedVirtualMachineSKUsCreateRequest(ctx context.Context, locationName string, nextLink string, options *LocationClientListSupportedVirtualMachineSKUsOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) + if firstPage { + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listSupportedVirtualMachineSKUsHandleResponse handles the ListSupportedVirtualMachineSKUs response. -func (client *LocationClient) listSupportedVirtualMachineSKUsHandleResponse(resp *http.Response) (LocationClientListSupportedVirtualMachineSKUsResponse, error) { +func (client *LocationClient) listSupportedVirtualMachineSKUsHandleResponse(resp *http.Response, successCodes ...int) (LocationClientListSupportedVirtualMachineSKUsResponse, error) { result := LocationClientListSupportedVirtualMachineSKUsResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.SupportedSKUsResult); err != nil { return LocationClientListSupportedVirtualMachineSKUsResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/location_client_example_test.go b/sdk/resourcemanager/batch/armbatch/location_client_example_test.go index 9601dd852148..5e4aad0e89da 100644 --- a/sdk/resourcemanager/batch/armbatch/location_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/location_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -34,7 +34,7 @@ func ExampleLocationClient_CheckNameAvailability_locationCheckNameAvailabilityAl _ = 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 = armbatch.LocationClientCheckNameAvailabilityResponse{ - // CheckNameAvailabilityResult: &armbatch.CheckNameAvailabilityResult{ + // CheckNameAvailabilityResult: armbatch.CheckNameAvailabilityResult{ // Message: to.Ptr("An account named 'existingaccountname' is already in use."), // NameAvailable: to.Ptr(false), // Reason: to.Ptr(armbatch.NameAvailabilityReasonAlreadyExists), @@ -64,7 +64,7 @@ func ExampleLocationClient_CheckNameAvailability_locationCheckNameAvailabilityAv _ = 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 = armbatch.LocationClientCheckNameAvailabilityResponse{ - // CheckNameAvailabilityResult: &armbatch.CheckNameAvailabilityResult{ + // CheckNameAvailabilityResult: armbatch.CheckNameAvailabilityResult{ // NameAvailable: to.Ptr(true), // }, // } @@ -89,7 +89,7 @@ func ExampleLocationClient_GetQuotas() { _ = 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 = armbatch.LocationClientGetQuotasResponse{ - // LocationQuota: &armbatch.LocationQuota{ + // LocationQuota: armbatch.LocationQuota{ // AccountQuota: to.Ptr[int32](1), // }, // } @@ -156,7 +156,7 @@ func ExampleLocationClient_NewListSupportedVirtualMachineSKUsPager() { // }, // { // Name: to.Ptr("Standard_A1"), - // BatchSupportEndOfLife: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-31T00:00:00Z"); return t}()), + // BatchSupportEndOfLife: to.Ptr(time.Date(2024, time.August, 31, 0, 0, 0, 0, time.UTC)), // Capabilities: []*armbatch.SKUCapability{ // { // Name: to.Ptr("MaxResourceVolumeMB"), diff --git a/sdk/resourcemanager/batch/armbatch/models.go b/sdk/resourcemanager/batch/armbatch/models.go index 6a3ab1443a74..aa320cd9c3f4 100644 --- a/sdk/resourcemanager/batch/armbatch/models.go +++ b/sdk/resourcemanager/batch/armbatch/models.go @@ -9,7 +9,9 @@ import "time" // AccessRule - Access rule in a network security perimeter configuration profile type AccessRule struct { // Name of the access rule - Name *string + Name *string + + // Properties of the access rule Properties *AccessRuleProperties } @@ -17,7 +19,9 @@ type AccessRule struct { type AccessRuleProperties struct { // Address prefixes in the CIDR format for inbound rules AddressPrefixes []*string - Direction *AccessRuleDirection + + // Direction of the access rule + Direction *AccessRuleDirection // Email addresses for outbound rules EmailAddresses []*string @@ -1306,6 +1310,7 @@ type NetworkSecurityPerimeter struct { // NetworkSecurityPerimeterConfiguration - Network security perimeter (NSP) configuration resource type NetworkSecurityPerimeterConfiguration struct { + // Network security configuration properties. Properties *NetworkSecurityPerimeterConfigurationProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1321,25 +1326,30 @@ type NetworkSecurityPerimeterConfiguration struct { Type *string } -// NetworkSecurityPerimeterConfigurationListResult - Result of a list NSP (network security perimeter) configurations request. +// NetworkSecurityPerimeterConfigurationListResult - The response of a NetworkSecurityPerimeterConfiguration list operation. type NetworkSecurityPerimeterConfigurationListResult struct { - // The link used to get the next page of results. - NextLink *string - - // Array of network security perimeter results. + // REQUIRED; The NetworkSecurityPerimeterConfiguration items on this page Value []*NetworkSecurityPerimeterConfiguration + + // The link to the next page of items + NextLink *string } // NetworkSecurityPerimeterConfigurationProperties - Network security configuration properties. type NetworkSecurityPerimeterConfigurationProperties struct { + // Information about the network security perimeter (NSP) NetworkSecurityPerimeter *NetworkSecurityPerimeter - Profile *NetworkSecurityProfile - ResourceAssociation *ResourceAssociation + + // Network security perimeter configuration profile + Profile *NetworkSecurityProfile + + // Information about the resource association + ResourceAssociation *ResourceAssociation // READ-ONLY; List of provisioning issues, if any ProvisioningIssues []*ProvisioningIssue - // READ-ONLY + // READ-ONLY; Provisioning state of the network security perimeter configuration ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState } @@ -1787,7 +1797,7 @@ type ProvisioningIssue struct { // READ-ONLY; Name of the issue Name *string - // READ-ONLY + // READ-ONLY; Details of the provisioning issue Properties *ProvisioningIssueProperties } @@ -1906,6 +1916,7 @@ type ResizeOperationStatus struct { // ResourceAssociation - Information about resource association type ResourceAssociation struct { + // Access mode of the resource association AccessMode *ResourceAssociationAccessMode // Name of the resource association diff --git a/sdk/resourcemanager/batch/armbatch/models_serde.go b/sdk/resourcemanager/batch/armbatch/models_serde.go index 4ad44dd2f0fe..d2b14aa6d077 100644 --- a/sdk/resourcemanager/batch/armbatch/models_serde.go +++ b/sdk/resourcemanager/batch/armbatch/models_serde.go @@ -25,7 +25,7 @@ func (a AccessRule) MarshalJSON() ([]byte, error) { func (a *AccessRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -38,7 +38,7 @@ func (a *AccessRule) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -61,7 +61,7 @@ func (a AccessRuleProperties) MarshalJSON() ([]byte, error) { func (a *AccessRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -89,7 +89,7 @@ func (a *AccessRuleProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -106,7 +106,7 @@ func (a AccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) { func (a *AccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -116,7 +116,7 @@ func (a *AccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -140,7 +140,7 @@ func (a Account) MarshalJSON() ([]byte, error) { func (a *Account) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -171,7 +171,7 @@ func (a *Account) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -191,7 +191,7 @@ func (a AccountCreateParameters) MarshalJSON() ([]byte, error) { func (a *AccountCreateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -210,7 +210,7 @@ func (a *AccountCreateParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -233,7 +233,7 @@ func (a AccountCreateProperties) MarshalJSON() ([]byte, error) { func (a *AccountCreateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -261,7 +261,7 @@ func (a *AccountCreateProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -281,7 +281,7 @@ func (a AccountIdentity) MarshalJSON() ([]byte, error) { func (a *AccountIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -300,7 +300,7 @@ func (a *AccountIdentity) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -319,7 +319,7 @@ func (a AccountKeys) MarshalJSON() ([]byte, error) { func (a *AccountKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -335,7 +335,7 @@ func (a *AccountKeys) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -353,7 +353,7 @@ func (a AccountListResult) MarshalJSON() ([]byte, error) { func (a *AccountListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -366,7 +366,7 @@ func (a *AccountListResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -399,7 +399,7 @@ func (a AccountProperties) MarshalJSON() ([]byte, error) { func (a *AccountProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -457,7 +457,7 @@ func (a *AccountProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -474,7 +474,7 @@ func (a AccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) { func (a *AccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -484,7 +484,7 @@ func (a *AccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -503,7 +503,7 @@ func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) { func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -519,7 +519,7 @@ func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -540,7 +540,7 @@ func (a AccountUpdateProperties) MarshalJSON() ([]byte, error) { func (a *AccountUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -562,7 +562,7 @@ func (a *AccountUpdateProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -579,7 +579,7 @@ func (a ActivateApplicationPackageParameters) MarshalJSON() ([]byte, error) { func (a *ActivateApplicationPackageParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -589,7 +589,7 @@ func (a *ActivateApplicationPackageParameters) UnmarshalJSON(data []byte) error delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -612,7 +612,7 @@ func (a Application) MarshalJSON() ([]byte, error) { func (a *Application) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -640,7 +640,7 @@ func (a *Application) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -663,7 +663,7 @@ func (a ApplicationPackage) MarshalJSON() ([]byte, error) { func (a *ApplicationPackage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -691,7 +691,7 @@ func (a *ApplicationPackage) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -701,10 +701,10 @@ func (a *ApplicationPackage) UnmarshalJSON(data []byte) error { func (a ApplicationPackageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "format", a.Format) - populateTime[datetime.RFC3339](objectMap, "lastActivationTime", a.LastActivationTime) + populateTime[datetime.RFC3339](objectMap, "lastActivationTime", a.LastActivationTime, true) populate(objectMap, "state", a.State) populate(objectMap, "storageUrl", a.StorageURL) - populateTime[datetime.RFC3339](objectMap, "storageUrlExpiry", a.StorageURLExpiry) + populateTime[datetime.RFC3339](objectMap, "storageUrlExpiry", a.StorageURLExpiry, true) return json.Marshal(objectMap) } @@ -712,7 +712,7 @@ func (a ApplicationPackageProperties) MarshalJSON() ([]byte, error) { func (a *ApplicationPackageProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -734,7 +734,7 @@ func (a *ApplicationPackageProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -752,7 +752,7 @@ func (a ApplicationPackageReference) MarshalJSON() ([]byte, error) { func (a *ApplicationPackageReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -765,7 +765,7 @@ func (a *ApplicationPackageReference) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -784,7 +784,7 @@ func (a ApplicationProperties) MarshalJSON() ([]byte, error) { func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -800,7 +800,7 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -810,7 +810,7 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { func (a AutoScaleRun) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", a.Error) - populateTime[datetime.RFC3339](objectMap, "evaluationTime", a.EvaluationTime) + populateTime[datetime.RFC3339](objectMap, "evaluationTime", a.EvaluationTime, true) populate(objectMap, "results", a.Results) return json.Marshal(objectMap) } @@ -819,7 +819,7 @@ func (a AutoScaleRun) MarshalJSON() ([]byte, error) { func (a *AutoScaleRun) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -835,7 +835,7 @@ func (a *AutoScaleRun) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -854,7 +854,7 @@ func (a AutoScaleRunError) MarshalJSON() ([]byte, error) { func (a *AutoScaleRunError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -870,7 +870,7 @@ func (a *AutoScaleRunError) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -888,7 +888,7 @@ func (a AutoScaleSettings) MarshalJSON() ([]byte, error) { func (a *AutoScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -901,7 +901,7 @@ func (a *AutoScaleSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -920,7 +920,7 @@ func (a AutoStorageBaseProperties) MarshalJSON() ([]byte, error) { func (a *AutoStorageBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -936,7 +936,7 @@ func (a *AutoStorageBaseProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -946,7 +946,7 @@ func (a *AutoStorageBaseProperties) UnmarshalJSON(data []byte) error { func (a AutoStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationMode", a.AuthenticationMode) - populateTime[datetime.RFC3339](objectMap, "lastKeySync", a.LastKeySync) + populateTime[datetime.RFC3339](objectMap, "lastKeySync", a.LastKeySync, true) populate(objectMap, "nodeIdentityReference", a.NodeIdentityReference) populate(objectMap, "storageAccountId", a.StorageAccountID) return json.Marshal(objectMap) @@ -956,7 +956,7 @@ func (a AutoStorageProperties) MarshalJSON() ([]byte, error) { func (a *AutoStorageProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -975,7 +975,7 @@ func (a *AutoStorageProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -993,7 +993,7 @@ func (a AutoUserSpecification) MarshalJSON() ([]byte, error) { func (a *AutoUserSpecification) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -1006,7 +1006,7 @@ func (a *AutoUserSpecification) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -1026,7 +1026,7 @@ func (a AutomaticOSUpgradePolicy) MarshalJSON() ([]byte, error) { func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -1045,7 +1045,7 @@ func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -1068,7 +1068,7 @@ func (a AzureBlobFileSystemConfiguration) MarshalJSON() ([]byte, error) { func (a *AzureBlobFileSystemConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -1096,7 +1096,7 @@ func (a *AzureBlobFileSystemConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -1117,7 +1117,7 @@ func (a AzureFileShareConfiguration) MarshalJSON() ([]byte, error) { func (a *AzureFileShareConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } for key, val := range rawMsg { var err error @@ -1139,7 +1139,7 @@ func (a *AzureFileShareConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %s", a, err.Error()) } } return nil @@ -1160,7 +1160,7 @@ func (c CIFSMountConfiguration) MarshalJSON() ([]byte, error) { func (c *CIFSMountConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1182,7 +1182,7 @@ func (c *CIFSMountConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1200,7 +1200,7 @@ func (c CheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1213,7 +1213,7 @@ func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1232,7 +1232,7 @@ func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1248,7 +1248,7 @@ func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1265,7 +1265,7 @@ func (c ComputeNodeIdentityReference) MarshalJSON() ([]byte, error) { func (c *ComputeNodeIdentityReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1275,7 +1275,7 @@ func (c *ComputeNodeIdentityReference) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1294,7 +1294,7 @@ func (c ContainerConfiguration) MarshalJSON() ([]byte, error) { func (c *ContainerConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1310,7 +1310,7 @@ func (c *ContainerConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1328,7 +1328,7 @@ func (c ContainerHostBatchBindMountEntry) MarshalJSON() ([]byte, error) { func (c *ContainerHostBatchBindMountEntry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1341,7 +1341,7 @@ func (c *ContainerHostBatchBindMountEntry) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1361,7 +1361,7 @@ func (c ContainerRegistry) MarshalJSON() ([]byte, error) { func (c *ContainerRegistry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } for key, val := range rawMsg { var err error @@ -1380,7 +1380,7 @@ func (c *ContainerRegistry) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %s", c, err.Error()) } } return nil @@ -1400,7 +1400,7 @@ func (d DataDisk) MarshalJSON() ([]byte, error) { func (d *DataDisk) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1419,7 +1419,7 @@ func (d *DataDisk) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1436,7 +1436,7 @@ func (d DeploymentConfiguration) MarshalJSON() ([]byte, error) { func (d *DeploymentConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1446,7 +1446,7 @@ func (d *DeploymentConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1464,7 +1464,7 @@ func (d DetectorListResult) MarshalJSON() ([]byte, error) { func (d *DetectorListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1477,7 +1477,7 @@ func (d *DetectorListResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1500,7 +1500,7 @@ func (d DetectorResponse) MarshalJSON() ([]byte, error) { func (d *DetectorResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1528,7 +1528,7 @@ func (d *DetectorResponse) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1545,7 +1545,7 @@ func (d DetectorResponseProperties) MarshalJSON() ([]byte, error) { func (d *DetectorResponseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1555,7 +1555,7 @@ func (d *DetectorResponseProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1574,7 +1574,7 @@ func (d DiffDiskSettings) MarshalJSON() ([]byte, error) { func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1584,7 +1584,7 @@ func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1603,7 +1603,7 @@ func (d DiskCustomerManagedKey) MarshalJSON() ([]byte, error) { func (d *DiskCustomerManagedKey) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1619,7 +1619,7 @@ func (d *DiskCustomerManagedKey) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1637,7 +1637,7 @@ func (d DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) { func (d *DiskEncryptionConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1650,7 +1650,7 @@ func (d *DiskEncryptionConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1667,7 +1667,7 @@ func (d DiskEncryptionSetParameters) MarshalJSON() ([]byte, error) { func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } for key, val := range rawMsg { var err error @@ -1677,7 +1677,7 @@ func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %s", d, err.Error()) } } return nil @@ -1695,7 +1695,7 @@ func (e EncryptionProperties) MarshalJSON() ([]byte, error) { func (e *EncryptionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } for key, val := range rawMsg { var err error @@ -1708,7 +1708,7 @@ func (e *EncryptionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } } return nil @@ -1726,7 +1726,7 @@ func (e EndpointAccessProfile) MarshalJSON() ([]byte, error) { func (e *EndpointAccessProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } for key, val := range rawMsg { var err error @@ -1739,7 +1739,7 @@ func (e *EndpointAccessProfile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } } return nil @@ -1758,7 +1758,7 @@ func (e EndpointDependency) MarshalJSON() ([]byte, error) { func (e *EndpointDependency) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } for key, val := range rawMsg { var err error @@ -1774,7 +1774,7 @@ func (e *EndpointDependency) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } } return nil @@ -1791,7 +1791,7 @@ func (e EndpointDetail) MarshalJSON() ([]byte, error) { func (e *EndpointDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } for key, val := range rawMsg { var err error @@ -1801,7 +1801,7 @@ func (e *EndpointDetail) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } } return nil @@ -1819,7 +1819,7 @@ func (e EnvironmentSetting) MarshalJSON() ([]byte, error) { func (e *EnvironmentSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } for key, val := range rawMsg { var err error @@ -1832,7 +1832,7 @@ func (e *EnvironmentSetting) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %s", e, err.Error()) } } return nil @@ -1852,7 +1852,7 @@ func (f FixedScaleSettings) MarshalJSON() ([]byte, error) { func (f *FixedScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %s", f, err.Error()) } for key, val := range rawMsg { var err error @@ -1871,7 +1871,7 @@ func (f *FixedScaleSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %s", f, err.Error()) } } return nil @@ -1889,7 +1889,7 @@ func (h HostEndpointSettings) MarshalJSON() ([]byte, error) { func (h *HostEndpointSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %s", h, err.Error()) } for key, val := range rawMsg { var err error @@ -1902,7 +1902,7 @@ func (h *HostEndpointSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %s", h, err.Error()) } } return nil @@ -1920,7 +1920,7 @@ func (i IPRule) MarshalJSON() ([]byte, error) { func (i *IPRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } for key, val := range rawMsg { var err error @@ -1933,7 +1933,7 @@ func (i *IPRule) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } } return nil @@ -1951,7 +1951,7 @@ func (i IPTag) MarshalJSON() ([]byte, error) { func (i *IPTag) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } for key, val := range rawMsg { var err error @@ -1964,7 +1964,7 @@ func (i *IPTag) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } } return nil @@ -1987,7 +1987,7 @@ func (i ImageReference) MarshalJSON() ([]byte, error) { func (i *ImageReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } for key, val := range rawMsg { var err error @@ -2015,7 +2015,7 @@ func (i *ImageReference) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } } return nil @@ -2037,7 +2037,7 @@ func (i InboundNatPool) MarshalJSON() ([]byte, error) { func (i *InboundNatPool) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } for key, val := range rawMsg { var err error @@ -2062,7 +2062,7 @@ func (i *InboundNatPool) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %s", i, err.Error()) } } return nil @@ -2079,7 +2079,7 @@ func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %s", k, err.Error()) } for key, val := range rawMsg { var err error @@ -2089,7 +2089,7 @@ func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %s", k, err.Error()) } } return nil @@ -2107,7 +2107,7 @@ func (k KeyVaultReference) MarshalJSON() ([]byte, error) { func (k *KeyVaultReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %s", k, err.Error()) } for key, val := range rawMsg { var err error @@ -2120,7 +2120,7 @@ func (k *KeyVaultReference) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %s", k, err.Error()) } } return nil @@ -2139,7 +2139,7 @@ func (l LinuxUserConfiguration) MarshalJSON() ([]byte, error) { func (l *LinuxUserConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2155,7 +2155,7 @@ func (l *LinuxUserConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2173,7 +2173,7 @@ func (l ListApplicationPackagesResult) MarshalJSON() ([]byte, error) { func (l *ListApplicationPackagesResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2186,7 +2186,7 @@ func (l *ListApplicationPackagesResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2204,7 +2204,7 @@ func (l ListApplicationsResult) MarshalJSON() ([]byte, error) { func (l *ListApplicationsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2217,7 +2217,7 @@ func (l *ListApplicationsResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2235,7 +2235,7 @@ func (l ListPoolsResult) MarshalJSON() ([]byte, error) { func (l *ListPoolsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2248,7 +2248,7 @@ func (l *ListPoolsResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2266,7 +2266,7 @@ func (l ListPrivateEndpointConnectionsResult) MarshalJSON() ([]byte, error) { func (l *ListPrivateEndpointConnectionsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2279,7 +2279,7 @@ func (l *ListPrivateEndpointConnectionsResult) UnmarshalJSON(data []byte) error delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2297,7 +2297,7 @@ func (l ListPrivateLinkResourcesResult) MarshalJSON() ([]byte, error) { func (l *ListPrivateLinkResourcesResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2310,7 +2310,7 @@ func (l *ListPrivateLinkResourcesResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2327,7 +2327,7 @@ func (l LocationQuota) MarshalJSON() ([]byte, error) { func (l *LocationQuota) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } for key, val := range rawMsg { var err error @@ -2337,7 +2337,7 @@ func (l *LocationQuota) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %s", l, err.Error()) } } return nil @@ -2356,7 +2356,7 @@ func (m ManagedDisk) MarshalJSON() ([]byte, error) { func (m *ManagedDisk) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } for key, val := range rawMsg { var err error @@ -2372,7 +2372,7 @@ func (m *ManagedDisk) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } } return nil @@ -2390,7 +2390,7 @@ func (m MetadataItem) MarshalJSON() ([]byte, error) { func (m *MetadataItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } for key, val := range rawMsg { var err error @@ -2403,7 +2403,7 @@ func (m *MetadataItem) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } } return nil @@ -2423,7 +2423,7 @@ func (m MountConfiguration) MarshalJSON() ([]byte, error) { func (m *MountConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } for key, val := range rawMsg { var err error @@ -2442,7 +2442,7 @@ func (m *MountConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %s", m, err.Error()) } } return nil @@ -2461,7 +2461,7 @@ func (n NFSMountConfiguration) MarshalJSON() ([]byte, error) { func (n *NFSMountConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2477,7 +2477,7 @@ func (n *NFSMountConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2498,7 +2498,7 @@ func (n NetworkConfiguration) MarshalJSON() ([]byte, error) { func (n *NetworkConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2520,7 +2520,7 @@ func (n *NetworkConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2538,7 +2538,7 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { func (n *NetworkProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2551,7 +2551,7 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2571,7 +2571,7 @@ func (n NetworkSecurityGroupRule) MarshalJSON() ([]byte, error) { func (n *NetworkSecurityGroupRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2590,7 +2590,7 @@ func (n *NetworkSecurityGroupRule) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2609,7 +2609,7 @@ func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2625,7 +2625,7 @@ func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2646,7 +2646,7 @@ func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2668,7 +2668,7 @@ func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2686,7 +2686,7 @@ func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, func (n *NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2699,7 +2699,7 @@ func (n *NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON(data []b delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2720,7 +2720,7 @@ func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2742,7 +2742,7 @@ func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []b delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2763,7 +2763,7 @@ func (n NetworkSecurityProfile) MarshalJSON() ([]byte, error) { func (n *NetworkSecurityProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2785,7 +2785,7 @@ func (n *NetworkSecurityProfile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2802,7 +2802,7 @@ func (n NodePlacementConfiguration) MarshalJSON() ([]byte, error) { func (n *NodePlacementConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } for key, val := range rawMsg { var err error @@ -2812,7 +2812,7 @@ func (n *NodePlacementConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %s", n, err.Error()) } } return nil @@ -2833,7 +2833,7 @@ func (o OSDisk) MarshalJSON() ([]byte, error) { func (o *OSDisk) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -2855,7 +2855,7 @@ func (o *OSDisk) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -2876,7 +2876,7 @@ func (o Operation) MarshalJSON() ([]byte, error) { func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -2898,7 +2898,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -2918,7 +2918,7 @@ func (o OperationDisplay) MarshalJSON() ([]byte, error) { func (o *OperationDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -2937,7 +2937,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -2955,7 +2955,7 @@ func (o OperationListResult) MarshalJSON() ([]byte, error) { func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -2968,7 +2968,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -2986,7 +2986,7 @@ func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -2999,7 +2999,7 @@ func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -3017,7 +3017,7 @@ func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } for key, val := range rawMsg { var err error @@ -3030,7 +3030,7 @@ func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(data []byte) error delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %s", o, err.Error()) } } return nil @@ -3054,7 +3054,7 @@ func (p Pool) MarshalJSON() ([]byte, error) { func (p *Pool) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3085,7 +3085,7 @@ func (p *Pool) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3102,7 +3102,7 @@ func (p PoolEndpointConfiguration) MarshalJSON() ([]byte, error) { func (p *PoolEndpointConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3112,7 +3112,7 @@ func (p *PoolEndpointConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3130,7 +3130,7 @@ func (p PoolIdentity) MarshalJSON() ([]byte, error) { func (p *PoolIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3143,7 +3143,7 @@ func (p *PoolIdentity) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3153,21 +3153,21 @@ func (p *PoolIdentity) UnmarshalJSON(data []byte) error { func (p PoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allocationState", p.AllocationState) - populateTime[datetime.RFC3339](objectMap, "allocationStateTransitionTime", p.AllocationStateTransitionTime) + populateTime[datetime.RFC3339](objectMap, "allocationStateTransitionTime", p.AllocationStateTransitionTime, true) populate(objectMap, "applicationPackages", p.ApplicationPackages) populate(objectMap, "autoScaleRun", p.AutoScaleRun) - populateTime[datetime.RFC3339](objectMap, "creationTime", p.CreationTime) + populateTime[datetime.RFC3339](objectMap, "creationTime", p.CreationTime, true) populate(objectMap, "currentDedicatedNodes", p.CurrentDedicatedNodes) populate(objectMap, "currentLowPriorityNodes", p.CurrentLowPriorityNodes) populate(objectMap, "deploymentConfiguration", p.DeploymentConfiguration) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "interNodeCommunication", p.InterNodeCommunication) - populateTime[datetime.RFC3339](objectMap, "lastModified", p.LastModified) + populateTime[datetime.RFC3339](objectMap, "lastModified", p.LastModified, true) populate(objectMap, "metadata", p.Metadata) populate(objectMap, "mountConfiguration", p.MountConfiguration) populate(objectMap, "networkConfiguration", p.NetworkConfiguration) populate(objectMap, "provisioningState", p.ProvisioningState) - populateTime[datetime.RFC3339](objectMap, "provisioningStateTransitionTime", p.ProvisioningStateTransitionTime) + populateTime[datetime.RFC3339](objectMap, "provisioningStateTransitionTime", p.ProvisioningStateTransitionTime, true) populate(objectMap, "resizeOperationStatus", p.ResizeOperationStatus) populate(objectMap, "scaleSettings", p.ScaleSettings) populate(objectMap, "startTask", p.StartTask) @@ -3183,7 +3183,7 @@ func (p PoolProperties) MarshalJSON() ([]byte, error) { func (p *PoolProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3262,7 +3262,7 @@ func (p *PoolProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3279,7 +3279,7 @@ func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3289,7 +3289,7 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3312,7 +3312,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3340,7 +3340,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3360,7 +3360,7 @@ func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3379,7 +3379,7 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3402,7 +3402,7 @@ func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3430,7 +3430,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3449,7 +3449,7 @@ func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3465,7 +3465,7 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3484,7 +3484,7 @@ func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3500,7 +3500,7 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3518,7 +3518,7 @@ func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3531,7 +3531,7 @@ func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3552,7 +3552,7 @@ func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3574,7 +3574,7 @@ func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3593,7 +3593,7 @@ func (p ProxyAgentSettings) MarshalJSON() ([]byte, error) { func (p *ProxyAgentSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3609,7 +3609,7 @@ func (p *ProxyAgentSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3629,7 +3629,7 @@ func (p PublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { func (p *PublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } for key, val := range rawMsg { var err error @@ -3648,7 +3648,7 @@ func (p *PublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %s", p, err.Error()) } } return nil @@ -3667,7 +3667,7 @@ func (r ResizeError) MarshalJSON() ([]byte, error) { func (r *ResizeError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } for key, val := range rawMsg { var err error @@ -3683,7 +3683,7 @@ func (r *ResizeError) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } } return nil @@ -3695,7 +3695,7 @@ func (r ResizeOperationStatus) MarshalJSON() ([]byte, error) { populate(objectMap, "errors", r.Errors) populate(objectMap, "nodeDeallocationOption", r.NodeDeallocationOption) populate(objectMap, "resizeTimeout", r.ResizeTimeout) - populateTime[datetime.RFC3339](objectMap, "startTime", r.StartTime) + populateTime[datetime.RFC3339](objectMap, "startTime", r.StartTime, true) populate(objectMap, "targetDedicatedNodes", r.TargetDedicatedNodes) populate(objectMap, "targetLowPriorityNodes", r.TargetLowPriorityNodes) return json.Marshal(objectMap) @@ -3705,7 +3705,7 @@ func (r ResizeOperationStatus) MarshalJSON() ([]byte, error) { func (r *ResizeOperationStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } for key, val := range rawMsg { var err error @@ -3730,7 +3730,7 @@ func (r *ResizeOperationStatus) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } } return nil @@ -3748,7 +3748,7 @@ func (r ResourceAssociation) MarshalJSON() ([]byte, error) { func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } for key, val := range rawMsg { var err error @@ -3761,7 +3761,7 @@ func (r *ResourceAssociation) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } } return nil @@ -3784,7 +3784,7 @@ func (r ResourceFile) MarshalJSON() ([]byte, error) { func (r *ResourceFile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } for key, val := range rawMsg { var err error @@ -3812,7 +3812,7 @@ func (r *ResourceFile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } } return nil @@ -3835,7 +3835,7 @@ func (r RollingUpgradePolicy) MarshalJSON() ([]byte, error) { func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } for key, val := range rawMsg { var err error @@ -3863,7 +3863,7 @@ func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %s", r, err.Error()) } } return nil @@ -3881,7 +3881,7 @@ func (s SKUCapability) MarshalJSON() ([]byte, error) { func (s *SKUCapability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -3894,7 +3894,7 @@ func (s *SKUCapability) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -3912,7 +3912,7 @@ func (s ScaleSettings) MarshalJSON() ([]byte, error) { func (s *ScaleSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -3925,7 +3925,7 @@ func (s *ScaleSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -3945,7 +3945,7 @@ func (s SecurityProfile) MarshalJSON() ([]byte, error) { func (s *SecurityProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -3964,7 +3964,7 @@ func (s *SecurityProfile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -3981,7 +3981,7 @@ func (s ServiceArtifactReference) MarshalJSON() ([]byte, error) { func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -3991,7 +3991,7 @@ func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -4014,7 +4014,7 @@ func (s StartTask) MarshalJSON() ([]byte, error) { func (s *StartTask) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -4042,7 +4042,7 @@ func (s *StartTask) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -4051,7 +4051,7 @@ func (s *StartTask) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SupportedSKU. func (s SupportedSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTime[datetime.RFC3339](objectMap, "batchSupportEndOfLife", s.BatchSupportEndOfLife) + populateTime[datetime.RFC3339](objectMap, "batchSupportEndOfLife", s.BatchSupportEndOfLife, true) populate(objectMap, "capabilities", s.Capabilities) populate(objectMap, "familyName", s.FamilyName) populate(objectMap, "name", s.Name) @@ -4062,7 +4062,7 @@ func (s SupportedSKU) MarshalJSON() ([]byte, error) { func (s *SupportedSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -4081,7 +4081,7 @@ func (s *SupportedSKU) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -4099,7 +4099,7 @@ func (s SupportedSKUsResult) MarshalJSON() ([]byte, error) { func (s *SupportedSKUsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -4112,7 +4112,7 @@ func (s *SupportedSKUsResult) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -4121,10 +4121,10 @@ func (s *SupportedSKUsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt, true) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt, true) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -4134,7 +4134,7 @@ func (s SystemData) MarshalJSON() ([]byte, error) { func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } for key, val := range rawMsg { var err error @@ -4159,7 +4159,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %s", s, err.Error()) } } return nil @@ -4180,7 +4180,7 @@ func (t TaskContainerSettings) MarshalJSON() ([]byte, error) { func (t *TaskContainerSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) } for key, val := range rawMsg { var err error @@ -4202,7 +4202,7 @@ func (t *TaskContainerSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) } } return nil @@ -4220,7 +4220,7 @@ func (t TaskSchedulingPolicy) MarshalJSON() ([]byte, error) { func (t *TaskSchedulingPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) } for key, val := range rawMsg { var err error @@ -4233,7 +4233,7 @@ func (t *TaskSchedulingPolicy) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %s", t, err.Error()) } } return nil @@ -4251,7 +4251,7 @@ func (u UefiSettings) MarshalJSON() ([]byte, error) { func (u *UefiSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } for key, val := range rawMsg { var err error @@ -4264,7 +4264,7 @@ func (u *UefiSettings) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } } return nil @@ -4283,7 +4283,7 @@ func (u UpgradePolicy) MarshalJSON() ([]byte, error) { func (u *UpgradePolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } for key, val := range rawMsg { var err error @@ -4299,7 +4299,7 @@ func (u *UpgradePolicy) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } } return nil @@ -4320,7 +4320,7 @@ func (u UserAccount) MarshalJSON() ([]byte, error) { func (u *UserAccount) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } for key, val := range rawMsg { var err error @@ -4342,7 +4342,7 @@ func (u *UserAccount) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } } return nil @@ -4360,7 +4360,7 @@ func (u UserAssignedIdentities) MarshalJSON() ([]byte, error) { func (u *UserAssignedIdentities) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } for key, val := range rawMsg { var err error @@ -4373,7 +4373,7 @@ func (u *UserAssignedIdentities) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } } return nil @@ -4391,7 +4391,7 @@ func (u UserIdentity) MarshalJSON() ([]byte, error) { func (u *UserIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } for key, val := range rawMsg { var err error @@ -4404,7 +4404,7 @@ func (u *UserIdentity) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) + return fmt.Errorf("unmarshalling type %T: %s", u, err.Error()) } } return nil @@ -4422,7 +4422,7 @@ func (v VMDiskSecurityProfile) MarshalJSON() ([]byte, error) { func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } for key, val := range rawMsg { var err error @@ -4435,7 +4435,7 @@ func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } } return nil @@ -4460,7 +4460,7 @@ func (v VMExtension) MarshalJSON() ([]byte, error) { func (v *VMExtension) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } for key, val := range rawMsg { var err error @@ -4494,7 +4494,7 @@ func (v *VMExtension) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } } return nil @@ -4522,7 +4522,7 @@ func (v VirtualMachineConfiguration) MarshalJSON() ([]byte, error) { func (v *VirtualMachineConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } for key, val := range rawMsg { var err error @@ -4565,7 +4565,7 @@ func (v *VirtualMachineConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } } return nil @@ -4583,7 +4583,7 @@ func (v VirtualMachineFamilyCoreQuota) MarshalJSON() ([]byte, error) { func (v *VirtualMachineFamilyCoreQuota) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } for key, val := range rawMsg { var err error @@ -4596,7 +4596,7 @@ func (v *VirtualMachineFamilyCoreQuota) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %s", v, err.Error()) } } return nil @@ -4613,7 +4613,7 @@ func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) } for key, val := range rawMsg { var err error @@ -4623,7 +4623,7 @@ func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) } } return nil @@ -4640,7 +4640,7 @@ func (w WindowsUserConfiguration) MarshalJSON() ([]byte, error) { func (w *WindowsUserConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) } for key, val := range rawMsg { var err error @@ -4650,7 +4650,7 @@ func (w *WindowsUserConfiguration) UnmarshalJSON(data []byte) error { delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) + return fmt.Errorf("unmarshalling type %T: %s", w, err.Error()) } } return nil @@ -4666,13 +4666,17 @@ func populate(m map[string]any, k string, v any) { } } -func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time, utc bool) { if t == nil { return } else if azcore.IsNullValue(t) { m[k] = nil } else if !reflect.ValueOf(t).IsNil() { - newTime := T(*t) + tt := *t + if utc { + tt = tt.UTC() + } + newTime := T(tt) m[k] = (*T)(&newTime) } } @@ -4692,7 +4696,7 @@ func unpopulate(data json.RawMessage, fn string, v any) error { return nil } if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) + return fmt.Errorf("struct field %s: %s", fn, err.Error()) } return nil } @@ -4703,7 +4707,7 @@ func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t ** } var aux T if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) + return fmt.Errorf("struct field %s: %s", fn, err.Error()) } newTime := time.Time(aux) *t = &newTime @@ -4711,5 +4715,5 @@ func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t ** } type dateTimeConstraints interface { - datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix + datetime.PlainDate | datetime.PlainTime | datetime.RFC3339 | datetime.RFC7231 | datetime.Unix } diff --git a/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client.go b/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client.go index 48791bb19153..4cb36aeddccf 100644 --- a/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client.go +++ b/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client.go @@ -18,6 +18,8 @@ import ( // NetworkSecurityPerimeterClient contains the methods for the NetworkSecurityPerimeter group. // Don't use this type directly, use NewNetworkSecurityPerimeterClient() instead. +// +// Generated from API version 2025-06-01 type NetworkSecurityPerimeterClient struct { internal *arm.Client subscriptionID string @@ -41,8 +43,6 @@ func NewNetworkSecurityPerimeterClient(subscriptionID string, credential azcore. // GetConfiguration - Gets information about the specified NSP configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -64,12 +64,7 @@ func (client *NetworkSecurityPerimeterClient) GetConfiguration(ctx context.Conte if err != nil { return NetworkSecurityPerimeterClientGetConfigurationResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return NetworkSecurityPerimeterClientGetConfigurationResponse{}, err - } - resp, err := client.getConfigurationHandleResponse(httpResp) - return resp, err + return client.getConfigurationHandleResponse(httpResp, http.StatusOK) } // getConfigurationCreateRequest creates the GetConfiguration request. @@ -96,15 +91,18 @@ func (client *NetworkSecurityPerimeterClient) getConfigurationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getConfigurationHandleResponse handles the GetConfiguration response. -func (client *NetworkSecurityPerimeterClient) getConfigurationHandleResponse(resp *http.Response) (NetworkSecurityPerimeterClientGetConfigurationResponse, error) { +func (client *NetworkSecurityPerimeterClient) getConfigurationHandleResponse(resp *http.Response, successCodes ...int) (NetworkSecurityPerimeterClientGetConfigurationResponse, error) { result := NetworkSecurityPerimeterClientGetConfigurationResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { return NetworkSecurityPerimeterClientGetConfigurationResponse{}, err } @@ -112,8 +110,6 @@ func (client *NetworkSecurityPerimeterClient) getConfigurationHandleResponse(res } // NewListConfigurationsPager - Lists all of the NSP configurations in the specified account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -131,47 +127,61 @@ func (client *NetworkSecurityPerimeterClient) NewListConfigurationsPager(resourc if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listConfigurationsCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listConfigurationsCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) if err != nil { return NetworkSecurityPerimeterClientListConfigurationsResponse{}, err } - return client.listConfigurationsHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterClientListConfigurationsResponse{}, err + } + return client.listConfigurationsHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listConfigurationsCreateRequest creates the ListConfigurations request. -func (client *NetworkSecurityPerimeterClient) listConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *NetworkSecurityPerimeterClientListConfigurationsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *NetworkSecurityPerimeterClient) listConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, _ *NetworkSecurityPerimeterClientListConfigurationsOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listConfigurationsHandleResponse handles the ListConfigurations response. -func (client *NetworkSecurityPerimeterClient) listConfigurationsHandleResponse(resp *http.Response) (NetworkSecurityPerimeterClientListConfigurationsResponse, error) { +func (client *NetworkSecurityPerimeterClient) listConfigurationsHandleResponse(resp *http.Response, successCodes ...int) (NetworkSecurityPerimeterClientListConfigurationsResponse, error) { result := NetworkSecurityPerimeterClientListConfigurationsResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationListResult); err != nil { return NetworkSecurityPerimeterClientListConfigurationsResponse{}, err } @@ -180,8 +190,6 @@ func (client *NetworkSecurityPerimeterClient) listConfigurationsHandleResponse(r // BeginReconcileConfiguration - Reconciles the specified NSP configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -208,8 +216,6 @@ func (client *NetworkSecurityPerimeterClient) BeginReconcileConfiguration(ctx co // ReconcileConfiguration - Reconciles the specified NSP configuration. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *NetworkSecurityPerimeterClient) reconcileConfiguration(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterClientBeginReconcileConfigurationOptions) (*http.Response, error) { var err error const operationName = "NetworkSecurityPerimeterClient.BeginReconcileConfiguration" @@ -225,8 +231,7 @@ func (client *NetworkSecurityPerimeterClient) reconcileConfiguration(ctx context return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -255,7 +260,7 @@ func (client *NetworkSecurityPerimeterClient) reconcileConfigurationCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } diff --git a/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client_example_test.go b/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client_example_test.go index 8a740bdf1f31..6edd339b14b8 100644 --- a/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/networksecurityperimeter_client_example_test.go @@ -7,7 +7,7 @@ package armbatch_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -30,7 +30,7 @@ func ExampleNetworkSecurityPerimeterClient_GetConfiguration() { _ = 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 = armbatch.NetworkSecurityPerimeterClientGetConfigurationResponse{ - // NetworkSecurityPerimeterConfiguration: &armbatch.NetworkSecurityPerimeterConfiguration{ + // NetworkSecurityPerimeterConfiguration: armbatch.NetworkSecurityPerimeterConfiguration{ // Name: to.Ptr("00000000-0000-0000-0000-000000000000.sampleassociation"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/networkSecurityPerimeterConfigurations"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/networkSecurityPerimeterConfigurations/00000000-0000-0000-0000-000000000000.sampleassociation"), @@ -211,6 +211,6 @@ func ExampleNetworkSecurityPerimeterClient_BeginReconcileConfiguration() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } diff --git a/sdk/resourcemanager/batch/armbatch/operations_client.go b/sdk/resourcemanager/batch/armbatch/operations_client.go index 28b38c1c0ae0..db4f306d3637 100644 --- a/sdk/resourcemanager/batch/armbatch/operations_client.go +++ b/sdk/resourcemanager/batch/armbatch/operations_client.go @@ -11,10 +11,13 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" + "strings" ) // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. +// +// Generated from API version 2025-06-01 type OperationsClient struct { internal *arm.Client } @@ -34,8 +37,6 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists available operations for the Microsoft.Batch provider -// -// Generated from API version 2025-06-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -48,35 +49,49 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) + req, err := client.listCreateRequest(ctx, nextLink, options) + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } - return client.listHandleResponse(resp) + return client.listHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Batch/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) +func (client *OperationsClient) listCreateRequest(ctx context.Context, nextLink string, _ *OperationsClientListOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/providers/Microsoft.Batch/operations" + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) + } if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} + } return req, nil } // listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { +func (client *OperationsClient) listHandleResponse(resp *http.Response, successCodes ...int) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go b/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go index 47e94d08d0df..6656d6a06909 100644 --- a/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go @@ -7,7 +7,7 @@ package armbatch_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) diff --git a/sdk/resourcemanager/batch/armbatch/pool_client.go b/sdk/resourcemanager/batch/armbatch/pool_client.go index 32093f9fc4a5..3a6c1a64b07b 100644 --- a/sdk/resourcemanager/batch/armbatch/pool_client.go +++ b/sdk/resourcemanager/batch/armbatch/pool_client.go @@ -19,6 +19,8 @@ import ( // PoolClient contains the methods for the Pool group. // Don't use this type directly, use NewPoolClient() instead. +// +// Generated from API version 2025-06-01 type PoolClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewPoolClient(subscriptionID string, credential azcore.TokenCredential, opt // Create - Creates a new pool inside the specified account. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -65,12 +65,7 @@ func (client *PoolClient) Create(ctx context.Context, resourceGroupName string, if err != nil { return PoolClientCreateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PoolClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err + return client.createHandleResponse(httpResp, http.StatusOK) } // createCreateRequest creates the Create request. @@ -97,8 +92,8 @@ func (client *PoolClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -114,10 +109,13 @@ func (client *PoolClient) createCreateRequest(ctx context.Context, resourceGroup } // createHandleResponse handles the Create response. -func (client *PoolClient) createHandleResponse(resp *http.Response) (PoolClientCreateResponse, error) { +func (client *PoolClient) createHandleResponse(resp *http.Response, successCodes ...int) (PoolClientCreateResponse, error) { result := PoolClientCreateResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if val := resp.Header.Get("Etag"); val != "" { + result.Etag = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Pool); err != nil { return PoolClientCreateResponse{}, err @@ -127,8 +125,6 @@ func (client *PoolClient) createHandleResponse(resp *http.Response) (PoolClientC // BeginDelete - Deletes the specified pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -154,8 +150,6 @@ func (client *PoolClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Deletes the specified pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *PoolClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PoolClient.BeginDelete" @@ -171,8 +165,7 @@ func (client *PoolClient) deleteOperation(ctx context.Context, resourceGroupName return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -201,15 +194,13 @@ func (client *PoolClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // DisableAutoScale - Disables automatic scaling for a pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -230,12 +221,7 @@ func (client *PoolClient) DisableAutoScale(ctx context.Context, resourceGroupNam if err != nil { return PoolClientDisableAutoScaleResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PoolClientDisableAutoScaleResponse{}, err - } - resp, err := client.disableAutoScaleHandleResponse(httpResp) - return resp, err + return client.disableAutoScaleHandleResponse(httpResp, http.StatusOK) } // disableAutoScaleCreateRequest creates the DisableAutoScale request. @@ -262,17 +248,20 @@ func (client *PoolClient) disableAutoScaleCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // disableAutoScaleHandleResponse handles the DisableAutoScale response. -func (client *PoolClient) disableAutoScaleHandleResponse(resp *http.Response) (PoolClientDisableAutoScaleResponse, error) { +func (client *PoolClient) disableAutoScaleHandleResponse(resp *http.Response, successCodes ...int) (PoolClientDisableAutoScaleResponse, error) { result := PoolClientDisableAutoScaleResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if val := resp.Header.Get("Etag"); val != "" { + result.Etag = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Pool); err != nil { return PoolClientDisableAutoScaleResponse{}, err @@ -282,8 +271,6 @@ func (client *PoolClient) disableAutoScaleHandleResponse(resp *http.Response) (P // Get - Gets information about the specified pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -304,12 +291,7 @@ func (client *PoolClient) Get(ctx context.Context, resourceGroupName string, acc if err != nil { return PoolClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PoolClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -336,17 +318,20 @@ func (client *PoolClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *PoolClient) getHandleResponse(resp *http.Response) (PoolClientGetResponse, error) { +func (client *PoolClient) getHandleResponse(resp *http.Response, successCodes ...int) (PoolClientGetResponse, error) { result := PoolClientGetResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if val := resp.Header.Get("Etag"); val != "" { + result.Etag = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Pool); err != nil { return PoolClientGetResponse{}, err @@ -355,8 +340,6 @@ func (client *PoolClient) getHandleResponse(resp *http.Response) (PoolClientGetR } // NewListByBatchAccountPager - Lists all of the pools in the specified account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -374,56 +357,70 @@ func (client *PoolClient) NewListByBatchAccountPager(resourceGroupName string, a if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) if err != nil { return PoolClientListByBatchAccountResponse{}, err } - return client.listByBatchAccountHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PoolClientListByBatchAccountResponse{}, err + } + return client.listByBatchAccountHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listByBatchAccountCreateRequest creates the ListByBatchAccount request. -func (client *PoolClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PoolClientListByBatchAccountOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *PoolClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, options *PoolClientListByBatchAccountOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", *options.Select) - } - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + if firstPage { + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Select != nil { + reqQP.Set("$select", *options.Select) + } + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByBatchAccountHandleResponse handles the ListByBatchAccount response. -func (client *PoolClient) listByBatchAccountHandleResponse(resp *http.Response) (PoolClientListByBatchAccountResponse, error) { +func (client *PoolClient) listByBatchAccountHandleResponse(resp *http.Response, successCodes ...int) (PoolClientListByBatchAccountResponse, error) { result := PoolClientListByBatchAccountResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ListPoolsResult); err != nil { return PoolClientListByBatchAccountResponse{}, err } @@ -438,8 +435,6 @@ func (client *PoolClient) listByBatchAccountHandleResponse(resp *http.Response) // steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing // of the pool when it is created. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -460,12 +455,7 @@ func (client *PoolClient) StopResize(ctx context.Context, resourceGroupName stri if err != nil { return PoolClientStopResizeResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PoolClientStopResizeResponse{}, err - } - resp, err := client.stopResizeHandleResponse(httpResp) - return resp, err + return client.stopResizeHandleResponse(httpResp, http.StatusOK) } // stopResizeCreateRequest creates the StopResize request. @@ -492,17 +482,20 @@ func (client *PoolClient) stopResizeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // stopResizeHandleResponse handles the StopResize response. -func (client *PoolClient) stopResizeHandleResponse(resp *http.Response) (PoolClientStopResizeResponse, error) { +func (client *PoolClient) stopResizeHandleResponse(resp *http.Response, successCodes ...int) (PoolClientStopResizeResponse, error) { result := PoolClientStopResizeResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if val := resp.Header.Get("Etag"); val != "" { + result.Etag = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Pool); err != nil { return PoolClientStopResizeResponse{}, err @@ -512,8 +505,6 @@ func (client *PoolClient) stopResizeHandleResponse(resp *http.Response) (PoolCli // Update - Updates the properties of an existing pool. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -536,12 +527,7 @@ func (client *PoolClient) Update(ctx context.Context, resourceGroupName string, if err != nil { return PoolClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PoolClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return client.updateHandleResponse(httpResp, http.StatusOK) } // updateCreateRequest creates the Update request. @@ -568,8 +554,8 @@ func (client *PoolClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -582,10 +568,13 @@ func (client *PoolClient) updateCreateRequest(ctx context.Context, resourceGroup } // updateHandleResponse handles the Update response. -func (client *PoolClient) updateHandleResponse(resp *http.Response) (PoolClientUpdateResponse, error) { +func (client *PoolClient) updateHandleResponse(resp *http.Response, successCodes ...int) (PoolClientUpdateResponse, error) { result := PoolClientUpdateResponse{} - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } + if val := resp.Header.Get("Etag"); val != "" { + result.Etag = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Pool); err != nil { return PoolClientUpdateResponse{}, err diff --git a/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go b/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go index 9330abdbeebb..ee7730b02a77 100644 --- a/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -56,15 +56,15 @@ func ExamplePoolClient_Create_createPoolAcceleratedNetworking() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB46CB72A227E2\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB46CB72A227E2\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T03:00:34.0646502Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.April, 27, 3, 0, 34, 64650200, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.April, 27, 2, 59, 41, 859222600, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](1), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -79,18 +79,18 @@ func ExamplePoolClient_Create_createPoolAcceleratedNetworking() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.April, 27, 2, 59, 41, 859222600, time.UTC)), // NetworkConfiguration: &armbatch.NetworkConfiguration{ // DynamicVNetAssignmentScope: to.Ptr(armbatch.DynamicVNetAssignmentScopeNone), // EnableAcceleratedNetworking: to.Ptr(true), // SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.April, 27, 2, 59, 41, 859222600, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-27T02:59:41.8592226Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.April, 27, 2, 59, 41, 859222600, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -187,19 +187,19 @@ func ExamplePoolClient_Create_createPoolConfidentialDiskEncryptionSetForUserSubs _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), // Properties: &armbatch.PoolProperties{ - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522647Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522634Z"); return t}()), + // LastModified: to.Ptr(time.Date(2025, time.June, 30, 7, 30, 49, 752264700, time.UTC)), + // CreationTime: to.Ptr(time.Date(2025, time.June, 30, 7, 30, 49, 752263400, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522634Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 30, 49, 752263400, time.UTC)), // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522647Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 30, 49, 752264700, time.UTC)), // VMSize: to.Ptr("STANDARD_DC2as_v5"), // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), // TaskSlotsPerNode: to.Ptr[int32](1), @@ -265,7 +265,7 @@ func ExamplePoolClient_Create_createPoolConfidentialDiskEncryptionSetForUserSubs // TargetDedicatedNodes: to.Ptr[int32](1), // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:30:49.7522324Z"); return t}()), + // StartTime: to.Ptr(time.Date(2025, time.June, 30, 7, 30, 49, 752232400, time.UTC)), // }, // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), @@ -331,8 +331,8 @@ func ExamplePoolClient_Create_createPoolCustomerManagedKeyForBatchManagedAccount _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Identity: &armbatch.PoolIdentity{ // Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{ @@ -347,12 +347,12 @@ func ExamplePoolClient_Create_createPoolCustomerManagedKeyForBatchManagedAccount // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), // Properties: &armbatch.PoolProperties{ - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309281Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309266Z"); return t}()), + // LastModified: to.Ptr(time.Date(2025, time.June, 30, 7, 16, 33, 430928100, time.UTC)), + // CreationTime: to.Ptr(time.Date(2025, time.June, 30, 7, 16, 33, 430926600, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309266Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 16, 33, 430926600, time.UTC)), // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309281Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 16, 33, 430928100, time.UTC)), // VMSize: to.Ptr("Standard_D4ds_v5"), // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), // TaskSlotsPerNode: to.Ptr[int32](1), @@ -393,7 +393,7 @@ func ExamplePoolClient_Create_createPoolCustomerManagedKeyForBatchManagedAccount // TargetDedicatedNodes: to.Ptr[int32](1), // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:16:33.4309126Z"); return t}()), + // StartTime: to.Ptr(time.Date(2025, time.June, 30, 7, 16, 33, 430912600, time.UTC)), // }, // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), @@ -456,19 +456,19 @@ func ExamplePoolClient_Create_createPoolDiskEncryptionSetForUserSubscriptionAcco _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), // Properties: &armbatch.PoolProperties{ - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580726Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:35:44.5579791Z"); return t}()), + // LastModified: to.Ptr(time.Date(2025, time.June, 30, 7, 45, 46, 158072600, time.UTC)), + // CreationTime: to.Ptr(time.Date(2025, time.June, 30, 7, 35, 44, 557979100, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:35:44.5579791Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 35, 44, 557979100, time.UTC)), // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580727Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2025, time.June, 30, 7, 45, 46, 158072700, time.UTC)), // VMSize: to.Ptr("Standard_D4ds_v5"), // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), // TaskSlotsPerNode: to.Ptr[int32](1), @@ -510,7 +510,7 @@ func ExamplePoolClient_Create_createPoolDiskEncryptionSetForUserSubscriptionAcco // TargetDedicatedNodes: to.Ptr[int32](1), // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-30T07:45:46.1580724Z"); return t}()), + // StartTime: to.Ptr(time.Date(2025, time.June, 30, 7, 45, 46, 158072400, time.UTC)), // }, // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), @@ -587,19 +587,19 @@ func ExamplePoolClient_Create_createPoolDualStackNetworking() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/dualstackpool"), // Name: to.Ptr("dualstackpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // Etag: to.Ptr("W/\"0x8DDC34D4A01A419\""), // Properties: &armbatch.PoolProperties{ - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7998105Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7997967Z"); return t}()), + // LastModified: to.Ptr(time.Date(2025, time.July, 15, 3, 11, 27, 799810500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2025, time.July, 15, 3, 11, 27, 799796700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7997967Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2025, time.July, 15, 3, 11, 27, 799796700, time.UTC)), // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7998136Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2025, time.July, 15, 3, 11, 27, 799813600, time.UTC)), // VMSize: to.Ptr("Standard_D4ds_v5"), // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), // TaskSlotsPerNode: to.Ptr[int32](1), @@ -660,7 +660,7 @@ func ExamplePoolClient_Create_createPoolDualStackNetworking() { // TargetDedicatedNodes: to.Ptr[int32](1), // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-07-15T03:11:27.7994621Z"); return t}()), + // StartTime: to.Ptr(time.Date(2025, time.July, 15, 3, 11, 27, 799462100, time.UTC)), // }, // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), @@ -709,15 +709,15 @@ func ExamplePoolClient_Create_createPoolMinimalVirtualMachineConfiguration() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -732,9 +732,9 @@ func ExamplePoolClient_Create_createPoolMinimalVirtualMachineConfiguration() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // AutoScale: &armbatch.AutoScaleSettings{ // EvaluationInterval: to.Ptr("PT5M"), @@ -788,15 +788,15 @@ func ExamplePoolClient_Create_createPoolNoPublicIP() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -808,7 +808,7 @@ func ExamplePoolClient_Create_createPoolNoPublicIP() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // NetworkConfiguration: &armbatch.NetworkConfiguration{ // PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ // Provision: to.Ptr(armbatch.IPAddressProvisioningTypeNoPublicIPAddresses), @@ -816,7 +816,7 @@ func ExamplePoolClient_Create_createPoolNoPublicIP() { // SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // FixedScale: &armbatch.FixedScaleSettings{ // TargetDedicatedNodes: to.Ptr[int32](0), @@ -873,15 +873,15 @@ func ExamplePoolClient_Create_createPoolPublicIPs() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -893,7 +893,7 @@ func ExamplePoolClient_Create_createPoolPublicIPs() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // NetworkConfiguration: &armbatch.NetworkConfiguration{ // PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ // IPAddressIDs: []*string{ @@ -904,7 +904,7 @@ func ExamplePoolClient_Create_createPoolPublicIPs() { // SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // FixedScale: &armbatch.FixedScaleSettings{ // TargetDedicatedNodes: to.Ptr[int32](0), @@ -968,15 +968,15 @@ func ExamplePoolClient_Create_createPoolSecurityProfile() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB554F8E08BCF4\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB554F8E08BCF4\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -998,13 +998,13 @@ func ExamplePoolClient_Create_createPoolSecurityProfile() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -1055,15 +1055,15 @@ func ExamplePoolClient_Create_createPoolCustomImage() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1075,9 +1075,9 @@ func ExamplePoolClient_Create_createPoolCustomImage() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // FixedScale: &armbatch.FixedScaleSettings{ // TargetDedicatedNodes: to.Ptr[int32](0), @@ -1134,15 +1134,15 @@ func ExamplePoolClient_Create_createPoolTags() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB554F8E08BCF4\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB554F8E08BCF4\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1157,13 +1157,13 @@ func ExamplePoolClient_Create_createPoolTags() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-27T07:33:13.0625789Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.September, 27, 7, 33, 13, 62578900, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -1247,15 +1247,15 @@ func ExamplePoolClient_Create_createPoolUpgradePolicy() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB51E64D3C3B69\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51E64D3C3B69\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 6, 16, 44, 237218400, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.May, 11, 6, 16, 44, 237218400, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1276,13 +1276,13 @@ func ExamplePoolClient_Create_createPoolUpgradePolicy() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.May, 11, 6, 16, 44, 237218400, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 6, 16, 44, 237218400, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:16:44.2372184Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.May, 11, 6, 16, 44, 237218400, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](2), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -1367,8 +1367,8 @@ func ExamplePoolClient_Create_createPoolUserAssignedIdentities() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), @@ -1387,8 +1387,8 @@ func ExamplePoolClient_Create_createPoolUserAssignedIdentities() { // }, // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2020, time.October, 1, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2020, time.October, 1, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1403,9 +1403,9 @@ func ExamplePoolClient_Create_createPoolUserAssignedIdentities() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2020, time.October, 1, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2020, time.October, 1, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // AutoScale: &armbatch.AutoScaleSettings{ // EvaluationInterval: to.Ptr("PT5M"), @@ -1530,15 +1530,15 @@ func ExamplePoolClient_Create_createPoolFullVirtualMachineConfiguration() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1584,7 +1584,7 @@ func ExamplePoolClient_Create_createPoolFullVirtualMachineConfiguration() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // NetworkConfiguration: &armbatch.NetworkConfiguration{ // EndpointConfiguration: &armbatch.PoolEndpointConfiguration{ // InboundNatPools: []*armbatch.InboundNatPool{ @@ -1618,7 +1618,7 @@ func ExamplePoolClient_Create_createPoolFullVirtualMachineConfiguration() { // }, // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // AutoScale: &armbatch.AutoScaleSettings{ // EvaluationInterval: to.Ptr("PT5M"), @@ -1688,15 +1688,15 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationExtensions() _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1724,9 +1724,9 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationExtensions() // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // AutoScale: &armbatch.AutoScaleSettings{ // EvaluationInterval: to.Ptr("PT5M"), @@ -1790,15 +1790,15 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationOSDisk() { _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB51F14DC1A8AD\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51F14DC1A8AD\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1821,13 +1821,13 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationOSDisk() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -1899,15 +1899,15 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationServiceArtifa _ = 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 = armbatch.PoolClientCreateResponse{ - // ETag: "W/\"0x8DB51F14DC1A8AD\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51F14DC1A8AD\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("mypool41"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -1928,13 +1928,13 @@ func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationServiceArtifa // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](2), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -1977,7 +1977,7 @@ func ExamplePoolClient_BeginDelete() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res @@ -2005,15 +2005,15 @@ func ExamplePoolClient_DisableAutoScale() { _ = 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 = armbatch.PoolClientDisableAutoScaleResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2028,9 +2028,9 @@ func ExamplePoolClient_DisableAutoScale() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ScaleSettings: &armbatch.ScaleSettings{ // FixedScale: &armbatch.FixedScaleSettings{ // ResizeTimeout: to.Ptr("PT15M"), @@ -2067,21 +2067,21 @@ func ExamplePoolClient_Get_getPool() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ApplicationPackages: []*armbatch.ApplicationPackageReference{ // { // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), // Version: to.Ptr("asdf"), // }, // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2096,7 +2096,7 @@ func ExamplePoolClient_Get_getPool() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // Metadata: []*armbatch.MetadataItem{ // { // Name: to.Ptr("metadata-1"), @@ -2141,11 +2141,11 @@ func ExamplePoolClient_Get_getPool() { // SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](6), // TargetLowPriorityNodes: to.Ptr[int32](28), // }, @@ -2219,15 +2219,15 @@ func ExamplePoolClient_Get_getPoolAcceleratedNetworking() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-28T02:33:40.82831Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-28T02:32:32.8696419Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.April, 28, 2, 33, 40, 828310000, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.April, 28, 2, 32, 32, 869641900, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](1), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2242,17 +2242,17 @@ func ExamplePoolClient_Get_getPoolAcceleratedNetworking() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-28T02:32:32.8696419Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.April, 28, 2, 32, 32, 869641900, time.UTC)), // NetworkConfiguration: &armbatch.NetworkConfiguration{ // DynamicVNetAssignmentScope: to.Ptr(armbatch.DynamicVNetAssignmentScopeNone), // EnableAcceleratedNetworking: to.Ptr(true), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-28T02:32:32.8696419Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.April, 28, 2, 32, 32, 869641900, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-28T02:32:32.8696419Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.April, 28, 2, 32, 32, 869641900, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2291,15 +2291,15 @@ func ExamplePoolClient_Get_getPoolSecurityProfile() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8DB554F8E08BCF4\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB554F8E08BCF4\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:04:57.3413444Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 4, 57, 341344400, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](1), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2321,13 +2321,13 @@ func ExamplePoolClient_Get_getPoolSecurityProfile() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-14T07:03:58.3231917Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.June, 14, 7, 3, 58, 323191700, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2366,15 +2366,15 @@ func ExamplePoolClient_Get_getPoolUpgradePolicy() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8DB51E64D3C3B69\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51E64D3C3B69\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:10:31.4670326Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:09:38.3178089Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 6, 10, 31, 467032600, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.May, 11, 6, 9, 38, 317808900, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](2), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2395,13 +2395,13 @@ func ExamplePoolClient_Get_getPoolUpgradePolicy() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:09:38.3178089Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.May, 11, 6, 9, 38, 317808900, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:09:38.3178089Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 6, 9, 38, 317808900, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T06:09:38.3178089Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.May, 11, 6, 9, 38, 317808900, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](2), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2458,15 +2458,15 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationExtensions() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2494,13 +2494,13 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationExtensions() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](6), // TargetLowPriorityNodes: to.Ptr[int32](28), // }, @@ -2540,15 +2540,15 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationOSDisk() { _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8DB51E64D3C3B69\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51E64D3C3B69\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:13:22.4881351Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.August, 24, 2, 13, 22, 488135100, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](1), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2571,13 +2571,13 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationOSDisk() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T02:12:27.7527697Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.August, 24, 2, 12, 27, 752769700, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2616,15 +2616,15 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationServiceArtifactRefe _ = 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 = armbatch.PoolClientGetResponse{ - // ETag: "W/\"0x8DB51E64D3C3B69\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8DB51E64D3C3B69\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:45:42.0881659Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 7, 45, 42, 88165900, time.UTC)), + // CreationTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](2), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2645,13 +2645,13 @@ func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationServiceArtifactRefe // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // LastModified: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-11T07:44:44.8580493Z"); return t}()), + // StartTime: to.Ptr(time.Date(2023, time.May, 11, 7, 44, 44, 858049300, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](2), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2708,14 +2708,14 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPool() { // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ApplicationPackages: []*armbatch.ApplicationPackageReference{ // { // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), // Version: to.Ptr("asdf"), // }, // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2730,7 +2730,7 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPool() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // Metadata: []*armbatch.MetadataItem{ // { // Name: to.Ptr("metadata-1"), @@ -2774,7 +2774,7 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPool() { // SubnetID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // Errors: []*armbatch.ResizeError{ // { @@ -2784,7 +2784,7 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPool() { // }, // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](6), // TargetLowPriorityNodes: to.Ptr[int32](28), // }, @@ -2877,7 +2877,7 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPoolWithFilter() { // AllocationState: to.Ptr(armbatch.AllocationStateSteady), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](2), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // }, // }, // { @@ -2888,7 +2888,7 @@ func ExamplePoolClient_NewListByBatchAccountPager_listPoolWithFilter() { // AllocationState: to.Ptr(armbatch.AllocationStateResizing), // CurrentDedicatedNodes: to.Ptr[int32](4), // CurrentLowPriorityNodes: to.Ptr[int32](0), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-26T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 26, 10, 22, 55, 940727500, time.UTC)), // }, // }, // }, @@ -2916,15 +2916,15 @@ func ExamplePoolClient_StopResize() { _ = 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 = armbatch.PoolClientStopResizeResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](0), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -2939,13 +2939,13 @@ func ExamplePoolClient_StopResize() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT10M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](1), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -2992,19 +2992,19 @@ func ExamplePoolClient_Update_updatePoolEnableAutoscale() { _ = 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 = armbatch.PoolClientUpdateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // EvaluationTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](12), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -3019,13 +3019,13 @@ func ExamplePoolClient_Update_updatePoolEnableAutoscale() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](34), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -3081,14 +3081,14 @@ func ExamplePoolClient_Update_updatePoolOtherProperties() { _ = 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 = armbatch.PoolClientUpdateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // ApplicationPackages: []*armbatch.ApplicationPackageReference{ // { // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), @@ -3099,10 +3099,10 @@ func ExamplePoolClient_Update_updatePoolOtherProperties() { // }, // }, // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // EvaluationTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](12), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -3117,7 +3117,7 @@ func ExamplePoolClient_Update_updatePoolOtherProperties() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // Metadata: []*armbatch.MetadataItem{ // { // Name: to.Ptr("key1"), @@ -3125,11 +3125,11 @@ func ExamplePoolClient_Update_updatePoolOtherProperties() { // }, // }, // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](8), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -3173,19 +3173,19 @@ func ExamplePoolClient_Update_updatePoolRemoveStartTask() { _ = 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 = armbatch.PoolClientUpdateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // EvaluationTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](12), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -3200,13 +3200,13 @@ func ExamplePoolClient_Update_updatePoolRemoveStartTask() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](34), // }, // ScaleSettings: &armbatch.ScaleSettings{ @@ -3255,19 +3255,19 @@ func ExamplePoolClient_Update_updatePoolResizePool() { _ = 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 = armbatch.PoolClientUpdateResponse{ - // ETag: "W/\"0x8D4EDFEBFADF4AB\"" - // Pool: &armbatch.Pool{ + // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), + // Pool: armbatch.Pool{ // Name: to.Ptr("testpool"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), // Properties: &armbatch.PoolProperties{ // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // AllocationStateTransitionTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // EvaluationTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // CreationTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // CurrentDedicatedNodes: to.Ptr[int32](12), // CurrentLowPriorityNodes: to.Ptr[int32](0), // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ @@ -3282,13 +3282,13 @@ func ExamplePoolClient_Update_updatePoolResizePool() { // }, // }, // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // LastModified: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), + // ProvisioningStateTransitionTime: to.Ptr(time.Date(2017, time.August, 28, 10, 22, 55, 940727500, time.UTC)), // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), + // StartTime: to.Ptr(time.Date(2017, time.August, 29, 10, 22, 55, 940727500, time.UTC)), // TargetDedicatedNodes: to.Ptr[int32](8), // }, // ScaleSettings: &armbatch.ScaleSettings{ diff --git a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go index 357d4e3dbe44..7b2b825d81ca 100644 --- a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go +++ b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go @@ -19,6 +19,8 @@ import ( // PrivateEndpointConnectionClient contains the methods for the PrivateEndpointConnection group. // Don't use this type directly, use NewPrivateEndpointConnectionClient() instead. +// +// Generated from API version 2025-06-01 type PrivateEndpointConnectionClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Deletes the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -71,8 +71,6 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginDelete" @@ -88,8 +86,7 @@ func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Conte return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -118,15 +115,13 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") return req, nil } // Get - Gets information about the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -148,12 +143,7 @@ func (client *PrivateEndpointConnectionClient) Get(ctx context.Context, resource if err != nil { return PrivateEndpointConnectionClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PrivateEndpointConnectionClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -180,15 +170,18 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionClientGetResponse, error) { +func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Response, successCodes ...int) (PrivateEndpointConnectionClientGetResponse, error) { result := PrivateEndpointConnectionClientGetResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { return PrivateEndpointConnectionClientGetResponse{}, err } @@ -196,8 +189,6 @@ func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Resp } // NewListByBatchAccountPager - Lists all of the private endpoint connections in the specified account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -215,50 +206,64 @@ func (client *PrivateEndpointConnectionClient) NewListByBatchAccountPager(resour if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) + if err != nil { + return PrivateEndpointConnectionClientListByBatchAccountResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionClientListByBatchAccountResponse{}, err } - return client.listByBatchAccountHandleResponse(resp) + return client.listByBatchAccountHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listByBatchAccountCreateRequest creates the ListByBatchAccount request. -func (client *PrivateEndpointConnectionClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionClientListByBatchAccountOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *PrivateEndpointConnectionClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, options *PrivateEndpointConnectionClientListByBatchAccountOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByBatchAccountHandleResponse handles the ListByBatchAccount response. -func (client *PrivateEndpointConnectionClient) listByBatchAccountHandleResponse(resp *http.Response) (PrivateEndpointConnectionClientListByBatchAccountResponse, error) { +func (client *PrivateEndpointConnectionClient) listByBatchAccountHandleResponse(resp *http.Response, successCodes ...int) (PrivateEndpointConnectionClientListByBatchAccountResponse, error) { result := PrivateEndpointConnectionClientListByBatchAccountResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ListPrivateEndpointConnectionsResult); err != nil { return PrivateEndpointConnectionClientListByBatchAccountResponse{}, err } @@ -267,8 +272,6 @@ func (client *PrivateEndpointConnectionClient) listByBatchAccountHandleResponse( // BeginUpdate - Updates the properties of an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -298,8 +301,6 @@ func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, // Update - Updates the properties of an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginUpdate" @@ -315,8 +316,7 @@ func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resou return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err + return nil, runtime.NewResponseError(httpResp) } return httpResp, nil } @@ -345,8 +345,8 @@ func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go index bc0a79106450..2099d614a5eb 100644 --- a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go @@ -8,7 +8,7 @@ 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/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -29,7 +29,7 @@ func ExamplePrivateEndpointConnectionClient_BeginDelete() { } _, err = poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to poll the result: %v", err) } } @@ -52,7 +52,7 @@ func ExamplePrivateEndpointConnectionClient_Get() { _ = 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 = armbatch.PrivateEndpointConnectionClientGetResponse{ - // PrivateEndpointConnection: &armbatch.PrivateEndpointConnection{ + // PrivateEndpointConnection: armbatch.PrivateEndpointConnection{ // Name: to.Ptr("testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), @@ -146,13 +146,13 @@ func ExamplePrivateEndpointConnectionClient_BeginUpdate() { } res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + 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 = armbatch.PrivateEndpointConnectionClientUpdateResponse{ - // PrivateEndpointConnection: &armbatch.PrivateEndpointConnection{ + // PrivateEndpointConnection: armbatch.PrivateEndpointConnection{ // Name: to.Ptr("testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), diff --git a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go index 00a1d81f971e..cc509035e585 100644 --- a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go +++ b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go @@ -19,6 +19,8 @@ import ( // PrivateLinkResourceClient contains the methods for the PrivateLinkResource group. // Don't use this type directly, use NewPrivateLinkResourceClient() instead. +// +// Generated from API version 2025-06-01 type PrivateLinkResourceClient struct { internal *arm.Client subscriptionID string @@ -42,8 +44,6 @@ func NewPrivateLinkResourceClient(subscriptionID string, credential azcore.Token // Get - Gets information about the specified private link resource. // If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -64,12 +64,7 @@ func (client *PrivateLinkResourceClient) Get(ctx context.Context, resourceGroupN if err != nil { return PrivateLinkResourceClientGetResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PrivateLinkResourceClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err + return client.getHandleResponse(httpResp, http.StatusOK) } // getCreateRequest creates the Get request. @@ -96,15 +91,18 @@ func (client *PrivateLinkResourceClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() + reqQP.Set("api-version", version20250601) + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // getHandleResponse handles the Get response. -func (client *PrivateLinkResourceClient) getHandleResponse(resp *http.Response) (PrivateLinkResourceClientGetResponse, error) { +func (client *PrivateLinkResourceClient) getHandleResponse(resp *http.Response, successCodes ...int) (PrivateLinkResourceClientGetResponse, error) { result := PrivateLinkResourceClientGetResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResource); err != nil { return PrivateLinkResourceClientGetResponse{}, err } @@ -112,8 +110,6 @@ func (client *PrivateLinkResourceClient) getHandleResponse(resp *http.Response) } // NewListByBatchAccountPager - Lists all of the private link resources in the specified account. -// -// Generated from API version 2025-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name @@ -131,50 +127,64 @@ func (client *PrivateLinkResourceClient) NewListByBatchAccountPager(resourceGrou if page != nil { nextLink = *page.NextLink } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) + req, err := client.listByBatchAccountCreateRequest(ctx, resourceGroupName, accountName, nextLink, options) if err != nil { return PrivateLinkResourceClientListByBatchAccountResponse{}, err } - return client.listByBatchAccountHandleResponse(resp) + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourceClientListByBatchAccountResponse{}, err + } + return client.listByBatchAccountHandleResponse(resp, http.StatusOK) }, Tracer: client.internal.Tracer(), }) } // listByBatchAccountCreateRequest creates the ListByBatchAccount request. -func (client *PrivateLinkResourceClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourceClientListByBatchAccountOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") +func (client *PrivateLinkResourceClient) listByBatchAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, nextLink string, options *PrivateLinkResourceClientListByBatchAccountOptions) (*policy.Request, error) { + firstPage := nextLink == "" + var req *policy.Request + var err error + if firstPage { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err = runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + } else { + req, err = runtime.NewRequestForNextLink(ctx, http.MethodGet, client.internal.Endpoint(), nextLink) } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-06-01") - if options != nil && options.Maxresults != nil { - reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + if firstPage { + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", version20250601) + if options != nil && options.Maxresults != nil { + reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) + } + req.Raw().URL.RawQuery = strings.ReplaceAll(reqQP.Encode(), "+", "%20") + req.Raw().Header["Accept"] = []string{"application/json"} } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // listByBatchAccountHandleResponse handles the ListByBatchAccount response. -func (client *PrivateLinkResourceClient) listByBatchAccountHandleResponse(resp *http.Response) (PrivateLinkResourceClientListByBatchAccountResponse, error) { +func (client *PrivateLinkResourceClient) listByBatchAccountHandleResponse(resp *http.Response, successCodes ...int) (PrivateLinkResourceClientListByBatchAccountResponse, error) { result := PrivateLinkResourceClientListByBatchAccountResponse{} + if !runtime.HasStatusCode(resp, successCodes...) { + return result, runtime.NewResponseError(resp) + } if err := runtime.UnmarshalAsJSON(resp, &result.ListPrivateLinkResourcesResult); err != nil { return PrivateLinkResourceClientListByBatchAccountResponse{}, err } diff --git a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go index 26920af3629e..08d61919ad71 100644 --- a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go +++ b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go @@ -7,7 +7,7 @@ package armbatch_test import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v4" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v5" "log" ) @@ -30,7 +30,7 @@ func ExamplePrivateLinkResourceClient_Get() { _ = 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 = armbatch.PrivateLinkResourceClientGetResponse{ - // PrivateLinkResource: &armbatch.PrivateLinkResource{ + // PrivateLinkResource: armbatch.PrivateLinkResource{ // Name: to.Ptr("sampleacct"), // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateLinkResources"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateLinkResources/batchAccount"), diff --git a/sdk/resourcemanager/batch/armbatch/responses.go b/sdk/resourcemanager/batch/armbatch/responses.go index 57c29e801bf9..46de1d4ed92c 100644 --- a/sdk/resourcemanager/batch/armbatch/responses.go +++ b/sdk/resourcemanager/batch/armbatch/responses.go @@ -158,7 +158,7 @@ type NetworkSecurityPerimeterClientGetConfigurationResponse struct { // NetworkSecurityPerimeterClientListConfigurationsResponse contains the response from method NetworkSecurityPerimeterClient.NewListConfigurationsPager. type NetworkSecurityPerimeterClientListConfigurationsResponse struct { - // Result of a list NSP (network security perimeter) configurations request. + // The response of a NetworkSecurityPerimeterConfiguration list operation. NetworkSecurityPerimeterConfigurationListResult } @@ -183,7 +183,7 @@ type PoolClientCreateResponse struct { // The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between // requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. - ETag *string + Etag *string } // PoolClientDeleteResponse contains the response from method PoolClient.BeginDelete. @@ -198,7 +198,7 @@ type PoolClientDisableAutoScaleResponse struct { // The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between // requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. - ETag *string + Etag *string } // PoolClientGetResponse contains the response from method PoolClient.Get. @@ -208,7 +208,7 @@ type PoolClientGetResponse struct { // The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between // requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. - ETag *string + Etag *string } // PoolClientListByBatchAccountResponse contains the response from method PoolClient.NewListByBatchAccountPager. @@ -224,7 +224,7 @@ type PoolClientStopResizeResponse struct { // The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between // requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. - ETag *string + Etag *string } // PoolClientUpdateResponse contains the response from method PoolClient.Update. @@ -234,7 +234,7 @@ type PoolClientUpdateResponse struct { // The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between // requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. - ETag *string + Etag *string } // PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete. diff --git a/sdk/resourcemanager/batch/armbatch/testdata/_metadata.json b/sdk/resourcemanager/batch/armbatch/testdata/_metadata.json index 7acdb6ff356d..730119693646 100644 --- a/sdk/resourcemanager/batch/armbatch/testdata/_metadata.json +++ b/sdk/resourcemanager/batch/armbatch/testdata/_metadata.json @@ -1,4 +1,6 @@ { - "apiVersion": "2025-06-01", - "emitterVersion": "0.9.2" + "apiVersions": { + "Microsoft.Batch": "2025-06-01" + }, + "emitterVersion": "0.16.0" } diff --git a/sdk/resourcemanager/batch/armbatch/tsp-location.yaml b/sdk/resourcemanager/batch/armbatch/tsp-location.yaml index 965b7a4011f1..07a94ac7c8e0 100644 --- a/sdk/resourcemanager/batch/armbatch/tsp-location.yaml +++ b/sdk/resourcemanager/batch/armbatch/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/batch/resource-manager/Microsoft.Batch/Batch -commit: ed16e10caee8ef2ab09f321272877d0efbec0d1e +commit: 3be251f9a92eb6ae68f4e3ee706f462541de316e repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/resourcemanager/batch/armbatch/version.go b/sdk/resourcemanager/batch/armbatch/version.go index efe89a7e51c0..6360428ebd93 100644 --- a/sdk/resourcemanager/batch/armbatch/version.go +++ b/sdk/resourcemanager/batch/armbatch/version.go @@ -6,5 +6,5 @@ package armbatch const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" - moduleVersion = "v4.0.0" + moduleVersion = "v5.0.0" )