< Summary

Class:Azure.ResourceManager.AppConfiguration.Models.KeyValue
Assembly:Azure.ResourceManager.AppConfiguration
File(s):C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\KeyValue.cs
C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\KeyValue.Serialization.cs
Covered lines:0
Uncovered lines:66
Coverable lines:66
Total lines:208
Line coverage:0% (0 of 66)
Covered branches:0
Total branches:38
Branch coverage:0% (0 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Key()-0%100%
get_Label()-0%100%
get_Value()-0%100%
get_ContentType()-0%100%
get_ETag()-0%100%
get_LastModified()-0%100%
get_Locked()-0%100%
get_Tags()-0%100%
DeserializeKeyValue(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\KeyValue.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.Collections.Generic;
 10
 11namespace Azure.ResourceManager.AppConfiguration.Models
 12{
 13    /// <summary> The result of a request to retrieve a key-value from the specified configuration store. </summary>
 14    public partial class KeyValue
 15    {
 16        /// <summary> Initializes a new instance of KeyValue. </summary>
 017        internal KeyValue()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of KeyValue. </summary>
 22        /// <param name="key">
 23        /// The primary identifier of a key-value.
 24        ///
 25        /// The key is used in unison with the label to uniquely identify a key-value.
 26        /// </param>
 27        /// <param name="label">
 28        /// A value used to group key-values.
 29        ///
 30        /// The label is used in unison with the key to uniquely identify a key-value.
 31        /// </param>
 32        /// <param name="value"> The value of the key-value. </param>
 33        /// <param name="contentType">
 34        /// The content type of the key-value&apos;s value.
 35        ///
 36        /// Providing a proper content-type can enable transformations of values when they are retrieved by applications
 37        /// </param>
 38        /// <param name="eTag"> An ETag indicating the state of a key-value within a configuration store. </param>
 39        /// <param name="lastModified"> The last time a modifying operation was performed on the given key-value. </para
 40        /// <param name="locked">
 41        /// A value indicating whether the key-value is locked.
 42        ///
 43        /// A locked key-value may not be modified until it is unlocked.
 44        /// </param>
 45        /// <param name="tags"> A dictionary of tags that can help identify what a key-value may be applicable for. </pa
 046        internal KeyValue(string key, string label, string value, string contentType, string eTag, DateTimeOffset? lastM
 47        {
 048            Key = key;
 049            Label = label;
 050            Value = value;
 051            ContentType = contentType;
 052            ETag = eTag;
 053            LastModified = lastModified;
 054            Locked = locked;
 055            Tags = tags;
 056        }
 57
 58        /// <summary>
 59        /// The primary identifier of a key-value.
 60        ///
 61        /// The key is used in unison with the label to uniquely identify a key-value.
 62        /// </summary>
 063        public string Key { get; }
 64        /// <summary>
 65        /// A value used to group key-values.
 66        ///
 67        /// The label is used in unison with the key to uniquely identify a key-value.
 68        /// </summary>
 069        public string Label { get; }
 70        /// <summary> The value of the key-value. </summary>
 071        public string Value { get; }
 72        /// <summary>
 73        /// The content type of the key-value&apos;s value.
 74        ///
 75        /// Providing a proper content-type can enable transformations of values when they are retrieved by applications
 76        /// </summary>
 077        public string ContentType { get; }
 78        /// <summary> An ETag indicating the state of a key-value within a configuration store. </summary>
 079        public string ETag { get; }
 80        /// <summary> The last time a modifying operation was performed on the given key-value. </summary>
 081        public DateTimeOffset? LastModified { get; }
 82        /// <summary>
 83        /// A value indicating whether the key-value is locked.
 84        ///
 85        /// A locked key-value may not be modified until it is unlocked.
 86        /// </summary>
 087        public bool? Locked { get; }
 88        /// <summary> A dictionary of tags that can help identify what a key-value may be applicable for. </summary>
 089        public IReadOnlyDictionary<string, string> Tags { get; }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\appconfiguration\Azure.ResourceManager.AppConfiguration\src\Generated\Models\KeyValue.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.AppConfiguration.Models
 14{
 15    public partial class KeyValue
 16    {
 17        internal static KeyValue DeserializeKeyValue(JsonElement element)
 18        {
 019            string key = default;
 020            string label = default;
 021            string value = default;
 022            string contentType = default;
 023            string eTag = default;
 024            DateTimeOffset? lastModified = default;
 025            bool? locked = default;
 026            IReadOnlyDictionary<string, string> tags = default;
 027            foreach (var property in element.EnumerateObject())
 28            {
 029                if (property.NameEquals("key"))
 30                {
 031                    if (property.Value.ValueKind == JsonValueKind.Null)
 32                    {
 33                        continue;
 34                    }
 035                    key = property.Value.GetString();
 036                    continue;
 37                }
 038                if (property.NameEquals("label"))
 39                {
 040                    if (property.Value.ValueKind == JsonValueKind.Null)
 41                    {
 42                        continue;
 43                    }
 044                    label = property.Value.GetString();
 045                    continue;
 46                }
 047                if (property.NameEquals("value"))
 48                {
 049                    if (property.Value.ValueKind == JsonValueKind.Null)
 50                    {
 51                        continue;
 52                    }
 053                    value = property.Value.GetString();
 054                    continue;
 55                }
 056                if (property.NameEquals("contentType"))
 57                {
 058                    if (property.Value.ValueKind == JsonValueKind.Null)
 59                    {
 60                        continue;
 61                    }
 062                    contentType = property.Value.GetString();
 063                    continue;
 64                }
 065                if (property.NameEquals("eTag"))
 66                {
 067                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 071                    eTag = property.Value.GetString();
 072                    continue;
 73                }
 074                if (property.NameEquals("lastModified"))
 75                {
 076                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 080                    lastModified = property.Value.GetDateTimeOffset("O");
 081                    continue;
 82                }
 083                if (property.NameEquals("locked"))
 84                {
 085                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 089                    locked = property.Value.GetBoolean();
 090                    continue;
 91                }
 092                if (property.NameEquals("tags"))
 93                {
 094                    if (property.Value.ValueKind == JsonValueKind.Null)
 95                    {
 96                        continue;
 97                    }
 098                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 099                    foreach (var property0 in property.Value.EnumerateObject())
 100                    {
 0101                        if (property0.Value.ValueKind == JsonValueKind.Null)
 102                        {
 0103                            dictionary.Add(property0.Name, null);
 104                        }
 105                        else
 106                        {
 0107                            dictionary.Add(property0.Name, property0.Value.GetString());
 108                        }
 109                    }
 0110                    tags = dictionary;
 111                    continue;
 112                }
 113            }
 0114            return new KeyValue(key, label, value, contentType, eTag, lastModified, locked, tags);
 115        }
 116    }
 117}