| | 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.Analytics.Synapse.Artifacts.Models |
| | 13 | | { |
| | 14 | | public partial class CassandraTableDataset : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("type"); |
| 0 | 20 | | writer.WriteStringValue(Type); |
| 0 | 21 | | if (Optional.IsDefined(Description)) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("description"); |
| 0 | 24 | | writer.WriteStringValue(Description); |
| | 25 | | } |
| 0 | 26 | | if (Optional.IsDefined(Structure)) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("structure"); |
| 0 | 29 | | writer.WriteObjectValue(Structure); |
| | 30 | | } |
| 0 | 31 | | if (Optional.IsDefined(Schema)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("schema"); |
| 0 | 34 | | writer.WriteObjectValue(Schema); |
| | 35 | | } |
| 0 | 36 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 37 | | writer.WriteObjectValue(LinkedServiceName); |
| 0 | 38 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("parameters"); |
| 0 | 41 | | writer.WriteStartObject(); |
| 0 | 42 | | foreach (var item in Parameters) |
| | 43 | | { |
| 0 | 44 | | writer.WritePropertyName(item.Key); |
| 0 | 45 | | writer.WriteObjectValue(item.Value); |
| | 46 | | } |
| 0 | 47 | | writer.WriteEndObject(); |
| | 48 | | } |
| 0 | 49 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 50 | | { |
| 0 | 51 | | writer.WritePropertyName("annotations"); |
| 0 | 52 | | writer.WriteStartArray(); |
| 0 | 53 | | foreach (var item in Annotations) |
| | 54 | | { |
| 0 | 55 | | writer.WriteObjectValue(item); |
| | 56 | | } |
| 0 | 57 | | writer.WriteEndArray(); |
| | 58 | | } |
| 0 | 59 | | if (Optional.IsDefined(Folder)) |
| | 60 | | { |
| 0 | 61 | | writer.WritePropertyName("folder"); |
| 0 | 62 | | writer.WriteObjectValue(Folder); |
| | 63 | | } |
| 0 | 64 | | writer.WritePropertyName("typeProperties"); |
| 0 | 65 | | writer.WriteStartObject(); |
| 0 | 66 | | if (Optional.IsDefined(TableName)) |
| | 67 | | { |
| 0 | 68 | | writer.WritePropertyName("tableName"); |
| 0 | 69 | | writer.WriteObjectValue(TableName); |
| | 70 | | } |
| 0 | 71 | | if (Optional.IsDefined(Keyspace)) |
| | 72 | | { |
| 0 | 73 | | writer.WritePropertyName("keyspace"); |
| 0 | 74 | | writer.WriteObjectValue(Keyspace); |
| | 75 | | } |
| 0 | 76 | | writer.WriteEndObject(); |
| 0 | 77 | | foreach (var item in AdditionalProperties) |
| | 78 | | { |
| 0 | 79 | | writer.WritePropertyName(item.Key); |
| 0 | 80 | | writer.WriteObjectValue(item.Value); |
| | 81 | | } |
| 0 | 82 | | writer.WriteEndObject(); |
| 0 | 83 | | } |
| | 84 | |
|
| | 85 | | internal static CassandraTableDataset DeserializeCassandraTableDataset(JsonElement element) |
| | 86 | | { |
| 0 | 87 | | string type = default; |
| 0 | 88 | | Optional<string> description = default; |
| 0 | 89 | | Optional<object> structure = default; |
| 0 | 90 | | Optional<object> schema = default; |
| 0 | 91 | | LinkedServiceReference linkedServiceName = default; |
| 0 | 92 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 93 | | Optional<IList<object>> annotations = default; |
| 0 | 94 | | Optional<DatasetFolder> folder = default; |
| 0 | 95 | | Optional<object> tableName = default; |
| 0 | 96 | | Optional<object> keyspace = default; |
| 0 | 97 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 98 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 99 | | foreach (var property in element.EnumerateObject()) |
| | 100 | | { |
| 0 | 101 | | if (property.NameEquals("type")) |
| | 102 | | { |
| 0 | 103 | | type = property.Value.GetString(); |
| 0 | 104 | | continue; |
| | 105 | | } |
| 0 | 106 | | if (property.NameEquals("description")) |
| | 107 | | { |
| 0 | 108 | | description = property.Value.GetString(); |
| 0 | 109 | | continue; |
| | 110 | | } |
| 0 | 111 | | if (property.NameEquals("structure")) |
| | 112 | | { |
| 0 | 113 | | structure = property.Value.GetObject(); |
| 0 | 114 | | continue; |
| | 115 | | } |
| 0 | 116 | | if (property.NameEquals("schema")) |
| | 117 | | { |
| 0 | 118 | | schema = property.Value.GetObject(); |
| 0 | 119 | | continue; |
| | 120 | | } |
| 0 | 121 | | if (property.NameEquals("linkedServiceName")) |
| | 122 | | { |
| 0 | 123 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 124 | | continue; |
| | 125 | | } |
| 0 | 126 | | if (property.NameEquals("parameters")) |
| | 127 | | { |
| 0 | 128 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 129 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 130 | | { |
| 0 | 131 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 132 | | } |
| 0 | 133 | | parameters = dictionary; |
| 0 | 134 | | continue; |
| | 135 | | } |
| 0 | 136 | | if (property.NameEquals("annotations")) |
| | 137 | | { |
| 0 | 138 | | List<object> array = new List<object>(); |
| 0 | 139 | | foreach (var item in property.Value.EnumerateArray()) |
| | 140 | | { |
| 0 | 141 | | array.Add(item.GetObject()); |
| | 142 | | } |
| 0 | 143 | | annotations = array; |
| 0 | 144 | | continue; |
| | 145 | | } |
| 0 | 146 | | if (property.NameEquals("folder")) |
| | 147 | | { |
| 0 | 148 | | folder = DatasetFolder.DeserializeDatasetFolder(property.Value); |
| 0 | 149 | | continue; |
| | 150 | | } |
| 0 | 151 | | if (property.NameEquals("typeProperties")) |
| | 152 | | { |
| 0 | 153 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 154 | | { |
| 0 | 155 | | if (property0.NameEquals("tableName")) |
| | 156 | | { |
| 0 | 157 | | tableName = property0.Value.GetObject(); |
| 0 | 158 | | continue; |
| | 159 | | } |
| 0 | 160 | | if (property0.NameEquals("keyspace")) |
| | 161 | | { |
| 0 | 162 | | keyspace = property0.Value.GetObject(); |
| | 163 | | continue; |
| | 164 | | } |
| | 165 | | } |
| | 166 | | continue; |
| | 167 | | } |
| 0 | 168 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 169 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 170 | | } |
| 0 | 171 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 172 | | return new CassandraTableDataset(type, description.Value, structure.Value, schema.Value, linkedServiceName, |
| | 173 | | } |
| | 174 | | } |
| | 175 | | } |