| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core.Pipeline; |
| | 13 | | using Azure.ResourceManager.KeyVault.Models; |
| | 14 | |
|
| | 15 | | namespace Azure.ResourceManager.KeyVault |
| | 16 | | { |
| | 17 | | /// <summary> The PrivateLinkResources service client. </summary> |
| | 18 | | public partial class PrivateLinkResourcesOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal PrivateLinkResourcesRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of PrivateLinkResourcesOperations for mocking. </summary> |
| 0 | 24 | | protected PrivateLinkResourcesOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | | /// <summary> Initializes a new instance of PrivateLinkResourcesOperations. </summary> |
| | 28 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 29 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 30 | | /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription. |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| | 32 | | /// <param name="apiVersion"> Api Version. </param> |
| 0 | 33 | | internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc |
| | 34 | | { |
| 0 | 35 | | RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, a |
| 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 37 | | _pipeline = pipeline; |
| 0 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Gets the private link resources supported for the key vault. </summary> |
| | 41 | | /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param> |
| | 42 | | /// <param name="vaultName"> The name of the key vault. </param> |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<PrivateLinkResourceListResult>> ListByVaultAsync(string resourceGroupName, st |
| | 45 | | { |
| 0 | 46 | | using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByVault"); |
| 0 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 0 | 50 | | return await RestClient.ListByVaultAsync(resourceGroupName, vaultName, cancellationToken).ConfigureAwait |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Gets the private link resources supported for the key vault. </summary> |
| | 60 | | /// <param name="resourceGroupName"> Name of the resource group that contains the key vault. </param> |
| | 61 | | /// <param name="vaultName"> The name of the key vault. </param> |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public virtual Response<PrivateLinkResourceListResult> ListByVault(string resourceGroupName, string vaultName, C |
| | 64 | | { |
| 0 | 65 | | using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByVault"); |
| 0 | 66 | | scope.Start(); |
| | 67 | | try |
| | 68 | | { |
| 0 | 69 | | return RestClient.ListByVault(resourceGroupName, vaultName, cancellationToken); |
| | 70 | | } |
| 0 | 71 | | catch (Exception e) |
| | 72 | | { |
| 0 | 73 | | scope.Failed(e); |
| 0 | 74 | | throw; |
| | 75 | | } |
| 0 | 76 | | } |
| | 77 | | } |
| | 78 | | } |