| | 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 StoredProcedureParameter : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Optional.IsDefined(Value)) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("value"); |
| 0 | 21 | | writer.WriteObjectValue(Value); |
| | 22 | | } |
| 0 | 23 | | if (Optional.IsDefined(Type)) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("type"); |
| 0 | 26 | | writer.WriteStringValue(Type.Value.ToString()); |
| | 27 | | } |
| 0 | 28 | | writer.WriteEndObject(); |
| 0 | 29 | | } |
| | 30 | |
|
| | 31 | | internal static StoredProcedureParameter DeserializeStoredProcedureParameter(JsonElement element) |
| | 32 | | { |
| 0 | 33 | | Optional<object> value = default; |
| 0 | 34 | | Optional<StoredProcedureParameterType> type = default; |
| 0 | 35 | | foreach (var property in element.EnumerateObject()) |
| | 36 | | { |
| 0 | 37 | | if (property.NameEquals("value")) |
| | 38 | | { |
| 0 | 39 | | value = property.Value.GetObject(); |
| 0 | 40 | | continue; |
| | 41 | | } |
| 0 | 42 | | if (property.NameEquals("type")) |
| | 43 | | { |
| 0 | 44 | | type = new StoredProcedureParameterType(property.Value.GetString()); |
| | 45 | | continue; |
| | 46 | | } |
| | 47 | | } |
| 0 | 48 | | return new StoredProcedureParameter(value.Value, Optional.ToNullable(type)); |
| | 49 | | } |
| | 50 | | } |
| | 51 | | } |