| | 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.Resources.Models |
| | 12 | | { |
| | 13 | | public partial class SkuAutoGenerated : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("name"); |
| 0 | 19 | | writer.WriteStringValue(Name); |
| 0 | 20 | | if (Tier != null) |
| | 21 | | { |
| 0 | 22 | | writer.WritePropertyName("tier"); |
| 0 | 23 | | writer.WriteStringValue(Tier); |
| | 24 | | } |
| 0 | 25 | | if (Size != null) |
| | 26 | | { |
| 0 | 27 | | writer.WritePropertyName("size"); |
| 0 | 28 | | writer.WriteStringValue(Size); |
| | 29 | | } |
| 0 | 30 | | if (Family != null) |
| | 31 | | { |
| 0 | 32 | | writer.WritePropertyName("family"); |
| 0 | 33 | | writer.WriteStringValue(Family); |
| | 34 | | } |
| 0 | 35 | | if (Model != null) |
| | 36 | | { |
| 0 | 37 | | writer.WritePropertyName("model"); |
| 0 | 38 | | writer.WriteStringValue(Model); |
| | 39 | | } |
| 0 | 40 | | if (Capacity != null) |
| | 41 | | { |
| 0 | 42 | | writer.WritePropertyName("capacity"); |
| 0 | 43 | | writer.WriteNumberValue(Capacity.Value); |
| | 44 | | } |
| 0 | 45 | | writer.WriteEndObject(); |
| 0 | 46 | | } |
| | 47 | |
|
| | 48 | | internal static SkuAutoGenerated DeserializeSkuAutoGenerated(JsonElement element) |
| | 49 | | { |
| 0 | 50 | | string name = default; |
| 0 | 51 | | string tier = default; |
| 0 | 52 | | string size = default; |
| 0 | 53 | | string family = default; |
| 0 | 54 | | string model = default; |
| 0 | 55 | | int? capacity = default; |
| 0 | 56 | | foreach (var property in element.EnumerateObject()) |
| | 57 | | { |
| 0 | 58 | | if (property.NameEquals("name")) |
| | 59 | | { |
| 0 | 60 | | name = property.Value.GetString(); |
| 0 | 61 | | continue; |
| | 62 | | } |
| 0 | 63 | | if (property.NameEquals("tier")) |
| | 64 | | { |
| 0 | 65 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 66 | | { |
| | 67 | | continue; |
| | 68 | | } |
| 0 | 69 | | tier = property.Value.GetString(); |
| 0 | 70 | | continue; |
| | 71 | | } |
| 0 | 72 | | if (property.NameEquals("size")) |
| | 73 | | { |
| 0 | 74 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 75 | | { |
| | 76 | | continue; |
| | 77 | | } |
| 0 | 78 | | size = property.Value.GetString(); |
| 0 | 79 | | continue; |
| | 80 | | } |
| 0 | 81 | | if (property.NameEquals("family")) |
| | 82 | | { |
| 0 | 83 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 84 | | { |
| | 85 | | continue; |
| | 86 | | } |
| 0 | 87 | | family = property.Value.GetString(); |
| 0 | 88 | | continue; |
| | 89 | | } |
| 0 | 90 | | if (property.NameEquals("model")) |
| | 91 | | { |
| 0 | 92 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 93 | | { |
| | 94 | | continue; |
| | 95 | | } |
| 0 | 96 | | model = property.Value.GetString(); |
| 0 | 97 | | continue; |
| | 98 | | } |
| 0 | 99 | | if (property.NameEquals("capacity")) |
| | 100 | | { |
| 0 | 101 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 102 | | { |
| | 103 | | continue; |
| | 104 | | } |
| 0 | 105 | | capacity = property.Value.GetInt32(); |
| | 106 | | continue; |
| | 107 | | } |
| | 108 | | } |
| 0 | 109 | | return new SkuAutoGenerated(name, tier, size, family, model, capacity); |
| | 110 | | } |
| | 111 | | } |
| | 112 | | } |