| | 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 SsisLogLocation : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("logPath"); |
| 0 | 19 | | writer.WriteObjectValue(LogPath); |
| 0 | 20 | | writer.WritePropertyName("type"); |
| 0 | 21 | | writer.WriteStringValue(Type.ToString()); |
| 0 | 22 | | writer.WritePropertyName("typeProperties"); |
| 0 | 23 | | writer.WriteStartObject(); |
| 0 | 24 | | if (Optional.IsDefined(AccessCredential)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("accessCredential"); |
| 0 | 27 | | writer.WriteObjectValue(AccessCredential); |
| | 28 | | } |
| 0 | 29 | | if (Optional.IsDefined(LogRefreshInterval)) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("logRefreshInterval"); |
| 0 | 32 | | writer.WriteObjectValue(LogRefreshInterval); |
| | 33 | | } |
| 0 | 34 | | writer.WriteEndObject(); |
| 0 | 35 | | writer.WriteEndObject(); |
| 0 | 36 | | } |
| | 37 | |
|
| | 38 | | internal static SsisLogLocation DeserializeSsisLogLocation(JsonElement element) |
| | 39 | | { |
| 0 | 40 | | object logPath = default; |
| 0 | 41 | | SsisLogLocationType type = default; |
| 0 | 42 | | Optional<SsisAccessCredential> accessCredential = default; |
| 0 | 43 | | Optional<object> logRefreshInterval = default; |
| 0 | 44 | | foreach (var property in element.EnumerateObject()) |
| | 45 | | { |
| 0 | 46 | | if (property.NameEquals("logPath")) |
| | 47 | | { |
| 0 | 48 | | logPath = property.Value.GetObject(); |
| 0 | 49 | | continue; |
| | 50 | | } |
| 0 | 51 | | if (property.NameEquals("type")) |
| | 52 | | { |
| 0 | 53 | | type = new SsisLogLocationType(property.Value.GetString()); |
| 0 | 54 | | continue; |
| | 55 | | } |
| 0 | 56 | | if (property.NameEquals("typeProperties")) |
| | 57 | | { |
| 0 | 58 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 59 | | { |
| 0 | 60 | | if (property0.NameEquals("accessCredential")) |
| | 61 | | { |
| 0 | 62 | | accessCredential = SsisAccessCredential.DeserializeSsisAccessCredential(property0.Value); |
| 0 | 63 | | continue; |
| | 64 | | } |
| 0 | 65 | | if (property0.NameEquals("logRefreshInterval")) |
| | 66 | | { |
| 0 | 67 | | logRefreshInterval = property0.Value.GetObject(); |
| | 68 | | continue; |
| | 69 | | } |
| | 70 | | } |
| | 71 | | continue; |
| | 72 | | } |
| | 73 | | } |
| 0 | 74 | | return new SsisLogLocation(logPath, type, accessCredential.Value, logRefreshInterval.Value); |
| | 75 | | } |
| | 76 | | } |
| | 77 | | } |