| | 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 MultiplePipelineTrigger : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsCollectionDefined(Pipelines)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("pipelines"); |
| 0 | 22 | | writer.WriteStartArray(); |
| 0 | 23 | | foreach (var item in Pipelines) |
| | 24 | | { |
| 0 | 25 | | writer.WriteObjectValue(item); |
| | 26 | | } |
| 0 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("type"); |
| 0 | 30 | | writer.WriteStringValue(Type); |
| 0 | 31 | | if (Optional.IsDefined(Description)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("description"); |
| 0 | 34 | | writer.WriteStringValue(Description); |
| | 35 | | } |
| 0 | 36 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("annotations"); |
| 0 | 39 | | writer.WriteStartArray(); |
| 0 | 40 | | foreach (var item in Annotations) |
| | 41 | | { |
| 0 | 42 | | writer.WriteObjectValue(item); |
| | 43 | | } |
| 0 | 44 | | writer.WriteEndArray(); |
| | 45 | | } |
| 0 | 46 | | foreach (var item in AdditionalProperties) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName(item.Key); |
| 0 | 49 | | writer.WriteObjectValue(item.Value); |
| | 50 | | } |
| 0 | 51 | | writer.WriteEndObject(); |
| 0 | 52 | | } |
| | 53 | |
|
| | 54 | | internal static MultiplePipelineTrigger DeserializeMultiplePipelineTrigger(JsonElement element) |
| | 55 | | { |
| 0 | 56 | | Optional<IList<TriggerPipelineReference>> pipelines = default; |
| 0 | 57 | | string type = default; |
| 0 | 58 | | Optional<string> description = default; |
| 0 | 59 | | Optional<TriggerRuntimeState> runtimeState = default; |
| 0 | 60 | | Optional<IList<object>> annotations = default; |
| 0 | 61 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 62 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 63 | | foreach (var property in element.EnumerateObject()) |
| | 64 | | { |
| 0 | 65 | | if (property.NameEquals("pipelines")) |
| | 66 | | { |
| 0 | 67 | | List<TriggerPipelineReference> array = new List<TriggerPipelineReference>(); |
| 0 | 68 | | foreach (var item in property.Value.EnumerateArray()) |
| | 69 | | { |
| 0 | 70 | | array.Add(TriggerPipelineReference.DeserializeTriggerPipelineReference(item)); |
| | 71 | | } |
| 0 | 72 | | pipelines = array; |
| 0 | 73 | | continue; |
| | 74 | | } |
| 0 | 75 | | if (property.NameEquals("type")) |
| | 76 | | { |
| 0 | 77 | | type = property.Value.GetString(); |
| 0 | 78 | | continue; |
| | 79 | | } |
| 0 | 80 | | if (property.NameEquals("description")) |
| | 81 | | { |
| 0 | 82 | | description = property.Value.GetString(); |
| 0 | 83 | | continue; |
| | 84 | | } |
| 0 | 85 | | if (property.NameEquals("runtimeState")) |
| | 86 | | { |
| 0 | 87 | | runtimeState = new TriggerRuntimeState(property.Value.GetString()); |
| 0 | 88 | | continue; |
| | 89 | | } |
| 0 | 90 | | if (property.NameEquals("annotations")) |
| | 91 | | { |
| 0 | 92 | | List<object> array = new List<object>(); |
| 0 | 93 | | foreach (var item in property.Value.EnumerateArray()) |
| | 94 | | { |
| 0 | 95 | | array.Add(item.GetObject()); |
| | 96 | | } |
| 0 | 97 | | annotations = array; |
| 0 | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 101 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 102 | | } |
| 0 | 103 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 104 | | return new MultiplePipelineTrigger(type, description.Value, Optional.ToNullable(runtimeState), Optional.ToLi |
| | 105 | | } |
| | 106 | | } |
| | 107 | | } |