Class CustomDomainResponseConverter
- Namespace
- Cloudflare.NET.Accounts.Models
- Assembly
- Cloudflare.NET.dll
A custom JSON converter for the CustomDomainResponse record. It handles the case where the "status" field from the Cloudflare API can be either a simple string (on creation) or a complex object (when querying an existing domain).
public class CustomDomainResponseConverter : JsonConverter<CustomDomainResponse>
- Inheritance
-
CustomDomainResponseConverter
- Inherited Members
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type CustomDomainResponse.
public override CustomDomainResponse Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
readerUtf8JsonReaderThe reader.
typeToConvertTypeThe type to convert.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- CustomDomainResponse
The converted value.
Write(Utf8JsonWriter, CustomDomainResponse, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, CustomDomainResponse value, JsonSerializerOptions options)
Parameters
writerUtf8JsonWriterThe writer to write to.
valueCustomDomainResponseThe value to convert to JSON.
optionsJsonSerializerOptionsAn object that specifies serialization options to use.