Table of Contents

Class PatchDnsRecordRequest

Namespace
Cloudflare.NET.Dns.Models
Assembly
Cloudflare.NET.dll

Request to partially update a DNS record (PATCH).

All fields are optional; only include fields you want to change. Unspecified fields retain their current values.

public record PatchDnsRecordRequest : IEquatable<PatchDnsRecordRequest>
Inheritance
PatchDnsRecordRequest
Implements
Inherited Members

Examples

// Change only the content
var patchContent = new PatchDnsRecordRequest(Content: "192.0.2.100");

// Change only the TTL
var patchTtl = new PatchDnsRecordRequest(Ttl: 3600);

// Toggle proxied status
var patchProxy = new PatchDnsRecordRequest(Proxied: true);

// Update multiple fields
var patchMultiple = new PatchDnsRecordRequest(Content: "192.0.2.100", Ttl: 3600, Comment: "Updated endpoint");

Constructors

PatchDnsRecordRequest(DnsRecordType?, string?, string?, int?, bool?, string?, IReadOnlyList<string>?, DnsRecordSettings?)

Request to partially update a DNS record (PATCH).

All fields are optional; only include fields you want to change. Unspecified fields retain their current values.

public PatchDnsRecordRequest(DnsRecordType? Type = null, string? Name = null, string? Content = null, int? Ttl = null, bool? Proxied = null, string? Comment = null, IReadOnlyList<string>? Tags = null, DnsRecordSettings? Settings = null)

Parameters

Type DnsRecordType?

The DNS record type (optional for PATCH).

Name string

The record name (optional for PATCH).

Content string

The record content (optional for PATCH).

Ttl int?

Time to live in seconds (optional for PATCH).

Proxied bool?

Whether to proxy the record (optional for PATCH).

Comment string

Comment (optional for PATCH).

Tags IReadOnlyList<string>

Tags (optional for PATCH).

Settings DnsRecordSettings

Settings (optional for PATCH).

Examples

// Change only the content
var patchContent = new PatchDnsRecordRequest(Content: "192.0.2.100");

// Change only the TTL
var patchTtl = new PatchDnsRecordRequest(Ttl: 3600);

// Toggle proxied status
var patchProxy = new PatchDnsRecordRequest(Proxied: true);

// Update multiple fields
var patchMultiple = new PatchDnsRecordRequest(Content: "192.0.2.100", Ttl: 3600, Comment: "Updated endpoint");

Properties

Comment

Comment (optional for PATCH).

[JsonPropertyName("comment")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Comment { get; init; }

Property Value

string

Content

The record content (optional for PATCH).

[JsonPropertyName("content")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Content { get; init; }

Property Value

string

Name

The record name (optional for PATCH).

[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; init; }

Property Value

string

Proxied

Whether to proxy the record (optional for PATCH).

[JsonPropertyName("proxied")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Proxied { get; init; }

Property Value

bool?

Settings

Settings (optional for PATCH).

[JsonPropertyName("settings")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DnsRecordSettings? Settings { get; init; }

Property Value

DnsRecordSettings

Tags

Tags (optional for PATCH).

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

Property Value

IReadOnlyList<string>

Ttl

Time to live in seconds (optional for PATCH).

[JsonPropertyName("ttl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Ttl { get; init; }

Property Value

int?

Type

The DNS record type (optional for PATCH).

[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DnsRecordType? Type { get; init; }

Property Value

DnsRecordType?