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