internal static TagValue DeserializeTagValue(JsonElement element)
        {
            string   id       = default;
            string   tagValue = default;
            TagCount count    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tagValue"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tagValue = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("count"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    count = TagCount.DeserializeTagCount(property.Value);
                    continue;
                }
            }
            return(new TagValue(id, tagValue, count));
        }
        internal static TagDetails DeserializeTagDetails(JsonElement element)
        {
            Optional <string>   id      = default;
            Optional <string>   tagName = default;
            Optional <TagCount> count   = default;
            Optional <IReadOnlyList <TagValue> > values = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tagName"))
                {
                    tagName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("count"))
                {
                    count = TagCount.DeserializeTagCount(property.Value);
                    continue;
                }
                if (property.NameEquals("values"))
                {
                    List <TagValue> array = new List <TagValue>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(TagValue.DeserializeTagValue(item));
                    }
                    values = array;
                    continue;
                }
            }
            return(new TagDetails(id.Value, tagName.Value, count.Value, Optional.ToList(values)));
        }