| | 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 Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Storage.Models |
| | 12 | | { |
| | 13 | | public partial class PrivateEndpoint : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Id != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("id"); |
| 0 | 21 | | writer.WriteStringValue(Id); |
| | 22 | | } |
| 0 | 23 | | writer.WriteEndObject(); |
| 0 | 24 | | } |
| | 25 | |
|
| | 26 | | internal static PrivateEndpoint DeserializePrivateEndpoint(JsonElement element) |
| | 27 | | { |
| 0 | 28 | | string id = default; |
| 0 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 0 | 31 | | if (property.NameEquals("id")) |
| | 32 | | { |
| 0 | 33 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 34 | | { |
| | 35 | | continue; |
| | 36 | | } |
| 0 | 37 | | id = property.Value.GetString(); |
| | 38 | | continue; |
| | 39 | | } |
| | 40 | | } |
| 0 | 41 | | return new PrivateEndpoint(id); |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |