< Summary

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

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<Azure.AsyncPageable<Azure.ResourceManager.Network.Models.BastionShareableLink>>.CreateResult(...)-0%0%
Azure-Core-IOperationSource<Azure-AsyncPageable<Azure-ResourceManager-Network-Models-BastionShareableLink>>-CreateResultAsync()-0%0%
GetNextPage()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\ServicePutBastionShareableLinkOperation.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;
 15using Azure.ResourceManager.Network.Models;
 16
 17namespace Azure.ResourceManager.Network
 18{
 19    /// <summary> Creates a Bastion Shareable Links for all the VMs specified in the request. </summary>
 20    public partial class ServicePutBastionShareableLinkOperation : Operation<AsyncPageable<BastionShareableLink>>, IOper
 21    {
 22        private readonly ArmOperationHelpers<AsyncPageable<BastionShareableLink>> _operation;
 23        private readonly Func<string, Task<Response>> _nextPageFunc;
 024        internal ServicePutBastionShareableLinkOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Req
 25        {
 026            _operation = new ArmOperationHelpers<AsyncPageable<BastionShareableLink>>(this, clientDiagnostics, pipeline,
 027            _nextPageFunc = nextPageFunc;
 028        }
 29        /// <inheritdoc />
 030        public override string Id => _operation.Id;
 31
 32        /// <inheritdoc />
 033        public override AsyncPageable<BastionShareableLink> Value => _operation.Value;
 34
 35        /// <inheritdoc />
 036        public override bool HasCompleted => _operation.HasCompleted;
 37
 38        /// <inheritdoc />
 039        public override bool HasValue => _operation.HasValue;
 40
 41        /// <inheritdoc />
 042        public override Response GetRawResponse() => _operation.GetRawResponse();
 43
 44        /// <inheritdoc />
 045        public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(
 46
 47        /// <inheritdoc />
 048        public override ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken = default) => _operati
 49
 50        /// <inheritdoc />
 051        public override ValueTask<Response<AsyncPageable<BastionShareableLink>>> WaitForCompletionAsync(CancellationToke
 52
 53        /// <inheritdoc />
 054        public override ValueTask<Response<AsyncPageable<BastionShareableLink>>> WaitForCompletionAsync(TimeSpan polling
 55
 56        AsyncPageable<BastionShareableLink> IOperationSource<AsyncPageable<BastionShareableLink>>.CreateResult(Response 
 57        {
 58            BastionShareableLinkListResult firstPageResult;
 059            using var document = JsonDocument.Parse(response.ContentStream);
 060            if (document.RootElement.ValueKind == JsonValueKind.Null)
 61            {
 062                firstPageResult = null;
 63            }
 64            else
 65            {
 066                firstPageResult = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Root
 67            }
 068            Page<BastionShareableLink> firstPage = Page.FromValues(firstPageResult.Value, firstPageResult.NextLink, resp
 69
 070            return PageableHelpers.CreateAsyncEnumerable(_ => Task.FromResult(firstPage), (nextLink, _) => GetNextPage(n
 071        }
 72
 73        async ValueTask<AsyncPageable<BastionShareableLink>> IOperationSource<AsyncPageable<BastionShareableLink>>.Creat
 74        {
 75            BastionShareableLinkListResult firstPageResult;
 076            using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).Confi
 077            if (document.RootElement.ValueKind == JsonValueKind.Null)
 78            {
 079                firstPageResult = null;
 80            }
 81            else
 82            {
 083                firstPageResult = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.Root
 84            }
 085            Page<BastionShareableLink> firstPage = Page.FromValues(firstPageResult.Value, firstPageResult.NextLink, resp
 86
 087            return PageableHelpers.CreateAsyncEnumerable(_ => Task.FromResult(firstPage), (nextLink, _) => GetNextPage(n
 088        }
 89
 90        private async Task<Page<BastionShareableLink>> GetNextPage(string nextLink, CancellationToken cancellationToken)
 91        {
 092            Response response = await _nextPageFunc(nextLink).ConfigureAwait(false);
 93            BastionShareableLinkListResult nextPageResult;
 094            using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).Confi
 095            if (document.RootElement.ValueKind == JsonValueKind.Null)
 96            {
 097                nextPageResult = null;
 98            }
 99            else
 100            {
 0101                nextPageResult = BastionShareableLinkListResult.DeserializeBastionShareableLinkListResult(document.RootE
 102            }
 0103            return Page.FromValues(nextPageResult.Value, nextPageResult.NextLink, response);
 0104        }
 105    }
 106}