| | 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 ExecuteSsisPackageActivity : 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("packageLocation"); |
| 0 | 61 | | writer.WriteObjectValue(PackageLocation); |
| 0 | 62 | | if (Optional.IsDefined(Runtime)) |
| | 63 | | { |
| 0 | 64 | | writer.WritePropertyName("runtime"); |
| 0 | 65 | | writer.WriteObjectValue(Runtime); |
| | 66 | | } |
| 0 | 67 | | if (Optional.IsDefined(LoggingLevel)) |
| | 68 | | { |
| 0 | 69 | | writer.WritePropertyName("loggingLevel"); |
| 0 | 70 | | writer.WriteObjectValue(LoggingLevel); |
| | 71 | | } |
| 0 | 72 | | if (Optional.IsDefined(EnvironmentPath)) |
| | 73 | | { |
| 0 | 74 | | writer.WritePropertyName("environmentPath"); |
| 0 | 75 | | writer.WriteObjectValue(EnvironmentPath); |
| | 76 | | } |
| 0 | 77 | | if (Optional.IsDefined(ExecutionCredential)) |
| | 78 | | { |
| 0 | 79 | | writer.WritePropertyName("executionCredential"); |
| 0 | 80 | | writer.WriteObjectValue(ExecutionCredential); |
| | 81 | | } |
| 0 | 82 | | writer.WritePropertyName("connectVia"); |
| 0 | 83 | | writer.WriteObjectValue(ConnectVia); |
| 0 | 84 | | if (Optional.IsCollectionDefined(ProjectParameters)) |
| | 85 | | { |
| 0 | 86 | | writer.WritePropertyName("projectParameters"); |
| 0 | 87 | | writer.WriteStartObject(); |
| 0 | 88 | | foreach (var item in ProjectParameters) |
| | 89 | | { |
| 0 | 90 | | writer.WritePropertyName(item.Key); |
| 0 | 91 | | writer.WriteObjectValue(item.Value); |
| | 92 | | } |
| 0 | 93 | | writer.WriteEndObject(); |
| | 94 | | } |
| 0 | 95 | | if (Optional.IsCollectionDefined(PackageParameters)) |
| | 96 | | { |
| 0 | 97 | | writer.WritePropertyName("packageParameters"); |
| 0 | 98 | | writer.WriteStartObject(); |
| 0 | 99 | | foreach (var item in PackageParameters) |
| | 100 | | { |
| 0 | 101 | | writer.WritePropertyName(item.Key); |
| 0 | 102 | | writer.WriteObjectValue(item.Value); |
| | 103 | | } |
| 0 | 104 | | writer.WriteEndObject(); |
| | 105 | | } |
| 0 | 106 | | if (Optional.IsCollectionDefined(ProjectConnectionManagers)) |
| | 107 | | { |
| 0 | 108 | | writer.WritePropertyName("projectConnectionManagers"); |
| 0 | 109 | | writer.WriteStartObject(); |
| 0 | 110 | | foreach (var item in ProjectConnectionManagers) |
| | 111 | | { |
| 0 | 112 | | writer.WritePropertyName(item.Key); |
| 0 | 113 | | writer.WriteObjectValue(item.Value); |
| | 114 | | } |
| 0 | 115 | | writer.WriteEndObject(); |
| | 116 | | } |
| 0 | 117 | | if (Optional.IsCollectionDefined(PackageConnectionManagers)) |
| | 118 | | { |
| 0 | 119 | | writer.WritePropertyName("packageConnectionManagers"); |
| 0 | 120 | | writer.WriteStartObject(); |
| 0 | 121 | | foreach (var item in PackageConnectionManagers) |
| | 122 | | { |
| 0 | 123 | | writer.WritePropertyName(item.Key); |
| 0 | 124 | | writer.WriteObjectValue(item.Value); |
| | 125 | | } |
| 0 | 126 | | writer.WriteEndObject(); |
| | 127 | | } |
| 0 | 128 | | if (Optional.IsCollectionDefined(PropertyOverrides)) |
| | 129 | | { |
| 0 | 130 | | writer.WritePropertyName("propertyOverrides"); |
| 0 | 131 | | writer.WriteStartObject(); |
| 0 | 132 | | foreach (var item in PropertyOverrides) |
| | 133 | | { |
| 0 | 134 | | writer.WritePropertyName(item.Key); |
| 0 | 135 | | writer.WriteObjectValue(item.Value); |
| | 136 | | } |
| 0 | 137 | | writer.WriteEndObject(); |
| | 138 | | } |
| 0 | 139 | | if (Optional.IsDefined(LogLocation)) |
| | 140 | | { |
| 0 | 141 | | writer.WritePropertyName("logLocation"); |
| 0 | 142 | | writer.WriteObjectValue(LogLocation); |
| | 143 | | } |
| 0 | 144 | | writer.WriteEndObject(); |
| 0 | 145 | | foreach (var item in AdditionalProperties) |
| | 146 | | { |
| 0 | 147 | | writer.WritePropertyName(item.Key); |
| 0 | 148 | | writer.WriteObjectValue(item.Value); |
| | 149 | | } |
| 0 | 150 | | writer.WriteEndObject(); |
| 0 | 151 | | } |
| | 152 | |
|
| | 153 | | internal static ExecuteSsisPackageActivity DeserializeExecuteSsisPackageActivity(JsonElement element) |
| | 154 | | { |
| 0 | 155 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 156 | | Optional<ActivityPolicy> policy = default; |
| 0 | 157 | | string name = default; |
| 0 | 158 | | string type = default; |
| 0 | 159 | | Optional<string> description = default; |
| 0 | 160 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 161 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 162 | | SsisPackageLocation packageLocation = default; |
| 0 | 163 | | Optional<object> runtime = default; |
| 0 | 164 | | Optional<object> loggingLevel = default; |
| 0 | 165 | | Optional<object> environmentPath = default; |
| 0 | 166 | | Optional<SsisExecutionCredential> executionCredential = default; |
| 0 | 167 | | IntegrationRuntimeReference connectVia = default; |
| 0 | 168 | | Optional<IDictionary<string, SsisExecutionParameter>> projectParameters = default; |
| 0 | 169 | | Optional<IDictionary<string, SsisExecutionParameter>> packageParameters = default; |
| 0 | 170 | | Optional<IDictionary<string, object>> projectConnectionManagers = default; |
| 0 | 171 | | Optional<IDictionary<string, object>> packageConnectionManagers = default; |
| 0 | 172 | | Optional<IDictionary<string, SsisPropertyOverride>> propertyOverrides = default; |
| 0 | 173 | | Optional<SsisLogLocation> logLocation = default; |
| 0 | 174 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 175 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 176 | | foreach (var property in element.EnumerateObject()) |
| | 177 | | { |
| 0 | 178 | | if (property.NameEquals("linkedServiceName")) |
| | 179 | | { |
| 0 | 180 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 181 | | continue; |
| | 182 | | } |
| 0 | 183 | | if (property.NameEquals("policy")) |
| | 184 | | { |
| 0 | 185 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 186 | | continue; |
| | 187 | | } |
| 0 | 188 | | if (property.NameEquals("name")) |
| | 189 | | { |
| 0 | 190 | | name = property.Value.GetString(); |
| 0 | 191 | | continue; |
| | 192 | | } |
| 0 | 193 | | if (property.NameEquals("type")) |
| | 194 | | { |
| 0 | 195 | | type = property.Value.GetString(); |
| 0 | 196 | | continue; |
| | 197 | | } |
| 0 | 198 | | if (property.NameEquals("description")) |
| | 199 | | { |
| 0 | 200 | | description = property.Value.GetString(); |
| 0 | 201 | | continue; |
| | 202 | | } |
| 0 | 203 | | if (property.NameEquals("dependsOn")) |
| | 204 | | { |
| 0 | 205 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 206 | | foreach (var item in property.Value.EnumerateArray()) |
| | 207 | | { |
| 0 | 208 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 209 | | } |
| 0 | 210 | | dependsOn = array; |
| 0 | 211 | | continue; |
| | 212 | | } |
| 0 | 213 | | if (property.NameEquals("userProperties")) |
| | 214 | | { |
| 0 | 215 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 216 | | foreach (var item in property.Value.EnumerateArray()) |
| | 217 | | { |
| 0 | 218 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 219 | | } |
| 0 | 220 | | userProperties = array; |
| 0 | 221 | | continue; |
| | 222 | | } |
| 0 | 223 | | if (property.NameEquals("typeProperties")) |
| | 224 | | { |
| 0 | 225 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 226 | | { |
| 0 | 227 | | if (property0.NameEquals("packageLocation")) |
| | 228 | | { |
| 0 | 229 | | packageLocation = SsisPackageLocation.DeserializeSsisPackageLocation(property0.Value); |
| 0 | 230 | | continue; |
| | 231 | | } |
| 0 | 232 | | if (property0.NameEquals("runtime")) |
| | 233 | | { |
| 0 | 234 | | runtime = property0.Value.GetObject(); |
| 0 | 235 | | continue; |
| | 236 | | } |
| 0 | 237 | | if (property0.NameEquals("loggingLevel")) |
| | 238 | | { |
| 0 | 239 | | loggingLevel = property0.Value.GetObject(); |
| 0 | 240 | | continue; |
| | 241 | | } |
| 0 | 242 | | if (property0.NameEquals("environmentPath")) |
| | 243 | | { |
| 0 | 244 | | environmentPath = property0.Value.GetObject(); |
| 0 | 245 | | continue; |
| | 246 | | } |
| 0 | 247 | | if (property0.NameEquals("executionCredential")) |
| | 248 | | { |
| 0 | 249 | | executionCredential = SsisExecutionCredential.DeserializeSsisExecutionCredential(property0.V |
| 0 | 250 | | continue; |
| | 251 | | } |
| 0 | 252 | | if (property0.NameEquals("connectVia")) |
| | 253 | | { |
| 0 | 254 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property0.Va |
| 0 | 255 | | continue; |
| | 256 | | } |
| 0 | 257 | | if (property0.NameEquals("projectParameters")) |
| | 258 | | { |
| 0 | 259 | | Dictionary<string, SsisExecutionParameter> dictionary = new Dictionary<string, SsisExecution |
| 0 | 260 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 261 | | { |
| 0 | 262 | | dictionary.Add(property1.Name, SsisExecutionParameter.DeserializeSsisExecutionParameter( |
| | 263 | | } |
| 0 | 264 | | projectParameters = dictionary; |
| 0 | 265 | | continue; |
| | 266 | | } |
| 0 | 267 | | if (property0.NameEquals("packageParameters")) |
| | 268 | | { |
| 0 | 269 | | Dictionary<string, SsisExecutionParameter> dictionary = new Dictionary<string, SsisExecution |
| 0 | 270 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 271 | | { |
| 0 | 272 | | dictionary.Add(property1.Name, SsisExecutionParameter.DeserializeSsisExecutionParameter( |
| | 273 | | } |
| 0 | 274 | | packageParameters = dictionary; |
| 0 | 275 | | continue; |
| | 276 | | } |
| 0 | 277 | | if (property0.NameEquals("projectConnectionManagers")) |
| | 278 | | { |
| 0 | 279 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 280 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 281 | | { |
| 0 | 282 | | dictionary.Add(property1.Name, property1.Value.GetObject()); |
| | 283 | | } |
| 0 | 284 | | projectConnectionManagers = dictionary; |
| 0 | 285 | | continue; |
| | 286 | | } |
| 0 | 287 | | if (property0.NameEquals("packageConnectionManagers")) |
| | 288 | | { |
| 0 | 289 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 290 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 291 | | { |
| 0 | 292 | | dictionary.Add(property1.Name, property1.Value.GetObject()); |
| | 293 | | } |
| 0 | 294 | | packageConnectionManagers = dictionary; |
| 0 | 295 | | continue; |
| | 296 | | } |
| 0 | 297 | | if (property0.NameEquals("propertyOverrides")) |
| | 298 | | { |
| 0 | 299 | | Dictionary<string, SsisPropertyOverride> dictionary = new Dictionary<string, SsisPropertyOve |
| 0 | 300 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 301 | | { |
| 0 | 302 | | dictionary.Add(property1.Name, SsisPropertyOverride.DeserializeSsisPropertyOverride(prop |
| | 303 | | } |
| 0 | 304 | | propertyOverrides = dictionary; |
| 0 | 305 | | continue; |
| | 306 | | } |
| 0 | 307 | | if (property0.NameEquals("logLocation")) |
| | 308 | | { |
| 0 | 309 | | logLocation = SsisLogLocation.DeserializeSsisLogLocation(property0.Value); |
| | 310 | | continue; |
| | 311 | | } |
| | 312 | | } |
| | 313 | | continue; |
| | 314 | | } |
| 0 | 315 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 316 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 317 | | } |
| 0 | 318 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 319 | | return new ExecuteSsisPackageActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.To |
| | 320 | | } |
| | 321 | | } |
| | 322 | | } |