< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Enabled()-100%100%
get_Encoding()-100%100%
get_IntervalInSeconds()-100%100%
get_SizeLimitInBytes()-100%100%
get_Destination()-100%100%
get_SkipEmptyArchives()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeCaptureDescription(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CaptureDescription.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> Properties to configure capture description for eventhub. </summary>
 11    public partial class CaptureDescription
 12    {
 13        /// <summary> Initializes a new instance of CaptureDescription. </summary>
 414        public CaptureDescription()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of CaptureDescription. </summary>
 19        /// <param name="enabled"> A value that indicates whether capture description is enabled. </param>
 20        /// <param name="encoding"> Enumerates the possible values for the encoding format of capture description. Note:
 21        /// <param name="intervalInSeconds"> The time window allows you to set the frequency with which the capture to A
 22        /// <param name="sizeLimitInBytes"> The size window defines the amount of data built up in your Event Hub before
 23        /// <param name="destination"> Properties of Destination where capture will be stored. (Storage Account, Blob Na
 24        /// <param name="skipEmptyArchives"> A value that indicates whether to Skip Empty Archives. </param>
 2025        internal CaptureDescription(bool? enabled, EncodingCaptureDescription? encoding, int? intervalInSeconds, int? si
 26        {
 2027            Enabled = enabled;
 2028            Encoding = encoding;
 2029            IntervalInSeconds = intervalInSeconds;
 2030            SizeLimitInBytes = sizeLimitInBytes;
 2031            Destination = destination;
 2032            SkipEmptyArchives = skipEmptyArchives;
 2033        }
 34
 35        /// <summary> A value that indicates whether capture description is enabled. </summary>
 4036        public bool? Enabled { get; set; }
 37        /// <summary> Enumerates the possible values for the encoding format of capture description. Note: &apos;AvroDef
 4038        public EncodingCaptureDescription? Encoding { get; set; }
 39        /// <summary> The time window allows you to set the frequency with which the capture to Azure Blobs will happen,
 4440        public int? IntervalInSeconds { get; set; }
 41        /// <summary> The size window defines the amount of data built up in your Event Hub before an capture operation,
 4442        public int? SizeLimitInBytes { get; set; }
 43        /// <summary> Properties of Destination where capture will be stored. (Storage Account, Blob Names). </summary>
 4044        public Destination Destination { get; set; }
 45        /// <summary> A value that indicates whether to Skip Empty Archives. </summary>
 4446        public bool? SkipEmptyArchives { get; set; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CaptureDescription.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 CaptureDescription : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (Enabled != null)
 19            {
 820                writer.WritePropertyName("enabled");
 821                writer.WriteBooleanValue(Enabled.Value);
 22            }
 823            if (Encoding != null)
 24            {
 825                writer.WritePropertyName("encoding");
 826                writer.WriteStringValue(Encoding.Value.ToSerialString());
 27            }
 828            if (IntervalInSeconds != null)
 29            {
 830                writer.WritePropertyName("intervalInSeconds");
 831                writer.WriteNumberValue(IntervalInSeconds.Value);
 32            }
 833            if (SizeLimitInBytes != null)
 34            {
 835                writer.WritePropertyName("sizeLimitInBytes");
 836                writer.WriteNumberValue(SizeLimitInBytes.Value);
 37            }
 838            if (Destination != null)
 39            {
 840                writer.WritePropertyName("destination");
 841                writer.WriteObjectValue(Destination);
 42            }
 843            if (SkipEmptyArchives != null)
 44            {
 845                writer.WritePropertyName("skipEmptyArchives");
 846                writer.WriteBooleanValue(SkipEmptyArchives.Value);
 47            }
 848            writer.WriteEndObject();
 849        }
 50
 51        internal static CaptureDescription DeserializeCaptureDescription(JsonElement element)
 52        {
 2053            bool? enabled = default;
 2054            EncodingCaptureDescription? encoding = default;
 2055            int? intervalInSeconds = default;
 2056            int? sizeLimitInBytes = default;
 2057            Destination destination = default;
 2058            bool? skipEmptyArchives = default;
 28059            foreach (var property in element.EnumerateObject())
 60            {
 12061                if (property.NameEquals("enabled"))
 62                {
 2063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 2067                    enabled = property.Value.GetBoolean();
 2068                    continue;
 69                }
 10070                if (property.NameEquals("encoding"))
 71                {
 2072                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 2076                    encoding = property.Value.GetString().ToEncodingCaptureDescription();
 2077                    continue;
 78                }
 8079                if (property.NameEquals("intervalInSeconds"))
 80                {
 2081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 2085                    intervalInSeconds = property.Value.GetInt32();
 2086                    continue;
 87                }
 6088                if (property.NameEquals("sizeLimitInBytes"))
 89                {
 2090                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 2094                    sizeLimitInBytes = property.Value.GetInt32();
 2095                    continue;
 96                }
 4097                if (property.NameEquals("destination"))
 98                {
 2099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 20103                    destination = Destination.DeserializeDestination(property.Value);
 20104                    continue;
 105                }
 20106                if (property.NameEquals("skipEmptyArchives"))
 107                {
 20108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 20112                    skipEmptyArchives = property.Value.GetBoolean();
 113                    continue;
 114                }
 115            }
 20116            return new CaptureDescription(enabled, encoding, intervalInSeconds, sizeLimitInBytes, destination, skipEmpty
 117        }
 118    }
 119}