Table of Contents

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

Id string

The unique identifier of the scanned DNS record to accept. Required.

Type DnsRecordType

The DNS record type.

Name string

The record name (hostname).

Content string

The record content (value varies by type).

Ttl int

Time to live in seconds. Default: 1 (automatic).

Proxied bool?

Whether to proxy the record through Cloudflare.

Comment string

Optional comment describing the record.

Tags IReadOnlyList<string>

Optional tags in "name:value" format.

Priority int?

Record priority (required for MX records, optional for SRV records).

Settings DnsRecordSettings

Optional 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

string

Content

The record content (value varies by type).

[JsonPropertyName("content")]
public string Content { get; init; }

Property Value

string

Id

The unique identifier of the scanned DNS record to accept. Required.

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

Name

The record name (hostname).

[JsonPropertyName("name")]
public string Name { get; init; }

Property Value

string

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

DnsRecordSettings

Tags

Optional tags in "name:value" format.

[JsonPropertyName("tags")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Tags { get; init; }

Property Value

IReadOnlyList<string>

Ttl

Time to live in seconds. Default: 1 (automatic).

[JsonPropertyName("ttl")]
public int Ttl { get; init; }

Property Value

int

Type

The DNS record type.

[JsonPropertyName("type")]
public DnsRecordType Type { get; init; }

Property Value

DnsRecordType

Methods

FromDnsRecord(DnsRecord)

Creates a DnsScanAcceptItem from a DnsRecord returned by the scan review.

public static DnsScanAcceptItem FromDnsRecord(DnsRecord record)

Parameters

record DnsRecord

The scanned DNS record to convert.

Returns

DnsScanAcceptItem

A record object suitable for the accepts array.

See Also