| | 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 AzureBlobFSLinkedService : 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("url"); |
| 0 | 55 | | writer.WriteObjectValue(Url); |
| 0 | 56 | | if (Optional.IsDefined(AccountKey)) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("accountKey"); |
| 0 | 59 | | writer.WriteObjectValue(AccountKey); |
| | 60 | | } |
| 0 | 61 | | if (Optional.IsDefined(ServicePrincipalId)) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("servicePrincipalId"); |
| 0 | 64 | | writer.WriteObjectValue(ServicePrincipalId); |
| | 65 | | } |
| 0 | 66 | | if (Optional.IsDefined(ServicePrincipalKey)) |
| | 67 | | { |
| 0 | 68 | | writer.WritePropertyName("servicePrincipalKey"); |
| 0 | 69 | | writer.WriteObjectValue(ServicePrincipalKey); |
| | 70 | | } |
| 0 | 71 | | if (Optional.IsDefined(Tenant)) |
| | 72 | | { |
| 0 | 73 | | writer.WritePropertyName("tenant"); |
| 0 | 74 | | writer.WriteObjectValue(Tenant); |
| | 75 | | } |
| 0 | 76 | | if (Optional.IsDefined(EncryptedCredential)) |
| | 77 | | { |
| 0 | 78 | | writer.WritePropertyName("encryptedCredential"); |
| 0 | 79 | | writer.WriteObjectValue(EncryptedCredential); |
| | 80 | | } |
| 0 | 81 | | writer.WriteEndObject(); |
| 0 | 82 | | foreach (var item in AdditionalProperties) |
| | 83 | | { |
| 0 | 84 | | writer.WritePropertyName(item.Key); |
| 0 | 85 | | writer.WriteObjectValue(item.Value); |
| | 86 | | } |
| 0 | 87 | | writer.WriteEndObject(); |
| 0 | 88 | | } |
| | 89 | |
|
| | 90 | | internal static AzureBlobFSLinkedService DeserializeAzureBlobFSLinkedService(JsonElement element) |
| | 91 | | { |
| 0 | 92 | | string type = default; |
| 0 | 93 | | Optional<IntegrationRuntimeReference> connectVia = default; |
| 0 | 94 | | Optional<string> description = default; |
| 0 | 95 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 96 | | Optional<IList<object>> annotations = default; |
| 0 | 97 | | object url = default; |
| 0 | 98 | | Optional<object> accountKey = default; |
| 0 | 99 | | Optional<object> servicePrincipalId = default; |
| 0 | 100 | | Optional<SecretBase> servicePrincipalKey = default; |
| 0 | 101 | | Optional<object> tenant = default; |
| 0 | 102 | | Optional<object> encryptedCredential = default; |
| 0 | 103 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 104 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 105 | | foreach (var property in element.EnumerateObject()) |
| | 106 | | { |
| 0 | 107 | | if (property.NameEquals("type")) |
| | 108 | | { |
| 0 | 109 | | type = property.Value.GetString(); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("connectVia")) |
| | 113 | | { |
| 0 | 114 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value); |
| 0 | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | if (property.NameEquals("description")) |
| | 118 | | { |
| 0 | 119 | | description = property.Value.GetString(); |
| 0 | 120 | | continue; |
| | 121 | | } |
| 0 | 122 | | if (property.NameEquals("parameters")) |
| | 123 | | { |
| 0 | 124 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 125 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 126 | | { |
| 0 | 127 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 128 | | } |
| 0 | 129 | | parameters = dictionary; |
| 0 | 130 | | continue; |
| | 131 | | } |
| 0 | 132 | | if (property.NameEquals("annotations")) |
| | 133 | | { |
| 0 | 134 | | List<object> array = new List<object>(); |
| 0 | 135 | | foreach (var item in property.Value.EnumerateArray()) |
| | 136 | | { |
| 0 | 137 | | array.Add(item.GetObject()); |
| | 138 | | } |
| 0 | 139 | | annotations = array; |
| 0 | 140 | | continue; |
| | 141 | | } |
| 0 | 142 | | if (property.NameEquals("typeProperties")) |
| | 143 | | { |
| 0 | 144 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 145 | | { |
| 0 | 146 | | if (property0.NameEquals("url")) |
| | 147 | | { |
| 0 | 148 | | url = property0.Value.GetObject(); |
| 0 | 149 | | continue; |
| | 150 | | } |
| 0 | 151 | | if (property0.NameEquals("accountKey")) |
| | 152 | | { |
| 0 | 153 | | accountKey = property0.Value.GetObject(); |
| 0 | 154 | | continue; |
| | 155 | | } |
| 0 | 156 | | if (property0.NameEquals("servicePrincipalId")) |
| | 157 | | { |
| 0 | 158 | | servicePrincipalId = property0.Value.GetObject(); |
| 0 | 159 | | continue; |
| | 160 | | } |
| 0 | 161 | | if (property0.NameEquals("servicePrincipalKey")) |
| | 162 | | { |
| 0 | 163 | | servicePrincipalKey = SecretBase.DeserializeSecretBase(property0.Value); |
| 0 | 164 | | continue; |
| | 165 | | } |
| 0 | 166 | | if (property0.NameEquals("tenant")) |
| | 167 | | { |
| 0 | 168 | | tenant = property0.Value.GetObject(); |
| 0 | 169 | | continue; |
| | 170 | | } |
| 0 | 171 | | if (property0.NameEquals("encryptedCredential")) |
| | 172 | | { |
| 0 | 173 | | encryptedCredential = property0.Value.GetObject(); |
| | 174 | | continue; |
| | 175 | | } |
| | 176 | | } |
| | 177 | | continue; |
| | 178 | | } |
| 0 | 179 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 180 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 181 | | } |
| 0 | 182 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 183 | | return new AzureBlobFSLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(paramet |
| | 184 | | } |
| | 185 | | } |
| | 186 | | } |