| | | 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; |
| | | 13 | | using Azure.Core.Pipeline; |
| | | 14 | | using Azure.ResourceManager.Storage.Models; |
| | | 15 | | |
| | | 16 | | namespace Azure.ResourceManager.Storage |
| | | 17 | | { |
| | | 18 | | /// <summary> The PrivateEndpointConnections service client. </summary> |
| | | 19 | | public partial class PrivateEndpointConnectionsOperations |
| | | 20 | | { |
| | | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 22 | | private readonly HttpPipeline _pipeline; |
| | 0 | 23 | | internal PrivateEndpointConnectionsRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations for mocking. </summary> |
| | 240 | 25 | | protected PrivateEndpointConnectionsOperations() |
| | | 26 | | { |
| | 240 | 27 | | } |
| | | 28 | | /// <summary> Initializes a new instance of PrivateEndpointConnectionsOperations. </summary> |
| | | 29 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | | 30 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | | 31 | | /// <param name="subscriptionId"> The ID of the target subscription. </param> |
| | | 32 | | /// <param name="endpoint"> server parameter. </param> |
| | | 33 | | /// <param name="apiVersion"> Api Version. </param> |
| | 240 | 34 | | internal PrivateEndpointConnectionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string |
| | | 35 | | { |
| | 240 | 36 | | RestClient = new PrivateEndpointConnectionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo |
| | 240 | 37 | | _clientDiagnostics = clientDiagnostics; |
| | 240 | 38 | | _pipeline = pipeline; |
| | 240 | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary> Gets the specified private endpoint connection associated with the storage account. </summary> |
| | | 42 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 43 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 44 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 45 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 46 | | public virtual async Task<Response<PrivateEndpointConnection>> GetAsync(string resourceGroupName, string account |
| | | 47 | | { |
| | 0 | 48 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| | 0 | 49 | | scope.Start(); |
| | | 50 | | try |
| | | 51 | | { |
| | 0 | 52 | | return await RestClient.GetAsync(resourceGroupName, accountName, privateEndpointConnectionName, cancella |
| | | 53 | | } |
| | 0 | 54 | | catch (Exception e) |
| | | 55 | | { |
| | 0 | 56 | | scope.Failed(e); |
| | 0 | 57 | | throw; |
| | | 58 | | } |
| | 0 | 59 | | } |
| | | 60 | | |
| | | 61 | | /// <summary> Gets the specified private endpoint connection associated with the storage account. </summary> |
| | | 62 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 63 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 64 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 65 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 66 | | public virtual Response<PrivateEndpointConnection> Get(string resourceGroupName, string accountName, string priv |
| | | 67 | | { |
| | 0 | 68 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Get"); |
| | 0 | 69 | | scope.Start(); |
| | | 70 | | try |
| | | 71 | | { |
| | 0 | 72 | | return RestClient.Get(resourceGroupName, accountName, privateEndpointConnectionName, cancellationToken); |
| | | 73 | | } |
| | 0 | 74 | | catch (Exception e) |
| | | 75 | | { |
| | 0 | 76 | | scope.Failed(e); |
| | 0 | 77 | | throw; |
| | | 78 | | } |
| | 0 | 79 | | } |
| | | 80 | | |
| | | 81 | | /// <summary> Update the state of specified private endpoint connection associated with the storage account. </s |
| | | 82 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 83 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 84 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 85 | | /// <param name="properties"> The private endpoint connection properties. </param> |
| | | 86 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 87 | | public virtual async Task<Response<PrivateEndpointConnection>> PutAsync(string resourceGroupName, string account |
| | | 88 | | { |
| | 0 | 89 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put"); |
| | 0 | 90 | | scope.Start(); |
| | | 91 | | try |
| | | 92 | | { |
| | 0 | 93 | | return await RestClient.PutAsync(resourceGroupName, accountName, privateEndpointConnectionName, properti |
| | | 94 | | } |
| | 0 | 95 | | catch (Exception e) |
| | | 96 | | { |
| | 0 | 97 | | scope.Failed(e); |
| | 0 | 98 | | throw; |
| | | 99 | | } |
| | 0 | 100 | | } |
| | | 101 | | |
| | | 102 | | /// <summary> Update the state of specified private endpoint connection associated with the storage account. </s |
| | | 103 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 104 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 105 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 106 | | /// <param name="properties"> The private endpoint connection properties. </param> |
| | | 107 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 108 | | public virtual Response<PrivateEndpointConnection> Put(string resourceGroupName, string accountName, string priv |
| | | 109 | | { |
| | 0 | 110 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Put"); |
| | 0 | 111 | | scope.Start(); |
| | | 112 | | try |
| | | 113 | | { |
| | 0 | 114 | | return RestClient.Put(resourceGroupName, accountName, privateEndpointConnectionName, properties, cancell |
| | | 115 | | } |
| | 0 | 116 | | catch (Exception e) |
| | | 117 | | { |
| | 0 | 118 | | scope.Failed(e); |
| | 0 | 119 | | throw; |
| | | 120 | | } |
| | 0 | 121 | | } |
| | | 122 | | |
| | | 123 | | /// <summary> Deletes the specified private endpoint connection associated with the storage account. </summary> |
| | | 124 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 125 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 126 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 127 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 128 | | public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string privateEndp |
| | | 129 | | { |
| | 0 | 130 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Delete"); |
| | 0 | 131 | | scope.Start(); |
| | | 132 | | try |
| | | 133 | | { |
| | 0 | 134 | | return await RestClient.DeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, cance |
| | | 135 | | } |
| | 0 | 136 | | catch (Exception e) |
| | | 137 | | { |
| | 0 | 138 | | scope.Failed(e); |
| | 0 | 139 | | throw; |
| | | 140 | | } |
| | 0 | 141 | | } |
| | | 142 | | |
| | | 143 | | /// <summary> Deletes the specified private endpoint connection associated with the storage account. </summary> |
| | | 144 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 145 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 146 | | /// <param name="privateEndpointConnectionName"> The name of the private endpoint connection associated with the |
| | | 147 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 148 | | public virtual Response Delete(string resourceGroupName, string accountName, string privateEndpointConnectionNam |
| | | 149 | | { |
| | 0 | 150 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.Delete"); |
| | 0 | 151 | | scope.Start(); |
| | | 152 | | try |
| | | 153 | | { |
| | 0 | 154 | | return RestClient.Delete(resourceGroupName, accountName, privateEndpointConnectionName, cancellationToke |
| | | 155 | | } |
| | 0 | 156 | | catch (Exception e) |
| | | 157 | | { |
| | 0 | 158 | | scope.Failed(e); |
| | 0 | 159 | | throw; |
| | | 160 | | } |
| | 0 | 161 | | } |
| | | 162 | | |
| | | 163 | | /// <summary> List all the private endpoint connections associated with the storage account. </summary> |
| | | 164 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 165 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 166 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 167 | | public virtual AsyncPageable<PrivateEndpointConnection> ListAsync(string resourceGroupName, string accountName, |
| | | 168 | | { |
| | 0 | 169 | | if (resourceGroupName == null) |
| | | 170 | | { |
| | 0 | 171 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 172 | | } |
| | 0 | 173 | | if (accountName == null) |
| | | 174 | | { |
| | 0 | 175 | | throw new ArgumentNullException(nameof(accountName)); |
| | | 176 | | } |
| | | 177 | | |
| | | 178 | | async Task<Page<PrivateEndpointConnection>> FirstPageFunc(int? pageSizeHint) |
| | | 179 | | { |
| | 0 | 180 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.List"); |
| | 0 | 181 | | scope.Start(); |
| | | 182 | | try |
| | | 183 | | { |
| | 0 | 184 | | var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).Configu |
| | 0 | 185 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | | 186 | | } |
| | 0 | 187 | | catch (Exception e) |
| | | 188 | | { |
| | 0 | 189 | | scope.Failed(e); |
| | 0 | 190 | | throw; |
| | | 191 | | } |
| | 0 | 192 | | } |
| | 0 | 193 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); |
| | | 194 | | } |
| | | 195 | | |
| | | 196 | | /// <summary> List all the private endpoint connections associated with the storage account. </summary> |
| | | 197 | | /// <param name="resourceGroupName"> The name of the resource group within the user's subscription. The nam |
| | | 198 | | /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco |
| | | 199 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 200 | | public virtual Pageable<PrivateEndpointConnection> List(string resourceGroupName, string accountName, Cancellati |
| | | 201 | | { |
| | 0 | 202 | | if (resourceGroupName == null) |
| | | 203 | | { |
| | 0 | 204 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 205 | | } |
| | 0 | 206 | | if (accountName == null) |
| | | 207 | | { |
| | 0 | 208 | | throw new ArgumentNullException(nameof(accountName)); |
| | | 209 | | } |
| | | 210 | | |
| | | 211 | | Page<PrivateEndpointConnection> FirstPageFunc(int? pageSizeHint) |
| | | 212 | | { |
| | 0 | 213 | | using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionsOperations.List"); |
| | 0 | 214 | | scope.Start(); |
| | | 215 | | try |
| | | 216 | | { |
| | 0 | 217 | | var response = RestClient.List(resourceGroupName, accountName, cancellationToken); |
| | 0 | 218 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | | 219 | | } |
| | 0 | 220 | | catch (Exception e) |
| | | 221 | | { |
| | 0 | 222 | | scope.Failed(e); |
| | 0 | 223 | | throw; |
| | | 224 | | } |
| | 0 | 225 | | } |
| | 0 | 226 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, null); |
| | | 227 | | } |
| | | 228 | | } |
| | | 229 | | } |