Class DnsScanAcceptItem
- Namespace
- Cloudflare.NET.Dns.Models
- Assembly
- Cloudflare.NET.dll
A DNS record object for accepting scanned DNS records.
The Cloudflare API requires full DNS record objects (including the Id field) when accepting scanned records. This type provides proper JSON serialization with appropriate ignore conditions for optional fields.
public record DnsScanAcceptItem : IEquatable<DnsScanAcceptItem>
- Inheritance
-
DnsScanAcceptItem
- Implements
- Inherited Members
Constructors
DnsScanAcceptItem(string, DnsRecordType, string, string, int, bool?, string?, IReadOnlyList<string>?, int?, DnsRecordSettings?)
A DNS record object for accepting scanned DNS records.
The Cloudflare API requires full DNS record objects (including the Id field) when accepting scanned records. This type provides proper JSON serialization with appropriate ignore conditions for optional fields.
public DnsScanAcceptItem(string Id, DnsRecordType Type, string Name, string Content, int Ttl = 1, bool? Proxied = null, string? Comment = null, IReadOnlyList<string>? Tags = null, int? Priority = null, DnsRecordSettings? Settings = null)
Parameters
IdstringThe unique identifier of the scanned DNS record to accept. Required.
TypeDnsRecordTypeThe DNS record type.
NamestringThe record name (hostname).
ContentstringThe record content (value varies by type).
TtlintTime to live in seconds. Default: 1 (automatic).
Proxiedbool?Whether to proxy the record through Cloudflare.
CommentstringOptional comment describing the record.
TagsIReadOnlyList<string>Optional tags in "name:value" format.
Priorityint?Record priority (required for MX records, optional for SRV records).
SettingsDnsRecordSettingsOptional settings for the record.
- See Also
Properties
Comment
Optional comment describing the record.
[JsonPropertyName("comment")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Comment { get; init; }
Property Value
Content
The record content (value varies by type).
[JsonPropertyName("content")]
public string Content { get; init; }
Property Value
Id
The unique identifier of the scanned DNS record to accept. Required.
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
Name
The record name (hostname).
[JsonPropertyName("name")]
public string Name { get; init; }
Property Value
Priority
Record priority (required for MX records, optional for SRV records).
[JsonPropertyName("priority")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Priority { get; init; }
Property Value
- int?
Proxied
Whether to proxy the record through Cloudflare.
[JsonPropertyName("proxied")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Proxied { get; init; }
Property Value
- bool?
Settings
Optional settings for the record.
[JsonPropertyName("settings")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DnsRecordSettings? Settings { get; init; }
Property Value
Tags
Optional tags in "name:value" format.
[JsonPropertyName("tags")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Tags { get; init; }
Property Value
Ttl
Time to live in seconds. Default: 1 (automatic).
[JsonPropertyName("ttl")]
public int Ttl { get; init; }
Property Value
Type
The DNS record type.
[JsonPropertyName("type")]
public DnsRecordType Type { get; init; }
Property Value
Methods
FromDnsRecord(DnsRecord)
Creates a DnsScanAcceptItem from a DnsRecord returned by the scan review.
public static DnsScanAcceptItem FromDnsRecord(DnsRecord record)
Parameters
recordDnsRecordThe scanned DNS record to convert.
Returns
- DnsScanAcceptItem
A record object suitable for the accepts array.