| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Xml; |
| | 9 | | using System.Xml.Linq; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Data.Tables.Models |
| | 13 | | { |
| | 14 | | public partial class TableAnalyticsLoggingSettings : IXmlSerializable |
| | 15 | | { |
| | 16 | | void IXmlSerializable.Write(XmlWriter writer, string nameHint) |
| | 17 | | { |
| 4 | 18 | | writer.WriteStartElement(nameHint ?? "Logging"); |
| 4 | 19 | | writer.WriteStartElement("Version"); |
| 4 | 20 | | writer.WriteValue(Version); |
| 4 | 21 | | writer.WriteEndElement(); |
| 4 | 22 | | writer.WriteStartElement("Delete"); |
| 4 | 23 | | writer.WriteValue(Delete); |
| 4 | 24 | | writer.WriteEndElement(); |
| 4 | 25 | | writer.WriteStartElement("Read"); |
| 4 | 26 | | writer.WriteValue(Read); |
| 4 | 27 | | writer.WriteEndElement(); |
| 4 | 28 | | writer.WriteStartElement("Write"); |
| 4 | 29 | | writer.WriteValue(Write); |
| 4 | 30 | | writer.WriteEndElement(); |
| 4 | 31 | | writer.WriteObjectValue(RetentionPolicy, "RetentionPolicy"); |
| 4 | 32 | | writer.WriteEndElement(); |
| 4 | 33 | | } |
| | 34 | |
|
| | 35 | | internal static TableAnalyticsLoggingSettings DeserializeTableAnalyticsLoggingSettings(XElement element) |
| | 36 | | { |
| 24 | 37 | | string version = default; |
| 24 | 38 | | bool delete = default; |
| 24 | 39 | | bool read = default; |
| 24 | 40 | | bool write = default; |
| 24 | 41 | | RetentionPolicy retentionPolicy = default; |
| 24 | 42 | | if (element.Element("Version") is XElement versionElement) |
| | 43 | | { |
| 24 | 44 | | version = (string)versionElement; |
| | 45 | | } |
| 24 | 46 | | if (element.Element("Delete") is XElement deleteElement) |
| | 47 | | { |
| 24 | 48 | | delete = (bool)deleteElement; |
| | 49 | | } |
| 24 | 50 | | if (element.Element("Read") is XElement readElement) |
| | 51 | | { |
| 24 | 52 | | read = (bool)readElement; |
| | 53 | | } |
| 24 | 54 | | if (element.Element("Write") is XElement writeElement) |
| | 55 | | { |
| 24 | 56 | | write = (bool)writeElement; |
| | 57 | | } |
| 24 | 58 | | if (element.Element("RetentionPolicy") is XElement retentionPolicyElement) |
| | 59 | | { |
| 24 | 60 | | retentionPolicy = RetentionPolicy.DeserializeRetentionPolicy(retentionPolicyElement); |
| | 61 | | } |
| 24 | 62 | | return new TableAnalyticsLoggingSettings(version, delete, read, write, retentionPolicy); |
| | 63 | | } |
| | 64 | | } |
| | 65 | | } |