internal static TableMetrics DeserializeTableMetrics(XElement element)
        {
            string          version         = default;
            bool            enabled         = default;
            bool?           includeApis     = default;
            RetentionPolicy retentionPolicy = default;

            if (element.Element("Version") is XElement versionElement)
            {
                version = (string)versionElement;
            }
            if (element.Element("Enabled") is XElement enabledElement)
            {
                enabled = (bool)enabledElement;
            }
            if (element.Element("IncludeAPIs") is XElement includeAPIsElement)
            {
                includeApis = (bool?)includeAPIsElement;
            }
            if (element.Element("RetentionPolicy") is XElement retentionPolicyElement)
            {
                retentionPolicy = RetentionPolicy.DeserializeRetentionPolicy(retentionPolicyElement);
            }
            return(new TableMetrics(version, enabled, includeApis, retentionPolicy));
        }
示例#2
0
        internal static TableAnalyticsLoggingSettings DeserializeTableAnalyticsLoggingSettings(XElement element)
        {
            string          version         = default;
            bool            delete          = default;
            bool            read            = default;
            bool            write           = default;
            RetentionPolicy retentionPolicy = default;

            if (element.Element("Version") is XElement versionElement)
            {
                version = (string)versionElement;
            }
            if (element.Element("Delete") is XElement deleteElement)
            {
                delete = (bool)deleteElement;
            }
            if (element.Element("Read") is XElement readElement)
            {
                read = (bool)readElement;
            }
            if (element.Element("Write") is XElement writeElement)
            {
                write = (bool)writeElement;
            }
            if (element.Element("RetentionPolicy") is XElement retentionPolicyElement)
            {
                retentionPolicy = RetentionPolicy.DeserializeRetentionPolicy(retentionPolicyElement);
            }
            return(new TableAnalyticsLoggingSettings(version, delete, read, write, retentionPolicy));
        }