| | 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 ServiceAssociationLinks service client. </summary> |
| | 18 | | public partial class ServiceAssociationLinksOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal ServiceAssociationLinksRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of ServiceAssociationLinksOperations for mocking. </summary> |
| 0 | 24 | | protected ServiceAssociationLinksOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 27 | | /// <summary> Initializes a new instance of ServiceAssociationLinksOperations. </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 ServiceAssociationLinksOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su |
| | 33 | | { |
| 0 | 34 | | RestClient = new ServiceAssociationLinksRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | /// <summary> Gets a list of service association links for a subnet. </summary> |
| | 40 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 41 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 42 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<ServiceAssociationLinksListResult>> ListAsync(string resourceGroupName, strin |
| | 45 | | { |
| 0 | 46 | | using var scope = _clientDiagnostics.CreateScope("ServiceAssociationLinksOperations.List"); |
| 0 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 0 | 50 | | return await RestClient.ListAsync(resourceGroupName, virtualNetworkName, subnetName, cancellationToken). |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Gets a list of service association links for a subnet. </summary> |
| | 60 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 61 | | /// <param name="virtualNetworkName"> The name of the virtual network. </param> |
| | 62 | | /// <param name="subnetName"> The name of the subnet. </param> |
| | 63 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 64 | | public virtual Response<ServiceAssociationLinksListResult> List(string resourceGroupName, string virtualNetworkN |
| | 65 | | { |
| 0 | 66 | | using var scope = _clientDiagnostics.CreateScope("ServiceAssociationLinksOperations.List"); |
| 0 | 67 | | scope.Start(); |
| | 68 | | try |
| | 69 | | { |
| 0 | 70 | | return RestClient.List(resourceGroupName, virtualNetworkName, subnetName, cancellationToken); |
| | 71 | | } |
| 0 | 72 | | catch (Exception e) |
| | 73 | | { |
| 0 | 74 | | scope.Failed(e); |
| 0 | 75 | | throw; |
| | 76 | | } |
| 0 | 77 | | } |
| | 78 | | } |
| | 79 | | } |