< Summary

Class:Azure.Data.Tables.Models.TableAnalyticsLoggingSettings
Assembly:Azure.Data.Tables
File(s):C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableAnalyticsLoggingSettings.cs
C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableAnalyticsLoggingSettings.Serialization.cs
Covered lines:46
Uncovered lines:2
Coverable lines:48
Total lines:116
Line coverage:95.8% (46 of 48)
Covered branches:13
Total branches:16
Branch coverage:81.2% (13 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-81.82%50%
get_Version()-100%100%
get_Delete()-100%100%
get_Read()-100%100%
get_Write()-100%100%
get_RetentionPolicy()-100%100%
Azure.Core.IXmlSerializable.Write(...)-100%50%
DeserializeTableAnalyticsLoggingSettings(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableAnalyticsLoggingSettings.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.Data.Tables.Models
 11{
 12    /// <summary> Azure Analytics Logging settings. </summary>
 13    public partial class TableAnalyticsLoggingSettings
 14    {
 15        /// <summary> Initializes a new instance of TableAnalyticsLoggingSettings. </summary>
 16        /// <param name="version"> The version of Analytics to configure. </param>
 17        /// <param name="delete"> Indicates whether all delete requests should be logged. </param>
 18        /// <param name="read"> Indicates whether all read requests should be logged. </param>
 19        /// <param name="write"> Indicates whether all write requests should be logged. </param>
 20        /// <param name="retentionPolicy"> The retention policy. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="version"/> or <paramref name="retentionPolicy"/> is
 2422        public TableAnalyticsLoggingSettings(string version, bool delete, bool read, bool write, RetentionPolicy retenti
 23        {
 2424            if (version == null)
 25            {
 026                throw new ArgumentNullException(nameof(version));
 27            }
 2428            if (retentionPolicy == null)
 29            {
 030                throw new ArgumentNullException(nameof(retentionPolicy));
 31            }
 32
 2433            Version = version;
 2434            Delete = delete;
 2435            Read = read;
 2436            Write = write;
 2437            RetentionPolicy = retentionPolicy;
 2438        }
 39
 40        /// <summary> The version of Analytics to configure. </summary>
 3641        public string Version { get; set; }
 42        /// <summary> Indicates whether all delete requests should be logged. </summary>
 3643        public bool Delete { get; set; }
 44        /// <summary> Indicates whether all read requests should be logged. </summary>
 4445        public bool Read { get; set; }
 46        /// <summary> Indicates whether all write requests should be logged. </summary>
 3647        public bool Write { get; set; }
 48        /// <summary> The retention policy. </summary>
 4449        public RetentionPolicy RetentionPolicy { get; set; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\tables\Azure.Data.Tables\src\Generated\Models\TableAnalyticsLoggingSettings.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.Xml;
 9using System.Xml.Linq;
 10using Azure.Core;
 11
 12namespace Azure.Data.Tables.Models
 13{
 14    public partial class TableAnalyticsLoggingSettings : IXmlSerializable
 15    {
 16        void IXmlSerializable.Write(XmlWriter writer, string nameHint)
 17        {
 418            writer.WriteStartElement(nameHint ?? "Logging");
 419            writer.WriteStartElement("Version");
 420            writer.WriteValue(Version);
 421            writer.WriteEndElement();
 422            writer.WriteStartElement("Delete");
 423            writer.WriteValue(Delete);
 424            writer.WriteEndElement();
 425            writer.WriteStartElement("Read");
 426            writer.WriteValue(Read);
 427            writer.WriteEndElement();
 428            writer.WriteStartElement("Write");
 429            writer.WriteValue(Write);
 430            writer.WriteEndElement();
 431            writer.WriteObjectValue(RetentionPolicy, "RetentionPolicy");
 432            writer.WriteEndElement();
 433        }
 34
 35        internal static TableAnalyticsLoggingSettings DeserializeTableAnalyticsLoggingSettings(XElement element)
 36        {
 2437            string version = default;
 2438            bool delete = default;
 2439            bool read = default;
 2440            bool write = default;
 2441            RetentionPolicy retentionPolicy = default;
 2442            if (element.Element("Version") is XElement versionElement)
 43            {
 2444                version = (string)versionElement;
 45            }
 2446            if (element.Element("Delete") is XElement deleteElement)
 47            {
 2448                delete = (bool)deleteElement;
 49            }
 2450            if (element.Element("Read") is XElement readElement)
 51            {
 2452                read = (bool)readElement;
 53            }
 2454            if (element.Element("Write") is XElement writeElement)
 55            {
 2456                write = (bool)writeElement;
 57            }
 2458            if (element.Element("RetentionPolicy") is XElement retentionPolicyElement)
 59            {
 2460                retentionPolicy = RetentionPolicy.DeserializeRetentionPolicy(retentionPolicyElement);
 61            }
 2462            return new TableAnalyticsLoggingSettings(version, delete, read, write, retentionPolicy);
 63        }
 64    }
 65}