| | 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.Network.Models; |
| | 14 | |
|
| | 15 | | namespace Azure.ResourceManager.Network |
| | 16 | | { |
| | 17 | | /// <summary> The ServiceTags service client. </summary> |
| | 18 | | public partial class ServiceTagsOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal ServiceTagsRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of ServiceTagsOperations for mocking. </summary> |
| 0 | 24 | | protected ServiceTagsOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | | /// <summary> Initializes a new instance of ServiceTagsOperations. </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 subscription credentials which uniquely identify the Microsoft Azure subsc |
| | 31 | | /// <param name="endpoint"> server parameter. </param> |
| 0 | 32 | | internal ServiceTagsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId |
| | 33 | | { |
| 0 | 34 | | RestClient = new ServiceTagsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> Gets a list of service tag information resources. </summary> |
| | 40 | | /// <param name="location"> The location that will be used as a reference for version (not as a filter based on |
| | 41 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 42 | | public virtual async Task<Response<ServiceTagsListResult>> ListAsync(string location, CancellationToken cancella |
| | 43 | | { |
| 0 | 44 | | using var scope = _clientDiagnostics.CreateScope("ServiceTagsOperations.List"); |
| 0 | 45 | | scope.Start(); |
| | 46 | | try |
| | 47 | | { |
| 0 | 48 | | return await RestClient.ListAsync(location, cancellationToken).ConfigureAwait(false); |
| | 49 | | } |
| 0 | 50 | | catch (Exception e) |
| | 51 | | { |
| 0 | 52 | | scope.Failed(e); |
| 0 | 53 | | throw; |
| | 54 | | } |
| 0 | 55 | | } |
| | 56 | |
|
| | 57 | | /// <summary> Gets a list of service tag information resources. </summary> |
| | 58 | | /// <param name="location"> The location that will be used as a reference for version (not as a filter based on |
| | 59 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 60 | | public virtual Response<ServiceTagsListResult> List(string location, CancellationToken cancellationToken = defau |
| | 61 | | { |
| 0 | 62 | | using var scope = _clientDiagnostics.CreateScope("ServiceTagsOperations.List"); |
| 0 | 63 | | scope.Start(); |
| | 64 | | try |
| | 65 | | { |
| 0 | 66 | | return RestClient.List(location, cancellationToken); |
| | 67 | | } |
| 0 | 68 | | catch (Exception e) |
| | 69 | | { |
| 0 | 70 | | scope.Failed(e); |
| 0 | 71 | | throw; |
| | 72 | | } |
| 0 | 73 | | } |
| | 74 | | } |
| | 75 | | } |