| | 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.Text.Json; |
| | 9 | | using System.Xml.Linq; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Data.Tables.Models |
| | 13 | | { |
| | 14 | | internal partial class TableServiceError |
| | 15 | | { |
| | 16 | | internal static TableServiceError DeserializeTableServiceError(JsonElement element) |
| | 17 | | { |
| 0 | 18 | | Optional<string> message = default; |
| 0 | 19 | | foreach (var property in element.EnumerateObject()) |
| | 20 | | { |
| 0 | 21 | | if (property.NameEquals("Message")) |
| | 22 | | { |
| 0 | 23 | | message = property.Value.GetString(); |
| | 24 | | continue; |
| | 25 | | } |
| | 26 | | } |
| 0 | 27 | | return new TableServiceError(message.Value); |
| | 28 | | } |
| | 29 | |
|
| | 30 | | internal static TableServiceError DeserializeTableServiceError(XElement element) |
| | 31 | | { |
| 0 | 32 | | string message = default; |
| 0 | 33 | | if (element.Element("Message") is XElement messageElement) |
| | 34 | | { |
| 0 | 35 | | message = (string)messageElement; |
| | 36 | | } |
| 0 | 37 | | return new TableServiceError(message); |
| | 38 | | } |
| | 39 | | } |
| | 40 | | } |