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