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