| | | 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.AppConfiguration.Models; |
| | | 15 | | |
| | | 16 | | namespace Azure.ResourceManager.AppConfiguration |
| | | 17 | | { |
| | | 18 | | /// <summary> The ConfigurationStores service client. </summary> |
| | | 19 | | public partial class ConfigurationStoresOperations |
| | | 20 | | { |
| | | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 22 | | private readonly HttpPipeline _pipeline; |
| | 60 | 23 | | internal ConfigurationStoresRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of ConfigurationStoresOperations for mocking. </summary> |
| | 8 | 25 | | protected ConfigurationStoresOperations() |
| | | 26 | | { |
| | 8 | 27 | | } |
| | | 28 | | /// <summary> Initializes a new instance of ConfigurationStoresOperations. </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 Microsoft Azure subscription ID. </param> |
| | | 32 | | /// <param name="endpoint"> server parameter. </param> |
| | | 33 | | /// <param name="apiVersion"> Api Version. </param> |
| | 8 | 34 | | internal ConfigurationStoresOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr |
| | | 35 | | { |
| | 8 | 36 | | RestClient = new ConfigurationStoresRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, ap |
| | 8 | 37 | | _clientDiagnostics = clientDiagnostics; |
| | 8 | 38 | | _pipeline = pipeline; |
| | 8 | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary> Gets the properties of the specified configuration store. </summary> |
| | | 42 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 43 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 45 | | public virtual async Task<Response<ConfigurationStore>> GetAsync(string resourceGroupName, string configStoreNam |
| | | 46 | | { |
| | 2 | 47 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.Get"); |
| | 2 | 48 | | scope.Start(); |
| | | 49 | | try |
| | | 50 | | { |
| | 2 | 51 | | return await RestClient.GetAsync(resourceGroupName, configStoreName, cancellationToken).ConfigureAwait(f |
| | | 52 | | } |
| | 0 | 53 | | catch (Exception e) |
| | | 54 | | { |
| | 0 | 55 | | scope.Failed(e); |
| | 0 | 56 | | throw; |
| | | 57 | | } |
| | 2 | 58 | | } |
| | | 59 | | |
| | | 60 | | /// <summary> Gets the properties of the specified configuration store. </summary> |
| | | 61 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 62 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 63 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 64 | | public virtual Response<ConfigurationStore> Get(string resourceGroupName, string configStoreName, CancellationTo |
| | | 65 | | { |
| | 2 | 66 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.Get"); |
| | 2 | 67 | | scope.Start(); |
| | | 68 | | try |
| | | 69 | | { |
| | 2 | 70 | | return RestClient.Get(resourceGroupName, configStoreName, cancellationToken); |
| | | 71 | | } |
| | 0 | 72 | | catch (Exception e) |
| | | 73 | | { |
| | 0 | 74 | | scope.Failed(e); |
| | 0 | 75 | | throw; |
| | | 76 | | } |
| | 2 | 77 | | } |
| | | 78 | | |
| | | 79 | | /// <summary> Regenerates an access key for the specified configuration store. </summary> |
| | | 80 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 81 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 82 | | /// <param name="regenerateKeyParameters"> The parameters for regenerating an access key. </param> |
| | | 83 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 84 | | public virtual async Task<Response<ApiKey>> RegenerateKeyAsync(string resourceGroupName, string configStoreName, |
| | | 85 | | { |
| | 2 | 86 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.RegenerateKey"); |
| | 2 | 87 | | scope.Start(); |
| | | 88 | | try |
| | | 89 | | { |
| | 2 | 90 | | return await RestClient.RegenerateKeyAsync(resourceGroupName, configStoreName, regenerateKeyParameters, |
| | | 91 | | } |
| | 0 | 92 | | catch (Exception e) |
| | | 93 | | { |
| | 0 | 94 | | scope.Failed(e); |
| | 0 | 95 | | throw; |
| | | 96 | | } |
| | 2 | 97 | | } |
| | | 98 | | |
| | | 99 | | /// <summary> Regenerates an access key for the specified configuration store. </summary> |
| | | 100 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 101 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 102 | | /// <param name="regenerateKeyParameters"> The parameters for regenerating an access key. </param> |
| | | 103 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 104 | | public virtual Response<ApiKey> RegenerateKey(string resourceGroupName, string configStoreName, RegenerateKeyPar |
| | | 105 | | { |
| | 2 | 106 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.RegenerateKey"); |
| | 2 | 107 | | scope.Start(); |
| | | 108 | | try |
| | | 109 | | { |
| | 2 | 110 | | return RestClient.RegenerateKey(resourceGroupName, configStoreName, regenerateKeyParameters, cancellatio |
| | | 111 | | } |
| | 0 | 112 | | catch (Exception e) |
| | | 113 | | { |
| | 0 | 114 | | scope.Failed(e); |
| | 0 | 115 | | throw; |
| | | 116 | | } |
| | 2 | 117 | | } |
| | | 118 | | |
| | | 119 | | /// <summary> Lists a configuration store key-value. </summary> |
| | | 120 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 121 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 122 | | /// <param name="listKeyValueParameters"> The parameters for retrieving a key-value. </param> |
| | | 123 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 124 | | public virtual async Task<Response<KeyValue>> ListKeyValueAsync(string resourceGroupName, string configStoreName |
| | | 125 | | { |
| | 0 | 126 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeyValue"); |
| | 0 | 127 | | scope.Start(); |
| | | 128 | | try |
| | | 129 | | { |
| | 0 | 130 | | return await RestClient.ListKeyValueAsync(resourceGroupName, configStoreName, listKeyValueParameters, ca |
| | | 131 | | } |
| | 0 | 132 | | catch (Exception e) |
| | | 133 | | { |
| | 0 | 134 | | scope.Failed(e); |
| | 0 | 135 | | throw; |
| | | 136 | | } |
| | 0 | 137 | | } |
| | | 138 | | |
| | | 139 | | /// <summary> Lists a configuration store key-value. </summary> |
| | | 140 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 141 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 142 | | /// <param name="listKeyValueParameters"> The parameters for retrieving a key-value. </param> |
| | | 143 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 144 | | public virtual Response<KeyValue> ListKeyValue(string resourceGroupName, string configStoreName, ListKeyValuePar |
| | | 145 | | { |
| | 0 | 146 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeyValue"); |
| | 0 | 147 | | scope.Start(); |
| | | 148 | | try |
| | | 149 | | { |
| | 0 | 150 | | return RestClient.ListKeyValue(resourceGroupName, configStoreName, listKeyValueParameters, cancellationT |
| | | 151 | | } |
| | 0 | 152 | | catch (Exception e) |
| | | 153 | | { |
| | 0 | 154 | | scope.Failed(e); |
| | 0 | 155 | | throw; |
| | | 156 | | } |
| | 0 | 157 | | } |
| | | 158 | | |
| | | 159 | | /// <summary> Lists the configuration stores for a given subscription. </summary> |
| | | 160 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 161 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 162 | | public virtual AsyncPageable<ConfigurationStore> ListAsync(string skipToken = null, CancellationToken cancellati |
| | | 163 | | { |
| | | 164 | | async Task<Page<ConfigurationStore>> FirstPageFunc(int? pageSizeHint) |
| | | 165 | | { |
| | 2 | 166 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.List"); |
| | 2 | 167 | | scope.Start(); |
| | | 168 | | try |
| | | 169 | | { |
| | 2 | 170 | | var response = await RestClient.ListAsync(skipToken, cancellationToken).ConfigureAwait(false); |
| | 2 | 171 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 172 | | } |
| | 0 | 173 | | catch (Exception e) |
| | | 174 | | { |
| | 0 | 175 | | scope.Failed(e); |
| | 0 | 176 | | throw; |
| | | 177 | | } |
| | 2 | 178 | | } |
| | | 179 | | async Task<Page<ConfigurationStore>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 180 | | { |
| | 2 | 181 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.List"); |
| | 2 | 182 | | scope.Start(); |
| | | 183 | | try |
| | | 184 | | { |
| | 2 | 185 | | var response = await RestClient.ListNextPageAsync(nextLink, skipToken, cancellationToken).ConfigureA |
| | 2 | 186 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 187 | | } |
| | 0 | 188 | | catch (Exception e) |
| | | 189 | | { |
| | 0 | 190 | | scope.Failed(e); |
| | 0 | 191 | | throw; |
| | | 192 | | } |
| | 2 | 193 | | } |
| | 2 | 194 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 195 | | } |
| | | 196 | | |
| | | 197 | | /// <summary> Lists the configuration stores for a given subscription. </summary> |
| | | 198 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 199 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 200 | | public virtual Pageable<ConfigurationStore> List(string skipToken = null, CancellationToken cancellationToken = |
| | | 201 | | { |
| | | 202 | | Page<ConfigurationStore> FirstPageFunc(int? pageSizeHint) |
| | | 203 | | { |
| | 2 | 204 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.List"); |
| | 2 | 205 | | scope.Start(); |
| | | 206 | | try |
| | | 207 | | { |
| | 2 | 208 | | var response = RestClient.List(skipToken, cancellationToken); |
| | 2 | 209 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 210 | | } |
| | 0 | 211 | | catch (Exception e) |
| | | 212 | | { |
| | 0 | 213 | | scope.Failed(e); |
| | 0 | 214 | | throw; |
| | | 215 | | } |
| | 2 | 216 | | } |
| | | 217 | | Page<ConfigurationStore> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 218 | | { |
| | 2 | 219 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.List"); |
| | 2 | 220 | | scope.Start(); |
| | | 221 | | try |
| | | 222 | | { |
| | 2 | 223 | | var response = RestClient.ListNextPage(nextLink, skipToken, cancellationToken); |
| | 2 | 224 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 225 | | } |
| | 0 | 226 | | catch (Exception e) |
| | | 227 | | { |
| | 0 | 228 | | scope.Failed(e); |
| | 0 | 229 | | throw; |
| | | 230 | | } |
| | 2 | 231 | | } |
| | 2 | 232 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 233 | | } |
| | | 234 | | |
| | | 235 | | /// <summary> Lists the configuration stores for a given resource group. </summary> |
| | | 236 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 237 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 238 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 239 | | public virtual AsyncPageable<ConfigurationStore> ListByResourceGroupAsync(string resourceGroupName, string skipT |
| | | 240 | | { |
| | 2 | 241 | | if (resourceGroupName == null) |
| | | 242 | | { |
| | 0 | 243 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 244 | | } |
| | | 245 | | |
| | | 246 | | async Task<Page<ConfigurationStore>> FirstPageFunc(int? pageSizeHint) |
| | | 247 | | { |
| | 2 | 248 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListByResourceGroup"); |
| | 2 | 249 | | scope.Start(); |
| | | 250 | | try |
| | | 251 | | { |
| | 2 | 252 | | var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, skipToken, cancellationT |
| | 2 | 253 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 254 | | } |
| | 0 | 255 | | catch (Exception e) |
| | | 256 | | { |
| | 0 | 257 | | scope.Failed(e); |
| | 0 | 258 | | throw; |
| | | 259 | | } |
| | 2 | 260 | | } |
| | | 261 | | async Task<Page<ConfigurationStore>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 262 | | { |
| | 2 | 263 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListByResourceGroup"); |
| | 2 | 264 | | scope.Start(); |
| | | 265 | | try |
| | | 266 | | { |
| | 2 | 267 | | var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, skipTo |
| | 2 | 268 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 269 | | } |
| | 0 | 270 | | catch (Exception e) |
| | | 271 | | { |
| | 0 | 272 | | scope.Failed(e); |
| | 0 | 273 | | throw; |
| | | 274 | | } |
| | 2 | 275 | | } |
| | 2 | 276 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 277 | | } |
| | | 278 | | |
| | | 279 | | /// <summary> Lists the configuration stores for a given resource group. </summary> |
| | | 280 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 281 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 282 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 283 | | public virtual Pageable<ConfigurationStore> ListByResourceGroup(string resourceGroupName, string skipToken = nul |
| | | 284 | | { |
| | 2 | 285 | | if (resourceGroupName == null) |
| | | 286 | | { |
| | 0 | 287 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 288 | | } |
| | | 289 | | |
| | | 290 | | Page<ConfigurationStore> FirstPageFunc(int? pageSizeHint) |
| | | 291 | | { |
| | 2 | 292 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListByResourceGroup"); |
| | 2 | 293 | | scope.Start(); |
| | | 294 | | try |
| | | 295 | | { |
| | 2 | 296 | | var response = RestClient.ListByResourceGroup(resourceGroupName, skipToken, cancellationToken); |
| | 2 | 297 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 298 | | } |
| | 0 | 299 | | catch (Exception e) |
| | | 300 | | { |
| | 0 | 301 | | scope.Failed(e); |
| | 0 | 302 | | throw; |
| | | 303 | | } |
| | 2 | 304 | | } |
| | | 305 | | Page<ConfigurationStore> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 306 | | { |
| | 2 | 307 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListByResourceGroup"); |
| | 2 | 308 | | scope.Start(); |
| | | 309 | | try |
| | | 310 | | { |
| | 2 | 311 | | var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, skipToken, cancel |
| | 2 | 312 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 313 | | } |
| | 0 | 314 | | catch (Exception e) |
| | | 315 | | { |
| | 0 | 316 | | scope.Failed(e); |
| | 0 | 317 | | throw; |
| | | 318 | | } |
| | 2 | 319 | | } |
| | 2 | 320 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 321 | | } |
| | | 322 | | |
| | | 323 | | /// <summary> Lists the access key for the specified configuration store. </summary> |
| | | 324 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 325 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 326 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 327 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 328 | | public virtual AsyncPageable<ApiKey> ListKeysAsync(string resourceGroupName, string configStoreName, string skip |
| | | 329 | | { |
| | 2 | 330 | | if (resourceGroupName == null) |
| | | 331 | | { |
| | 0 | 332 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 333 | | } |
| | 2 | 334 | | if (configStoreName == null) |
| | | 335 | | { |
| | 0 | 336 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 337 | | } |
| | | 338 | | |
| | | 339 | | async Task<Page<ApiKey>> FirstPageFunc(int? pageSizeHint) |
| | | 340 | | { |
| | 2 | 341 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeys"); |
| | 2 | 342 | | scope.Start(); |
| | | 343 | | try |
| | | 344 | | { |
| | 2 | 345 | | var response = await RestClient.ListKeysAsync(resourceGroupName, configStoreName, skipToken, cancell |
| | 2 | 346 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 347 | | } |
| | 0 | 348 | | catch (Exception e) |
| | | 349 | | { |
| | 0 | 350 | | scope.Failed(e); |
| | 0 | 351 | | throw; |
| | | 352 | | } |
| | 2 | 353 | | } |
| | | 354 | | async Task<Page<ApiKey>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 355 | | { |
| | 0 | 356 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeys"); |
| | 0 | 357 | | scope.Start(); |
| | | 358 | | try |
| | | 359 | | { |
| | 0 | 360 | | var response = await RestClient.ListKeysNextPageAsync(nextLink, resourceGroupName, configStoreName, |
| | 0 | 361 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 362 | | } |
| | 0 | 363 | | catch (Exception e) |
| | | 364 | | { |
| | 0 | 365 | | scope.Failed(e); |
| | 0 | 366 | | throw; |
| | | 367 | | } |
| | 0 | 368 | | } |
| | 2 | 369 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 370 | | } |
| | | 371 | | |
| | | 372 | | /// <summary> Lists the access key for the specified configuration store. </summary> |
| | | 373 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 374 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 375 | | /// <param name="skipToken"> A skip token is used to continue retrieving items after an operation returns a part |
| | | 376 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 377 | | public virtual Pageable<ApiKey> ListKeys(string resourceGroupName, string configStoreName, string skipToken = nu |
| | | 378 | | { |
| | 2 | 379 | | if (resourceGroupName == null) |
| | | 380 | | { |
| | 0 | 381 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 382 | | } |
| | 2 | 383 | | if (configStoreName == null) |
| | | 384 | | { |
| | 0 | 385 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 386 | | } |
| | | 387 | | |
| | | 388 | | Page<ApiKey> FirstPageFunc(int? pageSizeHint) |
| | | 389 | | { |
| | 2 | 390 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeys"); |
| | 2 | 391 | | scope.Start(); |
| | | 392 | | try |
| | | 393 | | { |
| | 2 | 394 | | var response = RestClient.ListKeys(resourceGroupName, configStoreName, skipToken, cancellationToken) |
| | 2 | 395 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 396 | | } |
| | 0 | 397 | | catch (Exception e) |
| | | 398 | | { |
| | 0 | 399 | | scope.Failed(e); |
| | 0 | 400 | | throw; |
| | | 401 | | } |
| | 2 | 402 | | } |
| | | 403 | | Page<ApiKey> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 404 | | { |
| | 0 | 405 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.ListKeys"); |
| | 0 | 406 | | scope.Start(); |
| | | 407 | | try |
| | | 408 | | { |
| | 0 | 409 | | var response = RestClient.ListKeysNextPage(nextLink, resourceGroupName, configStoreName, skipToken, |
| | 0 | 410 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 411 | | } |
| | 0 | 412 | | catch (Exception e) |
| | | 413 | | { |
| | 0 | 414 | | scope.Failed(e); |
| | 0 | 415 | | throw; |
| | | 416 | | } |
| | 0 | 417 | | } |
| | 2 | 418 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 419 | | } |
| | | 420 | | |
| | | 421 | | /// <summary> Creates a configuration store with the specified parameters. </summary> |
| | | 422 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 423 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 424 | | /// <param name="configStoreCreationParameters"> The parameters for creating a configuration store. </param> |
| | | 425 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 426 | | public virtual async Task<ConfigurationStoresCreateOperation> StartCreateAsync(string resourceGroupName, string |
| | | 427 | | { |
| | 4 | 428 | | if (resourceGroupName == null) |
| | | 429 | | { |
| | 0 | 430 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 431 | | } |
| | 4 | 432 | | if (configStoreName == null) |
| | | 433 | | { |
| | 0 | 434 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 435 | | } |
| | 4 | 436 | | if (configStoreCreationParameters == null) |
| | | 437 | | { |
| | 0 | 438 | | throw new ArgumentNullException(nameof(configStoreCreationParameters)); |
| | | 439 | | } |
| | | 440 | | |
| | 4 | 441 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartCreate"); |
| | 4 | 442 | | scope.Start(); |
| | | 443 | | try |
| | | 444 | | { |
| | 4 | 445 | | var originalResponse = await RestClient.CreateAsync(resourceGroupName, configStoreName, configStoreCreat |
| | 4 | 446 | | return new ConfigurationStoresCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequ |
| | | 447 | | } |
| | 0 | 448 | | catch (Exception e) |
| | | 449 | | { |
| | 0 | 450 | | scope.Failed(e); |
| | 0 | 451 | | throw; |
| | | 452 | | } |
| | 4 | 453 | | } |
| | | 454 | | |
| | | 455 | | /// <summary> Creates a configuration store with the specified parameters. </summary> |
| | | 456 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 457 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 458 | | /// <param name="configStoreCreationParameters"> The parameters for creating a configuration store. </param> |
| | | 459 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 460 | | public virtual ConfigurationStoresCreateOperation StartCreate(string resourceGroupName, string configStoreName, |
| | | 461 | | { |
| | 4 | 462 | | if (resourceGroupName == null) |
| | | 463 | | { |
| | 0 | 464 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 465 | | } |
| | 4 | 466 | | if (configStoreName == null) |
| | | 467 | | { |
| | 0 | 468 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 469 | | } |
| | 4 | 470 | | if (configStoreCreationParameters == null) |
| | | 471 | | { |
| | 0 | 472 | | throw new ArgumentNullException(nameof(configStoreCreationParameters)); |
| | | 473 | | } |
| | | 474 | | |
| | 4 | 475 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartCreate"); |
| | 4 | 476 | | scope.Start(); |
| | | 477 | | try |
| | | 478 | | { |
| | 4 | 479 | | var originalResponse = RestClient.Create(resourceGroupName, configStoreName, configStoreCreationParamete |
| | 4 | 480 | | return new ConfigurationStoresCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequ |
| | | 481 | | } |
| | 0 | 482 | | catch (Exception e) |
| | | 483 | | { |
| | 0 | 484 | | scope.Failed(e); |
| | 0 | 485 | | throw; |
| | | 486 | | } |
| | 4 | 487 | | } |
| | | 488 | | |
| | | 489 | | /// <summary> Deletes a configuration store. </summary> |
| | | 490 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 491 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 492 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 493 | | public virtual async Task<ConfigurationStoresDeleteOperation> StartDeleteAsync(string resourceGroupName, string |
| | | 494 | | { |
| | 2 | 495 | | if (resourceGroupName == null) |
| | | 496 | | { |
| | 0 | 497 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 498 | | } |
| | 2 | 499 | | if (configStoreName == null) |
| | | 500 | | { |
| | 0 | 501 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 502 | | } |
| | | 503 | | |
| | 2 | 504 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartDelete"); |
| | 2 | 505 | | scope.Start(); |
| | | 506 | | try |
| | | 507 | | { |
| | 2 | 508 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, configStoreName, cancellationToke |
| | 2 | 509 | | return new ConfigurationStoresDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ |
| | | 510 | | } |
| | 0 | 511 | | catch (Exception e) |
| | | 512 | | { |
| | 0 | 513 | | scope.Failed(e); |
| | 0 | 514 | | throw; |
| | | 515 | | } |
| | 2 | 516 | | } |
| | | 517 | | |
| | | 518 | | /// <summary> Deletes a configuration store. </summary> |
| | | 519 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 520 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 521 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 522 | | public virtual ConfigurationStoresDeleteOperation StartDelete(string resourceGroupName, string configStoreName, |
| | | 523 | | { |
| | 2 | 524 | | if (resourceGroupName == null) |
| | | 525 | | { |
| | 0 | 526 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 527 | | } |
| | 2 | 528 | | if (configStoreName == null) |
| | | 529 | | { |
| | 0 | 530 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 531 | | } |
| | | 532 | | |
| | 2 | 533 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartDelete"); |
| | 2 | 534 | | scope.Start(); |
| | | 535 | | try |
| | | 536 | | { |
| | 2 | 537 | | var originalResponse = RestClient.Delete(resourceGroupName, configStoreName, cancellationToken); |
| | 2 | 538 | | return new ConfigurationStoresDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ |
| | | 539 | | } |
| | 0 | 540 | | catch (Exception e) |
| | | 541 | | { |
| | 0 | 542 | | scope.Failed(e); |
| | 0 | 543 | | throw; |
| | | 544 | | } |
| | 2 | 545 | | } |
| | | 546 | | |
| | | 547 | | /// <summary> Updates a configuration store with the specified parameters. </summary> |
| | | 548 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 549 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 550 | | /// <param name="configStoreUpdateParameters"> The parameters for updating a configuration store. </param> |
| | | 551 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 552 | | public virtual async Task<ConfigurationStoresUpdateOperation> StartUpdateAsync(string resourceGroupName, string |
| | | 553 | | { |
| | 2 | 554 | | if (resourceGroupName == null) |
| | | 555 | | { |
| | 0 | 556 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 557 | | } |
| | 2 | 558 | | if (configStoreName == null) |
| | | 559 | | { |
| | 0 | 560 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 561 | | } |
| | 2 | 562 | | if (configStoreUpdateParameters == null) |
| | | 563 | | { |
| | 0 | 564 | | throw new ArgumentNullException(nameof(configStoreUpdateParameters)); |
| | | 565 | | } |
| | | 566 | | |
| | 2 | 567 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartUpdate"); |
| | 2 | 568 | | scope.Start(); |
| | | 569 | | try |
| | | 570 | | { |
| | 2 | 571 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, configStoreName, configStoreUpdat |
| | 2 | 572 | | return new ConfigurationStoresUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequ |
| | | 573 | | } |
| | 0 | 574 | | catch (Exception e) |
| | | 575 | | { |
| | 0 | 576 | | scope.Failed(e); |
| | 0 | 577 | | throw; |
| | | 578 | | } |
| | 2 | 579 | | } |
| | | 580 | | |
| | | 581 | | /// <summary> Updates a configuration store with the specified parameters. </summary> |
| | | 582 | | /// <param name="resourceGroupName"> The name of the resource group to which the container registry belongs. </p |
| | | 583 | | /// <param name="configStoreName"> The name of the configuration store. </param> |
| | | 584 | | /// <param name="configStoreUpdateParameters"> The parameters for updating a configuration store. </param> |
| | | 585 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 586 | | public virtual ConfigurationStoresUpdateOperation StartUpdate(string resourceGroupName, string configStoreName, |
| | | 587 | | { |
| | 2 | 588 | | if (resourceGroupName == null) |
| | | 589 | | { |
| | 0 | 590 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 591 | | } |
| | 2 | 592 | | if (configStoreName == null) |
| | | 593 | | { |
| | 0 | 594 | | throw new ArgumentNullException(nameof(configStoreName)); |
| | | 595 | | } |
| | 2 | 596 | | if (configStoreUpdateParameters == null) |
| | | 597 | | { |
| | 0 | 598 | | throw new ArgumentNullException(nameof(configStoreUpdateParameters)); |
| | | 599 | | } |
| | | 600 | | |
| | 2 | 601 | | using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresOperations.StartUpdate"); |
| | 2 | 602 | | scope.Start(); |
| | | 603 | | try |
| | | 604 | | { |
| | 2 | 605 | | var originalResponse = RestClient.Update(resourceGroupName, configStoreName, configStoreUpdateParameters |
| | 2 | 606 | | return new ConfigurationStoresUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequ |
| | | 607 | | } |
| | 0 | 608 | | catch (Exception e) |
| | | 609 | | { |
| | 0 | 610 | | scope.Failed(e); |
| | 0 | 611 | | throw; |
| | | 612 | | } |
| | 2 | 613 | | } |
| | | 614 | | } |
| | | 615 | | } |