1package network 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/tracing" 25 "net/http" 26) 27 28// AzureFirewallsClient is the network Client 29type AzureFirewallsClient struct { 30 BaseClient 31} 32 33// NewAzureFirewallsClient creates an instance of the AzureFirewallsClient client. 34func NewAzureFirewallsClient(subscriptionID string) AzureFirewallsClient { 35 return NewAzureFirewallsClientWithBaseURI(DefaultBaseURI, subscriptionID) 36} 37 38// NewAzureFirewallsClientWithBaseURI creates an instance of the AzureFirewallsClient client using a custom endpoint. 39// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 40func NewAzureFirewallsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallsClient { 41 return AzureFirewallsClient{NewWithBaseURI(baseURI, subscriptionID)} 42} 43 44// CreateOrUpdate creates or updates the specified Azure Firewall. 45// Parameters: 46// resourceGroupName - the name of the resource group. 47// azureFirewallName - the name of the Azure Firewall. 48// parameters - parameters supplied to the create or update Azure Firewall operation. 49func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (result AzureFirewallsCreateOrUpdateFuture, err error) { 50 if tracing.IsEnabled() { 51 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.CreateOrUpdate") 52 defer func() { 53 sc := -1 54 if result.Response() != nil { 55 sc = result.Response().StatusCode 56 } 57 tracing.EndSpan(ctx, sc, err) 58 }() 59 } 60 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, azureFirewallName, parameters) 61 if err != nil { 62 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure preparing request") 63 return 64 } 65 66 result, err = client.CreateOrUpdateSender(req) 67 if err != nil { 68 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure sending request") 69 return 70 } 71 72 return 73} 74 75// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 76func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (*http.Request, error) { 77 pathParameters := map[string]interface{}{ 78 "azureFirewallName": autorest.Encode("path", azureFirewallName), 79 "resourceGroupName": autorest.Encode("path", resourceGroupName), 80 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 81 } 82 83 const APIVersion = "2019-07-01" 84 queryParameters := map[string]interface{}{ 85 "api-version": APIVersion, 86 } 87 88 parameters.Etag = nil 89 preparer := autorest.CreatePreparer( 90 autorest.AsContentType("application/json; charset=utf-8"), 91 autorest.AsPut(), 92 autorest.WithBaseURL(client.BaseURI), 93 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), 94 autorest.WithJSON(parameters), 95 autorest.WithQueryParameters(queryParameters)) 96 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 97} 98 99// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 100// http.Response Body if it receives an error. 101func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (future AzureFirewallsCreateOrUpdateFuture, err error) { 102 var resp *http.Response 103 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 104 if err != nil { 105 return 106 } 107 var azf azure.Future 108 azf, err = azure.NewFutureFromResponse(resp) 109 future.FutureAPI = &azf 110 future.Result = func(client AzureFirewallsClient) (af AzureFirewall, err error) { 111 var done bool 112 done, err = future.DoneWithContext(context.Background(), client) 113 if err != nil { 114 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 115 return 116 } 117 if !done { 118 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") 119 return 120 } 121 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 122 if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { 123 af, err = client.CreateOrUpdateResponder(af.Response.Response) 124 if err != nil { 125 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request") 126 } 127 } 128 return 129 } 130 return 131} 132 133// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 134// closes the http.Response Body. 135func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { 136 err = autorest.Respond( 137 resp, 138 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 139 autorest.ByUnmarshallingJSON(&result), 140 autorest.ByClosing()) 141 result.Response = autorest.Response{Response: resp} 142 return 143} 144 145// Delete deletes the specified Azure Firewall. 146// Parameters: 147// resourceGroupName - the name of the resource group. 148// azureFirewallName - the name of the Azure Firewall. 149func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsDeleteFuture, err error) { 150 if tracing.IsEnabled() { 151 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Delete") 152 defer func() { 153 sc := -1 154 if result.Response() != nil { 155 sc = result.Response().StatusCode 156 } 157 tracing.EndSpan(ctx, sc, err) 158 }() 159 } 160 req, err := client.DeletePreparer(ctx, resourceGroupName, azureFirewallName) 161 if err != nil { 162 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure preparing request") 163 return 164 } 165 166 result, err = client.DeleteSender(req) 167 if err != nil { 168 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure sending request") 169 return 170 } 171 172 return 173} 174 175// DeletePreparer prepares the Delete request. 176func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { 177 pathParameters := map[string]interface{}{ 178 "azureFirewallName": autorest.Encode("path", azureFirewallName), 179 "resourceGroupName": autorest.Encode("path", resourceGroupName), 180 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 181 } 182 183 const APIVersion = "2019-07-01" 184 queryParameters := map[string]interface{}{ 185 "api-version": APIVersion, 186 } 187 188 preparer := autorest.CreatePreparer( 189 autorest.AsDelete(), 190 autorest.WithBaseURL(client.BaseURI), 191 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), 192 autorest.WithQueryParameters(queryParameters)) 193 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 194} 195 196// DeleteSender sends the Delete request. The method will close the 197// http.Response Body if it receives an error. 198func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future AzureFirewallsDeleteFuture, err error) { 199 var resp *http.Response 200 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 201 if err != nil { 202 return 203 } 204 var azf azure.Future 205 azf, err = azure.NewFutureFromResponse(resp) 206 future.FutureAPI = &azf 207 future.Result = func(client AzureFirewallsClient) (ar autorest.Response, err error) { 208 var done bool 209 done, err = future.DoneWithContext(context.Background(), client) 210 if err != nil { 211 err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure") 212 return 213 } 214 if !done { 215 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") 216 return 217 } 218 ar.Response = future.Response() 219 return 220 } 221 return 222} 223 224// DeleteResponder handles the response to the Delete request. The method always 225// closes the http.Response Body. 226func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 227 err = autorest.Respond( 228 resp, 229 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 230 autorest.ByClosing()) 231 result.Response = resp 232 return 233} 234 235// Get gets the specified Azure Firewall. 236// Parameters: 237// resourceGroupName - the name of the resource group. 238// azureFirewallName - the name of the Azure Firewall. 239func (client AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewall, err error) { 240 if tracing.IsEnabled() { 241 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Get") 242 defer func() { 243 sc := -1 244 if result.Response.Response != nil { 245 sc = result.Response.Response.StatusCode 246 } 247 tracing.EndSpan(ctx, sc, err) 248 }() 249 } 250 req, err := client.GetPreparer(ctx, resourceGroupName, azureFirewallName) 251 if err != nil { 252 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", nil, "Failure preparing request") 253 return 254 } 255 256 resp, err := client.GetSender(req) 257 if err != nil { 258 result.Response = autorest.Response{Response: resp} 259 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure sending request") 260 return 261 } 262 263 result, err = client.GetResponder(resp) 264 if err != nil { 265 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure responding to request") 266 return 267 } 268 269 return 270} 271 272// GetPreparer prepares the Get request. 273func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { 274 pathParameters := map[string]interface{}{ 275 "azureFirewallName": autorest.Encode("path", azureFirewallName), 276 "resourceGroupName": autorest.Encode("path", resourceGroupName), 277 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 278 } 279 280 const APIVersion = "2019-07-01" 281 queryParameters := map[string]interface{}{ 282 "api-version": APIVersion, 283 } 284 285 preparer := autorest.CreatePreparer( 286 autorest.AsGet(), 287 autorest.WithBaseURL(client.BaseURI), 288 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), 289 autorest.WithQueryParameters(queryParameters)) 290 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 291} 292 293// GetSender sends the Get request. The method will close the 294// http.Response Body if it receives an error. 295func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, error) { 296 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 297} 298 299// GetResponder handles the response to the Get request. The method always 300// closes the http.Response Body. 301func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { 302 err = autorest.Respond( 303 resp, 304 azure.WithErrorUnlessStatusCode(http.StatusOK), 305 autorest.ByUnmarshallingJSON(&result), 306 autorest.ByClosing()) 307 result.Response = autorest.Response{Response: resp} 308 return 309} 310 311// List lists all Azure Firewalls in a resource group. 312// Parameters: 313// resourceGroupName - the name of the resource group. 314func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultPage, err error) { 315 if tracing.IsEnabled() { 316 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") 317 defer func() { 318 sc := -1 319 if result.aflr.Response.Response != nil { 320 sc = result.aflr.Response.Response.StatusCode 321 } 322 tracing.EndSpan(ctx, sc, err) 323 }() 324 } 325 result.fn = client.listNextResults 326 req, err := client.ListPreparer(ctx, resourceGroupName) 327 if err != nil { 328 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", nil, "Failure preparing request") 329 return 330 } 331 332 resp, err := client.ListSender(req) 333 if err != nil { 334 result.aflr.Response = autorest.Response{Response: resp} 335 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure sending request") 336 return 337 } 338 339 result.aflr, err = client.ListResponder(resp) 340 if err != nil { 341 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") 342 return 343 } 344 if result.aflr.hasNextLink() && result.aflr.IsEmpty() { 345 err = result.NextWithContext(ctx) 346 return 347 } 348 349 return 350} 351 352// ListPreparer prepares the List request. 353func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 354 pathParameters := map[string]interface{}{ 355 "resourceGroupName": autorest.Encode("path", resourceGroupName), 356 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 357 } 358 359 const APIVersion = "2019-07-01" 360 queryParameters := map[string]interface{}{ 361 "api-version": APIVersion, 362 } 363 364 preparer := autorest.CreatePreparer( 365 autorest.AsGet(), 366 autorest.WithBaseURL(client.BaseURI), 367 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls", pathParameters), 368 autorest.WithQueryParameters(queryParameters)) 369 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 370} 371 372// ListSender sends the List request. The method will close the 373// http.Response Body if it receives an error. 374func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response, error) { 375 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 376} 377 378// ListResponder handles the response to the List request. The method always 379// closes the http.Response Body. 380func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { 381 err = autorest.Respond( 382 resp, 383 azure.WithErrorUnlessStatusCode(http.StatusOK), 384 autorest.ByUnmarshallingJSON(&result), 385 autorest.ByClosing()) 386 result.Response = autorest.Response{Response: resp} 387 return 388} 389 390// listNextResults retrieves the next set of results, if any. 391func (client AzureFirewallsClient) listNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { 392 req, err := lastResults.azureFirewallListResultPreparer(ctx) 393 if err != nil { 394 return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", nil, "Failure preparing next results request") 395 } 396 if req == nil { 397 return 398 } 399 resp, err := client.ListSender(req) 400 if err != nil { 401 result.Response = autorest.Response{Response: resp} 402 return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure sending next results request") 403 } 404 result, err = client.ListResponder(resp) 405 if err != nil { 406 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure responding to next results request") 407 } 408 return 409} 410 411// ListComplete enumerates all values, automatically crossing page boundaries as required. 412func (client AzureFirewallsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultIterator, err error) { 413 if tracing.IsEnabled() { 414 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") 415 defer func() { 416 sc := -1 417 if result.Response().Response.Response != nil { 418 sc = result.page.Response().Response.Response.StatusCode 419 } 420 tracing.EndSpan(ctx, sc, err) 421 }() 422 } 423 result.page, err = client.List(ctx, resourceGroupName) 424 return 425} 426 427// ListAll gets all the Azure Firewalls in a subscription. 428func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFirewallListResultPage, err error) { 429 if tracing.IsEnabled() { 430 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") 431 defer func() { 432 sc := -1 433 if result.aflr.Response.Response != nil { 434 sc = result.aflr.Response.Response.StatusCode 435 } 436 tracing.EndSpan(ctx, sc, err) 437 }() 438 } 439 result.fn = client.listAllNextResults 440 req, err := client.ListAllPreparer(ctx) 441 if err != nil { 442 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", nil, "Failure preparing request") 443 return 444 } 445 446 resp, err := client.ListAllSender(req) 447 if err != nil { 448 result.aflr.Response = autorest.Response{Response: resp} 449 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure sending request") 450 return 451 } 452 453 result.aflr, err = client.ListAllResponder(resp) 454 if err != nil { 455 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") 456 return 457 } 458 if result.aflr.hasNextLink() && result.aflr.IsEmpty() { 459 err = result.NextWithContext(ctx) 460 return 461 } 462 463 return 464} 465 466// ListAllPreparer prepares the ListAll request. 467func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { 468 pathParameters := map[string]interface{}{ 469 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 470 } 471 472 const APIVersion = "2019-07-01" 473 queryParameters := map[string]interface{}{ 474 "api-version": APIVersion, 475 } 476 477 preparer := autorest.CreatePreparer( 478 autorest.AsGet(), 479 autorest.WithBaseURL(client.BaseURI), 480 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls", pathParameters), 481 autorest.WithQueryParameters(queryParameters)) 482 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 483} 484 485// ListAllSender sends the ListAll request. The method will close the 486// http.Response Body if it receives an error. 487func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Response, error) { 488 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 489} 490 491// ListAllResponder handles the response to the ListAll request. The method always 492// closes the http.Response Body. 493func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { 494 err = autorest.Respond( 495 resp, 496 azure.WithErrorUnlessStatusCode(http.StatusOK), 497 autorest.ByUnmarshallingJSON(&result), 498 autorest.ByClosing()) 499 result.Response = autorest.Response{Response: resp} 500 return 501} 502 503// listAllNextResults retrieves the next set of results, if any. 504func (client AzureFirewallsClient) listAllNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { 505 req, err := lastResults.azureFirewallListResultPreparer(ctx) 506 if err != nil { 507 return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", nil, "Failure preparing next results request") 508 } 509 if req == nil { 510 return 511 } 512 resp, err := client.ListAllSender(req) 513 if err != nil { 514 result.Response = autorest.Response{Response: resp} 515 return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure sending next results request") 516 } 517 result, err = client.ListAllResponder(resp) 518 if err != nil { 519 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure responding to next results request") 520 } 521 return 522} 523 524// ListAllComplete enumerates all values, automatically crossing page boundaries as required. 525func (client AzureFirewallsClient) ListAllComplete(ctx context.Context) (result AzureFirewallListResultIterator, err error) { 526 if tracing.IsEnabled() { 527 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") 528 defer func() { 529 sc := -1 530 if result.Response().Response.Response != nil { 531 sc = result.page.Response().Response.Response.StatusCode 532 } 533 tracing.EndSpan(ctx, sc, err) 534 }() 535 } 536 result.page, err = client.ListAll(ctx) 537 return 538} 539 540// UpdateTags updates tags for an Azure Firewall resource. 541// Parameters: 542// resourceGroupName - the name of the resource group. 543// azureFirewallName - the name of the Azure Firewall. 544// parameters - parameters supplied to the create or update Azure Firewall operation. 545func (client AzureFirewallsClient) UpdateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (result AzureFirewall, err error) { 546 if tracing.IsEnabled() { 547 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.UpdateTags") 548 defer func() { 549 sc := -1 550 if result.Response.Response != nil { 551 sc = result.Response.Response.StatusCode 552 } 553 tracing.EndSpan(ctx, sc, err) 554 }() 555 } 556 req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, azureFirewallName, parameters) 557 if err != nil { 558 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", nil, "Failure preparing request") 559 return 560 } 561 562 resp, err := client.UpdateTagsSender(req) 563 if err != nil { 564 result.Response = autorest.Response{Response: resp} 565 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", resp, "Failure sending request") 566 return 567 } 568 569 result, err = client.UpdateTagsResponder(resp) 570 if err != nil { 571 err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", resp, "Failure responding to request") 572 return 573 } 574 575 return 576} 577 578// UpdateTagsPreparer prepares the UpdateTags request. 579func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (*http.Request, error) { 580 pathParameters := map[string]interface{}{ 581 "azureFirewallName": autorest.Encode("path", azureFirewallName), 582 "resourceGroupName": autorest.Encode("path", resourceGroupName), 583 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 584 } 585 586 const APIVersion = "2019-07-01" 587 queryParameters := map[string]interface{}{ 588 "api-version": APIVersion, 589 } 590 591 parameters.Etag = nil 592 preparer := autorest.CreatePreparer( 593 autorest.AsContentType("application/json; charset=utf-8"), 594 autorest.AsPatch(), 595 autorest.WithBaseURL(client.BaseURI), 596 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), 597 autorest.WithJSON(parameters), 598 autorest.WithQueryParameters(queryParameters)) 599 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 600} 601 602// UpdateTagsSender sends the UpdateTags request. The method will close the 603// http.Response Body if it receives an error. 604func (client AzureFirewallsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { 605 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 606} 607 608// UpdateTagsResponder handles the response to the UpdateTags request. The method always 609// closes the http.Response Body. 610func (client AzureFirewallsClient) UpdateTagsResponder(resp *http.Response) (result AzureFirewall, err error) { 611 err = autorest.Respond( 612 resp, 613 azure.WithErrorUnlessStatusCode(http.StatusOK), 614 autorest.ByUnmarshallingJSON(&result), 615 autorest.ByClosing()) 616 result.Response = autorest.Response{Response: resp} 617 return 618} 619