Skip to content

Commit

Permalink
Fix Custom in Dns (#41738)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgallan authored Feb 5, 2024
1 parent 5798506 commit ca54f4a
Show file tree
Hide file tree
Showing 14 changed files with 323 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ void IJsonModel<DnsARecordData>.Write(Utf8JsonWriter writer, ModelReaderWriterOp
writer.WritePropertyName("etag"u8);
writer.WriteStringValue(ETag.Value.ToString());
}
if (options.Format != "W")
{
writer.WritePropertyName("id"u8);
writer.WriteStringValue(Id);
}
if (options.Format != "W")
{
writer.WritePropertyName("name"u8);
writer.WriteStringValue(Name);
}
if (options.Format != "W")
{
writer.WritePropertyName("type"u8);
writer.WriteStringValue(ResourceType);
}
if (options.Format != "W" && Optional.IsDefined(SystemData))
{
writer.WritePropertyName("systemData"u8);
JsonSerializer.Serialize(writer, SystemData);
}
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
if (Optional.IsCollectionDefined(Metadata))
Expand All @@ -51,6 +71,11 @@ void IJsonModel<DnsARecordData>.Write(Utf8JsonWriter writer, ModelReaderWriterOp
writer.WritePropertyName("TTL"u8);
writer.WriteNumberValue(TtlInSeconds.Value);
}
if (options.Format != "W" && Optional.IsDefined(ProvisioningState))
{
writer.WritePropertyName("provisioningState"u8);
writer.WriteStringValue(ProvisioningState);
}
if (Optional.IsDefined(TargetResource))
{
writer.WritePropertyName("targetResource"u8);
Expand Down Expand Up @@ -162,7 +187,6 @@ internal static DnsARecordData DeserializeDnsARecordData(JsonElement element, Mo
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
Dictionary<string, string> dictionary = new Dictionary<string, string>();
Expand All @@ -177,7 +201,6 @@ internal static DnsARecordData DeserializeDnsARecordData(JsonElement element, Mo
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
ttl = property0.Value.GetInt64();
Expand All @@ -197,7 +220,6 @@ internal static DnsARecordData DeserializeDnsARecordData(JsonElement element, Mo
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
targetResource = JsonSerializer.Deserialize<WritableSubResource>(property0.Value.ToString());
Expand All @@ -207,7 +229,6 @@ internal static DnsARecordData DeserializeDnsARecordData(JsonElement element, Mo
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
List<DnsARecordInfo> array = new List<DnsARecordInfo>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ void IJsonModel<DnsAaaaRecordData>.Write(Utf8JsonWriter writer, ModelReaderWrite
writer.WritePropertyName("etag"u8);
writer.WriteStringValue(ETag.Value.ToString());
}
if (options.Format != "W")
{
writer.WritePropertyName("id"u8);
writer.WriteStringValue(Id);
}
if (options.Format != "W")
{
writer.WritePropertyName("name"u8);
writer.WriteStringValue(Name);
}
if (options.Format != "W")
{
writer.WritePropertyName("type"u8);
writer.WriteStringValue(ResourceType);
}
if (options.Format != "W" && Optional.IsDefined(SystemData))
{
writer.WritePropertyName("systemData"u8);
JsonSerializer.Serialize(writer, SystemData);
}
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
if (Optional.IsCollectionDefined(Metadata))
Expand All @@ -50,6 +70,11 @@ void IJsonModel<DnsAaaaRecordData>.Write(Utf8JsonWriter writer, ModelReaderWrite
writer.WritePropertyName("TTL"u8);
writer.WriteNumberValue(TtlInSeconds.Value);
}
if (options.Format != "W" && Optional.IsDefined(ProvisioningState))
{
writer.WritePropertyName("provisioningState"u8);
writer.WriteStringValue(ProvisioningState);
}
if (Optional.IsDefined(TargetResource))
{
writer.WritePropertyName("targetResource"u8);
Expand Down Expand Up @@ -162,7 +187,6 @@ internal static DnsAaaaRecordData DeserializeDnsAaaaRecordData(JsonElement eleme
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
Dictionary<string, string> dictionary = new Dictionary<string, string>();
Expand All @@ -177,7 +201,6 @@ internal static DnsAaaaRecordData DeserializeDnsAaaaRecordData(JsonElement eleme
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
ttl = property0.Value.GetInt64();
Expand All @@ -197,7 +220,6 @@ internal static DnsAaaaRecordData DeserializeDnsAaaaRecordData(JsonElement eleme
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
targetResource = JsonSerializer.Deserialize<WritableSubResource>(property0.Value.ToString());
Expand All @@ -207,7 +229,6 @@ internal static DnsAaaaRecordData DeserializeDnsAaaaRecordData(JsonElement eleme
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
List<DnsAaaaRecordInfo> array = new List<DnsAaaaRecordInfo>();
Expand All @@ -226,6 +247,7 @@ internal static DnsAaaaRecordData DeserializeDnsAaaaRecordData(JsonElement eleme
additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
}
}
serializedAdditionalRawData = additionalPropertiesDictionary;
return new DnsAaaaRecordData(id, name, type, systemData, Optional.ToNullable(etag), Optional.ToDictionary(metadata), Optional.ToNullable(ttl), fqdn.Value, provisioningState.Value, targetResource, Optional.ToList(aaaaRecords), serializedAdditionalRawData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ void IJsonModel<DnsBaseRecordData>.Write(Utf8JsonWriter writer, ModelReaderWrite
writer.WritePropertyName("etag"u8);
writer.WriteStringValue(ETag.Value.ToString());
}
if (options.Format != "W")
{
writer.WritePropertyName("id"u8);
writer.WriteStringValue(Id);
}
if (options.Format != "W")
{
writer.WritePropertyName("name"u8);
writer.WriteStringValue(Name);
}
if (options.Format != "W")
{
writer.WritePropertyName("type"u8);
writer.WriteStringValue(ResourceType);
}
if (options.Format != "W" && Optional.IsDefined(SystemData))
{
writer.WritePropertyName("systemData"u8);
JsonSerializer.Serialize(writer, SystemData);
}
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
if (Optional.IsCollectionDefined(Metadata))
Expand All @@ -45,6 +65,16 @@ void IJsonModel<DnsBaseRecordData>.Write(Utf8JsonWriter writer, ModelReaderWrite
writer.WritePropertyName("TTL"u8);
writer.WriteNumberValue(TtlInSeconds.Value);
}
if (options.Format != "W")
{
writer.WritePropertyName("fqdn"u8);
writer.WriteStringValue(Fqdn);
}
if (options.Format != "W" && Optional.IsDefined(ProvisioningState))
{
writer.WritePropertyName("provisioningState"u8);
writer.WriteStringValue(ProvisioningState);
}
if (Optional.IsDefined(TargetResource))
{
writer.WritePropertyName("targetResource"u8);
Expand Down Expand Up @@ -151,7 +181,6 @@ internal static DnsBaseRecordData DeserializeBaseRecordData(JsonElement element,
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
Dictionary<string, string> dictionary = new Dictionary<string, string>();
Expand All @@ -166,7 +195,6 @@ internal static DnsBaseRecordData DeserializeBaseRecordData(JsonElement element,
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
ttl = property0.Value.GetInt64();
Expand All @@ -186,7 +214,6 @@ internal static DnsBaseRecordData DeserializeBaseRecordData(JsonElement element,
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
targetResource = JsonSerializer.Deserialize<WritableSubResource>(property0.Value.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ void IJsonModel<DnsCaaRecordData>.Write(Utf8JsonWriter writer, ModelReaderWriter
writer.WritePropertyName("etag"u8);
writer.WriteStringValue(ETag.Value.ToString());
}
if (options.Format != "W")
{
writer.WritePropertyName("id"u8);
writer.WriteStringValue(Id);
}
if (options.Format != "W")
{
writer.WritePropertyName("name"u8);
writer.WriteStringValue(Name);
}
if (options.Format != "W")
{
writer.WritePropertyName("type"u8);
writer.WriteStringValue(ResourceType);
}
if (options.Format != "W" && Optional.IsDefined(SystemData))
{
writer.WritePropertyName("systemData"u8);
JsonSerializer.Serialize(writer, SystemData);
}
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
if (Optional.IsCollectionDefined(Metadata))
Expand All @@ -45,6 +65,11 @@ void IJsonModel<DnsCaaRecordData>.Write(Utf8JsonWriter writer, ModelReaderWriter
writer.WritePropertyName("TTL"u8);
writer.WriteNumberValue(TtlInSeconds.Value);
}
if (options.Format != "W" && Optional.IsDefined(ProvisioningState))
{
writer.WritePropertyName("provisioningState"u8);
writer.WriteStringValue(ProvisioningState);
}
if (Optional.IsDefined(TargetResource))
{
writer.WritePropertyName("targetResource"u8);
Expand Down Expand Up @@ -157,7 +182,6 @@ internal static DnsCaaRecordData DeserializeDnsCaaRecordData(JsonElement element
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
Dictionary<string, string> dictionary = new Dictionary<string, string>();
Expand All @@ -172,7 +196,6 @@ internal static DnsCaaRecordData DeserializeDnsCaaRecordData(JsonElement element
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
ttl = property0.Value.GetInt64();
Expand All @@ -192,7 +215,6 @@ internal static DnsCaaRecordData DeserializeDnsCaaRecordData(JsonElement element
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
targetResource = JsonSerializer.Deserialize<WritableSubResource>(property0.Value.ToString());
Expand All @@ -202,7 +224,6 @@ internal static DnsCaaRecordData DeserializeDnsCaaRecordData(JsonElement element
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
property0.ThrowNonNullablePropertyIsNull();
continue;
}
List<DnsCaaRecordInfo> array = new List<DnsCaaRecordInfo>();
Expand Down
Loading

0 comments on commit ca54f4a

Please sign in to comment.