< Summary

Class:Azure.ResourceManager.DigitalTwins.DigitalTwinsEndpointOperations
Assembly:Azure.ResourceManager.DigitalTwins
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\DigitalTwinsEndpointOperations.cs
Covered lines:0
Uncovered lines:120
Coverable lines:120
Total lines:321
Line coverage:0% (0 of 120)
Covered branches:0
Total branches:32
Branch coverage:0% (0 of 32)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\DigitalTwinsEndpointOperations.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.DigitalTwins.Models;
 15
 16namespace Azure.ResourceManager.DigitalTwins
 17{
 18    /// <summary> The DigitalTwinsEndpoint service client. </summary>
 19    public partial class DigitalTwinsEndpointOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal DigitalTwinsEndpointRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of DigitalTwinsEndpointOperations for mocking. </summary>
 025        protected DigitalTwinsEndpointOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of DigitalTwinsEndpointOperations. </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 identifier. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 034        internal DigitalTwinsEndpointOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 35        {
 036            RestClient = new DigitalTwinsEndpointRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, a
 037            _clientDiagnostics = clientDiagnostics;
 038            _pipeline = pipeline;
 039        }
 40
 41        /// <summary> Get DigitalTwinsInstances Endpoint. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 43        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 44        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<DigitalTwinsEndpointResource>> GetAsync(string resourceGroupName, string reso
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.Get");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.GetAsync(resourceGroupName, resourceName, endpointName, cancellationToken).Confi
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> Get DigitalTwinsInstances Endpoint. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 63        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 64        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<DigitalTwinsEndpointResource> Get(string resourceGroupName, string resourceName, string 
 67        {
 068            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.Get");
 069            scope.Start();
 70            try
 71            {
 072                return RestClient.Get(resourceGroupName, resourceName, endpointName, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 079        }
 80
 81        /// <summary> Get DigitalTwinsInstance Endpoints. </summary>
 82        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 83        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam
 86        public virtual AsyncPageable<DigitalTwinsEndpointResource> ListAsync(string resourceGroupName, string resourceNa
 87        {
 088            if (resourceGroupName == null)
 89            {
 090                throw new ArgumentNullException(nameof(resourceGroupName));
 91            }
 092            if (resourceName == null)
 93            {
 094                throw new ArgumentNullException(nameof(resourceName));
 95            }
 96
 97            async Task<Page<DigitalTwinsEndpointResource>> FirstPageFunc(int? pageSizeHint)
 98            {
 099                using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.List");
 0100                scope.Start();
 101                try
 102                {
 0103                    var response = await RestClient.ListAsync(resourceGroupName, resourceName, cancellationToken).Config
 0104                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 105                }
 0106                catch (Exception e)
 107                {
 0108                    scope.Failed(e);
 0109                    throw;
 110                }
 0111            }
 112            async Task<Page<DigitalTwinsEndpointResource>> NextPageFunc(string nextLink, int? pageSizeHint)
 113            {
 0114                using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.List");
 0115                scope.Start();
 116                try
 117                {
 0118                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, resourceName, cancell
 0119                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 120                }
 0121                catch (Exception e)
 122                {
 0123                    scope.Failed(e);
 0124                    throw;
 125                }
 0126            }
 0127            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 128        }
 129
 130        /// <summary> Get DigitalTwinsInstance Endpoints. </summary>
 131        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 132        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 133        /// <param name="cancellationToken"> The cancellation token to use. </param>
 134        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/> or <paramref name="resourceNam
 135        public virtual Pageable<DigitalTwinsEndpointResource> List(string resourceGroupName, string resourceName, Cancel
 136        {
 0137            if (resourceGroupName == null)
 138            {
 0139                throw new ArgumentNullException(nameof(resourceGroupName));
 140            }
 0141            if (resourceName == null)
 142            {
 0143                throw new ArgumentNullException(nameof(resourceName));
 144            }
 145
 146            Page<DigitalTwinsEndpointResource> FirstPageFunc(int? pageSizeHint)
 147            {
 0148                using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.List");
 0149                scope.Start();
 150                try
 151                {
 0152                    var response = RestClient.List(resourceGroupName, resourceName, cancellationToken);
 0153                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 154                }
 0155                catch (Exception e)
 156                {
 0157                    scope.Failed(e);
 0158                    throw;
 159                }
 0160            }
 161            Page<DigitalTwinsEndpointResource> NextPageFunc(string nextLink, int? pageSizeHint)
 162            {
 0163                using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.List");
 0164                scope.Start();
 165                try
 166                {
 0167                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, resourceName, cancellationToken)
 0168                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 169                }
 0170                catch (Exception e)
 171                {
 0172                    scope.Failed(e);
 0173                    throw;
 174                }
 0175            }
 0176            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 177        }
 178
 179        /// <summary> Create or update DigitalTwinsInstance endpoint. </summary>
 180        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 181        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 182        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 183        /// <param name="properties"> DigitalTwinsInstance endpoint resource properties. </param>
 184        /// <param name="cancellationToken"> The cancellation token to use. </param>
 185        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName"
 186        public virtual async Task<DigitalTwinsEndpointCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceG
 187        {
 0188            if (resourceGroupName == null)
 189            {
 0190                throw new ArgumentNullException(nameof(resourceGroupName));
 191            }
 0192            if (resourceName == null)
 193            {
 0194                throw new ArgumentNullException(nameof(resourceName));
 195            }
 0196            if (endpointName == null)
 197            {
 0198                throw new ArgumentNullException(nameof(endpointName));
 199            }
 200
 0201            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.StartCreateOrUpdate");
 0202            scope.Start();
 203            try
 204            {
 0205                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, resourceName, endpointNam
 0206                return new DigitalTwinsEndpointCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC
 207            }
 0208            catch (Exception e)
 209            {
 0210                scope.Failed(e);
 0211                throw;
 212            }
 0213        }
 214
 215        /// <summary> Create or update DigitalTwinsInstance endpoint. </summary>
 216        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 217        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 218        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 219        /// <param name="properties"> DigitalTwinsInstance endpoint resource properties. </param>
 220        /// <param name="cancellationToken"> The cancellation token to use. </param>
 221        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName"
 222        public virtual DigitalTwinsEndpointCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string 
 223        {
 0224            if (resourceGroupName == null)
 225            {
 0226                throw new ArgumentNullException(nameof(resourceGroupName));
 227            }
 0228            if (resourceName == null)
 229            {
 0230                throw new ArgumentNullException(nameof(resourceName));
 231            }
 0232            if (endpointName == null)
 233            {
 0234                throw new ArgumentNullException(nameof(endpointName));
 235            }
 236
 0237            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.StartCreateOrUpdate");
 0238            scope.Start();
 239            try
 240            {
 0241                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, resourceName, endpointName, properti
 0242                return new DigitalTwinsEndpointCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateC
 243            }
 0244            catch (Exception e)
 245            {
 0246                scope.Failed(e);
 0247                throw;
 248            }
 0249        }
 250
 251        /// <summary> Delete a DigitalTwinsInstance endpoint. </summary>
 252        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 253        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 254        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 255        /// <param name="cancellationToken"> The cancellation token to use. </param>
 256        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName"
 257        public virtual async Task<DigitalTwinsEndpointDeleteOperation> StartDeleteAsync(string resourceGroupName, string
 258        {
 0259            if (resourceGroupName == null)
 260            {
 0261                throw new ArgumentNullException(nameof(resourceGroupName));
 262            }
 0263            if (resourceName == null)
 264            {
 0265                throw new ArgumentNullException(nameof(resourceName));
 266            }
 0267            if (endpointName == null)
 268            {
 0269                throw new ArgumentNullException(nameof(endpointName));
 270            }
 271
 0272            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.StartDelete");
 0273            scope.Start();
 274            try
 275            {
 0276                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, resourceName, endpointName, cance
 0277                return new DigitalTwinsEndpointDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq
 278            }
 0279            catch (Exception e)
 280            {
 0281                scope.Failed(e);
 0282                throw;
 283            }
 0284        }
 285
 286        /// <summary> Delete a DigitalTwinsInstance endpoint. </summary>
 287        /// <param name="resourceGroupName"> The name of the resource group that contains the DigitalTwinsInstance. </pa
 288        /// <param name="resourceName"> The name of the DigitalTwinsInstance. </param>
 289        /// <param name="endpointName"> Name of Endpoint Resource. </param>
 290        /// <param name="cancellationToken"> The cancellation token to use. </param>
 291        /// <exception cref="ArgumentNullException"> <paramref name="resourceGroupName"/>, <paramref name="resourceName"
 292        public virtual DigitalTwinsEndpointDeleteOperation StartDelete(string resourceGroupName, string resourceName, st
 293        {
 0294            if (resourceGroupName == null)
 295            {
 0296                throw new ArgumentNullException(nameof(resourceGroupName));
 297            }
 0298            if (resourceName == null)
 299            {
 0300                throw new ArgumentNullException(nameof(resourceName));
 301            }
 0302            if (endpointName == null)
 303            {
 0304                throw new ArgumentNullException(nameof(endpointName));
 305            }
 306
 0307            using var scope = _clientDiagnostics.CreateScope("DigitalTwinsEndpointOperations.StartDelete");
 0308            scope.Start();
 309            try
 310            {
 0311                var originalResponse = RestClient.Delete(resourceGroupName, resourceName, endpointName, cancellationToke
 0312                return new DigitalTwinsEndpointDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReq
 313            }
 0314            catch (Exception e)
 315            {
 0316                scope.Failed(e);
 0317                throw;
 318            }
 0319        }
 320    }
 321}