| | 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 GetMetadataActivity : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(LinkedServiceName)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 22 | | writer.WriteObjectValue(LinkedServiceName); |
| | 23 | | } |
| 0 | 24 | | if (Optional.IsDefined(Policy)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("policy"); |
| 0 | 27 | | writer.WriteObjectValue(Policy); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("name"); |
| 0 | 30 | | writer.WriteStringValue(Name); |
| 0 | 31 | | writer.WritePropertyName("type"); |
| 0 | 32 | | writer.WriteStringValue(Type); |
| 0 | 33 | | if (Optional.IsDefined(Description)) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("description"); |
| 0 | 36 | | writer.WriteStringValue(Description); |
| | 37 | | } |
| 0 | 38 | | if (Optional.IsCollectionDefined(DependsOn)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("dependsOn"); |
| 0 | 41 | | writer.WriteStartArray(); |
| 0 | 42 | | foreach (var item in DependsOn) |
| | 43 | | { |
| 0 | 44 | | writer.WriteObjectValue(item); |
| | 45 | | } |
| 0 | 46 | | writer.WriteEndArray(); |
| | 47 | | } |
| 0 | 48 | | if (Optional.IsCollectionDefined(UserProperties)) |
| | 49 | | { |
| 0 | 50 | | writer.WritePropertyName("userProperties"); |
| 0 | 51 | | writer.WriteStartArray(); |
| 0 | 52 | | foreach (var item in UserProperties) |
| | 53 | | { |
| 0 | 54 | | writer.WriteObjectValue(item); |
| | 55 | | } |
| 0 | 56 | | writer.WriteEndArray(); |
| | 57 | | } |
| 0 | 58 | | writer.WritePropertyName("typeProperties"); |
| 0 | 59 | | writer.WriteStartObject(); |
| 0 | 60 | | writer.WritePropertyName("dataset"); |
| 0 | 61 | | writer.WriteObjectValue(Dataset); |
| 0 | 62 | | if (Optional.IsCollectionDefined(FieldList)) |
| | 63 | | { |
| 0 | 64 | | writer.WritePropertyName("fieldList"); |
| 0 | 65 | | writer.WriteStartArray(); |
| 0 | 66 | | foreach (var item in FieldList) |
| | 67 | | { |
| 0 | 68 | | writer.WriteObjectValue(item); |
| | 69 | | } |
| 0 | 70 | | writer.WriteEndArray(); |
| | 71 | | } |
| 0 | 72 | | writer.WriteEndObject(); |
| 0 | 73 | | foreach (var item in AdditionalProperties) |
| | 74 | | { |
| 0 | 75 | | writer.WritePropertyName(item.Key); |
| 0 | 76 | | writer.WriteObjectValue(item.Value); |
| | 77 | | } |
| 0 | 78 | | writer.WriteEndObject(); |
| 0 | 79 | | } |
| | 80 | |
|
| | 81 | | internal static GetMetadataActivity DeserializeGetMetadataActivity(JsonElement element) |
| | 82 | | { |
| 0 | 83 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 84 | | Optional<ActivityPolicy> policy = default; |
| 0 | 85 | | string name = default; |
| 0 | 86 | | string type = default; |
| 0 | 87 | | Optional<string> description = default; |
| 0 | 88 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 89 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 90 | | DatasetReference dataset = default; |
| 0 | 91 | | Optional<IList<object>> fieldList = default; |
| 0 | 92 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 93 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 94 | | foreach (var property in element.EnumerateObject()) |
| | 95 | | { |
| 0 | 96 | | if (property.NameEquals("linkedServiceName")) |
| | 97 | | { |
| 0 | 98 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 99 | | continue; |
| | 100 | | } |
| 0 | 101 | | if (property.NameEquals("policy")) |
| | 102 | | { |
| 0 | 103 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 104 | | continue; |
| | 105 | | } |
| 0 | 106 | | if (property.NameEquals("name")) |
| | 107 | | { |
| 0 | 108 | | name = property.Value.GetString(); |
| 0 | 109 | | continue; |
| | 110 | | } |
| 0 | 111 | | if (property.NameEquals("type")) |
| | 112 | | { |
| 0 | 113 | | type = property.Value.GetString(); |
| 0 | 114 | | continue; |
| | 115 | | } |
| 0 | 116 | | if (property.NameEquals("description")) |
| | 117 | | { |
| 0 | 118 | | description = property.Value.GetString(); |
| 0 | 119 | | continue; |
| | 120 | | } |
| 0 | 121 | | if (property.NameEquals("dependsOn")) |
| | 122 | | { |
| 0 | 123 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 124 | | foreach (var item in property.Value.EnumerateArray()) |
| | 125 | | { |
| 0 | 126 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 127 | | } |
| 0 | 128 | | dependsOn = array; |
| 0 | 129 | | continue; |
| | 130 | | } |
| 0 | 131 | | if (property.NameEquals("userProperties")) |
| | 132 | | { |
| 0 | 133 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 134 | | foreach (var item in property.Value.EnumerateArray()) |
| | 135 | | { |
| 0 | 136 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 137 | | } |
| 0 | 138 | | userProperties = array; |
| 0 | 139 | | continue; |
| | 140 | | } |
| 0 | 141 | | if (property.NameEquals("typeProperties")) |
| | 142 | | { |
| 0 | 143 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 144 | | { |
| 0 | 145 | | if (property0.NameEquals("dataset")) |
| | 146 | | { |
| 0 | 147 | | dataset = DatasetReference.DeserializeDatasetReference(property0.Value); |
| 0 | 148 | | continue; |
| | 149 | | } |
| 0 | 150 | | if (property0.NameEquals("fieldList")) |
| | 151 | | { |
| 0 | 152 | | List<object> array = new List<object>(); |
| 0 | 153 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 154 | | { |
| 0 | 155 | | array.Add(item.GetObject()); |
| | 156 | | } |
| 0 | 157 | | fieldList = array; |
| | 158 | | continue; |
| | 159 | | } |
| | 160 | | } |
| | 161 | | continue; |
| | 162 | | } |
| 0 | 163 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 164 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 165 | | } |
| 0 | 166 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 167 | | return new GetMetadataActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(us |
| | 168 | | } |
| | 169 | | } |
| | 170 | | } |