< Summary

Class:Azure.ResourceManager.Network.ServiceEndpointPolicyDefinitionsOperations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceEndpointPolicyDefinitionsOperations.cs
Covered lines:0
Uncovered lines:124
Coverable lines:124
Total lines:322
Line coverage:0% (0 of 124)
Covered branches:0
Total branches:36
Branch coverage:0% (0 of 36)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
ListByResourceGroupAsync(...)-0%0%
<ListByResourceGroupAsync()-0%100%
<ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServiceEndpointPolicyDefinitionsOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Network.Models;
 15
 16namespace Azure.ResourceManager.Network
 17{
 18    /// <summary> The ServiceEndpointPolicyDefinitions service client. </summary>
 19    public partial class ServiceEndpointPolicyDefinitionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal ServiceEndpointPolicyDefinitionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ServiceEndpointPolicyDefinitionsOperations for mocking. </summary>
 025        protected ServiceEndpointPolicyDefinitionsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of ServiceEndpointPolicyDefinitionsOperations. </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 subscription credentials which uniquely identify the Microsoft Azure subsc
 32        /// <param name="endpoint"> server parameter. </param>
 033        internal ServiceEndpointPolicyDefinitionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, 
 34        {
 035            RestClient = new ServiceEndpointPolicyDefinitionsRestOperations(clientDiagnostics, pipeline, subscriptionId,
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Get the specified service endpoint policy definitions from service endpoint policy. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy name. </param>
 43        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition name. 
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<ServiceEndpointPolicyDefinition>> GetAsync(string resourceGroupName, string s
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefi
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> Get the specified service endpoint policy definitions from service endpoint policy. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy name. </param>
 63        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition name. 
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<ServiceEndpointPolicyDefinition> Get(string resourceGroupName, string serviceEndpointPol
 66        {
 067            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.Get");
 068            scope.Start();
 69            try
 70            {
 071                return RestClient.Get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName,
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 078        }
 79
 80        /// <summary> Gets all service endpoint policy definitions in a service end point policy. </summary>
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy name. </param>
 83        /// <param name="cancellationToken"> The cancellation token to use. </param>
 84        public virtual AsyncPageable<ServiceEndpointPolicyDefinition> ListByResourceGroupAsync(string resourceGroupName,
 85        {
 086            if (resourceGroupName == null)
 87            {
 088                throw new ArgumentNullException(nameof(resourceGroupName));
 89            }
 090            if (serviceEndpointPolicyName == null)
 91            {
 092                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 93            }
 94
 95            async Task<Page<ServiceEndpointPolicyDefinition>> FirstPageFunc(int? pageSizeHint)
 96            {
 097                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.ListByResou
 098                scope.Start();
 99                try
 100                {
 0101                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, serviceEndpointPolicyNam
 0102                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 103                }
 0104                catch (Exception e)
 105                {
 0106                    scope.Failed(e);
 0107                    throw;
 108                }
 0109            }
 110            async Task<Page<ServiceEndpointPolicyDefinition>> NextPageFunc(string nextLink, int? pageSizeHint)
 111            {
 0112                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.ListByResou
 0113                scope.Start();
 114                try
 115                {
 0116                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, servic
 0117                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 118                }
 0119                catch (Exception e)
 120                {
 0121                    scope.Failed(e);
 0122                    throw;
 123                }
 0124            }
 0125            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 126        }
 127
 128        /// <summary> Gets all service endpoint policy definitions in a service end point policy. </summary>
 129        /// <param name="resourceGroupName"> The name of the resource group. </param>
 130        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy name. </param>
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public virtual Pageable<ServiceEndpointPolicyDefinition> ListByResourceGroup(string resourceGroupName, string se
 133        {
 0134            if (resourceGroupName == null)
 135            {
 0136                throw new ArgumentNullException(nameof(resourceGroupName));
 137            }
 0138            if (serviceEndpointPolicyName == null)
 139            {
 0140                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 141            }
 142
 143            Page<ServiceEndpointPolicyDefinition> FirstPageFunc(int? pageSizeHint)
 144            {
 0145                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.ListByResou
 0146                scope.Start();
 147                try
 148                {
 0149                    var response = RestClient.ListByResourceGroup(resourceGroupName, serviceEndpointPolicyName, cancella
 0150                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 151                }
 0152                catch (Exception e)
 153                {
 0154                    scope.Failed(e);
 0155                    throw;
 156                }
 0157            }
 158            Page<ServiceEndpointPolicyDefinition> NextPageFunc(string nextLink, int? pageSizeHint)
 159            {
 0160                using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.ListByResou
 0161                scope.Start();
 162                try
 163                {
 0164                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, serviceEndpointPo
 0165                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 166                }
 0167                catch (Exception e)
 168                {
 0169                    scope.Failed(e);
 0170                    throw;
 171                }
 0172            }
 0173            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 174        }
 175
 176        /// <summary> Deletes the specified ServiceEndpoint policy definitions. </summary>
 177        /// <param name="resourceGroupName"> The name of the resource group. </param>
 178        /// <param name="serviceEndpointPolicyName"> The name of the Service Endpoint Policy. </param>
 179        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition. </par
 180        /// <param name="cancellationToken"> The cancellation token to use. </param>
 181        public virtual async Task<ServiceEndpointPolicyDefinitionsDeleteOperation> StartDeleteAsync(string resourceGroup
 182        {
 0183            if (resourceGroupName == null)
 184            {
 0185                throw new ArgumentNullException(nameof(resourceGroupName));
 186            }
 0187            if (serviceEndpointPolicyName == null)
 188            {
 0189                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 190            }
 0191            if (serviceEndpointPolicyDefinitionName == null)
 192            {
 0193                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitionName));
 194            }
 195
 0196            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.StartDelete");
 0197            scope.Start();
 198            try
 199            {
 0200                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, serviceEndpointPolicyName, servic
 0201                return new ServiceEndpointPolicyDefinitionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 202            }
 0203            catch (Exception e)
 204            {
 0205                scope.Failed(e);
 0206                throw;
 207            }
 0208        }
 209
 210        /// <summary> Deletes the specified ServiceEndpoint policy definitions. </summary>
 211        /// <param name="resourceGroupName"> The name of the resource group. </param>
 212        /// <param name="serviceEndpointPolicyName"> The name of the Service Endpoint Policy. </param>
 213        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition. </par
 214        /// <param name="cancellationToken"> The cancellation token to use. </param>
 215        public virtual ServiceEndpointPolicyDefinitionsDeleteOperation StartDelete(string resourceGroupName, string serv
 216        {
 0217            if (resourceGroupName == null)
 218            {
 0219                throw new ArgumentNullException(nameof(resourceGroupName));
 220            }
 0221            if (serviceEndpointPolicyName == null)
 222            {
 0223                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 224            }
 0225            if (serviceEndpointPolicyDefinitionName == null)
 226            {
 0227                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitionName));
 228            }
 229
 0230            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.StartDelete");
 0231            scope.Start();
 232            try
 233            {
 0234                var originalResponse = RestClient.Delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPo
 0235                return new ServiceEndpointPolicyDefinitionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 236            }
 0237            catch (Exception e)
 238            {
 0239                scope.Failed(e);
 0240                throw;
 241            }
 0242        }
 243
 244        /// <summary> Creates or updates a service endpoint policy definition in the specified service endpoint policy. 
 245        /// <param name="resourceGroupName"> The name of the resource group. </param>
 246        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy. </param>
 247        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition name. 
 248        /// <param name="serviceEndpointPolicyDefinitions"> Parameters supplied to the create or update service endpoint
 249        /// <param name="cancellationToken"> The cancellation token to use. </param>
 250        public virtual async Task<ServiceEndpointPolicyDefinitionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(stri
 251        {
 0252            if (resourceGroupName == null)
 253            {
 0254                throw new ArgumentNullException(nameof(resourceGroupName));
 255            }
 0256            if (serviceEndpointPolicyName == null)
 257            {
 0258                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 259            }
 0260            if (serviceEndpointPolicyDefinitionName == null)
 261            {
 0262                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitionName));
 263            }
 0264            if (serviceEndpointPolicyDefinitions == null)
 265            {
 0266                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitions));
 267            }
 268
 0269            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.StartCreateOrUp
 0270            scope.Start();
 271            try
 272            {
 0273                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, serviceEndpointPolicyName
 0274                return new ServiceEndpointPolicyDefinitionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestCl
 275            }
 0276            catch (Exception e)
 277            {
 0278                scope.Failed(e);
 0279                throw;
 280            }
 0281        }
 282
 283        /// <summary> Creates or updates a service endpoint policy definition in the specified service endpoint policy. 
 284        /// <param name="resourceGroupName"> The name of the resource group. </param>
 285        /// <param name="serviceEndpointPolicyName"> The name of the service endpoint policy. </param>
 286        /// <param name="serviceEndpointPolicyDefinitionName"> The name of the service endpoint policy definition name. 
 287        /// <param name="serviceEndpointPolicyDefinitions"> Parameters supplied to the create or update service endpoint
 288        /// <param name="cancellationToken"> The cancellation token to use. </param>
 289        public virtual ServiceEndpointPolicyDefinitionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupN
 290        {
 0291            if (resourceGroupName == null)
 292            {
 0293                throw new ArgumentNullException(nameof(resourceGroupName));
 294            }
 0295            if (serviceEndpointPolicyName == null)
 296            {
 0297                throw new ArgumentNullException(nameof(serviceEndpointPolicyName));
 298            }
 0299            if (serviceEndpointPolicyDefinitionName == null)
 300            {
 0301                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitionName));
 302            }
 0303            if (serviceEndpointPolicyDefinitions == null)
 304            {
 0305                throw new ArgumentNullException(nameof(serviceEndpointPolicyDefinitions));
 306            }
 307
 0308            using var scope = _clientDiagnostics.CreateScope("ServiceEndpointPolicyDefinitionsOperations.StartCreateOrUp
 0309            scope.Start();
 310            try
 311            {
 0312                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEn
 0313                return new ServiceEndpointPolicyDefinitionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestCl
 314            }
 0315            catch (Exception e)
 316            {
 0317                scope.Failed(e);
 0318                throw;
 319            }
 0320        }
 321    }
 322}