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
TypeDnsRecordType?The DNS record type (optional for PATCH).
NamestringThe record name (optional for PATCH).
ContentstringThe record content (optional for PATCH).
Ttlint?Time to live in seconds (optional for PATCH).
Proxiedbool?Whether to proxy the record (optional for PATCH).
CommentstringComment (optional for PATCH).
TagsIReadOnlyList<string>Tags (optional for PATCH).
SettingsDnsRecordSettingsSettings (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
Content
The record content (optional for PATCH).
[JsonPropertyName("content")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Content { get; init; }
Property Value
Name
The record name (optional for PATCH).
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; init; }
Property Value
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
Tags
Tags (optional for PATCH).
[JsonPropertyName("tags")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Tags { get; init; }
Property Value
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; }