| | 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.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class ContainerService : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Id != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("id"); |
| 0 | 22 | | writer.WriteStringValue(Id); |
| | 23 | | } |
| 0 | 24 | | if (Name != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("name"); |
| 0 | 27 | | writer.WriteStringValue(Name); |
| | 28 | | } |
| 0 | 29 | | if (Type != null) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("type"); |
| 0 | 32 | | writer.WriteStringValue(Type); |
| | 33 | | } |
| 0 | 34 | | writer.WritePropertyName("location"); |
| 0 | 35 | | writer.WriteStringValue(Location); |
| 0 | 36 | | if (Tags != null) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("tags"); |
| 0 | 39 | | writer.WriteStartObject(); |
| 0 | 40 | | foreach (var item in Tags) |
| | 41 | | { |
| 0 | 42 | | writer.WritePropertyName(item.Key); |
| 0 | 43 | | writer.WriteStringValue(item.Value); |
| | 44 | | } |
| 0 | 45 | | writer.WriteEndObject(); |
| | 46 | | } |
| 0 | 47 | | writer.WritePropertyName("properties"); |
| 0 | 48 | | writer.WriteStartObject(); |
| 0 | 49 | | if (ProvisioningState != null) |
| | 50 | | { |
| 0 | 51 | | writer.WritePropertyName("provisioningState"); |
| 0 | 52 | | writer.WriteStringValue(ProvisioningState); |
| | 53 | | } |
| 0 | 54 | | if (OrchestratorProfile != null) |
| | 55 | | { |
| 0 | 56 | | writer.WritePropertyName("orchestratorProfile"); |
| 0 | 57 | | writer.WriteObjectValue(OrchestratorProfile); |
| | 58 | | } |
| 0 | 59 | | if (CustomProfile != null) |
| | 60 | | { |
| 0 | 61 | | writer.WritePropertyName("customProfile"); |
| 0 | 62 | | writer.WriteObjectValue(CustomProfile); |
| | 63 | | } |
| 0 | 64 | | if (ServicePrincipalProfile != null) |
| | 65 | | { |
| 0 | 66 | | writer.WritePropertyName("servicePrincipalProfile"); |
| 0 | 67 | | writer.WriteObjectValue(ServicePrincipalProfile); |
| | 68 | | } |
| 0 | 69 | | if (MasterProfile != null) |
| | 70 | | { |
| 0 | 71 | | writer.WritePropertyName("masterProfile"); |
| 0 | 72 | | writer.WriteObjectValue(MasterProfile); |
| | 73 | | } |
| 0 | 74 | | if (AgentPoolProfiles != null) |
| | 75 | | { |
| 0 | 76 | | writer.WritePropertyName("agentPoolProfiles"); |
| 0 | 77 | | writer.WriteStartArray(); |
| 0 | 78 | | foreach (var item in AgentPoolProfiles) |
| | 79 | | { |
| 0 | 80 | | writer.WriteObjectValue(item); |
| | 81 | | } |
| 0 | 82 | | writer.WriteEndArray(); |
| | 83 | | } |
| 0 | 84 | | if (WindowsProfile != null) |
| | 85 | | { |
| 0 | 86 | | writer.WritePropertyName("windowsProfile"); |
| 0 | 87 | | writer.WriteObjectValue(WindowsProfile); |
| | 88 | | } |
| 0 | 89 | | if (LinuxProfile != null) |
| | 90 | | { |
| 0 | 91 | | writer.WritePropertyName("linuxProfile"); |
| 0 | 92 | | writer.WriteObjectValue(LinuxProfile); |
| | 93 | | } |
| 0 | 94 | | if (DiagnosticsProfile != null) |
| | 95 | | { |
| 0 | 96 | | writer.WritePropertyName("diagnosticsProfile"); |
| 0 | 97 | | writer.WriteObjectValue(DiagnosticsProfile); |
| | 98 | | } |
| 0 | 99 | | writer.WriteEndObject(); |
| 0 | 100 | | writer.WriteEndObject(); |
| 0 | 101 | | } |
| | 102 | |
|
| | 103 | | internal static ContainerService DeserializeContainerService(JsonElement element) |
| | 104 | | { |
| 0 | 105 | | string id = default; |
| 0 | 106 | | string name = default; |
| 0 | 107 | | string type = default; |
| 0 | 108 | | string location = default; |
| 0 | 109 | | IDictionary<string, string> tags = default; |
| 0 | 110 | | string provisioningState = default; |
| 0 | 111 | | ContainerServiceOrchestratorProfile orchestratorProfile = default; |
| 0 | 112 | | ContainerServiceCustomProfile customProfile = default; |
| 0 | 113 | | ContainerServicePrincipalProfile servicePrincipalProfile = default; |
| 0 | 114 | | ContainerServiceMasterProfile masterProfile = default; |
| 0 | 115 | | IList<ContainerServiceAgentPoolProfile> agentPoolProfiles = default; |
| 0 | 116 | | ContainerServiceWindowsProfile windowsProfile = default; |
| 0 | 117 | | ContainerServiceLinuxProfile linuxProfile = default; |
| 0 | 118 | | ContainerServiceDiagnosticsProfile diagnosticsProfile = default; |
| 0 | 119 | | foreach (var property in element.EnumerateObject()) |
| | 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("name")) |
| | 131 | | { |
| 0 | 132 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 133 | | { |
| | 134 | | continue; |
| | 135 | | } |
| 0 | 136 | | name = property.Value.GetString(); |
| 0 | 137 | | continue; |
| | 138 | | } |
| 0 | 139 | | if (property.NameEquals("type")) |
| | 140 | | { |
| 0 | 141 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 142 | | { |
| | 143 | | continue; |
| | 144 | | } |
| 0 | 145 | | type = property.Value.GetString(); |
| 0 | 146 | | continue; |
| | 147 | | } |
| 0 | 148 | | if (property.NameEquals("location")) |
| | 149 | | { |
| 0 | 150 | | location = property.Value.GetString(); |
| 0 | 151 | | continue; |
| | 152 | | } |
| 0 | 153 | | if (property.NameEquals("tags")) |
| | 154 | | { |
| 0 | 155 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 156 | | { |
| | 157 | | continue; |
| | 158 | | } |
| 0 | 159 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| 0 | 160 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 161 | | { |
| 0 | 162 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 163 | | { |
| 0 | 164 | | dictionary.Add(property0.Name, null); |
| | 165 | | } |
| | 166 | | else |
| | 167 | | { |
| 0 | 168 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | 169 | | } |
| | 170 | | } |
| 0 | 171 | | tags = dictionary; |
| 0 | 172 | | continue; |
| | 173 | | } |
| 0 | 174 | | if (property.NameEquals("properties")) |
| | 175 | | { |
| 0 | 176 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 177 | | { |
| 0 | 178 | | if (property0.NameEquals("provisioningState")) |
| | 179 | | { |
| 0 | 180 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 181 | | { |
| | 182 | | continue; |
| | 183 | | } |
| 0 | 184 | | provisioningState = property0.Value.GetString(); |
| 0 | 185 | | continue; |
| | 186 | | } |
| 0 | 187 | | if (property0.NameEquals("orchestratorProfile")) |
| | 188 | | { |
| 0 | 189 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 190 | | { |
| | 191 | | continue; |
| | 192 | | } |
| 0 | 193 | | orchestratorProfile = ContainerServiceOrchestratorProfile.DeserializeContainerServiceOrchest |
| 0 | 194 | | continue; |
| | 195 | | } |
| 0 | 196 | | if (property0.NameEquals("customProfile")) |
| | 197 | | { |
| 0 | 198 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 199 | | { |
| | 200 | | continue; |
| | 201 | | } |
| 0 | 202 | | customProfile = ContainerServiceCustomProfile.DeserializeContainerServiceCustomProfile(prope |
| 0 | 203 | | continue; |
| | 204 | | } |
| 0 | 205 | | if (property0.NameEquals("servicePrincipalProfile")) |
| | 206 | | { |
| 0 | 207 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 208 | | { |
| | 209 | | continue; |
| | 210 | | } |
| 0 | 211 | | servicePrincipalProfile = ContainerServicePrincipalProfile.DeserializeContainerServicePrinci |
| 0 | 212 | | continue; |
| | 213 | | } |
| 0 | 214 | | if (property0.NameEquals("masterProfile")) |
| | 215 | | { |
| 0 | 216 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 217 | | { |
| | 218 | | continue; |
| | 219 | | } |
| 0 | 220 | | masterProfile = ContainerServiceMasterProfile.DeserializeContainerServiceMasterProfile(prope |
| 0 | 221 | | continue; |
| | 222 | | } |
| 0 | 223 | | if (property0.NameEquals("agentPoolProfiles")) |
| | 224 | | { |
| 0 | 225 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 226 | | { |
| | 227 | | continue; |
| | 228 | | } |
| 0 | 229 | | List<ContainerServiceAgentPoolProfile> array = new List<ContainerServiceAgentPoolProfile>(); |
| 0 | 230 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 231 | | { |
| 0 | 232 | | if (item.ValueKind == JsonValueKind.Null) |
| | 233 | | { |
| 0 | 234 | | array.Add(null); |
| | 235 | | } |
| | 236 | | else |
| | 237 | | { |
| 0 | 238 | | array.Add(ContainerServiceAgentPoolProfile.DeserializeContainerServiceAgentPoolProfi |
| | 239 | | } |
| | 240 | | } |
| 0 | 241 | | agentPoolProfiles = array; |
| 0 | 242 | | continue; |
| | 243 | | } |
| 0 | 244 | | if (property0.NameEquals("windowsProfile")) |
| | 245 | | { |
| 0 | 246 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 247 | | { |
| | 248 | | continue; |
| | 249 | | } |
| 0 | 250 | | windowsProfile = ContainerServiceWindowsProfile.DeserializeContainerServiceWindowsProfile(pr |
| 0 | 251 | | continue; |
| | 252 | | } |
| 0 | 253 | | if (property0.NameEquals("linuxProfile")) |
| | 254 | | { |
| 0 | 255 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 256 | | { |
| | 257 | | continue; |
| | 258 | | } |
| 0 | 259 | | linuxProfile = ContainerServiceLinuxProfile.DeserializeContainerServiceLinuxProfile(property |
| 0 | 260 | | continue; |
| | 261 | | } |
| 0 | 262 | | if (property0.NameEquals("diagnosticsProfile")) |
| | 263 | | { |
| 0 | 264 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 265 | | { |
| | 266 | | continue; |
| | 267 | | } |
| 0 | 268 | | diagnosticsProfile = ContainerServiceDiagnosticsProfile.DeserializeContainerServiceDiagnosti |
| | 269 | | continue; |
| | 270 | | } |
| | 271 | | } |
| | 272 | | continue; |
| | 273 | | } |
| | 274 | | } |
| 0 | 275 | | return new ContainerService(id, name, type, location, tags, provisioningState, orchestratorProfile, customPr |
| | 276 | | } |
| | 277 | | } |
| | 278 | | } |