1package appplatform 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/autorest/validation" 14 "github.com/Azure/go-autorest/tracing" 15 "net/http" 16) 17 18// AppsClient is the REST API for Azure Spring Cloud 19type AppsClient struct { 20 BaseClient 21} 22 23// NewAppsClient creates an instance of the AppsClient client. 24func NewAppsClient(subscriptionID string) AppsClient { 25 return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) 26} 27 28// NewAppsClientWithBaseURI creates an instance of the AppsClient client using a custom endpoint. Use this when 29// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 30func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { 31 return AppsClient{NewWithBaseURI(baseURI, subscriptionID)} 32} 33 34// CreateOrUpdate create a new App or update an exiting App. 35// Parameters: 36// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 37// from the Azure Resource Manager API or the portal. 38// serviceName - the name of the Service resource. 39// appName - the name of the App resource. 40// appResource - parameters for the create or update operation 41func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource) (result AppsCreateOrUpdateFuture, err error) { 42 if tracing.IsEnabled() { 43 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdate") 44 defer func() { 45 sc := -1 46 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 47 sc = result.FutureAPI.Response().StatusCode 48 } 49 tracing.EndSpan(ctx, sc, err) 50 }() 51 } 52 if err := validation.Validate([]validation.Validation{ 53 {TargetValue: appResource, 54 Constraints: []validation.Constraint{{Target: "appResource.Properties", Name: validation.Null, Rule: false, 55 Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk", Name: validation.Null, Rule: false, 56 Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.Null, Rule: false, 57 Chain: []validation.Constraint{{Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.InclusiveMaximum, Rule: int64(5), Chain: nil}, 58 {Target: "appResource.Properties.TemporaryDisk.SizeInGB", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 59 }}, 60 }}, 61 {Target: "appResource.Properties.PersistentDisk", Name: validation.Null, Rule: false, 62 Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.Null, Rule: false, 63 Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil}, 64 {Target: "appResource.Properties.PersistentDisk.SizeInGB", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 65 }}, 66 {Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.Null, Rule: false, 67 Chain: []validation.Constraint{{Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil}, 68 {Target: "appResource.Properties.PersistentDisk.UsedInGB", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 69 }}, 70 }}, 71 }}}}}); err != nil { 72 return result, validation.NewError("appplatform.AppsClient", "CreateOrUpdate", err.Error()) 73 } 74 75 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, appName, appResource) 76 if err != nil { 77 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", nil, "Failure preparing request") 78 return 79 } 80 81 result, err = client.CreateOrUpdateSender(req) 82 if err != nil { 83 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "CreateOrUpdate", nil, "Failure sending request") 84 return 85 } 86 87 return 88} 89 90// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 91func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource) (*http.Request, error) { 92 pathParameters := map[string]interface{}{ 93 "appName": autorest.Encode("path", appName), 94 "resourceGroupName": autorest.Encode("path", resourceGroupName), 95 "serviceName": autorest.Encode("path", serviceName), 96 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 97 } 98 99 const APIVersion = "2019-05-01-preview" 100 queryParameters := map[string]interface{}{ 101 "api-version": APIVersion, 102 } 103 104 preparer := autorest.CreatePreparer( 105 autorest.AsContentType("application/json; charset=utf-8"), 106 autorest.AsPut(), 107 autorest.WithBaseURL(client.BaseURI), 108 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters), 109 autorest.WithJSON(appResource), 110 autorest.WithQueryParameters(queryParameters)) 111 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 112} 113 114// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 115// http.Response Body if it receives an error. 116func (client AppsClient) CreateOrUpdateSender(req *http.Request) (future AppsCreateOrUpdateFuture, err error) { 117 var resp *http.Response 118 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 119 if err != nil { 120 return 121 } 122 var azf azure.Future 123 azf, err = azure.NewFutureFromResponse(resp) 124 future.FutureAPI = &azf 125 future.Result = future.result 126 return 127} 128 129// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 130// closes the http.Response Body. 131func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result AppResource, err error) { 132 err = autorest.Respond( 133 resp, 134 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 135 autorest.ByUnmarshallingJSON(&result), 136 autorest.ByClosing()) 137 result.Response = autorest.Response{Response: resp} 138 return 139} 140 141// Delete operation to delete an App. 142// Parameters: 143// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 144// from the Azure Resource Manager API or the portal. 145// serviceName - the name of the Service resource. 146// appName - the name of the App resource. 147func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result autorest.Response, err error) { 148 if tracing.IsEnabled() { 149 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete") 150 defer func() { 151 sc := -1 152 if result.Response != nil { 153 sc = result.Response.StatusCode 154 } 155 tracing.EndSpan(ctx, sc, err) 156 }() 157 } 158 req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, appName) 159 if err != nil { 160 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", nil, "Failure preparing request") 161 return 162 } 163 164 resp, err := client.DeleteSender(req) 165 if err != nil { 166 result.Response = resp 167 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", resp, "Failure sending request") 168 return 169 } 170 171 result, err = client.DeleteResponder(resp) 172 if err != nil { 173 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Delete", resp, "Failure responding to request") 174 return 175 } 176 177 return 178} 179 180// DeletePreparer prepares the Delete request. 181func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string) (*http.Request, error) { 182 pathParameters := map[string]interface{}{ 183 "appName": autorest.Encode("path", appName), 184 "resourceGroupName": autorest.Encode("path", resourceGroupName), 185 "serviceName": autorest.Encode("path", serviceName), 186 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 187 } 188 189 const APIVersion = "2019-05-01-preview" 190 queryParameters := map[string]interface{}{ 191 "api-version": APIVersion, 192 } 193 194 preparer := autorest.CreatePreparer( 195 autorest.AsDelete(), 196 autorest.WithBaseURL(client.BaseURI), 197 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters), 198 autorest.WithQueryParameters(queryParameters)) 199 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 200} 201 202// DeleteSender sends the Delete request. The method will close the 203// http.Response Body if it receives an error. 204func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { 205 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 206} 207 208// DeleteResponder handles the response to the Delete request. The method always 209// closes the http.Response Body. 210func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 211 err = autorest.Respond( 212 resp, 213 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 214 autorest.ByClosing()) 215 result.Response = resp 216 return 217} 218 219// Get get an App and its properties. 220// Parameters: 221// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 222// from the Azure Resource Manager API or the portal. 223// serviceName - the name of the Service resource. 224// appName - the name of the App resource. 225// syncStatus - indicates whether sync status 226func (client AppsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, syncStatus string) (result AppResource, err error) { 227 if tracing.IsEnabled() { 228 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Get") 229 defer func() { 230 sc := -1 231 if result.Response.Response != nil { 232 sc = result.Response.Response.StatusCode 233 } 234 tracing.EndSpan(ctx, sc, err) 235 }() 236 } 237 req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, appName, syncStatus) 238 if err != nil { 239 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Get", nil, "Failure preparing request") 240 return 241 } 242 243 resp, err := client.GetSender(req) 244 if err != nil { 245 result.Response = autorest.Response{Response: resp} 246 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Get", resp, "Failure sending request") 247 return 248 } 249 250 result, err = client.GetResponder(resp) 251 if err != nil { 252 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Get", resp, "Failure responding to request") 253 return 254 } 255 256 return 257} 258 259// GetPreparer prepares the Get request. 260func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, syncStatus string) (*http.Request, error) { 261 pathParameters := map[string]interface{}{ 262 "appName": autorest.Encode("path", appName), 263 "resourceGroupName": autorest.Encode("path", resourceGroupName), 264 "serviceName": autorest.Encode("path", serviceName), 265 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 266 } 267 268 const APIVersion = "2019-05-01-preview" 269 queryParameters := map[string]interface{}{ 270 "api-version": APIVersion, 271 } 272 if len(syncStatus) > 0 { 273 queryParameters["syncStatus"] = autorest.Encode("query", syncStatus) 274 } 275 276 preparer := autorest.CreatePreparer( 277 autorest.AsGet(), 278 autorest.WithBaseURL(client.BaseURI), 279 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters), 280 autorest.WithQueryParameters(queryParameters)) 281 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 282} 283 284// GetSender sends the Get request. The method will close the 285// http.Response Body if it receives an error. 286func (client AppsClient) GetSender(req *http.Request) (*http.Response, error) { 287 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 288} 289 290// GetResponder handles the response to the Get request. The method always 291// closes the http.Response Body. 292func (client AppsClient) GetResponder(resp *http.Response) (result AppResource, err error) { 293 err = autorest.Respond( 294 resp, 295 azure.WithErrorUnlessStatusCode(http.StatusOK), 296 autorest.ByUnmarshallingJSON(&result), 297 autorest.ByClosing()) 298 result.Response = autorest.Response{Response: resp} 299 return 300} 301 302// GetResourceUploadURL get an resource upload URL for an App, which may be artifacts or source archive. 303// Parameters: 304// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 305// from the Azure Resource Manager API or the portal. 306// serviceName - the name of the Service resource. 307// appName - the name of the App resource. 308func (client AppsClient) GetResourceUploadURL(ctx context.Context, resourceGroupName string, serviceName string, appName string) (result ResourceUploadDefinition, err error) { 309 if tracing.IsEnabled() { 310 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetResourceUploadURL") 311 defer func() { 312 sc := -1 313 if result.Response.Response != nil { 314 sc = result.Response.Response.StatusCode 315 } 316 tracing.EndSpan(ctx, sc, err) 317 }() 318 } 319 req, err := client.GetResourceUploadURLPreparer(ctx, resourceGroupName, serviceName, appName) 320 if err != nil { 321 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", nil, "Failure preparing request") 322 return 323 } 324 325 resp, err := client.GetResourceUploadURLSender(req) 326 if err != nil { 327 result.Response = autorest.Response{Response: resp} 328 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", resp, "Failure sending request") 329 return 330 } 331 332 result, err = client.GetResourceUploadURLResponder(resp) 333 if err != nil { 334 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "GetResourceUploadURL", resp, "Failure responding to request") 335 return 336 } 337 338 return 339} 340 341// GetResourceUploadURLPreparer prepares the GetResourceUploadURL request. 342func (client AppsClient) GetResourceUploadURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string) (*http.Request, error) { 343 pathParameters := map[string]interface{}{ 344 "appName": autorest.Encode("path", appName), 345 "resourceGroupName": autorest.Encode("path", resourceGroupName), 346 "serviceName": autorest.Encode("path", serviceName), 347 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 348 } 349 350 const APIVersion = "2019-05-01-preview" 351 queryParameters := map[string]interface{}{ 352 "api-version": APIVersion, 353 } 354 355 preparer := autorest.CreatePreparer( 356 autorest.AsPost(), 357 autorest.WithBaseURL(client.BaseURI), 358 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl", pathParameters), 359 autorest.WithQueryParameters(queryParameters)) 360 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 361} 362 363// GetResourceUploadURLSender sends the GetResourceUploadURL request. The method will close the 364// http.Response Body if it receives an error. 365func (client AppsClient) GetResourceUploadURLSender(req *http.Request) (*http.Response, error) { 366 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 367} 368 369// GetResourceUploadURLResponder handles the response to the GetResourceUploadURL request. The method always 370// closes the http.Response Body. 371func (client AppsClient) GetResourceUploadURLResponder(resp *http.Response) (result ResourceUploadDefinition, err error) { 372 err = autorest.Respond( 373 resp, 374 azure.WithErrorUnlessStatusCode(http.StatusOK), 375 autorest.ByUnmarshallingJSON(&result), 376 autorest.ByClosing()) 377 result.Response = autorest.Response{Response: resp} 378 return 379} 380 381// List handles requests to list all resources in a Service. 382// Parameters: 383// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 384// from the Azure Resource Manager API or the portal. 385// serviceName - the name of the Service resource. 386func (client AppsClient) List(ctx context.Context, resourceGroupName string, serviceName string) (result AppResourceCollectionPage, err error) { 387 if tracing.IsEnabled() { 388 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") 389 defer func() { 390 sc := -1 391 if result.arc.Response.Response != nil { 392 sc = result.arc.Response.Response.StatusCode 393 } 394 tracing.EndSpan(ctx, sc, err) 395 }() 396 } 397 result.fn = client.listNextResults 398 req, err := client.ListPreparer(ctx, resourceGroupName, serviceName) 399 if err != nil { 400 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", nil, "Failure preparing request") 401 return 402 } 403 404 resp, err := client.ListSender(req) 405 if err != nil { 406 result.arc.Response = autorest.Response{Response: resp} 407 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", resp, "Failure sending request") 408 return 409 } 410 411 result.arc, err = client.ListResponder(resp) 412 if err != nil { 413 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "List", resp, "Failure responding to request") 414 return 415 } 416 if result.arc.hasNextLink() && result.arc.IsEmpty() { 417 err = result.NextWithContext(ctx) 418 return 419 } 420 421 return 422} 423 424// ListPreparer prepares the List request. 425func (client AppsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { 426 pathParameters := map[string]interface{}{ 427 "resourceGroupName": autorest.Encode("path", resourceGroupName), 428 "serviceName": autorest.Encode("path", serviceName), 429 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 430 } 431 432 const APIVersion = "2019-05-01-preview" 433 queryParameters := map[string]interface{}{ 434 "api-version": APIVersion, 435 } 436 437 preparer := autorest.CreatePreparer( 438 autorest.AsGet(), 439 autorest.WithBaseURL(client.BaseURI), 440 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps", pathParameters), 441 autorest.WithQueryParameters(queryParameters)) 442 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 443} 444 445// ListSender sends the List request. The method will close the 446// http.Response Body if it receives an error. 447func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { 448 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 449} 450 451// ListResponder handles the response to the List request. The method always 452// closes the http.Response Body. 453func (client AppsClient) ListResponder(resp *http.Response) (result AppResourceCollection, err error) { 454 err = autorest.Respond( 455 resp, 456 azure.WithErrorUnlessStatusCode(http.StatusOK), 457 autorest.ByUnmarshallingJSON(&result), 458 autorest.ByClosing()) 459 result.Response = autorest.Response{Response: resp} 460 return 461} 462 463// listNextResults retrieves the next set of results, if any. 464func (client AppsClient) listNextResults(ctx context.Context, lastResults AppResourceCollection) (result AppResourceCollection, err error) { 465 req, err := lastResults.appResourceCollectionPreparer(ctx) 466 if err != nil { 467 return result, autorest.NewErrorWithError(err, "appplatform.AppsClient", "listNextResults", nil, "Failure preparing next results request") 468 } 469 if req == nil { 470 return 471 } 472 resp, err := client.ListSender(req) 473 if err != nil { 474 result.Response = autorest.Response{Response: resp} 475 return result, autorest.NewErrorWithError(err, "appplatform.AppsClient", "listNextResults", resp, "Failure sending next results request") 476 } 477 result, err = client.ListResponder(resp) 478 if err != nil { 479 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "listNextResults", resp, "Failure responding to next results request") 480 } 481 return 482} 483 484// ListComplete enumerates all values, automatically crossing page boundaries as required. 485func (client AppsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string) (result AppResourceCollectionIterator, err error) { 486 if tracing.IsEnabled() { 487 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") 488 defer func() { 489 sc := -1 490 if result.Response().Response.Response != nil { 491 sc = result.page.Response().Response.Response.StatusCode 492 } 493 tracing.EndSpan(ctx, sc, err) 494 }() 495 } 496 result.page, err = client.List(ctx, resourceGroupName, serviceName) 497 return 498} 499 500// Update operation to update an exiting App. 501// Parameters: 502// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value 503// from the Azure Resource Manager API or the portal. 504// serviceName - the name of the Service resource. 505// appName - the name of the App resource. 506// appResource - parameters for the update operation 507func (client AppsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource) (result AppsUpdateFuture, err error) { 508 if tracing.IsEnabled() { 509 ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Update") 510 defer func() { 511 sc := -1 512 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 513 sc = result.FutureAPI.Response().StatusCode 514 } 515 tracing.EndSpan(ctx, sc, err) 516 }() 517 } 518 req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, appName, appResource) 519 if err != nil { 520 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Update", nil, "Failure preparing request") 521 return 522 } 523 524 result, err = client.UpdateSender(req) 525 if err != nil { 526 err = autorest.NewErrorWithError(err, "appplatform.AppsClient", "Update", nil, "Failure sending request") 527 return 528 } 529 530 return 531} 532 533// UpdatePreparer prepares the Update request. 534func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource) (*http.Request, error) { 535 pathParameters := map[string]interface{}{ 536 "appName": autorest.Encode("path", appName), 537 "resourceGroupName": autorest.Encode("path", resourceGroupName), 538 "serviceName": autorest.Encode("path", serviceName), 539 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 540 } 541 542 const APIVersion = "2019-05-01-preview" 543 queryParameters := map[string]interface{}{ 544 "api-version": APIVersion, 545 } 546 547 preparer := autorest.CreatePreparer( 548 autorest.AsContentType("application/json; charset=utf-8"), 549 autorest.AsPatch(), 550 autorest.WithBaseURL(client.BaseURI), 551 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", pathParameters), 552 autorest.WithJSON(appResource), 553 autorest.WithQueryParameters(queryParameters)) 554 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 555} 556 557// UpdateSender sends the Update request. The method will close the 558// http.Response Body if it receives an error. 559func (client AppsClient) UpdateSender(req *http.Request) (future AppsUpdateFuture, err error) { 560 var resp *http.Response 561 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 562 if err != nil { 563 return 564 } 565 var azf azure.Future 566 azf, err = azure.NewFutureFromResponse(resp) 567 future.FutureAPI = &azf 568 future.Result = future.result 569 return 570} 571 572// UpdateResponder handles the response to the Update request. The method always 573// closes the http.Response Body. 574func (client AppsClient) UpdateResponder(resp *http.Response) (result AppResource, err error) { 575 err = autorest.Respond( 576 resp, 577 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 578 autorest.ByUnmarshallingJSON(&result), 579 autorest.ByClosing()) 580 result.Response = autorest.Response{Response: resp} 581 return 582} 583