< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
UpdateTagsAsync()-0%100%
UpdateTags(...)-0%100%
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\DdosCustomPoliciesOperations.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.Pipeline;
 13using Azure.ResourceManager.Network.Models;
 14
 15namespace Azure.ResourceManager.Network
 16{
 17    /// <summary> The DdosCustomPolicies service client. </summary>
 18    public partial class DdosCustomPoliciesOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal DdosCustomPoliciesRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of DdosCustomPoliciesOperations for mocking. </summary>
 024        protected DdosCustomPoliciesOperations()
 25        {
 026        }
 27        /// <summary> Initializes a new instance of DdosCustomPoliciesOperations. </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>
 032        internal DdosCustomPoliciesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri
 33        {
 034            RestClient = new DdosCustomPoliciesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 035            _clientDiagnostics = clientDiagnostics;
 036            _pipeline = pipeline;
 037        }
 38
 39        /// <summary> Gets information about the specified DDoS custom policy. </summary>
 40        /// <param name="resourceGroupName"> The name of the resource group. </param>
 41        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 42        /// <param name="cancellationToken"> The cancellation token to use. </param>
 43        public virtual async Task<Response<DdosCustomPolicy>> GetAsync(string resourceGroupName, string ddosCustomPolicy
 44        {
 045            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.Get");
 046            scope.Start();
 47            try
 48            {
 049                return await RestClient.GetAsync(resourceGroupName, ddosCustomPolicyName, cancellationToken).ConfigureAw
 50            }
 051            catch (Exception e)
 52            {
 053                scope.Failed(e);
 054                throw;
 55            }
 056        }
 57
 58        /// <summary> Gets information about the specified DDoS custom policy. </summary>
 59        /// <param name="resourceGroupName"> The name of the resource group. </param>
 60        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 61        /// <param name="cancellationToken"> The cancellation token to use. </param>
 62        public virtual Response<DdosCustomPolicy> Get(string resourceGroupName, string ddosCustomPolicyName, Cancellatio
 63        {
 064            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.Get");
 065            scope.Start();
 66            try
 67            {
 068                return RestClient.Get(resourceGroupName, ddosCustomPolicyName, cancellationToken);
 69            }
 070            catch (Exception e)
 71            {
 072                scope.Failed(e);
 073                throw;
 74            }
 075        }
 76
 77        /// <summary> Update a DDoS custom policy tags. </summary>
 78        /// <param name="resourceGroupName"> The name of the resource group. </param>
 79        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 80        /// <param name="parameters"> Parameters supplied to update DDoS custom policy resource tags. </param>
 81        /// <param name="cancellationToken"> The cancellation token to use. </param>
 82        public virtual async Task<Response<DdosCustomPolicy>> UpdateTagsAsync(string resourceGroupName, string ddosCusto
 83        {
 084            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.UpdateTags");
 085            scope.Start();
 86            try
 87            {
 088                return await RestClient.UpdateTagsAsync(resourceGroupName, ddosCustomPolicyName, parameters, cancellatio
 89            }
 090            catch (Exception e)
 91            {
 092                scope.Failed(e);
 093                throw;
 94            }
 095        }
 96
 97        /// <summary> Update a DDoS custom policy tags. </summary>
 98        /// <param name="resourceGroupName"> The name of the resource group. </param>
 99        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 100        /// <param name="parameters"> Parameters supplied to update DDoS custom policy resource tags. </param>
 101        /// <param name="cancellationToken"> The cancellation token to use. </param>
 102        public virtual Response<DdosCustomPolicy> UpdateTags(string resourceGroupName, string ddosCustomPolicyName, Tags
 103        {
 0104            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.UpdateTags");
 0105            scope.Start();
 106            try
 107            {
 0108                return RestClient.UpdateTags(resourceGroupName, ddosCustomPolicyName, parameters, cancellationToken);
 109            }
 0110            catch (Exception e)
 111            {
 0112                scope.Failed(e);
 0113                throw;
 114            }
 0115        }
 116
 117        /// <summary> Deletes the specified DDoS custom policy. </summary>
 118        /// <param name="resourceGroupName"> The name of the resource group. </param>
 119        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 120        /// <param name="cancellationToken"> The cancellation token to use. </param>
 121        public virtual async Task<DdosCustomPoliciesDeleteOperation> StartDeleteAsync(string resourceGroupName, string d
 122        {
 0123            if (resourceGroupName == null)
 124            {
 0125                throw new ArgumentNullException(nameof(resourceGroupName));
 126            }
 0127            if (ddosCustomPolicyName == null)
 128            {
 0129                throw new ArgumentNullException(nameof(ddosCustomPolicyName));
 130            }
 131
 0132            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.StartDelete");
 0133            scope.Start();
 134            try
 135            {
 0136                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, ddosCustomPolicyName, cancellatio
 0137                return new DdosCustomPoliciesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque
 138            }
 0139            catch (Exception e)
 140            {
 0141                scope.Failed(e);
 0142                throw;
 143            }
 0144        }
 145
 146        /// <summary> Deletes the specified DDoS custom policy. </summary>
 147        /// <param name="resourceGroupName"> The name of the resource group. </param>
 148        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 149        /// <param name="cancellationToken"> The cancellation token to use. </param>
 150        public virtual DdosCustomPoliciesDeleteOperation StartDelete(string resourceGroupName, string ddosCustomPolicyNa
 151        {
 0152            if (resourceGroupName == null)
 153            {
 0154                throw new ArgumentNullException(nameof(resourceGroupName));
 155            }
 0156            if (ddosCustomPolicyName == null)
 157            {
 0158                throw new ArgumentNullException(nameof(ddosCustomPolicyName));
 159            }
 160
 0161            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.StartDelete");
 0162            scope.Start();
 163            try
 164            {
 0165                var originalResponse = RestClient.Delete(resourceGroupName, ddosCustomPolicyName, cancellationToken);
 0166                return new DdosCustomPoliciesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque
 167            }
 0168            catch (Exception e)
 169            {
 0170                scope.Failed(e);
 0171                throw;
 172            }
 0173        }
 174
 175        /// <summary> Creates or updates a DDoS custom policy. </summary>
 176        /// <param name="resourceGroupName"> The name of the resource group. </param>
 177        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 178        /// <param name="parameters"> Parameters supplied to the create or update operation. </param>
 179        /// <param name="cancellationToken"> The cancellation token to use. </param>
 180        public virtual async Task<DdosCustomPoliciesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGro
 181        {
 0182            if (resourceGroupName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(resourceGroupName));
 185            }
 0186            if (ddosCustomPolicyName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(ddosCustomPolicyName));
 189            }
 0190            if (parameters == null)
 191            {
 0192                throw new ArgumentNullException(nameof(parameters));
 193            }
 194
 0195            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.StartCreateOrUpdate");
 0196            scope.Start();
 197            try
 198            {
 0199                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, ddosCustomPolicyName, par
 0200                return new DdosCustomPoliciesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre
 201            }
 0202            catch (Exception e)
 203            {
 0204                scope.Failed(e);
 0205                throw;
 206            }
 0207        }
 208
 209        /// <summary> Creates or updates a DDoS custom policy. </summary>
 210        /// <param name="resourceGroupName"> The name of the resource group. </param>
 211        /// <param name="ddosCustomPolicyName"> The name of the DDoS custom policy. </param>
 212        /// <param name="parameters"> Parameters supplied to the create or update operation. </param>
 213        /// <param name="cancellationToken"> The cancellation token to use. </param>
 214        public virtual DdosCustomPoliciesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string dd
 215        {
 0216            if (resourceGroupName == null)
 217            {
 0218                throw new ArgumentNullException(nameof(resourceGroupName));
 219            }
 0220            if (ddosCustomPolicyName == null)
 221            {
 0222                throw new ArgumentNullException(nameof(ddosCustomPolicyName));
 223            }
 0224            if (parameters == null)
 225            {
 0226                throw new ArgumentNullException(nameof(parameters));
 227            }
 228
 0229            using var scope = _clientDiagnostics.CreateScope("DdosCustomPoliciesOperations.StartCreateOrUpdate");
 0230            scope.Start();
 231            try
 232            {
 0233                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, ddosCustomPolicyName, parameters, ca
 0234                return new DdosCustomPoliciesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre
 235            }
 0236            catch (Exception e)
 237            {
 0238                scope.Failed(e);
 0239                throw;
 240            }
 0241        }
 242    }
 243}