< Summary

Class:Azure.Template.Models.SecretBundle
Assembly:Azure.Template
File(s):C:\Git\azure-sdk-for-net\sdk\template\Azure.Template\src\Generated\Models\SecretBundle.cs
C:\Git\azure-sdk-for-net\sdk\template\Azure.Template\src\Generated\Models\SecretBundle.Serialization.cs
Covered lines:27
Uncovered lines:18
Coverable lines:45
Total lines:117
Line coverage:60% (27 of 45)
Covered branches:10
Total branches:16
Branch coverage:62.5% (10 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Value()-100%100%
get_Id()-0%100%
get_ContentType()-0%100%
get_Tags()-0%100%
get_Kid()-0%100%
get_Managed()-0%100%
DeserializeSecretBundle(...)-64.29%62.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\template\Azure.Template\src\Generated\Models\SecretBundle.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.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Template.Models
 12{
 13    /// <summary> A secret consisting of a value, id and its attributes. </summary>
 14    public partial class SecretBundle
 15    {
 16        /// <summary> Initializes a new instance of SecretBundle. </summary>
 017        internal SecretBundle()
 18        {
 019            Tags = new ChangeTrackingDictionary<string, string>();
 020        }
 21
 22        /// <summary> Initializes a new instance of SecretBundle. </summary>
 23        /// <param name="value"> The secret value. </param>
 24        /// <param name="id"> The secret id. </param>
 25        /// <param name="contentType"> The content type of the secret. </param>
 26        /// <param name="tags"> Application specific metadata in the form of key-value pairs. </param>
 27        /// <param name="kid"> If this is a secret backing a KV certificate, then this field specifies the corresponding
 28        /// <param name="managed"> True if the secret&apos;s lifetime is managed by key vault. If this is a secret backi
 429        internal SecretBundle(string value, string id, string contentType, IReadOnlyDictionary<string, string> tags, str
 30        {
 431            Value = value;
 432            Id = id;
 433            ContentType = contentType;
 434            Tags = tags;
 435            Kid = kid;
 436            Managed = managed;
 437        }
 38
 39        /// <summary> The secret value. </summary>
 440        public string Value { get; }
 41        /// <summary> The secret id. </summary>
 042        public string Id { get; }
 43        /// <summary> The content type of the secret. </summary>
 044        public string ContentType { get; }
 45        /// <summary> Application specific metadata in the form of key-value pairs. </summary>
 046        public IReadOnlyDictionary<string, string> Tags { get; }
 47        /// <summary> If this is a secret backing a KV certificate, then this field specifies the corresponding key back
 048        public string Kid { get; }
 49        /// <summary> True if the secret&apos;s lifetime is managed by key vault. If this is a secret backing a certific
 050        public bool? Managed { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\template\Azure.Template\src\Generated\Models\SecretBundle.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Template.Models
 13{
 14    public partial class SecretBundle
 15    {
 16        internal static SecretBundle DeserializeSecretBundle(JsonElement element)
 17        {
 418            Optional<string> value = default;
 419            Optional<string> id = default;
 420            Optional<string> contentType = default;
 421            Optional<IReadOnlyDictionary<string, string>> tags = default;
 422            Optional<string> kid = default;
 423            Optional<bool> managed = default;
 3224            foreach (var property in element.EnumerateObject())
 25            {
 1226                if (property.NameEquals("value"))
 27                {
 428                    value = property.Value.GetString();
 429                    continue;
 30                }
 831                if (property.NameEquals("id"))
 32                {
 433                    id = property.Value.GetString();
 434                    continue;
 35                }
 436                if (property.NameEquals("contentType"))
 37                {
 038                    contentType = property.Value.GetString();
 039                    continue;
 40                }
 441                if (property.NameEquals("tags"))
 42                {
 043                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 044                    foreach (var property0 in property.Value.EnumerateObject())
 45                    {
 046                        dictionary.Add(property0.Name, property0.Value.GetString());
 47                    }
 048                    tags = dictionary;
 049                    continue;
 50                }
 451                if (property.NameEquals("kid"))
 52                {
 053                    kid = property.Value.GetString();
 054                    continue;
 55                }
 456                if (property.NameEquals("managed"))
 57                {
 058                    managed = property.Value.GetBoolean();
 59                    continue;
 60                }
 61            }
 462            return new SecretBundle(value.Value, id.Value, contentType.Value, Optional.ToDictionary(tags), kid.Value, Op
 63        }
 64    }
 65}