1package compute 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// GalleryApplicationVersionsClient is the compute Client 19type GalleryApplicationVersionsClient struct { 20 BaseClient 21} 22 23// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. 24func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { 25 return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) 26} 27 28// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client 29// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign 30// clouds, Azure stack). 31func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { 32 return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} 33} 34 35// CreateOrUpdate create or update a gallery Application Version. 36// Parameters: 37// resourceGroupName - the name of the resource group. 38// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. 39// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is 40// to be created. 41// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow 42// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range 43// of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> 44// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version 45// operation. 46func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { 47 if tracing.IsEnabled() { 48 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") 49 defer func() { 50 sc := -1 51 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 52 sc = result.FutureAPI.Response().StatusCode 53 } 54 tracing.EndSpan(ctx, sc, err) 55 }() 56 } 57 if err := validation.Validate([]validation.Validation{ 58 {TargetValue: galleryApplicationVersion, 59 Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, 60 Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, 61 Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, 62 Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.FileName", Name: validation.Null, Rule: true, Chain: nil}, 63 {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}, 64 }}, 65 }}, 66 }}}}}); err != nil { 67 return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) 68 } 69 70 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) 71 if err != nil { 72 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") 73 return 74 } 75 76 result, err = client.CreateOrUpdateSender(req) 77 if err != nil { 78 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure sending request") 79 return 80 } 81 82 return 83} 84 85// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 86func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { 87 pathParameters := map[string]interface{}{ 88 "galleryApplicationName": autorest.Encode("path", galleryApplicationName), 89 "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), 90 "galleryName": autorest.Encode("path", galleryName), 91 "resourceGroupName": autorest.Encode("path", resourceGroupName), 92 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 93 } 94 95 const APIVersion = "2019-12-01" 96 queryParameters := map[string]interface{}{ 97 "api-version": APIVersion, 98 } 99 100 preparer := autorest.CreatePreparer( 101 autorest.AsContentType("application/json; charset=utf-8"), 102 autorest.AsPut(), 103 autorest.WithBaseURL(client.BaseURI), 104 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), 105 autorest.WithJSON(galleryApplicationVersion), 106 autorest.WithQueryParameters(queryParameters)) 107 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 108} 109 110// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 111// http.Response Body if it receives an error. 112func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { 113 var resp *http.Response 114 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 115 if err != nil { 116 return 117 } 118 var azf azure.Future 119 azf, err = azure.NewFutureFromResponse(resp) 120 future.FutureAPI = &azf 121 future.Result = future.result 122 return 123} 124 125// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 126// closes the http.Response Body. 127func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { 128 err = autorest.Respond( 129 resp, 130 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), 131 autorest.ByUnmarshallingJSON(&result), 132 autorest.ByClosing()) 133 result.Response = autorest.Response{Response: resp} 134 return 135} 136 137// Delete delete a gallery Application Version. 138// Parameters: 139// resourceGroupName - the name of the resource group. 140// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. 141// galleryApplicationName - the name of the gallery Application Definition in which the Application Version 142// resides. 143// galleryApplicationVersionName - the name of the gallery Application Version to be deleted. 144func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { 145 if tracing.IsEnabled() { 146 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") 147 defer func() { 148 sc := -1 149 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 150 sc = result.FutureAPI.Response().StatusCode 151 } 152 tracing.EndSpan(ctx, sc, err) 153 }() 154 } 155 req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) 156 if err != nil { 157 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") 158 return 159 } 160 161 result, err = client.DeleteSender(req) 162 if err != nil { 163 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure sending request") 164 return 165 } 166 167 return 168} 169 170// DeletePreparer prepares the Delete request. 171func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { 172 pathParameters := map[string]interface{}{ 173 "galleryApplicationName": autorest.Encode("path", galleryApplicationName), 174 "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), 175 "galleryName": autorest.Encode("path", galleryName), 176 "resourceGroupName": autorest.Encode("path", resourceGroupName), 177 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 178 } 179 180 const APIVersion = "2019-12-01" 181 queryParameters := map[string]interface{}{ 182 "api-version": APIVersion, 183 } 184 185 preparer := autorest.CreatePreparer( 186 autorest.AsDelete(), 187 autorest.WithBaseURL(client.BaseURI), 188 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), 189 autorest.WithQueryParameters(queryParameters)) 190 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 191} 192 193// DeleteSender sends the Delete request. The method will close the 194// http.Response Body if it receives an error. 195func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { 196 var resp *http.Response 197 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 198 if err != nil { 199 return 200 } 201 var azf azure.Future 202 azf, err = azure.NewFutureFromResponse(resp) 203 future.FutureAPI = &azf 204 future.Result = future.result 205 return 206} 207 208// DeleteResponder handles the response to the Delete request. The method always 209// closes the http.Response Body. 210func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 211 err = autorest.Respond( 212 resp, 213 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 214 autorest.ByClosing()) 215 result.Response = resp 216 return 217} 218 219// Get retrieves information about a gallery Application Version. 220// Parameters: 221// resourceGroupName - the name of the resource group. 222// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. 223// galleryApplicationName - the name of the gallery Application Definition in which the Application Version 224// resides. 225// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved. 226// expand - the expand expression to apply on the operation. 227func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { 228 if tracing.IsEnabled() { 229 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") 230 defer func() { 231 sc := -1 232 if result.Response.Response != nil { 233 sc = result.Response.Response.StatusCode 234 } 235 tracing.EndSpan(ctx, sc, err) 236 }() 237 } 238 req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) 239 if err != nil { 240 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") 241 return 242 } 243 244 resp, err := client.GetSender(req) 245 if err != nil { 246 result.Response = autorest.Response{Response: resp} 247 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") 248 return 249 } 250 251 result, err = client.GetResponder(resp) 252 if err != nil { 253 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") 254 return 255 } 256 257 return 258} 259 260// GetPreparer prepares the Get request. 261func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { 262 pathParameters := map[string]interface{}{ 263 "galleryApplicationName": autorest.Encode("path", galleryApplicationName), 264 "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), 265 "galleryName": autorest.Encode("path", galleryName), 266 "resourceGroupName": autorest.Encode("path", resourceGroupName), 267 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 268 } 269 270 const APIVersion = "2019-12-01" 271 queryParameters := map[string]interface{}{ 272 "api-version": APIVersion, 273 } 274 if len(string(expand)) > 0 { 275 queryParameters["$expand"] = autorest.Encode("query", expand) 276 } 277 278 preparer := autorest.CreatePreparer( 279 autorest.AsGet(), 280 autorest.WithBaseURL(client.BaseURI), 281 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), 282 autorest.WithQueryParameters(queryParameters)) 283 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 284} 285 286// GetSender sends the Get request. The method will close the 287// http.Response Body if it receives an error. 288func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { 289 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 290} 291 292// GetResponder handles the response to the Get request. The method always 293// closes the http.Response Body. 294func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { 295 err = autorest.Respond( 296 resp, 297 azure.WithErrorUnlessStatusCode(http.StatusOK), 298 autorest.ByUnmarshallingJSON(&result), 299 autorest.ByClosing()) 300 result.Response = autorest.Response{Response: resp} 301 return 302} 303 304// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. 305// Parameters: 306// resourceGroupName - the name of the resource group. 307// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. 308// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the 309// Application Versions are to be listed. 310func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { 311 if tracing.IsEnabled() { 312 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") 313 defer func() { 314 sc := -1 315 if result.gavl.Response.Response != nil { 316 sc = result.gavl.Response.Response.StatusCode 317 } 318 tracing.EndSpan(ctx, sc, err) 319 }() 320 } 321 result.fn = client.listByGalleryApplicationNextResults 322 req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) 323 if err != nil { 324 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") 325 return 326 } 327 328 resp, err := client.ListByGalleryApplicationSender(req) 329 if err != nil { 330 result.gavl.Response = autorest.Response{Response: resp} 331 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") 332 return 333 } 334 335 result.gavl, err = client.ListByGalleryApplicationResponder(resp) 336 if err != nil { 337 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") 338 return 339 } 340 if result.gavl.hasNextLink() && result.gavl.IsEmpty() { 341 err = result.NextWithContext(ctx) 342 return 343 } 344 345 return 346} 347 348// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. 349func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { 350 pathParameters := map[string]interface{}{ 351 "galleryApplicationName": autorest.Encode("path", galleryApplicationName), 352 "galleryName": autorest.Encode("path", galleryName), 353 "resourceGroupName": autorest.Encode("path", resourceGroupName), 354 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 355 } 356 357 const APIVersion = "2019-12-01" 358 queryParameters := map[string]interface{}{ 359 "api-version": APIVersion, 360 } 361 362 preparer := autorest.CreatePreparer( 363 autorest.AsGet(), 364 autorest.WithBaseURL(client.BaseURI), 365 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), 366 autorest.WithQueryParameters(queryParameters)) 367 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 368} 369 370// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the 371// http.Response Body if it receives an error. 372func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { 373 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 374} 375 376// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always 377// closes the http.Response Body. 378func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { 379 err = autorest.Respond( 380 resp, 381 azure.WithErrorUnlessStatusCode(http.StatusOK), 382 autorest.ByUnmarshallingJSON(&result), 383 autorest.ByClosing()) 384 result.Response = autorest.Response{Response: resp} 385 return 386} 387 388// listByGalleryApplicationNextResults retrieves the next set of results, if any. 389func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { 390 req, err := lastResults.galleryApplicationVersionListPreparer(ctx) 391 if err != nil { 392 return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") 393 } 394 if req == nil { 395 return 396 } 397 resp, err := client.ListByGalleryApplicationSender(req) 398 if err != nil { 399 result.Response = autorest.Response{Response: resp} 400 return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") 401 } 402 result, err = client.ListByGalleryApplicationResponder(resp) 403 if err != nil { 404 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") 405 } 406 return 407} 408 409// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. 410func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { 411 if tracing.IsEnabled() { 412 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") 413 defer func() { 414 sc := -1 415 if result.Response().Response.Response != nil { 416 sc = result.page.Response().Response.Response.StatusCode 417 } 418 tracing.EndSpan(ctx, sc, err) 419 }() 420 } 421 result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) 422 return 423} 424 425// Update update a gallery Application Version. 426// Parameters: 427// resourceGroupName - the name of the resource group. 428// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. 429// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is 430// to be updated. 431// galleryApplicationVersionName - the name of the gallery Application Version to be updated. Needs to follow 432// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range 433// of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch> 434// galleryApplicationVersion - parameters supplied to the update gallery Application Version operation. 435func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { 436 if tracing.IsEnabled() { 437 ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") 438 defer func() { 439 sc := -1 440 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 441 sc = result.FutureAPI.Response().StatusCode 442 } 443 tracing.EndSpan(ctx, sc, err) 444 }() 445 } 446 req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) 447 if err != nil { 448 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") 449 return 450 } 451 452 result, err = client.UpdateSender(req) 453 if err != nil { 454 err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure sending request") 455 return 456 } 457 458 return 459} 460 461// UpdatePreparer prepares the Update request. 462func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { 463 pathParameters := map[string]interface{}{ 464 "galleryApplicationName": autorest.Encode("path", galleryApplicationName), 465 "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), 466 "galleryName": autorest.Encode("path", galleryName), 467 "resourceGroupName": autorest.Encode("path", resourceGroupName), 468 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 469 } 470 471 const APIVersion = "2019-12-01" 472 queryParameters := map[string]interface{}{ 473 "api-version": APIVersion, 474 } 475 476 preparer := autorest.CreatePreparer( 477 autorest.AsContentType("application/json; charset=utf-8"), 478 autorest.AsPatch(), 479 autorest.WithBaseURL(client.BaseURI), 480 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), 481 autorest.WithJSON(galleryApplicationVersion), 482 autorest.WithQueryParameters(queryParameters)) 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 GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { 489 var resp *http.Response 490 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 491 if err != nil { 492 return 493 } 494 var azf azure.Future 495 azf, err = azure.NewFutureFromResponse(resp) 496 future.FutureAPI = &azf 497 future.Result = future.result 498 return 499} 500 501// UpdateResponder handles the response to the Update request. The method always 502// closes the http.Response Body. 503func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { 504 err = autorest.Respond( 505 resp, 506 azure.WithErrorUnlessStatusCode(http.StatusOK), 507 autorest.ByUnmarshallingJSON(&result), 508 autorest.ByClosing()) 509 result.Response = autorest.Response{Response: resp} 510 return 511} 512