Add IIUtf8JsonSerializable interface (#363)
This commit is contained in:
Родитель
628dab4815
Коммит
214d235fdb
|
@ -74,9 +74,9 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
{ typeof(Uri), (n, f) => null } //TODO: Figure out how to get the Uri type here, so we can do 'new Uri(GetString())'
|
||||
};
|
||||
|
||||
private static void WriteSerializeClientObject(CodeWriter writer, CodeWriterDelegate name, CSharpType type)
|
||||
private static void WriteSerializeClientObject(CodeWriter writer, CodeWriterDelegate name)
|
||||
{
|
||||
writer.Line($"{type.WithNullable(false)}Serializer.Serialize({name}, writer);");
|
||||
writer.Line($"writer.WriteObjectValue({name});");
|
||||
}
|
||||
|
||||
private static void WriteSerializeClientEnum(CodeWriter writer, CodeWriterDelegate name, bool isNullable, bool isStringBased)
|
||||
|
@ -95,7 +95,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
switch (typeFactory.ResolveReference(type))
|
||||
{
|
||||
case ClientObject _:
|
||||
WriteSerializeClientObject(writer, name, typeFactory.CreateType(type));
|
||||
WriteSerializeClientObject(writer, name);
|
||||
return;
|
||||
case ClientEnum clientEnum:
|
||||
WriteSerializeClientEnum(writer, name, type.IsNullable, clientEnum.IsStringBased);
|
||||
|
@ -165,7 +165,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
|
||||
private static void WriteDeserializeClientObject(CodeWriter writer, CSharpType cSharpType, CodeWriterDelegate name)
|
||||
{
|
||||
writer.Append($"{cSharpType}Serializer.Deserialize({name})");
|
||||
writer.Append($"{cSharpType}.Deserialize{cSharpType.Name}({name})");
|
||||
}
|
||||
|
||||
private static void WriteDeserializeClientEnum(CodeWriter writer, CSharpType cSharpType, CodeWriterDelegate name, bool isStringBased)
|
||||
|
|
|
@ -8,6 +8,7 @@ using System.Text.Json;
|
|||
using AutoRest.CSharp.V3.ClientModels;
|
||||
using AutoRest.CSharp.V3.Plugins;
|
||||
using AutoRest.CSharp.V3.Utilities;
|
||||
using Azure.Core;
|
||||
|
||||
namespace AutoRest.CSharp.V3.CodeGen
|
||||
{
|
||||
|
@ -72,12 +73,11 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
private void WriteObjectSerialization(CodeWriter writer, ClientObject model)
|
||||
{
|
||||
var cs = _typeFactory.CreateType(model);
|
||||
var serializerName = model.Name + "Serializer";
|
||||
using (writer.Namespace(cs.Namespace))
|
||||
{
|
||||
using (writer.Class(null, "partial", serializerName))
|
||||
using (writer.Class(null, "partial", model.Name, writer.Type(typeof(IUtf8JsonSerializable))))
|
||||
{
|
||||
WriteSerialize(writer, model, cs);
|
||||
WriteSerialize(writer, model);
|
||||
|
||||
WriteDeserialize(writer, model, cs);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
private void WriteDeserialize(CodeWriter writer, ClientObject model, CSharpType cs)
|
||||
{
|
||||
var typeText = writer.Type(cs);
|
||||
using (writer.Method("internal static", typeText, "Deserialize", writer.Pair(typeof(JsonElement), "element")))
|
||||
using (writer.Method("internal static", typeText, "Deserialize"+cs.Name, writer.Pair(typeof(JsonElement), "element")))
|
||||
{
|
||||
if (model.Discriminator?.HasDescendants == true)
|
||||
{
|
||||
|
@ -156,32 +156,11 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
}
|
||||
}
|
||||
|
||||
private void WriteSerialize(CodeWriter writer, ClientObject model, CSharpType cs)
|
||||
private void WriteSerialize(CodeWriter writer, ClientObject model)
|
||||
{
|
||||
using (writer.Method("internal static", "void", "Serialize", writer.Pair(cs, "model"), writer.Pair(typeof(Utf8JsonWriter), "writer")))
|
||||
writer.Append($"void {typeof(IUtf8JsonSerializable)}.{nameof(IUtf8JsonSerializable.Write)}({typeof(Utf8JsonWriter)} writer)");
|
||||
using (writer.Scope())
|
||||
{
|
||||
if (model.Discriminator?.HasDirectDescendants == true)
|
||||
{
|
||||
writer.Line($"switch (model)");
|
||||
using (writer.Scope())
|
||||
{
|
||||
foreach (var implementation in model.Discriminator.Implementations)
|
||||
{
|
||||
if (!implementation.IsDirect)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var type = _typeFactory.CreateType(implementation.Type);
|
||||
var localName = type.Name.ToVariableName();
|
||||
writer.Line($"case {type} {localName}:");
|
||||
writer.ToSerializeCall(implementation.Type, SerializationFormat.Default, _typeFactory,
|
||||
w => w.AppendRaw(localName));
|
||||
writer.Line($"return;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writer.Line($"writer.WriteStartObject();");
|
||||
|
||||
DictionaryTypeReference? implementsDictionary = null;
|
||||
|
@ -190,13 +169,13 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
{
|
||||
foreach (var property in currentType.Properties)
|
||||
{
|
||||
using (property.Type.IsNullable ? writer.If($"model.{property.Name} != null") : default)
|
||||
using (property.Type.IsNullable ? writer.If($"{property.Name} != null") : default)
|
||||
{
|
||||
writer.ToSerializeCall(
|
||||
property.Type,
|
||||
property.Format,
|
||||
_typeFactory,
|
||||
w => w.Append($"model.{property.Name}"),
|
||||
w => w.Append($"{property.Name}"),
|
||||
w => w.Literal(property.SerializedName));
|
||||
}
|
||||
|
||||
|
@ -206,7 +185,7 @@ namespace AutoRest.CSharp.V3.CodeGen
|
|||
|
||||
if (implementsDictionary != null)
|
||||
{
|
||||
using (writer.ForEach("var item in model"))
|
||||
using (writer.ForEach("var item in this"))
|
||||
{
|
||||
writer.ToSerializeCall(implementsDictionary.ValueType, SerializationFormat.Default, _typeFactory, w => w.Append($"item.Value"), w => w.Append($"item.Key"));
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Azure.Core
|
||||
{
|
||||
internal interface IUtf8JsonSerializable
|
||||
{
|
||||
void Write(Utf8JsonWriter writer);
|
||||
}
|
||||
}
|
|
@ -15,6 +15,10 @@ namespace Azure.Core
|
|||
public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) =>
|
||||
writer.WriteStringValue(TypeFormatters.ToString(value, format));
|
||||
|
||||
public static void WriteObjectValue(this Utf8JsonWriter writer, IUtf8JsonSerializable value)
|
||||
{
|
||||
value.Write(writer);
|
||||
}
|
||||
public static void WriteObjectValue(this Utf8JsonWriter writer, object value)
|
||||
{
|
||||
switch (value)
|
||||
|
@ -22,6 +26,12 @@ namespace Azure.Core
|
|||
case null:
|
||||
writer.WriteNullValue();
|
||||
break;
|
||||
case IUtf8JsonSerializable serializable:
|
||||
writer.WriteObjectValue(serializable);
|
||||
break;
|
||||
case byte[] bytes:
|
||||
writer.WriteStringValue(Convert.ToBase64String(bytes));
|
||||
break;
|
||||
case int i:
|
||||
writer.WriteNumberValue(i);
|
||||
break;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using additionalProperties;
|
||||
using additionalProperties.Models.V100;
|
||||
|
@ -129,7 +130,6 @@ namespace AutoRest.TestServer.Tests
|
|||
});
|
||||
|
||||
[Test]
|
||||
[Ignore("https://github.com/Azure/autorest.csharp/issues/360")]
|
||||
public Task AdditionalPropertiesTypeObject() => Test(async (host, pipeline) =>
|
||||
{
|
||||
PetAPObject petApObject = new PetAPObject()
|
||||
|
@ -144,8 +144,32 @@ namespace AutoRest.TestServer.Tests
|
|||
{"color", "Red"}
|
||||
};
|
||||
|
||||
await PetsOperations.CreateAPObjectAsync(ClientDiagnostics, pipeline, petApObject, host);
|
||||
PetAPObject outerApObject = new PetAPObject()
|
||||
{
|
||||
Id = 2,
|
||||
Name = "Hira"
|
||||
};
|
||||
outerApObject["siblings"] = new object[]
|
||||
{
|
||||
petApObject
|
||||
};
|
||||
outerApObject["picture"] = new byte[] { 255, 255, 255, 255, 254 };
|
||||
|
||||
var response = await PetsOperations.CreateAPObjectAsync(ClientDiagnostics, pipeline, outerApObject, host);
|
||||
|
||||
var value = response.Value;
|
||||
|
||||
Assert.AreEqual(2, value.Id);
|
||||
Assert.AreEqual("Hira", value.Name);
|
||||
Assert.AreEqual(true, value.Status);
|
||||
|
||||
var siblings = (IEnumerable<object>)value["siblings"];
|
||||
var sibling = (IDictionary<string, object>)siblings.Single();
|
||||
|
||||
Assert.AreEqual(1, sibling["id"]);
|
||||
Assert.AreEqual("Puppy", sibling["name"]);
|
||||
Assert.AreEqual("2017-12-13T02:29:51Z", sibling["birthdate"]);
|
||||
Assert.AreEqual("Red", ((Dictionary<string, object>)sibling["complexProperty"])["color"]);
|
||||
});
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -6,36 +6,36 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class CatAPTrueSerializer
|
||||
public partial class CatAPTrue : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(CatAPTrue model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Friendly != null)
|
||||
if (Friendly != null)
|
||||
{
|
||||
writer.WritePropertyName("friendly");
|
||||
writer.WriteBooleanValue(model.Friendly.Value);
|
||||
writer.WriteBooleanValue(Friendly.Value);
|
||||
}
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteObjectValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static CatAPTrue Deserialize(JsonElement element)
|
||||
internal static CatAPTrue DeserializeCatAPTrue(JsonElement element)
|
||||
{
|
||||
var result = new CatAPTrue();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,28 +7,28 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class PetAPInPropertiesSerializer
|
||||
public partial class PetAPInProperties : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(PetAPInProperties model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
if (model.AdditionalProperties != null)
|
||||
if (AdditionalProperties != null)
|
||||
{
|
||||
writer.WritePropertyName("additionalProperties");
|
||||
writer.WriteStartObject();
|
||||
foreach (var item in model.AdditionalProperties)
|
||||
foreach (var item in AdditionalProperties)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteNumberValue(item.Value);
|
||||
|
@ -37,7 +37,7 @@ namespace additionalProperties.Models.V100
|
|||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static PetAPInProperties Deserialize(JsonElement element)
|
||||
internal static PetAPInProperties DeserializePetAPInProperties(JsonElement element)
|
||||
{
|
||||
var result = new PetAPInProperties();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,44 +7,44 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class PetAPInPropertiesWithAPStringSerializer
|
||||
public partial class PetAPInPropertiesWithAPString : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(PetAPInPropertiesWithAPString model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
writer.WritePropertyName("@odata.location");
|
||||
writer.WriteStringValue(model.OdataLocation);
|
||||
if (model.AdditionalProperties != null)
|
||||
writer.WriteStringValue(OdataLocation);
|
||||
if (AdditionalProperties != null)
|
||||
{
|
||||
writer.WritePropertyName("additionalProperties");
|
||||
writer.WriteStartObject();
|
||||
foreach (var item in model.AdditionalProperties)
|
||||
foreach (var item in AdditionalProperties)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteNumberValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteStringValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static PetAPInPropertiesWithAPString Deserialize(JsonElement element)
|
||||
internal static PetAPInPropertiesWithAPString DeserializePetAPInPropertiesWithAPString(JsonElement element)
|
||||
{
|
||||
var result = new PetAPInPropertiesWithAPString();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,31 +6,31 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class PetAPObjectSerializer
|
||||
public partial class PetAPObject : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(PetAPObject model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteObjectValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static PetAPObject Deserialize(JsonElement element)
|
||||
internal static PetAPObject DeserializePetAPObject(JsonElement element)
|
||||
{
|
||||
var result = new PetAPObject();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,31 +6,31 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class PetAPStringSerializer
|
||||
public partial class PetAPString : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(PetAPString model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteStringValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static PetAPString Deserialize(JsonElement element)
|
||||
internal static PetAPString DeserializePetAPString(JsonElement element)
|
||||
{
|
||||
var result = new PetAPString();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,31 +6,31 @@ using Azure.Core;
|
|||
|
||||
namespace additionalProperties.Models.V100
|
||||
{
|
||||
public partial class PetAPTrueSerializer
|
||||
public partial class PetAPTrue : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(PetAPTrue model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id);
|
||||
if (model.Name != null)
|
||||
writer.WriteNumberValue(Id);
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteBooleanValue(model.Status.Value);
|
||||
writer.WriteBooleanValue(Status.Value);
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteObjectValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static PetAPTrue Deserialize(JsonElement element)
|
||||
internal static PetAPTrue DeserializePetAPTrue(JsonElement element)
|
||||
{
|
||||
var result = new PetAPTrue();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetAPTrueSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -44,7 +44,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetAPTrueSerializer.Deserialize(document.RootElement);
|
||||
var value = PetAPTrue.DeserializePetAPTrue(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -79,7 +79,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
CatAPTrueSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -87,7 +87,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = CatAPTrueSerializer.Deserialize(document.RootElement);
|
||||
var value = CatAPTrue.DeserializeCatAPTrue(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -122,7 +122,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetAPObjectSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -130,7 +130,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetAPObjectSerializer.Deserialize(document.RootElement);
|
||||
var value = PetAPObject.DeserializePetAPObject(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -165,7 +165,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetAPStringSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -173,7 +173,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetAPStringSerializer.Deserialize(document.RootElement);
|
||||
var value = PetAPString.DeserializePetAPString(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -208,7 +208,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetAPInPropertiesSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -216,7 +216,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetAPInPropertiesSerializer.Deserialize(document.RootElement);
|
||||
var value = PetAPInProperties.DeserializePetAPInProperties(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -251,7 +251,7 @@ namespace additionalProperties
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetAPInPropertiesWithAPStringSerializer.Serialize(createParameters, writer);
|
||||
writer.WriteObjectValue(createParameters);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -259,7 +259,7 @@ namespace additionalProperties
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetAPInPropertiesWithAPStringSerializer.Deserialize(document.RootElement);
|
||||
var value = PetAPInPropertiesWithAPString.DeserializePetAPInPropertiesWithAPString(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_boolean.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,16 +7,16 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class ArrayWrapperSerializer
|
||||
public partial class ArrayWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(ArrayWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Array != null)
|
||||
if (Array != null)
|
||||
{
|
||||
writer.WritePropertyName("array");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Array)
|
||||
foreach (var item in Array)
|
||||
{
|
||||
writer.WriteStringValue(item);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace body_complex.Models.V20160229
|
|||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static ArrayWrapper Deserialize(JsonElement element)
|
||||
internal static ArrayWrapper DeserializeArrayWrapper(JsonElement element)
|
||||
{
|
||||
var result = new ArrayWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,29 +6,29 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class BasicSerializer
|
||||
public partial class Basic : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Basic model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id.Value);
|
||||
writer.WriteNumberValue(Id.Value);
|
||||
}
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.Color != null)
|
||||
if (Color != null)
|
||||
{
|
||||
writer.WritePropertyName("color");
|
||||
writer.WriteStringValue(model.Color.ToString());
|
||||
writer.WriteStringValue(Color.ToString());
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Basic Deserialize(JsonElement element)
|
||||
internal static Basic DeserializeBasic(JsonElement element)
|
||||
{
|
||||
var result = new Basic();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class BooleanWrapperSerializer
|
||||
public partial class BooleanWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(BooleanWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.FieldTrue != null)
|
||||
if (FieldTrue != null)
|
||||
{
|
||||
writer.WritePropertyName("field_true");
|
||||
writer.WriteBooleanValue(model.FieldTrue.Value);
|
||||
writer.WriteBooleanValue(FieldTrue.Value);
|
||||
}
|
||||
if (model.FieldFalse != null)
|
||||
if (FieldFalse != null)
|
||||
{
|
||||
writer.WritePropertyName("field_false");
|
||||
writer.WriteBooleanValue(model.FieldFalse.Value);
|
||||
writer.WriteBooleanValue(FieldFalse.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static BooleanWrapper Deserialize(JsonElement element)
|
||||
internal static BooleanWrapper DeserializeBooleanWrapper(JsonElement element)
|
||||
{
|
||||
var result = new BooleanWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,19 +6,19 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class ByteWrapperSerializer
|
||||
public partial class ByteWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(ByteWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteBase64StringValue(model.Field);
|
||||
writer.WriteBase64StringValue(Field);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static ByteWrapper Deserialize(JsonElement element)
|
||||
internal static ByteWrapper DeserializeByteWrapper(JsonElement element)
|
||||
{
|
||||
var result = new ByteWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,39 +7,39 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class CatSerializer
|
||||
public partial class Cat : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Cat model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Color != null)
|
||||
if (Color != null)
|
||||
{
|
||||
writer.WritePropertyName("color");
|
||||
writer.WriteStringValue(model.Color);
|
||||
writer.WriteStringValue(Color);
|
||||
}
|
||||
if (model.Hates != null)
|
||||
if (Hates != null)
|
||||
{
|
||||
writer.WritePropertyName("hates");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Hates)
|
||||
foreach (var item in Hates)
|
||||
{
|
||||
DogSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id.Value);
|
||||
writer.WriteNumberValue(Id.Value);
|
||||
}
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Cat Deserialize(JsonElement element)
|
||||
internal static Cat DeserializeCat(JsonElement element)
|
||||
{
|
||||
var result = new Cat();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -62,7 +62,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Hates = new List<Dog>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Hates.Add(DogSerializer.Deserialize(item));
|
||||
result.Hates.Add(Dog.DeserializeDog(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -7,40 +7,40 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class CookiecuttersharkSerializer
|
||||
public partial class Cookiecuttershark : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Cookiecuttershark model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Age != null)
|
||||
if (Age != null)
|
||||
{
|
||||
writer.WritePropertyName("age");
|
||||
writer.WriteNumberValue(model.Age.Value);
|
||||
writer.WriteNumberValue(Age.Value);
|
||||
}
|
||||
writer.WritePropertyName("birthday");
|
||||
writer.WriteStringValue(model.Birthday, "S");
|
||||
writer.WriteStringValue(Birthday, "S");
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Cookiecuttershark Deserialize(JsonElement element)
|
||||
internal static Cookiecuttershark DeserializeCookiecuttershark(JsonElement element)
|
||||
{
|
||||
var result = new Cookiecuttershark();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -87,7 +87,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DateWrapperSerializer
|
||||
public partial class DateWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DateWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteStringValue(model.Field.Value, "D");
|
||||
writer.WriteStringValue(Field.Value, "D");
|
||||
}
|
||||
if (model.Leap != null)
|
||||
if (Leap != null)
|
||||
{
|
||||
writer.WritePropertyName("leap");
|
||||
writer.WriteStringValue(model.Leap.Value, "D");
|
||||
writer.WriteStringValue(Leap.Value, "D");
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DateWrapper Deserialize(JsonElement element)
|
||||
internal static DateWrapper DeserializeDateWrapper(JsonElement element)
|
||||
{
|
||||
var result = new DateWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DatetimeWrapperSerializer
|
||||
public partial class DatetimeWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DatetimeWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteStringValue(model.Field.Value, "S");
|
||||
writer.WriteStringValue(Field.Value, "S");
|
||||
}
|
||||
if (model.Now != null)
|
||||
if (Now != null)
|
||||
{
|
||||
writer.WritePropertyName("now");
|
||||
writer.WriteStringValue(model.Now.Value, "S");
|
||||
writer.WriteStringValue(Now.Value, "S");
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DatetimeWrapper Deserialize(JsonElement element)
|
||||
internal static DatetimeWrapper DeserializeDatetimeWrapper(JsonElement element)
|
||||
{
|
||||
var result = new DatetimeWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class Datetimerfc1123WrapperSerializer
|
||||
public partial class Datetimerfc1123Wrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Datetimerfc1123Wrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteStringValue(model.Field.Value, "R");
|
||||
writer.WriteStringValue(Field.Value, "R");
|
||||
}
|
||||
if (model.Now != null)
|
||||
if (Now != null)
|
||||
{
|
||||
writer.WritePropertyName("now");
|
||||
writer.WriteStringValue(model.Now.Value, "R");
|
||||
writer.WriteStringValue(Now.Value, "R");
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Datetimerfc1123Wrapper Deserialize(JsonElement element)
|
||||
internal static Datetimerfc1123Wrapper DeserializeDatetimerfc1123Wrapper(JsonElement element)
|
||||
{
|
||||
var result = new Datetimerfc1123Wrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,16 +7,16 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DictionaryWrapperSerializer
|
||||
public partial class DictionaryWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DictionaryWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.DefaultProgram != null)
|
||||
if (DefaultProgram != null)
|
||||
{
|
||||
writer.WritePropertyName("defaultProgram");
|
||||
writer.WriteStartObject();
|
||||
foreach (var item in model.DefaultProgram)
|
||||
foreach (var item in DefaultProgram)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteStringValue(item.Value);
|
||||
|
@ -25,7 +25,7 @@ namespace body_complex.Models.V20160229
|
|||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DictionaryWrapper Deserialize(JsonElement element)
|
||||
internal static DictionaryWrapper DeserializeDictionaryWrapper(JsonElement element)
|
||||
{
|
||||
var result = new DictionaryWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,29 +6,29 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DogSerializer
|
||||
public partial class Dog : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Dog model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Food != null)
|
||||
if (Food != null)
|
||||
{
|
||||
writer.WritePropertyName("food");
|
||||
writer.WriteStringValue(model.Food);
|
||||
writer.WriteStringValue(Food);
|
||||
}
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id.Value);
|
||||
writer.WriteNumberValue(Id.Value);
|
||||
}
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Dog Deserialize(JsonElement element)
|
||||
internal static Dog DeserializeDog(JsonElement element)
|
||||
{
|
||||
var result = new Dog();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,33 +6,27 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DotFishSerializer
|
||||
public partial class DotFish : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DotFish model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
switch (model)
|
||||
{
|
||||
case DotSalmon dotSalmon:
|
||||
DotSalmonSerializer.Serialize(dotSalmon, writer);
|
||||
return;
|
||||
}
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("fish.type");
|
||||
writer.WriteStringValue(model.FishType);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(FishType);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DotFish Deserialize(JsonElement element)
|
||||
internal static DotFish DeserializeDotFish(JsonElement element)
|
||||
{
|
||||
if (element.TryGetProperty("fish.type", out JsonElement discriminator))
|
||||
{
|
||||
switch (discriminator.GetString())
|
||||
{
|
||||
case "DotSalmon": return DotSalmonSerializer.Deserialize(element);
|
||||
case "DotSalmon": return DotSalmon.DeserializeDotSalmon(element);
|
||||
}
|
||||
}
|
||||
var result = new DotFish();
|
||||
|
|
|
@ -7,44 +7,44 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DotFishMarketSerializer
|
||||
public partial class DotFishMarket : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DotFishMarket model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.SampleSalmon != null)
|
||||
if (SampleSalmon != null)
|
||||
{
|
||||
writer.WritePropertyName("sampleSalmon");
|
||||
DotSalmonSerializer.Serialize(model.SampleSalmon, writer);
|
||||
writer.WriteObjectValue(SampleSalmon);
|
||||
}
|
||||
if (model.Salmons != null)
|
||||
if (Salmons != null)
|
||||
{
|
||||
writer.WritePropertyName("salmons");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Salmons)
|
||||
foreach (var item in Salmons)
|
||||
{
|
||||
DotSalmonSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
if (model.SampleFish != null)
|
||||
if (SampleFish != null)
|
||||
{
|
||||
writer.WritePropertyName("sampleFish");
|
||||
DotFishSerializer.Serialize(model.SampleFish, writer);
|
||||
writer.WriteObjectValue(SampleFish);
|
||||
}
|
||||
if (model.Fishes != null)
|
||||
if (Fishes != null)
|
||||
{
|
||||
writer.WritePropertyName("fishes");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Fishes)
|
||||
foreach (var item in Fishes)
|
||||
{
|
||||
DotFishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DotFishMarket Deserialize(JsonElement element)
|
||||
internal static DotFishMarket DeserializeDotFishMarket(JsonElement element)
|
||||
{
|
||||
var result = new DotFishMarket();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -55,7 +55,7 @@ namespace body_complex.Models.V20160229
|
|||
{
|
||||
continue;
|
||||
}
|
||||
result.SampleSalmon = DotSalmonSerializer.Deserialize(property.Value);
|
||||
result.SampleSalmon = DotSalmon.DeserializeDotSalmon(property.Value);
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("salmons"))
|
||||
|
@ -67,7 +67,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Salmons = new List<DotSalmon>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Salmons.Add(DotSalmonSerializer.Deserialize(item));
|
||||
result.Salmons.Add(DotSalmon.DeserializeDotSalmon(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace body_complex.Models.V20160229
|
|||
{
|
||||
continue;
|
||||
}
|
||||
result.SampleFish = DotFishSerializer.Deserialize(property.Value);
|
||||
result.SampleFish = DotFish.DeserializeDotFish(property.Value);
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("fishes"))
|
||||
|
@ -89,7 +89,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Fishes = new List<DotFish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Fishes.Add(DotFishSerializer.Deserialize(item));
|
||||
result.Fishes.Add(DotFish.DeserializeDotFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -6,31 +6,31 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DotSalmonSerializer
|
||||
public partial class DotSalmon : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DotSalmon model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Location != null)
|
||||
if (Location != null)
|
||||
{
|
||||
writer.WritePropertyName("location");
|
||||
writer.WriteStringValue(model.Location);
|
||||
writer.WriteStringValue(Location);
|
||||
}
|
||||
if (model.Iswild != null)
|
||||
if (Iswild != null)
|
||||
{
|
||||
writer.WritePropertyName("iswild");
|
||||
writer.WriteBooleanValue(model.Iswild.Value);
|
||||
writer.WriteBooleanValue(Iswild.Value);
|
||||
}
|
||||
writer.WritePropertyName("fish.type");
|
||||
writer.WriteStringValue(model.FishType);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(FishType);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DotSalmon Deserialize(JsonElement element)
|
||||
internal static DotSalmon DeserializeDotSalmon(JsonElement element)
|
||||
{
|
||||
var result = new DotSalmon();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DoubleWrapperSerializer
|
||||
public partial class DoubleWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DoubleWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field1 != null)
|
||||
if (Field1 != null)
|
||||
{
|
||||
writer.WritePropertyName("field1");
|
||||
writer.WriteNumberValue(model.Field1.Value);
|
||||
writer.WriteNumberValue(Field1.Value);
|
||||
}
|
||||
if (model.Field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose != null)
|
||||
if (Field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose != null)
|
||||
{
|
||||
writer.WritePropertyName("field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose");
|
||||
writer.WriteNumberValue(model.Field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose.Value);
|
||||
writer.WriteNumberValue(Field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DoubleWrapper Deserialize(JsonElement element)
|
||||
internal static DoubleWrapper DeserializeDoubleWrapper(JsonElement element)
|
||||
{
|
||||
var result = new DoubleWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,19 +6,19 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class DurationWrapperSerializer
|
||||
public partial class DurationWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(DurationWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteStringValue(model.Field.Value, "P");
|
||||
writer.WriteStringValue(Field.Value, "P");
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static DurationWrapper Deserialize(JsonElement element)
|
||||
internal static DurationWrapper DeserializeDurationWrapper(JsonElement element)
|
||||
{
|
||||
var result = new DurationWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,53 +7,44 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class FishSerializer
|
||||
public partial class Fish : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Fish model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
switch (model)
|
||||
{
|
||||
case Salmon salmon:
|
||||
SalmonSerializer.Serialize(salmon, writer);
|
||||
return;
|
||||
case Shark shark:
|
||||
SharkSerializer.Serialize(shark, writer);
|
||||
return;
|
||||
}
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Fish Deserialize(JsonElement element)
|
||||
internal static Fish DeserializeFish(JsonElement element)
|
||||
{
|
||||
if (element.TryGetProperty("fishtype", out JsonElement discriminator))
|
||||
{
|
||||
switch (discriminator.GetString())
|
||||
{
|
||||
case "cookiecuttershark": return CookiecuttersharkSerializer.Deserialize(element);
|
||||
case "goblin": return GoblinsharkSerializer.Deserialize(element);
|
||||
case "salmon": return SalmonSerializer.Deserialize(element);
|
||||
case "sawshark": return SawsharkSerializer.Deserialize(element);
|
||||
case "shark": return SharkSerializer.Deserialize(element);
|
||||
case "smart_salmon": return SmartSalmonSerializer.Deserialize(element);
|
||||
case "cookiecuttershark": return Cookiecuttershark.DeserializeCookiecuttershark(element);
|
||||
case "goblin": return Goblinshark.DeserializeGoblinshark(element);
|
||||
case "salmon": return Salmon.DeserializeSalmon(element);
|
||||
case "sawshark": return Sawshark.DeserializeSawshark(element);
|
||||
case "shark": return Shark.DeserializeShark(element);
|
||||
case "smart_salmon": return SmartSalmon.DeserializeSmartSalmon(element);
|
||||
}
|
||||
}
|
||||
var result = new Fish();
|
||||
|
@ -87,7 +78,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class FloatWrapperSerializer
|
||||
public partial class FloatWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(FloatWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field1 != null)
|
||||
if (Field1 != null)
|
||||
{
|
||||
writer.WritePropertyName("field1");
|
||||
writer.WriteNumberValue(model.Field1.Value);
|
||||
writer.WriteNumberValue(Field1.Value);
|
||||
}
|
||||
if (model.Field2 != null)
|
||||
if (Field2 != null)
|
||||
{
|
||||
writer.WritePropertyName("field2");
|
||||
writer.WriteNumberValue(model.Field2.Value);
|
||||
writer.WriteNumberValue(Field2.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static FloatWrapper Deserialize(JsonElement element)
|
||||
internal static FloatWrapper DeserializeFloatWrapper(JsonElement element)
|
||||
{
|
||||
var result = new FloatWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,50 +7,50 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class GoblinsharkSerializer
|
||||
public partial class Goblinshark : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Goblinshark model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Jawsize != null)
|
||||
if (Jawsize != null)
|
||||
{
|
||||
writer.WritePropertyName("jawsize");
|
||||
writer.WriteNumberValue(model.Jawsize.Value);
|
||||
writer.WriteNumberValue(Jawsize.Value);
|
||||
}
|
||||
if (model.Color != null)
|
||||
if (Color != null)
|
||||
{
|
||||
writer.WritePropertyName("color");
|
||||
writer.WriteStringValue(model.Color.ToString());
|
||||
writer.WriteStringValue(Color.ToString());
|
||||
}
|
||||
if (model.Age != null)
|
||||
if (Age != null)
|
||||
{
|
||||
writer.WritePropertyName("age");
|
||||
writer.WriteNumberValue(model.Age.Value);
|
||||
writer.WriteNumberValue(Age.Value);
|
||||
}
|
||||
writer.WritePropertyName("birthday");
|
||||
writer.WriteStringValue(model.Birthday, "S");
|
||||
writer.WriteStringValue(Birthday, "S");
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Goblinshark Deserialize(JsonElement element)
|
||||
internal static Goblinshark DeserializeGoblinshark(JsonElement element)
|
||||
{
|
||||
var result = new Goblinshark();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -115,7 +115,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class IntWrapperSerializer
|
||||
public partial class IntWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(IntWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field1 != null)
|
||||
if (Field1 != null)
|
||||
{
|
||||
writer.WritePropertyName("field1");
|
||||
writer.WriteNumberValue(model.Field1.Value);
|
||||
writer.WriteNumberValue(Field1.Value);
|
||||
}
|
||||
if (model.Field2 != null)
|
||||
if (Field2 != null)
|
||||
{
|
||||
writer.WritePropertyName("field2");
|
||||
writer.WriteNumberValue(model.Field2.Value);
|
||||
writer.WriteNumberValue(Field2.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static IntWrapper Deserialize(JsonElement element)
|
||||
internal static IntWrapper DeserializeIntWrapper(JsonElement element)
|
||||
{
|
||||
var result = new IntWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class LongWrapperSerializer
|
||||
public partial class LongWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(LongWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field1 != null)
|
||||
if (Field1 != null)
|
||||
{
|
||||
writer.WritePropertyName("field1");
|
||||
writer.WriteNumberValue(model.Field1.Value);
|
||||
writer.WriteNumberValue(Field1.Value);
|
||||
}
|
||||
if (model.Field2 != null)
|
||||
if (Field2 != null)
|
||||
{
|
||||
writer.WritePropertyName("field2");
|
||||
writer.WriteNumberValue(model.Field2.Value);
|
||||
writer.WriteNumberValue(Field2.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static LongWrapper Deserialize(JsonElement element)
|
||||
internal static LongWrapper DeserializeLongWrapper(JsonElement element)
|
||||
{
|
||||
var result = new LongWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,19 +6,19 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class MyBaseHelperTypeSerializer
|
||||
public partial class MyBaseHelperType : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(MyBaseHelperType model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.PropBH1 != null)
|
||||
if (PropBH1 != null)
|
||||
{
|
||||
writer.WritePropertyName("propBH1");
|
||||
writer.WriteStringValue(model.PropBH1);
|
||||
writer.WriteStringValue(PropBH1);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static MyBaseHelperType Deserialize(JsonElement element)
|
||||
internal static MyBaseHelperType DeserializeMyBaseHelperType(JsonElement element)
|
||||
{
|
||||
var result = new MyBaseHelperType();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,38 +6,32 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class MyBaseTypeSerializer
|
||||
public partial class MyBaseType : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(MyBaseType model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
switch (model)
|
||||
{
|
||||
case MyDerivedType myDerivedType:
|
||||
MyDerivedTypeSerializer.Serialize(myDerivedType, writer);
|
||||
return;
|
||||
}
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("kind");
|
||||
writer.WriteStringValue(model.Kind);
|
||||
if (model.PropB1 != null)
|
||||
writer.WriteStringValue(Kind);
|
||||
if (PropB1 != null)
|
||||
{
|
||||
writer.WritePropertyName("propB1");
|
||||
writer.WriteStringValue(model.PropB1);
|
||||
writer.WriteStringValue(PropB1);
|
||||
}
|
||||
if (model.Helper != null)
|
||||
if (Helper != null)
|
||||
{
|
||||
writer.WritePropertyName("helper");
|
||||
MyBaseHelperTypeSerializer.Serialize(model.Helper, writer);
|
||||
writer.WriteObjectValue(Helper);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static MyBaseType Deserialize(JsonElement element)
|
||||
internal static MyBaseType DeserializeMyBaseType(JsonElement element)
|
||||
{
|
||||
if (element.TryGetProperty("kind", out JsonElement discriminator))
|
||||
{
|
||||
switch (discriminator.GetString())
|
||||
{
|
||||
case "Kind1": return MyDerivedTypeSerializer.Deserialize(element);
|
||||
case "Kind1": return MyDerivedType.DeserializeMyDerivedType(element);
|
||||
}
|
||||
}
|
||||
var result = new MyBaseType();
|
||||
|
@ -63,7 +57,7 @@ namespace body_complex.Models.V20160229
|
|||
{
|
||||
continue;
|
||||
}
|
||||
result.Helper = MyBaseHelperTypeSerializer.Deserialize(property.Value);
|
||||
result.Helper = MyBaseHelperType.DeserializeMyBaseHelperType(property.Value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,31 +6,31 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class MyDerivedTypeSerializer
|
||||
public partial class MyDerivedType : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(MyDerivedType model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.PropD1 != null)
|
||||
if (PropD1 != null)
|
||||
{
|
||||
writer.WritePropertyName("propD1");
|
||||
writer.WriteStringValue(model.PropD1);
|
||||
writer.WriteStringValue(PropD1);
|
||||
}
|
||||
writer.WritePropertyName("kind");
|
||||
writer.WriteStringValue(model.Kind);
|
||||
if (model.PropB1 != null)
|
||||
writer.WriteStringValue(Kind);
|
||||
if (PropB1 != null)
|
||||
{
|
||||
writer.WritePropertyName("propB1");
|
||||
writer.WriteStringValue(model.PropB1);
|
||||
writer.WriteStringValue(PropB1);
|
||||
}
|
||||
if (model.Helper != null)
|
||||
if (Helper != null)
|
||||
{
|
||||
writer.WritePropertyName("helper");
|
||||
MyBaseHelperTypeSerializer.Serialize(model.Helper, writer);
|
||||
writer.WriteObjectValue(Helper);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static MyDerivedType Deserialize(JsonElement element)
|
||||
internal static MyDerivedType DeserializeMyDerivedType(JsonElement element)
|
||||
{
|
||||
var result = new MyDerivedType();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -64,7 +64,7 @@ namespace body_complex.Models.V20160229
|
|||
{
|
||||
continue;
|
||||
}
|
||||
result.Helper = MyBaseHelperTypeSerializer.Deserialize(property.Value);
|
||||
result.Helper = MyBaseHelperType.DeserializeMyBaseHelperType(property.Value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class PetSerializer
|
||||
public partial class Pet : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Pet model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id.Value);
|
||||
writer.WriteNumberValue(Id.Value);
|
||||
}
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Pet Deserialize(JsonElement element)
|
||||
internal static Pet DeserializePet(JsonElement element)
|
||||
{
|
||||
var result = new Pet();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class ReadonlyObjSerializer
|
||||
public partial class ReadonlyObj : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(ReadonlyObj model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteStringValue(model.Id);
|
||||
writer.WriteStringValue(Id);
|
||||
}
|
||||
if (model.Size != null)
|
||||
if (Size != null)
|
||||
{
|
||||
writer.WritePropertyName("size");
|
||||
writer.WriteNumberValue(model.Size.Value);
|
||||
writer.WriteNumberValue(Size.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static ReadonlyObj Deserialize(JsonElement element)
|
||||
internal static ReadonlyObj DeserializeReadonlyObj(JsonElement element)
|
||||
{
|
||||
var result = new ReadonlyObj();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,55 +7,49 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class SalmonSerializer
|
||||
public partial class Salmon : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Salmon model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
switch (model)
|
||||
{
|
||||
case SmartSalmon smartSalmon:
|
||||
SmartSalmonSerializer.Serialize(smartSalmon, writer);
|
||||
return;
|
||||
}
|
||||
writer.WriteStartObject();
|
||||
if (model.Location != null)
|
||||
if (Location != null)
|
||||
{
|
||||
writer.WritePropertyName("location");
|
||||
writer.WriteStringValue(model.Location);
|
||||
writer.WriteStringValue(Location);
|
||||
}
|
||||
if (model.Iswild != null)
|
||||
if (Iswild != null)
|
||||
{
|
||||
writer.WritePropertyName("iswild");
|
||||
writer.WriteBooleanValue(model.Iswild.Value);
|
||||
writer.WriteBooleanValue(Iswild.Value);
|
||||
}
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Salmon Deserialize(JsonElement element)
|
||||
internal static Salmon DeserializeSalmon(JsonElement element)
|
||||
{
|
||||
if (element.TryGetProperty("fishtype", out JsonElement discriminator))
|
||||
{
|
||||
switch (discriminator.GetString())
|
||||
{
|
||||
case "smart_salmon": return SmartSalmonSerializer.Deserialize(element);
|
||||
case "smart_salmon": return SmartSalmon.DeserializeSmartSalmon(element);
|
||||
}
|
||||
}
|
||||
var result = new Salmon();
|
||||
|
@ -107,7 +101,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -7,45 +7,45 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class SawsharkSerializer
|
||||
public partial class Sawshark : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Sawshark model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Picture != null)
|
||||
if (Picture != null)
|
||||
{
|
||||
writer.WritePropertyName("picture");
|
||||
writer.WriteBase64StringValue(model.Picture);
|
||||
writer.WriteBase64StringValue(Picture);
|
||||
}
|
||||
if (model.Age != null)
|
||||
if (Age != null)
|
||||
{
|
||||
writer.WritePropertyName("age");
|
||||
writer.WriteNumberValue(model.Age.Value);
|
||||
writer.WriteNumberValue(Age.Value);
|
||||
}
|
||||
writer.WritePropertyName("birthday");
|
||||
writer.WriteStringValue(model.Birthday, "S");
|
||||
writer.WriteStringValue(Birthday, "S");
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Sawshark Deserialize(JsonElement element)
|
||||
internal static Sawshark DeserializeSawshark(JsonElement element)
|
||||
{
|
||||
var result = new Sawshark();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -101,7 +101,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -7,60 +7,48 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class SharkSerializer
|
||||
public partial class Shark : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Shark model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
switch (model)
|
||||
{
|
||||
case Cookiecuttershark cookiecuttershark:
|
||||
CookiecuttersharkSerializer.Serialize(cookiecuttershark, writer);
|
||||
return;
|
||||
case Goblinshark goblinshark:
|
||||
GoblinsharkSerializer.Serialize(goblinshark, writer);
|
||||
return;
|
||||
case Sawshark sawshark:
|
||||
SawsharkSerializer.Serialize(sawshark, writer);
|
||||
return;
|
||||
}
|
||||
writer.WriteStartObject();
|
||||
if (model.Age != null)
|
||||
if (Age != null)
|
||||
{
|
||||
writer.WritePropertyName("age");
|
||||
writer.WriteNumberValue(model.Age.Value);
|
||||
writer.WriteNumberValue(Age.Value);
|
||||
}
|
||||
writer.WritePropertyName("birthday");
|
||||
writer.WriteStringValue(model.Birthday, "S");
|
||||
writer.WriteStringValue(Birthday, "S");
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Shark Deserialize(JsonElement element)
|
||||
internal static Shark DeserializeShark(JsonElement element)
|
||||
{
|
||||
if (element.TryGetProperty("fishtype", out JsonElement discriminator))
|
||||
{
|
||||
switch (discriminator.GetString())
|
||||
{
|
||||
case "cookiecuttershark": return CookiecuttersharkSerializer.Deserialize(element);
|
||||
case "goblin": return GoblinsharkSerializer.Deserialize(element);
|
||||
case "sawshark": return SawsharkSerializer.Deserialize(element);
|
||||
case "cookiecuttershark": return Cookiecuttershark.DeserializeCookiecuttershark(element);
|
||||
case "goblin": return Goblinshark.DeserializeGoblinshark(element);
|
||||
case "sawshark": return Sawshark.DeserializeSawshark(element);
|
||||
}
|
||||
}
|
||||
var result = new Shark();
|
||||
|
@ -108,7 +96,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -7,44 +7,44 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class SiameseSerializer
|
||||
public partial class Siamese : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Siamese model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Breed != null)
|
||||
if (Breed != null)
|
||||
{
|
||||
writer.WritePropertyName("breed");
|
||||
writer.WriteStringValue(model.Breed);
|
||||
writer.WriteStringValue(Breed);
|
||||
}
|
||||
if (model.Color != null)
|
||||
if (Color != null)
|
||||
{
|
||||
writer.WritePropertyName("color");
|
||||
writer.WriteStringValue(model.Color);
|
||||
writer.WriteStringValue(Color);
|
||||
}
|
||||
if (model.Hates != null)
|
||||
if (Hates != null)
|
||||
{
|
||||
writer.WritePropertyName("hates");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Hates)
|
||||
foreach (var item in Hates)
|
||||
{
|
||||
DogSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
if (model.Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
writer.WritePropertyName("id");
|
||||
writer.WriteNumberValue(model.Id.Value);
|
||||
writer.WriteNumberValue(Id.Value);
|
||||
}
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Siamese Deserialize(JsonElement element)
|
||||
internal static Siamese DeserializeSiamese(JsonElement element)
|
||||
{
|
||||
var result = new Siamese();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -76,7 +76,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Hates = new List<Dog>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Hates.Add(DogSerializer.Deserialize(item));
|
||||
result.Hates.Add(Dog.DeserializeDog(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -7,53 +7,53 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class SmartSalmonSerializer
|
||||
public partial class SmartSalmon : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(SmartSalmon model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.CollegeDegree != null)
|
||||
if (CollegeDegree != null)
|
||||
{
|
||||
writer.WritePropertyName("college_degree");
|
||||
writer.WriteStringValue(model.CollegeDegree);
|
||||
writer.WriteStringValue(CollegeDegree);
|
||||
}
|
||||
if (model.Location != null)
|
||||
if (Location != null)
|
||||
{
|
||||
writer.WritePropertyName("location");
|
||||
writer.WriteStringValue(model.Location);
|
||||
writer.WriteStringValue(Location);
|
||||
}
|
||||
if (model.Iswild != null)
|
||||
if (Iswild != null)
|
||||
{
|
||||
writer.WritePropertyName("iswild");
|
||||
writer.WriteBooleanValue(model.Iswild.Value);
|
||||
writer.WriteBooleanValue(Iswild.Value);
|
||||
}
|
||||
writer.WritePropertyName("fishtype");
|
||||
writer.WriteStringValue(model.Fishtype);
|
||||
if (model.Species != null)
|
||||
writer.WriteStringValue(Fishtype);
|
||||
if (Species != null)
|
||||
{
|
||||
writer.WritePropertyName("species");
|
||||
writer.WriteStringValue(model.Species);
|
||||
writer.WriteStringValue(Species);
|
||||
}
|
||||
writer.WritePropertyName("length");
|
||||
writer.WriteNumberValue(model.Length);
|
||||
if (model.Siblings != null)
|
||||
writer.WriteNumberValue(Length);
|
||||
if (Siblings != null)
|
||||
{
|
||||
writer.WritePropertyName("siblings");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.Siblings)
|
||||
foreach (var item in Siblings)
|
||||
{
|
||||
FishSerializer.Serialize(item, writer);
|
||||
writer.WriteObjectValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
foreach (var item in model)
|
||||
foreach (var item in this)
|
||||
{
|
||||
writer.WritePropertyName(item.Key);
|
||||
writer.WriteObjectValue(item.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static SmartSalmon Deserialize(JsonElement element)
|
||||
internal static SmartSalmon DeserializeSmartSalmon(JsonElement element)
|
||||
{
|
||||
var result = new SmartSalmon();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -113,7 +113,7 @@ namespace body_complex.Models.V20160229
|
|||
result.Siblings = new List<Fish>();
|
||||
foreach (var item in property.Value.EnumerateArray())
|
||||
{
|
||||
result.Siblings.Add(FishSerializer.Deserialize(item));
|
||||
result.Siblings.Add(Fish.DeserializeFish(item));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -6,29 +6,29 @@ using Azure.Core;
|
|||
|
||||
namespace body_complex.Models.V20160229
|
||||
{
|
||||
public partial class StringWrapperSerializer
|
||||
public partial class StringWrapper : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(StringWrapper model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Field != null)
|
||||
if (Field != null)
|
||||
{
|
||||
writer.WritePropertyName("field");
|
||||
writer.WriteStringValue(model.Field);
|
||||
writer.WriteStringValue(Field);
|
||||
}
|
||||
if (model.Empty != null)
|
||||
if (Empty != null)
|
||||
{
|
||||
writer.WritePropertyName("empty");
|
||||
writer.WriteStringValue(model.Empty);
|
||||
writer.WriteStringValue(Empty);
|
||||
}
|
||||
if (model.NullProperty != null)
|
||||
if (NullProperty != null)
|
||||
{
|
||||
writer.WritePropertyName("null");
|
||||
writer.WriteStringValue(model.NullProperty);
|
||||
writer.WriteStringValue(NullProperty);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static StringWrapper Deserialize(JsonElement element)
|
||||
internal static StringWrapper DeserializeStringWrapper(JsonElement element)
|
||||
{
|
||||
var result = new StringWrapper();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ArrayWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = ArrayWrapper.DeserializeArrayWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ArrayWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -108,7 +108,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ArrayWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = ArrayWrapper.DeserializeArrayWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -143,7 +143,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ArrayWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -181,7 +181,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ArrayWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = ArrayWrapper.DeserializeArrayWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BasicSerializer.Deserialize(document.RootElement);
|
||||
var value = Basic.DeserializeBasic(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -71,7 +71,7 @@ namespace body_complex
|
|||
request.Uri.AppendQuery("api-version", "2016-02-29", true);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
BasicSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -109,7 +109,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BasicSerializer.Deserialize(document.RootElement);
|
||||
var value = Basic.DeserializeBasic(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -143,7 +143,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BasicSerializer.Deserialize(document.RootElement);
|
||||
var value = Basic.DeserializeBasic(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -177,7 +177,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BasicSerializer.Deserialize(document.RootElement);
|
||||
var value = Basic.DeserializeBasic(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -211,7 +211,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BasicSerializer.Deserialize(document.RootElement);
|
||||
var value = Basic.DeserializeBasic(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DictionaryWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DictionaryWrapper.DeserializeDictionaryWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DictionaryWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -108,7 +108,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DictionaryWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DictionaryWrapper.DeserializeDictionaryWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -143,7 +143,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DictionaryWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -181,7 +181,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DictionaryWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DictionaryWrapper.DeserializeDictionaryWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -215,7 +215,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DictionaryWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DictionaryWrapper.DeserializeDictionaryWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = MyBaseTypeSerializer.Deserialize(document.RootElement);
|
||||
var value = MyBaseType.DeserializeMyBaseType(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = SiameseSerializer.Deserialize(document.RootElement);
|
||||
var value = Siamese.DeserializeSiamese(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
SiameseSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = FishSerializer.Deserialize(document.RootElement);
|
||||
var value = Fish.DeserializeFish(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
FishSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = FishSerializer.Deserialize(document.RootElement);
|
||||
var value = Fish.DeserializeFish(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
FishSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -108,7 +108,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DotFishSerializer.Deserialize(document.RootElement);
|
||||
var value = DotFish.DeserializeDotFish(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -142,7 +142,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DotFishMarketSerializer.Deserialize(document.RootElement);
|
||||
var value = DotFishMarket.DeserializeDotFishMarket(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -176,7 +176,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DotFishMarketSerializer.Deserialize(document.RootElement);
|
||||
var value = DotFishMarket.DeserializeDotFishMarket(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -210,7 +210,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = SalmonSerializer.Deserialize(document.RootElement);
|
||||
var value = Salmon.DeserializeSalmon(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -245,7 +245,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
SalmonSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -284,7 +284,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
SalmonSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -292,7 +292,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = SalmonSerializer.Deserialize(document.RootElement);
|
||||
var value = Salmon.DeserializeSalmon(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -327,7 +327,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
FishSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = IntWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = IntWrapper.DeserializeIntWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
IntWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -108,7 +108,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = LongWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = LongWrapper.DeserializeLongWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -143,7 +143,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
LongWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -181,7 +181,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = FloatWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = FloatWrapper.DeserializeFloatWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -216,7 +216,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
FloatWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -254,7 +254,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DoubleWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DoubleWrapper.DeserializeDoubleWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -289,7 +289,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DoubleWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -327,7 +327,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = BooleanWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = BooleanWrapper.DeserializeBooleanWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -362,7 +362,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
BooleanWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -400,7 +400,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = StringWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = StringWrapper.DeserializeStringWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -435,7 +435,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
StringWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -473,7 +473,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DateWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DateWrapper.DeserializeDateWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -508,7 +508,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DateWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -546,7 +546,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DatetimeWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DatetimeWrapper.DeserializeDatetimeWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -581,7 +581,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DatetimeWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -619,7 +619,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = Datetimerfc1123WrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = Datetimerfc1123Wrapper.DeserializeDatetimerfc1123Wrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -654,7 +654,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
Datetimerfc1123WrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -692,7 +692,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = DurationWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = DurationWrapper.DeserializeDurationWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -727,7 +727,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
DurationWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -765,7 +765,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ByteWrapperSerializer.Deserialize(document.RootElement);
|
||||
var value = ByteWrapper.DeserializeByteWrapper(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -800,7 +800,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ByteWrapperSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace body_complex
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ReadonlyObjSerializer.Deserialize(document.RootElement);
|
||||
var value = ReadonlyObj.DeserializeReadonlyObj(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ namespace body_complex
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ReadonlyObjSerializer.Serialize(complexBody, writer);
|
||||
writer.WriteObjectValue(complexBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_date.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_datetime_rfc1123.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_datetime.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_duration.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_integer.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_number.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace body_string.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,21 +6,21 @@ using Azure.Core;
|
|||
|
||||
namespace body_string.Models.V100
|
||||
{
|
||||
public partial class RefColorConstantSerializer
|
||||
public partial class RefColorConstant : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(RefColorConstant model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("ColorConstant");
|
||||
writer.WriteStringValue(model.ColorConstant);
|
||||
if (model.Field1 != null)
|
||||
writer.WriteStringValue(ColorConstant);
|
||||
if (Field1 != null)
|
||||
{
|
||||
writer.WritePropertyName("field1");
|
||||
writer.WriteStringValue(model.Field1);
|
||||
writer.WriteStringValue(Field1);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static RefColorConstant Deserialize(JsonElement element)
|
||||
internal static RefColorConstant DeserializeRefColorConstant(JsonElement element)
|
||||
{
|
||||
var result = new RefColorConstant();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace body_string
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = RefColorConstantSerializer.Deserialize(document.RootElement);
|
||||
var value = RefColorConstant.DeserializeRefColorConstant(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -208,7 +208,7 @@ namespace body_string
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
RefColorConstantSerializer.Serialize(enumStringBody, writer);
|
||||
writer.WriteObjectValue(enumStringBody);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace custom_baseUrl_more_options.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace custom_baseUrl.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,26 +6,26 @@ using Azure.Core;
|
|||
|
||||
namespace extensible_enums_swagger.Models.V20160707
|
||||
{
|
||||
public partial class PetSerializer
|
||||
public partial class Pet : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Pet model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Name != null)
|
||||
if (Name != null)
|
||||
{
|
||||
writer.WritePropertyName("name");
|
||||
writer.WriteStringValue(model.Name);
|
||||
writer.WriteStringValue(Name);
|
||||
}
|
||||
if (model.DaysOfWeek != null)
|
||||
if (DaysOfWeek != null)
|
||||
{
|
||||
writer.WritePropertyName("DaysOfWeek");
|
||||
writer.WriteStringValue(model.DaysOfWeek.ToString());
|
||||
writer.WriteStringValue(DaysOfWeek.ToString());
|
||||
}
|
||||
writer.WritePropertyName("IntEnum");
|
||||
writer.WriteStringValue(model.IntEnum.ToString());
|
||||
writer.WriteStringValue(IntEnum.ToString());
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Pet Deserialize(JsonElement element)
|
||||
internal static Pet DeserializePet(JsonElement element)
|
||||
{
|
||||
var result = new Pet();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace extensible_enums_swagger
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetSerializer.Deserialize(document.RootElement);
|
||||
var value = Pet.DeserializePet(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -71,7 +71,7 @@ namespace extensible_enums_swagger
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
PetSerializer.Serialize(petParam, writer);
|
||||
writer.WriteObjectValue(petParam);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -79,7 +79,7 @@ namespace extensible_enums_swagger
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = PetSerializer.Deserialize(document.RootElement);
|
||||
var value = Pet.DeserializePet(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace header.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace url_multi_collectionFormat.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,24 +6,24 @@ using Azure.Core;
|
|||
|
||||
namespace url.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Status != null)
|
||||
if (Status != null)
|
||||
{
|
||||
writer.WritePropertyName("status");
|
||||
writer.WriteNumberValue(model.Status.Value);
|
||||
writer.WriteNumberValue(Status.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,21 +6,21 @@ using Azure.Core;
|
|||
|
||||
namespace validation.Models.V100
|
||||
{
|
||||
public partial class ChildProductSerializer
|
||||
public partial class ChildProduct : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(ChildProduct model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("constProperty");
|
||||
writer.WriteStringValue(model.ConstProperty);
|
||||
if (model.Count != null)
|
||||
writer.WriteStringValue(ConstProperty);
|
||||
if (Count != null)
|
||||
{
|
||||
writer.WritePropertyName("count");
|
||||
writer.WriteNumberValue(model.Count.Value);
|
||||
writer.WriteNumberValue(Count.Value);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static ChildProduct Deserialize(JsonElement element)
|
||||
internal static ChildProduct DeserializeChildProduct(JsonElement element)
|
||||
{
|
||||
var result = new ChildProduct();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,18 +6,18 @@ using Azure.Core;
|
|||
|
||||
namespace validation.Models.V100
|
||||
{
|
||||
public partial class ConstantProductSerializer
|
||||
public partial class ConstantProduct : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(ConstantProduct model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
writer.WritePropertyName("constProperty");
|
||||
writer.WriteStringValue(model.ConstProperty);
|
||||
writer.WriteStringValue(ConstProperty);
|
||||
writer.WritePropertyName("constProperty2");
|
||||
writer.WriteStringValue(model.ConstProperty2);
|
||||
writer.WriteStringValue(ConstProperty2);
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static ConstantProduct Deserialize(JsonElement element)
|
||||
internal static ConstantProduct DeserializeConstantProduct(JsonElement element)
|
||||
{
|
||||
var result = new ConstantProduct();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -6,29 +6,29 @@ using Azure.Core;
|
|||
|
||||
namespace validation.Models.V100
|
||||
{
|
||||
public partial class ErrorSerializer
|
||||
public partial class Error : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Error model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.Code != null)
|
||||
if (Code != null)
|
||||
{
|
||||
writer.WritePropertyName("code");
|
||||
writer.WriteNumberValue(model.Code.Value);
|
||||
writer.WriteNumberValue(Code.Value);
|
||||
}
|
||||
if (model.Message != null)
|
||||
if (Message != null)
|
||||
{
|
||||
writer.WritePropertyName("message");
|
||||
writer.WriteStringValue(model.Message);
|
||||
writer.WriteStringValue(Message);
|
||||
}
|
||||
if (model.Fields != null)
|
||||
if (Fields != null)
|
||||
{
|
||||
writer.WritePropertyName("fields");
|
||||
writer.WriteStringValue(model.Fields);
|
||||
writer.WriteStringValue(Fields);
|
||||
}
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Error Deserialize(JsonElement element)
|
||||
internal static Error DeserializeError(JsonElement element)
|
||||
{
|
||||
var result = new Error();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
|
|
@ -7,44 +7,44 @@ using Azure.Core;
|
|||
|
||||
namespace validation.Models.V100
|
||||
{
|
||||
public partial class ProductSerializer
|
||||
public partial class Product : IUtf8JsonSerializable
|
||||
{
|
||||
internal static void Serialize(Product model, Utf8JsonWriter writer)
|
||||
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
if (model.DisplayNames != null)
|
||||
if (DisplayNames != null)
|
||||
{
|
||||
writer.WritePropertyName("display_names");
|
||||
writer.WriteStartArray();
|
||||
foreach (var item in model.DisplayNames)
|
||||
foreach (var item in DisplayNames)
|
||||
{
|
||||
writer.WriteStringValue(item);
|
||||
}
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
if (model.Capacity != null)
|
||||
if (Capacity != null)
|
||||
{
|
||||
writer.WritePropertyName("capacity");
|
||||
writer.WriteNumberValue(model.Capacity.Value);
|
||||
writer.WriteNumberValue(Capacity.Value);
|
||||
}
|
||||
if (model.Image != null)
|
||||
if (Image != null)
|
||||
{
|
||||
writer.WritePropertyName("image");
|
||||
writer.WriteStringValue(model.Image);
|
||||
writer.WriteStringValue(Image);
|
||||
}
|
||||
writer.WritePropertyName("child");
|
||||
ChildProductSerializer.Serialize(model.Child, writer);
|
||||
writer.WriteObjectValue(Child);
|
||||
writer.WritePropertyName("constChild");
|
||||
ConstantProductSerializer.Serialize(model.ConstChild, writer);
|
||||
writer.WriteObjectValue(ConstChild);
|
||||
writer.WritePropertyName("constInt");
|
||||
writer.WriteNumberValue(model.ConstInt);
|
||||
writer.WriteNumberValue(ConstInt);
|
||||
writer.WritePropertyName("constString");
|
||||
writer.WriteStringValue(model.ConstString);
|
||||
writer.WriteStringValue(ConstString);
|
||||
writer.WritePropertyName("constStringAsEnum");
|
||||
writer.WriteStringValue(model.ConstStringAsEnum);
|
||||
writer.WriteStringValue(ConstStringAsEnum);
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
internal static Product Deserialize(JsonElement element)
|
||||
internal static Product DeserializeProduct(JsonElement element)
|
||||
{
|
||||
var result = new Product();
|
||||
foreach (var property in element.EnumerateObject())
|
||||
|
@ -82,12 +82,12 @@ namespace validation.Models.V100
|
|||
}
|
||||
if (property.NameEquals("child"))
|
||||
{
|
||||
result.Child = ChildProductSerializer.Deserialize(property.Value);
|
||||
result.Child = ChildProduct.DeserializeChildProduct(property.Value);
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("constChild"))
|
||||
{
|
||||
result.ConstChild = ConstantProductSerializer.Deserialize(property.Value);
|
||||
result.ConstChild = ConstantProduct.DeserializeConstantProduct(property.Value);
|
||||
continue;
|
||||
}
|
||||
if (property.NameEquals("constInt"))
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace validation
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ProductSerializer.Deserialize(document.RootElement);
|
||||
var value = Product.DeserializeProduct(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -94,7 +94,7 @@ namespace validation
|
|||
request.Uri.AppendQuery("apiVersion", "1.0.0", true);
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ProductSerializer.Serialize(body, writer);
|
||||
writer.WriteObjectValue(body);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -102,7 +102,7 @@ namespace validation
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ProductSerializer.Deserialize(document.RootElement);
|
||||
var value = Product.DeserializeProduct(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
@ -167,7 +167,7 @@ namespace validation
|
|||
request.Headers.Add("Content-Type", "application/json");
|
||||
using var content = new Utf8JsonRequestContent();
|
||||
var writer = content.JsonWriter;
|
||||
ProductSerializer.Serialize(body, writer);
|
||||
writer.WriteObjectValue(body);
|
||||
request.Content = content;
|
||||
var response = await pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
switch (response.Status)
|
||||
|
@ -175,7 +175,7 @@ namespace validation
|
|||
case 200:
|
||||
{
|
||||
using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ProductSerializer.Deserialize(document.RootElement);
|
||||
var value = Product.DeserializeProduct(document.RootElement);
|
||||
return Response.FromValue(value, response);
|
||||
}
|
||||
default:
|
||||
|
|
Загрузка…
Ссылка в новой задаче