using System.Runtime.Serialization;
using Newtonsoft.Json.Converters;
namespace AMWD.Net.Api.Cloudflare.Dns
{
///
/// A Cloudflare custom nameserver.
/// Source
///
public class CustomNameserver
{
///
/// Initializes a new instance of the class.
///
/// The FQDN of the name server.
public CustomNameserver(string nameserverName)
{
NameserverName = nameserverName;
}
///
/// A and AAAA records associated with the nameserver.
///
[JsonProperty("dns_records")]
public IReadOnlyCollection? DnsRecords { get; set; }
///
/// The full qualified domain name (FQDN) of the name server.
///
[JsonProperty("ns_name")]
public string NameserverName { get; set; }
///
/// Verification status of the nameserver.
///
[Obsolete]
[JsonProperty("status")]
public CustomNameserverStatus? Status { get; set; }
///
/// Identifier.
///
[JsonProperty("zone_tag")]
public string? ZoneTag { get; set; }
///
/// The number of the set that this name server belongs to.
///
///
/// 1 <= X <= 5
///
/// Default: 1
///
[JsonProperty("ns_set")]
public int? NameserverSet { get; set; }
}
///
/// Records associated with the nameserver.
///
public class CustomNameserverDnsRecord
{
///
/// DNS record type.
///
[JsonProperty("type")]
public CustomNameserverDnsRecordType? Type { get; set; }
///
/// DNS record contents (an IPv4 or IPv6 address).
///
[JsonProperty("value")]
public string? Value { get; set; }
}
///
/// Record types.
/// Source
///
[JsonConverter(typeof(StringEnumConverter))]
public enum CustomNameserverDnsRecordType
{
///
/// IPv4 record.
///
[EnumMember(Value = "A")]
A = 1,
///
/// IPv6 record.
///
[EnumMember(Value = "AAAA")]
AAAA = 2
}
///
/// Custom nameserver states.
/// Source
///
[JsonConverter(typeof(StringEnumConverter))]
public enum CustomNameserverStatus
{
///
/// The nameserver has been moved.
///
[EnumMember(Value = "moved")]
Moved = 1,
///
/// The nameserver is pending verification.
///
[EnumMember(Value = "pending")]
Pending = 2,
///
/// The nameserver has been verified.
///
[EnumMember(Value = "verified")]
Verified = 3
}
}