| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Network.Models |
| | 13 | | { |
| | 14 | | public partial class ApplicationGatewayProbeHealthResponseMatch : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Body != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("body"); |
| 0 | 22 | | writer.WriteStringValue(Body); |
| | 23 | | } |
| 0 | 24 | | if (StatusCodes != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("statusCodes"); |
| 0 | 27 | | writer.WriteStartArray(); |
| 0 | 28 | | foreach (var item in StatusCodes) |
| | 29 | | { |
| 0 | 30 | | writer.WriteStringValue(item); |
| | 31 | | } |
| 0 | 32 | | writer.WriteEndArray(); |
| | 33 | | } |
| 0 | 34 | | writer.WriteEndObject(); |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | internal static ApplicationGatewayProbeHealthResponseMatch DeserializeApplicationGatewayProbeHealthResponseMatch |
| | 38 | | { |
| 0 | 39 | | string body = default; |
| 0 | 40 | | IList<string> statusCodes = default; |
| 0 | 41 | | foreach (var property in element.EnumerateObject()) |
| | 42 | | { |
| 0 | 43 | | if (property.NameEquals("body")) |
| | 44 | | { |
| 0 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | body = property.Value.GetString(); |
| 0 | 50 | | continue; |
| | 51 | | } |
| 0 | 52 | | if (property.NameEquals("statusCodes")) |
| | 53 | | { |
| 0 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | List<string> array = new List<string>(); |
| 0 | 59 | | foreach (var item in property.Value.EnumerateArray()) |
| | 60 | | { |
| 0 | 61 | | if (item.ValueKind == JsonValueKind.Null) |
| | 62 | | { |
| 0 | 63 | | array.Add(null); |
| | 64 | | } |
| | 65 | | else |
| | 66 | | { |
| 0 | 67 | | array.Add(item.GetString()); |
| | 68 | | } |
| | 69 | | } |
| 0 | 70 | | statusCodes = array; |
| | 71 | | continue; |
| | 72 | | } |
| | 73 | | } |
| 0 | 74 | | return new ApplicationGatewayProbeHealthResponseMatch(body, statusCodes); |
| | 75 | | } |
| | 76 | | } |
| | 77 | | } |