1package apimanagement 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "net/http" 26) 27 28// BackendsClient is the apiManagement Client 29type BackendsClient struct { 30 BaseClient 31} 32 33// NewBackendsClient creates an instance of the BackendsClient client. 34func NewBackendsClient(subscriptionID string) BackendsClient { 35 return NewBackendsClientWithBaseURI(DefaultBaseURI, subscriptionID) 36} 37 38// NewBackendsClientWithBaseURI creates an instance of the BackendsClient client. 39func NewBackendsClientWithBaseURI(baseURI string, subscriptionID string) BackendsClient { 40 return BackendsClient{NewWithBaseURI(baseURI, subscriptionID)} 41} 42 43// CreateOrUpdate creates or Updates a backend. 44// Parameters: 45// resourceGroupName - the name of the resource group. 46// serviceName - the name of the API Management service. 47// backendid - user identifier. Must be unique in the current API Management service instance. 48// parameters - create parameters. 49func (client BackendsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract) (result autorest.Response, err error) { 50 if err := validation.Validate([]validation.Validation{ 51 {TargetValue: serviceName, 52 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 53 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 54 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 55 {TargetValue: backendid, 56 Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 255, Chain: nil}, 57 {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, 58 {Target: "backendid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, 59 {TargetValue: parameters, 60 Constraints: []validation.Constraint{{Target: "parameters.Host", Name: validation.Null, Rule: true, 61 Chain: []validation.Constraint{{Target: "parameters.Host", Name: validation.MaxLength, Rule: 255, Chain: nil}, 62 {Target: "parameters.Host", Name: validation.MinLength, Rule: 1, Chain: nil}, 63 }}}}}); err != nil { 64 return result, validation.NewError("apimanagement.BackendsClient", "CreateOrUpdate", err.Error()) 65 } 66 67 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters) 68 if err != nil { 69 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "CreateOrUpdate", nil, "Failure preparing request") 70 return 71 } 72 73 resp, err := client.CreateOrUpdateSender(req) 74 if err != nil { 75 result.Response = resp 76 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "CreateOrUpdate", resp, "Failure sending request") 77 return 78 } 79 80 result, err = client.CreateOrUpdateResponder(resp) 81 if err != nil { 82 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "CreateOrUpdate", resp, "Failure responding to request") 83 } 84 85 return 86} 87 88// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 89func (client BackendsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract) (*http.Request, error) { 90 pathParameters := map[string]interface{}{ 91 "backendid": autorest.Encode("path", backendid), 92 "resourceGroupName": autorest.Encode("path", resourceGroupName), 93 "serviceName": autorest.Encode("path", serviceName), 94 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 95 } 96 97 const APIVersion = "2016-07-07" 98 queryParameters := map[string]interface{}{ 99 "api-version": APIVersion, 100 } 101 102 preparer := autorest.CreatePreparer( 103 autorest.AsContentType("application/json; charset=utf-8"), 104 autorest.AsPut(), 105 autorest.WithBaseURL(client.BaseURI), 106 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), 107 autorest.WithJSON(parameters), 108 autorest.WithQueryParameters(queryParameters)) 109 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 110} 111 112// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 113// http.Response Body if it receives an error. 114func (client BackendsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { 115 return autorest.SendWithSender(client, req, 116 azure.DoRetryWithRegistration(client.Client)) 117} 118 119// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 120// closes the http.Response Body. 121func (client BackendsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) { 122 err = autorest.Respond( 123 resp, 124 client.ByInspecting(), 125 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent), 126 autorest.ByClosing()) 127 result.Response = resp 128 return 129} 130 131// Delete deletes the specified backend. 132// Parameters: 133// resourceGroupName - the name of the resource group. 134// serviceName - the name of the API Management service. 135// backendid - user identifier. Must be unique in the current API Management service instance. 136// ifMatch - the entity state (Etag) version of the backend to delete. A value of "*" can be used for If-Match 137// to unconditionally apply the operation. 138func (client BackendsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (result autorest.Response, err error) { 139 if err := validation.Validate([]validation.Validation{ 140 {TargetValue: serviceName, 141 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 142 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 143 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 144 {TargetValue: backendid, 145 Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 255, Chain: nil}, 146 {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, 147 {Target: "backendid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { 148 return result, validation.NewError("apimanagement.BackendsClient", "Delete", err.Error()) 149 } 150 151 req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendid, ifMatch) 152 if err != nil { 153 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Delete", nil, "Failure preparing request") 154 return 155 } 156 157 resp, err := client.DeleteSender(req) 158 if err != nil { 159 result.Response = resp 160 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Delete", resp, "Failure sending request") 161 return 162 } 163 164 result, err = client.DeleteResponder(resp) 165 if err != nil { 166 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Delete", resp, "Failure responding to request") 167 } 168 169 return 170} 171 172// DeletePreparer prepares the Delete request. 173func (client BackendsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (*http.Request, error) { 174 pathParameters := map[string]interface{}{ 175 "backendid": autorest.Encode("path", backendid), 176 "resourceGroupName": autorest.Encode("path", resourceGroupName), 177 "serviceName": autorest.Encode("path", serviceName), 178 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 179 } 180 181 const APIVersion = "2016-07-07" 182 queryParameters := map[string]interface{}{ 183 "api-version": APIVersion, 184 } 185 186 preparer := autorest.CreatePreparer( 187 autorest.AsDelete(), 188 autorest.WithBaseURL(client.BaseURI), 189 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), 190 autorest.WithQueryParameters(queryParameters), 191 autorest.WithHeader("If-Match", autorest.String(ifMatch))) 192 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 193} 194 195// DeleteSender sends the Delete request. The method will close the 196// http.Response Body if it receives an error. 197func (client BackendsClient) DeleteSender(req *http.Request) (*http.Response, error) { 198 return autorest.SendWithSender(client, req, 199 azure.DoRetryWithRegistration(client.Client)) 200} 201 202// DeleteResponder handles the response to the Delete request. The method always 203// closes the http.Response Body. 204func (client BackendsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 205 err = autorest.Respond( 206 resp, 207 client.ByInspecting(), 208 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 209 autorest.ByClosing()) 210 result.Response = resp 211 return 212} 213 214// Get gets the details of the backend specified by its identifier. 215// Parameters: 216// resourceGroupName - the name of the resource group. 217// serviceName - the name of the API Management service. 218// backendid - user identifier. Must be unique in the current API Management service instance. 219func (client BackendsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result BackendResponse, err error) { 220 if err := validation.Validate([]validation.Validation{ 221 {TargetValue: serviceName, 222 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 223 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 224 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 225 {TargetValue: backendid, 226 Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 255, Chain: nil}, 227 {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, 228 {Target: "backendid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { 229 return result, validation.NewError("apimanagement.BackendsClient", "Get", err.Error()) 230 } 231 232 req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendid) 233 if err != nil { 234 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Get", nil, "Failure preparing request") 235 return 236 } 237 238 resp, err := client.GetSender(req) 239 if err != nil { 240 result.Response = autorest.Response{Response: resp} 241 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Get", resp, "Failure sending request") 242 return 243 } 244 245 result, err = client.GetResponder(resp) 246 if err != nil { 247 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Get", resp, "Failure responding to request") 248 } 249 250 return 251} 252 253// GetPreparer prepares the Get request. 254func (client BackendsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { 255 pathParameters := map[string]interface{}{ 256 "backendid": autorest.Encode("path", backendid), 257 "resourceGroupName": autorest.Encode("path", resourceGroupName), 258 "serviceName": autorest.Encode("path", serviceName), 259 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 260 } 261 262 const APIVersion = "2016-07-07" 263 queryParameters := map[string]interface{}{ 264 "api-version": APIVersion, 265 } 266 267 preparer := autorest.CreatePreparer( 268 autorest.AsGet(), 269 autorest.WithBaseURL(client.BaseURI), 270 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), 271 autorest.WithQueryParameters(queryParameters)) 272 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 273} 274 275// GetSender sends the Get request. The method will close the 276// http.Response Body if it receives an error. 277func (client BackendsClient) GetSender(req *http.Request) (*http.Response, error) { 278 return autorest.SendWithSender(client, req, 279 azure.DoRetryWithRegistration(client.Client)) 280} 281 282// GetResponder handles the response to the Get request. The method always 283// closes the http.Response Body. 284func (client BackendsClient) GetResponder(resp *http.Response) (result BackendResponse, err error) { 285 err = autorest.Respond( 286 resp, 287 client.ByInspecting(), 288 azure.WithErrorUnlessStatusCode(http.StatusOK), 289 autorest.ByUnmarshallingJSON(&result), 290 autorest.ByClosing()) 291 result.Response = autorest.Response{Response: resp} 292 return 293} 294 295// ListByService lists a collection of backends in the specified service instance. 296// Parameters: 297// resourceGroupName - the name of the resource group. 298// serviceName - the name of the API Management service. 299// filter - | Field | Supported operators | Supported functions | 300// |-------|------------------------|---------------------------------------------| 301// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | 302// | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | 303// top - number of records to return. 304// skip - number of records to skip. 305func (client BackendsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionPage, err error) { 306 if err := validation.Validate([]validation.Validation{ 307 {TargetValue: serviceName, 308 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 309 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 310 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 311 {TargetValue: top, 312 Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, 313 Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}}}}}, 314 {TargetValue: skip, 315 Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, 316 Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { 317 return result, validation.NewError("apimanagement.BackendsClient", "ListByService", err.Error()) 318 } 319 320 result.fn = client.listByServiceNextResults 321 req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) 322 if err != nil { 323 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "ListByService", nil, "Failure preparing request") 324 return 325 } 326 327 resp, err := client.ListByServiceSender(req) 328 if err != nil { 329 result.bc.Response = autorest.Response{Response: resp} 330 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "ListByService", resp, "Failure sending request") 331 return 332 } 333 334 result.bc, err = client.ListByServiceResponder(resp) 335 if err != nil { 336 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "ListByService", resp, "Failure responding to request") 337 } 338 339 return 340} 341 342// ListByServicePreparer prepares the ListByService request. 343func (client BackendsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { 344 pathParameters := map[string]interface{}{ 345 "resourceGroupName": autorest.Encode("path", resourceGroupName), 346 "serviceName": autorest.Encode("path", serviceName), 347 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 348 } 349 350 const APIVersion = "2016-07-07" 351 queryParameters := map[string]interface{}{ 352 "api-version": APIVersion, 353 } 354 if len(filter) > 0 { 355 queryParameters["$filter"] = autorest.Encode("query", filter) 356 } 357 if top != nil { 358 queryParameters["$top"] = autorest.Encode("query", *top) 359 } 360 if skip != nil { 361 queryParameters["$skip"] = autorest.Encode("query", *skip) 362 } 363 364 preparer := autorest.CreatePreparer( 365 autorest.AsGet(), 366 autorest.WithBaseURL(client.BaseURI), 367 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends", pathParameters), 368 autorest.WithQueryParameters(queryParameters)) 369 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 370} 371 372// ListByServiceSender sends the ListByService request. The method will close the 373// http.Response Body if it receives an error. 374func (client BackendsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { 375 return autorest.SendWithSender(client, req, 376 azure.DoRetryWithRegistration(client.Client)) 377} 378 379// ListByServiceResponder handles the response to the ListByService request. The method always 380// closes the http.Response Body. 381func (client BackendsClient) ListByServiceResponder(resp *http.Response) (result BackendCollection, err error) { 382 err = autorest.Respond( 383 resp, 384 client.ByInspecting(), 385 azure.WithErrorUnlessStatusCode(http.StatusOK), 386 autorest.ByUnmarshallingJSON(&result), 387 autorest.ByClosing()) 388 result.Response = autorest.Response{Response: resp} 389 return 390} 391 392// listByServiceNextResults retrieves the next set of results, if any. 393func (client BackendsClient) listByServiceNextResults(lastResults BackendCollection) (result BackendCollection, err error) { 394 req, err := lastResults.backendCollectionPreparer() 395 if err != nil { 396 return result, autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "listByServiceNextResults", nil, "Failure preparing next results request") 397 } 398 if req == nil { 399 return 400 } 401 resp, err := client.ListByServiceSender(req) 402 if err != nil { 403 result.Response = autorest.Response{Response: resp} 404 return result, autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "listByServiceNextResults", resp, "Failure sending next results request") 405 } 406 result, err = client.ListByServiceResponder(resp) 407 if err != nil { 408 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "listByServiceNextResults", resp, "Failure responding to next results request") 409 } 410 return 411} 412 413// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. 414func (client BackendsClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionIterator, err error) { 415 result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) 416 return 417} 418 419// Update updates an existing backend. 420// Parameters: 421// resourceGroupName - the name of the resource group. 422// serviceName - the name of the API Management service. 423// backendid - user identifier. Must be unique in the current API Management service instance. 424// parameters - update parameters. 425// ifMatch - the entity state (Etag) version of the backend to update. A value of "*" can be used for If-Match 426// to unconditionally apply the operation. 427func (client BackendsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { 428 if err := validation.Validate([]validation.Validation{ 429 {TargetValue: serviceName, 430 Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 431 {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, 432 {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, 433 {TargetValue: backendid, 434 Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 255, Chain: nil}, 435 {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, 436 {Target: "backendid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { 437 return result, validation.NewError("apimanagement.BackendsClient", "Update", err.Error()) 438 } 439 440 req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) 441 if err != nil { 442 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Update", nil, "Failure preparing request") 443 return 444 } 445 446 resp, err := client.UpdateSender(req) 447 if err != nil { 448 result.Response = resp 449 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Update", resp, "Failure sending request") 450 return 451 } 452 453 result, err = client.UpdateResponder(resp) 454 if err != nil { 455 err = autorest.NewErrorWithError(err, "apimanagement.BackendsClient", "Update", resp, "Failure responding to request") 456 } 457 458 return 459} 460 461// UpdatePreparer prepares the Update request. 462func (client BackendsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { 463 pathParameters := map[string]interface{}{ 464 "backendid": autorest.Encode("path", backendid), 465 "resourceGroupName": autorest.Encode("path", resourceGroupName), 466 "serviceName": autorest.Encode("path", serviceName), 467 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 468 } 469 470 const APIVersion = "2016-07-07" 471 queryParameters := map[string]interface{}{ 472 "api-version": APIVersion, 473 } 474 475 preparer := autorest.CreatePreparer( 476 autorest.AsContentType("application/json; charset=utf-8"), 477 autorest.AsPatch(), 478 autorest.WithBaseURL(client.BaseURI), 479 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), 480 autorest.WithJSON(parameters), 481 autorest.WithQueryParameters(queryParameters), 482 autorest.WithHeader("If-Match", autorest.String(ifMatch))) 483 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 484} 485 486// UpdateSender sends the Update request. The method will close the 487// http.Response Body if it receives an error. 488func (client BackendsClient) UpdateSender(req *http.Request) (*http.Response, error) { 489 return autorest.SendWithSender(client, req, 490 azure.DoRetryWithRegistration(client.Client)) 491} 492 493// UpdateResponder handles the response to the Update request. The method always 494// closes the http.Response Body. 495func (client BackendsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { 496 err = autorest.Respond( 497 resp, 498 client.ByInspecting(), 499 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 500 autorest.ByClosing()) 501 result.Response = resp 502 return 503} 504