< Summary

Class:Azure.ResourceManager.Storage.Operations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Operations.cs
Covered lines:0
Uncovered lines:26
Coverable lines:26
Total lines:84
Line coverage:0% (0 of 26)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
<ListAsync()-0%100%
ListAsync(...)-0%100%
List(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Operations.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.Storage.Models;
 15
 16namespace Azure.ResourceManager.Storage
 17{
 18    /// <summary> The  service client. </summary>
 19    public partial class Operations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal RestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of Operations for mocking. </summary>
 025        protected Operations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of Operations. </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="endpoint"> server parameter. </param>
 32        /// <param name="apiVersion"> Api Version. </param>
 033        internal Operations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint = null, string apiV
 34        {
 035            RestClient = new RestOperations(clientDiagnostics, pipeline, endpoint, apiVersion);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Lists all of the available Storage Rest API operations. </summary>
 41        /// <param name="cancellationToken"> The cancellation token to use. </param>
 42        public virtual AsyncPageable<Operation> ListAsync(CancellationToken cancellationToken = default)
 43        {
 44            async Task<Page<Operation>> FirstPageFunc(int? pageSizeHint)
 45            {
 046                using var scope = _clientDiagnostics.CreateScope("Operations.List");
 047                scope.Start();
 48                try
 49                {
 050                    var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false);
 051                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 52                }
 053                catch (Exception e)
 54                {
 055                    scope.Failed(e);
 056                    throw;
 57                }
 058            }
 059            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
 60        }
 61
 62        /// <summary> Lists all of the available Storage Rest API operations. </summary>
 63        /// <param name="cancellationToken"> The cancellation token to use. </param>
 64        public virtual Pageable<Operation> List(CancellationToken cancellationToken = default)
 65        {
 66            Page<Operation> FirstPageFunc(int? pageSizeHint)
 67            {
 068                using var scope = _clientDiagnostics.CreateScope("Operations.List");
 069                scope.Start();
 70                try
 71                {
 072                    var response = RestClient.List(cancellationToken);
 073                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 74                }
 075                catch (Exception e)
 76                {
 077                    scope.Failed(e);
 078                    throw;
 79                }
 080            }
 081            return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
 82        }
 83    }
 84}