diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/apioperations.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/apioperations.go index 06765bc4c3b2..4ab002472396 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/apioperations.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/apioperations.go @@ -139,8 +139,7 @@ func (client APIOperationsClient) CreateOrUpdatePreparer(ctx context.Context, re // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client APIOperationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -148,7 +147,6 @@ func (client APIOperationsClient) CreateOrUpdateSender(req *http.Request) (*http func (client APIOperationsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -239,8 +237,7 @@ func (client APIOperationsClient) DeletePreparer(ctx context.Context, resourceGr // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client APIOperationsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -248,7 +245,6 @@ func (client APIOperationsClient) DeleteSender(req *http.Request) (*http.Respons func (client APIOperationsClient) 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 @@ -336,8 +332,7 @@ func (client APIOperationsClient) GetPreparer(ctx context.Context, resourceGroup // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client APIOperationsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -345,7 +340,6 @@ func (client APIOperationsClient) GetSender(req *http.Request) (*http.Response, func (client APIOperationsClient) GetResponder(resp *http.Response) (result OperationContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,6 +407,9 @@ func (client APIOperationsClient) ListByAPI(ctx context.Context, resourceGroupNa if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationsClient", "ListByAPI", resp, "Failure responding to request") } + if result.oc.hasNextLink() && result.oc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -451,8 +448,7 @@ func (client APIOperationsClient) ListByAPIPreparer(ctx context.Context, resourc // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client APIOperationsClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -460,7 +456,6 @@ func (client APIOperationsClient) ListByAPISender(req *http.Request) (*http.Resp func (client APIOperationsClient) ListByAPIResponder(resp *http.Response) (result OperationCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -592,8 +587,7 @@ func (client APIOperationsClient) UpdatePreparer(ctx context.Context, resourceGr // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client APIOperationsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -601,7 +595,6 @@ func (client APIOperationsClient) UpdateSender(req *http.Request) (*http.Respons func (client APIOperationsClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/apiproducts.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/apiproducts.go index 0e7db77faa82..3cede7864b40 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/apiproducts.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/apiproducts.go @@ -99,6 +99,9 @@ func (client APIProductsClient) ListByAPI(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIProductsClient", "ListByAPI", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -137,8 +140,7 @@ func (client APIProductsClient) ListByAPIPreparer(ctx context.Context, resourceG // ListByAPISender sends the ListByAPI request. The method will close the // http.Response Body if it receives an error. func (client APIProductsClient) ListByAPISender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByAPIResponder handles the response to the ListByAPI request. The method always @@ -146,7 +148,6 @@ func (client APIProductsClient) ListByAPISender(req *http.Request) (*http.Respon func (client APIProductsClient) ListByAPIResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/apis.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/apis.go index fee35d248931..e5db83ef126f 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/apis.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/apis.go @@ -140,8 +140,7 @@ func (client ApisClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -149,7 +148,6 @@ func (client ApisClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client ApisClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -233,8 +231,7 @@ func (client ApisClient) DeletePreparer(ctx context.Context, resourceGroupName s // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -242,7 +239,6 @@ func (client ApisClient) DeleteSender(req *http.Request) (*http.Response, error) func (client ApisClient) 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 @@ -323,8 +319,7 @@ func (client ApisClient) ExportPreparer(ctx context.Context, resourceGroupName s // ExportSender sends the Export request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) ExportSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ExportResponder handles the response to the Export request. The method always @@ -332,7 +327,6 @@ func (client ApisClient) ExportSender(req *http.Request) (*http.Response, error) func (client ApisClient) ExportResponder(resp *http.Response) (result APIExportResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -414,8 +408,7 @@ func (client ApisClient) GetPreparer(ctx context.Context, resourceGroupName stri // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -423,7 +416,6 @@ func (client ApisClient) GetSender(req *http.Request) (*http.Response, error) { func (client ApisClient) GetResponder(resp *http.Response) (result APIContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -487,6 +479,9 @@ func (client ApisClient) ListByService(ctx context.Context, resourceGroupName st if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ApisClient", "ListByService", resp, "Failure responding to request") } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -524,8 +519,7 @@ func (client ApisClient) ListByServicePreparer(ctx context.Context, resourceGrou // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -533,7 +527,6 @@ func (client ApisClient) ListByServiceSender(req *http.Request) (*http.Response, func (client ApisClient) ListByServiceResponder(resp *http.Response) (result APICollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -658,8 +651,7 @@ func (client ApisClient) UpdatePreparer(ctx context.Context, resourceGroupName s // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ApisClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -667,7 +659,6 @@ func (client ApisClient) UpdateSender(req *http.Request) (*http.Response, error) func (client ApisClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/authorizationservers.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/authorizationservers.go index 95884b63297c..dd5203f1524e 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/authorizationservers.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/authorizationservers.go @@ -129,8 +129,7 @@ func (client AuthorizationServersClient) CreateOrUpdatePreparer(ctx context.Cont // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -138,7 +137,6 @@ func (client AuthorizationServersClient) CreateOrUpdateSender(req *http.Request) func (client AuthorizationServersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -218,8 +216,7 @@ func (client AuthorizationServersClient) DeletePreparer(ctx context.Context, res // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -227,7 +224,6 @@ func (client AuthorizationServersClient) DeleteSender(req *http.Request) (*http. func (client AuthorizationServersClient) 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 @@ -307,8 +303,7 @@ func (client AuthorizationServersClient) GetPreparer(ctx context.Context, resour // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -316,7 +311,6 @@ func (client AuthorizationServersClient) GetSender(req *http.Request) (*http.Res func (client AuthorizationServersClient) GetResponder(resp *http.Response) (result OAuth2AuthorizationServerContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -377,6 +371,9 @@ func (client AuthorizationServersClient) ListByService(ctx context.Context, reso if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServersClient", "ListByService", resp, "Failure responding to request") } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -414,8 +411,7 @@ func (client AuthorizationServersClient) ListByServicePreparer(ctx context.Conte // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -423,7 +419,6 @@ func (client AuthorizationServersClient) ListByServiceSender(req *http.Request) func (client AuthorizationServersClient) ListByServiceResponder(resp *http.Response) (result AuthorizationServerCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -544,8 +539,7 @@ func (client AuthorizationServersClient) UpdatePreparer(ctx context.Context, res // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client AuthorizationServersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -553,7 +547,6 @@ func (client AuthorizationServersClient) UpdateSender(req *http.Request) (*http. func (client AuthorizationServersClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/backends.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/backends.go index e39cb2825590..07e2cf122387 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/backends.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/backends.go @@ -124,8 +124,7 @@ func (client BackendsClient) CreateOrUpdatePreparer(ctx context.Context, resourc // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client BackendsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -133,7 +132,6 @@ func (client BackendsClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client BackendsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -217,8 +215,7 @@ func (client BackendsClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client BackendsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -226,7 +223,6 @@ func (client BackendsClient) DeleteSender(req *http.Request) (*http.Response, er func (client BackendsClient) 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 @@ -307,8 +303,7 @@ func (client BackendsClient) GetPreparer(ctx context.Context, resourceGroupName // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client BackendsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -316,7 +311,6 @@ func (client BackendsClient) GetSender(req *http.Request) (*http.Response, error func (client BackendsClient) GetResponder(resp *http.Response) (result BackendResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -377,6 +371,9 @@ func (client BackendsClient) ListByService(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "ListByService", resp, "Failure responding to request") } + if result.bc.hasNextLink() && result.bc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -414,8 +411,7 @@ func (client BackendsClient) ListByServicePreparer(ctx context.Context, resource // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client BackendsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -423,7 +419,6 @@ func (client BackendsClient) ListByServiceSender(req *http.Request) (*http.Respo func (client BackendsClient) ListByServiceResponder(resp *http.Response) (result BackendCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -548,8 +543,7 @@ func (client BackendsClient) UpdatePreparer(ctx context.Context, resourceGroupNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client BackendsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -557,7 +551,6 @@ func (client BackendsClient) UpdateSender(req *http.Request) (*http.Response, er func (client BackendsClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/certificates.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/certificates.go index 60eb803cc206..a5bc1938221c 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/certificates.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/certificates.go @@ -129,8 +129,7 @@ func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, res // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client CertificatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -138,7 +137,6 @@ func (client CertificatesClient) CreateOrUpdateSender(req *http.Request) (*http. func (client CertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -218,8 +216,7 @@ func (client CertificatesClient) DeletePreparer(ctx context.Context, resourceGro // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client CertificatesClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -227,7 +224,6 @@ func (client CertificatesClient) DeleteSender(req *http.Request) (*http.Response func (client CertificatesClient) 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 @@ -304,8 +300,7 @@ func (client CertificatesClient) GetPreparer(ctx context.Context, resourceGroupN // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client CertificatesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -313,7 +308,6 @@ func (client CertificatesClient) GetSender(req *http.Request) (*http.Response, e func (client CertificatesClient) GetResponder(resp *http.Response) (result CertificateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -376,6 +370,9 @@ func (client CertificatesClient) ListByService(ctx context.Context, resourceGrou if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.CertificatesClient", "ListByService", resp, "Failure responding to request") } + if result.cc.hasNextLink() && result.cc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -413,8 +410,7 @@ func (client CertificatesClient) ListByServicePreparer(ctx context.Context, reso // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client CertificatesClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -422,7 +418,6 @@ func (client CertificatesClient) ListByServiceSender(req *http.Request) (*http.R func (client CertificatesClient) ListByServiceResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/enums.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/enums.go new file mode 100644 index 000000000000..774c2d332e87 --- /dev/null +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/enums.go @@ -0,0 +1,390 @@ +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. + +// APIProtocolContract enumerates the values for api protocol contract. +type APIProtocolContract string + +const ( + // HTTP ... + HTTP APIProtocolContract = "Http" + // HTTPS ... + HTTPS APIProtocolContract = "Https" +) + +// PossibleAPIProtocolContractValues returns an array of possible values for the APIProtocolContract const type. +func PossibleAPIProtocolContractValues() []APIProtocolContract { + return []APIProtocolContract{HTTP, HTTPS} +} + +// APITypeContract enumerates the values for api type contract. +type APITypeContract string + +const ( + // APITypeContractHTTP ... + APITypeContractHTTP APITypeContract = "Http" + // APITypeContractSoap ... + APITypeContractSoap APITypeContract = "Soap" +) + +// PossibleAPITypeContractValues returns an array of possible values for the APITypeContract const type. +func PossibleAPITypeContractValues() []APITypeContract { + return []APITypeContract{APITypeContractHTTP, APITypeContractSoap} +} + +// AsyncOperationState enumerates the values for async operation state. +type AsyncOperationState string + +const ( + // Failed ... + Failed AsyncOperationState = "Failed" + // InProgress ... + InProgress AsyncOperationState = "InProgress" + // Started ... + Started AsyncOperationState = "Started" + // Succeeded ... + Succeeded AsyncOperationState = "Succeeded" +) + +// PossibleAsyncOperationStateValues returns an array of possible values for the AsyncOperationState const type. +func PossibleAsyncOperationStateValues() []AsyncOperationState { + return []AsyncOperationState{Failed, InProgress, Started, Succeeded} +} + +// BearerTokenSendingMethodsContract enumerates the values for bearer token sending methods contract. +type BearerTokenSendingMethodsContract string + +const ( + // AuthorizationHeader ... + AuthorizationHeader BearerTokenSendingMethodsContract = "authorizationHeader" + // Query ... + Query BearerTokenSendingMethodsContract = "query" +) + +// PossibleBearerTokenSendingMethodsContractValues returns an array of possible values for the BearerTokenSendingMethodsContract const type. +func PossibleBearerTokenSendingMethodsContractValues() []BearerTokenSendingMethodsContract { + return []BearerTokenSendingMethodsContract{AuthorizationHeader, Query} +} + +// ClientAuthenticationMethodContract enumerates the values for client authentication method contract. +type ClientAuthenticationMethodContract string + +const ( + // Basic ... + Basic ClientAuthenticationMethodContract = "Basic" + // Body ... + Body ClientAuthenticationMethodContract = "Body" +) + +// PossibleClientAuthenticationMethodContractValues returns an array of possible values for the ClientAuthenticationMethodContract const type. +func PossibleClientAuthenticationMethodContractValues() []ClientAuthenticationMethodContract { + return []ClientAuthenticationMethodContract{Basic, Body} +} + +// GrantTypesContract enumerates the values for grant types contract. +type GrantTypesContract string + +const ( + // AuthorizationCode ... + AuthorizationCode GrantTypesContract = "authorizationCode" + // ClientCredentials ... + ClientCredentials GrantTypesContract = "clientCredentials" + // Implicit ... + Implicit GrantTypesContract = "implicit" + // ResourceOwnerPassword ... + ResourceOwnerPassword GrantTypesContract = "resourceOwnerPassword" +) + +// PossibleGrantTypesContractValues returns an array of possible values for the GrantTypesContract const type. +func PossibleGrantTypesContractValues() []GrantTypesContract { + return []GrantTypesContract{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} +} + +// GroupTypeContract enumerates the values for group type contract. +type GroupTypeContract string + +const ( + // Custom ... + Custom GroupTypeContract = "Custom" + // External ... + External GroupTypeContract = "External" + // System ... + System GroupTypeContract = "System" +) + +// PossibleGroupTypeContractValues returns an array of possible values for the GroupTypeContract const type. +func PossibleGroupTypeContractValues() []GroupTypeContract { + return []GroupTypeContract{Custom, External, System} +} + +// HostnameType enumerates the values for hostname type. +type HostnameType string + +const ( + // Management ... + Management HostnameType = "Management" + // Portal ... + Portal HostnameType = "Portal" + // Proxy ... + Proxy HostnameType = "Proxy" + // Scm ... + Scm HostnameType = "Scm" +) + +// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. +func PossibleHostnameTypeValues() []HostnameType { + return []HostnameType{Management, Portal, Proxy, Scm} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // Accepted ... + Accepted HTTPStatusCode = "Accepted" + // Conflict ... + Conflict HTTPStatusCode = "Conflict" + // Continue ... + Continue HTTPStatusCode = "Continue" + // Created ... + Created HTTPStatusCode = "Created" + // NotFound ... + NotFound HTTPStatusCode = "NotFound" + // OK ... + OK HTTPStatusCode = "OK" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{Accepted, Conflict, Continue, Created, NotFound, OK} +} + +// IdentityProviderNameType enumerates the values for identity provider name type. +type IdentityProviderNameType string + +const ( + // Aad ... + Aad IdentityProviderNameType = "aad" + // Facebook ... + Facebook IdentityProviderNameType = "facebook" + // Google ... + Google IdentityProviderNameType = "google" + // Microsoft ... + Microsoft IdentityProviderNameType = "microsoft" + // Twitter ... + Twitter IdentityProviderNameType = "twitter" +) + +// PossibleIdentityProviderNameTypeValues returns an array of possible values for the IdentityProviderNameType const type. +func PossibleIdentityProviderNameTypeValues() []IdentityProviderNameType { + return []IdentityProviderNameType{Aad, Facebook, Google, Microsoft, Twitter} +} + +// MethodContract enumerates the values for method contract. +type MethodContract string + +const ( + // DELETE ... + DELETE MethodContract = "DELETE" + // GET ... + GET MethodContract = "GET" + // HEAD ... + HEAD MethodContract = "HEAD" + // OPTIONS ... + OPTIONS MethodContract = "OPTIONS" + // PATCH ... + PATCH MethodContract = "PATCH" + // POST ... + POST MethodContract = "POST" + // PUT ... + PUT MethodContract = "PUT" + // TRACE ... + TRACE MethodContract = "TRACE" +) + +// PossibleMethodContractValues returns an array of possible values for the MethodContract const type. +func PossibleMethodContractValues() []MethodContract { + return []MethodContract{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} +} + +// NameAvailabilityReason enumerates the values for name availability reason. +type NameAvailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists NameAvailabilityReason = "AlreadyExists" + // Invalid ... + Invalid NameAvailabilityReason = "Invalid" + // Valid ... + Valid NameAvailabilityReason = "Valid" +) + +// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. +func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { + return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} +} + +// OperationStatus enumerates the values for operation status. +type OperationStatus string + +const ( + // OperationStatusFailed ... + OperationStatusFailed OperationStatus = "Failed" + // OperationStatusInProgress ... + OperationStatusInProgress OperationStatus = "InProgress" + // OperationStatusSucceeded ... + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} +} + +// 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} +} + +// ProductStateContract enumerates the values for product state contract. +type ProductStateContract string + +const ( + // NotPublished ... + NotPublished ProductStateContract = "NotPublished" + // Published ... + Published ProductStateContract = "Published" +) + +// PossibleProductStateContractValues returns an array of possible values for the ProductStateContract const type. +func PossibleProductStateContractValues() []ProductStateContract { + return []ProductStateContract{NotPublished, Published} +} + +// ReportsAggregation enumerates the values for reports aggregation. +type ReportsAggregation string + +const ( + // ByAPI ... + ByAPI ReportsAggregation = "byApi" + // ByGeo ... + ByGeo ReportsAggregation = "byGeo" + // ByOperation ... + ByOperation ReportsAggregation = "byOperation" + // ByProduct ... + ByProduct ReportsAggregation = "byProduct" + // BySubscription ... + BySubscription ReportsAggregation = "bySubscription" + // ByTime ... + ByTime ReportsAggregation = "byTime" + // ByUser ... + ByUser ReportsAggregation = "byUser" +) + +// PossibleReportsAggregationValues returns an array of possible values for the ReportsAggregation const type. +func PossibleReportsAggregationValues() []ReportsAggregation { + return []ReportsAggregation{ByAPI, ByGeo, ByOperation, ByProduct, BySubscription, ByTime, ByUser} +} + +// SkuType enumerates the values for sku type. +type SkuType string + +const ( + // Developer ... + Developer SkuType = "Developer" + // Premium ... + Premium SkuType = "Premium" + // Standard ... + Standard SkuType = "Standard" +) + +// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. +func PossibleSkuTypeValues() []SkuType { + return []SkuType{Developer, Premium, Standard} +} + +// SubscriptionStateContract enumerates the values for subscription state contract. +type SubscriptionStateContract string + +const ( + // Active ... + Active SubscriptionStateContract = "Active" + // Cancelled ... + Cancelled SubscriptionStateContract = "Cancelled" + // Expired ... + Expired SubscriptionStateContract = "Expired" + // Rejected ... + Rejected SubscriptionStateContract = "Rejected" + // Submitted ... + Submitted SubscriptionStateContract = "Submitted" + // Suspended ... + Suspended SubscriptionStateContract = "Suspended" +) + +// PossibleSubscriptionStateContractValues returns an array of possible values for the SubscriptionStateContract const type. +func PossibleSubscriptionStateContractValues() []SubscriptionStateContract { + return []SubscriptionStateContract{Active, Cancelled, Expired, Rejected, Submitted, Suspended} +} + +// UserStateContract enumerates the values for user state contract. +type UserStateContract string + +const ( + // UserStateContractActive ... + UserStateContractActive UserStateContract = "Active" + // UserStateContractBlocked ... + UserStateContractBlocked UserStateContract = "Blocked" +) + +// PossibleUserStateContractValues returns an array of possible values for the UserStateContract const type. +func PossibleUserStateContractValues() []UserStateContract { + return []UserStateContract{UserStateContractActive, UserStateContractBlocked} +} + +// VirtualNetworkType enumerates the values for virtual network type. +type VirtualNetworkType string + +const ( + // VirtualNetworkTypeExternal ... + VirtualNetworkTypeExternal VirtualNetworkType = "External" + // VirtualNetworkTypeInternal ... + VirtualNetworkTypeInternal VirtualNetworkType = "Internal" + // VirtualNetworkTypeNone ... + VirtualNetworkTypeNone VirtualNetworkType = "None" +) + +// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. +func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { + return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} +} diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/groups.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/groups.go index c69f026ab87f..6eb2154c5ae0 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/groups.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/groups.go @@ -124,8 +124,7 @@ func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceG // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -133,7 +132,6 @@ func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -217,8 +215,7 @@ func (client GroupsClient) DeletePreparer(ctx context.Context, resourceGroupName // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client GroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -226,7 +223,6 @@ func (client GroupsClient) DeleteSender(req *http.Request) (*http.Response, erro func (client GroupsClient) DeleteResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -308,8 +304,7 @@ func (client GroupsClient) GetPreparer(ctx context.Context, resourceGroupName st // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -317,7 +312,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result GroupContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -380,6 +374,9 @@ func (client GroupsClient) ListByService(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupsClient", "ListByService", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -417,8 +414,7 @@ func (client GroupsClient) ListByServicePreparer(ctx context.Context, resourceGr // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client GroupsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -426,7 +422,6 @@ func (client GroupsClient) ListByServiceSender(req *http.Request) (*http.Respons func (client GroupsClient) ListByServiceResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -551,8 +546,7 @@ func (client GroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -560,7 +554,6 @@ func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, erro func (client GroupsClient) UpdateResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/groupusers.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/groupusers.go index 40a0888a5448..b0d14eaddf36 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/groupusers.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/groupusers.go @@ -122,8 +122,7 @@ func (client GroupUsersClient) AddPreparer(ctx context.Context, resourceGroupNam // AddSender sends the Add request. The method will close the // http.Response Body if it receives an error. func (client GroupUsersClient) AddSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // AddResponder handles the response to the Add request. The method always @@ -131,7 +130,6 @@ func (client GroupUsersClient) AddSender(req *http.Request) (*http.Response, err func (client GroupUsersClient) AddResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,6 +200,9 @@ func (client GroupUsersClient) ListByGroup(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUsersClient", "ListByGroup", resp, "Failure responding to request") } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -240,8 +241,7 @@ func (client GroupUsersClient) ListByGroupPreparer(ctx context.Context, resource // ListByGroupSender sends the ListByGroup request. The method will close the // http.Response Body if it receives an error. func (client GroupUsersClient) ListByGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByGroupResponder handles the response to the ListByGroup request. The method always @@ -249,7 +249,6 @@ func (client GroupUsersClient) ListByGroupSender(req *http.Request) (*http.Respo func (client GroupUsersClient) ListByGroupResponder(resp *http.Response) (result UserCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -374,8 +373,7 @@ func (client GroupUsersClient) RemovePreparer(ctx context.Context, resourceGroup // RemoveSender sends the Remove request. The method will close the // http.Response Body if it receives an error. func (client GroupUsersClient) RemoveSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RemoveResponder handles the response to the Remove request. The method always @@ -383,7 +381,6 @@ func (client GroupUsersClient) RemoveSender(req *http.Request) (*http.Response, func (client GroupUsersClient) RemoveResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/identityproviders.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/identityproviders.go index 3f4e9ec9eb94..d02e32104482 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/identityproviders.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/identityproviders.go @@ -123,8 +123,7 @@ func (client IdentityProvidersClient) CreateOrUpdatePreparer(ctx context.Context // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client IdentityProvidersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -132,7 +131,6 @@ func (client IdentityProvidersClient) CreateOrUpdateSender(req *http.Request) (* func (client IdentityProvidersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -212,8 +210,7 @@ func (client IdentityProvidersClient) DeletePreparer(ctx context.Context, resour // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client IdentityProvidersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -221,7 +218,6 @@ func (client IdentityProvidersClient) DeleteSender(req *http.Request) (*http.Res func (client IdentityProvidersClient) 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 @@ -298,8 +294,7 @@ func (client IdentityProvidersClient) GetPreparer(ctx context.Context, resourceG // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IdentityProvidersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -307,7 +302,6 @@ func (client IdentityProvidersClient) GetSender(req *http.Request) (*http.Respon func (client IdentityProvidersClient) GetResponder(resp *http.Response) (result IdentityProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -383,8 +377,7 @@ func (client IdentityProvidersClient) ListByServicePreparer(ctx context.Context, // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client IdentityProvidersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -392,7 +385,6 @@ func (client IdentityProvidersClient) ListByServiceSender(req *http.Request) (*h func (client IdentityProvidersClient) ListByServiceResponder(resp *http.Response) (result IdentityProviderList, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -476,8 +468,7 @@ func (client IdentityProvidersClient) UpdatePreparer(ctx context.Context, resour // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client IdentityProvidersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -485,7 +476,6 @@ func (client IdentityProvidersClient) UpdateSender(req *http.Request) (*http.Res func (client IdentityProvidersClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/loggers.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/loggers.go index 8e48aaa80377..e58d5709eada 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/loggers.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/loggers.go @@ -121,8 +121,7 @@ func (client LoggersClient) CreateOrUpdatePreparer(ctx context.Context, resource // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client LoggersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -130,7 +129,6 @@ func (client LoggersClient) CreateOrUpdateSender(req *http.Request) (*http.Respo func (client LoggersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -210,8 +208,7 @@ func (client LoggersClient) DeletePreparer(ctx context.Context, resourceGroupNam // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client LoggersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -219,7 +216,6 @@ func (client LoggersClient) DeleteSender(req *http.Request) (*http.Response, err func (client LoggersClient) 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 LoggersClient) GetPreparer(ctx context.Context, resourceGroupName s // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client LoggersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -305,7 +300,6 @@ func (client LoggersClient) GetSender(req *http.Request) (*http.Response, error) func (client LoggersClient) GetResponder(resp *http.Response) (result LoggerResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -366,6 +360,9 @@ func (client LoggersClient) ListByService(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggersClient", "ListByService", resp, "Failure responding to request") } + if result.lc.hasNextLink() && result.lc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -403,8 +400,7 @@ func (client LoggersClient) ListByServicePreparer(ctx context.Context, resourceG // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client LoggersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -412,7 +408,6 @@ func (client LoggersClient) ListByServiceSender(req *http.Request) (*http.Respon func (client LoggersClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -533,8 +528,7 @@ func (client LoggersClient) UpdatePreparer(ctx context.Context, resourceGroupNam // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client LoggersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -542,7 +536,6 @@ func (client LoggersClient) UpdateSender(req *http.Request) (*http.Response, err func (client LoggersClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/models.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go index 1244c555470d..75a8e4d5f96b 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go @@ -31,378 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2016-07-07/apimanagement" -// APIProtocolContract enumerates the values for api protocol contract. -type APIProtocolContract string - -const ( - // HTTP ... - HTTP APIProtocolContract = "Http" - // HTTPS ... - HTTPS APIProtocolContract = "Https" -) - -// PossibleAPIProtocolContractValues returns an array of possible values for the APIProtocolContract const type. -func PossibleAPIProtocolContractValues() []APIProtocolContract { - return []APIProtocolContract{HTTP, HTTPS} -} - -// APITypeContract enumerates the values for api type contract. -type APITypeContract string - -const ( - // APITypeContractHTTP ... - APITypeContractHTTP APITypeContract = "Http" - // APITypeContractSoap ... - APITypeContractSoap APITypeContract = "Soap" -) - -// PossibleAPITypeContractValues returns an array of possible values for the APITypeContract const type. -func PossibleAPITypeContractValues() []APITypeContract { - return []APITypeContract{APITypeContractHTTP, APITypeContractSoap} -} - -// AsyncOperationState enumerates the values for async operation state. -type AsyncOperationState string - -const ( - // Failed ... - Failed AsyncOperationState = "Failed" - // InProgress ... - InProgress AsyncOperationState = "InProgress" - // Started ... - Started AsyncOperationState = "Started" - // Succeeded ... - Succeeded AsyncOperationState = "Succeeded" -) - -// PossibleAsyncOperationStateValues returns an array of possible values for the AsyncOperationState const type. -func PossibleAsyncOperationStateValues() []AsyncOperationState { - return []AsyncOperationState{Failed, InProgress, Started, Succeeded} -} - -// BearerTokenSendingMethodsContract enumerates the values for bearer token sending methods contract. -type BearerTokenSendingMethodsContract string - -const ( - // AuthorizationHeader ... - AuthorizationHeader BearerTokenSendingMethodsContract = "authorizationHeader" - // Query ... - Query BearerTokenSendingMethodsContract = "query" -) - -// PossibleBearerTokenSendingMethodsContractValues returns an array of possible values for the BearerTokenSendingMethodsContract const type. -func PossibleBearerTokenSendingMethodsContractValues() []BearerTokenSendingMethodsContract { - return []BearerTokenSendingMethodsContract{AuthorizationHeader, Query} -} - -// ClientAuthenticationMethodContract enumerates the values for client authentication method contract. -type ClientAuthenticationMethodContract string - -const ( - // Basic ... - Basic ClientAuthenticationMethodContract = "Basic" - // Body ... - Body ClientAuthenticationMethodContract = "Body" -) - -// PossibleClientAuthenticationMethodContractValues returns an array of possible values for the ClientAuthenticationMethodContract const type. -func PossibleClientAuthenticationMethodContractValues() []ClientAuthenticationMethodContract { - return []ClientAuthenticationMethodContract{Basic, Body} -} - -// GrantTypesContract enumerates the values for grant types contract. -type GrantTypesContract string - -const ( - // AuthorizationCode ... - AuthorizationCode GrantTypesContract = "authorizationCode" - // ClientCredentials ... - ClientCredentials GrantTypesContract = "clientCredentials" - // Implicit ... - Implicit GrantTypesContract = "implicit" - // ResourceOwnerPassword ... - ResourceOwnerPassword GrantTypesContract = "resourceOwnerPassword" -) - -// PossibleGrantTypesContractValues returns an array of possible values for the GrantTypesContract const type. -func PossibleGrantTypesContractValues() []GrantTypesContract { - return []GrantTypesContract{AuthorizationCode, ClientCredentials, Implicit, ResourceOwnerPassword} -} - -// GroupTypeContract enumerates the values for group type contract. -type GroupTypeContract string - -const ( - // Custom ... - Custom GroupTypeContract = "Custom" - // External ... - External GroupTypeContract = "External" - // System ... - System GroupTypeContract = "System" -) - -// PossibleGroupTypeContractValues returns an array of possible values for the GroupTypeContract const type. -func PossibleGroupTypeContractValues() []GroupTypeContract { - return []GroupTypeContract{Custom, External, System} -} - -// HostnameType enumerates the values for hostname type. -type HostnameType string - -const ( - // Management ... - Management HostnameType = "Management" - // Portal ... - Portal HostnameType = "Portal" - // Proxy ... - Proxy HostnameType = "Proxy" - // Scm ... - Scm HostnameType = "Scm" -) - -// PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. -func PossibleHostnameTypeValues() []HostnameType { - return []HostnameType{Management, Portal, Proxy, Scm} -} - -// HTTPStatusCode enumerates the values for http status code. -type HTTPStatusCode string - -const ( - // Accepted ... - Accepted HTTPStatusCode = "Accepted" - // Conflict ... - Conflict HTTPStatusCode = "Conflict" - // Continue ... - Continue HTTPStatusCode = "Continue" - // Created ... - Created HTTPStatusCode = "Created" - // NotFound ... - NotFound HTTPStatusCode = "NotFound" - // OK ... - OK HTTPStatusCode = "OK" -) - -// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. -func PossibleHTTPStatusCodeValues() []HTTPStatusCode { - return []HTTPStatusCode{Accepted, Conflict, Continue, Created, NotFound, OK} -} - -// IdentityProviderNameType enumerates the values for identity provider name type. -type IdentityProviderNameType string - -const ( - // Aad ... - Aad IdentityProviderNameType = "aad" - // Facebook ... - Facebook IdentityProviderNameType = "facebook" - // Google ... - Google IdentityProviderNameType = "google" - // Microsoft ... - Microsoft IdentityProviderNameType = "microsoft" - // Twitter ... - Twitter IdentityProviderNameType = "twitter" -) - -// PossibleIdentityProviderNameTypeValues returns an array of possible values for the IdentityProviderNameType const type. -func PossibleIdentityProviderNameTypeValues() []IdentityProviderNameType { - return []IdentityProviderNameType{Aad, Facebook, Google, Microsoft, Twitter} -} - -// MethodContract enumerates the values for method contract. -type MethodContract string - -const ( - // DELETE ... - DELETE MethodContract = "DELETE" - // GET ... - GET MethodContract = "GET" - // HEAD ... - HEAD MethodContract = "HEAD" - // OPTIONS ... - OPTIONS MethodContract = "OPTIONS" - // PATCH ... - PATCH MethodContract = "PATCH" - // POST ... - POST MethodContract = "POST" - // PUT ... - PUT MethodContract = "PUT" - // TRACE ... - TRACE MethodContract = "TRACE" -) - -// PossibleMethodContractValues returns an array of possible values for the MethodContract const type. -func PossibleMethodContractValues() []MethodContract { - return []MethodContract{DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE} -} - -// NameAvailabilityReason enumerates the values for name availability reason. -type NameAvailabilityReason string - -const ( - // AlreadyExists ... - AlreadyExists NameAvailabilityReason = "AlreadyExists" - // Invalid ... - Invalid NameAvailabilityReason = "Invalid" - // Valid ... - Valid NameAvailabilityReason = "Valid" -) - -// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. -func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { - return []NameAvailabilityReason{AlreadyExists, Invalid, Valid} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusFailed ... - OperationStatusFailed OperationStatus = "Failed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} -} - -// 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} -} - -// ProductStateContract enumerates the values for product state contract. -type ProductStateContract string - -const ( - // NotPublished ... - NotPublished ProductStateContract = "NotPublished" - // Published ... - Published ProductStateContract = "Published" -) - -// PossibleProductStateContractValues returns an array of possible values for the ProductStateContract const type. -func PossibleProductStateContractValues() []ProductStateContract { - return []ProductStateContract{NotPublished, Published} -} - -// ReportsAggregation enumerates the values for reports aggregation. -type ReportsAggregation string - -const ( - // ByAPI ... - ByAPI ReportsAggregation = "byApi" - // ByGeo ... - ByGeo ReportsAggregation = "byGeo" - // ByOperation ... - ByOperation ReportsAggregation = "byOperation" - // ByProduct ... - ByProduct ReportsAggregation = "byProduct" - // BySubscription ... - BySubscription ReportsAggregation = "bySubscription" - // ByTime ... - ByTime ReportsAggregation = "byTime" - // ByUser ... - ByUser ReportsAggregation = "byUser" -) - -// PossibleReportsAggregationValues returns an array of possible values for the ReportsAggregation const type. -func PossibleReportsAggregationValues() []ReportsAggregation { - return []ReportsAggregation{ByAPI, ByGeo, ByOperation, ByProduct, BySubscription, ByTime, ByUser} -} - -// SkuType enumerates the values for sku type. -type SkuType string - -const ( - // Developer ... - Developer SkuType = "Developer" - // Premium ... - Premium SkuType = "Premium" - // Standard ... - Standard SkuType = "Standard" -) - -// PossibleSkuTypeValues returns an array of possible values for the SkuType const type. -func PossibleSkuTypeValues() []SkuType { - return []SkuType{Developer, Premium, Standard} -} - -// SubscriptionStateContract enumerates the values for subscription state contract. -type SubscriptionStateContract string - -const ( - // Active ... - Active SubscriptionStateContract = "Active" - // Cancelled ... - Cancelled SubscriptionStateContract = "Cancelled" - // Expired ... - Expired SubscriptionStateContract = "Expired" - // Rejected ... - Rejected SubscriptionStateContract = "Rejected" - // Submitted ... - Submitted SubscriptionStateContract = "Submitted" - // Suspended ... - Suspended SubscriptionStateContract = "Suspended" -) - -// PossibleSubscriptionStateContractValues returns an array of possible values for the SubscriptionStateContract const type. -func PossibleSubscriptionStateContractValues() []SubscriptionStateContract { - return []SubscriptionStateContract{Active, Cancelled, Expired, Rejected, Submitted, Suspended} -} - -// UserStateContract enumerates the values for user state contract. -type UserStateContract string - -const ( - // UserStateContractActive ... - UserStateContractActive UserStateContract = "Active" - // UserStateContractBlocked ... - UserStateContractBlocked UserStateContract = "Blocked" -) - -// PossibleUserStateContractValues returns an array of possible values for the UserStateContract const type. -func PossibleUserStateContractValues() []UserStateContract { - return []UserStateContract{UserStateContractActive, UserStateContractBlocked} -} - -// VirtualNetworkType enumerates the values for virtual network type. -type VirtualNetworkType string - -const ( - // VirtualNetworkTypeExternal ... - VirtualNetworkTypeExternal VirtualNetworkType = "External" - // VirtualNetworkTypeInternal ... - VirtualNetworkTypeInternal VirtualNetworkType = "Internal" - // VirtualNetworkTypeNone ... - VirtualNetworkTypeNone VirtualNetworkType = "None" -) - -// PossibleVirtualNetworkTypeValues returns an array of possible values for the VirtualNetworkType const type. -func PossibleVirtualNetworkTypeValues() []VirtualNetworkType { - return []VirtualNetworkType{VirtualNetworkTypeExternal, VirtualNetworkTypeInternal, VirtualNetworkTypeNone} -} - // AccessInformationContract tenant access information contract of the API Management service. type AccessInformationContract struct { autorest.Response `json:"-"` @@ -416,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"` @@ -437,6 +64,24 @@ type AdditionalRegion struct { Vpnconfiguration *VirtualNetworkConfiguration `json:"vpnconfiguration,omitempty"` } +// MarshalJSON is the custom marshaler for AdditionalRegion. +func (ar AdditionalRegion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.Location != nil { + objectMap["location"] = ar.Location + } + if ar.SkuType != "" { + objectMap["skuType"] = ar.SkuType + } + if ar.SkuUnitCount != nil { + objectMap["skuUnitCount"] = ar.SkuUnitCount + } + if ar.Vpnconfiguration != nil { + objectMap["vpnconfiguration"] = ar.Vpnconfiguration + } + return json.Marshal(objectMap) +} + // APICollection paged Api list representation. type APICollection struct { autorest.Response `json:"-"` @@ -516,10 +161,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), @@ -547,11 +197,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 } @@ -608,6 +263,36 @@ type APIContract struct { Type APITypeContract `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for APIContract. +func (ac APIContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ac.Name != nil { + objectMap["name"] = ac.Name + } + if ac.Description != nil { + objectMap["description"] = ac.Description + } + if ac.ServiceURL != nil { + objectMap["serviceUrl"] = ac.ServiceURL + } + if ac.Path != nil { + objectMap["path"] = ac.Path + } + if ac.Protocols != nil { + objectMap["protocols"] = ac.Protocols + } + if ac.AuthenticationSettings != nil { + objectMap["authenticationSettings"] = ac.AuthenticationSettings + } + if ac.SubscriptionKeyParameterNames != nil { + objectMap["subscriptionKeyParameterNames"] = ac.SubscriptionKeyParameterNames + } + if ac.Type != "" { + objectMap["type"] = ac.Type + } + return json.Marshal(objectMap) +} + // APIExportResult the response model for the export API output operation. type APIExportResult struct { autorest.Response `json:"-"` @@ -703,10 +388,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), @@ -734,11 +424,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 } @@ -851,10 +546,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), @@ -882,11 +582,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 } @@ -928,8 +633,8 @@ type BackendContract struct { SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` } -// BackendResponse the Backend entity in API Management represents a backend service that is configured to -// skip certification chain validation when using a self-signed certificate to test mutual certificate +// BackendResponse the Backend entity in API Management represents a backend service that is configured to skip +// certification chain validation when using a self-signed certificate to test mutual certificate // authentication. type BackendResponse struct { autorest.Response `json:"-"` @@ -941,6 +646,18 @@ type BackendResponse struct { SkipCertificateChainValidation *bool `json:"skipCertificateChainValidation,omitempty"` } +// MarshalJSON is the custom marshaler for BackendResponse. +func (br BackendResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if br.Host != nil { + objectMap["host"] = br.Host + } + if br.SkipCertificateChainValidation != nil { + objectMap["skipCertificateChainValidation"] = br.SkipCertificateChainValidation + } + return json.Marshal(objectMap) +} + // BackendUpdateParameters parameters supplied to the Update Backend operation. type BackendUpdateParameters struct { // Host - Host attribute of the backend. Host is a pure hostname without a port or suffix, for example backend.contoso.com. Must not be empty. @@ -1028,10 +745,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), @@ -1059,11 +781,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 } @@ -1110,6 +837,21 @@ type CertificateContract struct { ExpirationDate *date.Time `json:"expirationDate,omitempty"` } +// MarshalJSON is the custom marshaler for CertificateContract. +func (cc CertificateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.Subject != nil { + objectMap["subject"] = cc.Subject + } + if cc.Thumbprint != nil { + objectMap["thumbprint"] = cc.Thumbprint + } + if cc.ExpirationDate != nil { + objectMap["expirationDate"] = cc.ExpirationDate + } + return json.Marshal(objectMap) +} + // CertificateCreateOrUpdateParameters parameters supplied to the CreateOrUpdate certificate operation. type CertificateCreateOrUpdateParameters struct { // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. @@ -1253,10 +995,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), @@ -1284,11 +1031,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 } @@ -1339,6 +1091,18 @@ 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.Name != nil { + objectMap["name"] = gc.Name + } + if gc.Description != nil { + objectMap["description"] = gc.Description + } + return json.Marshal(objectMap) +} + // GroupCreateParameters parameters supplied to the Create Group operation. type GroupCreateParameters struct { // Name - Group name. @@ -1373,9 +1137,9 @@ type HostnameConfiguration struct { Certificate *CertificateInformation `json:"certificate,omitempty"` } -// IdentityProviderContract 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. +// IdentityProviderContract 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 IdentityProviderContract struct { autorest.Response `json:"-"` // 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. @@ -1496,10 +1260,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), @@ -1527,11 +1296,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 } @@ -1596,8 +1370,7 @@ func (lcp LoggerCreateParameters) MarshalJSON() ([]byte, error) { } // LoggerResponse 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. +// Management events. Currently the Logger entity supports logging API Management events to Azure Event Hubs. type LoggerResponse struct { autorest.Response `json:"-"` // ID - READ-ONLY; Uniquely identifies the logger within the current API Management service instance. The value is a valid relative URL in the format of /loggers/{loggerId} where {loggerId} is a logger identifier. @@ -1707,6 +1480,60 @@ type OAuth2AuthorizationServerContract struct { ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` } +// MarshalJSON is the custom marshaler for OAuth2AuthorizationServerContract. +func (oa2asc OAuth2AuthorizationServerContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oa2asc.Name != nil { + objectMap["name"] = oa2asc.Name + } + if oa2asc.Description != nil { + objectMap["description"] = oa2asc.Description + } + if oa2asc.ClientRegistrationEndpoint != nil { + objectMap["clientRegistrationEndpoint"] = oa2asc.ClientRegistrationEndpoint + } + if oa2asc.AuthorizationEndpoint != nil { + objectMap["authorizationEndpoint"] = oa2asc.AuthorizationEndpoint + } + if oa2asc.AuthorizationMethods != nil { + objectMap["authorizationMethods"] = oa2asc.AuthorizationMethods + } + if oa2asc.ClientAuthenticationMethod != nil { + objectMap["clientAuthenticationMethod"] = oa2asc.ClientAuthenticationMethod + } + if oa2asc.TokenBodyParameters != nil { + objectMap["tokenBodyParameters"] = oa2asc.TokenBodyParameters + } + if oa2asc.TokenEndpoint != nil { + objectMap["tokenEndpoint"] = oa2asc.TokenEndpoint + } + if oa2asc.SupportState != nil { + objectMap["supportState"] = oa2asc.SupportState + } + if oa2asc.DefaultScope != nil { + objectMap["defaultScope"] = oa2asc.DefaultScope + } + if oa2asc.GrantTypes != nil { + objectMap["grantTypes"] = oa2asc.GrantTypes + } + if oa2asc.BearerTokenSendingMethods != nil { + objectMap["bearerTokenSendingMethods"] = oa2asc.BearerTokenSendingMethods + } + if oa2asc.ClientID != nil { + objectMap["clientId"] = oa2asc.ClientID + } + if oa2asc.ClientSecret != nil { + objectMap["clientSecret"] = oa2asc.ClientSecret + } + if oa2asc.ResourceOwnerUsername != nil { + objectMap["resourceOwnerUsername"] = oa2asc.ResourceOwnerUsername + } + if oa2asc.ResourceOwnerPassword != nil { + objectMap["resourceOwnerPassword"] = oa2asc.ResourceOwnerPassword + } + return json.Marshal(objectMap) +} + // OAuth2AuthorizationServerUpdateContract external OAuth authorization server Update settings contract. type OAuth2AuthorizationServerUpdateContract struct { // Name - User-friendly authorization server name. @@ -1823,10 +1650,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), @@ -1854,11 +1686,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 } @@ -2016,10 +1853,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), @@ -2047,11 +1889,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 } @@ -2106,6 +1953,33 @@ type OperationContract struct { Responses *[]ResultContract `json:"responses,omitempty"` } +// MarshalJSON is the custom marshaler for OperationContract. +func (oc OperationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oc.Name != nil { + objectMap["name"] = oc.Name + } + if oc.Method != nil { + objectMap["method"] = oc.Method + } + if oc.URLTemplate != nil { + objectMap["urlTemplate"] = oc.URLTemplate + } + if oc.TemplateParameters != nil { + objectMap["templateParameters"] = oc.TemplateParameters + } + if oc.Description != nil { + objectMap["description"] = oc.Description + } + if oc.Request != nil { + objectMap["request"] = oc.Request + } + if oc.Responses != nil { + objectMap["responses"] = oc.Responses + } + return json.Marshal(objectMap) +} + // OperationResultContract operation Result. type OperationResultContract struct { autorest.Response `json:"-"` @@ -2235,10 +2109,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), @@ -2266,11 +2145,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 } @@ -2317,14 +2201,41 @@ 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 ProductStateContract `json:"state,omitempty"` } +// MarshalJSON is the custom marshaler for ProductContract. +func (pc ProductContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Description != nil { + objectMap["description"] = pc.Description + } + if pc.Terms != nil { + objectMap["terms"] = pc.Terms + } + if pc.SubscriptionRequired != nil { + objectMap["subscriptionRequired"] = pc.SubscriptionRequired + } + if pc.ApprovalRequired != nil { + objectMap["approvalRequired"] = pc.ApprovalRequired + } + if pc.SubscriptionsLimit != nil { + objectMap["subscriptionsLimit"] = pc.SubscriptionsLimit + } + if pc.State != "" { + objectMap["state"] = pc.State + } + return json.Marshal(objectMap) +} + // ProductUpdateParameters parameters supplied to the CreateOrUpdate Product operation. type ProductUpdateParameters struct { // Name - Product name. @@ -2335,9 +2246,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. Possible values include: 'NotPublished', 'Published' State ProductStateContract `json:"state,omitempty"` @@ -2422,10 +2333,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), @@ -2453,11 +2369,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 } @@ -2506,6 +2427,24 @@ type PropertyContract struct { Secret *bool `json:"secret,omitempty"` } +// MarshalJSON is the custom marshaler for PropertyContract. +func (pc PropertyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Name != nil { + objectMap["name"] = pc.Name + } + if pc.Value != nil { + objectMap["value"] = pc.Value + } + if pc.Tags != nil { + objectMap["tags"] = pc.Tags + } + if pc.Secret != nil { + objectMap["secret"] = pc.Secret + } + return json.Marshal(objectMap) +} + // PropertyCreateParameters parameters supplied to the Create Property operation. type PropertyCreateParameters struct { // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. @@ -2660,10 +2599,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), @@ -2691,11 +2635,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 } @@ -2785,6 +2734,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. @@ -2993,10 +3020,15 @@ func (slr ServiceListResult) IsEmpty() bool { return slr.Value == nil || len(*slr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (slr ServiceListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + // serviceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { - if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + if !slr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3024,11 +3056,16 @@ func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.slr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.slr = next return nil } @@ -3197,8 +3234,7 @@ func (sr ServiceResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ServicesBackupFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServicesBackupFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ServicesBackupFuture struct { azure.Future } @@ -3234,8 +3270,8 @@ type ServiceSkuProperties struct { Capacity *int32 `json:"capacity,omitempty"` } -// ServicesManageDeploymentsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// ServicesManageDeploymentsFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type ServicesManageDeploymentsFuture struct { azure.Future } @@ -3263,8 +3299,7 @@ func (future *ServicesManageDeploymentsFuture) Result(client ServicesClient) (sr return } -// ServicesRestoreFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServicesRestoreFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ServicesRestoreFuture struct { azure.Future } @@ -3292,8 +3327,7 @@ func (future *ServicesRestoreFuture) Result(client ServicesClient) (sr ServiceRe return } -// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ServicesUpdateFuture struct { azure.Future } @@ -3358,8 +3392,8 @@ type ServiceUpdateHostnameParameters struct { Delete *[]HostnameType `json:"delete,omitempty"` } -// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API -// Management service operation. +// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API Management +// service operation. type ServiceUploadCertificateParameters struct { // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' Type HostnameType `json:"type,omitempty"` @@ -3454,10 +3488,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), @@ -3485,11 +3524,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 } @@ -3554,6 +3598,45 @@ 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.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) +} + // 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} @@ -3598,8 +3681,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 } @@ -3675,8 +3758,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 } @@ -3804,10 +3887,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), @@ -3835,11 +3923,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 } @@ -3894,6 +3987,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.State != "" { + objectMap["state"] = uc.State + } + if uc.RegistrationDate != nil { + objectMap["registrationDate"] = uc.RegistrationDate + } + if uc.Note != nil { + objectMap["note"] = uc.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. @@ -3934,8 +4054,7 @@ type UserUpdateParameters struct { Note *string `json:"note,omitempty"` } -// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is -// deployed. +// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is deployed. type VirtualNetworkConfiguration struct { // Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default. Vnetid *string `json:"vnetid,omitempty"` @@ -3946,3 +4065,15 @@ type VirtualNetworkConfiguration struct { // Location - The location of the virtual network. Location *string `json:"location,omitempty"` } + +// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration. +func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnc.SubnetResourceID != nil { + objectMap["subnetResourceId"] = vnc.SubnetResourceID + } + if vnc.Location != nil { + objectMap["location"] = vnc.Location + } + return json.Marshal(objectMap) +} diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/openidconnectproviders.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/openidconnectproviders.go index 564386b7caeb..180ca23ee803 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/openidconnectproviders.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/openidconnectproviders.go @@ -124,8 +124,7 @@ func (client OpenIDConnectProvidersClient) CreateOrUpdatePreparer(ctx context.Co // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProvidersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -133,7 +132,6 @@ func (client OpenIDConnectProvidersClient) CreateOrUpdateSender(req *http.Reques func (client OpenIDConnectProvidersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -213,8 +211,7 @@ func (client OpenIDConnectProvidersClient) DeletePreparer(ctx context.Context, r // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProvidersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -222,7 +219,6 @@ func (client OpenIDConnectProvidersClient) DeleteSender(req *http.Request) (*htt func (client OpenIDConnectProvidersClient) DeleteResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -300,8 +296,7 @@ func (client OpenIDConnectProvidersClient) GetPreparer(ctx context.Context, reso // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProvidersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -309,7 +304,6 @@ func (client OpenIDConnectProvidersClient) GetSender(req *http.Request) (*http.R func (client OpenIDConnectProvidersClient) GetResponder(resp *http.Response) (result OpenidConnectProviderContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -370,6 +364,9 @@ func (client OpenIDConnectProvidersClient) ListByService(ctx context.Context, re if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProvidersClient", "ListByService", resp, "Failure responding to request") } + if result.oicpc.hasNextLink() && result.oicpc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -407,8 +404,7 @@ func (client OpenIDConnectProvidersClient) ListByServicePreparer(ctx context.Con // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProvidersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -416,7 +412,6 @@ func (client OpenIDConnectProvidersClient) ListByServiceSender(req *http.Request func (client OpenIDConnectProvidersClient) ListByServiceResponder(resp *http.Response) (result OpenIDConnectProviderCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -537,8 +532,7 @@ func (client OpenIDConnectProvidersClient) UpdatePreparer(ctx context.Context, r // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client OpenIDConnectProvidersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -546,7 +540,6 @@ func (client OpenIDConnectProvidersClient) UpdateSender(req *http.Request) (*htt func (client OpenIDConnectProvidersClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/policysnippets.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/policysnippets.go index 2adeff9d6110..3c0a3c4c1293 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/policysnippets.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/policysnippets.go @@ -114,8 +114,7 @@ func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, re // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client PolicySnippetsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -123,7 +122,6 @@ func (client PolicySnippetsClient) ListByServiceSender(req *http.Request) (*http func (client PolicySnippetsClient) ListByServiceResponder(resp *http.Response) (result ListPolicySnippetContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/productapis.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/productapis.go index 23aca961b6f9..7bca90e1ba1e 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/productapis.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/productapis.go @@ -122,8 +122,7 @@ func (client ProductApisClient) AddPreparer(ctx context.Context, resourceGroupNa // AddSender sends the Add request. The method will close the // http.Response Body if it receives an error. func (client ProductApisClient) AddSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // AddResponder handles the response to the Add request. The method always @@ -131,7 +130,6 @@ func (client ProductApisClient) AddSender(req *http.Request) (*http.Response, er func (client ProductApisClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -199,6 +197,9 @@ func (client ProductApisClient) ListByProduct(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductApisClient", "ListByProduct", resp, "Failure responding to request") } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -237,8 +238,7 @@ func (client ProductApisClient) ListByProductPreparer(ctx context.Context, resou // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductApisClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -246,7 +246,6 @@ func (client ProductApisClient) ListByProductSender(req *http.Request) (*http.Re func (client ProductApisClient) ListByProductResponder(resp *http.Response) (result APICollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -371,8 +370,7 @@ func (client ProductApisClient) RemovePreparer(ctx context.Context, resourceGrou // RemoveSender sends the Remove request. The method will close the // http.Response Body if it receives an error. func (client ProductApisClient) RemoveSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RemoveResponder handles the response to the Remove request. The method always @@ -380,7 +378,6 @@ func (client ProductApisClient) RemoveSender(req *http.Request) (*http.Response, func (client ProductApisClient) RemoveResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/productgroups.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/productgroups.go index 00941ab76055..c072b6335f5f 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/productgroups.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/productgroups.go @@ -122,8 +122,7 @@ func (client ProductGroupsClient) AddPreparer(ctx context.Context, resourceGroup // AddSender sends the Add request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupsClient) AddSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // AddResponder handles the response to the Add request. The method always @@ -131,7 +130,6 @@ func (client ProductGroupsClient) AddSender(req *http.Request) (*http.Response, func (client ProductGroupsClient) AddResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -198,6 +196,9 @@ func (client ProductGroupsClient) ListByProduct(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductGroupsClient", "ListByProduct", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -236,8 +237,7 @@ func (client ProductGroupsClient) ListByProductPreparer(ctx context.Context, res // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupsClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -245,7 +245,6 @@ func (client ProductGroupsClient) ListByProductSender(req *http.Request) (*http. func (client ProductGroupsClient) ListByProductResponder(resp *http.Response) (result GroupCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -370,8 +369,7 @@ func (client ProductGroupsClient) RemovePreparer(ctx context.Context, resourceGr // RemoveSender sends the Remove request. The method will close the // http.Response Body if it receives an error. func (client ProductGroupsClient) RemoveSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RemoveResponder handles the response to the Remove request. The method always @@ -379,7 +377,6 @@ func (client ProductGroupsClient) RemoveSender(req *http.Request) (*http.Respons func (client ProductGroupsClient) RemoveResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/products.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/products.go index 3873cc70eb59..19c22da669b9 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/products.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/products.go @@ -129,8 +129,7 @@ func (client ProductsClient) CreateOrUpdatePreparer(ctx context.Context, resourc // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ProductsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -138,7 +137,6 @@ func (client ProductsClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client ProductsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -226,8 +224,7 @@ func (client ProductsClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ProductsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -235,7 +232,6 @@ func (client ProductsClient) DeleteSender(req *http.Request) (*http.Response, er func (client ProductsClient) 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 @@ -316,8 +312,7 @@ func (client ProductsClient) GetPreparer(ctx context.Context, resourceGroupName // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ProductsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -325,7 +320,6 @@ func (client ProductsClient) GetSender(req *http.Request) (*http.Response, error func (client ProductsClient) GetResponder(resp *http.Response) (result ProductContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -391,6 +385,9 @@ func (client ProductsClient) ListByService(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductsClient", "ListByService", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -431,8 +428,7 @@ func (client ProductsClient) ListByServicePreparer(ctx context.Context, resource // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client ProductsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -440,7 +436,6 @@ func (client ProductsClient) ListByServiceSender(req *http.Request) (*http.Respo func (client ProductsClient) ListByServiceResponder(resp *http.Response) (result ProductCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -565,8 +560,7 @@ func (client ProductsClient) UpdatePreparer(ctx context.Context, resourceGroupNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ProductsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -574,7 +568,6 @@ func (client ProductsClient) UpdateSender(req *http.Request) (*http.Response, er func (client ProductsClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/productsubscriptions.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/productsubscriptions.go index dea329eb026b..da5497cde38d 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/productsubscriptions.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/productsubscriptions.go @@ -105,6 +105,9 @@ func (client ProductSubscriptionsClient) ListByProduct(ctx context.Context, reso if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductSubscriptionsClient", "ListByProduct", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -143,8 +146,7 @@ func (client ProductSubscriptionsClient) ListByProductPreparer(ctx context.Conte // ListByProductSender sends the ListByProduct request. The method will close the // http.Response Body if it receives an error. func (client ProductSubscriptionsClient) ListByProductSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByProductResponder handles the response to the ListByProduct request. The method always @@ -152,7 +154,6 @@ func (client ProductSubscriptionsClient) ListByProductSender(req *http.Request) func (client ProductSubscriptionsClient) ListByProductResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/property.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go index 428f8534bdd8..65c7b111573e 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go @@ -130,8 +130,7 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourc // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -139,7 +138,6 @@ func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -219,8 +217,7 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupNa // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -228,7 +225,6 @@ func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, er func (client PropertyClient) DeleteResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -306,8 +302,7 @@ func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -315,7 +310,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()) @@ -376,6 +370,9 @@ func (client PropertyClient) ListByService(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure responding to request") } + if result.pc.hasNextLink() && result.pc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -413,8 +410,7 @@ func (client PropertyClient) ListByServicePreparer(ctx context.Context, resource // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client PropertyClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -422,7 +418,6 @@ func (client PropertyClient) ListByServiceSender(req *http.Request) (*http.Respo func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result PropertyCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -543,8 +538,7 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupNa // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -552,7 +546,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/apimanagement/mgmt/2016-07-07/apimanagement/quotabycounterkeys.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabycounterkeys.go index 77b52ce054b1..c2eddc1f66dc 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabycounterkeys.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabycounterkeys.go @@ -114,8 +114,7 @@ func (client QuotaByCounterKeysClient) ListByServicePreparer(ctx context.Context // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client QuotaByCounterKeysClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -123,7 +122,6 @@ func (client QuotaByCounterKeysClient) ListByServiceSender(req *http.Request) (* func (client QuotaByCounterKeysClient) ListByServiceResponder(resp *http.Response) (result QuotaCounterCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -205,8 +203,7 @@ func (client QuotaByCounterKeysClient) UpdatePreparer(ctx context.Context, resou // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -214,7 +211,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/apimanagement/mgmt/2016-07-07/apimanagement/quotabyperiodkeys.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabyperiodkeys.go index 711ef44e715a..7bd28ec76d7d 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabyperiodkeys.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/quotabyperiodkeys.go @@ -116,8 +116,7 @@ func (client QuotaByPeriodKeysClient) GetPreparer(ctx context.Context, resourceG // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -125,7 +124,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()) @@ -208,8 +206,7 @@ func (client QuotaByPeriodKeysClient) UpdatePreparer(ctx context.Context, resour // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -217,7 +214,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/apimanagement/mgmt/2016-07-07/apimanagement/regions.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/regions.go index 453f663e2f01..e0aa19061189 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/regions.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/regions.go @@ -110,8 +110,7 @@ func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceG // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client RegionsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -119,7 +118,6 @@ func (client RegionsClient) ListByServiceSender(req *http.Request) (*http.Respon func (client RegionsClient) ListByServiceResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/reports.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go index b80b2adc66df..488ea40b03d2 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go @@ -97,6 +97,9 @@ func (client ReportsClient) ListByService(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByService", resp, "Failure responding to request") } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -138,8 +141,7 @@ func (client ReportsClient) ListByServicePreparer(ctx context.Context, resourceG // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client ReportsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -147,7 +149,6 @@ func (client ReportsClient) ListByServiceSender(req *http.Request) (*http.Respon func (client ReportsClient) ListByServiceResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/services.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/services.go index b89ee26d490f..8acfd993aabe 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/services.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/services.go @@ -113,9 +113,8 @@ func (client ServicesClient) BackupPreparer(ctx context.Context, resourceGroupNa // BackupSender sends the Backup request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) BackupSender(req *http.Request) (future ServicesBackupFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -128,7 +127,6 @@ func (client ServicesClient) BackupSender(req *http.Request) (future ServicesBac func (client ServicesClient) BackupResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -201,8 +199,7 @@ func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, // CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always @@ -210,7 +207,6 @@ func (client ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*ht func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) (result ServiceNameAvailabilityResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -295,8 +291,7 @@ func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourc // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -304,7 +299,6 @@ func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Resp func (client ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -380,8 +374,7 @@ func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -389,7 +382,6 @@ func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, er func (client ServicesClient) DeleteResponder(resp *http.Response) (result ErrorResponse, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -465,8 +457,7 @@ func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -474,7 +465,6 @@ func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error func (client ServicesClient) GetResponder(resp *http.Response) (result SetObject, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) @@ -550,8 +540,7 @@ func (client ServicesClient) GetSsoTokenPreparer(ctx context.Context, resourceGr // GetSsoTokenSender sends the GetSsoToken request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) GetSsoTokenSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetSsoTokenResponder handles the response to the GetSsoToken request. The method always @@ -559,7 +548,6 @@ func (client ServicesClient) GetSsoTokenSender(req *http.Request) (*http.Respons func (client ServicesClient) GetSsoTokenResponder(resp *http.Response) (result ServiceGetSsoTokenResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -597,6 +585,9 @@ func (client ServicesClient) List(ctx context.Context) (result ServiceListResult if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ServicesClient", "List", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -623,8 +614,7 @@ func (client ServicesClient) ListPreparer(ctx context.Context) (*http.Request, e // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -632,7 +622,6 @@ func (client ServicesClient) ListSender(req *http.Request) (*http.Response, erro func (client ServicesClient) ListResponder(resp *http.Response) (result ServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -709,6 +698,9 @@ func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -736,8 +728,7 @@ func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, re // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -745,7 +736,6 @@ func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -859,9 +849,8 @@ func (client ServicesClient) ManageDeploymentsPreparer(ctx context.Context, reso // ManageDeploymentsSender sends the ManageDeployments request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) ManageDeploymentsSender(req *http.Request) (future ServicesManageDeploymentsFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -874,7 +863,6 @@ func (client ServicesClient) ManageDeploymentsSender(req *http.Request) (future func (client ServicesClient) ManageDeploymentsResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -953,9 +941,8 @@ func (client ServicesClient) RestorePreparer(ctx context.Context, resourceGroupN // RestoreSender sends the Restore request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) RestoreSender(req *http.Request) (future ServicesRestoreFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -968,7 +955,6 @@ func (client ServicesClient) RestoreSender(req *http.Request) (future ServicesRe func (client ServicesClient) RestoreResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1041,9 +1027,8 @@ func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) UpdateSender(req *http.Request) (future ServicesUpdateFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -1056,7 +1041,6 @@ func (client ServicesClient) UpdateSender(req *http.Request) (future ServicesUpd func (client ServicesClient) UpdateResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1131,9 +1115,8 @@ func (client ServicesClient) UpdateHostnamePreparer(ctx context.Context, resourc // UpdateHostnameSender sends the UpdateHostname request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) UpdateHostnameSender(req *http.Request) (future ServicesUpdateHostnameFuture, err error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -1146,7 +1129,6 @@ func (client ServicesClient) UpdateHostnameSender(req *http.Request) (future Ser func (client ServicesClient) UpdateHostnameResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1228,8 +1210,7 @@ func (client ServicesClient) UploadCertificatePreparer(ctx context.Context, reso // UploadCertificateSender sends the UploadCertificate request. The method will close the // http.Response Body if it receives an error. func (client ServicesClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UploadCertificateResponder handles the response to the UploadCertificate request. The method always @@ -1237,7 +1218,6 @@ func (client ServicesClient) UploadCertificateSender(req *http.Request) (*http.R func (client ServicesClient) UploadCertificateResponder(resp *http.Response) (result CertificateInformation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go index 77c0bb2bba89..2d3794bbeac0 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go @@ -134,8 +134,7 @@ func (client SubscriptionsClient) CreateOrUpdatePreparer(ctx context.Context, re // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -143,7 +142,6 @@ func (client SubscriptionsClient) CreateOrUpdateSender(req *http.Request) (*http func (client SubscriptionsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -223,8 +221,7 @@ func (client SubscriptionsClient) DeletePreparer(ctx context.Context, resourceGr // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -232,7 +229,6 @@ func (client SubscriptionsClient) DeleteSender(req *http.Request) (*http.Respons func (client SubscriptionsClient) 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 SubscriptionsClient) GetPreparer(ctx context.Context, resourceGroup // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -318,7 +313,6 @@ func (client SubscriptionsClient) GetSender(req *http.Request) (*http.Response, func (client SubscriptionsClient) GetResponder(resp *http.Response) (result SubscriptionContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -383,6 +377,9 @@ func (client SubscriptionsClient) ListByService(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionsClient", "ListByService", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -420,8 +417,7 @@ func (client SubscriptionsClient) ListByServicePreparer(ctx context.Context, res // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -429,7 +425,6 @@ func (client SubscriptionsClient) ListByServiceSender(req *http.Request) (*http. func (client SubscriptionsClient) ListByServiceResponder(resp *http.Response) (result SubscriptionCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -544,8 +539,7 @@ func (client SubscriptionsClient) RegeneratePrimaryKeyPreparer(ctx context.Conte // RegeneratePrimaryKeySender sends the RegeneratePrimaryKey request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) RegeneratePrimaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -553,7 +547,6 @@ func (client SubscriptionsClient) RegeneratePrimaryKeySender(req *http.Request) func (client SubscriptionsClient) 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 @@ -630,8 +623,7 @@ func (client SubscriptionsClient) RegenerateSecondaryKeyPreparer(ctx context.Con // RegenerateSecondaryKeySender sends the RegenerateSecondaryKey request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) RegenerateSecondaryKeySender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -639,7 +631,6 @@ func (client SubscriptionsClient) RegenerateSecondaryKeySender(req *http.Request func (client SubscriptionsClient) 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 @@ -722,8 +713,7 @@ func (client SubscriptionsClient) UpdatePreparer(ctx context.Context, resourceGr // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client SubscriptionsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -731,7 +721,6 @@ func (client SubscriptionsClient) UpdateSender(req *http.Request) (*http.Respons func (client SubscriptionsClient) 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/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccess.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccess.go index bd7b01cecda6..1ddf628ce981 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccess.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccess.go @@ -110,8 +110,7 @@ func (client TenantAccessClient) GetPreparer(ctx context.Context, resourceGroupN // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -119,7 +118,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()) @@ -195,8 +193,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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -204,7 +201,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 @@ -279,8 +275,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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -288,7 +283,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 @@ -369,8 +363,7 @@ func (client TenantAccessClient) UpdatePreparer(ctx context.Context, resourceGro // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -378,7 +371,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.StatusCreated), autorest.ByClosing()) result.Response = resp diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccessgit.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccessgit.go index 83241cc57112..762c48b377e6 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccessgit.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantaccessgit.go @@ -110,8 +110,7 @@ func (client TenantAccessGitClient) GetPreparer(ctx context.Context, resourceGro // 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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -119,7 +118,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()) @@ -195,8 +193,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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegeneratePrimaryKeyResponder handles the response to the RegeneratePrimaryKey request. The method always @@ -204,7 +201,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 @@ -279,8 +275,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(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // RegenerateSecondaryKeyResponder handles the response to the RegenerateSecondaryKey request. The method always @@ -288,7 +283,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/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfiguration.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfiguration.go index 95eefc940f91..6e5a5fc216f5 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfiguration.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfiguration.go @@ -111,9 +111,8 @@ func (client TenantConfigurationClient) DeployPreparer(ctx context.Context, reso // 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(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -126,7 +125,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), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -202,9 +200,8 @@ func (client TenantConfigurationClient) SavePreparer(ctx context.Context, resour // 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(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -217,7 +214,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), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -293,9 +289,8 @@ func (client TenantConfigurationClient) ValidatePreparer(ctx context.Context, re // 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(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response - resp, err = autorest.SendWithSender(client, req, sd...) + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return } @@ -308,7 +303,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), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfigurationsyncstate.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfigurationsyncstate.go index 4df4c234aee2..67fd6af2b6cd 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfigurationsyncstate.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/tenantconfigurationsyncstate.go @@ -111,8 +111,7 @@ func (client TenantConfigurationSyncStateClient) GetPreparer(ctx context.Context // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client TenantConfigurationSyncStateClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -120,7 +119,6 @@ func (client TenantConfigurationSyncStateClient) GetSender(req *http.Request) (* func (client TenantConfigurationSyncStateClient) GetResponder(resp *http.Response) (result TenantConfigurationSyncStateContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/usergroups.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/usergroups.go index c5f439e9d98f..d8836772fc0c 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/usergroups.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/usergroups.go @@ -101,6 +101,9 @@ func (client UserGroupsClient) ListByUser(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserGroupsClient", "ListByUser", resp, "Failure responding to request") } + if result.gc.hasNextLink() && result.gc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -139,8 +142,7 @@ func (client UserGroupsClient) ListByUserPreparer(ctx context.Context, resourceG // ListByUserSender sends the ListByUser request. The method will close the // http.Response Body if it receives an error. func (client UserGroupsClient) ListByUserSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByUserResponder handles the response to the ListByUser request. The method always @@ -148,7 +150,6 @@ func (client UserGroupsClient) ListByUserSender(req *http.Request) (*http.Respon func (client UserGroupsClient) ListByUserResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/useridentities.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/useridentities.go index e806f6326d91..f54f8be26983 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/useridentities.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/useridentities.go @@ -116,8 +116,7 @@ func (client UserIdentitiesClient) ListByUserPreparer(ctx context.Context, resou // ListByUserSender sends the ListByUser request. The method will close the // http.Response Body if it receives an error. func (client UserIdentitiesClient) ListByUserSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByUserResponder handles the response to the ListByUser request. The method always @@ -125,7 +124,6 @@ func (client UserIdentitiesClient) ListByUserSender(req *http.Request) (*http.Re func (client UserIdentitiesClient) ListByUserResponder(resp *http.Response) (result ListUserIdentityContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/users.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/users.go index 328d84e1485a..339901a84e39 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/users.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/users.go @@ -133,8 +133,7 @@ func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -142,7 +141,6 @@ func (client UsersClient) CreateOrUpdateSender(req *http.Request) (*http.Respons func (client UsersClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -230,8 +228,7 @@ func (client UsersClient) DeletePreparer(ctx context.Context, resourceGroupName // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -239,7 +236,6 @@ func (client UsersClient) DeleteSender(req *http.Request) (*http.Response, error func (client UsersClient) DeleteResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -322,8 +318,7 @@ func (client UsersClient) GenerateSsoURLPreparer(ctx context.Context, resourceGr // GenerateSsoURLSender sends the GenerateSsoURL request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) GenerateSsoURLSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GenerateSsoURLResponder handles the response to the GenerateSsoURL request. The method always @@ -331,7 +326,6 @@ func (client UsersClient) GenerateSsoURLSender(req *http.Request) (*http.Respons func (client UsersClient) GenerateSsoURLResponder(resp *http.Response) (result GenerateSsoURLResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -413,8 +407,7 @@ func (client UsersClient) GetPreparer(ctx context.Context, resourceGroupName str // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -422,7 +415,6 @@ func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) { func (client UsersClient) GetResponder(resp *http.Response) (result UserContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -488,6 +480,9 @@ func (client UsersClient) ListByService(ctx context.Context, resourceGroupName s if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UsersClient", "ListByService", resp, "Failure responding to request") } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -525,8 +520,7 @@ func (client UsersClient) ListByServicePreparer(ctx context.Context, resourceGro // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always @@ -534,7 +528,6 @@ func (client UsersClient) ListByServiceSender(req *http.Request) (*http.Response func (client UsersClient) ListByServiceResponder(resp *http.Response) (result UserCollection, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -659,8 +652,7 @@ func (client UsersClient) UpdatePreparer(ctx context.Context, resourceGroupName // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client UsersClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always @@ -668,7 +660,6 @@ func (client UsersClient) UpdateSender(req *http.Request) (*http.Response, error func (client UsersClient) UpdateResponder(resp *http.Response) (result ErrorBodyContract, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusMethodNotAllowed), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/usersubscriptions.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/usersubscriptions.go index 21a5b62cb6d5..c2440706b89f 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/usersubscriptions.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/usersubscriptions.go @@ -105,6 +105,9 @@ func (client UserSubscriptionsClient) ListByUser(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionsClient", "ListByUser", resp, "Failure responding to request") } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -143,8 +146,7 @@ func (client UserSubscriptionsClient) ListByUserPreparer(ctx context.Context, re // ListByUserSender sends the ListByUser request. The method will close the // http.Response Body if it receives an error. func (client UserSubscriptionsClient) ListByUserSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByUserResponder handles the response to the ListByUser request. The method always @@ -152,7 +154,6 @@ func (client UserSubscriptionsClient) ListByUserSender(req *http.Request) (*http func (client UserSubscriptionsClient) ListByUserResponder(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/apimanagement/mgmt/2016-07-07/apimanagement/version.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/version.go index 767f1a607e4f..52234ff8e361 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/version.go +++ b/services/apimanagement/mgmt/2016-07-07/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/2016-07-07" + return "Azure-SDK-For-Go/" + Version() + " apimanagement/2016-07-07" } // Version returns the semantic version (see http://semver.org) of the client.