Skip to content

Make converter types public #50192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,21 @@ ManagedServiceIdentity IPersistableModel<ManagedServiceIdentity>.Create(BinaryDa

string IPersistableModel<ManagedServiceIdentity>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

internal partial class ManagedServiceIdentityConverter : JsonConverter<ManagedServiceIdentity>
/// <summary>
/// Converter for ManagedServiceIdentity type.
/// </summary>
public partial class ManagedServiceIdentityConverter : JsonConverter<ManagedServiceIdentity>
{
/// <summary>
/// Converter for ManagedServiceIdentity type.
/// </summary>
public override void Write(Utf8JsonWriter writer, ManagedServiceIdentity model, JsonSerializerOptions options)
{
model.Write(writer, new ModelReaderWriterOptions("W"), options);
}
/// <summary>
/// Converter for ManagedServiceIdentity type.
/// </summary>
public override ManagedServiceIdentity Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var document = JsonDocument.ParseValue(ref reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@ namespace Azure.ResourceManager.Models
[JsonConverter(typeof(ManagedServiceIdentityTypeConverter))]
public readonly partial struct ManagedServiceIdentityType : IEquatable<ManagedServiceIdentityType>
{
internal partial class ManagedServiceIdentityTypeConverter : JsonConverter<ManagedServiceIdentityType>
/// <summary>
/// Converter for ManagedServiceIdentityType type.
/// </summary>
public partial class ManagedServiceIdentityTypeConverter : JsonConverter<ManagedServiceIdentityType>
{
/// <summary>
/// Converter for ManagedServiceIdentityType type.
/// </summary>
public override void Write(Utf8JsonWriter writer, ManagedServiceIdentityType model, JsonSerializerOptions options)
{
writer.WritePropertyName("type");
writer.WriteStringValue(model.ToString());
}

/// <summary>
/// Converter for ManagedServiceIdentityType type.
/// </summary>
public override ManagedServiceIdentityType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var document = JsonDocument.ParseValue(ref reader);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,21 @@ SubResource IPersistableModel<SubResource>.Create(BinaryData data, ModelReaderWr

string IPersistableModel<SubResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

internal partial class SubResourceConverter : JsonConverter<SubResource>
/// <summary>
/// Converter for SubResource type.
/// </summary>
public partial class SubResourceConverter : JsonConverter<SubResource>
{
/// <summary>
/// Converter for SubResource type.
/// </summary>
public override void Write(Utf8JsonWriter writer, SubResource model, JsonSerializerOptions options)
{
writer.WriteObjectValue(model);
}
/// <summary>
/// Converter for SubResource type.
/// </summary>
public override SubResource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var document = JsonDocument.ParseValue(ref reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,21 @@ WritableSubResource IPersistableModel<WritableSubResource>.Create(BinaryData dat

string IPersistableModel<WritableSubResource>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";

internal partial class WritableSubResourceConverter : JsonConverter<WritableSubResource>
/// <summary>
/// Converter for WritableSubResource type.
/// </summary>
public partial class WritableSubResourceConverter : JsonConverter<WritableSubResource>
{
/// <summary>
/// Converter for WritableSubResource type.
/// </summary>
public override void Write(Utf8JsonWriter writer, WritableSubResource model, JsonSerializerOptions options)
{
writer.WriteObjectValue(model);
}
/// <summary>
/// Converter for WritableSubResource type.
/// </summary>
public override WritableSubResource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var document = JsonDocument.ParseValue(ref reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,21 @@ internal ResourceProviderData(ResourceIdentifier id, string @namespace, string r
/// <summary> The provider ID. </summary>
public ResourceIdentifier Id { get; }

internal partial class ProviderDataConverter : JsonConverter<ResourceProviderData>
/// <summary>
/// Converter for ResourceProviderData type.
/// </summary>
public partial class ProviderDataConverter : JsonConverter<ResourceProviderData>
{
/// <summary>
/// Converter for ResourceProviderData type.
/// </summary>
public override void Write(Utf8JsonWriter writer, ResourceProviderData providerData, JsonSerializerOptions options)
{
writer.WriteObjectValue(providerData);
}
/// <summary>
/// Converter for ResourceProviderData type.
/// </summary>
public override ResourceProviderData Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
using var document = JsonDocument.ParseValue(ref reader);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading