| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.Analytics.Synapse.Artifacts.Models |
| | 12 | | { |
| | 13 | | public partial class WebLinkedServiceTypeProperties : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("url"); |
| 0 | 19 | | writer.WriteObjectValue(Url); |
| 0 | 20 | | writer.WritePropertyName("authenticationType"); |
| 0 | 21 | | writer.WriteStringValue(AuthenticationType.ToString()); |
| 0 | 22 | | writer.WriteEndObject(); |
| 0 | 23 | | } |
| | 24 | |
|
| | 25 | | internal static WebLinkedServiceTypeProperties DeserializeWebLinkedServiceTypeProperties(JsonElement element) |
| | 26 | | { |
| 0 | 27 | | if (element.TryGetProperty("authenticationType", out JsonElement discriminator)) |
| | 28 | | { |
| 0 | 29 | | switch (discriminator.GetString()) |
| | 30 | | { |
| 0 | 31 | | case "Anonymous": return WebAnonymousAuthentication.DeserializeWebAnonymousAuthentication(element); |
| 0 | 32 | | case "Basic": return WebBasicAuthentication.DeserializeWebBasicAuthentication(element); |
| 0 | 33 | | case "ClientCertificate": return WebClientCertificateAuthentication.DeserializeWebClientCertificateA |
| | 34 | | } |
| | 35 | | } |
| 0 | 36 | | object url = default; |
| 0 | 37 | | WebAuthenticationType authenticationType = default; |
| 0 | 38 | | foreach (var property in element.EnumerateObject()) |
| | 39 | | { |
| 0 | 40 | | if (property.NameEquals("url")) |
| | 41 | | { |
| 0 | 42 | | url = property.Value.GetObject(); |
| 0 | 43 | | continue; |
| | 44 | | } |
| 0 | 45 | | if (property.NameEquals("authenticationType")) |
| | 46 | | { |
| 0 | 47 | | authenticationType = new WebAuthenticationType(property.Value.GetString()); |
| | 48 | | continue; |
| | 49 | | } |
| | 50 | | } |
| 0 | 51 | | return new WebLinkedServiceTypeProperties(url, authenticationType); |
| | 52 | | } |
| | 53 | | } |
| | 54 | | } |