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// PrivateLinkServicesClient is the network Client 18type PrivateLinkServicesClient struct { 19 BaseClient 20} 21 22// NewPrivateLinkServicesClient creates an instance of the PrivateLinkServicesClient client. 23func NewPrivateLinkServicesClient(subscriptionID string) PrivateLinkServicesClient { 24 return NewPrivateLinkServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) 25} 26 27// NewPrivateLinkServicesClientWithBaseURI creates an instance of the PrivateLinkServicesClient client using a custom 28// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure 29// stack). 30func NewPrivateLinkServicesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkServicesClient { 31 return PrivateLinkServicesClient{NewWithBaseURI(baseURI, subscriptionID)} 32} 33 34// CheckPrivateLinkServiceVisibility checks whether the subscription is visible to private link service. 35// Parameters: 36// location - the location of the domain name. 37// parameters - the request body of CheckPrivateLinkService API call. 38func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { 39 if tracing.IsEnabled() { 40 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility") 41 defer func() { 42 sc := -1 43 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 44 sc = result.FutureAPI.Response().StatusCode 45 } 46 tracing.EndSpan(ctx, sc, err) 47 }() 48 } 49 req, err := client.CheckPrivateLinkServiceVisibilityPreparer(ctx, location, parameters) 50 if err != nil { 51 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure preparing request") 52 return 53 } 54 55 result, err = client.CheckPrivateLinkServiceVisibilitySender(req) 56 if err != nil { 57 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure sending request") 58 return 59 } 60 61 return 62} 63 64// CheckPrivateLinkServiceVisibilityPreparer prepares the CheckPrivateLinkServiceVisibility request. 65func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPreparer(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { 66 pathParameters := map[string]interface{}{ 67 "location": autorest.Encode("path", location), 68 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 69 } 70 71 const APIVersion = "2019-07-01" 72 queryParameters := map[string]interface{}{ 73 "api-version": APIVersion, 74 } 75 76 preparer := autorest.CreatePreparer( 77 autorest.AsContentType("application/json; charset=utf-8"), 78 autorest.AsPost(), 79 autorest.WithBaseURL(client.BaseURI), 80 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), 81 autorest.WithJSON(parameters), 82 autorest.WithQueryParameters(queryParameters)) 83 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 84} 85 86// CheckPrivateLinkServiceVisibilitySender sends the CheckPrivateLinkServiceVisibility request. The method will close the 87// http.Response Body if it receives an error. 88func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { 89 var resp *http.Response 90 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 91 if err != nil { 92 return 93 } 94 var azf azure.Future 95 azf, err = azure.NewFutureFromResponse(resp) 96 future.FutureAPI = &azf 97 future.Result = future.result 98 return 99} 100 101// CheckPrivateLinkServiceVisibilityResponder handles the response to the CheckPrivateLinkServiceVisibility request. The method always 102// closes the http.Response Body. 103func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { 104 err = autorest.Respond( 105 resp, 106 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 107 autorest.ByUnmarshallingJSON(&result), 108 autorest.ByClosing()) 109 result.Response = autorest.Response{Response: resp} 110 return 111} 112 113// CheckPrivateLinkServiceVisibilityByResourceGroup checks whether the subscription is visible to private link service 114// in the specified resource group. 115// Parameters: 116// location - the location of the domain name. 117// resourceGroupName - the name of the resource group. 118// parameters - the request body of CheckPrivateLinkService API call. 119func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { 120 if tracing.IsEnabled() { 121 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup") 122 defer func() { 123 sc := -1 124 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 125 sc = result.FutureAPI.Response().StatusCode 126 } 127 tracing.EndSpan(ctx, sc, err) 128 }() 129 } 130 req, err := client.CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx, location, resourceGroupName, parameters) 131 if err != nil { 132 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure preparing request") 133 return 134 } 135 136 result, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupSender(req) 137 if err != nil { 138 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure sending request") 139 return 140 } 141 142 return 143} 144 145// CheckPrivateLinkServiceVisibilityByResourceGroupPreparer prepares the CheckPrivateLinkServiceVisibilityByResourceGroup request. 146func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { 147 pathParameters := map[string]interface{}{ 148 "location": autorest.Encode("path", location), 149 "resourceGroupName": autorest.Encode("path", resourceGroupName), 150 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 151 } 152 153 const APIVersion = "2019-07-01" 154 queryParameters := map[string]interface{}{ 155 "api-version": APIVersion, 156 } 157 158 preparer := autorest.CreatePreparer( 159 autorest.AsContentType("application/json; charset=utf-8"), 160 autorest.AsPost(), 161 autorest.WithBaseURL(client.BaseURI), 162 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), 163 autorest.WithJSON(parameters), 164 autorest.WithQueryParameters(queryParameters)) 165 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 166} 167 168// CheckPrivateLinkServiceVisibilityByResourceGroupSender sends the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method will close the 169// http.Response Body if it receives an error. 170func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupSender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, 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// CheckPrivateLinkServiceVisibilityByResourceGroupResponder handles the response to the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method always 184// closes the http.Response Body. 185func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { 186 err = autorest.Respond( 187 resp, 188 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 189 autorest.ByUnmarshallingJSON(&result), 190 autorest.ByClosing()) 191 result.Response = autorest.Response{Response: resp} 192 return 193} 194 195// CreateOrUpdate creates or updates an private link service in the specified resource group. 196// Parameters: 197// resourceGroupName - the name of the resource group. 198// serviceName - the name of the private link service. 199// parameters - parameters supplied to the create or update private link service operation. 200func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (result PrivateLinkServicesCreateOrUpdateFuture, err error) { 201 if tracing.IsEnabled() { 202 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CreateOrUpdate") 203 defer func() { 204 sc := -1 205 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 206 sc = result.FutureAPI.Response().StatusCode 207 } 208 tracing.EndSpan(ctx, sc, err) 209 }() 210 } 211 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) 212 if err != nil { 213 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure preparing request") 214 return 215 } 216 217 result, err = client.CreateOrUpdateSender(req) 218 if err != nil { 219 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure sending request") 220 return 221 } 222 223 return 224} 225 226// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 227func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (*http.Request, error) { 228 pathParameters := map[string]interface{}{ 229 "resourceGroupName": autorest.Encode("path", resourceGroupName), 230 "serviceName": autorest.Encode("path", serviceName), 231 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 232 } 233 234 const APIVersion = "2019-07-01" 235 queryParameters := map[string]interface{}{ 236 "api-version": APIVersion, 237 } 238 239 preparer := autorest.CreatePreparer( 240 autorest.AsContentType("application/json; charset=utf-8"), 241 autorest.AsPut(), 242 autorest.WithBaseURL(client.BaseURI), 243 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), 244 autorest.WithJSON(parameters), 245 autorest.WithQueryParameters(queryParameters)) 246 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 247} 248 249// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 250// http.Response Body if it receives an error. 251func (client PrivateLinkServicesClient) CreateOrUpdateSender(req *http.Request) (future PrivateLinkServicesCreateOrUpdateFuture, err error) { 252 var resp *http.Response 253 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 254 if err != nil { 255 return 256 } 257 var azf azure.Future 258 azf, err = azure.NewFutureFromResponse(resp) 259 future.FutureAPI = &azf 260 future.Result = future.result 261 return 262} 263 264// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 265// closes the http.Response Body. 266func (client PrivateLinkServicesClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkService, err error) { 267 err = autorest.Respond( 268 resp, 269 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 270 autorest.ByUnmarshallingJSON(&result), 271 autorest.ByClosing()) 272 result.Response = autorest.Response{Response: resp} 273 return 274} 275 276// Delete deletes the specified private link service. 277// Parameters: 278// resourceGroupName - the name of the resource group. 279// serviceName - the name of the private link service. 280func (client PrivateLinkServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateLinkServicesDeleteFuture, err error) { 281 if tracing.IsEnabled() { 282 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Delete") 283 defer func() { 284 sc := -1 285 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 286 sc = result.FutureAPI.Response().StatusCode 287 } 288 tracing.EndSpan(ctx, sc, err) 289 }() 290 } 291 req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName) 292 if err != nil { 293 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure preparing request") 294 return 295 } 296 297 result, err = client.DeleteSender(req) 298 if err != nil { 299 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure sending request") 300 return 301 } 302 303 return 304} 305 306// DeletePreparer prepares the Delete request. 307func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { 308 pathParameters := map[string]interface{}{ 309 "resourceGroupName": autorest.Encode("path", resourceGroupName), 310 "serviceName": autorest.Encode("path", serviceName), 311 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 312 } 313 314 const APIVersion = "2019-07-01" 315 queryParameters := map[string]interface{}{ 316 "api-version": APIVersion, 317 } 318 319 preparer := autorest.CreatePreparer( 320 autorest.AsDelete(), 321 autorest.WithBaseURL(client.BaseURI), 322 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), 323 autorest.WithQueryParameters(queryParameters)) 324 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 325} 326 327// DeleteSender sends the Delete request. The method will close the 328// http.Response Body if it receives an error. 329func (client PrivateLinkServicesClient) DeleteSender(req *http.Request) (future PrivateLinkServicesDeleteFuture, err error) { 330 var resp *http.Response 331 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 332 if err != nil { 333 return 334 } 335 var azf azure.Future 336 azf, err = azure.NewFutureFromResponse(resp) 337 future.FutureAPI = &azf 338 future.Result = future.result 339 return 340} 341 342// DeleteResponder handles the response to the Delete request. The method always 343// closes the http.Response Body. 344func (client PrivateLinkServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 345 err = autorest.Respond( 346 resp, 347 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 348 autorest.ByClosing()) 349 result.Response = resp 350 return 351} 352 353// DeletePrivateEndpointConnection delete private end point connection for a private link service in a subscription. 354// Parameters: 355// resourceGroupName - the name of the resource group. 356// serviceName - the name of the private link service. 357// peConnectionName - the name of the private end point connection. 358func (client PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (result PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { 359 if tracing.IsEnabled() { 360 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.DeletePrivateEndpointConnection") 361 defer func() { 362 sc := -1 363 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 364 sc = result.FutureAPI.Response().StatusCode 365 } 366 tracing.EndSpan(ctx, sc, err) 367 }() 368 } 369 req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName) 370 if err != nil { 371 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") 372 return 373 } 374 375 result, err = client.DeletePrivateEndpointConnectionSender(req) 376 if err != nil { 377 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure sending request") 378 return 379 } 380 381 return 382} 383 384// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. 385func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (*http.Request, error) { 386 pathParameters := map[string]interface{}{ 387 "peConnectionName": autorest.Encode("path", peConnectionName), 388 "resourceGroupName": autorest.Encode("path", resourceGroupName), 389 "serviceName": autorest.Encode("path", serviceName), 390 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 391 } 392 393 const APIVersion = "2019-07-01" 394 queryParameters := map[string]interface{}{ 395 "api-version": APIVersion, 396 } 397 398 preparer := autorest.CreatePreparer( 399 autorest.AsDelete(), 400 autorest.WithBaseURL(client.BaseURI), 401 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), 402 autorest.WithQueryParameters(queryParameters)) 403 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 404} 405 406// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the 407// http.Response Body if it receives an error. 408func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { 409 var resp *http.Response 410 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 411 if err != nil { 412 return 413 } 414 var azf azure.Future 415 azf, err = azure.NewFutureFromResponse(resp) 416 future.FutureAPI = &azf 417 future.Result = future.result 418 return 419} 420 421// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always 422// closes the http.Response Body. 423func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { 424 err = autorest.Respond( 425 resp, 426 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 427 autorest.ByClosing()) 428 result.Response = resp 429 return 430} 431 432// Get gets the specified private link service by resource group. 433// Parameters: 434// resourceGroupName - the name of the resource group. 435// serviceName - the name of the private link service. 436// expand - expands referenced resources. 437func (client PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, expand string) (result PrivateLinkService, err error) { 438 if tracing.IsEnabled() { 439 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Get") 440 defer func() { 441 sc := -1 442 if result.Response.Response != nil { 443 sc = result.Response.Response.StatusCode 444 } 445 tracing.EndSpan(ctx, sc, err) 446 }() 447 } 448 req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, expand) 449 if err != nil { 450 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", nil, "Failure preparing request") 451 return 452 } 453 454 resp, err := client.GetSender(req) 455 if err != nil { 456 result.Response = autorest.Response{Response: resp} 457 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure sending request") 458 return 459 } 460 461 result, err = client.GetResponder(resp) 462 if err != nil { 463 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure responding to request") 464 return 465 } 466 467 return 468} 469 470// GetPreparer prepares the Get request. 471func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, expand string) (*http.Request, error) { 472 pathParameters := map[string]interface{}{ 473 "resourceGroupName": autorest.Encode("path", resourceGroupName), 474 "serviceName": autorest.Encode("path", serviceName), 475 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 476 } 477 478 const APIVersion = "2019-07-01" 479 queryParameters := map[string]interface{}{ 480 "api-version": APIVersion, 481 } 482 if len(expand) > 0 { 483 queryParameters["$expand"] = autorest.Encode("query", expand) 484 } 485 486 preparer := autorest.CreatePreparer( 487 autorest.AsGet(), 488 autorest.WithBaseURL(client.BaseURI), 489 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), 490 autorest.WithQueryParameters(queryParameters)) 491 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 492} 493 494// GetSender sends the Get request. The method will close the 495// http.Response Body if it receives an error. 496func (client PrivateLinkServicesClient) GetSender(req *http.Request) (*http.Response, error) { 497 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 498} 499 500// GetResponder handles the response to the Get request. The method always 501// closes the http.Response Body. 502func (client PrivateLinkServicesClient) GetResponder(resp *http.Response) (result PrivateLinkService, err error) { 503 err = autorest.Respond( 504 resp, 505 azure.WithErrorUnlessStatusCode(http.StatusOK), 506 autorest.ByUnmarshallingJSON(&result), 507 autorest.ByClosing()) 508 result.Response = autorest.Response{Response: resp} 509 return 510} 511 512// List gets all private link services in a resource group. 513// Parameters: 514// resourceGroupName - the name of the resource group. 515func (client PrivateLinkServicesClient) List(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultPage, err error) { 516 if tracing.IsEnabled() { 517 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") 518 defer func() { 519 sc := -1 520 if result.plslr.Response.Response != nil { 521 sc = result.plslr.Response.Response.StatusCode 522 } 523 tracing.EndSpan(ctx, sc, err) 524 }() 525 } 526 result.fn = client.listNextResults 527 req, err := client.ListPreparer(ctx, resourceGroupName) 528 if err != nil { 529 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", nil, "Failure preparing request") 530 return 531 } 532 533 resp, err := client.ListSender(req) 534 if err != nil { 535 result.plslr.Response = autorest.Response{Response: resp} 536 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure sending request") 537 return 538 } 539 540 result.plslr, err = client.ListResponder(resp) 541 if err != nil { 542 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure responding to request") 543 return 544 } 545 if result.plslr.hasNextLink() && result.plslr.IsEmpty() { 546 err = result.NextWithContext(ctx) 547 return 548 } 549 550 return 551} 552 553// ListPreparer prepares the List request. 554func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 555 pathParameters := map[string]interface{}{ 556 "resourceGroupName": autorest.Encode("path", resourceGroupName), 557 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 558 } 559 560 const APIVersion = "2019-07-01" 561 queryParameters := map[string]interface{}{ 562 "api-version": APIVersion, 563 } 564 565 preparer := autorest.CreatePreparer( 566 autorest.AsGet(), 567 autorest.WithBaseURL(client.BaseURI), 568 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices", pathParameters), 569 autorest.WithQueryParameters(queryParameters)) 570 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 571} 572 573// ListSender sends the List request. The method will close the 574// http.Response Body if it receives an error. 575func (client PrivateLinkServicesClient) ListSender(req *http.Request) (*http.Response, error) { 576 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 577} 578 579// ListResponder handles the response to the List request. The method always 580// closes the http.Response Body. 581func (client PrivateLinkServicesClient) ListResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { 582 err = autorest.Respond( 583 resp, 584 azure.WithErrorUnlessStatusCode(http.StatusOK), 585 autorest.ByUnmarshallingJSON(&result), 586 autorest.ByClosing()) 587 result.Response = autorest.Response{Response: resp} 588 return 589} 590 591// listNextResults retrieves the next set of results, if any. 592func (client PrivateLinkServicesClient) listNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { 593 req, err := lastResults.privateLinkServiceListResultPreparer(ctx) 594 if err != nil { 595 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", nil, "Failure preparing next results request") 596 } 597 if req == nil { 598 return 599 } 600 resp, err := client.ListSender(req) 601 if err != nil { 602 result.Response = autorest.Response{Response: resp} 603 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure sending next results request") 604 } 605 result, err = client.ListResponder(resp) 606 if err != nil { 607 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure responding to next results request") 608 } 609 return 610} 611 612// ListComplete enumerates all values, automatically crossing page boundaries as required. 613func (client PrivateLinkServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultIterator, err error) { 614 if tracing.IsEnabled() { 615 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") 616 defer func() { 617 sc := -1 618 if result.Response().Response.Response != nil { 619 sc = result.page.Response().Response.Response.StatusCode 620 } 621 tracing.EndSpan(ctx, sc, err) 622 }() 623 } 624 result.page, err = client.List(ctx, resourceGroupName) 625 return 626} 627 628// ListAutoApprovedPrivateLinkServices returns all of the private link service ids that can be linked to a Private 629// Endpoint with auto approved in this subscription in this region. 630// Parameters: 631// location - the location of the domain name. 632func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { 633 if tracing.IsEnabled() { 634 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") 635 defer func() { 636 sc := -1 637 if result.aaplsr.Response.Response != nil { 638 sc = result.aaplsr.Response.Response.StatusCode 639 } 640 tracing.EndSpan(ctx, sc, err) 641 }() 642 } 643 result.fn = client.listAutoApprovedPrivateLinkServicesNextResults 644 req, err := client.ListAutoApprovedPrivateLinkServicesPreparer(ctx, location) 645 if err != nil { 646 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", nil, "Failure preparing request") 647 return 648 } 649 650 resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) 651 if err != nil { 652 result.aaplsr.Response = autorest.Response{Response: resp} 653 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure sending request") 654 return 655 } 656 657 result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) 658 if err != nil { 659 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure responding to request") 660 return 661 } 662 if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { 663 err = result.NextWithContext(ctx) 664 return 665 } 666 667 return 668} 669 670// ListAutoApprovedPrivateLinkServicesPreparer prepares the ListAutoApprovedPrivateLinkServices request. 671func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPreparer(ctx context.Context, location string) (*http.Request, error) { 672 pathParameters := map[string]interface{}{ 673 "location": autorest.Encode("path", location), 674 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 675 } 676 677 const APIVersion = "2019-07-01" 678 queryParameters := map[string]interface{}{ 679 "api-version": APIVersion, 680 } 681 682 preparer := autorest.CreatePreparer( 683 autorest.AsGet(), 684 autorest.WithBaseURL(client.BaseURI), 685 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), 686 autorest.WithQueryParameters(queryParameters)) 687 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 688} 689 690// ListAutoApprovedPrivateLinkServicesSender sends the ListAutoApprovedPrivateLinkServices request. The method will close the 691// http.Response Body if it receives an error. 692func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesSender(req *http.Request) (*http.Response, error) { 693 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 694} 695 696// ListAutoApprovedPrivateLinkServicesResponder handles the response to the ListAutoApprovedPrivateLinkServices request. The method always 697// closes the http.Response Body. 698func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { 699 err = autorest.Respond( 700 resp, 701 azure.WithErrorUnlessStatusCode(http.StatusOK), 702 autorest.ByUnmarshallingJSON(&result), 703 autorest.ByClosing()) 704 result.Response = autorest.Response{Response: resp} 705 return 706} 707 708// listAutoApprovedPrivateLinkServicesNextResults retrieves the next set of results, if any. 709func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { 710 req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) 711 if err != nil { 712 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", nil, "Failure preparing next results request") 713 } 714 if req == nil { 715 return 716 } 717 resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) 718 if err != nil { 719 result.Response = autorest.Response{Response: resp} 720 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure sending next results request") 721 } 722 result, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) 723 if err != nil { 724 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure responding to next results request") 725 } 726 return 727} 728 729// ListAutoApprovedPrivateLinkServicesComplete enumerates all values, automatically crossing page boundaries as required. 730func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesComplete(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { 731 if tracing.IsEnabled() { 732 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") 733 defer func() { 734 sc := -1 735 if result.Response().Response.Response != nil { 736 sc = result.page.Response().Response.Response.StatusCode 737 } 738 tracing.EndSpan(ctx, sc, err) 739 }() 740 } 741 result.page, err = client.ListAutoApprovedPrivateLinkServices(ctx, location) 742 return 743} 744 745// ListAutoApprovedPrivateLinkServicesByResourceGroup returns all of the private link service ids that can be linked to 746// a Private Endpoint with auto approved in this subscription in this region. 747// Parameters: 748// location - the location of the domain name. 749// resourceGroupName - the name of the resource group. 750func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { 751 if tracing.IsEnabled() { 752 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") 753 defer func() { 754 sc := -1 755 if result.aaplsr.Response.Response != nil { 756 sc = result.aaplsr.Response.Response.StatusCode 757 } 758 tracing.EndSpan(ctx, sc, err) 759 }() 760 } 761 result.fn = client.listAutoApprovedPrivateLinkServicesByResourceGroupNextResults 762 req, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx, location, resourceGroupName) 763 if err != nil { 764 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", nil, "Failure preparing request") 765 return 766 } 767 768 resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) 769 if err != nil { 770 result.aaplsr.Response = autorest.Response{Response: resp} 771 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure sending request") 772 return 773 } 774 775 result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) 776 if err != nil { 777 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure responding to request") 778 return 779 } 780 if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { 781 err = result.NextWithContext(ctx) 782 return 783 } 784 785 return 786} 787 788// ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer prepares the ListAutoApprovedPrivateLinkServicesByResourceGroup request. 789func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { 790 pathParameters := map[string]interface{}{ 791 "location": autorest.Encode("path", location), 792 "resourceGroupName": autorest.Encode("path", resourceGroupName), 793 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 794 } 795 796 const APIVersion = "2019-07-01" 797 queryParameters := map[string]interface{}{ 798 "api-version": APIVersion, 799 } 800 801 preparer := autorest.CreatePreparer( 802 autorest.AsGet(), 803 autorest.WithBaseURL(client.BaseURI), 804 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), 805 autorest.WithQueryParameters(queryParameters)) 806 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 807} 808 809// ListAutoApprovedPrivateLinkServicesByResourceGroupSender sends the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method will close the 810// http.Response Body if it receives an error. 811func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req *http.Request) (*http.Response, error) { 812 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 813} 814 815// ListAutoApprovedPrivateLinkServicesByResourceGroupResponder handles the response to the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method always 816// closes the http.Response Body. 817func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { 818 err = autorest.Respond( 819 resp, 820 azure.WithErrorUnlessStatusCode(http.StatusOK), 821 autorest.ByUnmarshallingJSON(&result), 822 autorest.ByClosing()) 823 result.Response = autorest.Response{Response: resp} 824 return 825} 826 827// listAutoApprovedPrivateLinkServicesByResourceGroupNextResults retrieves the next set of results, if any. 828func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { 829 req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) 830 if err != nil { 831 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", nil, "Failure preparing next results request") 832 } 833 if req == nil { 834 return 835 } 836 resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) 837 if err != nil { 838 result.Response = autorest.Response{Response: resp} 839 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure sending next results request") 840 } 841 result, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) 842 if err != nil { 843 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure responding to next results request") 844 } 845 return 846} 847 848// ListAutoApprovedPrivateLinkServicesByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. 849func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { 850 if tracing.IsEnabled() { 851 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") 852 defer func() { 853 sc := -1 854 if result.Response().Response.Response != nil { 855 sc = result.page.Response().Response.Response.StatusCode 856 } 857 tracing.EndSpan(ctx, sc, err) 858 }() 859 } 860 result.page, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, location, resourceGroupName) 861 return 862} 863 864// ListBySubscription gets all private link service in a subscription. 865func (client PrivateLinkServicesClient) ListBySubscription(ctx context.Context) (result PrivateLinkServiceListResultPage, err error) { 866 if tracing.IsEnabled() { 867 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") 868 defer func() { 869 sc := -1 870 if result.plslr.Response.Response != nil { 871 sc = result.plslr.Response.Response.StatusCode 872 } 873 tracing.EndSpan(ctx, sc, err) 874 }() 875 } 876 result.fn = client.listBySubscriptionNextResults 877 req, err := client.ListBySubscriptionPreparer(ctx) 878 if err != nil { 879 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", nil, "Failure preparing request") 880 return 881 } 882 883 resp, err := client.ListBySubscriptionSender(req) 884 if err != nil { 885 result.plslr.Response = autorest.Response{Response: resp} 886 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure sending request") 887 return 888 } 889 890 result.plslr, err = client.ListBySubscriptionResponder(resp) 891 if err != nil { 892 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure responding to request") 893 return 894 } 895 if result.plslr.hasNextLink() && result.plslr.IsEmpty() { 896 err = result.NextWithContext(ctx) 897 return 898 } 899 900 return 901} 902 903// ListBySubscriptionPreparer prepares the ListBySubscription request. 904func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { 905 pathParameters := map[string]interface{}{ 906 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 907 } 908 909 const APIVersion = "2019-07-01" 910 queryParameters := map[string]interface{}{ 911 "api-version": APIVersion, 912 } 913 914 preparer := autorest.CreatePreparer( 915 autorest.AsGet(), 916 autorest.WithBaseURL(client.BaseURI), 917 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices", pathParameters), 918 autorest.WithQueryParameters(queryParameters)) 919 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 920} 921 922// ListBySubscriptionSender sends the ListBySubscription request. The method will close the 923// http.Response Body if it receives an error. 924func (client PrivateLinkServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { 925 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 926} 927 928// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always 929// closes the http.Response Body. 930func (client PrivateLinkServicesClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { 931 err = autorest.Respond( 932 resp, 933 azure.WithErrorUnlessStatusCode(http.StatusOK), 934 autorest.ByUnmarshallingJSON(&result), 935 autorest.ByClosing()) 936 result.Response = autorest.Response{Response: resp} 937 return 938} 939 940// listBySubscriptionNextResults retrieves the next set of results, if any. 941func (client PrivateLinkServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { 942 req, err := lastResults.privateLinkServiceListResultPreparer(ctx) 943 if err != nil { 944 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") 945 } 946 if req == nil { 947 return 948 } 949 resp, err := client.ListBySubscriptionSender(req) 950 if err != nil { 951 result.Response = autorest.Response{Response: resp} 952 return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") 953 } 954 result, err = client.ListBySubscriptionResponder(resp) 955 if err != nil { 956 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") 957 } 958 return 959} 960 961// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. 962func (client PrivateLinkServicesClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateLinkServiceListResultIterator, err error) { 963 if tracing.IsEnabled() { 964 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") 965 defer func() { 966 sc := -1 967 if result.Response().Response.Response != nil { 968 sc = result.page.Response().Response.Response.StatusCode 969 } 970 tracing.EndSpan(ctx, sc, err) 971 }() 972 } 973 result.page, err = client.ListBySubscription(ctx) 974 return 975} 976 977// UpdatePrivateEndpointConnection approve or reject private end point connection for a private link service in a 978// subscription. 979// Parameters: 980// resourceGroupName - the name of the resource group. 981// serviceName - the name of the private link service. 982// peConnectionName - the name of the private end point connection. 983// parameters - parameters supplied to approve or reject the private end point connection. 984func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { 985 if tracing.IsEnabled() { 986 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.UpdatePrivateEndpointConnection") 987 defer func() { 988 sc := -1 989 if result.Response.Response != nil { 990 sc = result.Response.Response.StatusCode 991 } 992 tracing.EndSpan(ctx, sc, err) 993 }() 994 } 995 req, err := client.UpdatePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, parameters) 996 if err != nil { 997 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", nil, "Failure preparing request") 998 return 999 } 1000 1001 resp, err := client.UpdatePrivateEndpointConnectionSender(req) 1002 if err != nil { 1003 result.Response = autorest.Response{Response: resp} 1004 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure sending request") 1005 return 1006 } 1007 1008 result, err = client.UpdatePrivateEndpointConnectionResponder(resp) 1009 if err != nil { 1010 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure responding to request") 1011 return 1012 } 1013 1014 return 1015} 1016 1017// UpdatePrivateEndpointConnectionPreparer prepares the UpdatePrivateEndpointConnection request. 1018func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { 1019 pathParameters := map[string]interface{}{ 1020 "peConnectionName": autorest.Encode("path", peConnectionName), 1021 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1022 "serviceName": autorest.Encode("path", serviceName), 1023 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1024 } 1025 1026 const APIVersion = "2019-07-01" 1027 queryParameters := map[string]interface{}{ 1028 "api-version": APIVersion, 1029 } 1030 1031 parameters.Type = nil 1032 parameters.Etag = nil 1033 preparer := autorest.CreatePreparer( 1034 autorest.AsContentType("application/json; charset=utf-8"), 1035 autorest.AsPut(), 1036 autorest.WithBaseURL(client.BaseURI), 1037 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), 1038 autorest.WithJSON(parameters), 1039 autorest.WithQueryParameters(queryParameters)) 1040 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1041} 1042 1043// UpdatePrivateEndpointConnectionSender sends the UpdatePrivateEndpointConnection request. The method will close the 1044// http.Response Body if it receives an error. 1045func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { 1046 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1047} 1048 1049// UpdatePrivateEndpointConnectionResponder handles the response to the UpdatePrivateEndpointConnection request. The method always 1050// closes the http.Response Body. 1051func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { 1052 err = autorest.Respond( 1053 resp, 1054 azure.WithErrorUnlessStatusCode(http.StatusOK), 1055 autorest.ByUnmarshallingJSON(&result), 1056 autorest.ByClosing()) 1057 result.Response = autorest.Response{Response: resp} 1058 return 1059} 1060