| | 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 ApplicationGatewayUrlPathMap : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Name != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("name"); |
| 0 | 22 | | writer.WriteStringValue(Name); |
| | 23 | | } |
| 0 | 24 | | if (Etag != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("etag"); |
| 0 | 27 | | writer.WriteStringValue(Etag); |
| | 28 | | } |
| 0 | 29 | | if (Type != null) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("type"); |
| 0 | 32 | | writer.WriteStringValue(Type); |
| | 33 | | } |
| 0 | 34 | | if (Id != null) |
| | 35 | | { |
| 0 | 36 | | writer.WritePropertyName("id"); |
| 0 | 37 | | writer.WriteStringValue(Id); |
| | 38 | | } |
| 0 | 39 | | writer.WritePropertyName("properties"); |
| 0 | 40 | | writer.WriteStartObject(); |
| 0 | 41 | | if (DefaultBackendAddressPool != null) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("defaultBackendAddressPool"); |
| 0 | 44 | | writer.WriteObjectValue(DefaultBackendAddressPool); |
| | 45 | | } |
| 0 | 46 | | if (DefaultBackendHttpSettings != null) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("defaultBackendHttpSettings"); |
| 0 | 49 | | writer.WriteObjectValue(DefaultBackendHttpSettings); |
| | 50 | | } |
| 0 | 51 | | if (DefaultRewriteRuleSet != null) |
| | 52 | | { |
| 0 | 53 | | writer.WritePropertyName("defaultRewriteRuleSet"); |
| 0 | 54 | | writer.WriteObjectValue(DefaultRewriteRuleSet); |
| | 55 | | } |
| 0 | 56 | | if (DefaultRedirectConfiguration != null) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("defaultRedirectConfiguration"); |
| 0 | 59 | | writer.WriteObjectValue(DefaultRedirectConfiguration); |
| | 60 | | } |
| 0 | 61 | | if (PathRules != null) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("pathRules"); |
| 0 | 64 | | writer.WriteStartArray(); |
| 0 | 65 | | foreach (var item in PathRules) |
| | 66 | | { |
| 0 | 67 | | writer.WriteObjectValue(item); |
| | 68 | | } |
| 0 | 69 | | writer.WriteEndArray(); |
| | 70 | | } |
| 0 | 71 | | if (ProvisioningState != null) |
| | 72 | | { |
| 0 | 73 | | writer.WritePropertyName("provisioningState"); |
| 0 | 74 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 75 | | } |
| 0 | 76 | | writer.WriteEndObject(); |
| 0 | 77 | | writer.WriteEndObject(); |
| 0 | 78 | | } |
| | 79 | |
|
| | 80 | | internal static ApplicationGatewayUrlPathMap DeserializeApplicationGatewayUrlPathMap(JsonElement element) |
| | 81 | | { |
| 0 | 82 | | string name = default; |
| 0 | 83 | | string etag = default; |
| 0 | 84 | | string type = default; |
| 0 | 85 | | string id = default; |
| 0 | 86 | | SubResource defaultBackendAddressPool = default; |
| 0 | 87 | | SubResource defaultBackendHttpSettings = default; |
| 0 | 88 | | SubResource defaultRewriteRuleSet = default; |
| 0 | 89 | | SubResource defaultRedirectConfiguration = default; |
| 0 | 90 | | IList<ApplicationGatewayPathRule> pathRules = default; |
| 0 | 91 | | ProvisioningState? provisioningState = default; |
| 0 | 92 | | foreach (var property in element.EnumerateObject()) |
| | 93 | | { |
| 0 | 94 | | if (property.NameEquals("name")) |
| | 95 | | { |
| 0 | 96 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | name = property.Value.GetString(); |
| 0 | 101 | | continue; |
| | 102 | | } |
| 0 | 103 | | if (property.NameEquals("etag")) |
| | 104 | | { |
| 0 | 105 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 106 | | { |
| | 107 | | continue; |
| | 108 | | } |
| 0 | 109 | | etag = property.Value.GetString(); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("type")) |
| | 113 | | { |
| 0 | 114 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 115 | | { |
| | 116 | | continue; |
| | 117 | | } |
| 0 | 118 | | type = property.Value.GetString(); |
| 0 | 119 | | continue; |
| | 120 | | } |
| 0 | 121 | | if (property.NameEquals("id")) |
| | 122 | | { |
| 0 | 123 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 124 | | { |
| | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | id = property.Value.GetString(); |
| 0 | 128 | | continue; |
| | 129 | | } |
| 0 | 130 | | if (property.NameEquals("properties")) |
| | 131 | | { |
| 0 | 132 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 133 | | { |
| 0 | 134 | | if (property0.NameEquals("defaultBackendAddressPool")) |
| | 135 | | { |
| 0 | 136 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 137 | | { |
| | 138 | | continue; |
| | 139 | | } |
| 0 | 140 | | defaultBackendAddressPool = DeserializeSubResource(property0.Value); |
| 0 | 141 | | continue; |
| | 142 | | } |
| 0 | 143 | | if (property0.NameEquals("defaultBackendHttpSettings")) |
| | 144 | | { |
| 0 | 145 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 146 | | { |
| | 147 | | continue; |
| | 148 | | } |
| 0 | 149 | | defaultBackendHttpSettings = DeserializeSubResource(property0.Value); |
| 0 | 150 | | continue; |
| | 151 | | } |
| 0 | 152 | | if (property0.NameEquals("defaultRewriteRuleSet")) |
| | 153 | | { |
| 0 | 154 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 155 | | { |
| | 156 | | continue; |
| | 157 | | } |
| 0 | 158 | | defaultRewriteRuleSet = DeserializeSubResource(property0.Value); |
| 0 | 159 | | continue; |
| | 160 | | } |
| 0 | 161 | | if (property0.NameEquals("defaultRedirectConfiguration")) |
| | 162 | | { |
| 0 | 163 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 164 | | { |
| | 165 | | continue; |
| | 166 | | } |
| 0 | 167 | | defaultRedirectConfiguration = DeserializeSubResource(property0.Value); |
| 0 | 168 | | continue; |
| | 169 | | } |
| 0 | 170 | | if (property0.NameEquals("pathRules")) |
| | 171 | | { |
| 0 | 172 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 173 | | { |
| | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | List<ApplicationGatewayPathRule> array = new List<ApplicationGatewayPathRule>(); |
| 0 | 177 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 178 | | { |
| 0 | 179 | | if (item.ValueKind == JsonValueKind.Null) |
| | 180 | | { |
| 0 | 181 | | array.Add(null); |
| | 182 | | } |
| | 183 | | else |
| | 184 | | { |
| 0 | 185 | | array.Add(ApplicationGatewayPathRule.DeserializeApplicationGatewayPathRule(item)); |
| | 186 | | } |
| | 187 | | } |
| 0 | 188 | | pathRules = array; |
| 0 | 189 | | continue; |
| | 190 | | } |
| 0 | 191 | | if (property0.NameEquals("provisioningState")) |
| | 192 | | { |
| 0 | 193 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 194 | | { |
| | 195 | | continue; |
| | 196 | | } |
| 0 | 197 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 198 | | continue; |
| | 199 | | } |
| | 200 | | } |
| | 201 | | continue; |
| | 202 | | } |
| | 203 | | } |
| 0 | 204 | | return new ApplicationGatewayUrlPathMap(id, name, etag, type, defaultBackendAddressPool, defaultBackendHttpS |
| | 205 | | } |
| | 206 | | } |
| | 207 | | } |