| | 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 DeleteActivity : 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 | | if (Optional.IsDefined(Recursive)) |
| | 61 | | { |
| 0 | 62 | | writer.WritePropertyName("recursive"); |
| 0 | 63 | | writer.WriteObjectValue(Recursive); |
| | 64 | | } |
| 0 | 65 | | if (Optional.IsDefined(MaxConcurrentConnections)) |
| | 66 | | { |
| 0 | 67 | | writer.WritePropertyName("maxConcurrentConnections"); |
| 0 | 68 | | writer.WriteNumberValue(MaxConcurrentConnections.Value); |
| | 69 | | } |
| 0 | 70 | | if (Optional.IsDefined(EnableLogging)) |
| | 71 | | { |
| 0 | 72 | | writer.WritePropertyName("enableLogging"); |
| 0 | 73 | | writer.WriteObjectValue(EnableLogging); |
| | 74 | | } |
| 0 | 75 | | if (Optional.IsDefined(LogStorageSettings)) |
| | 76 | | { |
| 0 | 77 | | writer.WritePropertyName("logStorageSettings"); |
| 0 | 78 | | writer.WriteObjectValue(LogStorageSettings); |
| | 79 | | } |
| 0 | 80 | | writer.WritePropertyName("dataset"); |
| 0 | 81 | | writer.WriteObjectValue(Dataset); |
| 0 | 82 | | writer.WriteEndObject(); |
| 0 | 83 | | foreach (var item in AdditionalProperties) |
| | 84 | | { |
| 0 | 85 | | writer.WritePropertyName(item.Key); |
| 0 | 86 | | writer.WriteObjectValue(item.Value); |
| | 87 | | } |
| 0 | 88 | | writer.WriteEndObject(); |
| 0 | 89 | | } |
| | 90 | |
|
| | 91 | | internal static DeleteActivity DeserializeDeleteActivity(JsonElement element) |
| | 92 | | { |
| 0 | 93 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 94 | | Optional<ActivityPolicy> policy = default; |
| 0 | 95 | | string name = default; |
| 0 | 96 | | string type = default; |
| 0 | 97 | | Optional<string> description = default; |
| 0 | 98 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 99 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 100 | | Optional<object> recursive = default; |
| 0 | 101 | | Optional<int> maxConcurrentConnections = default; |
| 0 | 102 | | Optional<object> enableLogging = default; |
| 0 | 103 | | Optional<LogStorageSettings> logStorageSettings = default; |
| 0 | 104 | | DatasetReference dataset = default; |
| 0 | 105 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 106 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 107 | | foreach (var property in element.EnumerateObject()) |
| | 108 | | { |
| 0 | 109 | | if (property.NameEquals("linkedServiceName")) |
| | 110 | | { |
| 0 | 111 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 112 | | continue; |
| | 113 | | } |
| 0 | 114 | | if (property.NameEquals("policy")) |
| | 115 | | { |
| 0 | 116 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 117 | | continue; |
| | 118 | | } |
| 0 | 119 | | if (property.NameEquals("name")) |
| | 120 | | { |
| 0 | 121 | | name = property.Value.GetString(); |
| 0 | 122 | | continue; |
| | 123 | | } |
| 0 | 124 | | if (property.NameEquals("type")) |
| | 125 | | { |
| 0 | 126 | | type = property.Value.GetString(); |
| 0 | 127 | | continue; |
| | 128 | | } |
| 0 | 129 | | if (property.NameEquals("description")) |
| | 130 | | { |
| 0 | 131 | | description = property.Value.GetString(); |
| 0 | 132 | | continue; |
| | 133 | | } |
| 0 | 134 | | if (property.NameEquals("dependsOn")) |
| | 135 | | { |
| 0 | 136 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 137 | | foreach (var item in property.Value.EnumerateArray()) |
| | 138 | | { |
| 0 | 139 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 140 | | } |
| 0 | 141 | | dependsOn = array; |
| 0 | 142 | | continue; |
| | 143 | | } |
| 0 | 144 | | if (property.NameEquals("userProperties")) |
| | 145 | | { |
| 0 | 146 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 147 | | foreach (var item in property.Value.EnumerateArray()) |
| | 148 | | { |
| 0 | 149 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 150 | | } |
| 0 | 151 | | userProperties = array; |
| 0 | 152 | | continue; |
| | 153 | | } |
| 0 | 154 | | if (property.NameEquals("typeProperties")) |
| | 155 | | { |
| 0 | 156 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 157 | | { |
| 0 | 158 | | if (property0.NameEquals("recursive")) |
| | 159 | | { |
| 0 | 160 | | recursive = property0.Value.GetObject(); |
| 0 | 161 | | continue; |
| | 162 | | } |
| 0 | 163 | | if (property0.NameEquals("maxConcurrentConnections")) |
| | 164 | | { |
| 0 | 165 | | maxConcurrentConnections = property0.Value.GetInt32(); |
| 0 | 166 | | continue; |
| | 167 | | } |
| 0 | 168 | | if (property0.NameEquals("enableLogging")) |
| | 169 | | { |
| 0 | 170 | | enableLogging = property0.Value.GetObject(); |
| 0 | 171 | | continue; |
| | 172 | | } |
| 0 | 173 | | if (property0.NameEquals("logStorageSettings")) |
| | 174 | | { |
| 0 | 175 | | logStorageSettings = LogStorageSettings.DeserializeLogStorageSettings(property0.Value); |
| 0 | 176 | | continue; |
| | 177 | | } |
| 0 | 178 | | if (property0.NameEquals("dataset")) |
| | 179 | | { |
| 0 | 180 | | dataset = DatasetReference.DeserializeDatasetReference(property0.Value); |
| | 181 | | continue; |
| | 182 | | } |
| | 183 | | } |
| | 184 | | continue; |
| | 185 | | } |
| 0 | 186 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 187 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 188 | | } |
| 0 | 189 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 190 | | return new DeleteActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userPro |
| | 191 | | } |
| | 192 | | } |
| | 193 | | } |