< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_Id()-0%100%
get_Value()-0%100%
get_HasCompleted()-0%100%
get_HasValue()-0%100%
GetRawResponse()-0%100%
UpdateStatus(...)-0%100%
UpdateStatusAsync(...)-0%100%
WaitForCompletionAsync(...)-0%100%
WaitForCompletionAsync(...)-0%100%
Azure.Core.IOperationSource<System.String>.CreateResult(...)-0%0%
Azure-Core-IOperationSource<System-String>-CreateResultAsync()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\VirtualNetworkGatewayConnectionsStartPacketCaptureOperation.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.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15
 16namespace Azure.ResourceManager.Network
 17{
 18    /// <summary> Starts packet capture on virtual network gateway connection in the specified resource group. </summary
 19    public partial class VirtualNetworkGatewayConnectionsStartPacketCaptureOperation : Operation<string>, IOperationSour
 20    {
 21        private readonly ArmOperationHelpers<string> _operation;
 022        internal VirtualNetworkGatewayConnectionsStartPacketCaptureOperation(ClientDiagnostics clientDiagnostics, HttpPi
 23        {
 024            _operation = new ArmOperationHelpers<string>(this, clientDiagnostics, pipeline, request, response, Operation
 025        }
 26        /// <inheritdoc />
 027        public override string Id => _operation.Id;
 28
 29        /// <inheritdoc />
 030        public override string Value => _operation.Value;
 31
 32        /// <inheritdoc />
 033        public override bool HasCompleted => _operation.HasCompleted;
 34
 35        /// <inheritdoc />
 036        public override bool HasValue => _operation.HasValue;
 37
 38        /// <inheritdoc />
 039        public override Response GetRawResponse() => _operation.GetRawResponse();
 40
 41        /// <inheritdoc />
 042        public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(
 43
 44        /// <inheritdoc />
 045        public override ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken = default) => _operati
 46
 47        /// <inheritdoc />
 048        public override ValueTask<Response<string>> WaitForCompletionAsync(CancellationToken cancellationToken = default
 49
 50        /// <inheritdoc />
 051        public override ValueTask<Response<string>> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken c
 52
 53        string IOperationSource<string>.CreateResult(Response response, CancellationToken cancellationToken)
 54        {
 055            using var document = JsonDocument.Parse(response.ContentStream);
 056            if (document.RootElement.ValueKind == JsonValueKind.Null)
 57            {
 058                return null;
 59            }
 60            else
 61            {
 062                return document.RootElement.GetString();
 63            }
 064        }
 65
 66        async ValueTask<string> IOperationSource<string>.CreateResultAsync(Response response, CancellationToken cancella
 67        {
 068            using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).Confi
 069            if (document.RootElement.ValueKind == JsonValueKind.Null)
 70            {
 071                return null;
 72            }
 73            else
 74            {
 075                return document.RootElement.GetString();
 76            }
 077        }
 78    }
 79}