| | 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.Storage.Models; |
| | 14 | |
|
| | 15 | | namespace Azure.ResourceManager.Storage |
| | 16 | | { |
| | 17 | | /// <summary> The PrivateLinkResources service client. </summary> |
| | 18 | | public partial class PrivateLinkResourcesOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 4 | 22 | | internal PrivateLinkResourcesRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of PrivateLinkResourcesOperations for mocking. </summary> |
| 240 | 24 | | protected PrivateLinkResourcesOperations() |
| | 25 | | { |
| 240 | 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"> The ID of the target subscription. </param> |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| | 32 | | /// <param name="apiVersion"> Api Version. </param> |
| 240 | 33 | | internal PrivateLinkResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc |
| | 34 | | { |
| 240 | 35 | | RestClient = new PrivateLinkResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, a |
| 240 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 240 | 37 | | _pipeline = pipeline; |
| 240 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Gets the private link resources that need to be created for a storage account. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 42 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<PrivateLinkResourceListResult>> ListByStorageAccountAsync(string resourceGrou |
| | 45 | | { |
| 2 | 46 | | using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByStorageAccount"); |
| 2 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 2 | 50 | | return await RestClient.ListByStorageAccountAsync(resourceGroupName, accountName, cancellationToken).Con |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 2 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Gets the private link resources that need to be created for a storage account. </summary> |
| | 60 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | 61 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public virtual Response<PrivateLinkResourceListResult> ListByStorageAccount(string resourceGroupName, string acc |
| | 64 | | { |
| 2 | 65 | | using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourcesOperations.ListByStorageAccount"); |
| 2 | 66 | | scope.Start(); |
| | 67 | | try |
| | 68 | | { |
| 2 | 69 | | return RestClient.ListByStorageAccount(resourceGroupName, accountName, cancellationToken); |
| | 70 | | } |
| 0 | 71 | | catch (Exception e) |
| | 72 | | { |
| 0 | 73 | | scope.Failed(e); |
| 0 | 74 | | throw; |
| | 75 | | } |
| 2 | 76 | | } |
| | 77 | | } |
| | 78 | | } |