< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_StorageAccountResourceId()-100%100%
get_BlobContainer()-100%100%
get_ArchiveNameFormat()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeDestination(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Destination.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
 8namespace Azure.ResourceManager.EventHubs.Models
 9{
 10    /// <summary> Capture storage details for capture description. </summary>
 11    public partial class Destination
 12    {
 13        /// <summary> Initializes a new instance of Destination. </summary>
 414        public Destination()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of Destination. </summary>
 19        /// <param name="name"> Name for capture destination. </param>
 20        /// <param name="storageAccountResourceId"> Resource id of the storage account to be used to create the blobs. <
 21        /// <param name="blobContainer"> Blob container Name. </param>
 22        /// <param name="archiveNameFormat"> Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionI
 2023        internal Destination(string name, string storageAccountResourceId, string blobContainer, string archiveNameForma
 24        {
 2025            Name = name;
 2026            StorageAccountResourceId = storageAccountResourceId;
 2027            BlobContainer = blobContainer;
 2028            ArchiveNameFormat = archiveNameFormat;
 2029        }
 30
 31        /// <summary> Name for capture destination. </summary>
 4032        public string Name { get; set; }
 33        /// <summary> Resource id of the storage account to be used to create the blobs. </summary>
 4034        public string StorageAccountResourceId { get; set; }
 35        /// <summary> Blob container Name. </summary>
 4036        public string BlobContainer { get; set; }
 37        /// <summary> Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}
 4038        public string ArchiveNameFormat { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Destination.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.EventHubs.Models
 12{
 13    public partial class Destination : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (Name != null)
 19            {
 820                writer.WritePropertyName("name");
 821                writer.WriteStringValue(Name);
 22            }
 823            writer.WritePropertyName("properties");
 824            writer.WriteStartObject();
 825            if (StorageAccountResourceId != null)
 26            {
 827                writer.WritePropertyName("storageAccountResourceId");
 828                writer.WriteStringValue(StorageAccountResourceId);
 29            }
 830            if (BlobContainer != null)
 31            {
 832                writer.WritePropertyName("blobContainer");
 833                writer.WriteStringValue(BlobContainer);
 34            }
 835            if (ArchiveNameFormat != null)
 36            {
 837                writer.WritePropertyName("archiveNameFormat");
 838                writer.WriteStringValue(ArchiveNameFormat);
 39            }
 840            writer.WriteEndObject();
 841            writer.WriteEndObject();
 842        }
 43
 44        internal static Destination DeserializeDestination(JsonElement element)
 45        {
 2046            string name = default;
 2047            string storageAccountResourceId = default;
 2048            string blobContainer = default;
 2049            string archiveNameFormat = default;
 12050            foreach (var property in element.EnumerateObject())
 51            {
 4052                if (property.NameEquals("name"))
 53                {
 2054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 2058                    name = property.Value.GetString();
 2059                    continue;
 60                }
 2061                if (property.NameEquals("properties"))
 62                {
 16063                    foreach (var property0 in property.Value.EnumerateObject())
 64                    {
 6065                        if (property0.NameEquals("storageAccountResourceId"))
 66                        {
 2067                            if (property0.Value.ValueKind == JsonValueKind.Null)
 68                            {
 69                                continue;
 70                            }
 2071                            storageAccountResourceId = property0.Value.GetString();
 2072                            continue;
 73                        }
 4074                        if (property0.NameEquals("blobContainer"))
 75                        {
 2076                            if (property0.Value.ValueKind == JsonValueKind.Null)
 77                            {
 78                                continue;
 79                            }
 2080                            blobContainer = property0.Value.GetString();
 2081                            continue;
 82                        }
 2083                        if (property0.NameEquals("archiveNameFormat"))
 84                        {
 2085                            if (property0.Value.ValueKind == JsonValueKind.Null)
 86                            {
 87                                continue;
 88                            }
 2089                            archiveNameFormat = property0.Value.GetString();
 90                            continue;
 91                        }
 92                    }
 93                    continue;
 94                }
 95            }
 2096            return new Destination(name, storageAccountResourceId, blobContainer, archiveNameFormat);
 97        }
 98    }
 99}