From 92ddf8069860efeae45e23d3ad15db156405c31e Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Fri, 4 Oct 2024 12:09:47 -0700 Subject: [PATCH] Fake pollers accept more status codes (#1436) The underlying pollers in azcore always accept 200 and possible 204 as valid HTTP responses. While services should model this, some only model the status code for the initial HTTP response. Updated fakes to emulate the behavior in azcore. --- packages/autorest.go/CHANGELOG.md | 4 + .../lrogroup/fake/zz_lroretrys_server.go | 24 ++-- .../autorest/lrogroup/fake/zz_lros_server.go | 132 +++++++++--------- .../lrogroup/fake/zz_lrosads_server.go | 96 ++++++------- .../fake/zz_lroscustomheader_server.go | 12 +- .../paginggroup/fake/zz_paging_server.go | 6 +- .../zz_cloudserviceroleinstances_server.go | 18 +-- .../fake/zz_cloudservices_server.go | 36 ++--- .../zz_cloudservicesupdatedomain_server.go | 6 +- .../fake/zz_dedicatedhosts_server.go | 6 +- .../fake/zz_diskrestorepoint_server.go | 6 +- .../armcompute/fake/zz_disks_server.go | 6 +- .../fake/zz_restorepoints_server.go | 6 +- .../armcompute/fake/zz_snapshots_server.go | 6 +- .../fake/zz_virtualmachines_server.go | 54 +++---- ...almachinescalesetrollingupgrades_server.go | 18 +-- .../fake/zz_virtualmachinescalesets_server.go | 66 ++++----- .../zz_virtualmachinescalesetvms_server.go | 48 +++---- .../fake/zz_containers_server.go | 12 +- .../armdataboxedge/fake/zz_devices_server.go | 24 ++-- .../fake/zz_diagnosticsettings_server.go | 12 +- .../armdataboxedge/fake/zz_shares_server.go | 6 +- .../fake/zz_storageaccounts_server.go | 6 +- .../fake/zz_supportpackages_server.go | 6 +- .../test/maps/azalias/fake/zz_server.go | 6 +- .../fake/zz_applicationgateways_server.go | 12 +- .../fake/zz_connectionmonitors_server.go | 18 +-- .../armnetwork/fake/zz_flowlogs_server.go | 6 +- .../fake/zz_loadbalancers_server.go | 6 +- .../armnetwork/fake/zz_management_server.go | 6 +- .../fake/zz_p2svpngateways_server.go | 6 +- .../fake/zz_packetcaptures_server.go | 18 +-- .../armnetwork/fake/zz_subnets_server.go | 12 +- .../armnetwork/fake/zz_vipswap_server.go | 6 +- .../armnetwork/fake/zz_virtualhubs_server.go | 18 +-- ...virtualnetworkgatewayconnections_server.go | 6 +- .../fake/zz_virtualnetworkgateways_server.go | 12 +- .../fake/zz_vpnlinkconnections_server.go | 6 +- .../fake/zz_vpnsitesconfiguration_server.go | 6 +- .../armnetwork/fake/zz_watchers_server.go | 6 +- packages/codegen.go/src/fake/servers.ts | 22 ++- packages/typespec-go/CHANGELOG.md | 4 + .../armcodesigning/fake/zz_accounts_server.go | 6 +- .../fake/zz_certificateprofiles_server.go | 6 +- .../zz_sharedprivatelinkresources_server.go | 6 +- .../fake/zz_watchers_server.go | 6 +- .../fake/zz_pools_server.go | 6 +- .../fake/zz_azurelargeinstance_server.go | 6 +- .../fake/zz_loadtests_server.go | 6 +- .../fake/zz_firewallrules_server.go | 6 +- .../fake/zz_mongoclusters_server.go | 6 +- .../zz_privateendpointconnections_server.go | 6 +- .../lro/lrorpcgroup/fake/zz_rpc_server.go | 6 +- .../lrostdgroup/fake/zz_standard_server.go | 12 +- .../fake/zz_nestedproxyresources_server.go | 6 +- .../zz_topleveltrackedresources_server.go | 6 +- 56 files changed, 453 insertions(+), 429 deletions(-) diff --git a/packages/autorest.go/CHANGELOG.md b/packages/autorest.go/CHANGELOG.md index 270fb72b0..e31be7910 100644 --- a/packages/autorest.go/CHANGELOG.md +++ b/packages/autorest.go/CHANGELOG.md @@ -8,6 +8,10 @@ * Fake servers will honor the caller's context in the `*http.Request`. * Add missing error check when parsing multipart/form content in fakes. +### Other Fixes + +* Fake pollers will always include `http.StatusOK` as an acceptible status code, and `http.StatusNoContent` for operations that don't return a body. + ## 4.0.0-preview.67 (2024-07-30) ### Bugs Fixed diff --git a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroretrys_server.go b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroretrys_server.go index a4b85f4d1..9651ca9dd 100644 --- a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroretrys_server.go +++ b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroretrys_server.go @@ -20,11 +20,11 @@ import ( // LRORetrysServer is a fake server for instances of the lrogroup.LRORetrysClient type. type LRORetrysServer struct { // BeginDelete202Retry200 is the fake for method LRORetrysClient.BeginDelete202Retry200 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete202Retry200 func(ctx context.Context, options *lrogroup.LRORetrysClientBeginDelete202Retry200Options) (resp azfake.PollerResponder[lrogroup.LRORetrysClientDelete202Retry200Response], errResp azfake.ErrorResponder) // BeginDeleteAsyncRelativeRetrySucceeded is the fake for method LRORetrysClient.BeginDeleteAsyncRelativeRetrySucceeded - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRelativeRetrySucceeded func(ctx context.Context, options *lrogroup.LRORetrysClientBeginDeleteAsyncRelativeRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LRORetrysClientDeleteAsyncRelativeRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginDeleteProvisioning202Accepted200Succeeded is the fake for method LRORetrysClient.BeginDeleteProvisioning202Accepted200Succeeded @@ -32,11 +32,11 @@ type LRORetrysServer struct { BeginDeleteProvisioning202Accepted200Succeeded func(ctx context.Context, options *lrogroup.LRORetrysClientBeginDeleteProvisioning202Accepted200SucceededOptions) (resp azfake.PollerResponder[lrogroup.LRORetrysClientDeleteProvisioning202Accepted200SucceededResponse], errResp azfake.ErrorResponder) // BeginPost202Retry200 is the fake for method LRORetrysClient.BeginPost202Retry200 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202Retry200 func(ctx context.Context, options *lrogroup.LRORetrysClientBeginPost202Retry200Options) (resp azfake.PollerResponder[lrogroup.LRORetrysClientPost202Retry200Response], errResp azfake.ErrorResponder) // BeginPostAsyncRelativeRetrySucceeded is the fake for method LRORetrysClient.BeginPostAsyncRelativeRetrySucceeded - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRelativeRetrySucceeded func(ctx context.Context, options *lrogroup.LRORetrysClientBeginPostAsyncRelativeRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LRORetrysClientPostAsyncRelativeRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginPut201CreatingSucceeded200 is the fake for method LRORetrysClient.BeginPut201CreatingSucceeded200 @@ -146,9 +146,9 @@ func (l *LRORetrysServerTransport) dispatchBeginDelete202Retry200(req *http.Requ return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete202Retry200.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete202Retry200) { l.beginDelete202Retry200.remove(req) @@ -176,9 +176,9 @@ func (l *LRORetrysServerTransport) dispatchBeginDeleteAsyncRelativeRetrySucceede return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRelativeRetrySucceeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRelativeRetrySucceeded) { l.beginDeleteAsyncRelativeRetrySucceeded.remove(req) @@ -246,9 +246,9 @@ func (l *LRORetrysServerTransport) dispatchBeginPost202Retry200(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202Retry200.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202Retry200) { l.beginPost202Retry200.remove(req) @@ -286,9 +286,9 @@ func (l *LRORetrysServerTransport) dispatchBeginPostAsyncRelativeRetrySucceeded( return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRelativeRetrySucceeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRelativeRetrySucceeded) { l.beginPostAsyncRelativeRetrySucceeded.remove(req) diff --git a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lros_server.go b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lros_server.go index 43760dc8a..853c5b505 100644 --- a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lros_server.go +++ b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lros_server.go @@ -28,31 +28,31 @@ type LROsServer struct { BeginDelete202Retry200 func(ctx context.Context, options *lrogroup.LROsClientBeginDelete202Retry200Options) (resp azfake.PollerResponder[lrogroup.LROsClientDelete202Retry200Response], errResp azfake.ErrorResponder) // BeginDelete204Succeeded is the fake for method LROsClient.BeginDelete204Succeeded - // HTTP status codes to indicate success: http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent BeginDelete204Succeeded func(ctx context.Context, options *lrogroup.LROsClientBeginDelete204SucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDelete204SucceededResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncNoHeaderInRetry is the fake for method LROsClient.BeginDeleteAsyncNoHeaderInRetry - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncNoHeaderInRetry func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteAsyncNoHeaderInRetryOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteAsyncNoHeaderInRetryResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncNoRetrySucceeded is the fake for method LROsClient.BeginDeleteAsyncNoRetrySucceeded - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncNoRetrySucceeded func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteAsyncNoRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteAsyncNoRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRetryFailed is the fake for method LROsClient.BeginDeleteAsyncRetryFailed - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRetryFailed func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteAsyncRetryFailedOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteAsyncRetryFailedResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRetrySucceeded is the fake for method LROsClient.BeginDeleteAsyncRetrySucceeded - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRetrySucceeded func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteAsyncRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteAsyncRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRetrycanceled is the fake for method LROsClient.BeginDeleteAsyncRetrycanceled - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRetrycanceled func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteAsyncRetrycanceledOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteAsyncRetrycanceledResponse], errResp azfake.ErrorResponder) // BeginDeleteNoHeaderInRetry is the fake for method LROsClient.BeginDeleteNoHeaderInRetry - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteNoHeaderInRetry func(ctx context.Context, options *lrogroup.LROsClientBeginDeleteNoHeaderInRetryOptions) (resp azfake.PollerResponder[lrogroup.LROsClientDeleteNoHeaderInRetryResponse], errResp azfake.ErrorResponder) // BeginDeleteProvisioning202Accepted200Succeeded is the fake for method LROsClient.BeginDeleteProvisioning202Accepted200Succeeded @@ -88,11 +88,11 @@ type LROsServer struct { BeginPost202List func(ctx context.Context, options *lrogroup.LROsClientBeginPost202ListOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPost202ListResponse], errResp azfake.ErrorResponder) // BeginPost202NoRetry204 is the fake for method LROsClient.BeginPost202NoRetry204 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPost202NoRetry204 func(ctx context.Context, options *lrogroup.LROsClientBeginPost202NoRetry204Options) (resp azfake.PollerResponder[lrogroup.LROsClientPost202NoRetry204Response], errResp azfake.ErrorResponder) // BeginPost202Retry200 is the fake for method LROsClient.BeginPost202Retry200 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202Retry200 func(ctx context.Context, options *lrogroup.LROsClientBeginPost202Retry200Options) (resp azfake.PollerResponder[lrogroup.LROsClientPost202Retry200Response], errResp azfake.ErrorResponder) // BeginPostAsyncNoRetrySucceeded is the fake for method LROsClient.BeginPostAsyncNoRetrySucceeded @@ -100,7 +100,7 @@ type LROsServer struct { BeginPostAsyncNoRetrySucceeded func(ctx context.Context, options *lrogroup.LROsClientBeginPostAsyncNoRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostAsyncNoRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRetryFailed is the fake for method LROsClient.BeginPostAsyncRetryFailed - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRetryFailed func(ctx context.Context, options *lrogroup.LROsClientBeginPostAsyncRetryFailedOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostAsyncRetryFailedResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRetrySucceeded is the fake for method LROsClient.BeginPostAsyncRetrySucceeded @@ -108,19 +108,19 @@ type LROsServer struct { BeginPostAsyncRetrySucceeded func(ctx context.Context, options *lrogroup.LROsClientBeginPostAsyncRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostAsyncRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRetrycanceled is the fake for method LROsClient.BeginPostAsyncRetrycanceled - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRetrycanceled func(ctx context.Context, options *lrogroup.LROsClientBeginPostAsyncRetrycanceledOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostAsyncRetrycanceledResponse], errResp azfake.ErrorResponder) // BeginPostDoubleHeadersFinalAzureHeaderGet is the fake for method LROsClient.BeginPostDoubleHeadersFinalAzureHeaderGet - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPostDoubleHeadersFinalAzureHeaderGet func(ctx context.Context, options *lrogroup.LROsClientBeginPostDoubleHeadersFinalAzureHeaderGetOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostDoubleHeadersFinalAzureHeaderGetResponse], errResp azfake.ErrorResponder) // BeginPostDoubleHeadersFinalAzureHeaderGetDefault is the fake for method LROsClient.BeginPostDoubleHeadersFinalAzureHeaderGetDefault - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPostDoubleHeadersFinalAzureHeaderGetDefault func(ctx context.Context, options *lrogroup.LROsClientBeginPostDoubleHeadersFinalAzureHeaderGetDefaultOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostDoubleHeadersFinalAzureHeaderGetDefaultResponse], errResp azfake.ErrorResponder) // BeginPostDoubleHeadersFinalLocationGet is the fake for method LROsClient.BeginPostDoubleHeadersFinalLocationGet - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPostDoubleHeadersFinalLocationGet func(ctx context.Context, options *lrogroup.LROsClientBeginPostDoubleHeadersFinalLocationGetOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPostDoubleHeadersFinalLocationGetResponse], errResp azfake.ErrorResponder) // BeginPut200Acceptedcanceled200 is the fake for method LROsClient.BeginPut200Acceptedcanceled200 @@ -148,15 +148,15 @@ type LROsServer struct { BeginPut201CreatingSucceeded200 func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPut201CreatingSucceeded200Options) (resp azfake.PollerResponder[lrogroup.LROsClientPut201CreatingSucceeded200Response], errResp azfake.ErrorResponder) // BeginPut201Succeeded is the fake for method LROsClient.BeginPut201Succeeded - // HTTP status codes to indicate success: http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginPut201Succeeded func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPut201SucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPut201SucceededResponse], errResp azfake.ErrorResponder) // BeginPut202Retry200 is the fake for method LROsClient.BeginPut202Retry200 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPut202Retry200 func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPut202Retry200Options) (resp azfake.PollerResponder[lrogroup.LROsClientPut202Retry200Response], errResp azfake.ErrorResponder) // BeginPutAsyncNoHeaderInRetry is the fake for method LROsClient.BeginPutAsyncNoHeaderInRetry - // HTTP status codes to indicate success: http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginPutAsyncNoHeaderInRetry func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPutAsyncNoHeaderInRetryOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutAsyncNoHeaderInRetryResponse], errResp azfake.ErrorResponder) // BeginPutAsyncNoRetrySucceeded is the fake for method LROsClient.BeginPutAsyncNoRetrySucceeded @@ -168,7 +168,7 @@ type LROsServer struct { BeginPutAsyncNoRetrycanceled func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPutAsyncNoRetrycanceledOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutAsyncNoRetrycanceledResponse], errResp azfake.ErrorResponder) // BeginPutAsyncNonResource is the fake for method LROsClient.BeginPutAsyncNonResource - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPutAsyncNonResource func(ctx context.Context, sku lrogroup.SKU, options *lrogroup.LROsClientBeginPutAsyncNonResourceOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutAsyncNonResourceResponse], errResp azfake.ErrorResponder) // BeginPutAsyncRetryFailed is the fake for method LROsClient.BeginPutAsyncRetryFailed @@ -180,19 +180,19 @@ type LROsServer struct { BeginPutAsyncRetrySucceeded func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPutAsyncRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutAsyncRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginPutAsyncSubResource is the fake for method LROsClient.BeginPutAsyncSubResource - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPutAsyncSubResource func(ctx context.Context, product lrogroup.SubProduct, options *lrogroup.LROsClientBeginPutAsyncSubResourceOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutAsyncSubResourceResponse], errResp azfake.ErrorResponder) // BeginPutNoHeaderInRetry is the fake for method LROsClient.BeginPutNoHeaderInRetry - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPutNoHeaderInRetry func(ctx context.Context, product lrogroup.Product, options *lrogroup.LROsClientBeginPutNoHeaderInRetryOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutNoHeaderInRetryResponse], errResp azfake.ErrorResponder) // BeginPutNonResource is the fake for method LROsClient.BeginPutNonResource - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPutNonResource func(ctx context.Context, sku lrogroup.SKU, options *lrogroup.LROsClientBeginPutNonResourceOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutNonResourceResponse], errResp azfake.ErrorResponder) // BeginPutSubResource is the fake for method LROsClient.BeginPutSubResource - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginPutSubResource func(ctx context.Context, product lrogroup.SubProduct, options *lrogroup.LROsClientBeginPutSubResourceOptions) (resp azfake.PollerResponder[lrogroup.LROsClientPutSubResourceResponse], errResp azfake.ErrorResponder) } @@ -502,9 +502,9 @@ func (l *LROsServerTransport) dispatchBeginDelete204Succeeded(req *http.Request) return nil, err } - if !contains([]int{http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusNoContent}, resp.StatusCode) { l.beginDelete204Succeeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete204Succeeded) { l.beginDelete204Succeeded.remove(req) @@ -532,9 +532,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteAsyncNoHeaderInRetry(req *http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncNoHeaderInRetry.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncNoHeaderInRetry) { l.beginDeleteAsyncNoHeaderInRetry.remove(req) @@ -562,9 +562,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteAsyncNoRetrySucceeded(req *http return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncNoRetrySucceeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncNoRetrySucceeded) { l.beginDeleteAsyncNoRetrySucceeded.remove(req) @@ -592,9 +592,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteAsyncRetryFailed(req *http.Requ return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRetryFailed.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRetryFailed) { l.beginDeleteAsyncRetryFailed.remove(req) @@ -622,9 +622,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteAsyncRetrySucceeded(req *http.R return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRetrySucceeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRetrySucceeded) { l.beginDeleteAsyncRetrySucceeded.remove(req) @@ -652,9 +652,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteAsyncRetrycanceled(req *http.Re return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRetrycanceled.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRetrycanceled) { l.beginDeleteAsyncRetrycanceled.remove(req) @@ -682,9 +682,9 @@ func (l *LROsServerTransport) dispatchBeginDeleteNoHeaderInRetry(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteNoHeaderInRetry.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteNoHeaderInRetry) { l.beginDeleteNoHeaderInRetry.remove(req) @@ -974,9 +974,9 @@ func (l *LROsServerTransport) dispatchBeginPost202NoRetry204(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPost202NoRetry204.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202NoRetry204) { l.beginPost202NoRetry204.remove(req) @@ -1014,9 +1014,9 @@ func (l *LROsServerTransport) dispatchBeginPost202Retry200(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202Retry200.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202Retry200) { l.beginPost202Retry200.remove(req) @@ -1094,9 +1094,9 @@ func (l *LROsServerTransport) dispatchBeginPostAsyncRetryFailed(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRetryFailed.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRetryFailed) { l.beginPostAsyncRetryFailed.remove(req) @@ -1174,9 +1174,9 @@ func (l *LROsServerTransport) dispatchBeginPostAsyncRetrycanceled(req *http.Requ return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRetrycanceled.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRetrycanceled) { l.beginPostAsyncRetrycanceled.remove(req) @@ -1204,9 +1204,9 @@ func (l *LROsServerTransport) dispatchBeginPostDoubleHeadersFinalAzureHeaderGet( return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPostDoubleHeadersFinalAzureHeaderGet.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPostDoubleHeadersFinalAzureHeaderGet) { l.beginPostDoubleHeadersFinalAzureHeaderGet.remove(req) @@ -1234,9 +1234,9 @@ func (l *LROsServerTransport) dispatchBeginPostDoubleHeadersFinalAzureHeaderGetD return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPostDoubleHeadersFinalAzureHeaderGetDefault.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPostDoubleHeadersFinalAzureHeaderGetDefault) { l.beginPostDoubleHeadersFinalAzureHeaderGetDefault.remove(req) @@ -1264,9 +1264,9 @@ func (l *LROsServerTransport) dispatchBeginPostDoubleHeadersFinalLocationGet(req return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPostDoubleHeadersFinalLocationGet.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPostDoubleHeadersFinalLocationGet) { l.beginPostDoubleHeadersFinalLocationGet.remove(req) @@ -1502,9 +1502,9 @@ func (l *LROsServerTransport) dispatchBeginPut201Succeeded(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusCreated}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { l.beginPut201Succeeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusCreated", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } if !server.PollerResponderMore(beginPut201Succeeded) { l.beginPut201Succeeded.remove(req) @@ -1536,9 +1536,9 @@ func (l *LROsServerTransport) dispatchBeginPut202Retry200(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPut202Retry200.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPut202Retry200) { l.beginPut202Retry200.remove(req) @@ -1570,9 +1570,9 @@ func (l *LROsServerTransport) dispatchBeginPutAsyncNoHeaderInRetry(req *http.Req return nil, err } - if !contains([]int{http.StatusCreated}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { l.beginPutAsyncNoHeaderInRetry.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusCreated", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } if !server.PollerResponderMore(beginPutAsyncNoHeaderInRetry) { l.beginPutAsyncNoHeaderInRetry.remove(req) @@ -1672,9 +1672,9 @@ func (l *LROsServerTransport) dispatchBeginPutAsyncNonResource(req *http.Request return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPutAsyncNonResource.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPutAsyncNonResource) { l.beginPutAsyncNonResource.remove(req) @@ -1774,9 +1774,9 @@ func (l *LROsServerTransport) dispatchBeginPutAsyncSubResource(req *http.Request return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPutAsyncSubResource.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPutAsyncSubResource) { l.beginPutAsyncSubResource.remove(req) @@ -1808,9 +1808,9 @@ func (l *LROsServerTransport) dispatchBeginPutNoHeaderInRetry(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPutNoHeaderInRetry.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPutNoHeaderInRetry) { l.beginPutNoHeaderInRetry.remove(req) @@ -1842,9 +1842,9 @@ func (l *LROsServerTransport) dispatchBeginPutNonResource(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPutNonResource.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPutNonResource) { l.beginPutNonResource.remove(req) @@ -1876,9 +1876,9 @@ func (l *LROsServerTransport) dispatchBeginPutSubResource(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { l.beginPutSubResource.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginPutSubResource) { l.beginPutSubResource.remove(req) diff --git a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lrosads_server.go b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lrosads_server.go index e084d0857..a95eca24b 100644 --- a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lrosads_server.go +++ b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lrosads_server.go @@ -20,67 +20,67 @@ import ( // LROSADsServer is a fake server for instances of the lrogroup.LROSADsClient type. type LROSADsServer struct { // BeginDelete202NonRetry400 is the fake for method LROSADsClient.BeginDelete202NonRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete202NonRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginDelete202NonRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientDelete202NonRetry400Response], errResp azfake.ErrorResponder) // BeginDelete202RetryInvalidHeader is the fake for method LROSADsClient.BeginDelete202RetryInvalidHeader - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete202RetryInvalidHeader func(ctx context.Context, options *lrogroup.LROSADsClientBeginDelete202RetryInvalidHeaderOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientDelete202RetryInvalidHeaderResponse], errResp azfake.ErrorResponder) // BeginDelete204Succeeded is the fake for method LROSADsClient.BeginDelete204Succeeded - // HTTP status codes to indicate success: http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent BeginDelete204Succeeded func(ctx context.Context, options *lrogroup.LROSADsClientBeginDelete204SucceededOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientDelete204SucceededResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRelativeRetry400 is the fake for method LROSADsClient.BeginDeleteAsyncRelativeRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRelativeRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginDeleteAsyncRelativeRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientDeleteAsyncRelativeRetry400Response], errResp azfake.ErrorResponder) // BeginDeleteAsyncRelativeRetryInvalidHeader is the fake for method LROSADsClient.BeginDeleteAsyncRelativeRetryInvalidHeader - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRelativeRetryInvalidHeader func(ctx context.Context, options *lrogroup.LROSADsClientBeginDeleteAsyncRelativeRetryInvalidHeaderOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientDeleteAsyncRelativeRetryInvalidHeaderResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRelativeRetryInvalidJSONPolling is the fake for method LROSADsClient.BeginDeleteAsyncRelativeRetryInvalidJSONPolling - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRelativeRetryInvalidJSONPolling func(ctx context.Context, options *lrogroup.LROSADsClientBeginDeleteAsyncRelativeRetryInvalidJSONPollingOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientDeleteAsyncRelativeRetryInvalidJSONPollingResponse], errResp azfake.ErrorResponder) // BeginDeleteAsyncRelativeRetryNoStatus is the fake for method LROSADsClient.BeginDeleteAsyncRelativeRetryNoStatus - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteAsyncRelativeRetryNoStatus func(ctx context.Context, options *lrogroup.LROSADsClientBeginDeleteAsyncRelativeRetryNoStatusOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientDeleteAsyncRelativeRetryNoStatusResponse], errResp azfake.ErrorResponder) // BeginDeleteNonRetry400 is the fake for method LROSADsClient.BeginDeleteNonRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteNonRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginDeleteNonRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientDeleteNonRetry400Response], errResp azfake.ErrorResponder) // BeginPost202NoLocation is the fake for method LROSADsClient.BeginPost202NoLocation - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202NoLocation func(ctx context.Context, options *lrogroup.LROSADsClientBeginPost202NoLocationOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientPost202NoLocationResponse], errResp azfake.ErrorResponder) // BeginPost202NonRetry400 is the fake for method LROSADsClient.BeginPost202NonRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202NonRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginPost202NonRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientPost202NonRetry400Response], errResp azfake.ErrorResponder) // BeginPost202RetryInvalidHeader is the fake for method LROSADsClient.BeginPost202RetryInvalidHeader - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202RetryInvalidHeader func(ctx context.Context, options *lrogroup.LROSADsClientBeginPost202RetryInvalidHeaderOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientPost202RetryInvalidHeaderResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRelativeRetry400 is the fake for method LROSADsClient.BeginPostAsyncRelativeRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRelativeRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginPostAsyncRelativeRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientPostAsyncRelativeRetry400Response], errResp azfake.ErrorResponder) // BeginPostAsyncRelativeRetryInvalidHeader is the fake for method LROSADsClient.BeginPostAsyncRelativeRetryInvalidHeader - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRelativeRetryInvalidHeader func(ctx context.Context, options *lrogroup.LROSADsClientBeginPostAsyncRelativeRetryInvalidHeaderOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientPostAsyncRelativeRetryInvalidHeaderResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRelativeRetryInvalidJSONPolling is the fake for method LROSADsClient.BeginPostAsyncRelativeRetryInvalidJSONPolling - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRelativeRetryInvalidJSONPolling func(ctx context.Context, options *lrogroup.LROSADsClientBeginPostAsyncRelativeRetryInvalidJSONPollingOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientPostAsyncRelativeRetryInvalidJSONPollingResponse], errResp azfake.ErrorResponder) // BeginPostAsyncRelativeRetryNoPayload is the fake for method LROSADsClient.BeginPostAsyncRelativeRetryNoPayload - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRelativeRetryNoPayload func(ctx context.Context, options *lrogroup.LROSADsClientBeginPostAsyncRelativeRetryNoPayloadOptions) (resp azfake.PollerResponder[lrogroup.LROSADsClientPostAsyncRelativeRetryNoPayloadResponse], errResp azfake.ErrorResponder) // BeginPostNonRetry400 is the fake for method LROSADsClient.BeginPostNonRetry400 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostNonRetry400 func(ctx context.Context, options *lrogroup.LROSADsClientBeginPostNonRetry400Options) (resp azfake.PollerResponder[lrogroup.LROSADsClientPostNonRetry400Response], errResp azfake.ErrorResponder) // BeginPut200InvalidJSON is the fake for method LROSADsClient.BeginPut200InvalidJSON @@ -298,9 +298,9 @@ func (l *LROSADsServerTransport) dispatchBeginDelete202NonRetry400(req *http.Req return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete202NonRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete202NonRetry400) { l.beginDelete202NonRetry400.remove(req) @@ -328,9 +328,9 @@ func (l *LROSADsServerTransport) dispatchBeginDelete202RetryInvalidHeader(req *h return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete202RetryInvalidHeader.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete202RetryInvalidHeader) { l.beginDelete202RetryInvalidHeader.remove(req) @@ -358,9 +358,9 @@ func (l *LROSADsServerTransport) dispatchBeginDelete204Succeeded(req *http.Reque return nil, err } - if !contains([]int{http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusNoContent}, resp.StatusCode) { l.beginDelete204Succeeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete204Succeeded) { l.beginDelete204Succeeded.remove(req) @@ -388,9 +388,9 @@ func (l *LROSADsServerTransport) dispatchBeginDeleteAsyncRelativeRetry400(req *h return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRelativeRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRelativeRetry400) { l.beginDeleteAsyncRelativeRetry400.remove(req) @@ -418,9 +418,9 @@ func (l *LROSADsServerTransport) dispatchBeginDeleteAsyncRelativeRetryInvalidHea return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRelativeRetryInvalidHeader.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRelativeRetryInvalidHeader) { l.beginDeleteAsyncRelativeRetryInvalidHeader.remove(req) @@ -448,9 +448,9 @@ func (l *LROSADsServerTransport) dispatchBeginDeleteAsyncRelativeRetryInvalidJSO return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRelativeRetryInvalidJSONPolling.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRelativeRetryInvalidJSONPolling) { l.beginDeleteAsyncRelativeRetryInvalidJSONPolling.remove(req) @@ -478,9 +478,9 @@ func (l *LROSADsServerTransport) dispatchBeginDeleteAsyncRelativeRetryNoStatus(r return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteAsyncRelativeRetryNoStatus.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteAsyncRelativeRetryNoStatus) { l.beginDeleteAsyncRelativeRetryNoStatus.remove(req) @@ -508,9 +508,9 @@ func (l *LROSADsServerTransport) dispatchBeginDeleteNonRetry400(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDeleteNonRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteNonRetry400) { l.beginDeleteNonRetry400.remove(req) @@ -548,9 +548,9 @@ func (l *LROSADsServerTransport) dispatchBeginPost202NoLocation(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202NoLocation.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202NoLocation) { l.beginPost202NoLocation.remove(req) @@ -588,9 +588,9 @@ func (l *LROSADsServerTransport) dispatchBeginPost202NonRetry400(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202NonRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202NonRetry400) { l.beginPost202NonRetry400.remove(req) @@ -628,9 +628,9 @@ func (l *LROSADsServerTransport) dispatchBeginPost202RetryInvalidHeader(req *htt return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202RetryInvalidHeader.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202RetryInvalidHeader) { l.beginPost202RetryInvalidHeader.remove(req) @@ -668,9 +668,9 @@ func (l *LROSADsServerTransport) dispatchBeginPostAsyncRelativeRetry400(req *htt return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRelativeRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRelativeRetry400) { l.beginPostAsyncRelativeRetry400.remove(req) @@ -708,9 +708,9 @@ func (l *LROSADsServerTransport) dispatchBeginPostAsyncRelativeRetryInvalidHeade return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRelativeRetryInvalidHeader.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRelativeRetryInvalidHeader) { l.beginPostAsyncRelativeRetryInvalidHeader.remove(req) @@ -748,9 +748,9 @@ func (l *LROSADsServerTransport) dispatchBeginPostAsyncRelativeRetryInvalidJSONP return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRelativeRetryInvalidJSONPolling.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRelativeRetryInvalidJSONPolling) { l.beginPostAsyncRelativeRetryInvalidJSONPolling.remove(req) @@ -788,9 +788,9 @@ func (l *LROSADsServerTransport) dispatchBeginPostAsyncRelativeRetryNoPayload(re return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRelativeRetryNoPayload.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRelativeRetryNoPayload) { l.beginPostAsyncRelativeRetryNoPayload.remove(req) @@ -828,9 +828,9 @@ func (l *LROSADsServerTransport) dispatchBeginPostNonRetry400(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostNonRetry400.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostNonRetry400) { l.beginPostNonRetry400.remove(req) diff --git a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroscustomheader_server.go b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroscustomheader_server.go index 3205ffb52..fffbeb40d 100644 --- a/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroscustomheader_server.go +++ b/packages/autorest.go/test/autorest/lrogroup/fake/zz_lroscustomheader_server.go @@ -20,11 +20,11 @@ import ( // LROsCustomHeaderServer is a fake server for instances of the lrogroup.LROsCustomHeaderClient type. type LROsCustomHeaderServer struct { // BeginPost202Retry200 is the fake for method LROsCustomHeaderClient.BeginPost202Retry200 - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPost202Retry200 func(ctx context.Context, options *lrogroup.LROsCustomHeaderClientBeginPost202Retry200Options) (resp azfake.PollerResponder[lrogroup.LROsCustomHeaderClientPost202Retry200Response], errResp azfake.ErrorResponder) // BeginPostAsyncRetrySucceeded is the fake for method LROsCustomHeaderClient.BeginPostAsyncRetrySucceeded - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPostAsyncRetrySucceeded func(ctx context.Context, options *lrogroup.LROsCustomHeaderClientBeginPostAsyncRetrySucceededOptions) (resp azfake.PollerResponder[lrogroup.LROsCustomHeaderClientPostAsyncRetrySucceededResponse], errResp azfake.ErrorResponder) // BeginPut201CreatingSucceeded200 is the fake for method LROsCustomHeaderClient.BeginPut201CreatingSucceeded200 @@ -132,9 +132,9 @@ func (l *LROsCustomHeaderServerTransport) dispatchBeginPost202Retry200(req *http return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPost202Retry200.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPost202Retry200) { l.beginPost202Retry200.remove(req) @@ -172,9 +172,9 @@ func (l *LROsCustomHeaderServerTransport) dispatchBeginPostAsyncRetrySucceeded(r return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginPostAsyncRetrySucceeded.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPostAsyncRetrySucceeded) { l.beginPostAsyncRetrySucceeded.remove(req) diff --git a/packages/autorest.go/test/autorest/paginggroup/fake/zz_paging_server.go b/packages/autorest.go/test/autorest/paginggroup/fake/zz_paging_server.go index 300fecdf3..02e6ba585 100644 --- a/packages/autorest.go/test/autorest/paginggroup/fake/zz_paging_server.go +++ b/packages/autorest.go/test/autorest/paginggroup/fake/zz_paging_server.go @@ -59,7 +59,7 @@ type PagingServer struct { NewGetMultiplePagesFragmentWithGroupingNextLinkPager func(customParameterGroup paginggroup.CustomParameterGroup, options *paginggroup.PagingClientGetMultiplePagesFragmentWithGroupingNextLinkOptions) (resp azfake.PagerResponder[paginggroup.PagingClientGetMultiplePagesFragmentWithGroupingNextLinkResponse]) // BeginGetMultiplePagesLRO is the fake for method PagingClient.BeginGetMultiplePagesLRO - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginGetMultiplePagesLRO func(ctx context.Context, options *paginggroup.PagingClientBeginGetMultiplePagesLROOptions) (resp azfake.PollerResponder[azfake.PagerResponder[paginggroup.PagingClientGetMultiplePagesLROResponse]], errResp azfake.ErrorResponder) // NewGetMultiplePagesRetryFirstPager is the fake for method PagingClient.NewGetMultiplePagesRetryFirstPager @@ -624,9 +624,9 @@ func (p *PagingServerTransport) dispatchBeginGetMultiplePagesLRO(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { p.beginGetMultiplePagesLRO.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginGetMultiplePagesLRO) { p.beginGetMultiplePagesLRO.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudserviceroleinstances_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudserviceroleinstances_server.go index ad836bfba..e48f0e9a5 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudserviceroleinstances_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudserviceroleinstances_server.go @@ -42,15 +42,15 @@ type CloudServiceRoleInstancesServer struct { NewListPager func(resourceGroupName string, cloudServiceName string, options *armcompute.CloudServiceRoleInstancesClientListOptions) (resp azfake.PagerResponder[armcompute.CloudServiceRoleInstancesClientListResponse]) // BeginRebuild is the fake for method CloudServiceRoleInstancesClient.BeginRebuild - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRebuild func(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServiceRoleInstancesClientBeginRebuildOptions) (resp azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRebuildResponse], errResp azfake.ErrorResponder) // BeginReimage is the fake for method CloudServiceRoleInstancesClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServiceRoleInstancesClientBeginReimageOptions) (resp azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientReimageResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method CloudServiceRoleInstancesClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServiceRoleInstancesClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRestartResponse], errResp azfake.ErrorResponder) } @@ -395,9 +395,9 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRebuild(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginRebuild.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRebuild) { c.beginRebuild.remove(req) @@ -443,9 +443,9 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginReimage(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { c.beginReimage.remove(req) @@ -491,9 +491,9 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRestart(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { c.beginRestart.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservices_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservices_server.go index aaebbb33d..0a0eda989 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservices_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservices_server.go @@ -31,7 +31,7 @@ type CloudServicesServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDeleteInstances is the fake for method CloudServicesClient.BeginDeleteInstances - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteInstances func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginDeleteInstancesOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientDeleteInstancesResponse], errResp azfake.ErrorResponder) // Get is the fake for method CloudServicesClient.Get @@ -51,23 +51,23 @@ type CloudServicesServer struct { NewListAllPager func(options *armcompute.CloudServicesClientListAllOptions) (resp azfake.PagerResponder[armcompute.CloudServicesClientListAllResponse]) // BeginPowerOff is the fake for method CloudServicesClient.BeginPowerOff - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPowerOff func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginPowerOffOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientPowerOffResponse], errResp azfake.ErrorResponder) // BeginRebuild is the fake for method CloudServicesClient.BeginRebuild - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRebuild func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginRebuildOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientRebuildResponse], errResp azfake.ErrorResponder) // BeginReimage is the fake for method CloudServicesClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginReimageOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientReimageResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method CloudServicesClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientRestartResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method CloudServicesClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesClientBeginStartOptions) (resp azfake.PollerResponder[armcompute.CloudServicesClientStartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method CloudServicesClient.BeginUpdate @@ -309,9 +309,9 @@ func (c *CloudServicesServerTransport) dispatchBeginDeleteInstances(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDeleteInstances.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteInstances) { c.beginDeleteInstances.remove(req) @@ -489,9 +489,9 @@ func (c *CloudServicesServerTransport) dispatchBeginPowerOff(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginPowerOff.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPowerOff) { c.beginPowerOff.remove(req) @@ -543,9 +543,9 @@ func (c *CloudServicesServerTransport) dispatchBeginRebuild(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginRebuild.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRebuild) { c.beginRebuild.remove(req) @@ -597,9 +597,9 @@ func (c *CloudServicesServerTransport) dispatchBeginReimage(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { c.beginReimage.remove(req) @@ -651,9 +651,9 @@ func (c *CloudServicesServerTransport) dispatchBeginRestart(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { c.beginRestart.remove(req) @@ -695,9 +695,9 @@ func (c *CloudServicesServerTransport) dispatchBeginStart(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { c.beginStart.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservicesupdatedomain_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservicesupdatedomain_server.go index 14d8ad866..cbb35c663 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservicesupdatedomain_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_cloudservicesupdatedomain_server.go @@ -31,7 +31,7 @@ type CloudServicesUpdateDomainServer struct { NewListUpdateDomainsPager func(resourceGroupName string, cloudServiceName string, options *armcompute.CloudServicesUpdateDomainClientListUpdateDomainsOptions) (resp azfake.PagerResponder[armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse]) // BeginWalkUpdateDomain is the fake for method CloudServicesUpdateDomainClient.BeginWalkUpdateDomain - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginWalkUpdateDomain func(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters armcompute.UpdateDomain, options *armcompute.CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (resp azfake.PollerResponder[armcompute.CloudServicesUpdateDomainClientWalkUpdateDomainResponse], errResp azfake.ErrorResponder) } @@ -235,9 +235,9 @@ func (c *CloudServicesUpdateDomainServerTransport) dispatchBeginWalkUpdateDomain return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginWalkUpdateDomain.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginWalkUpdateDomain) { c.beginWalkUpdateDomain.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_dedicatedhosts_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_dedicatedhosts_server.go index 27f7642ae..d330727f8 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_dedicatedhosts_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_dedicatedhosts_server.go @@ -38,7 +38,7 @@ type DedicatedHostsServer struct { NewListByHostGroupPager func(resourceGroupName string, hostGroupName string, options *armcompute.DedicatedHostsClientListByHostGroupOptions) (resp azfake.PagerResponder[armcompute.DedicatedHostsClientListByHostGroupResponse]) // BeginRestart is the fake for method DedicatedHostsClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *armcompute.DedicatedHostsClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.DedicatedHostsClientRestartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method DedicatedHostsClient.BeginUpdate @@ -346,9 +346,9 @@ func (d *DedicatedHostsServerTransport) dispatchBeginRestart(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusNoContent}, resp.StatusCode) { d.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { d.beginRestart.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_diskrestorepoint_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_diskrestorepoint_server.go index 497cf1571..820d35e57 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_diskrestorepoint_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_diskrestorepoint_server.go @@ -34,7 +34,7 @@ type DiskRestorePointServer struct { NewListByRestorePointPager func(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *armcompute.DiskRestorePointClientListByRestorePointOptions) (resp azfake.PagerResponder[armcompute.DiskRestorePointClientListByRestorePointResponse]) // BeginRevokeAccess is the fake for method DiskRestorePointClient.BeginRevokeAccess - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRevokeAccess func(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *armcompute.DiskRestorePointClientBeginRevokeAccessOptions) (resp azfake.PollerResponder[armcompute.DiskRestorePointClientRevokeAccessResponse], errResp azfake.ErrorResponder) } @@ -286,9 +286,9 @@ func (d *DiskRestorePointServerTransport) dispatchBeginRevokeAccess(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginRevokeAccess.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRevokeAccess) { d.beginRevokeAccess.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_disks_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_disks_server.go index e934f715c..4a3dbe6da 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_disks_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_disks_server.go @@ -46,7 +46,7 @@ type DisksServer struct { NewListByResourceGroupPager func(resourceGroupName string, options *armcompute.DisksClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcompute.DisksClientListByResourceGroupResponse]) // BeginRevokeAccess is the fake for method DisksClient.BeginRevokeAccess - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRevokeAccess func(ctx context.Context, resourceGroupName string, diskName string, options *armcompute.DisksClientBeginRevokeAccessOptions) (resp azfake.PollerResponder[armcompute.DisksClientRevokeAccessResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method DisksClient.BeginUpdate @@ -411,9 +411,9 @@ func (d *DisksServerTransport) dispatchBeginRevokeAccess(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginRevokeAccess.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRevokeAccess) { d.beginRevokeAccess.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_restorepoints_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_restorepoints_server.go index 03ef6c1de..253f03b34 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_restorepoints_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_restorepoints_server.go @@ -21,7 +21,7 @@ import ( // RestorePointsServer is a fake server for instances of the armcompute.RestorePointsClient type. type RestorePointsServer struct { // BeginCreate is the fake for method RestorePointsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreate func(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters armcompute.RestorePoint, options *armcompute.RestorePointsClientBeginCreateOptions) (resp azfake.PollerResponder[armcompute.RestorePointsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method RestorePointsClient.BeginDelete @@ -135,9 +135,9 @@ func (r *RestorePointsServerTransport) dispatchBeginCreate(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusCreated}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { r.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusCreated", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { r.beginCreate.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_snapshots_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_snapshots_server.go index a8e3d2c01..6872d5bdb 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_snapshots_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_snapshots_server.go @@ -46,7 +46,7 @@ type SnapshotsServer struct { NewListByResourceGroupPager func(resourceGroupName string, options *armcompute.SnapshotsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcompute.SnapshotsClientListByResourceGroupResponse]) // BeginRevokeAccess is the fake for method SnapshotsClient.BeginRevokeAccess - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRevokeAccess func(ctx context.Context, resourceGroupName string, snapshotName string, options *armcompute.SnapshotsClientBeginRevokeAccessOptions) (resp azfake.PollerResponder[armcompute.SnapshotsClientRevokeAccessResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method SnapshotsClient.BeginUpdate @@ -411,9 +411,9 @@ func (s *SnapshotsServerTransport) dispatchBeginRevokeAccess(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginRevokeAccess.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRevokeAccess) { s.beginRevokeAccess.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachines_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachines_server.go index 2ff977c9c..6649395ee 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachines_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachines_server.go @@ -32,7 +32,7 @@ type VirtualMachinesServer struct { BeginCapture func(ctx context.Context, resourceGroupName string, vmName string, parameters armcompute.VirtualMachineCaptureParameters, options *armcompute.VirtualMachinesClientBeginCaptureOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientCaptureResponse], errResp azfake.ErrorResponder) // BeginConvertToManagedDisks is the fake for method VirtualMachinesClient.BeginConvertToManagedDisks - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginConvertToManagedDisks func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginConvertToManagedDisksOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientConvertToManagedDisksResponse], errResp azfake.ErrorResponder) // BeginCreateOrUpdate is the fake for method VirtualMachinesClient.BeginCreateOrUpdate @@ -40,7 +40,7 @@ type VirtualMachinesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, vmName string, parameters armcompute.VirtualMachine, options *armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDeallocate is the fake for method VirtualMachinesClient.BeginDeallocate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeallocate func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginDeallocateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientDeallocateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualMachinesClient.BeginDelete @@ -80,27 +80,27 @@ type VirtualMachinesServer struct { NewListByLocationPager func(location string, options *armcompute.VirtualMachinesClientListByLocationOptions) (resp azfake.PagerResponder[armcompute.VirtualMachinesClientListByLocationResponse]) // BeginPerformMaintenance is the fake for method VirtualMachinesClient.BeginPerformMaintenance - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPerformMaintenance func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginPerformMaintenanceOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientPerformMaintenanceResponse], errResp azfake.ErrorResponder) // BeginPowerOff is the fake for method VirtualMachinesClient.BeginPowerOff - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPowerOff func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginPowerOffOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientPowerOffResponse], errResp azfake.ErrorResponder) // BeginReapply is the fake for method VirtualMachinesClient.BeginReapply - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReapply func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginReapplyOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientReapplyResponse], errResp azfake.ErrorResponder) // BeginRedeploy is the fake for method VirtualMachinesClient.BeginRedeploy - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRedeploy func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginRedeployOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientRedeployResponse], errResp azfake.ErrorResponder) // BeginReimage is the fake for method VirtualMachinesClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginReimageOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientReimageResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method VirtualMachinesClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientRestartResponse], errResp azfake.ErrorResponder) // RetrieveBootDiagnosticsData is the fake for method VirtualMachinesClient.RetrieveBootDiagnosticsData @@ -116,7 +116,7 @@ type VirtualMachinesServer struct { SimulateEviction func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientSimulateEvictionOptions) (resp azfake.Responder[armcompute.VirtualMachinesClientSimulateEvictionResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method VirtualMachinesClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginStartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachinesClientStartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method VirtualMachinesClient.BeginUpdate @@ -390,9 +390,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginConvertToManagedDisks(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginConvertToManagedDisks.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginConvertToManagedDisks) { v.beginConvertToManagedDisks.remove(req) @@ -497,9 +497,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginDeallocate(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDeallocate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeallocate) { v.beginDeallocate.remove(req) @@ -934,9 +934,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPerformMaintenance(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPerformMaintenance.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPerformMaintenance) { v.beginPerformMaintenance.remove(req) @@ -993,9 +993,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPowerOff(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPowerOff.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPowerOff) { v.beginPowerOff.remove(req) @@ -1037,9 +1037,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReapply(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReapply.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReapply) { v.beginReapply.remove(req) @@ -1081,9 +1081,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRedeploy(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRedeploy.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRedeploy) { v.beginRedeploy.remove(req) @@ -1135,9 +1135,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReimage(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { v.beginReimage.remove(req) @@ -1179,9 +1179,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRestart(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { v.beginRestart.remove(req) @@ -1358,9 +1358,9 @@ func (v *VirtualMachinesServerTransport) dispatchBeginStart(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { v.beginStart.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetrollingupgrades_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetrollingupgrades_server.go index 0522e0503..081d9b59f 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetrollingupgrades_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetrollingupgrades_server.go @@ -21,7 +21,7 @@ import ( // VirtualMachineScaleSetRollingUpgradesServer is a fake server for instances of the armcompute.VirtualMachineScaleSetRollingUpgradesClient type. type VirtualMachineScaleSetRollingUpgradesServer struct { // BeginCancel is the fake for method VirtualMachineScaleSetRollingUpgradesClient.BeginCancel - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCancel func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientCancelResponse], errResp azfake.ErrorResponder) // GetLatest is the fake for method VirtualMachineScaleSetRollingUpgradesClient.GetLatest @@ -29,11 +29,11 @@ type VirtualMachineScaleSetRollingUpgradesServer struct { GetLatest func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (resp azfake.Responder[armcompute.VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse], errResp azfake.ErrorResponder) // BeginStartExtensionUpgrade is the fake for method VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStartExtensionUpgrade func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], errResp azfake.ErrorResponder) // BeginStartOSUpgrade is the fake for method VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStartOSUpgrade func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], errResp azfake.ErrorResponder) } @@ -135,9 +135,9 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginCanc return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginCancel.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCancel) { v.beginCancel.remove(req) @@ -212,9 +212,9 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStartExtensionUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStartExtensionUpgrade) { v.beginStartExtensionUpgrade.remove(req) @@ -256,9 +256,9 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStartOSUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStartOSUpgrade) { v.beginStartOSUpgrade.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesets_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesets_server.go index 7a8d61d81..3e3c7980d 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesets_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesets_server.go @@ -32,7 +32,7 @@ type VirtualMachineScaleSetsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.VirtualMachineScaleSet, options *armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDeallocate is the fake for method VirtualMachineScaleSetsClient.BeginDeallocate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeallocate func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeallocateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualMachineScaleSetsClient.BeginDelete @@ -40,7 +40,7 @@ type VirtualMachineScaleSetsServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDeleteInstances is the fake for method VirtualMachineScaleSetsClient.BeginDeleteInstances - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteInstances func(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs, options *armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse], errResp azfake.ErrorResponder) // ForceRecoveryServiceFabricPlatformUpdateDomainWalk is the fake for method VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk @@ -76,35 +76,35 @@ type VirtualMachineScaleSetsServer struct { NewListSKUsPager func(resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientListSKUsOptions) (resp azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListSKUsResponse]) // BeginPerformMaintenance is the fake for method VirtualMachineScaleSetsClient.BeginPerformMaintenance - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPerformMaintenance func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPerformMaintenanceResponse], errResp azfake.ErrorResponder) // BeginPowerOff is the fake for method VirtualMachineScaleSetsClient.BeginPowerOff - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPowerOff func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginPowerOffOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPowerOffResponse], errResp azfake.ErrorResponder) // BeginRedeploy is the fake for method VirtualMachineScaleSetsClient.BeginRedeploy - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRedeploy func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginRedeployOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRedeployResponse], errResp azfake.ErrorResponder) // BeginReimage is the fake for method VirtualMachineScaleSetsClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginReimageOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageResponse], errResp azfake.ErrorResponder) // BeginReimageAll is the fake for method VirtualMachineScaleSetsClient.BeginReimageAll - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimageAll func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginReimageAllOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageAllResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method VirtualMachineScaleSetsClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRestartResponse], errResp azfake.ErrorResponder) // BeginSetOrchestrationServiceState is the fake for method VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginSetOrchestrationServiceState func(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.OrchestrationServiceStateInput, options *armcompute.VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method VirtualMachineScaleSetsClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *armcompute.VirtualMachineScaleSetsClientBeginStartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientStartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method VirtualMachineScaleSetsClient.BeginUpdate @@ -112,7 +112,7 @@ type VirtualMachineScaleSetsServer struct { BeginUpdate func(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters armcompute.VirtualMachineScaleSetUpdate, options *armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateResponse], errResp azfake.ErrorResponder) // BeginUpdateInstances is the fake for method VirtualMachineScaleSetsClient.BeginUpdateInstances - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUpdateInstances func(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs, options *armcompute.VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateInstancesResponse], errResp azfake.ErrorResponder) } @@ -379,9 +379,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeallocate(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDeallocate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeallocate) { v.beginDeallocate.remove(req) @@ -501,9 +501,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeleteInstances(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDeleteInstances.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteInstances) { v.beginDeleteInstances.remove(req) @@ -887,9 +887,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPerformMaintenance return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPerformMaintenance.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPerformMaintenance) { v.beginPerformMaintenance.remove(req) @@ -951,9 +951,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPowerOff(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPowerOff.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPowerOff) { v.beginPowerOff.remove(req) @@ -1005,9 +1005,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRedeploy(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRedeploy.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRedeploy) { v.beginRedeploy.remove(req) @@ -1059,9 +1059,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimage(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { v.beginReimage.remove(req) @@ -1113,9 +1113,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimageAll(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReimageAll.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimageAll) { v.beginReimageAll.remove(req) @@ -1167,9 +1167,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRestart(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { v.beginRestart.remove(req) @@ -1215,9 +1215,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginSetOrchestrationSe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginSetOrchestrationServiceState.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginSetOrchestrationServiceState) { v.beginSetOrchestrationServiceState.remove(req) @@ -1269,9 +1269,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginStart(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { v.beginStart.remove(req) @@ -1365,9 +1365,9 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginUpdateInstances(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginUpdateInstances.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdateInstances) { v.beginUpdateInstances.remove(req) diff --git a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetvms_server.go b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetvms_server.go index 8444a7863..74960b8a0 100644 --- a/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetvms_server.go +++ b/packages/autorest.go/test/compute/armcompute/fake/zz_virtualmachinescalesetvms_server.go @@ -24,7 +24,7 @@ import ( // VirtualMachineScaleSetVMsServer is a fake server for instances of the armcompute.VirtualMachineScaleSetVMsClient type. type VirtualMachineScaleSetVMsServer struct { // BeginDeallocate is the fake for method VirtualMachineScaleSetVMsClient.BeginDeallocate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeallocate func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeallocateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualMachineScaleSetVMsClient.BeginDelete @@ -44,27 +44,27 @@ type VirtualMachineScaleSetVMsServer struct { NewListPager func(resourceGroupName string, virtualMachineScaleSetName string, options *armcompute.VirtualMachineScaleSetVMsClientListOptions) (resp azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMsClientListResponse]) // BeginPerformMaintenance is the fake for method VirtualMachineScaleSetVMsClient.BeginPerformMaintenance - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPerformMaintenance func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], errResp azfake.ErrorResponder) // BeginPowerOff is the fake for method VirtualMachineScaleSetVMsClient.BeginPowerOff - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPowerOff func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPowerOffResponse], errResp azfake.ErrorResponder) // BeginRedeploy is the fake for method VirtualMachineScaleSetVMsClient.BeginRedeploy - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRedeploy func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginRedeployOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRedeployResponse], errResp azfake.ErrorResponder) // BeginReimage is the fake for method VirtualMachineScaleSetVMsClient.BeginReimage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimage func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageResponse], errResp azfake.ErrorResponder) // BeginReimageAll is the fake for method VirtualMachineScaleSetVMsClient.BeginReimageAll - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginReimageAll func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageAllResponse], errResp azfake.ErrorResponder) // BeginRestart is the fake for method VirtualMachineScaleSetVMsClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginRestartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRestartResponse], errResp azfake.ErrorResponder) // RetrieveBootDiagnosticsData is the fake for method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData @@ -80,7 +80,7 @@ type VirtualMachineScaleSetVMsServer struct { SimulateEviction func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (resp azfake.Responder[armcompute.VirtualMachineScaleSetVMsClientSimulateEvictionResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method VirtualMachineScaleSetVMsClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *armcompute.VirtualMachineScaleSetVMsClientBeginStartOptions) (resp azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientStartResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method VirtualMachineScaleSetVMsClient.BeginUpdate @@ -232,9 +232,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginDeallocate(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDeallocate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeallocate) { v.beginDeallocate.remove(req) @@ -494,9 +494,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPerformMaintenan return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPerformMaintenance.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPerformMaintenance) { v.beginPerformMaintenance.remove(req) @@ -557,9 +557,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPowerOff(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginPowerOff.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPowerOff) { v.beginPowerOff.remove(req) @@ -605,9 +605,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRedeploy(req *ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRedeploy.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRedeploy) { v.beginRedeploy.remove(req) @@ -663,9 +663,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimage(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReimage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimage) { v.beginReimage.remove(req) @@ -711,9 +711,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimageAll(req * return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginReimageAll.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginReimageAll) { v.beginReimageAll.remove(req) @@ -759,9 +759,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRestart(req *htt return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { v.beginRestart.remove(req) @@ -954,9 +954,9 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginStart(req *http. return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { v.beginStart.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_containers_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_containers_server.go index 2839d9d7f..a80b0a2a7 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_containers_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_containers_server.go @@ -26,7 +26,7 @@ type ContainersServer struct { BeginCreateOrUpdate func(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, containerParam armdataboxedge.Container, options *armdataboxedge.ContainersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdataboxedge.ContainersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ContainersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *armdataboxedge.ContainersClientBeginDeleteOptions) (resp azfake.PollerResponder[armdataboxedge.ContainersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ContainersClient.Get @@ -38,7 +38,7 @@ type ContainersServer struct { NewListByStorageAccountPager func(deviceName string, storageAccountName string, resourceGroupName string, options *armdataboxedge.ContainersClientListByStorageAccountOptions) (resp azfake.PagerResponder[armdataboxedge.ContainersClientListByStorageAccountResponse]) // BeginRefresh is the fake for method ContainersClient.BeginRefresh - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRefresh func(ctx context.Context, deviceName string, storageAccountName string, containerName string, resourceGroupName string, options *armdataboxedge.ContainersClientBeginRefreshOptions) (resp azfake.PollerResponder[armdataboxedge.ContainersClientRefreshResponse], errResp azfake.ErrorResponder) } @@ -208,9 +208,9 @@ func (c *ContainersServerTransport) dispatchBeginDelete(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -346,9 +346,9 @@ func (c *ContainersServerTransport) dispatchBeginRefresh(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginRefresh.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRefresh) { c.beginRefresh.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_devices_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_devices_server.go index 13e685192..d89c638c9 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_devices_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_devices_server.go @@ -26,7 +26,7 @@ type DevicesServer struct { CreateOrUpdate func(ctx context.Context, deviceName string, resourceGroupName string, dataBoxEdgeDevice armdataboxedge.Device, options *armdataboxedge.DevicesClientCreateOrUpdateOptions) (resp azfake.Responder[armdataboxedge.DevicesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginCreateOrUpdateSecuritySettings is the fake for method DevicesClient.BeginCreateOrUpdateSecuritySettings - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreateOrUpdateSecuritySettings func(ctx context.Context, deviceName string, resourceGroupName string, securitySettings armdataboxedge.SecuritySettings, options *armdataboxedge.DevicesClientBeginCreateOrUpdateSecuritySettingsOptions) (resp azfake.PollerResponder[armdataboxedge.DevicesClientCreateOrUpdateSecuritySettingsResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method DevicesClient.BeginDelete @@ -34,7 +34,7 @@ type DevicesServer struct { BeginDelete func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DevicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdataboxedge.DevicesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDownloadUpdates is the fake for method DevicesClient.BeginDownloadUpdates - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDownloadUpdates func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DevicesClientBeginDownloadUpdatesOptions) (resp azfake.PollerResponder[armdataboxedge.DevicesClientDownloadUpdatesResponse], errResp azfake.ErrorResponder) // GenerateCertificate is the fake for method DevicesClient.GenerateCertificate @@ -58,7 +58,7 @@ type DevicesServer struct { GetUpdateSummary func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DevicesClientGetUpdateSummaryOptions) (resp azfake.Responder[armdataboxedge.DevicesClientGetUpdateSummaryResponse], errResp azfake.ErrorResponder) // BeginInstallUpdates is the fake for method DevicesClient.BeginInstallUpdates - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginInstallUpdates func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DevicesClientBeginInstallUpdatesOptions) (resp azfake.PollerResponder[armdataboxedge.DevicesClientInstallUpdatesResponse], errResp azfake.ErrorResponder) // NewListByResourceGroupPager is the fake for method DevicesClient.NewListByResourceGroupPager @@ -70,7 +70,7 @@ type DevicesServer struct { NewListBySubscriptionPager func(options *armdataboxedge.DevicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armdataboxedge.DevicesClientListBySubscriptionResponse]) // BeginScanForUpdates is the fake for method DevicesClient.BeginScanForUpdates - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginScanForUpdates func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DevicesClientBeginScanForUpdatesOptions) (resp azfake.PollerResponder[armdataboxedge.DevicesClientScanForUpdatesResponse], errResp azfake.ErrorResponder) // Update is the fake for method DevicesClient.Update @@ -257,9 +257,9 @@ func (d *DevicesServerTransport) dispatchBeginCreateOrUpdateSecuritySettings(req return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginCreateOrUpdateSecuritySettings.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateOrUpdateSecuritySettings) { d.beginCreateOrUpdateSecuritySettings.remove(req) @@ -345,9 +345,9 @@ func (d *DevicesServerTransport) dispatchBeginDownloadUpdates(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginDownloadUpdates.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDownloadUpdates) { d.beginDownloadUpdates.remove(req) @@ -554,9 +554,9 @@ func (d *DevicesServerTransport) dispatchBeginInstallUpdates(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginInstallUpdates.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginInstallUpdates) { d.beginInstallUpdates.remove(req) @@ -692,9 +692,9 @@ func (d *DevicesServerTransport) dispatchBeginScanForUpdates(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginScanForUpdates.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginScanForUpdates) { d.beginScanForUpdates.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_diagnosticsettings_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_diagnosticsettings_server.go index 4408d461a..39894a2b0 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_diagnosticsettings_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_diagnosticsettings_server.go @@ -29,11 +29,11 @@ type DiagnosticSettingsServer struct { GetDiagnosticRemoteSupportSettings func(ctx context.Context, deviceName string, resourceGroupName string, options *armdataboxedge.DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsOptions) (resp azfake.Responder[armdataboxedge.DiagnosticSettingsClientGetDiagnosticRemoteSupportSettingsResponse], errResp azfake.ErrorResponder) // BeginUpdateDiagnosticProactiveLogCollectionSettings is the fake for method DiagnosticSettingsClient.BeginUpdateDiagnosticProactiveLogCollectionSettings - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUpdateDiagnosticProactiveLogCollectionSettings func(ctx context.Context, deviceName string, resourceGroupName string, proactiveLogCollectionSettings armdataboxedge.DiagnosticProactiveLogCollectionSettings, options *armdataboxedge.DiagnosticSettingsClientBeginUpdateDiagnosticProactiveLogCollectionSettingsOptions) (resp azfake.PollerResponder[armdataboxedge.DiagnosticSettingsClientUpdateDiagnosticProactiveLogCollectionSettingsResponse], errResp azfake.ErrorResponder) // BeginUpdateDiagnosticRemoteSupportSettings is the fake for method DiagnosticSettingsClient.BeginUpdateDiagnosticRemoteSupportSettings - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUpdateDiagnosticRemoteSupportSettings func(ctx context.Context, deviceName string, resourceGroupName string, diagnosticRemoteSupportSettings armdataboxedge.DiagnosticRemoteSupportSettings, options *armdataboxedge.DiagnosticSettingsClientBeginUpdateDiagnosticRemoteSupportSettingsOptions) (resp azfake.PollerResponder[armdataboxedge.DiagnosticSettingsClientUpdateDiagnosticRemoteSupportSettingsResponse], errResp azfake.ErrorResponder) } @@ -203,9 +203,9 @@ func (d *DiagnosticSettingsServerTransport) dispatchBeginUpdateDiagnosticProacti return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginUpdateDiagnosticProactiveLogCollectionSettings.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdateDiagnosticProactiveLogCollectionSettings) { d.beginUpdateDiagnosticProactiveLogCollectionSettings.remove(req) @@ -251,9 +251,9 @@ func (d *DiagnosticSettingsServerTransport) dispatchBeginUpdateDiagnosticRemoteS return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { d.beginUpdateDiagnosticRemoteSupportSettings.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUpdateDiagnosticRemoteSupportSettings) { d.beginUpdateDiagnosticRemoteSupportSettings.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_shares_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_shares_server.go index 82c6d686e..c00d3b8e4 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_shares_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_shares_server.go @@ -38,7 +38,7 @@ type SharesServer struct { NewListByDataBoxEdgeDevicePager func(deviceName string, resourceGroupName string, options *armdataboxedge.SharesClientListByDataBoxEdgeDeviceOptions) (resp azfake.PagerResponder[armdataboxedge.SharesClientListByDataBoxEdgeDeviceResponse]) // BeginRefresh is the fake for method SharesClient.BeginRefresh - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRefresh func(ctx context.Context, deviceName string, name string, resourceGroupName string, options *armdataboxedge.SharesClientBeginRefreshOptions) (resp azfake.PollerResponder[armdataboxedge.SharesClientRefreshResponse], errResp azfake.ErrorResponder) } @@ -326,9 +326,9 @@ func (s *SharesServerTransport) dispatchBeginRefresh(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginRefresh.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRefresh) { s.beginRefresh.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_storageaccounts_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_storageaccounts_server.go index 9961e4a48..df107d1ca 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_storageaccounts_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_storageaccounts_server.go @@ -26,7 +26,7 @@ type StorageAccountsServer struct { BeginCreateOrUpdate func(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, storageAccount armdataboxedge.StorageAccount, options *armdataboxedge.StorageAccountsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdataboxedge.StorageAccountsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method StorageAccountsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, deviceName string, storageAccountName string, resourceGroupName string, options *armdataboxedge.StorageAccountsClientBeginDeleteOptions) (resp azfake.PollerResponder[armdataboxedge.StorageAccountsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method StorageAccountsClient.Get @@ -192,9 +192,9 @@ func (s *StorageAccountsServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { s.beginDelete.remove(req) diff --git a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_supportpackages_server.go b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_supportpackages_server.go index 2039ff453..8d322bc00 100644 --- a/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_supportpackages_server.go +++ b/packages/autorest.go/test/databoxedge/armdataboxedge/fake/zz_supportpackages_server.go @@ -21,7 +21,7 @@ import ( // SupportPackagesServer is a fake server for instances of the armdataboxedge.SupportPackagesClient type. type SupportPackagesServer struct { // BeginTriggerSupportPackage is the fake for method SupportPackagesClient.BeginTriggerSupportPackage - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginTriggerSupportPackage func(ctx context.Context, deviceName string, resourceGroupName string, triggerSupportPackageRequest armdataboxedge.TriggerSupportPackageRequest, options *armdataboxedge.SupportPackagesClientBeginTriggerSupportPackageOptions) (resp azfake.PollerResponder[armdataboxedge.SupportPackagesClientTriggerSupportPackageResponse], errResp azfake.ErrorResponder) } @@ -117,9 +117,9 @@ func (s *SupportPackagesServerTransport) dispatchBeginTriggerSupportPackage(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginTriggerSupportPackage.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginTriggerSupportPackage) { s.beginTriggerSupportPackage.remove(req) diff --git a/packages/autorest.go/test/maps/azalias/fake/zz_server.go b/packages/autorest.go/test/maps/azalias/fake/zz_server.go index 4b1e2d764..4f550e9e6 100644 --- a/packages/autorest.go/test/maps/azalias/fake/zz_server.go +++ b/packages/autorest.go/test/maps/azalias/fake/zz_server.go @@ -39,7 +39,7 @@ type Server struct { NewListPager func(headerEnums []azalias.IntEnum, queryEnum azalias.IntEnum, options *azalias.ListOptions) (resp azfake.PagerResponder[azalias.ListResponseEnvelope]) // BeginListLRO is the fake for method Client.BeginListLRO - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginListLRO func(ctx context.Context, options *azalias.BeginListLROOptions) (resp azfake.PollerResponder[azfake.PagerResponder[azalias.ListLROResponse]], errResp azfake.ErrorResponder) // NewListWithSharedNextOnePager is the fake for method Client.NewListWithSharedNextOnePager @@ -504,9 +504,9 @@ func (s *ServerTransport) dispatchBeginListLRO(req *http.Request) (*http.Respons return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { s.beginListLRO.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginListLRO) { s.beginListLRO.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_applicationgateways_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_applicationgateways_server.go index afa2fc03a..906e0472d 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_applicationgateways_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_applicationgateways_server.go @@ -78,11 +78,11 @@ type ApplicationGatewaysServer struct { ListAvailableWafRuleSets func(ctx context.Context, options *armnetwork.ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (resp azfake.Responder[armnetwork.ApplicationGatewaysClientListAvailableWafRuleSetsResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method ApplicationGatewaysClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *armnetwork.ApplicationGatewaysClientBeginStartOptions) (resp azfake.PollerResponder[armnetwork.ApplicationGatewaysClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method ApplicationGatewaysClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *armnetwork.ApplicationGatewaysClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.ApplicationGatewaysClientStopResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method ApplicationGatewaysClient.UpdateTags @@ -724,9 +724,9 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStart(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { a.beginStart.remove(req) @@ -768,9 +768,9 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStop(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { a.beginStop.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_connectionmonitors_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_connectionmonitors_server.go index 8919cb007..4d650331b 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_connectionmonitors_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_connectionmonitors_server.go @@ -25,7 +25,7 @@ type ConnectionMonitorsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters armnetwork.ConnectionMonitor, options *armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ConnectionMonitorsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ConnectionMonitorsClient.Get @@ -41,11 +41,11 @@ type ConnectionMonitorsServer struct { BeginQuery func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginQueryOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientQueryResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method ConnectionMonitorsClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginStartOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method ConnectionMonitorsClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStopResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method ConnectionMonitorsClient.UpdateTags @@ -233,9 +233,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -404,9 +404,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginStart(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { c.beginStart.remove(req) @@ -452,9 +452,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginStop(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { c.beginStop.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_flowlogs_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_flowlogs_server.go index 8cffcd1a6..8c6987947 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_flowlogs_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_flowlogs_server.go @@ -26,7 +26,7 @@ type FlowLogsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters armnetwork.FlowLog, options *armnetwork.FlowLogsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.FlowLogsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FlowLogsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *armnetwork.FlowLogsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.FlowLogsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FlowLogsClient.Get @@ -198,9 +198,9 @@ func (f *FlowLogsServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { f.beginDelete.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_loadbalancers_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_loadbalancers_server.go index 48852d746..b0c19ac0d 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_loadbalancers_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_loadbalancers_server.go @@ -46,7 +46,7 @@ type LoadBalancersServer struct { BeginListInboundNatRulePortMappings func(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters armnetwork.QueryInboundNatRulePortMappingRequest, options *armnetwork.LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (resp azfake.PollerResponder[armnetwork.LoadBalancersClientListInboundNatRulePortMappingsResponse], errResp azfake.ErrorResponder) // BeginSwapPublicIPAddresses is the fake for method LoadBalancersClient.BeginSwapPublicIPAddresses - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginSwapPublicIPAddresses func(ctx context.Context, location string, parameters armnetwork.LoadBalancerVipSwapRequest, options *armnetwork.LoadBalancersClientBeginSwapPublicIPAddressesOptions) (resp azfake.PollerResponder[armnetwork.LoadBalancersClientSwapPublicIPAddressesResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method LoadBalancersClient.UpdateTags @@ -425,9 +425,9 @@ func (l *LoadBalancersServerTransport) dispatchBeginSwapPublicIPAddresses(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginSwapPublicIPAddresses.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginSwapPublicIPAddresses) { l.beginSwapPublicIPAddresses.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_management_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_management_server.go index b729e829f..b6c1446e6 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_management_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_management_server.go @@ -27,7 +27,7 @@ type ManagementServer struct { CheckDNSNameAvailability func(ctx context.Context, location string, domainNameLabel string, options *armnetwork.ManagementClientCheckDNSNameAvailabilityOptions) (resp azfake.Responder[armnetwork.ManagementClientCheckDNSNameAvailabilityResponse], errResp azfake.ErrorResponder) // BeginDeleteBastionShareableLink is the fake for method ManagementClient.BeginDeleteBastionShareableLink - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteBastionShareableLink func(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest armnetwork.BastionShareableLinkListRequest, options *armnetwork.ManagementClientBeginDeleteBastionShareableLinkOptions) (resp azfake.PollerResponder[armnetwork.ManagementClientDeleteBastionShareableLinkResponse], errResp azfake.ErrorResponder) // NewDisconnectActiveSessionsPager is the fake for method ManagementClient.NewDisconnectActiveSessionsPager @@ -235,9 +235,9 @@ func (m *ManagementServerTransport) dispatchBeginDeleteBastionShareableLink(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDeleteBastionShareableLink.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteBastionShareableLink) { m.beginDeleteBastionShareableLink.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_p2svpngateways_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_p2svpngateways_server.go index 09c70be6c..94bc4fc33 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_p2svpngateways_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_p2svpngateways_server.go @@ -30,7 +30,7 @@ type P2SVPNGatewaysServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, gatewayName string, options *armnetwork.P2SVPNGatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.P2SVPNGatewaysClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDisconnectP2SVPNConnections is the fake for method P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDisconnectP2SVPNConnections func(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request armnetwork.P2SVPNConnectionRequest, options *armnetwork.P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (resp azfake.PollerResponder[armnetwork.P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse], errResp azfake.ErrorResponder) // BeginGenerateVPNProfile is the fake for method P2SVPNGatewaysClient.BeginGenerateVPNProfile @@ -288,9 +288,9 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginDisconnectP2SVPNConnections return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginDisconnectP2SVPNConnections.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDisconnectP2SVPNConnections) { p.beginDisconnectP2SVPNConnections.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_packetcaptures_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_packetcaptures_server.go index 04d18bf72..ac0f042c1 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_packetcaptures_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_packetcaptures_server.go @@ -21,11 +21,11 @@ import ( // PacketCapturesServer is a fake server for instances of the armnetwork.PacketCapturesClient type. type PacketCapturesServer struct { // BeginCreate is the fake for method PacketCapturesClient.BeginCreate - // HTTP status codes to indicate success: http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreate func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters armnetwork.PacketCapture, options *armnetwork.PacketCapturesClientBeginCreateOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method PacketCapturesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *armnetwork.PacketCapturesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method PacketCapturesClient.Get @@ -41,7 +41,7 @@ type PacketCapturesServer struct { NewListPager func(resourceGroupName string, networkWatcherName string, options *armnetwork.PacketCapturesClientListOptions) (resp azfake.PagerResponder[armnetwork.PacketCapturesClientListResponse]) // BeginStop is the fake for method PacketCapturesClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *armnetwork.PacketCapturesClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientStopResponse], errResp azfake.ErrorResponder) } @@ -159,9 +159,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginCreate(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusCreated}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { p.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusCreated", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { p.beginCreate.remove(req) @@ -207,9 +207,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { p.beginDelete.remove(req) @@ -378,9 +378,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginStop(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { p.beginStop.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_subnets_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_subnets_server.go index 9afb04f6c..092ecb7b6 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_subnets_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_subnets_server.go @@ -38,11 +38,11 @@ type SubnetsServer struct { NewListPager func(resourceGroupName string, virtualNetworkName string, options *armnetwork.SubnetsClientListOptions) (resp azfake.PagerResponder[armnetwork.SubnetsClientListResponse]) // BeginPrepareNetworkPolicies is the fake for method SubnetsClient.BeginPrepareNetworkPolicies - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPrepareNetworkPolicies func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters armnetwork.PrepareNetworkPoliciesRequest, options *armnetwork.SubnetsClientBeginPrepareNetworkPoliciesOptions) (resp azfake.PollerResponder[armnetwork.SubnetsClientPrepareNetworkPoliciesResponse], errResp azfake.ErrorResponder) // BeginUnprepareNetworkPolicies is the fake for method SubnetsClient.BeginUnprepareNetworkPolicies - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUnprepareNetworkPolicies func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters armnetwork.UnprepareNetworkPoliciesRequest, options *armnetwork.SubnetsClientBeginUnprepareNetworkPoliciesOptions) (resp azfake.PollerResponder[armnetwork.SubnetsClientUnprepareNetworkPoliciesResponse], errResp azfake.ErrorResponder) } @@ -350,9 +350,9 @@ func (s *SubnetsServerTransport) dispatchBeginPrepareNetworkPolicies(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginPrepareNetworkPolicies.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPrepareNetworkPolicies) { s.beginPrepareNetworkPolicies.remove(req) @@ -402,9 +402,9 @@ func (s *SubnetsServerTransport) dispatchBeginUnprepareNetworkPolicies(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginUnprepareNetworkPolicies.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUnprepareNetworkPolicies) { s.beginUnprepareNetworkPolicies.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_vipswap_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_vipswap_server.go index d1a9e9312..bb62135b6 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_vipswap_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_vipswap_server.go @@ -21,7 +21,7 @@ import ( // VipSwapServer is a fake server for instances of the armnetwork.VipSwapClient type. type VipSwapServer struct { // BeginCreate is the fake for method VipSwapClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreate func(ctx context.Context, groupName string, resourceName string, parameters armnetwork.SwapResource, options *armnetwork.VipSwapClientBeginCreateOptions) (resp azfake.PollerResponder[armnetwork.VipSwapClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method VipSwapClient.Get @@ -129,9 +129,9 @@ func (v *VipSwapServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { v.beginCreate.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualhubs_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualhubs_server.go index cdfab3bb1..3d398519c 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualhubs_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualhubs_server.go @@ -35,15 +35,15 @@ type VirtualHubsServer struct { Get func(ctx context.Context, resourceGroupName string, virtualHubName string, options *armnetwork.VirtualHubsClientGetOptions) (resp azfake.Responder[armnetwork.VirtualHubsClientGetResponse], errResp azfake.ErrorResponder) // BeginGetEffectiveVirtualHubRoutes is the fake for method VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginGetEffectiveVirtualHubRoutes func(ctx context.Context, resourceGroupName string, virtualHubName string, options *armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualHubsClientGetEffectiveVirtualHubRoutesResponse], errResp azfake.ErrorResponder) // BeginGetInboundRoutes is the fake for method VirtualHubsClient.BeginGetInboundRoutes - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginGetInboundRoutes func(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters armnetwork.GetInboundRoutesParameters, options *armnetwork.VirtualHubsClientBeginGetInboundRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualHubsClientGetInboundRoutesResponse], errResp azfake.ErrorResponder) // BeginGetOutboundRoutes is the fake for method VirtualHubsClient.BeginGetOutboundRoutes - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginGetOutboundRoutes func(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters armnetwork.GetOutboundRoutesParameters, options *armnetwork.VirtualHubsClientBeginGetOutboundRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualHubsClientGetOutboundRoutesResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method VirtualHubsClient.NewListPager @@ -310,9 +310,9 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetEffectiveVirtualHubRoutes(r return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginGetEffectiveVirtualHubRoutes.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginGetEffectiveVirtualHubRoutes) { v.beginGetEffectiveVirtualHubRoutes.remove(req) @@ -358,9 +358,9 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetInboundRoutes(req *http.Req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginGetInboundRoutes.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginGetInboundRoutes) { v.beginGetInboundRoutes.remove(req) @@ -406,9 +406,9 @@ func (v *VirtualHubsServerTransport) dispatchBeginGetOutboundRoutes(req *http.Re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginGetOutboundRoutes.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginGetOutboundRoutes) { v.beginGetOutboundRoutes.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgatewayconnections_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgatewayconnections_server.go index b8d7e5ca3..29c2bd944 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgatewayconnections_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgatewayconnections_server.go @@ -47,7 +47,7 @@ type VirtualNetworkGatewayConnectionsServer struct { NewListPager func(resourceGroupName string, options *armnetwork.VirtualNetworkGatewayConnectionsClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualNetworkGatewayConnectionsClientListResponse]) // BeginResetConnection is the fake for method VirtualNetworkGatewayConnectionsClient.BeginResetConnection - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetConnection func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *armnetwork.VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewayConnectionsClientResetConnectionResponse], errResp azfake.ErrorResponder) // BeginResetSharedKey is the fake for method VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey @@ -438,9 +438,9 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginResetConn return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetConnection.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetConnection) { v.beginResetConnection.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgateways_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgateways_server.go index f885c7bd3..fa6f777da 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgateways_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_virtualnetworkgateways_server.go @@ -31,7 +31,7 @@ type VirtualNetworkGatewaysServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDisconnectVirtualNetworkGatewayVPNConnections is the fake for method VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDisconnectVirtualNetworkGatewayVPNConnections func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request armnetwork.P2SVPNConnectionRequest, options *armnetwork.VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse], errResp azfake.ErrorResponder) // BeginGenerateVPNProfile is the fake for method VirtualNetworkGatewaysClient.BeginGenerateVPNProfile @@ -83,7 +83,7 @@ type VirtualNetworkGatewaysServer struct { BeginReset func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse], errResp azfake.ErrorResponder) // BeginResetVPNClientSharedKey is the fake for method VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetVPNClientSharedKey func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse], errResp azfake.ErrorResponder) // BeginSetVpnclientIPSecParameters is the fake for method VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters @@ -373,9 +373,9 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDisconnectVirtualNe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDisconnectVirtualNetworkGatewayVPNConnections) { v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req) @@ -961,9 +961,9 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginResetVPNClientShare return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetVPNClientSharedKey.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetVPNClientSharedKey) { v.beginResetVPNClientSharedKey.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_vpnlinkconnections_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_vpnlinkconnections_server.go index d90af0dcf..12d3ff26d 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_vpnlinkconnections_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_vpnlinkconnections_server.go @@ -30,7 +30,7 @@ type VPNLinkConnectionsServer struct { NewListByVPNConnectionPager func(resourceGroupName string, gatewayName string, connectionName string, options *armnetwork.VPNLinkConnectionsClientListByVPNConnectionOptions) (resp azfake.PagerResponder[armnetwork.VPNLinkConnectionsClientListByVPNConnectionResponse]) // BeginResetConnection is the fake for method VPNLinkConnectionsClient.BeginResetConnection - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetConnection func(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *armnetwork.VPNLinkConnectionsClientBeginResetConnectionOptions) (resp azfake.PollerResponder[armnetwork.VPNLinkConnectionsClientResetConnectionResponse], errResp azfake.ErrorResponder) } @@ -235,9 +235,9 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginResetConnection(req *ht return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginResetConnection.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetConnection) { v.beginResetConnection.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_vpnsitesconfiguration_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_vpnsitesconfiguration_server.go index 1fae65675..2b9248777 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_vpnsitesconfiguration_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_vpnsitesconfiguration_server.go @@ -21,7 +21,7 @@ import ( // VPNSitesConfigurationServer is a fake server for instances of the armnetwork.VPNSitesConfigurationClient type. type VPNSitesConfigurationServer struct { // BeginDownload is the fake for method VPNSitesConfigurationClient.BeginDownload - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDownload func(ctx context.Context, resourceGroupName string, virtualWANName string, request armnetwork.GetVPNSitesConfigurationRequest, options *armnetwork.VPNSitesConfigurationClientBeginDownloadOptions) (resp azfake.PollerResponder[armnetwork.VPNSitesConfigurationClientDownloadResponse], errResp azfake.ErrorResponder) } @@ -117,9 +117,9 @@ func (v *VPNSitesConfigurationServerTransport) dispatchBeginDownload(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDownload.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDownload) { v.beginDownload.remove(req) diff --git a/packages/autorest.go/test/network/armnetwork/fake/zz_watchers_server.go b/packages/autorest.go/test/network/armnetwork/fake/zz_watchers_server.go index 363db740c..ecfd1f7ef 100644 --- a/packages/autorest.go/test/network/armnetwork/fake/zz_watchers_server.go +++ b/packages/autorest.go/test/network/armnetwork/fake/zz_watchers_server.go @@ -29,7 +29,7 @@ type WatchersServer struct { CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters armnetwork.Watcher, options *armnetwork.WatchersClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.WatchersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method WatchersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, options *armnetwork.WatchersClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.WatchersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method WatchersClient.Get @@ -326,9 +326,9 @@ func (w *WatchersServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { w.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { w.beginDelete.remove(req) diff --git a/packages/codegen.go/src/fake/servers.ts b/packages/codegen.go/src/fake/servers.ts index e0ba21244..6af43800e 100644 --- a/packages/codegen.go/src/fake/servers.ts +++ b/packages/codegen.go/src/fake/servers.ts @@ -112,7 +112,7 @@ export async function generateServers(codeModel: go.CodeModel): Promise(); if (method.responseEnvelope.result && go.isAnyResult(method.responseEnvelope.result)) { - for (const httpStatus of values(method.httpStatusCodes)) { + for (const httpStatus of getMethodStatusCodes(method)) { const result = method.responseEnvelope.result.httpStatusCodeType[httpStatus]; if (!result) { // the operation contains a mix of schemas and non-schema responses @@ -126,7 +126,7 @@ export async function generateServers(codeModel: go.CodeModel): Promise { + // NOTE: don't modify the original array! + const statusCodes = Array.from(method.httpStatusCodes); + if (go.isLROMethod(method)) { + if (!statusCodes.includes(200)) { + // pollers always include 200 as an acceptible status code so we emulate that here + statusCodes.unshift(200); + } + if (!method.responseEnvelope.result && !statusCodes.includes(204)) { + // also include 204 if the LRO doesn't return a body + statusCodes.push(204); + } + } + return statusCodes; +} + function dispatchForLROBody(clientPkg: string, receiverName: string, method: go.Method, imports: ImportManager): string { const operationName = fixUpMethodName(method); const localVarName = uncapitalize(operationName); @@ -687,7 +703,7 @@ function dispatchForLROBody(clientPkg: string, receiverName: string, method: go. content += `\tresp, err := server.PollerResponderNext(${localVarName}, req)\n`; content += '\tif err != nil {\n\t\treturn nil, err\n\t}\n\n'; - const formattedStatusCodes = helpers.formatStatusCodes(method.httpStatusCodes); + const formattedStatusCodes = helpers.formatStatusCodes(getMethodStatusCodes(method)); content += `\tif !contains([]int{${formattedStatusCodes}}, resp.StatusCode) {\n`; content += `\t\t${operationStateMachine}.remove(req)\n`; content += `\t\treturn nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are ${formattedStatusCodes}", resp.StatusCode)}\n\t}\n`; diff --git a/packages/typespec-go/CHANGELOG.md b/packages/typespec-go/CHANGELOG.md index 35488d926..f8b1e61e4 100644 --- a/packages/typespec-go/CHANGELOG.md +++ b/packages/typespec-go/CHANGELOG.md @@ -7,6 +7,10 @@ * Fake servers will honor the caller's context in the `*http.Request`. * Add missing error check when parsing multipart/form content in fakes. +### Other Fixes + +* Fake pollers will always include `http.StatusOK` as an acceptible status code, and `http.StatusNoContent` for operations that don't return a body. + ## 0.3.1 (2024-08-14) ### Bugs Fixed diff --git a/packages/typespec-go/test/armcodesigning/fake/zz_accounts_server.go b/packages/typespec-go/test/armcodesigning/fake/zz_accounts_server.go index bdf38269b..f1094df3a 100644 --- a/packages/typespec-go/test/armcodesigning/fake/zz_accounts_server.go +++ b/packages/typespec-go/test/armcodesigning/fake/zz_accounts_server.go @@ -29,7 +29,7 @@ type AccountsServer struct { BeginCreate func(ctx context.Context, resourceGroupName string, accountName string, resource armcodesigning.Account, options *armcodesigning.AccountsClientBeginCreateOptions) (resp azfake.PollerResponder[armcodesigning.AccountsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AccountsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, options *armcodesigning.AccountsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcodesigning.AccountsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method AccountsClient.Get @@ -234,9 +234,9 @@ func (a *AccountsServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { a.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armcodesigning/fake/zz_certificateprofiles_server.go b/packages/typespec-go/test/armcodesigning/fake/zz_certificateprofiles_server.go index d3f3bd96e..18c8a4105 100644 --- a/packages/typespec-go/test/armcodesigning/fake/zz_certificateprofiles_server.go +++ b/packages/typespec-go/test/armcodesigning/fake/zz_certificateprofiles_server.go @@ -25,7 +25,7 @@ type CertificateProfilesServer struct { BeginCreate func(ctx context.Context, resourceGroupName string, accountName string, profileName string, resource armcodesigning.CertificateProfile, options *armcodesigning.CertificateProfilesClientBeginCreateOptions) (resp azfake.PollerResponder[armcodesigning.CertificateProfilesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method CertificateProfilesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, profileName string, options *armcodesigning.CertificateProfilesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcodesigning.CertificateProfilesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CertificateProfilesClient.Get @@ -197,9 +197,9 @@ func (c *CertificateProfilesServerTransport) dispatchBeginDelete(req *http.Reque return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armdatabasewatcher/fake/zz_sharedprivatelinkresources_server.go b/packages/typespec-go/test/armdatabasewatcher/fake/zz_sharedprivatelinkresources_server.go index e93c72a24..3a4b78545 100644 --- a/packages/typespec-go/test/armdatabasewatcher/fake/zz_sharedprivatelinkresources_server.go +++ b/packages/typespec-go/test/armdatabasewatcher/fake/zz_sharedprivatelinkresources_server.go @@ -25,7 +25,7 @@ type SharedPrivateLinkResourcesServer struct { BeginCreate func(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, resource armdatabasewatcher.SharedPrivateLinkResource, options *armdatabasewatcher.SharedPrivateLinkResourcesClientBeginCreateOptions) (resp azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method SharedPrivateLinkResourcesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, watcherName string, sharedPrivateLinkResourceName string, options *armdatabasewatcher.SharedPrivateLinkResourcesClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasewatcher.SharedPrivateLinkResourcesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method SharedPrivateLinkResourcesClient.Get @@ -191,9 +191,9 @@ func (s *SharedPrivateLinkResourcesServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { s.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armdatabasewatcher/fake/zz_watchers_server.go b/packages/typespec-go/test/armdatabasewatcher/fake/zz_watchers_server.go index d4264a014..524d5eeb5 100644 --- a/packages/typespec-go/test/armdatabasewatcher/fake/zz_watchers_server.go +++ b/packages/typespec-go/test/armdatabasewatcher/fake/zz_watchers_server.go @@ -25,7 +25,7 @@ type WatchersServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, watcherName string, resource armdatabasewatcher.Watcher, options *armdatabasewatcher.WatchersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method WatchersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, watcherName string, options *armdatabasewatcher.WatchersClientBeginDeleteOptions) (resp azfake.PollerResponder[armdatabasewatcher.WatchersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method WatchersClient.Get @@ -215,9 +215,9 @@ func (w *WatchersServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { w.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { w.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armdevopsinfrastructure/fake/zz_pools_server.go b/packages/typespec-go/test/armdevopsinfrastructure/fake/zz_pools_server.go index 867927d76..95a6c64a1 100644 --- a/packages/typespec-go/test/armdevopsinfrastructure/fake/zz_pools_server.go +++ b/packages/typespec-go/test/armdevopsinfrastructure/fake/zz_pools_server.go @@ -25,7 +25,7 @@ type PoolsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, poolName string, resource armdevopsinfrastructure.Pool, options *armdevopsinfrastructure.PoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armdevopsinfrastructure.PoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method PoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, poolName string, options *armdevopsinfrastructure.PoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armdevopsinfrastructure.PoolsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method PoolsClient.Get @@ -199,9 +199,9 @@ func (p *PoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Res return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { p.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armlargeinstance/fake/zz_azurelargeinstance_server.go b/packages/typespec-go/test/armlargeinstance/fake/zz_azurelargeinstance_server.go index c3b1487d6..887f6cad3 100644 --- a/packages/typespec-go/test/armlargeinstance/fake/zz_azurelargeinstance_server.go +++ b/packages/typespec-go/test/armlargeinstance/fake/zz_azurelargeinstance_server.go @@ -34,7 +34,7 @@ type AzureLargeInstanceServer struct { NewListBySubscriptionPager func(options *armlargeinstance.AzureLargeInstanceClientListBySubscriptionOptions) (resp azfake.PagerResponder[armlargeinstance.AzureLargeInstanceClientListBySubscriptionResponse]) // BeginRestart is the fake for method AzureLargeInstanceClient.BeginRestart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceGroupName string, azureLargeInstanceName string, options *armlargeinstance.AzureLargeInstanceClientBeginRestartOptions) (resp azfake.PollerResponder[armlargeinstance.AzureLargeInstanceClientRestartResponse], errResp azfake.ErrorResponder) // BeginShutdown is the fake for method AzureLargeInstanceClient.BeginShutdown @@ -271,9 +271,9 @@ func (a *AzureLargeInstanceServerTransport) dispatchBeginRestart(req *http.Reque return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { a.beginRestart.remove(req) diff --git a/packages/typespec-go/test/armloadtestservice/fake/zz_loadtests_server.go b/packages/typespec-go/test/armloadtestservice/fake/zz_loadtests_server.go index e25278455..198a62b9c 100644 --- a/packages/typespec-go/test/armloadtestservice/fake/zz_loadtests_server.go +++ b/packages/typespec-go/test/armloadtestservice/fake/zz_loadtests_server.go @@ -25,7 +25,7 @@ type LoadTestsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, loadTestName string, resource armloadtestservice.LoadTestResource, options *armloadtestservice.LoadTestsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armloadtestservice.LoadTestsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method LoadTestsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, loadTestName string, options *armloadtestservice.LoadTestsClientBeginDeleteOptions) (resp azfake.PollerResponder[armloadtestservice.LoadTestsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method LoadTestsClient.Get @@ -207,9 +207,9 @@ func (l *LoadTestsServerTransport) dispatchBeginDelete(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { l.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { l.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armmongocluster/fake/zz_firewallrules_server.go b/packages/typespec-go/test/armmongocluster/fake/zz_firewallrules_server.go index 6065c0be4..2d0677e4f 100644 --- a/packages/typespec-go/test/armmongocluster/fake/zz_firewallrules_server.go +++ b/packages/typespec-go/test/armmongocluster/fake/zz_firewallrules_server.go @@ -25,7 +25,7 @@ type FirewallRulesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, resource armmongocluster.FirewallRule, options *armmongocluster.FirewallRulesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmongocluster.FirewallRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FirewallRulesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, firewallRuleName string, options *armmongocluster.FirewallRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.FirewallRulesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FirewallRulesClient.Get @@ -191,9 +191,9 @@ func (f *FirewallRulesServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { f.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { f.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armmongocluster/fake/zz_mongoclusters_server.go b/packages/typespec-go/test/armmongocluster/fake/zz_mongoclusters_server.go index 774e97940..ef588e583 100644 --- a/packages/typespec-go/test/armmongocluster/fake/zz_mongoclusters_server.go +++ b/packages/typespec-go/test/armmongocluster/fake/zz_mongoclusters_server.go @@ -29,7 +29,7 @@ type MongoClustersServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, mongoClusterName string, resource armmongocluster.MongoCluster, options *armmongocluster.MongoClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armmongocluster.MongoClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method MongoClustersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, options *armmongocluster.MongoClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.MongoClustersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method MongoClustersClient.Get @@ -244,9 +244,9 @@ func (m *MongoClustersServerTransport) dispatchBeginDelete(req *http.Request) (* return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { m.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { m.beginDelete.remove(req) diff --git a/packages/typespec-go/test/armmongocluster/fake/zz_privateendpointconnections_server.go b/packages/typespec-go/test/armmongocluster/fake/zz_privateendpointconnections_server.go index d584e9660..1182e8975 100644 --- a/packages/typespec-go/test/armmongocluster/fake/zz_privateendpointconnections_server.go +++ b/packages/typespec-go/test/armmongocluster/fake/zz_privateendpointconnections_server.go @@ -25,7 +25,7 @@ type PrivateEndpointConnectionsServer struct { BeginCreate func(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, resource armmongocluster.PrivateEndpointConnectionResource, options *armmongocluster.PrivateEndpointConnectionsClientBeginCreateOptions) (resp azfake.PollerResponder[armmongocluster.PrivateEndpointConnectionsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method PrivateEndpointConnectionsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, mongoClusterName string, privateEndpointConnectionName string, options *armmongocluster.PrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armmongocluster.PrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method PrivateEndpointConnectionsClient.Get @@ -191,9 +191,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { p.beginDelete.remove(req) diff --git a/packages/typespec-go/test/cadlranch/azure/core/lro/lrorpcgroup/fake/zz_rpc_server.go b/packages/typespec-go/test/cadlranch/azure/core/lro/lrorpcgroup/fake/zz_rpc_server.go index 86565883b..28ae3f23d 100644 --- a/packages/typespec-go/test/cadlranch/azure/core/lro/lrorpcgroup/fake/zz_rpc_server.go +++ b/packages/typespec-go/test/cadlranch/azure/core/lro/lrorpcgroup/fake/zz_rpc_server.go @@ -18,7 +18,7 @@ import ( // RPCServer is a fake server for instances of the lrorpcgroup.RPCClient type. type RPCServer struct { // BeginLongRunningRPC is the fake for method RPCClient.BeginLongRunningRPC - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginLongRunningRPC func(ctx context.Context, body lrorpcgroup.GenerationOptions, options *lrorpcgroup.RPCClientBeginLongRunningRPCOptions) (resp azfake.PollerResponder[lrorpcgroup.RPCClientLongRunningRPCResponse], errResp azfake.ErrorResponder) } @@ -100,9 +100,9 @@ func (r *RPCServerTransport) dispatchBeginLongRunningRPC(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { r.beginLongRunningRPC.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginLongRunningRPC) { r.beginLongRunningRPC.remove(req) diff --git a/packages/typespec-go/test/cadlranch/azure/core/lro/lrostdgroup/fake/zz_standard_server.go b/packages/typespec-go/test/cadlranch/azure/core/lro/lrostdgroup/fake/zz_standard_server.go index 89bbcc664..20e73a6fb 100644 --- a/packages/typespec-go/test/cadlranch/azure/core/lro/lrostdgroup/fake/zz_standard_server.go +++ b/packages/typespec-go/test/cadlranch/azure/core/lro/lrostdgroup/fake/zz_standard_server.go @@ -24,11 +24,11 @@ type StandardServer struct { BeginCreateOrReplace func(ctx context.Context, name string, resource lrostdgroup.User, options *lrostdgroup.StandardClientBeginCreateOrReplaceOptions) (resp azfake.PollerResponder[lrostdgroup.StandardClientCreateOrReplaceResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method StandardClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, name string, options *lrostdgroup.StandardClientBeginDeleteOptions) (resp azfake.PollerResponder[lrostdgroup.StandardClientDeleteResponse], errResp azfake.ErrorResponder) // BeginExport is the fake for method StandardClient.BeginExport - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginExport func(ctx context.Context, name string, formatParam string, options *lrostdgroup.StandardClientBeginExportOptions) (resp azfake.PollerResponder[lrostdgroup.StandardClientExportResponse], errResp azfake.ErrorResponder) } @@ -168,9 +168,9 @@ func (s *StandardServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { s.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { s.beginDelete.remove(req) @@ -213,9 +213,9 @@ func (s *StandardServerTransport) dispatchBeginExport(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { s.beginExport.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginExport) { s.beginExport.remove(req) diff --git a/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_nestedproxyresources_server.go b/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_nestedproxyresources_server.go index 51b6806ec..eda1e8fca 100644 --- a/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_nestedproxyresources_server.go +++ b/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_nestedproxyresources_server.go @@ -25,7 +25,7 @@ type NestedProxyResourcesServer struct { BeginCreateOrReplace func(ctx context.Context, resourceGroupName string, topLevelTrackedResourceName string, nextedProxyResourceName string, resource resources.NestedProxyResource, options *resources.NestedProxyResourcesClientBeginCreateOrReplaceOptions) (resp azfake.PollerResponder[resources.NestedProxyResourcesClientCreateOrReplaceResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method NestedProxyResourcesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, topLevelTrackedResourceName string, nextedProxyResourceName string, options *resources.NestedProxyResourcesClientBeginDeleteOptions) (resp azfake.PollerResponder[resources.NestedProxyResourcesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method NestedProxyResourcesClient.Get @@ -199,9 +199,9 @@ func (n *NestedProxyResourcesServerTransport) dispatchBeginDelete(req *http.Requ return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { n.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { n.beginDelete.remove(req) diff --git a/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_topleveltrackedresources_server.go b/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_topleveltrackedresources_server.go index f715b2ad5..16f1cedef 100644 --- a/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_topleveltrackedresources_server.go +++ b/packages/typespec-go/test/cadlranch/azure/resource-manager/models/resources/fake/zz_topleveltrackedresources_server.go @@ -29,7 +29,7 @@ type TopLevelTrackedResourcesServer struct { BeginCreateOrReplace func(ctx context.Context, resourceGroupName string, topLevelTrackedResourceName string, resource resources.TopLevelTrackedResource, options *resources.TopLevelTrackedResourcesClientBeginCreateOrReplaceOptions) (resp azfake.PollerResponder[resources.TopLevelTrackedResourcesClientCreateOrReplaceResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method TopLevelTrackedResourcesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, topLevelTrackedResourceName string, options *resources.TopLevelTrackedResourcesClientBeginDeleteOptions) (resp azfake.PollerResponder[resources.TopLevelTrackedResourcesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method TopLevelTrackedResourcesClient.Get @@ -242,9 +242,9 @@ func (t *TopLevelTrackedResourcesServerTransport) dispatchBeginDelete(req *http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { t.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { t.beginDelete.remove(req)