< Summary

Class:Azure.ResourceManager.EventHubs.Models.ConsumerGroup
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ConsumerGroup.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ConsumerGroup.Serialization.cs
Covered lines:67
Uncovered lines:0
Coverable lines:67
Total lines:171
Line coverage:100% (67 of 67)
Covered branches:42
Total branches:42
Branch coverage:100% (42 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_CreatedAt()-100%100%
get_UpdatedAt()-100%100%
get_UserMetadata()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeConsumerGroup(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ConsumerGroup.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.EventHubs.Models
 11{
 12    /// <summary> Single item in List or Get Consumer group operation. </summary>
 13    public partial class ConsumerGroup : Resource
 14    {
 15        /// <summary> Initializes a new instance of ConsumerGroup. </summary>
 4816        public ConsumerGroup()
 17        {
 4818        }
 19
 20        /// <summary> Initializes a new instance of ConsumerGroup. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="createdAt"> Exact time the message was created. </param>
 25        /// <param name="updatedAt"> The exact time the message was updated. </param>
 26        /// <param name="userMetadata"> User Metadata is a placeholder to store user-defined string data with maximum le
 15627        internal ConsumerGroup(string id, string name, string type, DateTimeOffset? createdAt, DateTimeOffset? updatedAt
 28        {
 15629            CreatedAt = createdAt;
 15630            UpdatedAt = updatedAt;
 15631            UserMetadata = userMetadata;
 15632        }
 33
 34        /// <summary> Exact time the message was created. </summary>
 6435        public DateTimeOffset? CreatedAt { get; }
 36        /// <summary> The exact time the message was updated. </summary>
 6437        public DateTimeOffset? UpdatedAt { get; }
 38        /// <summary> User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it
 26839        public string UserMetadata { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ConsumerGroup.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.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.EventHubs.Models
 13{
 14    public partial class ConsumerGroup : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 5618            writer.WriteStartObject();
 5619            if (Id != null)
 20            {
 821                writer.WritePropertyName("id");
 822                writer.WriteStringValue(Id);
 23            }
 5624            if (Name != null)
 25            {
 826                writer.WritePropertyName("name");
 827                writer.WriteStringValue(Name);
 28            }
 5629            if (Type != null)
 30            {
 831                writer.WritePropertyName("type");
 832                writer.WriteStringValue(Type);
 33            }
 5634            writer.WritePropertyName("properties");
 5635            writer.WriteStartObject();
 5636            if (CreatedAt != null)
 37            {
 838                writer.WritePropertyName("createdAt");
 839                writer.WriteStringValue(CreatedAt.Value, "O");
 40            }
 5641            if (UpdatedAt != null)
 42            {
 843                writer.WritePropertyName("updatedAt");
 844                writer.WriteStringValue(UpdatedAt.Value, "O");
 45            }
 5646            if (UserMetadata != null)
 47            {
 1648                writer.WritePropertyName("userMetadata");
 1649                writer.WriteStringValue(UserMetadata);
 50            }
 5651            writer.WriteEndObject();
 5652            writer.WriteEndObject();
 5653        }
 54
 55        internal static ConsumerGroup DeserializeConsumerGroup(JsonElement element)
 56        {
 15657            string id = default;
 15658            string name = default;
 15659            string type = default;
 15660            DateTimeOffset? createdAt = default;
 15661            DateTimeOffset? updatedAt = default;
 15662            string userMetadata = default;
 187263            foreach (var property in element.EnumerateObject())
 64            {
 78065                if (property.NameEquals("id"))
 66                {
 15667                    if (property.Value.ValueKind == JsonValueKind.Null)
 68                    {
 69                        continue;
 70                    }
 15671                    id = property.Value.GetString();
 15672                    continue;
 73                }
 62474                if (property.NameEquals("name"))
 75                {
 15676                    if (property.Value.ValueKind == JsonValueKind.Null)
 77                    {
 78                        continue;
 79                    }
 15680                    name = property.Value.GetString();
 15681                    continue;
 82                }
 46883                if (property.NameEquals("type"))
 84                {
 15685                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 15689                    type = property.Value.GetString();
 15690                    continue;
 91                }
 31292                if (property.NameEquals("properties"))
 93                {
 101694                    foreach (var property0 in property.Value.EnumerateObject())
 95                    {
 35296                        if (property0.NameEquals("createdAt"))
 97                        {
 15698                            if (property0.Value.ValueKind == JsonValueKind.Null)
 99                            {
 100                                continue;
 101                            }
 156102                            createdAt = property0.Value.GetDateTimeOffset("O");
 156103                            continue;
 104                        }
 196105                        if (property0.NameEquals("updatedAt"))
 106                        {
 156107                            if (property0.Value.ValueKind == JsonValueKind.Null)
 108                            {
 109                                continue;
 110                            }
 156111                            updatedAt = property0.Value.GetDateTimeOffset("O");
 156112                            continue;
 113                        }
 40114                        if (property0.NameEquals("userMetadata"))
 115                        {
 40116                            if (property0.Value.ValueKind == JsonValueKind.Null)
 117                            {
 118                                continue;
 119                            }
 40120                            userMetadata = property0.Value.GetString();
 121                            continue;
 122                        }
 123                    }
 124                    continue;
 125                }
 126            }
 156127            return new ConsumerGroup(id, name, type, createdAt, updatedAt, userMetadata);
 128        }
 129    }
 130}