1package containerregistry 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 "github.com/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// RunsClient is the client for the Runs methods of the Containerregistry service. 30type RunsClient struct { 31 BaseClient 32} 33 34// NewRunsClient creates an instance of the RunsClient client. 35func NewRunsClient(subscriptionID string) RunsClient { 36 return NewRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// NewRunsClientWithBaseURI creates an instance of the RunsClient client using a custom endpoint. Use this when 40// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 41func NewRunsClientWithBaseURI(baseURI string, subscriptionID string) RunsClient { 42 return RunsClient{NewWithBaseURI(baseURI, subscriptionID)} 43} 44 45// Cancel cancel an existing run. 46// Parameters: 47// resourceGroupName - the name of the resource group to which the container registry belongs. 48// registryName - the name of the container registry. 49// runID - the run ID. 50func (client RunsClient) Cancel(ctx context.Context, resourceGroupName string, registryName string, runID string) (result RunsCancelFuture, err error) { 51 if tracing.IsEnabled() { 52 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Cancel") 53 defer func() { 54 sc := -1 55 if result.Response() != nil { 56 sc = result.Response().StatusCode 57 } 58 tracing.EndSpan(ctx, sc, err) 59 }() 60 } 61 if err := validation.Validate([]validation.Validation{ 62 {TargetValue: resourceGroupName, 63 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 64 {TargetValue: registryName, 65 Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 66 {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, 67 {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { 68 return result, validation.NewError("containerregistry.RunsClient", "Cancel", err.Error()) 69 } 70 71 req, err := client.CancelPreparer(ctx, resourceGroupName, registryName, runID) 72 if err != nil { 73 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", nil, "Failure preparing request") 74 return 75 } 76 77 result, err = client.CancelSender(req) 78 if err != nil { 79 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", nil, "Failure sending request") 80 return 81 } 82 83 return 84} 85 86// CancelPreparer prepares the Cancel request. 87func (client RunsClient) CancelPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { 88 pathParameters := map[string]interface{}{ 89 "registryName": autorest.Encode("path", registryName), 90 "resourceGroupName": autorest.Encode("path", resourceGroupName), 91 "runId": autorest.Encode("path", runID), 92 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 93 } 94 95 const APIVersion = "2019-06-01-preview" 96 queryParameters := map[string]interface{}{ 97 "api-version": APIVersion, 98 } 99 100 preparer := autorest.CreatePreparer( 101 autorest.AsPost(), 102 autorest.WithBaseURL(client.BaseURI), 103 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel", pathParameters), 104 autorest.WithQueryParameters(queryParameters)) 105 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 106} 107 108// CancelSender sends the Cancel request. The method will close the 109// http.Response Body if it receives an error. 110func (client RunsClient) CancelSender(req *http.Request) (future RunsCancelFuture, err error) { 111 var resp *http.Response 112 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 113 if err != nil { 114 return 115 } 116 var azf azure.Future 117 azf, err = azure.NewFutureFromResponse(resp) 118 future.FutureAPI = &azf 119 future.Result = func(client RunsClient) (ar autorest.Response, err error) { 120 var done bool 121 done, err = future.DoneWithContext(context.Background(), client) 122 if err != nil { 123 err = autorest.NewErrorWithError(err, "containerregistry.RunsCancelFuture", "Result", future.Response(), "Polling failure") 124 return 125 } 126 if !done { 127 err = azure.NewAsyncOpIncompleteError("containerregistry.RunsCancelFuture") 128 return 129 } 130 ar.Response = future.Response() 131 return 132 } 133 return 134} 135 136// CancelResponder handles the response to the Cancel request. The method always 137// closes the http.Response Body. 138func (client RunsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { 139 err = autorest.Respond( 140 resp, 141 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 142 autorest.ByClosing()) 143 result.Response = resp 144 return 145} 146 147// Get gets the detailed information for a given run. 148// Parameters: 149// resourceGroupName - the name of the resource group to which the container registry belongs. 150// registryName - the name of the container registry. 151// runID - the run ID. 152func (client RunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, runID string) (result Run, err error) { 153 if tracing.IsEnabled() { 154 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Get") 155 defer func() { 156 sc := -1 157 if result.Response.Response != nil { 158 sc = result.Response.Response.StatusCode 159 } 160 tracing.EndSpan(ctx, sc, err) 161 }() 162 } 163 if err := validation.Validate([]validation.Validation{ 164 {TargetValue: resourceGroupName, 165 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 166 {TargetValue: registryName, 167 Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 168 {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, 169 {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { 170 return result, validation.NewError("containerregistry.RunsClient", "Get", err.Error()) 171 } 172 173 req, err := client.GetPreparer(ctx, resourceGroupName, registryName, runID) 174 if err != nil { 175 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", nil, "Failure preparing request") 176 return 177 } 178 179 resp, err := client.GetSender(req) 180 if err != nil { 181 result.Response = autorest.Response{Response: resp} 182 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", resp, "Failure sending request") 183 return 184 } 185 186 result, err = client.GetResponder(resp) 187 if err != nil { 188 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", resp, "Failure responding to request") 189 return 190 } 191 192 return 193} 194 195// GetPreparer prepares the Get request. 196func (client RunsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { 197 pathParameters := map[string]interface{}{ 198 "registryName": autorest.Encode("path", registryName), 199 "resourceGroupName": autorest.Encode("path", resourceGroupName), 200 "runId": autorest.Encode("path", runID), 201 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 202 } 203 204 const APIVersion = "2019-06-01-preview" 205 queryParameters := map[string]interface{}{ 206 "api-version": APIVersion, 207 } 208 209 preparer := autorest.CreatePreparer( 210 autorest.AsGet(), 211 autorest.WithBaseURL(client.BaseURI), 212 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}", pathParameters), 213 autorest.WithQueryParameters(queryParameters)) 214 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 215} 216 217// GetSender sends the Get request. The method will close the 218// http.Response Body if it receives an error. 219func (client RunsClient) GetSender(req *http.Request) (*http.Response, error) { 220 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 221} 222 223// GetResponder handles the response to the Get request. The method always 224// closes the http.Response Body. 225func (client RunsClient) GetResponder(resp *http.Response) (result Run, err error) { 226 err = autorest.Respond( 227 resp, 228 azure.WithErrorUnlessStatusCode(http.StatusOK), 229 autorest.ByUnmarshallingJSON(&result), 230 autorest.ByClosing()) 231 result.Response = autorest.Response{Response: resp} 232 return 233} 234 235// GetLogSasURL gets a link to download the run logs. 236// Parameters: 237// resourceGroupName - the name of the resource group to which the container registry belongs. 238// registryName - the name of the container registry. 239// runID - the run ID. 240func (client RunsClient) GetLogSasURL(ctx context.Context, resourceGroupName string, registryName string, runID string) (result RunGetLogResult, err error) { 241 if tracing.IsEnabled() { 242 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.GetLogSasURL") 243 defer func() { 244 sc := -1 245 if result.Response.Response != nil { 246 sc = result.Response.Response.StatusCode 247 } 248 tracing.EndSpan(ctx, sc, err) 249 }() 250 } 251 if err := validation.Validate([]validation.Validation{ 252 {TargetValue: resourceGroupName, 253 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 254 {TargetValue: registryName, 255 Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 256 {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, 257 {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { 258 return result, validation.NewError("containerregistry.RunsClient", "GetLogSasURL", err.Error()) 259 } 260 261 req, err := client.GetLogSasURLPreparer(ctx, resourceGroupName, registryName, runID) 262 if err != nil { 263 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", nil, "Failure preparing request") 264 return 265 } 266 267 resp, err := client.GetLogSasURLSender(req) 268 if err != nil { 269 result.Response = autorest.Response{Response: resp} 270 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", resp, "Failure sending request") 271 return 272 } 273 274 result, err = client.GetLogSasURLResponder(resp) 275 if err != nil { 276 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", resp, "Failure responding to request") 277 return 278 } 279 280 return 281} 282 283// GetLogSasURLPreparer prepares the GetLogSasURL request. 284func (client RunsClient) GetLogSasURLPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { 285 pathParameters := map[string]interface{}{ 286 "registryName": autorest.Encode("path", registryName), 287 "resourceGroupName": autorest.Encode("path", resourceGroupName), 288 "runId": autorest.Encode("path", runID), 289 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 290 } 291 292 const APIVersion = "2019-06-01-preview" 293 queryParameters := map[string]interface{}{ 294 "api-version": APIVersion, 295 } 296 297 preparer := autorest.CreatePreparer( 298 autorest.AsPost(), 299 autorest.WithBaseURL(client.BaseURI), 300 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl", pathParameters), 301 autorest.WithQueryParameters(queryParameters)) 302 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 303} 304 305// GetLogSasURLSender sends the GetLogSasURL request. The method will close the 306// http.Response Body if it receives an error. 307func (client RunsClient) GetLogSasURLSender(req *http.Request) (*http.Response, error) { 308 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 309} 310 311// GetLogSasURLResponder handles the response to the GetLogSasURL request. The method always 312// closes the http.Response Body. 313func (client RunsClient) GetLogSasURLResponder(resp *http.Response) (result RunGetLogResult, err error) { 314 err = autorest.Respond( 315 resp, 316 azure.WithErrorUnlessStatusCode(http.StatusOK), 317 autorest.ByUnmarshallingJSON(&result), 318 autorest.ByClosing()) 319 result.Response = autorest.Response{Response: resp} 320 return 321} 322 323// List gets all the runs for a registry. 324// Parameters: 325// resourceGroupName - the name of the resource group to which the container registry belongs. 326// registryName - the name of the container registry. 327// filter - the runs filter to apply on the operation. Arithmetic operators are not supported. The allowed 328// string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. 329// top - $top is supported for get list of runs, which limits the maximum number of runs to return. 330func (client RunsClient) List(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result RunListResultPage, err error) { 331 if tracing.IsEnabled() { 332 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.List") 333 defer func() { 334 sc := -1 335 if result.rlr.Response.Response != nil { 336 sc = result.rlr.Response.Response.StatusCode 337 } 338 tracing.EndSpan(ctx, sc, err) 339 }() 340 } 341 if err := validation.Validate([]validation.Validation{ 342 {TargetValue: resourceGroupName, 343 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 344 {TargetValue: registryName, 345 Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 346 {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, 347 {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { 348 return result, validation.NewError("containerregistry.RunsClient", "List", err.Error()) 349 } 350 351 result.fn = client.listNextResults 352 req, err := client.ListPreparer(ctx, resourceGroupName, registryName, filter, top) 353 if err != nil { 354 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", nil, "Failure preparing request") 355 return 356 } 357 358 resp, err := client.ListSender(req) 359 if err != nil { 360 result.rlr.Response = autorest.Response{Response: resp} 361 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", resp, "Failure sending request") 362 return 363 } 364 365 result.rlr, err = client.ListResponder(resp) 366 if err != nil { 367 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", resp, "Failure responding to request") 368 return 369 } 370 if result.rlr.hasNextLink() && result.rlr.IsEmpty() { 371 err = result.NextWithContext(ctx) 372 return 373 } 374 375 return 376} 377 378// ListPreparer prepares the List request. 379func (client RunsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (*http.Request, error) { 380 pathParameters := map[string]interface{}{ 381 "registryName": autorest.Encode("path", registryName), 382 "resourceGroupName": autorest.Encode("path", resourceGroupName), 383 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 384 } 385 386 const APIVersion = "2019-06-01-preview" 387 queryParameters := map[string]interface{}{ 388 "api-version": APIVersion, 389 } 390 if len(filter) > 0 { 391 queryParameters["$filter"] = autorest.Encode("query", filter) 392 } 393 if top != nil { 394 queryParameters["$top"] = autorest.Encode("query", *top) 395 } 396 397 preparer := autorest.CreatePreparer( 398 autorest.AsGet(), 399 autorest.WithBaseURL(client.BaseURI), 400 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs", pathParameters), 401 autorest.WithQueryParameters(queryParameters)) 402 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 403} 404 405// ListSender sends the List request. The method will close the 406// http.Response Body if it receives an error. 407func (client RunsClient) ListSender(req *http.Request) (*http.Response, error) { 408 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 409} 410 411// ListResponder handles the response to the List request. The method always 412// closes the http.Response Body. 413func (client RunsClient) ListResponder(resp *http.Response) (result RunListResult, err error) { 414 err = autorest.Respond( 415 resp, 416 azure.WithErrorUnlessStatusCode(http.StatusOK), 417 autorest.ByUnmarshallingJSON(&result), 418 autorest.ByClosing()) 419 result.Response = autorest.Response{Response: resp} 420 return 421} 422 423// listNextResults retrieves the next set of results, if any. 424func (client RunsClient) listNextResults(ctx context.Context, lastResults RunListResult) (result RunListResult, err error) { 425 req, err := lastResults.runListResultPreparer(ctx) 426 if err != nil { 427 return result, autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", nil, "Failure preparing next results request") 428 } 429 if req == nil { 430 return 431 } 432 resp, err := client.ListSender(req) 433 if err != nil { 434 result.Response = autorest.Response{Response: resp} 435 return result, autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", resp, "Failure sending next results request") 436 } 437 result, err = client.ListResponder(resp) 438 if err != nil { 439 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", resp, "Failure responding to next results request") 440 } 441 return 442} 443 444// ListComplete enumerates all values, automatically crossing page boundaries as required. 445func (client RunsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result RunListResultIterator, err error) { 446 if tracing.IsEnabled() { 447 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.List") 448 defer func() { 449 sc := -1 450 if result.Response().Response.Response != nil { 451 sc = result.page.Response().Response.Response.StatusCode 452 } 453 tracing.EndSpan(ctx, sc, err) 454 }() 455 } 456 result.page, err = client.List(ctx, resourceGroupName, registryName, filter, top) 457 return 458} 459 460// Update patch the run properties. 461// Parameters: 462// resourceGroupName - the name of the resource group to which the container registry belongs. 463// registryName - the name of the container registry. 464// runID - the run ID. 465// runUpdateParameters - the run update properties. 466func (client RunsClient) Update(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters) (result RunsUpdateFuture, err error) { 467 if tracing.IsEnabled() { 468 ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Update") 469 defer func() { 470 sc := -1 471 if result.Response() != nil { 472 sc = result.Response().StatusCode 473 } 474 tracing.EndSpan(ctx, sc, err) 475 }() 476 } 477 if err := validation.Validate([]validation.Validation{ 478 {TargetValue: resourceGroupName, 479 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 480 {TargetValue: registryName, 481 Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, 482 {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, 483 {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { 484 return result, validation.NewError("containerregistry.RunsClient", "Update", err.Error()) 485 } 486 487 req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, runID, runUpdateParameters) 488 if err != nil { 489 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", nil, "Failure preparing request") 490 return 491 } 492 493 result, err = client.UpdateSender(req) 494 if err != nil { 495 err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", nil, "Failure sending request") 496 return 497 } 498 499 return 500} 501 502// UpdatePreparer prepares the Update request. 503func (client RunsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters) (*http.Request, error) { 504 pathParameters := map[string]interface{}{ 505 "registryName": autorest.Encode("path", registryName), 506 "resourceGroupName": autorest.Encode("path", resourceGroupName), 507 "runId": autorest.Encode("path", runID), 508 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 509 } 510 511 const APIVersion = "2019-06-01-preview" 512 queryParameters := map[string]interface{}{ 513 "api-version": APIVersion, 514 } 515 516 preparer := autorest.CreatePreparer( 517 autorest.AsContentType("application/json; charset=utf-8"), 518 autorest.AsPatch(), 519 autorest.WithBaseURL(client.BaseURI), 520 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}", pathParameters), 521 autorest.WithJSON(runUpdateParameters), 522 autorest.WithQueryParameters(queryParameters)) 523 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 524} 525 526// UpdateSender sends the Update request. The method will close the 527// http.Response Body if it receives an error. 528func (client RunsClient) UpdateSender(req *http.Request) (future RunsUpdateFuture, err error) { 529 var resp *http.Response 530 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 531 if err != nil { 532 return 533 } 534 var azf azure.Future 535 azf, err = azure.NewFutureFromResponse(resp) 536 future.FutureAPI = &azf 537 future.Result = func(client RunsClient) (r Run, err error) { 538 var done bool 539 done, err = future.DoneWithContext(context.Background(), client) 540 if err != nil { 541 err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", future.Response(), "Polling failure") 542 return 543 } 544 if !done { 545 err = azure.NewAsyncOpIncompleteError("containerregistry.RunsUpdateFuture") 546 return 547 } 548 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 549 if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { 550 r, err = client.UpdateResponder(r.Response.Response) 551 if err != nil { 552 err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", r.Response.Response, "Failure responding to request") 553 } 554 } 555 return 556 } 557 return 558} 559 560// UpdateResponder handles the response to the Update request. The method always 561// closes the http.Response Body. 562func (client RunsClient) UpdateResponder(resp *http.Response) (result Run, err error) { 563 err = autorest.Respond( 564 resp, 565 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 566 autorest.ByUnmarshallingJSON(&result), 567 autorest.ByClosing()) 568 result.Response = autorest.Response{Response: resp} 569 return 570} 571