< Summary

Class:Azure.ResourceManager.Resources.Models.ParametersLink
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ParametersLink.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ParametersLink.Serialization.cs
Covered lines:28
Uncovered lines:1
Coverable lines:29
Total lines:93
Line coverage:96.5% (28 of 29)
Covered branches:11
Total branches:12
Branch coverage:91.6% (11 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Uri()-100%100%
get_ContentVersion()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeParametersLink(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ParametersLink.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;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> Entity representing the reference to the deployment parameters. </summary>
 13    public partial class ParametersLink
 14    {
 15        /// <summary> Initializes a new instance of ParametersLink. </summary>
 16        /// <param name="uri"> The URI of the parameters file. </param>
 1217        public ParametersLink(string uri)
 18        {
 1219            if (uri == null)
 20            {
 021                throw new ArgumentNullException(nameof(uri));
 22            }
 23
 1224            Uri = uri;
 1225        }
 26
 27        /// <summary> Initializes a new instance of ParametersLink. </summary>
 28        /// <param name="uri"> The URI of the parameters file. </param>
 29        /// <param name="contentVersion"> If included, must match the ContentVersion in the template. </param>
 2430        internal ParametersLink(string uri, string contentVersion)
 31        {
 2432            Uri = uri;
 2433            ContentVersion = contentVersion;
 2434        }
 35
 36        /// <summary> The URI of the parameters file. </summary>
 6037        public string Uri { get; set; }
 38        /// <summary> If included, must match the ContentVersion in the template. </summary>
 8439        public string ContentVersion { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ParametersLink.Serialization.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Resources.Models
 12{
 13    public partial class ParametersLink : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2417            writer.WriteStartObject();
 2418            writer.WritePropertyName("uri");
 2419            writer.WriteStringValue(Uri);
 2420            if (ContentVersion != null)
 21            {
 2422                writer.WritePropertyName("contentVersion");
 2423                writer.WriteStringValue(ContentVersion);
 24            }
 2425            writer.WriteEndObject();
 2426        }
 27
 28        internal static ParametersLink DeserializeParametersLink(JsonElement element)
 29        {
 2430            string uri = default;
 2431            string contentVersion = default;
 19232            foreach (var property in element.EnumerateObject())
 33            {
 7234                if (property.NameEquals("uri"))
 35                {
 2436                    uri = property.Value.GetString();
 2437                    continue;
 38                }
 4839                if (property.NameEquals("contentVersion"))
 40                {
 2441                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 2445                    contentVersion = property.Value.GetString();
 46                    continue;
 47                }
 48            }
 2449            return new ParametersLink(uri, contentVersion);
 50        }
 51    }
 52}