| | 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.Network.Models |
| | 12 | | { |
| | 13 | | public partial class ApplicationGatewayProbe : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Name != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("name"); |
| 0 | 21 | | writer.WriteStringValue(Name); |
| | 22 | | } |
| 0 | 23 | | if (Etag != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("etag"); |
| 0 | 26 | | writer.WriteStringValue(Etag); |
| | 27 | | } |
| 0 | 28 | | if (Type != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("type"); |
| 0 | 31 | | writer.WriteStringValue(Type); |
| | 32 | | } |
| 0 | 33 | | if (Id != null) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("id"); |
| 0 | 36 | | writer.WriteStringValue(Id); |
| | 37 | | } |
| 0 | 38 | | writer.WritePropertyName("properties"); |
| 0 | 39 | | writer.WriteStartObject(); |
| 0 | 40 | | if (Protocol != null) |
| | 41 | | { |
| 0 | 42 | | writer.WritePropertyName("protocol"); |
| 0 | 43 | | writer.WriteStringValue(Protocol.Value.ToString()); |
| | 44 | | } |
| 0 | 45 | | if (Host != null) |
| | 46 | | { |
| 0 | 47 | | writer.WritePropertyName("host"); |
| 0 | 48 | | writer.WriteStringValue(Host); |
| | 49 | | } |
| 0 | 50 | | if (Path != null) |
| | 51 | | { |
| 0 | 52 | | writer.WritePropertyName("path"); |
| 0 | 53 | | writer.WriteStringValue(Path); |
| | 54 | | } |
| 0 | 55 | | if (Interval != null) |
| | 56 | | { |
| 0 | 57 | | writer.WritePropertyName("interval"); |
| 0 | 58 | | writer.WriteNumberValue(Interval.Value); |
| | 59 | | } |
| 0 | 60 | | if (Timeout != null) |
| | 61 | | { |
| 0 | 62 | | writer.WritePropertyName("timeout"); |
| 0 | 63 | | writer.WriteNumberValue(Timeout.Value); |
| | 64 | | } |
| 0 | 65 | | if (UnhealthyThreshold != null) |
| | 66 | | { |
| 0 | 67 | | writer.WritePropertyName("unhealthyThreshold"); |
| 0 | 68 | | writer.WriteNumberValue(UnhealthyThreshold.Value); |
| | 69 | | } |
| 0 | 70 | | if (PickHostNameFromBackendHttpSettings != null) |
| | 71 | | { |
| 0 | 72 | | writer.WritePropertyName("pickHostNameFromBackendHttpSettings"); |
| 0 | 73 | | writer.WriteBooleanValue(PickHostNameFromBackendHttpSettings.Value); |
| | 74 | | } |
| 0 | 75 | | if (MinServers != null) |
| | 76 | | { |
| 0 | 77 | | writer.WritePropertyName("minServers"); |
| 0 | 78 | | writer.WriteNumberValue(MinServers.Value); |
| | 79 | | } |
| 0 | 80 | | if (Match != null) |
| | 81 | | { |
| 0 | 82 | | writer.WritePropertyName("match"); |
| 0 | 83 | | writer.WriteObjectValue(Match); |
| | 84 | | } |
| 0 | 85 | | if (ProvisioningState != null) |
| | 86 | | { |
| 0 | 87 | | writer.WritePropertyName("provisioningState"); |
| 0 | 88 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 89 | | } |
| 0 | 90 | | if (Port != null) |
| | 91 | | { |
| 0 | 92 | | writer.WritePropertyName("port"); |
| 0 | 93 | | writer.WriteNumberValue(Port.Value); |
| | 94 | | } |
| 0 | 95 | | writer.WriteEndObject(); |
| 0 | 96 | | writer.WriteEndObject(); |
| 0 | 97 | | } |
| | 98 | |
|
| | 99 | | internal static ApplicationGatewayProbe DeserializeApplicationGatewayProbe(JsonElement element) |
| | 100 | | { |
| 0 | 101 | | string name = default; |
| 0 | 102 | | string etag = default; |
| 0 | 103 | | string type = default; |
| 0 | 104 | | string id = default; |
| 0 | 105 | | ApplicationGatewayProtocol? protocol = default; |
| 0 | 106 | | string host = default; |
| 0 | 107 | | string path = default; |
| 0 | 108 | | int? interval = default; |
| 0 | 109 | | int? timeout = default; |
| 0 | 110 | | int? unhealthyThreshold = default; |
| 0 | 111 | | bool? pickHostNameFromBackendHttpSettings = default; |
| 0 | 112 | | int? minServers = default; |
| 0 | 113 | | ApplicationGatewayProbeHealthResponseMatch match = default; |
| 0 | 114 | | ProvisioningState? provisioningState = default; |
| 0 | 115 | | int? port = default; |
| 0 | 116 | | foreach (var property in element.EnumerateObject()) |
| | 117 | | { |
| 0 | 118 | | if (property.NameEquals("name")) |
| | 119 | | { |
| 0 | 120 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 121 | | { |
| | 122 | | continue; |
| | 123 | | } |
| 0 | 124 | | name = property.Value.GetString(); |
| 0 | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | if (property.NameEquals("etag")) |
| | 128 | | { |
| 0 | 129 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 130 | | { |
| | 131 | | continue; |
| | 132 | | } |
| 0 | 133 | | etag = property.Value.GetString(); |
| 0 | 134 | | continue; |
| | 135 | | } |
| 0 | 136 | | if (property.NameEquals("type")) |
| | 137 | | { |
| 0 | 138 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 139 | | { |
| | 140 | | continue; |
| | 141 | | } |
| 0 | 142 | | type = property.Value.GetString(); |
| 0 | 143 | | continue; |
| | 144 | | } |
| 0 | 145 | | if (property.NameEquals("id")) |
| | 146 | | { |
| 0 | 147 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 148 | | { |
| | 149 | | continue; |
| | 150 | | } |
| 0 | 151 | | id = property.Value.GetString(); |
| 0 | 152 | | continue; |
| | 153 | | } |
| 0 | 154 | | if (property.NameEquals("properties")) |
| | 155 | | { |
| 0 | 156 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 157 | | { |
| 0 | 158 | | if (property0.NameEquals("protocol")) |
| | 159 | | { |
| 0 | 160 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 161 | | { |
| | 162 | | continue; |
| | 163 | | } |
| 0 | 164 | | protocol = new ApplicationGatewayProtocol(property0.Value.GetString()); |
| 0 | 165 | | continue; |
| | 166 | | } |
| 0 | 167 | | if (property0.NameEquals("host")) |
| | 168 | | { |
| 0 | 169 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 170 | | { |
| | 171 | | continue; |
| | 172 | | } |
| 0 | 173 | | host = property0.Value.GetString(); |
| 0 | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | if (property0.NameEquals("path")) |
| | 177 | | { |
| 0 | 178 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 179 | | { |
| | 180 | | continue; |
| | 181 | | } |
| 0 | 182 | | path = property0.Value.GetString(); |
| 0 | 183 | | continue; |
| | 184 | | } |
| 0 | 185 | | if (property0.NameEquals("interval")) |
| | 186 | | { |
| 0 | 187 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 188 | | { |
| | 189 | | continue; |
| | 190 | | } |
| 0 | 191 | | interval = property0.Value.GetInt32(); |
| 0 | 192 | | continue; |
| | 193 | | } |
| 0 | 194 | | if (property0.NameEquals("timeout")) |
| | 195 | | { |
| 0 | 196 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 197 | | { |
| | 198 | | continue; |
| | 199 | | } |
| 0 | 200 | | timeout = property0.Value.GetInt32(); |
| 0 | 201 | | continue; |
| | 202 | | } |
| 0 | 203 | | if (property0.NameEquals("unhealthyThreshold")) |
| | 204 | | { |
| 0 | 205 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 206 | | { |
| | 207 | | continue; |
| | 208 | | } |
| 0 | 209 | | unhealthyThreshold = property0.Value.GetInt32(); |
| 0 | 210 | | continue; |
| | 211 | | } |
| 0 | 212 | | if (property0.NameEquals("pickHostNameFromBackendHttpSettings")) |
| | 213 | | { |
| 0 | 214 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 215 | | { |
| | 216 | | continue; |
| | 217 | | } |
| 0 | 218 | | pickHostNameFromBackendHttpSettings = property0.Value.GetBoolean(); |
| 0 | 219 | | continue; |
| | 220 | | } |
| 0 | 221 | | if (property0.NameEquals("minServers")) |
| | 222 | | { |
| 0 | 223 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 224 | | { |
| | 225 | | continue; |
| | 226 | | } |
| 0 | 227 | | minServers = property0.Value.GetInt32(); |
| 0 | 228 | | continue; |
| | 229 | | } |
| 0 | 230 | | if (property0.NameEquals("match")) |
| | 231 | | { |
| 0 | 232 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 233 | | { |
| | 234 | | continue; |
| | 235 | | } |
| 0 | 236 | | match = ApplicationGatewayProbeHealthResponseMatch.DeserializeApplicationGatewayProbeHealthR |
| 0 | 237 | | continue; |
| | 238 | | } |
| 0 | 239 | | if (property0.NameEquals("provisioningState")) |
| | 240 | | { |
| 0 | 241 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 242 | | { |
| | 243 | | continue; |
| | 244 | | } |
| 0 | 245 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| 0 | 246 | | continue; |
| | 247 | | } |
| 0 | 248 | | if (property0.NameEquals("port")) |
| | 249 | | { |
| 0 | 250 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 251 | | { |
| | 252 | | continue; |
| | 253 | | } |
| 0 | 254 | | port = property0.Value.GetInt32(); |
| | 255 | | continue; |
| | 256 | | } |
| | 257 | | } |
| | 258 | | continue; |
| | 259 | | } |
| | 260 | | } |
| 0 | 261 | | return new ApplicationGatewayProbe(id, name, etag, type, protocol, host, path, interval, timeout, unhealthyT |
| | 262 | | } |
| | 263 | | } |
| | 264 | | } |