| | 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 CustomActivityReferenceObject : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsCollectionDefined(LinkedServices)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("linkedServices"); |
| 0 | 22 | | writer.WriteStartArray(); |
| 0 | 23 | | foreach (var item in LinkedServices) |
| | 24 | | { |
| 0 | 25 | | writer.WriteObjectValue(item); |
| | 26 | | } |
| 0 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 0 | 29 | | if (Optional.IsCollectionDefined(Datasets)) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("datasets"); |
| 0 | 32 | | writer.WriteStartArray(); |
| 0 | 33 | | foreach (var item in Datasets) |
| | 34 | | { |
| 0 | 35 | | writer.WriteObjectValue(item); |
| | 36 | | } |
| 0 | 37 | | writer.WriteEndArray(); |
| | 38 | | } |
| 0 | 39 | | writer.WriteEndObject(); |
| 0 | 40 | | } |
| | 41 | |
|
| | 42 | | internal static CustomActivityReferenceObject DeserializeCustomActivityReferenceObject(JsonElement element) |
| | 43 | | { |
| 0 | 44 | | Optional<IList<LinkedServiceReference>> linkedServices = default; |
| 0 | 45 | | Optional<IList<DatasetReference>> datasets = default; |
| 0 | 46 | | foreach (var property in element.EnumerateObject()) |
| | 47 | | { |
| 0 | 48 | | if (property.NameEquals("linkedServices")) |
| | 49 | | { |
| 0 | 50 | | List<LinkedServiceReference> array = new List<LinkedServiceReference>(); |
| 0 | 51 | | foreach (var item in property.Value.EnumerateArray()) |
| | 52 | | { |
| 0 | 53 | | array.Add(LinkedServiceReference.DeserializeLinkedServiceReference(item)); |
| | 54 | | } |
| 0 | 55 | | linkedServices = array; |
| 0 | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | if (property.NameEquals("datasets")) |
| | 59 | | { |
| 0 | 60 | | List<DatasetReference> array = new List<DatasetReference>(); |
| 0 | 61 | | foreach (var item in property.Value.EnumerateArray()) |
| | 62 | | { |
| 0 | 63 | | array.Add(DatasetReference.DeserializeDatasetReference(item)); |
| | 64 | | } |
| 0 | 65 | | datasets = array; |
| | 66 | | continue; |
| | 67 | | } |
| | 68 | | } |
| 0 | 69 | | return new CustomActivityReferenceObject(Optional.ToList(linkedServices), Optional.ToList(datasets)); |
| | 70 | | } |
| | 71 | | } |
| | 72 | | } |