| | 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 SapCloudForCustomerResourceDataset : 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 | | writer.WritePropertyName("path"); |
| 0 | 67 | | writer.WriteObjectValue(Path); |
| 0 | 68 | | writer.WriteEndObject(); |
| 0 | 69 | | foreach (var item in AdditionalProperties) |
| | 70 | | { |
| 0 | 71 | | writer.WritePropertyName(item.Key); |
| 0 | 72 | | writer.WriteObjectValue(item.Value); |
| | 73 | | } |
| 0 | 74 | | writer.WriteEndObject(); |
| 0 | 75 | | } |
| | 76 | |
|
| | 77 | | internal static SapCloudForCustomerResourceDataset DeserializeSapCloudForCustomerResourceDataset(JsonElement ele |
| | 78 | | { |
| 0 | 79 | | string type = default; |
| 0 | 80 | | Optional<string> description = default; |
| 0 | 81 | | Optional<object> structure = default; |
| 0 | 82 | | Optional<object> schema = default; |
| 0 | 83 | | LinkedServiceReference linkedServiceName = default; |
| 0 | 84 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 85 | | Optional<IList<object>> annotations = default; |
| 0 | 86 | | Optional<DatasetFolder> folder = default; |
| 0 | 87 | | object path = default; |
| 0 | 88 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 89 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 90 | | foreach (var property in element.EnumerateObject()) |
| | 91 | | { |
| 0 | 92 | | if (property.NameEquals("type")) |
| | 93 | | { |
| 0 | 94 | | type = property.Value.GetString(); |
| 0 | 95 | | continue; |
| | 96 | | } |
| 0 | 97 | | if (property.NameEquals("description")) |
| | 98 | | { |
| 0 | 99 | | description = property.Value.GetString(); |
| 0 | 100 | | continue; |
| | 101 | | } |
| 0 | 102 | | if (property.NameEquals("structure")) |
| | 103 | | { |
| 0 | 104 | | structure = property.Value.GetObject(); |
| 0 | 105 | | continue; |
| | 106 | | } |
| 0 | 107 | | if (property.NameEquals("schema")) |
| | 108 | | { |
| 0 | 109 | | schema = property.Value.GetObject(); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("linkedServiceName")) |
| | 113 | | { |
| 0 | 114 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | if (property.NameEquals("parameters")) |
| | 118 | | { |
| 0 | 119 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 120 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 121 | | { |
| 0 | 122 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 123 | | } |
| 0 | 124 | | parameters = dictionary; |
| 0 | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | if (property.NameEquals("annotations")) |
| | 128 | | { |
| 0 | 129 | | List<object> array = new List<object>(); |
| 0 | 130 | | foreach (var item in property.Value.EnumerateArray()) |
| | 131 | | { |
| 0 | 132 | | array.Add(item.GetObject()); |
| | 133 | | } |
| 0 | 134 | | annotations = array; |
| 0 | 135 | | continue; |
| | 136 | | } |
| 0 | 137 | | if (property.NameEquals("folder")) |
| | 138 | | { |
| 0 | 139 | | folder = DatasetFolder.DeserializeDatasetFolder(property.Value); |
| 0 | 140 | | continue; |
| | 141 | | } |
| 0 | 142 | | if (property.NameEquals("typeProperties")) |
| | 143 | | { |
| 0 | 144 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 145 | | { |
| 0 | 146 | | if (property0.NameEquals("path")) |
| | 147 | | { |
| 0 | 148 | | path = property0.Value.GetObject(); |
| | 149 | | continue; |
| | 150 | | } |
| | 151 | | } |
| | 152 | | continue; |
| | 153 | | } |
| 0 | 154 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 155 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 156 | | } |
| 0 | 157 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 158 | | return new SapCloudForCustomerResourceDataset(type, description.Value, structure.Value, schema.Value, linked |
| | 159 | | } |
| | 160 | | } |
| | 161 | | } |