| | 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 SsisPackageLocation : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(PackagePath)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("packagePath"); |
| 0 | 22 | | writer.WriteObjectValue(PackagePath); |
| | 23 | | } |
| 0 | 24 | | if (Optional.IsDefined(Type)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("type"); |
| 0 | 27 | | writer.WriteStringValue(Type.Value.ToString()); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("typeProperties"); |
| 0 | 30 | | writer.WriteStartObject(); |
| 0 | 31 | | if (Optional.IsDefined(PackagePassword)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("packagePassword"); |
| 0 | 34 | | writer.WriteObjectValue(PackagePassword); |
| | 35 | | } |
| 0 | 36 | | if (Optional.IsDefined(AccessCredential)) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("accessCredential"); |
| 0 | 39 | | writer.WriteObjectValue(AccessCredential); |
| | 40 | | } |
| 0 | 41 | | if (Optional.IsDefined(ConfigurationPath)) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("configurationPath"); |
| 0 | 44 | | writer.WriteObjectValue(ConfigurationPath); |
| | 45 | | } |
| 0 | 46 | | if (Optional.IsDefined(PackageName)) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("packageName"); |
| 0 | 49 | | writer.WriteStringValue(PackageName); |
| | 50 | | } |
| 0 | 51 | | if (Optional.IsDefined(PackageContent)) |
| | 52 | | { |
| 0 | 53 | | writer.WritePropertyName("packageContent"); |
| 0 | 54 | | writer.WriteObjectValue(PackageContent); |
| | 55 | | } |
| 0 | 56 | | if (Optional.IsDefined(PackageLastModifiedDate)) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("packageLastModifiedDate"); |
| 0 | 59 | | writer.WriteStringValue(PackageLastModifiedDate); |
| | 60 | | } |
| 0 | 61 | | if (Optional.IsCollectionDefined(ChildPackages)) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("childPackages"); |
| 0 | 64 | | writer.WriteStartArray(); |
| 0 | 65 | | foreach (var item in ChildPackages) |
| | 66 | | { |
| 0 | 67 | | writer.WriteObjectValue(item); |
| | 68 | | } |
| 0 | 69 | | writer.WriteEndArray(); |
| | 70 | | } |
| 0 | 71 | | writer.WriteEndObject(); |
| 0 | 72 | | writer.WriteEndObject(); |
| 0 | 73 | | } |
| | 74 | |
|
| | 75 | | internal static SsisPackageLocation DeserializeSsisPackageLocation(JsonElement element) |
| | 76 | | { |
| 0 | 77 | | Optional<object> packagePath = default; |
| 0 | 78 | | Optional<SsisPackageLocationType> type = default; |
| 0 | 79 | | Optional<SecretBase> packagePassword = default; |
| 0 | 80 | | Optional<SsisAccessCredential> accessCredential = default; |
| 0 | 81 | | Optional<object> configurationPath = default; |
| 0 | 82 | | Optional<string> packageName = default; |
| 0 | 83 | | Optional<object> packageContent = default; |
| 0 | 84 | | Optional<string> packageLastModifiedDate = default; |
| 0 | 85 | | Optional<IList<SsisChildPackage>> childPackages = default; |
| 0 | 86 | | foreach (var property in element.EnumerateObject()) |
| | 87 | | { |
| 0 | 88 | | if (property.NameEquals("packagePath")) |
| | 89 | | { |
| 0 | 90 | | packagePath = property.Value.GetObject(); |
| 0 | 91 | | continue; |
| | 92 | | } |
| 0 | 93 | | if (property.NameEquals("type")) |
| | 94 | | { |
| 0 | 95 | | type = new SsisPackageLocationType(property.Value.GetString()); |
| 0 | 96 | | continue; |
| | 97 | | } |
| 0 | 98 | | if (property.NameEquals("typeProperties")) |
| | 99 | | { |
| 0 | 100 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 101 | | { |
| 0 | 102 | | if (property0.NameEquals("packagePassword")) |
| | 103 | | { |
| 0 | 104 | | packagePassword = SecretBase.DeserializeSecretBase(property0.Value); |
| 0 | 105 | | continue; |
| | 106 | | } |
| 0 | 107 | | if (property0.NameEquals("accessCredential")) |
| | 108 | | { |
| 0 | 109 | | accessCredential = SsisAccessCredential.DeserializeSsisAccessCredential(property0.Value); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property0.NameEquals("configurationPath")) |
| | 113 | | { |
| 0 | 114 | | configurationPath = property0.Value.GetObject(); |
| 0 | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | if (property0.NameEquals("packageName")) |
| | 118 | | { |
| 0 | 119 | | packageName = property0.Value.GetString(); |
| 0 | 120 | | continue; |
| | 121 | | } |
| 0 | 122 | | if (property0.NameEquals("packageContent")) |
| | 123 | | { |
| 0 | 124 | | packageContent = property0.Value.GetObject(); |
| 0 | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | if (property0.NameEquals("packageLastModifiedDate")) |
| | 128 | | { |
| 0 | 129 | | packageLastModifiedDate = property0.Value.GetString(); |
| 0 | 130 | | continue; |
| | 131 | | } |
| 0 | 132 | | if (property0.NameEquals("childPackages")) |
| | 133 | | { |
| 0 | 134 | | List<SsisChildPackage> array = new List<SsisChildPackage>(); |
| 0 | 135 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 136 | | { |
| 0 | 137 | | array.Add(SsisChildPackage.DeserializeSsisChildPackage(item)); |
| | 138 | | } |
| 0 | 139 | | childPackages = array; |
| | 140 | | continue; |
| | 141 | | } |
| | 142 | | } |
| | 143 | | continue; |
| | 144 | | } |
| | 145 | | } |
| 0 | 146 | | return new SsisPackageLocation(packagePath.Value, Optional.ToNullable(type), packagePassword.Value, accessCr |
| | 147 | | } |
| | 148 | | } |
| | 149 | | } |