From ea9f7c642a014689b6b02e0cd07ac979a425df66 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 30 Jul 2020 06:34:00 +0000 Subject: [PATCH] Generated from da00763d30e6e0a47dc90c58fbcb14cbcb2db295 Documentation updated --- .../ctrl/2017-03-01/apimanagement/api.go | 23 +- .../2017-03-01/apimanagement/apiexport.go | 4 +- .../2017-03-01/apimanagement/apioperation.go | 23 +- .../apimanagement/apioperationpolicy.go | 16 +- .../2017-03-01/apimanagement/apipolicy.go | 16 +- .../2017-03-01/apimanagement/apiproduct.go | 7 +- .../2017-03-01/apimanagement/apischema.go | 19 +- .../apimanagement/authorizationserver.go | 23 +- .../ctrl/2017-03-01/apimanagement/backend.go | 23 +- .../2017-03-01/apimanagement/certificate.go | 19 +- .../apimanagement/delegationsettings.go | 12 +- .../2017-03-01/apimanagement/emailtemplate.go | 23 +- .../ctrl/2017-03-01/apimanagement/enums.go | 365 ++++++ .../ctrl/2017-03-01/apimanagement/group.go | 23 +- .../2017-03-01/apimanagement/groupuser.go | 15 +- .../apimanagement/identityprovider.go | 20 +- .../ctrl/2017-03-01/apimanagement/logger.go | 23 +- .../ctrl/2017-03-01/apimanagement/models.go | 1134 ++++++++++------- .../apimanagement/openidconnectprovider.go | 23 +- .../ctrl/2017-03-01/apimanagement/policy.go | 16 +- .../apimanagement/policysnippets.go | 4 +- .../ctrl/2017-03-01/apimanagement/product.go | 23 +- .../2017-03-01/apimanagement/productapi.go | 15 +- .../2017-03-01/apimanagement/productgroup.go | 15 +- .../2017-03-01/apimanagement/productpolicy.go | 16 +- .../apimanagement/productsubscriptions.go | 7 +- .../ctrl/2017-03-01/apimanagement/property.go | 23 +- .../apimanagement/quotabycounterkeys.go | 8 +- .../apimanagement/quotabyperiodkeys.go | 8 +- .../ctrl/2017-03-01/apimanagement/regions.go | 4 +- .../ctrl/2017-03-01/apimanagement/reports.go | 53 +- .../apimanagement/signinsettings.go | 12 +- .../apimanagement/signupsettings.go | 12 +- .../2017-03-01/apimanagement/subscription.go | 31 +- .../2017-03-01/apimanagement/tenantaccess.go | 16 +- .../apimanagement/tenantaccessgit.go | 12 +- .../apimanagement/tenantconfiguration.go | 16 +- .../ctrl/2017-03-01/apimanagement/user.go | 31 +- .../2017-03-01/apimanagement/usergroup.go | 7 +- .../apimanagement/useridentities.go | 4 +- .../apimanagement/usersubscription.go | 7 +- .../ctrl/2017-03-01/apimanagement/version.go | 2 +- 42 files changed, 1282 insertions(+), 871 deletions(-) create mode 100644 services/preview/apimanagement/ctrl/2017-03-01/apimanagement/enums.go diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/api.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/api.go index 2bca8bb0f917..fc7940e9ca45 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/api.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/api.go @@ -116,8 +116,7 @@ func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, apimBaseURL // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -125,7 +124,6 @@ func (client APIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, func (client APIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,8 +205,7 @@ func (client APIClient) DeletePreparer(ctx context.Context, apimBaseURL string, // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APIClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -216,7 +213,6 @@ func (client APIClient) DeleteSender(req *http.Request) (*http.Response, error) func (client APIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -294,8 +290,7 @@ func (client APIClient) GetPreparer(ctx context.Context, apimBaseURL string, api // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -303,7 +298,6 @@ func (client APIClient) GetSender(req *http.Request) (*http.Response, error) { func (client APIClient) GetResponder(resp *http.Response) (result APIContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,6 +357,9 @@ func (client APIClient) List(ctx context.Context, apimBaseURL string, filter str if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "List", resp, "Failure responding to request") } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -398,8 +395,7 @@ func (client APIClient) ListPreparer(ctx context.Context, apimBaseURL string, fi // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client APIClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -407,7 +403,6 @@ func (client APIClient) ListSender(req *http.Request) (*http.Response, error) { func (client APIClient) ListResponder(resp *http.Response) (result APICollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -529,8 +524,7 @@ func (client APIClient) UpdatePreparer(ctx context.Context, apimBaseURL string, // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client APIClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -538,7 +532,6 @@ func (client APIClient) UpdateSender(req *http.Request) (*http.Response, error) func (client APIClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiexport.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiexport.go index fd574a5b0bf4..e56bce07a89f 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiexport.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiexport.go @@ -109,8 +109,7 @@ func (client APIExportClient) GetPreparer(ctx context.Context, apimBaseURL strin // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIExportClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -118,7 +117,6 @@ func (client APIExportClient) GetSender(req *http.Request) (*http.Response, erro func (client APIExportClient) GetResponder(resp *http.Response) (result APIExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperation.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperation.go index e19134c3f1c0..d05cf2799a70 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperation.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperation.go @@ -117,8 +117,7 @@ func (client APIOperationClient) CreateOrUpdatePreparer(ctx context.Context, api // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APIOperationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -126,7 +125,6 @@ func (client APIOperationClient) CreateOrUpdateSender(req *http.Request) (*http. func (client APIOperationClient) CreateOrUpdateResponder(resp *http.Response) (result OperationContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -215,8 +213,7 @@ func (client APIOperationClient) DeletePreparer(ctx context.Context, apimBaseURL // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APIOperationClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -224,7 +221,6 @@ func (client APIOperationClient) DeleteSender(req *http.Request) (*http.Response func (client APIOperationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -309,8 +305,7 @@ func (client APIOperationClient) GetPreparer(ctx context.Context, apimBaseURL st // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIOperationClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -318,7 +313,6 @@ func (client APIOperationClient) GetSender(req *http.Request) (*http.Response, e func (client APIOperationClient) GetResponder(resp *http.Response) (result OperationContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -382,6 +376,9 @@ func (client APIOperationClient) ListByAPI(ctx context.Context, apimBaseURL stri if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", resp, "Failure responding to request") } + if result.oc.hasNextLink() && result.oc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -421,8 +418,7 @@ func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, apimBase // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client APIOperationClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -430,7 +426,6 @@ func (client APIOperationClient) ListByAPISender(req *http.Request) (*http.Respo func (client APIOperationClient) ListByAPIResponder(resp *http.Response) (result OperationCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -559,8 +554,7 @@ func (client APIOperationClient) UpdatePreparer(ctx context.Context, apimBaseURL // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client APIOperationClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -568,7 +562,6 @@ func (client APIOperationClient) UpdateSender(req *http.Request) (*http.Response func (client APIOperationClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperationpolicy.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperationpolicy.go index 0ca7db733f08..f53d1b657d59 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperationpolicy.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apioperationpolicy.go @@ -123,8 +123,7 @@ func (client APIOperationPolicyClient) CreateOrUpdatePreparer(ctx context.Contex // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APIOperationPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -132,7 +131,6 @@ func (client APIOperationPolicyClient) CreateOrUpdateSender(req *http.Request) ( func (client APIOperationPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -222,8 +220,7 @@ func (client APIOperationPolicyClient) DeletePreparer(ctx context.Context, apimB // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APIOperationPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -231,7 +228,6 @@ func (client APIOperationPolicyClient) DeleteSender(req *http.Request) (*http.Re func (client APIOperationPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -317,8 +313,7 @@ func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, apimBase // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIOperationPolicyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -326,7 +321,6 @@ func (client APIOperationPolicyClient) GetSender(req *http.Request) (*http.Respo func (client APIOperationPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -412,8 +406,7 @@ func (client APIOperationPolicyClient) ListByOperationPreparer(ctx context.Conte // ListByOperationSender sends the ListByOperation request. The method will close the // http.Response Body if it receives an error. func (client APIOperationPolicyClient) ListByOperationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByOperationResponder handles the response to the ListByOperation request. The method always @@ -421,7 +414,6 @@ func (client APIOperationPolicyClient) ListByOperationSender(req *http.Request) func (client APIOperationPolicyClient) ListByOperationResponder(resp *http.Response) (result PolicyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apipolicy.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apipolicy.go index b8c3f4f07a5e..7d75f46bc15e 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apipolicy.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apipolicy.go @@ -116,8 +116,7 @@ func (client APIPolicyClient) CreateOrUpdatePreparer(ctx context.Context, apimBa // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APIPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -125,7 +124,6 @@ func (client APIPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Res func (client APIPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -208,8 +206,7 @@ func (client APIPolicyClient) DeletePreparer(ctx context.Context, apimBaseURL st // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APIPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -217,7 +214,6 @@ func (client APIPolicyClient) DeleteSender(req *http.Request) (*http.Response, e func (client APIPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -296,8 +292,7 @@ func (client APIPolicyClient) GetPreparer(ctx context.Context, apimBaseURL strin // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIPolicyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -305,7 +300,6 @@ func (client APIPolicyClient) GetSender(req *http.Request) (*http.Response, erro func (client APIPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -384,8 +378,7 @@ func (client APIPolicyClient) ListByAPIPreparer(ctx context.Context, apimBaseURL // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client APIPolicyClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -393,7 +386,6 @@ func (client APIPolicyClient) ListByAPISender(req *http.Request) (*http.Response func (client APIPolicyClient) ListByAPIResponder(resp *http.Response) (result PolicyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiproduct.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiproduct.go index 315a71904ee1..479d60669ca2 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiproduct.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apiproduct.go @@ -89,6 +89,9 @@ func (client APIProductClient) ListByApis(ctx context.Context, apimBaseURL strin if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIProductClient", "ListByApis", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -128,8 +131,7 @@ func (client APIProductClient) ListByApisPreparer(ctx context.Context, apimBaseU // ListByApisSender sends the ListByApis request. The method will close the // http.Response Body if it receives an error. func (client APIProductClient) ListByApisSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByApisResponder handles the response to the ListByApis request. The method always @@ -137,7 +139,6 @@ func (client APIProductClient) ListByApisSender(req *http.Request) (*http.Respon func (client APIProductClient) ListByApisResponder(resp *http.Response) (result ProductCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apischema.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apischema.go index 2428be29b5e5..a32186df0d53 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apischema.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/apischema.go @@ -122,8 +122,7 @@ func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, apimBa // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -131,7 +130,6 @@ func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (*http.Res func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (result SchemaContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -219,8 +217,7 @@ func (client APISchemaClient) DeletePreparer(ctx context.Context, apimBaseURL st // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APISchemaClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -228,7 +225,6 @@ func (client APISchemaClient) DeleteSender(req *http.Request) (*http.Response, e func (client APISchemaClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -312,8 +308,7 @@ func (client APISchemaClient) GetPreparer(ctx context.Context, apimBaseURL strin // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APISchemaClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -321,7 +316,6 @@ func (client APISchemaClient) GetSender(req *http.Request) (*http.Response, erro func (client APISchemaClient) GetResponder(resp *http.Response) (result SchemaContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -371,6 +365,9 @@ func (client APISchemaClient) ListByAPI(ctx context.Context, apimBaseURL string, if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -401,8 +398,7 @@ func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, apimBaseURL // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client APISchemaClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -410,7 +406,6 @@ func (client APISchemaClient) ListByAPISender(req *http.Request) (*http.Response func (client APISchemaClient) ListByAPIResponder(resp *http.Response) (result SchemaCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/authorizationserver.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/authorizationserver.go index 0a4cf07e87ef..32254cbb124f 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/authorizationserver.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/authorizationserver.go @@ -109,8 +109,7 @@ func (client AuthorizationServerClient) CreateOrUpdatePreparer(ctx context.Conte // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -118,7 +117,6 @@ func (client AuthorizationServerClient) CreateOrUpdateSender(req *http.Request) func (client AuthorizationServerClient) CreateOrUpdateResponder(resp *http.Response) (result AuthorizationServerContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,8 +197,7 @@ func (client AuthorizationServerClient) DeletePreparer(ctx context.Context, apim // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServerClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -208,7 +205,6 @@ func (client AuthorizationServerClient) DeleteSender(req *http.Request) (*http.R func (client AuthorizationServerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,8 +281,7 @@ func (client AuthorizationServerClient) GetPreparer(ctx context.Context, apimBas // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServerClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -294,7 +289,6 @@ func (client AuthorizationServerClient) GetSender(req *http.Request) (*http.Resp func (client AuthorizationServerClient) GetResponder(resp *http.Response) (result AuthorizationServerContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,6 +345,9 @@ func (client AuthorizationServerClient) List(ctx context.Context, apimBaseURL st if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "List", resp, "Failure responding to request") } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -386,8 +383,7 @@ func (client AuthorizationServerClient) ListPreparer(ctx context.Context, apimBa // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServerClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -395,7 +391,6 @@ func (client AuthorizationServerClient) ListSender(req *http.Request) (*http.Res func (client AuthorizationServerClient) ListResponder(resp *http.Response) (result AuthorizationServerCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -516,8 +511,7 @@ func (client AuthorizationServerClient) UpdatePreparer(ctx context.Context, apim // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServerClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -525,7 +519,6 @@ func (client AuthorizationServerClient) UpdateSender(req *http.Request) (*http.R func (client AuthorizationServerClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/backend.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/backend.go index 66349dd8eeff..09b41bba0b8b 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/backend.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/backend.go @@ -110,8 +110,7 @@ func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, apimBase // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client BackendClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -119,7 +118,6 @@ func (client BackendClient) CreateOrUpdateSender(req *http.Request) (*http.Respo func (client BackendClient) CreateOrUpdateResponder(resp *http.Response) (result BackendContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -201,8 +199,7 @@ func (client BackendClient) DeletePreparer(ctx context.Context, apimBaseURL stri // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client BackendClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -210,7 +207,6 @@ func (client BackendClient) DeleteSender(req *http.Request) (*http.Response, err func (client BackendClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -288,8 +284,7 @@ func (client BackendClient) GetPreparer(ctx context.Context, apimBaseURL string, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client BackendClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -297,7 +292,6 @@ func (client BackendClient) GetSender(req *http.Request) (*http.Response, error) func (client BackendClient) GetResponder(resp *http.Response) (result BackendContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -354,6 +348,9 @@ func (client BackendClient) List(ctx context.Context, apimBaseURL string, filter if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "List", resp, "Failure responding to request") } + if result.bc.hasNextLink() && result.bc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -389,8 +386,7 @@ func (client BackendClient) ListPreparer(ctx context.Context, apimBaseURL string // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client BackendClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -398,7 +394,6 @@ func (client BackendClient) ListSender(req *http.Request) (*http.Response, error func (client BackendClient) ListResponder(resp *http.Response) (result BackendCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -520,8 +515,7 @@ func (client BackendClient) UpdatePreparer(ctx context.Context, apimBaseURL stri // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client BackendClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -529,7 +523,6 @@ func (client BackendClient) UpdateSender(req *http.Request) (*http.Response, err func (client BackendClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/certificate.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/certificate.go index af0f2c0d3e75..5d30db159208 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/certificate.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/certificate.go @@ -120,8 +120,7 @@ func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, apim // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -129,7 +128,6 @@ func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.R func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result CertificateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -212,8 +210,7 @@ func (client CertificateClient) DeletePreparer(ctx context.Context, apimBaseURL // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -221,7 +218,6 @@ func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -300,8 +296,7 @@ func (client CertificateClient) GetPreparer(ctx context.Context, apimBaseURL str // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -309,7 +304,6 @@ func (client CertificateClient) GetSender(req *http.Request) (*http.Response, er func (client CertificateClient) GetResponder(resp *http.Response) (result CertificateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -368,6 +362,9 @@ func (client CertificateClient) List(ctx context.Context, apimBaseURL string, fi if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.CertificateClient", "List", resp, "Failure responding to request") } + if result.cc.hasNextLink() && result.cc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -403,8 +400,7 @@ func (client CertificateClient) ListPreparer(ctx context.Context, apimBaseURL st // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client CertificateClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -412,7 +408,6 @@ func (client CertificateClient) ListSender(req *http.Request) (*http.Response, e func (client CertificateClient) ListResponder(resp *http.Response) (result CertificateCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/delegationsettings.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/delegationsettings.go index 818ebfb9074b..8dadc6477c38 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/delegationsettings.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/delegationsettings.go @@ -96,8 +96,7 @@ func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Contex // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client DelegationSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -105,7 +104,6 @@ func (client DelegationSettingsClient) CreateOrUpdateSender(req *http.Request) ( func (client DelegationSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalDelegationSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -171,8 +169,7 @@ func (client DelegationSettingsClient) GetPreparer(ctx context.Context, apimBase // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client DelegationSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -180,7 +177,6 @@ func (client DelegationSettingsClient) GetSender(req *http.Request) (*http.Respo func (client DelegationSettingsClient) GetResponder(resp *http.Response) (result PortalDelegationSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -252,8 +248,7 @@ func (client DelegationSettingsClient) UpdatePreparer(ctx context.Context, apimB // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client DelegationSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -261,7 +256,6 @@ func (client DelegationSettingsClient) UpdateSender(req *http.Request) (*http.Re func (client DelegationSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/emailtemplate.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/emailtemplate.go index 6af536e7cf3e..3f6d512209c6 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/emailtemplate.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/emailtemplate.go @@ -113,8 +113,7 @@ func (client EmailTemplateClient) CreateOrUpdatePreparer(ctx context.Context, ap // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client EmailTemplateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -122,7 +121,6 @@ func (client EmailTemplateClient) CreateOrUpdateSender(req *http.Request) (*http func (client EmailTemplateClient) CreateOrUpdateResponder(resp *http.Response) (result EmailTemplateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,8 +194,7 @@ func (client EmailTemplateClient) DeletePreparer(ctx context.Context, apimBaseUR // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client EmailTemplateClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -205,7 +202,6 @@ func (client EmailTemplateClient) DeleteSender(req *http.Request) (*http.Respons func (client EmailTemplateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -275,8 +271,7 @@ func (client EmailTemplateClient) GetPreparer(ctx context.Context, apimBaseURL s // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client EmailTemplateClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -284,7 +279,6 @@ func (client EmailTemplateClient) GetSender(req *http.Request) (*http.Response, func (client EmailTemplateClient) GetResponder(resp *http.Response) (result EmailTemplateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -340,6 +334,9 @@ func (client EmailTemplateClient) List(ctx context.Context, apimBaseURL string, if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "List", resp, "Failure responding to request") } + if result.etc.hasNextLink() && result.etc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -375,8 +372,7 @@ func (client EmailTemplateClient) ListPreparer(ctx context.Context, apimBaseURL // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client EmailTemplateClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -384,7 +380,6 @@ func (client EmailTemplateClient) ListSender(req *http.Request) (*http.Response, func (client EmailTemplateClient) ListResponder(resp *http.Response) (result EmailTemplateCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -495,8 +490,7 @@ func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, apimBaseUR // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client EmailTemplateClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -504,7 +498,6 @@ func (client EmailTemplateClient) UpdateSender(req *http.Request) (*http.Respons func (client EmailTemplateClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/enums.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/enums.go new file mode 100644 index 000000000000..9eb58968fb61 --- /dev/null +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/enums.go @@ -0,0 +1,365 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// APIType enumerates the values for api type. +type APIType string + +const ( + // HTTP ... + HTTP APIType = "http" + // Soap ... + Soap APIType = "soap" +) + +// PossibleAPITypeValues returns an array of possible values for the APIType const type. +func PossibleAPITypeValues() []APIType { + return []APIType{HTTP, Soap} +} + +// AsyncOperationStatus enumerates the values for async operation status. +type AsyncOperationStatus string + +const ( + // Failed ... + Failed AsyncOperationStatus = "Failed" + // InProgress ... + InProgress AsyncOperationStatus = "InProgress" + // Started ... + Started AsyncOperationStatus = "Started" + // Succeeded ... + Succeeded AsyncOperationStatus = "Succeeded" +) + +// PossibleAsyncOperationStatusValues returns an array of possible values for the AsyncOperationStatus const type. +func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { + return []AsyncOperationStatus{Failed, InProgress, Started, Succeeded} +} + +// AuthorizationMethod enumerates the values for authorization method. +type AuthorizationMethod string + +const ( + // DELETE ... + DELETE AuthorizationMethod = "DELETE" + // GET ... + GET AuthorizationMethod = "GET" + // HEAD ... + HEAD AuthorizationMethod = "HEAD" + // OPTIONS ... + OPTIONS AuthorizationMethod = "OPTIONS" + // PATCH ... + PATCH AuthorizationMethod = "PATCH" + // POST ... + POST AuthorizationMethod = "POST" + // PUT ... + PUT AuthorizationMethod = "PUT" + // TRACE ... + TRACE AuthorizationMethod = "TRACE" +) + +// PossibleAuthorizationMethodValues returns an array of possible values for the AuthorizationMethod const type. +func PossibleAuthorizationMethodValues() []AuthorizationMethod { + return []AuthorizationMethod{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} +} + +// BackendProtocol enumerates the values for backend protocol. +type BackendProtocol string + +const ( + // BackendProtocolHTTP The Backend is a RESTful service. + BackendProtocolHTTP BackendProtocol = "http" + // BackendProtocolSoap The Backend is a SOAP service. + BackendProtocolSoap BackendProtocol = "soap" +) + +// PossibleBackendProtocolValues returns an array of possible values for the BackendProtocol const type. +func PossibleBackendProtocolValues() []BackendProtocol { + return []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap} +} + +// BearerTokenSendingMethod enumerates the values for bearer token sending method. +type BearerTokenSendingMethod string + +const ( + // AuthorizationHeader ... + AuthorizationHeader BearerTokenSendingMethod = "authorizationHeader" + // Query ... + Query BearerTokenSendingMethod = "query" +) + +// PossibleBearerTokenSendingMethodValues returns an array of possible values for the BearerTokenSendingMethod const type. +func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod { + return []BearerTokenSendingMethod{AuthorizationHeader, Query} +} + +// ClientAuthenticationMethod enumerates the values for client authentication method. +type ClientAuthenticationMethod string + +const ( + // Basic Basic Client Authentication method. + Basic ClientAuthenticationMethod = "Basic" + // Body Body based Authentication method. + Body ClientAuthenticationMethod = "Body" +) + +// PossibleClientAuthenticationMethodValues returns an array of possible values for the ClientAuthenticationMethod const type. +func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod { + return []ClientAuthenticationMethod{Basic, Body} +} + +// ContentFormat enumerates the values for content format. +type ContentFormat string + +const ( + // SwaggerJSON The contents are inline and Content Type if a OpenApi 2.0 Document. + SwaggerJSON ContentFormat = "swagger-json" + // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. + SwaggerLinkJSON ContentFormat = "swagger-link-json" + // WadlLinkJSON The WADL document is hosted on a publicly accessible internet address. + WadlLinkJSON ContentFormat = "wadl-link-json" + // WadlXML The contents are inline and Content type is a WADL document. + WadlXML ContentFormat = "wadl-xml" + // Wsdl The contents are inline and the document is a WSDL/Soap document. + Wsdl ContentFormat = "wsdl" + // WsdlLink The WSDL document is hosted on a publicly accessible internet address. + WsdlLink ContentFormat = "wsdl-link" +) + +// PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. +func PossibleContentFormatValues() []ContentFormat { + return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} +} + +// GrantType enumerates the values for grant type. +type GrantType string + +const ( + // AuthorizationCode Authorization Code Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.1. + AuthorizationCode GrantType = "authorizationCode" + // ClientCredentials Client Credentials Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.4. + ClientCredentials GrantType = "clientCredentials" + // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. + Implicit GrantType = "implicit" + // ResourceOwnerPassword Resource Owner Password Grant flow as described + // https://tools.ietf.org/html/rfc6749#section-4.3. + ResourceOwnerPassword GrantType = "resourceOwnerPassword" +) + +// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. +func PossibleGrantTypeValues() []GrantType { + return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} +} + +// GroupType enumerates the values for group type. +type GroupType string + +const ( + // Custom ... + Custom GroupType = "custom" + // External ... + External GroupType = "external" + // System ... + System GroupType = "system" +) + +// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. +func PossibleGroupTypeValues() []GroupType { + return []GroupType{Custom, External, System} +} + +// IdentityProviderType enumerates the values for identity provider type. +type IdentityProviderType string + +const ( + // Aad Azure Active Directory as Identity provider. + Aad IdentityProviderType = "aad" + // AadB2C Azure Active Directory B2C as Identity provider. + AadB2C IdentityProviderType = "aadB2C" + // Facebook Facebook as Identity provider. + Facebook IdentityProviderType = "facebook" + // Google Google as Identity provider. + Google IdentityProviderType = "google" + // Microsoft Microsoft Live as Identity provider. + Microsoft IdentityProviderType = "microsoft" + // Twitter Twitter as Identity provider. + Twitter IdentityProviderType = "twitter" +) + +// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. +func PossibleIdentityProviderTypeValues() []IdentityProviderType { + return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // Primary ... + Primary KeyType = "primary" + // Secondary ... + Secondary KeyType = "secondary" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{Primary, Secondary} +} + +// LoggerType enumerates the values for logger type. +type LoggerType string + +const ( + // AzureEventHub Azure Event Hub as log destination. + AzureEventHub LoggerType = "azureEventHub" +) + +// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. +func PossibleLoggerTypeValues() []LoggerType { + return []LoggerType{AzureEventHub} +} + +// PolicyScopeContract enumerates the values for policy scope contract. +type PolicyScopeContract string + +const ( + // All ... + All PolicyScopeContract = "All" + // API ... + API PolicyScopeContract = "Api" + // Operation ... + Operation PolicyScopeContract = "Operation" + // Product ... + Product PolicyScopeContract = "Product" + // Tenant ... + Tenant PolicyScopeContract = "Tenant" +) + +// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. +func PossiblePolicyScopeContractValues() []PolicyScopeContract { + return []PolicyScopeContract{All, API, Operation, Product, Tenant} +} + +// ProductState enumerates the values for product state. +type ProductState string + +const ( + // NotPublished ... + NotPublished ProductState = "notPublished" + // Published ... + Published ProductState = "published" +) + +// PossibleProductStateValues returns an array of possible values for the ProductState const type. +func PossibleProductStateValues() []ProductState { + return []ProductState{NotPublished, Published} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // ProtocolHTTP ... + ProtocolHTTP Protocol = "http" + // ProtocolHTTPS ... + ProtocolHTTPS Protocol = "https" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{ProtocolHTTP, ProtocolHTTPS} +} + +// SubscriptionState enumerates the values for subscription state. +type SubscriptionState string + +const ( + // Active ... + Active SubscriptionState = "active" + // Cancelled ... + Cancelled SubscriptionState = "cancelled" + // Expired ... + Expired SubscriptionState = "expired" + // Rejected ... + Rejected SubscriptionState = "rejected" + // Submitted ... + Submitted SubscriptionState = "submitted" + // Suspended ... + Suspended SubscriptionState = "suspended" +) + +// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. +func PossibleSubscriptionStateValues() []SubscriptionState { + return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} +} + +// TemplateName enumerates the values for template name. +type TemplateName string + +const ( + // AccountClosedDeveloper ... + AccountClosedDeveloper TemplateName = "accountClosedDeveloper" + // ApplicationApprovedNotificationMessage ... + ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" + // ConfirmSignUpIdentityDefault ... + ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" + // EmailChangeIdentityDefault ... + EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" + // InviteUserNotificationMessage ... + InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" + // NewCommentNotificationMessage ... + NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" + // NewDeveloperNotificationMessage ... + NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" + // NewIssueNotificationMessage ... + NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" + // PasswordResetByAdminNotificationMessage ... + PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" + // PasswordResetIdentityDefault ... + PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" + // PurchaseDeveloperNotificationMessage ... + PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" + // QuotaLimitApproachingDeveloperNotificationMessage ... + QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" + // RejectDeveloperNotificationMessage ... + RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" + // RequestDeveloperNotificationMessage ... + RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" +) + +// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. +func PossibleTemplateNameValues() []TemplateName { + return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} +} + +// UserState enumerates the values for user state. +type UserState string + +const ( + // UserStateActive ... + UserStateActive UserState = "active" + // UserStateBlocked ... + UserStateBlocked UserState = "blocked" +) + +// PossibleUserStateValues returns an array of possible values for the UserState const type. +func PossibleUserStateValues() []UserState { + return []UserState{UserStateActive, UserStateBlocked} +} diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/group.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/group.go index ebd77658f376..cf77fb008c8e 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/group.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/group.go @@ -115,8 +115,7 @@ func (client GroupClient) CreateOrUpdatePreparer(ctx context.Context, apimBaseUR // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -124,7 +123,6 @@ func (client GroupClient) CreateOrUpdateSender(req *http.Request) (*http.Respons func (client GroupClient) CreateOrUpdateResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -206,8 +204,7 @@ func (client GroupClient) DeletePreparer(ctx context.Context, apimBaseURL string // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -215,7 +212,6 @@ func (client GroupClient) DeleteSender(req *http.Request) (*http.Response, error func (client GroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -293,8 +289,7 @@ func (client GroupClient) GetPreparer(ctx context.Context, apimBaseURL string, g // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -302,7 +297,6 @@ func (client GroupClient) GetSender(req *http.Request) (*http.Response, error) { func (client GroupClient) GetResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -361,6 +355,9 @@ func (client GroupClient) List(ctx context.Context, apimBaseURL string, filter s if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupClient", "List", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -396,8 +393,7 @@ func (client GroupClient) ListPreparer(ctx context.Context, apimBaseURL string, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -405,7 +401,6 @@ func (client GroupClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupClient) ListResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -527,8 +522,7 @@ func (client GroupClient) UpdatePreparer(ctx context.Context, apimBaseURL string // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client GroupClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -536,7 +530,6 @@ func (client GroupClient) UpdateSender(req *http.Request) (*http.Response, error func (client GroupClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/groupuser.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/groupuser.go index 555043dbd556..b3d733c2d340 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/groupuser.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/groupuser.go @@ -113,8 +113,7 @@ func (client GroupUserClient) CreatePreparer(ctx context.Context, apimBaseURL st // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. func (client GroupUserClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateResponder handles the response to the Create request. The method always @@ -122,7 +121,6 @@ func (client GroupUserClient) CreateSender(req *http.Request) (*http.Response, e func (client GroupUserClient) CreateResponder(resp *http.Response) (result UserContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,8 +205,7 @@ func (client GroupUserClient) DeletePreparer(ctx context.Context, apimBaseURL st // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client GroupUserClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -216,7 +213,6 @@ func (client GroupUserClient) DeleteSender(req *http.Request) (*http.Response, e func (client GroupUserClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -282,6 +278,9 @@ func (client GroupUserClient) List(ctx context.Context, apimBaseURL string, grou if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "List", resp, "Failure responding to request") } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -321,8 +320,7 @@ func (client GroupUserClient) ListPreparer(ctx context.Context, apimBaseURL stri // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client GroupUserClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -330,7 +328,6 @@ func (client GroupUserClient) ListSender(req *http.Request) (*http.Response, err func (client GroupUserClient) ListResponder(resp *http.Response) (result UserCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/identityprovider.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/identityprovider.go index 3a42cd8534e1..a772e64c095d 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/identityprovider.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/identityprovider.go @@ -101,8 +101,7 @@ func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client IdentityProviderClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -110,7 +109,6 @@ func (client IdentityProviderClient) CreateOrUpdateSender(req *http.Request) (*h func (client IdentityProviderClient) CreateOrUpdateResponder(resp *http.Response) (result IdentityProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -184,8 +182,7 @@ func (client IdentityProviderClient) DeletePreparer(ctx context.Context, apimBas // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client IdentityProviderClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -193,7 +190,6 @@ func (client IdentityProviderClient) DeleteSender(req *http.Request) (*http.Resp func (client IdentityProviderClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -263,8 +259,7 @@ func (client IdentityProviderClient) GetPreparer(ctx context.Context, apimBaseUR // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IdentityProviderClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -272,7 +267,6 @@ func (client IdentityProviderClient) GetSender(req *http.Request) (*http.Respons func (client IdentityProviderClient) GetResponder(resp *http.Response) (result IdentityProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -338,8 +332,7 @@ func (client IdentityProviderClient) ListPreparer(ctx context.Context, apimBaseU // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IdentityProviderClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -347,7 +340,6 @@ func (client IdentityProviderClient) ListSender(req *http.Request) (*http.Respon func (client IdentityProviderClient) ListResponder(resp *http.Response) (result IdentityProviderList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -424,8 +416,7 @@ func (client IdentityProviderClient) UpdatePreparer(ctx context.Context, apimBas // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client IdentityProviderClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -433,7 +424,6 @@ func (client IdentityProviderClient) UpdateSender(req *http.Request) (*http.Resp func (client IdentityProviderClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/logger.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/logger.go index e8e17350f2b9..40eaa7e80765 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/logger.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/logger.go @@ -109,8 +109,7 @@ func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, apimBaseU // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client LoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -118,7 +117,6 @@ func (client LoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client LoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,8 +197,7 @@ func (client LoggerClient) DeletePreparer(ctx context.Context, apimBaseURL strin // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client LoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -208,7 +205,6 @@ func (client LoggerClient) DeleteSender(req *http.Request) (*http.Response, erro func (client LoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,8 +281,7 @@ func (client LoggerClient) GetPreparer(ctx context.Context, apimBaseURL string, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client LoggerClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -294,7 +289,6 @@ func (client LoggerClient) GetSender(req *http.Request) (*http.Response, error) func (client LoggerClient) GetResponder(resp *http.Response) (result LoggerContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,6 +345,9 @@ func (client LoggerClient) List(ctx context.Context, apimBaseURL string, filter if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "List", resp, "Failure responding to request") } + if result.lc.hasNextLink() && result.lc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -386,8 +383,7 @@ func (client LoggerClient) ListPreparer(ctx context.Context, apimBaseURL string, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client LoggerClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -395,7 +391,6 @@ func (client LoggerClient) ListSender(req *http.Request) (*http.Response, error) func (client LoggerClient) ListResponder(resp *http.Response) (result LoggerCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -516,8 +511,7 @@ func (client LoggerClient) UpdatePreparer(ctx context.Context, apimBaseURL strin // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client LoggerClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -525,7 +519,6 @@ func (client LoggerClient) UpdateSender(req *http.Request) (*http.Response, erro func (client LoggerClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/models.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/models.go index 055ebd4681c7..f18281fd5885 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/models.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/models.go @@ -31,353 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/ctrl/2017-03-01/apimanagement" -// APIType enumerates the values for api type. -type APIType string - -const ( - // HTTP ... - HTTP APIType = "http" - // Soap ... - Soap APIType = "soap" -) - -// PossibleAPITypeValues returns an array of possible values for the APIType const type. -func PossibleAPITypeValues() []APIType { - return []APIType{HTTP, Soap} -} - -// AsyncOperationStatus enumerates the values for async operation status. -type AsyncOperationStatus string - -const ( - // Failed ... - Failed AsyncOperationStatus = "Failed" - // InProgress ... - InProgress AsyncOperationStatus = "InProgress" - // Started ... - Started AsyncOperationStatus = "Started" - // Succeeded ... - Succeeded AsyncOperationStatus = "Succeeded" -) - -// PossibleAsyncOperationStatusValues returns an array of possible values for the AsyncOperationStatus const type. -func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { - return []AsyncOperationStatus{Failed, InProgress, Started, Succeeded} -} - -// AuthorizationMethod enumerates the values for authorization method. -type AuthorizationMethod string - -const ( - // DELETE ... - DELETE AuthorizationMethod = "DELETE" - // GET ... - GET AuthorizationMethod = "GET" - // HEAD ... - HEAD AuthorizationMethod = "HEAD" - // OPTIONS ... - OPTIONS AuthorizationMethod = "OPTIONS" - // PATCH ... - PATCH AuthorizationMethod = "PATCH" - // POST ... - POST AuthorizationMethod = "POST" - // PUT ... - PUT AuthorizationMethod = "PUT" - // TRACE ... - TRACE AuthorizationMethod = "TRACE" -) - -// PossibleAuthorizationMethodValues returns an array of possible values for the AuthorizationMethod const type. -func PossibleAuthorizationMethodValues() []AuthorizationMethod { - return []AuthorizationMethod{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} -} - -// BackendProtocol enumerates the values for backend protocol. -type BackendProtocol string - -const ( - // BackendProtocolHTTP The Backend is a RESTful service. - BackendProtocolHTTP BackendProtocol = "http" - // BackendProtocolSoap The Backend is a SOAP service. - BackendProtocolSoap BackendProtocol = "soap" -) - -// PossibleBackendProtocolValues returns an array of possible values for the BackendProtocol const type. -func PossibleBackendProtocolValues() []BackendProtocol { - return []BackendProtocol{BackendProtocolHTTP, BackendProtocolSoap} -} - -// BearerTokenSendingMethod enumerates the values for bearer token sending method. -type BearerTokenSendingMethod string - -const ( - // AuthorizationHeader ... - AuthorizationHeader BearerTokenSendingMethod = "authorizationHeader" - // Query ... - Query BearerTokenSendingMethod = "query" -) - -// PossibleBearerTokenSendingMethodValues returns an array of possible values for the BearerTokenSendingMethod const type. -func PossibleBearerTokenSendingMethodValues() []BearerTokenSendingMethod { - return []BearerTokenSendingMethod{AuthorizationHeader, Query} -} - -// ClientAuthenticationMethod enumerates the values for client authentication method. -type ClientAuthenticationMethod string - -const ( - // Basic Basic Client Authentication method. - Basic ClientAuthenticationMethod = "Basic" - // Body Body based Authentication method. - Body ClientAuthenticationMethod = "Body" -) - -// PossibleClientAuthenticationMethodValues returns an array of possible values for the ClientAuthenticationMethod const type. -func PossibleClientAuthenticationMethodValues() []ClientAuthenticationMethod { - return []ClientAuthenticationMethod{Basic, Body} -} - -// ContentFormat enumerates the values for content format. -type ContentFormat string - -const ( - // SwaggerJSON The contents are inline and Content Type if a OpenApi 2.0 Document. - SwaggerJSON ContentFormat = "swagger-json" - // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. - SwaggerLinkJSON ContentFormat = "swagger-link-json" - // WadlLinkJSON The WADL document is hosted on a publicly accessible internet address. - WadlLinkJSON ContentFormat = "wadl-link-json" - // WadlXML The contents are inline and Content type is a WADL document. - WadlXML ContentFormat = "wadl-xml" - // Wsdl The contents are inline and the document is a WSDL/Soap document. - Wsdl ContentFormat = "wsdl" - // WsdlLink The WSDL document is hosted on a publicly accessible internet address. - WsdlLink ContentFormat = "wsdl-link" -) - -// PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. -func PossibleContentFormatValues() []ContentFormat { - return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} -} - -// GrantType enumerates the values for grant type. -type GrantType string - -const ( - // AuthorizationCode Authorization Code Grant flow as described - // https://tools.ietf.org/html/rfc6749#section-4.1. - AuthorizationCode GrantType = "authorizationCode" - // ClientCredentials Client Credentials Grant flow as described - // https://tools.ietf.org/html/rfc6749#section-4.4. - ClientCredentials GrantType = "clientCredentials" - // Implicit Implicit Code Grant flow as described https://tools.ietf.org/html/rfc6749#section-4.2. - Implicit GrantType = "implicit" - // ResourceOwnerPassword Resource Owner Password Grant flow as described - // https://tools.ietf.org/html/rfc6749#section-4.3. - ResourceOwnerPassword GrantType = "resourceOwnerPassword" -) - -// PossibleGrantTypeValues returns an array of possible values for the GrantType const type. -func PossibleGrantTypeValues() []GrantType { - return []GrantType{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} -} - -// GroupType enumerates the values for group type. -type GroupType string - -const ( - // Custom ... - Custom GroupType = "custom" - // External ... - External GroupType = "external" - // System ... - System GroupType = "system" -) - -// PossibleGroupTypeValues returns an array of possible values for the GroupType const type. -func PossibleGroupTypeValues() []GroupType { - return []GroupType{Custom, External, System} -} - -// IdentityProviderType enumerates the values for identity provider type. -type IdentityProviderType string - -const ( - // Aad Azure Active Directory as Identity provider. - Aad IdentityProviderType = "aad" - // AadB2C Azure Active Directory B2C as Identity provider. - AadB2C IdentityProviderType = "aadB2C" - // Facebook Facebook as Identity provider. - Facebook IdentityProviderType = "facebook" - // Google Google as Identity provider. - Google IdentityProviderType = "google" - // Microsoft Microsoft Live as Identity provider. - Microsoft IdentityProviderType = "microsoft" - // Twitter Twitter as Identity provider. - Twitter IdentityProviderType = "twitter" -) - -// PossibleIdentityProviderTypeValues returns an array of possible values for the IdentityProviderType const type. -func PossibleIdentityProviderTypeValues() []IdentityProviderType { - return []IdentityProviderType{Aad, AadB2C, Facebook, Google, Microsoft, Twitter} -} - -// KeyType enumerates the values for key type. -type KeyType string - -const ( - // Primary ... - Primary KeyType = "primary" - // Secondary ... - Secondary KeyType = "secondary" -) - -// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. -func PossibleKeyTypeValues() []KeyType { - return []KeyType{Primary, Secondary} -} - -// LoggerType enumerates the values for logger type. -type LoggerType string - -const ( - // AzureEventHub Azure Event Hub as log destination. - AzureEventHub LoggerType = "azureEventHub" -) - -// PossibleLoggerTypeValues returns an array of possible values for the LoggerType const type. -func PossibleLoggerTypeValues() []LoggerType { - return []LoggerType{AzureEventHub} -} - -// PolicyScopeContract enumerates the values for policy scope contract. -type PolicyScopeContract string - -const ( - // All ... - All PolicyScopeContract = "All" - // API ... - API PolicyScopeContract = "Api" - // Operation ... - Operation PolicyScopeContract = "Operation" - // Product ... - Product PolicyScopeContract = "Product" - // Tenant ... - Tenant PolicyScopeContract = "Tenant" -) - -// PossiblePolicyScopeContractValues returns an array of possible values for the PolicyScopeContract const type. -func PossiblePolicyScopeContractValues() []PolicyScopeContract { - return []PolicyScopeContract{All, API, Operation, Product, Tenant} -} - -// ProductState enumerates the values for product state. -type ProductState string - -const ( - // NotPublished ... - NotPublished ProductState = "notPublished" - // Published ... - Published ProductState = "published" -) - -// PossibleProductStateValues returns an array of possible values for the ProductState const type. -func PossibleProductStateValues() []ProductState { - return []ProductState{NotPublished, Published} -} - -// Protocol enumerates the values for protocol. -type Protocol string - -const ( - // ProtocolHTTP ... - ProtocolHTTP Protocol = "http" - // ProtocolHTTPS ... - ProtocolHTTPS Protocol = "https" -) - -// PossibleProtocolValues returns an array of possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ProtocolHTTP, ProtocolHTTPS} -} - -// SubscriptionState enumerates the values for subscription state. -type SubscriptionState string - -const ( - // Active ... - Active SubscriptionState = "active" - // Cancelled ... - Cancelled SubscriptionState = "cancelled" - // Expired ... - Expired SubscriptionState = "expired" - // Rejected ... - Rejected SubscriptionState = "rejected" - // Submitted ... - Submitted SubscriptionState = "submitted" - // Suspended ... - Suspended SubscriptionState = "suspended" -) - -// PossibleSubscriptionStateValues returns an array of possible values for the SubscriptionState const type. -func PossibleSubscriptionStateValues() []SubscriptionState { - return []SubscriptionState{Active, Cancelled, Expired, Rejected, Submitted, Suspended} -} - -// TemplateName enumerates the values for template name. -type TemplateName string - -const ( - // AccountClosedDeveloper ... - AccountClosedDeveloper TemplateName = "accountClosedDeveloper" - // ApplicationApprovedNotificationMessage ... - ApplicationApprovedNotificationMessage TemplateName = "applicationApprovedNotificationMessage" - // ConfirmSignUpIdentityDefault ... - ConfirmSignUpIdentityDefault TemplateName = "confirmSignUpIdentityDefault" - // EmailChangeIdentityDefault ... - EmailChangeIdentityDefault TemplateName = "emailChangeIdentityDefault" - // InviteUserNotificationMessage ... - InviteUserNotificationMessage TemplateName = "inviteUserNotificationMessage" - // NewCommentNotificationMessage ... - NewCommentNotificationMessage TemplateName = "newCommentNotificationMessage" - // NewDeveloperNotificationMessage ... - NewDeveloperNotificationMessage TemplateName = "newDeveloperNotificationMessage" - // NewIssueNotificationMessage ... - NewIssueNotificationMessage TemplateName = "newIssueNotificationMessage" - // PasswordResetByAdminNotificationMessage ... - PasswordResetByAdminNotificationMessage TemplateName = "passwordResetByAdminNotificationMessage" - // PasswordResetIdentityDefault ... - PasswordResetIdentityDefault TemplateName = "passwordResetIdentityDefault" - // PurchaseDeveloperNotificationMessage ... - PurchaseDeveloperNotificationMessage TemplateName = "purchaseDeveloperNotificationMessage" - // QuotaLimitApproachingDeveloperNotificationMessage ... - QuotaLimitApproachingDeveloperNotificationMessage TemplateName = "quotaLimitApproachingDeveloperNotificationMessage" - // RejectDeveloperNotificationMessage ... - RejectDeveloperNotificationMessage TemplateName = "rejectDeveloperNotificationMessage" - // RequestDeveloperNotificationMessage ... - RequestDeveloperNotificationMessage TemplateName = "requestDeveloperNotificationMessage" -) - -// PossibleTemplateNameValues returns an array of possible values for the TemplateName const type. -func PossibleTemplateNameValues() []TemplateName { - return []TemplateName{AccountClosedDeveloper, ApplicationApprovedNotificationMessage, ConfirmSignUpIdentityDefault, EmailChangeIdentityDefault, InviteUserNotificationMessage, NewCommentNotificationMessage, NewDeveloperNotificationMessage, NewIssueNotificationMessage, PasswordResetByAdminNotificationMessage, PasswordResetIdentityDefault, PurchaseDeveloperNotificationMessage, QuotaLimitApproachingDeveloperNotificationMessage, RejectDeveloperNotificationMessage, RequestDeveloperNotificationMessage} -} - -// UserState enumerates the values for user state. -type UserState string - -const ( - // UserStateActive ... - UserStateActive UserState = "active" - // UserStateBlocked ... - UserStateBlocked UserState = "blocked" -) - -// PossibleUserStateValues returns an array of possible values for the UserState const type. -func PossibleUserStateValues() []UserState { - return []UserState{UserStateActive, UserStateBlocked} -} - // AccessInformationContract tenant access information contract of the API Management service. type AccessInformationContract struct { autorest.Response `json:"-"` @@ -391,8 +44,7 @@ type AccessInformationContract struct { Enabled *bool `json:"enabled,omitempty"` } -// AccessInformationUpdateParameters tenant access information update parameters of the API Management -// service. +// AccessInformationUpdateParameters tenant access information update parameters of the API Management service. type AccessInformationUpdateParameters struct { // Enabled - Tenant access information of the API Management service. Enabled *bool `json:"enabled,omitempty"` @@ -476,10 +128,15 @@ func (ac APICollection) IsEmpty() bool { return ac.Value == nil || len(*ac.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (ac APICollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + // aPICollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { - if ac.NextLink == nil || len(to.String(ac.NextLink)) < 1 { + if !ac.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -507,11 +164,16 @@ func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ac) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.ac = next return nil } @@ -710,8 +372,8 @@ type AuthorizationServerCollection struct { NextLink *string `json:"nextLink,omitempty"` } -// AuthorizationServerCollectionIterator provides access to a complete listing of -// AuthorizationServerContract values. +// AuthorizationServerCollectionIterator provides access to a complete listing of AuthorizationServerContract +// values. type AuthorizationServerCollectionIterator struct { i int page AuthorizationServerCollectionPage @@ -779,10 +441,15 @@ func (asc AuthorizationServerCollection) IsEmpty() bool { return asc.Value == nil || len(*asc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (asc AuthorizationServerCollection) hasNextLink() bool { + return asc.NextLink != nil && len(*asc.NextLink) != 0 +} + // authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { - if asc.NextLink == nil || len(to.String(asc.NextLink)) < 1 { + if !asc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -810,11 +477,16 @@ func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.asc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.asc) + if err != nil { + return err + } + page.asc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.asc = next return nil } @@ -1090,10 +762,15 @@ func (bc BackendCollection) IsEmpty() bool { return bc.Value == nil || len(*bc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (bc BackendCollection) hasNextLink() bool { + return bc.NextLink != nil && len(*bc.NextLink) != 0 +} + // backendCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { - if bc.NextLink == nil || len(to.String(bc.NextLink)) < 1 { + if !bc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1121,11 +798,16 @@ func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.bc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.bc) + if err != nil { + return err + } + page.bc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.bc = next return nil } @@ -1377,10 +1059,15 @@ func (cc CertificateCollection) IsEmpty() bool { return cc.Value == nil || len(*cc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cc CertificateCollection) hasNextLink() bool { + return cc.NextLink != nil && len(*cc.NextLink) != 0 +} + // certificateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { - if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { + if !cc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1408,11 +1095,16 @@ func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cc) + if err != nil { + return err + } + page.cc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cc = next return nil } @@ -1564,10 +1256,15 @@ func (etc EmailTemplateCollection) IsEmpty() bool { return etc.Value == nil || len(*etc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (etc EmailTemplateCollection) hasNextLink() bool { + return etc.NextLink != nil && len(*etc.NextLink) != 0 +} + // emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { - if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { + if !etc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1595,11 +1292,16 @@ func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.etc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.etc) + if err != nil { + return err + } + page.etc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.etc = next return nil } @@ -1652,6 +1354,30 @@ type EmailTemplateContract struct { Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } +// MarshalJSON is the custom marshaler for EmailTemplateContract. +func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if etc.ID != nil { + objectMap["id"] = etc.ID + } + if etc.Subject != nil { + objectMap["subject"] = etc.Subject + } + if etc.Body != nil { + objectMap["body"] = etc.Body + } + if etc.Title != nil { + objectMap["title"] = etc.Title + } + if etc.Description != nil { + objectMap["description"] = etc.Description + } + if etc.Parameters != nil { + objectMap["parameters"] = etc.Parameters + } + return json.Marshal(objectMap) +} + // EmailTemplateContractProperties email Template Contract properties. type EmailTemplateContractProperties struct { // Subject - Subject of the Template. @@ -1668,6 +1394,27 @@ type EmailTemplateContractProperties struct { Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } +// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. +func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if etcp.Subject != nil { + objectMap["subject"] = etcp.Subject + } + if etcp.Body != nil { + objectMap["body"] = etcp.Body + } + if etcp.Title != nil { + objectMap["title"] = etcp.Title + } + if etcp.Description != nil { + objectMap["description"] = etcp.Description + } + if etcp.Parameters != nil { + objectMap["parameters"] = etcp.Parameters + } + return json.Marshal(objectMap) +} + // EmailTemplateParametersContractProperties email Template Parameter contract. type EmailTemplateParametersContractProperties struct { // Name - Template parameter name. @@ -1798,10 +1545,15 @@ func (gc GroupCollection) IsEmpty() bool { return gc.Value == nil || len(*gc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (gc GroupCollection) hasNextLink() bool { + return gc.NextLink != nil && len(*gc.NextLink) != 0 +} + // groupCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { - if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { + if !gc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1829,11 +1581,16 @@ func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.gc) + if err != nil { + return err + } + page.gc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.gc = next return nil } @@ -1884,6 +1641,27 @@ type GroupContract struct { ExternalID *string `json:"externalId,omitempty"` } +// MarshalJSON is the custom marshaler for GroupContract. +func (gc GroupContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gc.ID != nil { + objectMap["id"] = gc.ID + } + if gc.Name != nil { + objectMap["name"] = gc.Name + } + if gc.Description != nil { + objectMap["description"] = gc.Description + } + if gc.Type != "" { + objectMap["type"] = gc.Type + } + if gc.ExternalID != nil { + objectMap["externalId"] = gc.ExternalID + } + return json.Marshal(objectMap) +} + // GroupContractProperties developer group. type GroupContractProperties struct { // Name - Group name. @@ -1898,6 +1676,24 @@ type GroupContractProperties struct { ExternalID *string `json:"externalId,omitempty"` } +// MarshalJSON is the custom marshaler for GroupContractProperties. +func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.Name != nil { + objectMap["name"] = gcp.Name + } + if gcp.Description != nil { + objectMap["description"] = gcp.Description + } + if gcp.Type != "" { + objectMap["type"] = gcp.Type + } + if gcp.ExternalID != nil { + objectMap["externalId"] = gcp.ExternalID + } + return json.Marshal(objectMap) +} + // GroupCreateParameters parameters supplied to the Create Group operation. type GroupCreateParameters struct { // Name - Group name. @@ -1961,9 +1757,9 @@ type IdentityProviderContract struct { PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` } -// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, -// Twitter or Azure Active Directory which can be used to enable access to the API Management service -// developer portal for all users. +// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, Twitter +// or Azure Active Directory which can be used to enable access to the API Management service developer portal +// for all users. type IdentityProviderContractProperties struct { // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. ClientID *string `json:"clientId,omitempty"` @@ -2091,10 +1887,15 @@ func (lc LoggerCollection) IsEmpty() bool { return lc.Value == nil || len(*lc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lc LoggerCollection) hasNextLink() bool { + return lc.NextLink != nil && len(*lc.NextLink) != 0 +} + // loggerCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { - if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { + if !lc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2122,11 +1923,16 @@ func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lc) + if err != nil { + return err + } + page.lc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lc = next return nil } @@ -2196,9 +2002,9 @@ func (lc LoggerContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use -// to log API Management events. Currently the Logger entity supports logging API Management events to -// Azure Event Hubs. +// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use to +// log API Management events. Currently the Logger entity supports logging API Management events to Azure Event +// Hubs. type LoggerContractProperties struct { // LoggerType - Logger type. LoggerType *string `json:"loggerType,omitempty"` @@ -2346,10 +2152,15 @@ func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { return oicpc.Value == nil || len(*oicpc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { + return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 +} + // openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { - if oicpc.NextLink == nil || len(to.String(oicpc.NextLink)) < 1 { + if !oicpc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2377,11 +2188,16 @@ func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.oicpc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.oicpc) + if err != nil { + return err + } + page.oicpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.oicpc = next return nil } @@ -2539,10 +2355,15 @@ func (oc OperationCollection) IsEmpty() bool { return oc.Value == nil || len(*oc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (oc OperationCollection) hasNextLink() bool { + return oc.NextLink != nil && len(*oc.NextLink) != 0 +} + // operationCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { - if oc.NextLink == nil || len(to.String(oc.NextLink)) < 1 { + if !oc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2570,11 +2391,16 @@ func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.oc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.oc) + if err != nil { + return err + } + page.oc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.oc = next return nil } @@ -2684,6 +2510,30 @@ type OperationResultContract struct { ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` } +// MarshalJSON is the custom marshaler for OperationResultContract. +func (orc OperationResultContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if orc.ID != nil { + objectMap["id"] = orc.ID + } + if orc.Status != "" { + objectMap["status"] = orc.Status + } + if orc.Started != nil { + objectMap["started"] = orc.Started + } + if orc.Updated != nil { + objectMap["updated"] = orc.Updated + } + if orc.ResultInfo != nil { + objectMap["resultInfo"] = orc.ResultInfo + } + if orc.Error != nil { + objectMap["error"] = orc.Error + } + return json.Marshal(objectMap) +} + // OperationResultLogItemContract log of the entity being created, updated or deleted. type OperationResultLogItemContract struct { // ObjectType - The type of entity contract. @@ -2877,10 +2727,15 @@ func (pc ProductCollection) IsEmpty() bool { return pc.Value == nil || len(*pc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pc ProductCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + // productCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { - if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { + if !pc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2908,11 +2763,16 @@ func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pc = next return nil } @@ -2959,9 +2819,9 @@ type ProductContract struct { Terms *string `json:"terms,omitempty"` // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' State ProductState `json:"state,omitempty"` @@ -2977,9 +2837,9 @@ type ProductContractProperties struct { Terms *string `json:"terms,omitempty"` // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' State ProductState `json:"state,omitempty"` @@ -2993,9 +2853,9 @@ type ProductEntityBaseParameters struct { Terms *string `json:"terms,omitempty"` // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' State ProductState `json:"state,omitempty"` @@ -3011,9 +2871,9 @@ type ProductUpdateParameters struct { Terms *string `json:"terms,omitempty"` // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' State ProductState `json:"state,omitempty"` @@ -3098,10 +2958,15 @@ func (pc PropertyCollection) IsEmpty() bool { return pc.Value == nil || len(*pc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (pc PropertyCollection) hasNextLink() bool { + return pc.NextLink != nil && len(*pc.NextLink) != 0 +} + // propertyCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { - if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { + if !pc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3129,11 +2994,16 @@ func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.pc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.pc) + if err != nil { + return err + } + page.pc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.pc = next return nil } @@ -3297,6 +3167,18 @@ type RegionContract struct { IsDeleted *bool `json:"isDeleted,omitempty"` } +// MarshalJSON is the custom marshaler for RegionContract. +func (rc RegionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rc.IsMasterRegion != nil { + objectMap["isMasterRegion"] = rc.IsMasterRegion + } + if rc.IsDeleted != nil { + objectMap["isDeleted"] = rc.IsDeleted + } + return json.Marshal(objectMap) +} + // RegionListResult lists Regions operation response details. type RegionListResult struct { autorest.Response `json:"-"` @@ -3393,10 +3275,15 @@ func (rc ReportCollection) IsEmpty() bool { return rc.Value == nil || len(*rc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rc ReportCollection) hasNextLink() bool { + return rc.NextLink != nil && len(*rc.NextLink) != 0 +} + // reportCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { - if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 { + if !rc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3424,11 +3311,16 @@ func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rc) + if err != nil { + return err + } + page.rc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rc = next return nil } @@ -3518,6 +3410,84 @@ type ReportRecordContract struct { ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` } +// MarshalJSON is the custom marshaler for ReportRecordContract. +func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rrc.Name != nil { + objectMap["name"] = rrc.Name + } + if rrc.Timestamp != nil { + objectMap["timestamp"] = rrc.Timestamp + } + if rrc.Interval != nil { + objectMap["interval"] = rrc.Interval + } + if rrc.Country != nil { + objectMap["country"] = rrc.Country + } + if rrc.Region != nil { + objectMap["region"] = rrc.Region + } + if rrc.Zip != nil { + objectMap["zip"] = rrc.Zip + } + if rrc.APIID != nil { + objectMap["apiId"] = rrc.APIID + } + if rrc.OperationID != nil { + objectMap["operationId"] = rrc.OperationID + } + if rrc.APIRegion != nil { + objectMap["apiRegion"] = rrc.APIRegion + } + if rrc.SubscriptionID != nil { + objectMap["subscriptionId"] = rrc.SubscriptionID + } + if rrc.CallCountSuccess != nil { + objectMap["callCountSuccess"] = rrc.CallCountSuccess + } + if rrc.CallCountBlocked != nil { + objectMap["callCountBlocked"] = rrc.CallCountBlocked + } + if rrc.CallCountFailed != nil { + objectMap["callCountFailed"] = rrc.CallCountFailed + } + if rrc.CallCountOther != nil { + objectMap["callCountOther"] = rrc.CallCountOther + } + if rrc.CallCountTotal != nil { + objectMap["callCountTotal"] = rrc.CallCountTotal + } + if rrc.Bandwidth != nil { + objectMap["bandwidth"] = rrc.Bandwidth + } + if rrc.CacheHitCount != nil { + objectMap["cacheHitCount"] = rrc.CacheHitCount + } + if rrc.CacheMissCount != nil { + objectMap["cacheMissCount"] = rrc.CacheMissCount + } + if rrc.APITimeAvg != nil { + objectMap["apiTimeAvg"] = rrc.APITimeAvg + } + if rrc.APITimeMin != nil { + objectMap["apiTimeMin"] = rrc.APITimeMin + } + if rrc.APITimeMax != nil { + objectMap["apiTimeMax"] = rrc.APITimeMax + } + if rrc.ServiceTimeAvg != nil { + objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg + } + if rrc.ServiceTimeMin != nil { + objectMap["serviceTimeMin"] = rrc.ServiceTimeMin + } + if rrc.ServiceTimeMax != nil { + objectMap["serviceTimeMax"] = rrc.ServiceTimeMax + } + return json.Marshal(objectMap) +} + // RepresentationContract operation request/response representation details. type RepresentationContract struct { // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. @@ -3593,6 +3563,60 @@ type RequestReportRecordContract struct { RequestSize *int32 `json:"requestSize,omitempty"` } +// MarshalJSON is the custom marshaler for RequestReportRecordContract. +func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rrrc.APIID != nil { + objectMap["apiId"] = rrrc.APIID + } + if rrrc.OperationID != nil { + objectMap["operationId"] = rrrc.OperationID + } + if rrrc.Method != nil { + objectMap["method"] = rrrc.Method + } + if rrrc.URL != nil { + objectMap["url"] = rrrc.URL + } + if rrrc.IPAddress != nil { + objectMap["ipAddress"] = rrrc.IPAddress + } + if rrrc.BackendResponseCode != nil { + objectMap["backendResponseCode"] = rrrc.BackendResponseCode + } + if rrrc.ResponseCode != nil { + objectMap["responseCode"] = rrrc.ResponseCode + } + if rrrc.ResponseSize != nil { + objectMap["responseSize"] = rrrc.ResponseSize + } + if rrrc.Timestamp != nil { + objectMap["timestamp"] = rrrc.Timestamp + } + if rrrc.Cache != nil { + objectMap["cache"] = rrrc.Cache + } + if rrrc.APITime != nil { + objectMap["apiTime"] = rrrc.APITime + } + if rrrc.ServiceTime != nil { + objectMap["serviceTime"] = rrrc.ServiceTime + } + if rrrc.APIRegion != nil { + objectMap["apiRegion"] = rrrc.APIRegion + } + if rrrc.SubscriptionID != nil { + objectMap["subscriptionId"] = rrrc.SubscriptionID + } + if rrrc.RequestID != nil { + objectMap["requestId"] = rrrc.RequestID + } + if rrrc.RequestSize != nil { + objectMap["requestSize"] = rrrc.RequestSize + } + return json.Marshal(objectMap) +} + // ResponseContract operation response details. type ResponseContract struct { // StatusCode - Operation response HTTP status code. @@ -3692,10 +3716,15 @@ func (sc SchemaCollection) IsEmpty() bool { return sc.Value == nil || len(*sc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sc SchemaCollection) hasNextLink() bool { + return sc.NextLink != nil && len(*sc.NextLink) != 0 +} + // schemaCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { - if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { + if !sc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3723,11 +3752,16 @@ func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sc) + if err != nil { + return err + } + page.sc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sc = next return nil } @@ -3910,10 +3944,15 @@ func (sc SubscriptionCollection) IsEmpty() bool { return sc.Value == nil || len(*sc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sc SubscriptionCollection) hasNextLink() bool { + return sc.NextLink != nil && len(*sc.NextLink) != 0 +} + // subscriptionCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { - if sc.NextLink == nil || len(to.String(sc.NextLink)) < 1 { + if !sc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3941,11 +3980,16 @@ func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sc) + if err != nil { + return err + } + page.sc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sc = next return nil } @@ -4010,6 +4054,48 @@ type SubscriptionContract struct { StateComment *string `json:"stateComment,omitempty"` } +// MarshalJSON is the custom marshaler for SubscriptionContract. +func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.ID != nil { + objectMap["id"] = sc.ID + } + if sc.UserID != nil { + objectMap["userId"] = sc.UserID + } + if sc.ProductID != nil { + objectMap["productId"] = sc.ProductID + } + if sc.Name != nil { + objectMap["name"] = sc.Name + } + if sc.State != "" { + objectMap["state"] = sc.State + } + if sc.StartDate != nil { + objectMap["startDate"] = sc.StartDate + } + if sc.ExpirationDate != nil { + objectMap["expirationDate"] = sc.ExpirationDate + } + if sc.EndDate != nil { + objectMap["endDate"] = sc.EndDate + } + if sc.NotificationDate != nil { + objectMap["notificationDate"] = sc.NotificationDate + } + if sc.PrimaryKey != nil { + objectMap["primaryKey"] = sc.PrimaryKey + } + if sc.SecondaryKey != nil { + objectMap["secondaryKey"] = sc.SecondaryKey + } + if sc.StateComment != nil { + objectMap["stateComment"] = sc.StateComment + } + return json.Marshal(objectMap) +} + // SubscriptionContractProperties subscription details. type SubscriptionContractProperties struct { // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. @@ -4038,6 +4124,45 @@ type SubscriptionContractProperties struct { StateComment *string `json:"stateComment,omitempty"` } +// MarshalJSON is the custom marshaler for SubscriptionContractProperties. +func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.UserID != nil { + objectMap["userId"] = scp.UserID + } + if scp.ProductID != nil { + objectMap["productId"] = scp.ProductID + } + if scp.Name != nil { + objectMap["name"] = scp.Name + } + if scp.State != "" { + objectMap["state"] = scp.State + } + if scp.StartDate != nil { + objectMap["startDate"] = scp.StartDate + } + if scp.ExpirationDate != nil { + objectMap["expirationDate"] = scp.ExpirationDate + } + if scp.EndDate != nil { + objectMap["endDate"] = scp.EndDate + } + if scp.NotificationDate != nil { + objectMap["notificationDate"] = scp.NotificationDate + } + if scp.PrimaryKey != nil { + objectMap["primaryKey"] = scp.PrimaryKey + } + if scp.SecondaryKey != nil { + objectMap["secondaryKey"] = scp.SecondaryKey + } + if scp.StateComment != nil { + objectMap["stateComment"] = scp.StateComment + } + return json.Marshal(objectMap) +} + // SubscriptionCreateParameters parameters supplied to the Create subscription operation. type SubscriptionCreateParameters struct { // UserID - User (user id path) for whom subscription is being created in form /users/{uid} @@ -4088,8 +4213,8 @@ type SubscriptionUpdateParameters struct { StateComment *string `json:"stateComment,omitempty"` } -// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type TenantConfigurationDeployFuture struct { azure.Future } @@ -4165,8 +4290,8 @@ type TenantConfigurationSyncStateContract struct { ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` } -// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type TenantConfigurationValidateFuture struct { azure.Future } @@ -4291,10 +4416,15 @@ func (uc UserCollection) IsEmpty() bool { return uc.Value == nil || len(*uc.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (uc UserCollection) hasNextLink() bool { + return uc.NextLink != nil && len(*uc.NextLink) != 0 +} + // userCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { - if uc.NextLink == nil || len(to.String(uc.NextLink)) < 1 { + if !uc.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -4322,11 +4452,16 @@ func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.uc) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.uc) + if err != nil { + return err + } + page.uc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.uc = next return nil } @@ -4383,6 +4518,33 @@ type UserContract struct { Identities *[]UserIdentityContract `json:"identities,omitempty"` } +// MarshalJSON is the custom marshaler for UserContract. +func (uc UserContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uc.ID != nil { + objectMap["id"] = uc.ID + } + if uc.FirstName != nil { + objectMap["firstName"] = uc.FirstName + } + if uc.LastName != nil { + objectMap["lastName"] = uc.LastName + } + if uc.Email != nil { + objectMap["email"] = uc.Email + } + if uc.RegistrationDate != nil { + objectMap["registrationDate"] = uc.RegistrationDate + } + if uc.State != "" { + objectMap["state"] = uc.State + } + if uc.Note != nil { + objectMap["note"] = uc.Note + } + return json.Marshal(objectMap) +} + // UserContractProperties user profile. type UserContractProperties struct { // FirstName - First name. @@ -4403,6 +4565,30 @@ type UserContractProperties struct { Identities *[]UserIdentityContract `json:"identities,omitempty"` } +// MarshalJSON is the custom marshaler for UserContractProperties. +func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucp.FirstName != nil { + objectMap["firstName"] = ucp.FirstName + } + if ucp.LastName != nil { + objectMap["lastName"] = ucp.LastName + } + if ucp.Email != nil { + objectMap["email"] = ucp.Email + } + if ucp.RegistrationDate != nil { + objectMap["registrationDate"] = ucp.RegistrationDate + } + if ucp.State != "" { + objectMap["state"] = ucp.State + } + if ucp.Note != nil { + objectMap["note"] = ucp.Note + } + return json.Marshal(objectMap) +} + // UserCreateParameters parameters supplied to the Create User operation. type UserCreateParameters struct { // Email - Email address. Must not be empty and must be unique within the service instance. @@ -4421,6 +4607,30 @@ type UserCreateParameters struct { Identities *[]UserIdentityContract `json:"identities,omitempty"` } +// MarshalJSON is the custom marshaler for UserCreateParameters. +func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucp.Email != nil { + objectMap["email"] = ucp.Email + } + if ucp.FirstName != nil { + objectMap["firstName"] = ucp.FirstName + } + if ucp.LastName != nil { + objectMap["lastName"] = ucp.LastName + } + if ucp.Password != nil { + objectMap["password"] = ucp.Password + } + if ucp.State != "" { + objectMap["state"] = ucp.State + } + if ucp.Note != nil { + objectMap["note"] = ucp.Note + } + return json.Marshal(objectMap) +} + // UserEntityBaseParameters user Entity Base Parameters set. type UserEntityBaseParameters struct { // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' @@ -4431,6 +4641,18 @@ type UserEntityBaseParameters struct { Identities *[]UserIdentityContract `json:"identities,omitempty"` } +// MarshalJSON is the custom marshaler for UserEntityBaseParameters. +func (uebp UserEntityBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uebp.State != "" { + objectMap["state"] = uebp.State + } + if uebp.Note != nil { + objectMap["note"] = uebp.Note + } + return json.Marshal(objectMap) +} + // UserIdentityCollection list of Users Identity list representation. type UserIdentityCollection struct { autorest.Response `json:"-"` @@ -4483,6 +4705,30 @@ type UserUpdateParameters struct { Identities *[]UserIdentityContract `json:"identities,omitempty"` } +// MarshalJSON is the custom marshaler for UserUpdateParameters. +func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uup.Email != nil { + objectMap["email"] = uup.Email + } + if uup.Password != nil { + objectMap["password"] = uup.Password + } + if uup.FirstName != nil { + objectMap["firstName"] = uup.FirstName + } + if uup.LastName != nil { + objectMap["lastName"] = uup.LastName + } + if uup.State != "" { + objectMap["state"] = uup.State + } + if uup.Note != nil { + objectMap["note"] = uup.Note + } + return json.Marshal(objectMap) +} + // X509CertificateName properties of server X509Names. type X509CertificateName struct { // Name - Common Name of the Certificate. diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/openidconnectprovider.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/openidconnectprovider.go index 8ba9912bb214..01ee561e4d84 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/openidconnectprovider.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/openidconnectprovider.go @@ -109,8 +109,7 @@ func (client OpenIDConnectProviderClient) CreateOrUpdatePreparer(ctx context.Con // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProviderClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -118,7 +117,6 @@ func (client OpenIDConnectProviderClient) CreateOrUpdateSender(req *http.Request func (client OpenIDConnectProviderClient) CreateOrUpdateResponder(resp *http.Response) (result OpenidConnectProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,8 +197,7 @@ func (client OpenIDConnectProviderClient) DeletePreparer(ctx context.Context, ap // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProviderClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -208,7 +205,6 @@ func (client OpenIDConnectProviderClient) DeleteSender(req *http.Request) (*http func (client OpenIDConnectProviderClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,8 +281,7 @@ func (client OpenIDConnectProviderClient) GetPreparer(ctx context.Context, apimB // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProviderClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -294,7 +289,6 @@ func (client OpenIDConnectProviderClient) GetSender(req *http.Request) (*http.Re func (client OpenIDConnectProviderClient) GetResponder(resp *http.Response) (result OpenidConnectProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,6 +345,9 @@ func (client OpenIDConnectProviderClient) List(ctx context.Context, apimBaseURL if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "List", resp, "Failure responding to request") } + if result.oicpc.hasNextLink() && result.oicpc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -386,8 +383,7 @@ func (client OpenIDConnectProviderClient) ListPreparer(ctx context.Context, apim // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProviderClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -395,7 +391,6 @@ func (client OpenIDConnectProviderClient) ListSender(req *http.Request) (*http.R func (client OpenIDConnectProviderClient) ListResponder(resp *http.Response) (result OpenIDConnectProviderCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -516,8 +511,7 @@ func (client OpenIDConnectProviderClient) UpdatePreparer(ctx context.Context, ap // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProviderClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -525,7 +519,6 @@ func (client OpenIDConnectProviderClient) UpdateSender(req *http.Request) (*http func (client OpenIDConnectProviderClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policy.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policy.go index 13601f222ec6..38b468afd9d2 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policy.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policy.go @@ -107,8 +107,7 @@ func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, apimBaseU // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client PolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -116,7 +115,6 @@ func (client PolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client PolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,8 +187,7 @@ func (client PolicyClient) DeletePreparer(ctx context.Context, apimBaseURL strin // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client PolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -198,7 +195,6 @@ func (client PolicyClient) DeleteSender(req *http.Request) (*http.Response, erro func (client PolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -267,8 +263,7 @@ func (client PolicyClient) GetPreparer(ctx context.Context, apimBaseURL string) // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client PolicyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -276,7 +271,6 @@ func (client PolicyClient) GetSender(req *http.Request) (*http.Response, error) func (client PolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -346,8 +340,7 @@ func (client PolicyClient) ListPreparer(ctx context.Context, apimBaseURL string, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client PolicyClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -355,7 +348,6 @@ func (client PolicyClient) ListSender(req *http.Request) (*http.Response, error) func (client PolicyClient) ListResponder(resp *http.Response) (result PolicyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policysnippets.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policysnippets.go index fdf61bfa2fb5..19c41a5450f5 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policysnippets.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/policysnippets.go @@ -97,8 +97,7 @@ func (client PolicySnippetsClient) ListPreparer(ctx context.Context, apimBaseURL // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client PolicySnippetsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -106,7 +105,6 @@ func (client PolicySnippetsClient) ListSender(req *http.Request) (*http.Response func (client PolicySnippetsClient) ListResponder(resp *http.Response) (result PolicySnippetsCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/product.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/product.go index fdcf17bef27c..ddf743b60015 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/product.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/product.go @@ -110,8 +110,7 @@ func (client ProductClient) CreateOrUpdatePreparer(ctx context.Context, apimBase // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ProductClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -119,7 +118,6 @@ func (client ProductClient) CreateOrUpdateSender(req *http.Request) (*http.Respo func (client ProductClient) CreateOrUpdateResponder(resp *http.Response) (result ProductContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,8 +203,7 @@ func (client ProductClient) DeletePreparer(ctx context.Context, apimBaseURL stri // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ProductClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -214,7 +211,6 @@ func (client ProductClient) DeleteSender(req *http.Request) (*http.Response, err func (client ProductClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -292,8 +288,7 @@ func (client ProductClient) GetPreparer(ctx context.Context, apimBaseURL string, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ProductClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -301,7 +296,6 @@ func (client ProductClient) GetSender(req *http.Request) (*http.Response, error) func (client ProductClient) GetResponder(resp *http.Response) (result ProductContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,6 +357,9 @@ func (client ProductClient) List(ctx context.Context, apimBaseURL string, filter if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "List", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -401,8 +398,7 @@ func (client ProductClient) ListPreparer(ctx context.Context, apimBaseURL string // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ProductClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -410,7 +406,6 @@ func (client ProductClient) ListSender(req *http.Request) (*http.Response, error func (client ProductClient) ListResponder(resp *http.Response) (result ProductCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -532,8 +527,7 @@ func (client ProductClient) UpdatePreparer(ctx context.Context, apimBaseURL stri // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ProductClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -541,7 +535,6 @@ func (client ProductClient) UpdateSender(req *http.Request) (*http.Response, err func (client ProductClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productapi.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productapi.go index 73855faa19b8..76600c1f1adf 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productapi.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productapi.go @@ -113,8 +113,7 @@ func (client ProductAPIClient) CreateOrUpdatePreparer(ctx context.Context, apimB // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ProductAPIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -122,7 +121,6 @@ func (client ProductAPIClient) CreateOrUpdateSender(req *http.Request) (*http.Re func (client ProductAPIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,8 +205,7 @@ func (client ProductAPIClient) DeletePreparer(ctx context.Context, apimBaseURL s // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ProductAPIClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -216,7 +213,6 @@ func (client ProductAPIClient) DeleteSender(req *http.Request) (*http.Response, func (client ProductAPIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -280,6 +276,9 @@ func (client ProductAPIClient) ListByProduct(ctx context.Context, apimBaseURL st if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductAPIClient", "ListByProduct", resp, "Failure responding to request") } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -319,8 +318,7 @@ func (client ProductAPIClient) ListByProductPreparer(ctx context.Context, apimBa // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductAPIClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -328,7 +326,6 @@ func (client ProductAPIClient) ListByProductSender(req *http.Request) (*http.Res func (client ProductAPIClient) ListByProductResponder(resp *http.Response) (result APICollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productgroup.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productgroup.go index 3b007e7a9c50..d5837f362caf 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productgroup.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productgroup.go @@ -113,8 +113,7 @@ func (client ProductGroupClient) CreateOrUpdatePreparer(ctx context.Context, api // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -122,7 +121,6 @@ func (client ProductGroupClient) CreateOrUpdateSender(req *http.Request) (*http. func (client ProductGroupClient) CreateOrUpdateResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -207,8 +205,7 @@ func (client ProductGroupClient) DeletePreparer(ctx context.Context, apimBaseURL // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -216,7 +213,6 @@ func (client ProductGroupClient) DeleteSender(req *http.Request) (*http.Response func (client ProductGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -279,6 +275,9 @@ func (client ProductGroupClient) ListByProduct(ctx context.Context, apimBaseURL if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupClient", "ListByProduct", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -318,8 +317,7 @@ func (client ProductGroupClient) ListByProductPreparer(ctx context.Context, apim // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -327,7 +325,6 @@ func (client ProductGroupClient) ListByProductSender(req *http.Request) (*http.R func (client ProductGroupClient) ListByProductResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productpolicy.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productpolicy.go index f5117338d477..8548f413c993 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productpolicy.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productpolicy.go @@ -113,8 +113,7 @@ func (client ProductPolicyClient) CreateOrUpdatePreparer(ctx context.Context, ap // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ProductPolicyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -122,7 +121,6 @@ func (client ProductPolicyClient) CreateOrUpdateSender(req *http.Request) (*http func (client ProductPolicyClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,8 +203,7 @@ func (client ProductPolicyClient) DeletePreparer(ctx context.Context, apimBaseUR // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ProductPolicyClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -214,7 +211,6 @@ func (client ProductPolicyClient) DeleteSender(req *http.Request) (*http.Respons func (client ProductPolicyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -293,8 +289,7 @@ func (client ProductPolicyClient) GetPreparer(ctx context.Context, apimBaseURL s // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ProductPolicyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -302,7 +297,6 @@ func (client ProductPolicyClient) GetSender(req *http.Request) (*http.Response, func (client ProductPolicyClient) GetResponder(resp *http.Response) (result PolicyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -381,8 +375,7 @@ func (client ProductPolicyClient) ListByProductPreparer(ctx context.Context, api // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductPolicyClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -390,7 +383,6 @@ func (client ProductPolicyClient) ListByProductSender(req *http.Request) (*http. func (client ProductPolicyClient) ListByProductResponder(resp *http.Response) (result PolicyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productsubscriptions.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productsubscriptions.go index 7ac1c97b8426..c3853af7c8b7 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productsubscriptions.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/productsubscriptions.go @@ -94,6 +94,9 @@ func (client ProductSubscriptionsClient) List(ctx context.Context, apimBaseURL s if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "List", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -133,8 +136,7 @@ func (client ProductSubscriptionsClient) ListPreparer(ctx context.Context, apimB // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ProductSubscriptionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -142,7 +144,6 @@ func (client ProductSubscriptionsClient) ListSender(req *http.Request) (*http.Re func (client ProductSubscriptionsClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/property.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/property.go index 4f2f351eb6f7..dc0cb945581d 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/property.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/property.go @@ -109,8 +109,7 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, apimBas // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -118,7 +117,6 @@ func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (result PropertyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -199,8 +197,7 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, apimBaseURL str // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -208,7 +205,6 @@ func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, er func (client PropertyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -285,8 +281,7 @@ func (client PropertyClient) GetPreparer(ctx context.Context, apimBaseURL string // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -294,7 +289,6 @@ func (client PropertyClient) GetSender(req *http.Request) (*http.Response, error func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -351,6 +345,9 @@ func (client PropertyClient) List(ctx context.Context, apimBaseURL string, filte if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "List", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -386,8 +383,7 @@ func (client PropertyClient) ListPreparer(ctx context.Context, apimBaseURL strin // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -395,7 +391,6 @@ func (client PropertyClient) ListSender(req *http.Request) (*http.Response, erro func (client PropertyClient) ListResponder(resp *http.Response) (result PropertyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -516,8 +511,7 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, apimBaseURL str // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -525,7 +519,6 @@ func (client PropertyClient) UpdateSender(req *http.Request) (*http.Response, er func (client PropertyClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabycounterkeys.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabycounterkeys.go index dd7107e311f2..284a08e63fe5 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabycounterkeys.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabycounterkeys.go @@ -102,8 +102,7 @@ func (client QuotaByCounterKeysClient) ListPreparer(ctx context.Context, apimBas // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client QuotaByCounterKeysClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -111,7 +110,6 @@ func (client QuotaByCounterKeysClient) ListSender(req *http.Request) (*http.Resp func (client QuotaByCounterKeysClient) ListResponder(resp *http.Response) (result QuotaCounterCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,8 +187,7 @@ func (client QuotaByCounterKeysClient) UpdatePreparer(ctx context.Context, apimB // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client QuotaByCounterKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -198,7 +195,6 @@ func (client QuotaByCounterKeysClient) UpdateSender(req *http.Request) (*http.Re func (client QuotaByCounterKeysClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabyperiodkeys.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabyperiodkeys.go index 92720c1c8e30..a9cf54a223a9 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabyperiodkeys.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/quotabyperiodkeys.go @@ -104,8 +104,7 @@ func (client QuotaByPeriodKeysClient) GetPreparer(ctx context.Context, apimBaseU // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client QuotaByPeriodKeysClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -113,7 +112,6 @@ func (client QuotaByPeriodKeysClient) GetSender(req *http.Request) (*http.Respon func (client QuotaByPeriodKeysClient) GetResponder(resp *http.Response) (result QuotaCounterContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -192,8 +190,7 @@ func (client QuotaByPeriodKeysClient) UpdatePreparer(ctx context.Context, apimBa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client QuotaByPeriodKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -201,7 +198,6 @@ func (client QuotaByPeriodKeysClient) UpdateSender(req *http.Request) (*http.Res func (client QuotaByPeriodKeysClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/regions.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/regions.go index 3a015fc27e94..a22228cf4e16 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/regions.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/regions.go @@ -93,8 +93,7 @@ func (client RegionsClient) ListPreparer(ctx context.Context, apimBaseURL string // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client RegionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -102,7 +101,6 @@ func (client RegionsClient) ListSender(req *http.Request) (*http.Response, error func (client RegionsClient) ListResponder(resp *http.Response) (result RegionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/reports.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/reports.go index 15f87a4240af..69a21cbbdf08 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/reports.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/reports.go @@ -82,6 +82,9 @@ func (client ReportsClient) ListByAPI(ctx context.Context, apimBaseURL string, f if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -115,8 +118,7 @@ func (client ReportsClient) ListByAPIPreparer(ctx context.Context, apimBaseURL s // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -124,7 +126,6 @@ func (client ReportsClient) ListByAPISender(req *http.Request) (*http.Response, func (client ReportsClient) ListByAPIResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -215,6 +216,9 @@ func (client ReportsClient) ListByGeo(ctx context.Context, apimBaseURL string, f if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByGeo", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -250,8 +254,7 @@ func (client ReportsClient) ListByGeoPreparer(ctx context.Context, apimBaseURL s // ListByGeoSender sends the ListByGeo request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByGeoSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByGeoResponder handles the response to the ListByGeo request. The method always @@ -259,7 +262,6 @@ func (client ReportsClient) ListByGeoSender(req *http.Request) (*http.Response, func (client ReportsClient) ListByGeoResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -350,6 +352,9 @@ func (client ReportsClient) ListByOperation(ctx context.Context, apimBaseURL str if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -383,8 +388,7 @@ func (client ReportsClient) ListByOperationPreparer(ctx context.Context, apimBas // ListByOperationSender sends the ListByOperation request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByOperationSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByOperationResponder handles the response to the ListByOperation request. The method always @@ -392,7 +396,6 @@ func (client ReportsClient) ListByOperationSender(req *http.Request) (*http.Resp func (client ReportsClient) ListByOperationResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -483,6 +486,9 @@ func (client ReportsClient) ListByProduct(ctx context.Context, apimBaseURL strin if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -516,8 +522,7 @@ func (client ReportsClient) ListByProductPreparer(ctx context.Context, apimBaseU // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -525,7 +530,6 @@ func (client ReportsClient) ListByProductSender(req *http.Request) (*http.Respon func (client ReportsClient) ListByProductResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -648,8 +652,7 @@ func (client ReportsClient) ListByRequestPreparer(ctx context.Context, apimBaseU // ListByRequestSender sends the ListByRequest request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByRequestSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByRequestResponder handles the response to the ListByRequest request. The method always @@ -657,7 +660,6 @@ func (client ReportsClient) ListByRequestSender(req *http.Request) (*http.Respon func (client ReportsClient) ListByRequestResponder(resp *http.Response) (result RequestReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -711,6 +713,9 @@ func (client ReportsClient) ListBySubscription(ctx context.Context, apimBaseURL if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -746,8 +751,7 @@ func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, apim // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always @@ -755,7 +759,6 @@ func (client ReportsClient) ListBySubscriptionSender(req *http.Request) (*http.R func (client ReportsClient) ListBySubscriptionResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -849,6 +852,9 @@ func (client ReportsClient) ListByTime(ctx context.Context, apimBaseURL string, if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -885,8 +891,7 @@ func (client ReportsClient) ListByTimePreparer(ctx context.Context, apimBaseURL // ListByTimeSender sends the ListByTime request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByTimeSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByTimeResponder handles the response to the ListByTime request. The method always @@ -894,7 +899,6 @@ func (client ReportsClient) ListByTimeSender(req *http.Request) (*http.Response, func (client ReportsClient) ListByTimeResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -985,6 +989,9 @@ func (client ReportsClient) ListByUser(ctx context.Context, apimBaseURL string, if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -1018,8 +1025,7 @@ func (client ReportsClient) ListByUserPreparer(ctx context.Context, apimBaseURL // ListByUserSender sends the ListByUser request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByUserSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListByUserResponder handles the response to the ListByUser request. The method always @@ -1027,7 +1033,6 @@ func (client ReportsClient) ListByUserSender(req *http.Request) (*http.Response, func (client ReportsClient) ListByUserResponder(resp *http.Response) (result ReportCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signinsettings.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signinsettings.go index de9212c39e27..fc645c691875 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signinsettings.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signinsettings.go @@ -96,8 +96,7 @@ func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, a // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client SignInSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -105,7 +104,6 @@ func (client SignInSettingsClient) CreateOrUpdateSender(req *http.Request) (*htt func (client SignInSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalSigninSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -171,8 +169,7 @@ func (client SignInSettingsClient) GetPreparer(ctx context.Context, apimBaseURL // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SignInSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -180,7 +177,6 @@ func (client SignInSettingsClient) GetSender(req *http.Request) (*http.Response, func (client SignInSettingsClient) GetResponder(resp *http.Response) (result PortalSigninSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -252,8 +248,7 @@ func (client SignInSettingsClient) UpdatePreparer(ctx context.Context, apimBaseU // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client SignInSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -261,7 +256,6 @@ func (client SignInSettingsClient) UpdateSender(req *http.Request) (*http.Respon func (client SignInSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signupsettings.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signupsettings.go index 621722599af4..8dc12c9a76fe 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signupsettings.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/signupsettings.go @@ -96,8 +96,7 @@ func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, a // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client SignUpSettingsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -105,7 +104,6 @@ func (client SignUpSettingsClient) CreateOrUpdateSender(req *http.Request) (*htt func (client SignUpSettingsClient) CreateOrUpdateResponder(resp *http.Response) (result PortalSignupSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -171,8 +169,7 @@ func (client SignUpSettingsClient) GetPreparer(ctx context.Context, apimBaseURL // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SignUpSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -180,7 +177,6 @@ func (client SignUpSettingsClient) GetSender(req *http.Request) (*http.Response, func (client SignUpSettingsClient) GetResponder(resp *http.Response) (result PortalSignupSettings, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -252,8 +248,7 @@ func (client SignUpSettingsClient) UpdatePreparer(ctx context.Context, apimBaseU // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client SignUpSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -261,7 +256,6 @@ func (client SignUpSettingsClient) UpdateSender(req *http.Request) (*http.Respon func (client SignUpSettingsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/subscription.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/subscription.go index 5b07d98f4eb4..5337b1aa582a 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/subscription.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/subscription.go @@ -131,8 +131,7 @@ func (client SubscriptionClient) CreateOrUpdatePreparer(ctx context.Context, api // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -140,7 +139,6 @@ func (client SubscriptionClient) CreateOrUpdateSender(req *http.Request) (*http. func (client SubscriptionClient) CreateOrUpdateResponder(resp *http.Response) (result SubscriptionContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -222,8 +220,7 @@ func (client SubscriptionClient) DeletePreparer(ctx context.Context, apimBaseURL // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -231,7 +228,6 @@ func (client SubscriptionClient) DeleteSender(req *http.Request) (*http.Response func (client SubscriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -309,8 +305,7 @@ func (client SubscriptionClient) GetPreparer(ctx context.Context, apimBaseURL st // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -318,7 +313,6 @@ func (client SubscriptionClient) GetSender(req *http.Request) (*http.Response, e func (client SubscriptionClient) GetResponder(resp *http.Response) (result SubscriptionContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -379,6 +373,9 @@ func (client SubscriptionClient) List(ctx context.Context, apimBaseURL string, f if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "List", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -414,8 +411,7 @@ func (client SubscriptionClient) ListPreparer(ctx context.Context, apimBaseURL s // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -423,7 +419,6 @@ func (client SubscriptionClient) ListSender(req *http.Request) (*http.Response, func (client SubscriptionClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -539,8 +534,7 @@ func (client SubscriptionClient) RegeneratePrimaryKeyPreparer(ctx context.Contex // RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -548,7 +542,6 @@ func (client SubscriptionClient) RegeneratePrimaryKeySender(req *http.Request) ( func (client SubscriptionClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -626,8 +619,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyPreparer(ctx context.Cont // RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -635,7 +627,6 @@ func (client SubscriptionClient) RegenerateSecondaryKeySender(req *http.Request) func (client SubscriptionClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -725,8 +716,7 @@ func (client SubscriptionClient) UpdatePreparer(ctx context.Context, apimBaseURL // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -734,7 +724,6 @@ func (client SubscriptionClient) UpdateSender(req *http.Request) (*http.Response func (client SubscriptionClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccess.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccess.go index 658fae8a4d58..2a2a6e6c2fc9 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccess.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccess.go @@ -97,8 +97,7 @@ func (client TenantAccessClient) GetPreparer(ctx context.Context, apimBaseURL st // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -106,7 +105,6 @@ func (client TenantAccessClient) GetSender(req *http.Request) (*http.Response, e func (client TenantAccessClient) GetResponder(resp *http.Response) (result AccessInformationContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -176,8 +174,7 @@ func (client TenantAccessClient) RegeneratePrimaryKeyPreparer(ctx context.Contex // RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -185,7 +182,6 @@ func (client TenantAccessClient) RegeneratePrimaryKeySender(req *http.Request) ( func (client TenantAccessClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -254,8 +250,7 @@ func (client TenantAccessClient) RegenerateSecondaryKeyPreparer(ctx context.Cont // RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -263,7 +258,6 @@ func (client TenantAccessClient) RegenerateSecondaryKeySender(req *http.Request) func (client TenantAccessClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -338,8 +332,7 @@ func (client TenantAccessClient) UpdatePreparer(ctx context.Context, apimBaseURL // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -347,7 +340,6 @@ func (client TenantAccessClient) UpdateSender(req *http.Request) (*http.Response func (client TenantAccessClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccessgit.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccessgit.go index e47057e8a04c..5172d082f235 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccessgit.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantaccessgit.go @@ -97,8 +97,7 @@ func (client TenantAccessGitClient) GetPreparer(ctx context.Context, apimBaseURL // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessGitClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -106,7 +105,6 @@ func (client TenantAccessGitClient) GetSender(req *http.Request) (*http.Response func (client TenantAccessGitClient) GetResponder(resp *http.Response) (result AccessInformationContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -176,8 +174,7 @@ func (client TenantAccessGitClient) RegeneratePrimaryKeyPreparer(ctx context.Con // RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessGitClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -185,7 +182,6 @@ func (client TenantAccessGitClient) RegeneratePrimaryKeySender(req *http.Request func (client TenantAccessGitClient) RegeneratePrimaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -254,8 +250,7 @@ func (client TenantAccessGitClient) RegenerateSecondaryKeyPreparer(ctx context.C // RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the // http.Response Body if it receives an error. func (client TenantAccessGitClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -263,7 +258,6 @@ func (client TenantAccessGitClient) RegenerateSecondaryKeySender(req *http.Reque func (client TenantAccessGitClient) RegenerateSecondaryKeyResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantconfiguration.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantconfiguration.go index 11a7aa7e71ea..d574365743d1 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantconfiguration.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/tenantconfiguration.go @@ -102,9 +102,8 @@ func (client TenantConfigurationClient) DeployPreparer(ctx context.Context, apim // DeploySender sends the Deploy request. The method will close the // http.Response Body if it receives an error. func (client TenantConfigurationClient) DeploySender(req *http.Request) (future TenantConfigurationDeployFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { return } @@ -117,7 +116,6 @@ func (client TenantConfigurationClient) DeploySender(req *http.Request) (future func (client TenantConfigurationClient) DeployResponder(resp *http.Response) (result OperationResultContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -188,8 +186,7 @@ func (client TenantConfigurationClient) GetSyncStatePreparer(ctx context.Context // GetSyncStateSender sends the GetSyncState request. The method will close the // http.Response Body if it receives an error. func (client TenantConfigurationClient) GetSyncStateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetSyncStateResponder handles the response to the GetSyncState request. The method always @@ -197,7 +194,6 @@ func (client TenantConfigurationClient) GetSyncStateSender(req *http.Request) (* func (client TenantConfigurationClient) GetSyncStateResponder(resp *http.Response) (result TenantConfigurationSyncStateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -271,9 +267,8 @@ func (client TenantConfigurationClient) SavePreparer(ctx context.Context, apimBa // SaveSender sends the Save request. The method will close the // http.Response Body if it receives an error. func (client TenantConfigurationClient) SaveSender(req *http.Request) (future TenantConfigurationSaveFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { return } @@ -286,7 +281,6 @@ func (client TenantConfigurationClient) SaveSender(req *http.Request) (future Te func (client TenantConfigurationClient) SaveResponder(resp *http.Response) (result OperationResultContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -360,9 +354,8 @@ func (client TenantConfigurationClient) ValidatePreparer(ctx context.Context, ap // ValidateSender sends the Validate request. The method will close the // http.Response Body if it receives an error. func (client TenantConfigurationClient) ValidateSender(req *http.Request) (future TenantConfigurationValidateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { return } @@ -375,7 +368,6 @@ func (client TenantConfigurationClient) ValidateSender(req *http.Request) (futur func (client TenantConfigurationClient) ValidateResponder(resp *http.Response) (result OperationResultContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/user.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/user.go index 2ec398ca1f6f..0e02075776fe 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/user.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/user.go @@ -123,8 +123,7 @@ func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, apimBaseURL // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client UserClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -132,7 +131,6 @@ func (client UserClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client UserClient) CreateOrUpdateResponder(resp *http.Response) (result UserContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -226,8 +224,7 @@ func (client UserClient) DeletePreparer(ctx context.Context, apimBaseURL string, // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client UserClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -235,7 +232,6 @@ func (client UserClient) DeleteSender(req *http.Request) (*http.Response, error) func (client UserClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -314,8 +310,7 @@ func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, apimBaseURL // GenerateSsoURLSender sends the GenerateSsoURL request. The method will close the // http.Response Body if it receives an error. func (client UserClient) GenerateSsoURLSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GenerateSsoURLResponder handles the response to the GenerateSsoURL request. The method always @@ -323,7 +318,6 @@ func (client UserClient) GenerateSsoURLSender(req *http.Request) (*http.Response func (client UserClient) GenerateSsoURLResponder(resp *http.Response) (result GenerateSsoURLResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -402,8 +396,7 @@ func (client UserClient) GetPreparer(ctx context.Context, apimBaseURL string, UI // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client UserClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -411,7 +404,6 @@ func (client UserClient) GetSender(req *http.Request) (*http.Response, error) { func (client UserClient) GetResponder(resp *http.Response) (result UserContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -495,8 +487,7 @@ func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, apimB // GetSharedAccessTokenSender sends the GetSharedAccessToken request. The method will close the // http.Response Body if it receives an error. func (client UserClient) GetSharedAccessTokenSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetSharedAccessTokenResponder handles the response to the GetSharedAccessToken request. The method always @@ -504,7 +495,6 @@ func (client UserClient) GetSharedAccessTokenSender(req *http.Request) (*http.Re func (client UserClient) GetSharedAccessTokenResponder(resp *http.Response) (result UserTokenResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -566,6 +556,9 @@ func (client UserClient) List(ctx context.Context, apimBaseURL string, filter st if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "List", resp, "Failure responding to request") } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -601,8 +594,7 @@ func (client UserClient) ListPreparer(ctx context.Context, apimBaseURL string, f // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client UserClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -610,7 +602,6 @@ func (client UserClient) ListSender(req *http.Request) (*http.Response, error) { func (client UserClient) ListResponder(resp *http.Response) (result UserCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -732,8 +723,7 @@ func (client UserClient) UpdatePreparer(ctx context.Context, apimBaseURL string, // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client UserClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // UpdateResponder handles the response to the Update request. The method always @@ -741,7 +731,6 @@ func (client UserClient) UpdateSender(req *http.Request) (*http.Response, error) func (client UserClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usergroup.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usergroup.go index b49809de1b15..81f02535ad4b 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usergroup.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usergroup.go @@ -91,6 +91,9 @@ func (client UserGroupClient) List(ctx context.Context, apimBaseURL string, UID if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -130,8 +133,7 @@ func (client UserGroupClient) ListPreparer(ctx context.Context, apimBaseURL stri // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client UserGroupClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -139,7 +141,6 @@ func (client UserGroupClient) ListSender(req *http.Request) (*http.Response, err func (client UserGroupClient) ListResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/useridentities.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/useridentities.go index e02d6618f312..ab8295dacc01 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/useridentities.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/useridentities.go @@ -107,8 +107,7 @@ func (client UserIdentitiesClient) ListPreparer(ctx context.Context, apimBaseURL // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client UserIdentitiesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -116,7 +115,6 @@ func (client UserIdentitiesClient) ListSender(req *http.Request) (*http.Response func (client UserIdentitiesClient) ListResponder(resp *http.Response) (result UserIdentityCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usersubscription.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usersubscription.go index 37f04b5ac212..96d94ab13a71 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usersubscription.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/usersubscription.go @@ -94,6 +94,9 @@ func (client UserSubscriptionClient) List(ctx context.Context, apimBaseURL strin if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -133,8 +136,7 @@ func (client UserSubscriptionClient) ListPreparer(ctx context.Context, apimBaseU // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client UserSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -142,7 +144,6 @@ func (client UserSubscriptionClient) ListSender(req *http.Request) (*http.Respon func (client UserSubscriptionClient) ListResponder(resp *http.Response) (result SubscriptionCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/version.go b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/version.go index 4745be0ec721..f0cf4988bff8 100644 --- a/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/version.go +++ b/services/preview/apimanagement/ctrl/2017-03-01/apimanagement/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2017-03-01" + return "Azure-SDK-For-Go/" + Version() + " apimanagement/2017-03-01" } // Version returns the semantic version (see http://semver.org) of the client.