| | 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 SqlServerStoredProcedureActivity : 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("storedProcedureName"); |
| 0 | 61 | | writer.WriteObjectValue(StoredProcedureName); |
| 0 | 62 | | if (Optional.IsCollectionDefined(StoredProcedureParameters)) |
| | 63 | | { |
| 0 | 64 | | writer.WritePropertyName("storedProcedureParameters"); |
| 0 | 65 | | writer.WriteStartObject(); |
| 0 | 66 | | foreach (var item in StoredProcedureParameters) |
| | 67 | | { |
| 0 | 68 | | writer.WritePropertyName(item.Key); |
| 0 | 69 | | writer.WriteObjectValue(item.Value); |
| | 70 | | } |
| 0 | 71 | | writer.WriteEndObject(); |
| | 72 | | } |
| 0 | 73 | | writer.WriteEndObject(); |
| 0 | 74 | | foreach (var item in AdditionalProperties) |
| | 75 | | { |
| 0 | 76 | | writer.WritePropertyName(item.Key); |
| 0 | 77 | | writer.WriteObjectValue(item.Value); |
| | 78 | | } |
| 0 | 79 | | writer.WriteEndObject(); |
| 0 | 80 | | } |
| | 81 | |
|
| | 82 | | internal static SqlServerStoredProcedureActivity DeserializeSqlServerStoredProcedureActivity(JsonElement element |
| | 83 | | { |
| 0 | 84 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 85 | | Optional<ActivityPolicy> policy = default; |
| 0 | 86 | | string name = default; |
| 0 | 87 | | string type = default; |
| 0 | 88 | | Optional<string> description = default; |
| 0 | 89 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 90 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 91 | | object storedProcedureName = default; |
| 0 | 92 | | Optional<IDictionary<string, StoredProcedureParameter>> storedProcedureParameters = default; |
| 0 | 93 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 94 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 95 | | foreach (var property in element.EnumerateObject()) |
| | 96 | | { |
| 0 | 97 | | if (property.NameEquals("linkedServiceName")) |
| | 98 | | { |
| 0 | 99 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 100 | | continue; |
| | 101 | | } |
| 0 | 102 | | if (property.NameEquals("policy")) |
| | 103 | | { |
| 0 | 104 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 105 | | continue; |
| | 106 | | } |
| 0 | 107 | | if (property.NameEquals("name")) |
| | 108 | | { |
| 0 | 109 | | name = property.Value.GetString(); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("type")) |
| | 113 | | { |
| 0 | 114 | | type = property.Value.GetString(); |
| 0 | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | if (property.NameEquals("description")) |
| | 118 | | { |
| 0 | 119 | | description = property.Value.GetString(); |
| 0 | 120 | | continue; |
| | 121 | | } |
| 0 | 122 | | if (property.NameEquals("dependsOn")) |
| | 123 | | { |
| 0 | 124 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 125 | | foreach (var item in property.Value.EnumerateArray()) |
| | 126 | | { |
| 0 | 127 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 128 | | } |
| 0 | 129 | | dependsOn = array; |
| 0 | 130 | | continue; |
| | 131 | | } |
| 0 | 132 | | if (property.NameEquals("userProperties")) |
| | 133 | | { |
| 0 | 134 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 135 | | foreach (var item in property.Value.EnumerateArray()) |
| | 136 | | { |
| 0 | 137 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 138 | | } |
| 0 | 139 | | userProperties = array; |
| 0 | 140 | | continue; |
| | 141 | | } |
| 0 | 142 | | if (property.NameEquals("typeProperties")) |
| | 143 | | { |
| 0 | 144 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 145 | | { |
| 0 | 146 | | if (property0.NameEquals("storedProcedureName")) |
| | 147 | | { |
| 0 | 148 | | storedProcedureName = property0.Value.GetObject(); |
| 0 | 149 | | continue; |
| | 150 | | } |
| 0 | 151 | | if (property0.NameEquals("storedProcedureParameters")) |
| | 152 | | { |
| 0 | 153 | | Dictionary<string, StoredProcedureParameter> dictionary = new Dictionary<string, StoredProce |
| 0 | 154 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 155 | | { |
| 0 | 156 | | dictionary.Add(property1.Name, StoredProcedureParameter.DeserializeStoredProcedureParame |
| | 157 | | } |
| 0 | 158 | | storedProcedureParameters = dictionary; |
| | 159 | | continue; |
| | 160 | | } |
| | 161 | | } |
| | 162 | | continue; |
| | 163 | | } |
| 0 | 164 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 165 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 166 | | } |
| 0 | 167 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 168 | | return new SqlServerStoredProcedureActivity(name, type, description.Value, Optional.ToList(dependsOn), Optio |
| | 169 | | } |
| | 170 | | } |
| | 171 | | } |