< Summary

Class:Azure.ResourceManager.Compute.LogAnalyticsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\LogAnalyticsOperations.cs
Covered lines:7
Uncovered lines:49
Coverable lines:56
Total lines:154
Line coverage:12.5% (7 of 56)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-100%100%
.ctor(...)-100%100%
StartExportRequestRateByIntervalAsync()-0%0%
StartExportRequestRateByInterval(...)-0%0%
StartExportThrottledRequestsAsync()-0%0%
StartExportThrottledRequests(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\LogAnalyticsOperations.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.Core.Pipeline;
 12using Azure.ResourceManager.Compute.Models;
 13
 14namespace Azure.ResourceManager.Compute
 15{
 16    /// <summary> The LogAnalytics service client. </summary>
 17    public partial class LogAnalyticsOperations
 18    {
 19        private readonly ClientDiagnostics _clientDiagnostics;
 20        private readonly HttpPipeline _pipeline;
 021        internal LogAnalyticsRestOperations RestClient { get; }
 22        /// <summary> Initializes a new instance of LogAnalyticsOperations for mocking. </summary>
 39623        protected LogAnalyticsOperations()
 24        {
 39625        }
 26        /// <summary> Initializes a new instance of LogAnalyticsOperations. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 30        /// <param name="endpoint"> server parameter. </param>
 39631        internal LogAnalyticsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI
 32        {
 39633            RestClient = new LogAnalyticsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 39634            _clientDiagnostics = clientDiagnostics;
 39635            _pipeline = pipeline;
 39636        }
 37
 38        /// <summary> Export logs that show Api requests made by this subscription in the given time window to show thro
 39        /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param>
 40        /// <param name="parameters"> Parameters supplied to the LogAnalytics getRequestRateByInterval Api. </param>
 41        /// <param name="cancellationToken"> The cancellation token to use. </param>
 42        public virtual async Task<LogAnalyticsExportRequestRateByIntervalOperation> StartExportRequestRateByIntervalAsyn
 43        {
 044            if (location == null)
 45            {
 046                throw new ArgumentNullException(nameof(location));
 47            }
 048            if (parameters == null)
 49            {
 050                throw new ArgumentNullException(nameof(parameters));
 51            }
 52
 053            using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportRequestRateByInterval");
 054            scope.Start();
 55            try
 56            {
 057                var originalResponse = await RestClient.ExportRequestRateByIntervalAsync(location, parameters, cancellat
 058                return new LogAnalyticsExportRequestRateByIntervalOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 59            }
 060            catch (Exception e)
 61            {
 062                scope.Failed(e);
 063                throw;
 64            }
 065        }
 66
 67        /// <summary> Export logs that show Api requests made by this subscription in the given time window to show thro
 68        /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param>
 69        /// <param name="parameters"> Parameters supplied to the LogAnalytics getRequestRateByInterval Api. </param>
 70        /// <param name="cancellationToken"> The cancellation token to use. </param>
 71        public virtual LogAnalyticsExportRequestRateByIntervalOperation StartExportRequestRateByInterval(string location
 72        {
 073            if (location == null)
 74            {
 075                throw new ArgumentNullException(nameof(location));
 76            }
 077            if (parameters == null)
 78            {
 079                throw new ArgumentNullException(nameof(parameters));
 80            }
 81
 082            using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportRequestRateByInterval");
 083            scope.Start();
 84            try
 85            {
 086                var originalResponse = RestClient.ExportRequestRateByInterval(location, parameters, cancellationToken);
 087                return new LogAnalyticsExportRequestRateByIntervalOperation(_clientDiagnostics, _pipeline, RestClient.Cr
 88            }
 089            catch (Exception e)
 90            {
 091                scope.Failed(e);
 092                throw;
 93            }
 094        }
 95
 96        /// <summary> Export logs that show total throttled Api requests for this subscription in the given time window.
 97        /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param>
 98        /// <param name="parameters"> Parameters supplied to the LogAnalytics getThrottledRequests Api. </param>
 99        /// <param name="cancellationToken"> The cancellation token to use. </param>
 100        public virtual async Task<LogAnalyticsExportThrottledRequestsOperation> StartExportThrottledRequestsAsync(string
 101        {
 0102            if (location == null)
 103            {
 0104                throw new ArgumentNullException(nameof(location));
 105            }
 0106            if (parameters == null)
 107            {
 0108                throw new ArgumentNullException(nameof(parameters));
 109            }
 110
 0111            using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportThrottledRequests");
 0112            scope.Start();
 113            try
 114            {
 0115                var originalResponse = await RestClient.ExportThrottledRequestsAsync(location, parameters, cancellationT
 0116                return new LogAnalyticsExportThrottledRequestsOperation(_clientDiagnostics, _pipeline, RestClient.Create
 117            }
 0118            catch (Exception e)
 119            {
 0120                scope.Failed(e);
 0121                throw;
 122            }
 0123        }
 124
 125        /// <summary> Export logs that show total throttled Api requests for this subscription in the given time window.
 126        /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param>
 127        /// <param name="parameters"> Parameters supplied to the LogAnalytics getThrottledRequests Api. </param>
 128        /// <param name="cancellationToken"> The cancellation token to use. </param>
 129        public virtual LogAnalyticsExportThrottledRequestsOperation StartExportThrottledRequests(string location, LogAna
 130        {
 0131            if (location == null)
 132            {
 0133                throw new ArgumentNullException(nameof(location));
 134            }
 0135            if (parameters == null)
 136            {
 0137                throw new ArgumentNullException(nameof(parameters));
 138            }
 139
 0140            using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportThrottledRequests");
 0141            scope.Start();
 142            try
 143            {
 0144                var originalResponse = RestClient.ExportThrottledRequests(location, parameters, cancellationToken);
 0145                return new LogAnalyticsExportThrottledRequestsOperation(_clientDiagnostics, _pipeline, RestClient.Create
 146            }
 0147            catch (Exception e)
 148            {
 0149                scope.Failed(e);
 0150                throw;
 151            }
 0152        }
 153    }
 154}