1package sql 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/azure" 13 "github.com/Azure/go-autorest/tracing" 14 "net/http" 15) 16 17// DisasterRecoveryConfigurationsClient is the the Azure SQL Database management API provides a RESTful set of web 18// services that interact with Azure SQL Database services to manage your databases. The API enables you to create, 19// retrieve, update, and delete databases. 20type DisasterRecoveryConfigurationsClient struct { 21 BaseClient 22} 23 24// NewDisasterRecoveryConfigurationsClient creates an instance of the DisasterRecoveryConfigurationsClient client. 25func NewDisasterRecoveryConfigurationsClient(subscriptionID string) DisasterRecoveryConfigurationsClient { 26 return NewDisasterRecoveryConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) 27} 28 29// NewDisasterRecoveryConfigurationsClientWithBaseURI creates an instance of the DisasterRecoveryConfigurationsClient 30// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI 31// (sovereign clouds, Azure stack). 32func NewDisasterRecoveryConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) DisasterRecoveryConfigurationsClient { 33 return DisasterRecoveryConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} 34} 35 36// CreateOrUpdate creates or updates a disaster recovery configuration. 37// Parameters: 38// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 39// from the Azure Resource Manager API or the portal. 40// serverName - the name of the server. 41// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to be created/updated. 42func (client DisasterRecoveryConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsCreateOrUpdateFuture, err error) { 43 if tracing.IsEnabled() { 44 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.CreateOrUpdate") 45 defer func() { 46 sc := -1 47 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 48 sc = result.FutureAPI.Response().StatusCode 49 } 50 tracing.EndSpan(ctx, sc, err) 51 }() 52 } 53 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) 54 if err != nil { 55 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") 56 return 57 } 58 59 result, err = client.CreateOrUpdateSender(req) 60 if err != nil { 61 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") 62 return 63 } 64 65 return 66} 67 68// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 69func (client DisasterRecoveryConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { 70 pathParameters := map[string]interface{}{ 71 "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), 72 "resourceGroupName": autorest.Encode("path", resourceGroupName), 73 "serverName": autorest.Encode("path", serverName), 74 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 75 } 76 77 const APIVersion = "2014-04-01" 78 queryParameters := map[string]interface{}{ 79 "api-version": APIVersion, 80 } 81 82 preparer := autorest.CreatePreparer( 83 autorest.AsPut(), 84 autorest.WithBaseURL(client.BaseURI), 85 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", pathParameters), 86 autorest.WithQueryParameters(queryParameters)) 87 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 88} 89 90// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 91// http.Response Body if it receives an error. 92func (client DisasterRecoveryConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future DisasterRecoveryConfigurationsCreateOrUpdateFuture, err error) { 93 var resp *http.Response 94 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 95 if err != nil { 96 return 97 } 98 var azf azure.Future 99 azf, err = azure.NewFutureFromResponse(resp) 100 future.FutureAPI = &azf 101 future.Result = future.result 102 return 103} 104 105// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 106// closes the http.Response Body. 107func (client DisasterRecoveryConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result DisasterRecoveryConfiguration, err error) { 108 err = autorest.Respond( 109 resp, 110 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), 111 autorest.ByUnmarshallingJSON(&result), 112 autorest.ByClosing()) 113 result.Response = autorest.Response{Response: resp} 114 return 115} 116 117// Delete deletes a disaster recovery configuration. 118// Parameters: 119// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 120// from the Azure Resource Manager API or the portal. 121// serverName - the name of the server. 122// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to be deleted. 123func (client DisasterRecoveryConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsDeleteFuture, err error) { 124 if tracing.IsEnabled() { 125 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.Delete") 126 defer func() { 127 sc := -1 128 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 129 sc = result.FutureAPI.Response().StatusCode 130 } 131 tracing.EndSpan(ctx, sc, err) 132 }() 133 } 134 req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) 135 if err != nil { 136 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Delete", nil, "Failure preparing request") 137 return 138 } 139 140 result, err = client.DeleteSender(req) 141 if err != nil { 142 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Delete", nil, "Failure sending request") 143 return 144 } 145 146 return 147} 148 149// DeletePreparer prepares the Delete request. 150func (client DisasterRecoveryConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { 151 pathParameters := map[string]interface{}{ 152 "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), 153 "resourceGroupName": autorest.Encode("path", resourceGroupName), 154 "serverName": autorest.Encode("path", serverName), 155 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 156 } 157 158 const APIVersion = "2014-04-01" 159 queryParameters := map[string]interface{}{ 160 "api-version": APIVersion, 161 } 162 163 preparer := autorest.CreatePreparer( 164 autorest.AsDelete(), 165 autorest.WithBaseURL(client.BaseURI), 166 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", pathParameters), 167 autorest.WithQueryParameters(queryParameters)) 168 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 169} 170 171// DeleteSender sends the Delete request. The method will close the 172// http.Response Body if it receives an error. 173func (client DisasterRecoveryConfigurationsClient) DeleteSender(req *http.Request) (future DisasterRecoveryConfigurationsDeleteFuture, err error) { 174 var resp *http.Response 175 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 176 if err != nil { 177 return 178 } 179 var azf azure.Future 180 azf, err = azure.NewFutureFromResponse(resp) 181 future.FutureAPI = &azf 182 future.Result = future.result 183 return 184} 185 186// DeleteResponder handles the response to the Delete request. The method always 187// closes the http.Response Body. 188func (client DisasterRecoveryConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 189 err = autorest.Respond( 190 resp, 191 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 192 autorest.ByClosing()) 193 result.Response = resp 194 return 195} 196 197// Failover fails over from the current primary server to this server. 198// Parameters: 199// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 200// from the Azure Resource Manager API or the portal. 201// serverName - the name of the server. 202// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to failover. 203func (client DisasterRecoveryConfigurationsClient) Failover(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsFailoverFuture, err error) { 204 if tracing.IsEnabled() { 205 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.Failover") 206 defer func() { 207 sc := -1 208 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 209 sc = result.FutureAPI.Response().StatusCode 210 } 211 tracing.EndSpan(ctx, sc, err) 212 }() 213 } 214 req, err := client.FailoverPreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) 215 if err != nil { 216 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Failover", nil, "Failure preparing request") 217 return 218 } 219 220 result, err = client.FailoverSender(req) 221 if err != nil { 222 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Failover", nil, "Failure sending request") 223 return 224 } 225 226 return 227} 228 229// FailoverPreparer prepares the Failover request. 230func (client DisasterRecoveryConfigurationsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { 231 pathParameters := map[string]interface{}{ 232 "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), 233 "resourceGroupName": autorest.Encode("path", resourceGroupName), 234 "serverName": autorest.Encode("path", serverName), 235 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 236 } 237 238 const APIVersion = "2014-04-01" 239 queryParameters := map[string]interface{}{ 240 "api-version": APIVersion, 241 } 242 243 preparer := autorest.CreatePreparer( 244 autorest.AsPost(), 245 autorest.WithBaseURL(client.BaseURI), 246 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}/failover", pathParameters), 247 autorest.WithQueryParameters(queryParameters)) 248 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 249} 250 251// FailoverSender sends the Failover request. The method will close the 252// http.Response Body if it receives an error. 253func (client DisasterRecoveryConfigurationsClient) FailoverSender(req *http.Request) (future DisasterRecoveryConfigurationsFailoverFuture, err error) { 254 var resp *http.Response 255 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 256 if err != nil { 257 return 258 } 259 var azf azure.Future 260 azf, err = azure.NewFutureFromResponse(resp) 261 future.FutureAPI = &azf 262 future.Result = future.result 263 return 264} 265 266// FailoverResponder handles the response to the Failover request. The method always 267// closes the http.Response Body. 268func (client DisasterRecoveryConfigurationsClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { 269 err = autorest.Respond( 270 resp, 271 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 272 autorest.ByClosing()) 273 result.Response = resp 274 return 275} 276 277// FailoverAllowDataLoss fails over from the current primary server to this server. This operation might result in data 278// loss. 279// Parameters: 280// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 281// from the Azure Resource Manager API or the portal. 282// serverName - the name of the server. 283// disasterRecoveryConfigurationName - the name of the disaster recovery configuration to failover forcefully. 284func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, err error) { 285 if tracing.IsEnabled() { 286 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.FailoverAllowDataLoss") 287 defer func() { 288 sc := -1 289 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 290 sc = result.FutureAPI.Response().StatusCode 291 } 292 tracing.EndSpan(ctx, sc, err) 293 }() 294 } 295 req, err := client.FailoverAllowDataLossPreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) 296 if err != nil { 297 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "FailoverAllowDataLoss", nil, "Failure preparing request") 298 return 299 } 300 301 result, err = client.FailoverAllowDataLossSender(req) 302 if err != nil { 303 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "FailoverAllowDataLoss", nil, "Failure sending request") 304 return 305 } 306 307 return 308} 309 310// FailoverAllowDataLossPreparer prepares the FailoverAllowDataLoss request. 311func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { 312 pathParameters := map[string]interface{}{ 313 "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), 314 "resourceGroupName": autorest.Encode("path", resourceGroupName), 315 "serverName": autorest.Encode("path", serverName), 316 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 317 } 318 319 const APIVersion = "2014-04-01" 320 queryParameters := map[string]interface{}{ 321 "api-version": APIVersion, 322 } 323 324 preparer := autorest.CreatePreparer( 325 autorest.AsPost(), 326 autorest.WithBaseURL(client.BaseURI), 327 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}/forceFailoverAllowDataLoss", pathParameters), 328 autorest.WithQueryParameters(queryParameters)) 329 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 330} 331 332// FailoverAllowDataLossSender sends the FailoverAllowDataLoss request. The method will close the 333// http.Response Body if it receives an error. 334func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossSender(req *http.Request) (future DisasterRecoveryConfigurationsFailoverAllowDataLossFuture, err error) { 335 var resp *http.Response 336 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 337 if err != nil { 338 return 339 } 340 var azf azure.Future 341 azf, err = azure.NewFutureFromResponse(resp) 342 future.FutureAPI = &azf 343 future.Result = future.result 344 return 345} 346 347// FailoverAllowDataLossResponder handles the response to the FailoverAllowDataLoss request. The method always 348// closes the http.Response Body. 349func (client DisasterRecoveryConfigurationsClient) FailoverAllowDataLossResponder(resp *http.Response) (result autorest.Response, err error) { 350 err = autorest.Respond( 351 resp, 352 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 353 autorest.ByClosing()) 354 result.Response = resp 355 return 356} 357 358// Get gets a disaster recovery configuration. 359// Parameters: 360// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 361// from the Azure Resource Manager API or the portal. 362// serverName - the name of the server. 363// disasterRecoveryConfigurationName - the name of the disaster recovery configuration. 364func (client DisasterRecoveryConfigurationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (result DisasterRecoveryConfiguration, err error) { 365 if tracing.IsEnabled() { 366 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.Get") 367 defer func() { 368 sc := -1 369 if result.Response.Response != nil { 370 sc = result.Response.Response.StatusCode 371 } 372 tracing.EndSpan(ctx, sc, err) 373 }() 374 } 375 req, err := client.GetPreparer(ctx, resourceGroupName, serverName, disasterRecoveryConfigurationName) 376 if err != nil { 377 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", nil, "Failure preparing request") 378 return 379 } 380 381 resp, err := client.GetSender(req) 382 if err != nil { 383 result.Response = autorest.Response{Response: resp} 384 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", resp, "Failure sending request") 385 return 386 } 387 388 result, err = client.GetResponder(resp) 389 if err != nil { 390 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "Get", resp, "Failure responding to request") 391 return 392 } 393 394 return 395} 396 397// GetPreparer prepares the Get request. 398func (client DisasterRecoveryConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, disasterRecoveryConfigurationName string) (*http.Request, error) { 399 pathParameters := map[string]interface{}{ 400 "disasterRecoveryConfigurationName": autorest.Encode("path", disasterRecoveryConfigurationName), 401 "resourceGroupName": autorest.Encode("path", resourceGroupName), 402 "serverName": autorest.Encode("path", serverName), 403 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 404 } 405 406 const APIVersion = "2014-04-01" 407 queryParameters := map[string]interface{}{ 408 "api-version": APIVersion, 409 } 410 411 preparer := autorest.CreatePreparer( 412 autorest.AsGet(), 413 autorest.WithBaseURL(client.BaseURI), 414 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration/{disasterRecoveryConfigurationName}", pathParameters), 415 autorest.WithQueryParameters(queryParameters)) 416 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 417} 418 419// GetSender sends the Get request. The method will close the 420// http.Response Body if it receives an error. 421func (client DisasterRecoveryConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { 422 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 423} 424 425// GetResponder handles the response to the Get request. The method always 426// closes the http.Response Body. 427func (client DisasterRecoveryConfigurationsClient) GetResponder(resp *http.Response) (result DisasterRecoveryConfiguration, err error) { 428 err = autorest.Respond( 429 resp, 430 azure.WithErrorUnlessStatusCode(http.StatusOK), 431 autorest.ByUnmarshallingJSON(&result), 432 autorest.ByClosing()) 433 result.Response = autorest.Response{Response: resp} 434 return 435} 436 437// List lists a server's disaster recovery configuration. 438// Parameters: 439// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 440// from the Azure Resource Manager API or the portal. 441// serverName - the name of the server. 442func (client DisasterRecoveryConfigurationsClient) List(ctx context.Context, resourceGroupName string, serverName string) (result DisasterRecoveryConfigurationListResult, err error) { 443 if tracing.IsEnabled() { 444 ctx = tracing.StartSpan(ctx, fqdn+"/DisasterRecoveryConfigurationsClient.List") 445 defer func() { 446 sc := -1 447 if result.Response.Response != nil { 448 sc = result.Response.Response.StatusCode 449 } 450 tracing.EndSpan(ctx, sc, err) 451 }() 452 } 453 req, err := client.ListPreparer(ctx, resourceGroupName, serverName) 454 if err != nil { 455 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", nil, "Failure preparing request") 456 return 457 } 458 459 resp, err := client.ListSender(req) 460 if err != nil { 461 result.Response = autorest.Response{Response: resp} 462 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", resp, "Failure sending request") 463 return 464 } 465 466 result, err = client.ListResponder(resp) 467 if err != nil { 468 err = autorest.NewErrorWithError(err, "sql.DisasterRecoveryConfigurationsClient", "List", resp, "Failure responding to request") 469 return 470 } 471 472 return 473} 474 475// ListPreparer prepares the List request. 476func (client DisasterRecoveryConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { 477 pathParameters := map[string]interface{}{ 478 "resourceGroupName": autorest.Encode("path", resourceGroupName), 479 "serverName": autorest.Encode("path", serverName), 480 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 481 } 482 483 const APIVersion = "2014-04-01" 484 queryParameters := map[string]interface{}{ 485 "api-version": APIVersion, 486 } 487 488 preparer := autorest.CreatePreparer( 489 autorest.AsGet(), 490 autorest.WithBaseURL(client.BaseURI), 491 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disasterRecoveryConfiguration", pathParameters), 492 autorest.WithQueryParameters(queryParameters)) 493 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 494} 495 496// ListSender sends the List request. The method will close the 497// http.Response Body if it receives an error. 498func (client DisasterRecoveryConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { 499 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 500} 501 502// ListResponder handles the response to the List request. The method always 503// closes the http.Response Body. 504func (client DisasterRecoveryConfigurationsClient) ListResponder(resp *http.Response) (result DisasterRecoveryConfigurationListResult, err error) { 505 err = autorest.Respond( 506 resp, 507 azure.WithErrorUnlessStatusCode(http.StatusOK), 508 autorest.ByUnmarshallingJSON(&result), 509 autorest.ByClosing()) 510 result.Response = autorest.Response{Response: resp} 511 return 512} 513