| | 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 TriggerPipelineReference : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(PipelineReference)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("pipelineReference"); |
| 0 | 22 | | writer.WriteObjectValue(PipelineReference); |
| | 23 | | } |
| 0 | 24 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("parameters"); |
| 0 | 27 | | writer.WriteStartObject(); |
| 0 | 28 | | foreach (var item in Parameters) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName(item.Key); |
| 0 | 31 | | writer.WriteObjectValue(item.Value); |
| | 32 | | } |
| 0 | 33 | | writer.WriteEndObject(); |
| | 34 | | } |
| 0 | 35 | | writer.WriteEndObject(); |
| 0 | 36 | | } |
| | 37 | |
|
| | 38 | | internal static TriggerPipelineReference DeserializeTriggerPipelineReference(JsonElement element) |
| | 39 | | { |
| 0 | 40 | | Optional<PipelineReference> pipelineReference = default; |
| 0 | 41 | | Optional<IDictionary<string, object>> parameters = default; |
| 0 | 42 | | foreach (var property in element.EnumerateObject()) |
| | 43 | | { |
| 0 | 44 | | if (property.NameEquals("pipelineReference")) |
| | 45 | | { |
| 0 | 46 | | pipelineReference = PipelineReference.DeserializePipelineReference(property.Value); |
| 0 | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | if (property.NameEquals("parameters")) |
| | 50 | | { |
| 0 | 51 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 52 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 53 | | { |
| 0 | 54 | | dictionary.Add(property0.Name, property0.Value.GetObject()); |
| | 55 | | } |
| 0 | 56 | | parameters = dictionary; |
| | 57 | | continue; |
| | 58 | | } |
| | 59 | | } |
| 0 | 60 | | return new TriggerPipelineReference(pipelineReference.Value, Optional.ToDictionary(parameters)); |
| | 61 | | } |
| | 62 | | } |
| | 63 | | } |