| | 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 AzureKeyVaultLinkedService : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("type"); |
| 0 | 20 | | writer.WriteStringValue(Type); |
| 0 | 21 | | if (Optional.IsDefined(ConnectVia)) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("connectVia"); |
| 0 | 24 | | writer.WriteObjectValue(ConnectVia); |
| | 25 | | } |
| 0 | 26 | | if (Optional.IsDefined(Description)) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("description"); |
| 0 | 29 | | writer.WriteStringValue(Description); |
| | 30 | | } |
| 0 | 31 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("parameters"); |
| 0 | 34 | | writer.WriteStartObject(); |
| 0 | 35 | | foreach (var item in Parameters) |
| | 36 | | { |
| 0 | 37 | | writer.WritePropertyName(item.Key); |
| 0 | 38 | | writer.WriteObjectValue(item.Value); |
| | 39 | | } |
| 0 | 40 | | writer.WriteEndObject(); |
| | 41 | | } |
| 0 | 42 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 43 | | { |
| 0 | 44 | | writer.WritePropertyName("annotations"); |
| 0 | 45 | | writer.WriteStartArray(); |
| 0 | 46 | | foreach (var item in Annotations) |
| | 47 | | { |
| 0 | 48 | | writer.WriteObjectValue(item); |
| | 49 | | } |
| 0 | 50 | | writer.WriteEndArray(); |
| | 51 | | } |
| 0 | 52 | | writer.WritePropertyName("typeProperties"); |
| 0 | 53 | | writer.WriteStartObject(); |
| 0 | 54 | | writer.WritePropertyName("baseUrl"); |
| 0 | 55 | | writer.WriteObjectValue(BaseUrl); |
| 0 | 56 | | writer.WriteEndObject(); |
| 0 | 57 | | foreach (var item in AdditionalProperties) |
| | 58 | | { |
| 0 | 59 | | writer.WritePropertyName(item.Key); |
| 0 | 60 | | writer.WriteObjectValue(item.Value); |
| | 61 | | } |
| 0 | 62 | | writer.WriteEndObject(); |
| 0 | 63 | | } |
| | 64 | |
|
| | 65 | | internal static AzureKeyVaultLinkedService DeserializeAzureKeyVaultLinkedService(JsonElement element) |
| | 66 | | { |
| 0 | 67 | | string type = default; |
| 0 | 68 | | Optional<IntegrationRuntimeReference> connectVia = default; |
| 0 | 69 | | Optional<string> description = default; |
| 0 | 70 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 71 | | Optional<IList<object>> annotations = default; |
| 0 | 72 | | object baseUrl = default; |
| 0 | 73 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 74 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 75 | | foreach (var property in element.EnumerateObject()) |
| | 76 | | { |
| 0 | 77 | | if (property.NameEquals("type")) |
| | 78 | | { |
| 0 | 79 | | type = property.Value.GetString(); |
| 0 | 80 | | continue; |
| | 81 | | } |
| 0 | 82 | | if (property.NameEquals("connectVia")) |
| | 83 | | { |
| 0 | 84 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value); |
| 0 | 85 | | continue; |
| | 86 | | } |
| 0 | 87 | | if (property.NameEquals("description")) |
| | 88 | | { |
| 0 | 89 | | description = property.Value.GetString(); |
| 0 | 90 | | continue; |
| | 91 | | } |
| 0 | 92 | | if (property.NameEquals("parameters")) |
| | 93 | | { |
| 0 | 94 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 95 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 96 | | { |
| 0 | 97 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 98 | | } |
| 0 | 99 | | parameters = dictionary; |
| 0 | 100 | | continue; |
| | 101 | | } |
| 0 | 102 | | if (property.NameEquals("annotations")) |
| | 103 | | { |
| 0 | 104 | | List<object> array = new List<object>(); |
| 0 | 105 | | foreach (var item in property.Value.EnumerateArray()) |
| | 106 | | { |
| 0 | 107 | | array.Add(item.GetObject()); |
| | 108 | | } |
| 0 | 109 | | annotations = array; |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("typeProperties")) |
| | 113 | | { |
| 0 | 114 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 115 | | { |
| 0 | 116 | | if (property0.NameEquals("baseUrl")) |
| | 117 | | { |
| 0 | 118 | | baseUrl = property0.Value.GetObject(); |
| | 119 | | continue; |
| | 120 | | } |
| | 121 | | } |
| | 122 | | continue; |
| | 123 | | } |
| 0 | 124 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 125 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 126 | | } |
| 0 | 127 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 128 | | return new AzureKeyVaultLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(param |
| | 129 | | } |
| | 130 | | } |
| | 131 | | } |