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