diff --git a/Extensions/Cloudflare.Zones/DnsRecordsExtensions.cs b/Extensions/Cloudflare.Zones/DnsRecordsExtensions.cs
deleted file mode 100644
index 0f5e4e0..0000000
--- a/Extensions/Cloudflare.Zones/DnsRecordsExtensions.cs
+++ /dev/null
@@ -1,600 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using AMWD.Net.Api.Cloudflare.Zones.Internals.Requests;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Extends the with methods for working with zones.
- ///
- public static class DnsRecordsExtensions
- {
- private static readonly IReadOnlyCollection _dataComponentTypes = [
- DnsRecordType.Caa,
- DnsRecordType.Cert,
- DnsRecordType.DnsKey,
- DnsRecordType.Ds,
- DnsRecordType.Https,
- DnsRecordType.Loc,
- DnsRecordType.NaPtr,
- DnsRecordType.SMimeA,
- DnsRecordType.Srv,
- DnsRecordType.SshFp,
- DnsRecordType.SvcB,
- DnsRecordType.TlsA,
- DnsRecordType.Uri,
- ];
-
- private static readonly IReadOnlyCollection _priorityTypes = [
- DnsRecordType.Mx,
- DnsRecordType.Srv,
- DnsRecordType.Uri,
- ];
-
- ///
- /// List, search, sort, and filter a zones' DNS records.
- ///
- /// The .
- /// The zone ID.
- /// Filter options (optional).
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task>> ListDnsRecords(this ICloudflareClient client, string zoneId, ListDnsRecordsFilter? options = null, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- return client.GetAsync>($"zones/{zoneId}/dns_records", options, cancellationToken);
- }
-
- ///
- /// Create a new DNS record for a zone.
- ///
- ///
- ///
- /// A/AAAA records cannot exist on the same name as CNAME records.
- /// NS records cannot exist on the same name as any other record type.
- /// Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.
- ///
- ///
- /// The .
- /// The request information.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> CreateDnsRecord(this ICloudflareClient client, CreateDnsRecordRequest request, CancellationToken cancellationToken = default)
- {
- request.ZoneId.ValidateCloudflareId();
-
- var req = ValidateDnsRecordRequest(request);
-
- return client.PostAsync($"zones/{request.ZoneId}/dns_records", req, cancellationToken: cancellationToken);
- }
-
- ///
- /// Send a Batch of DNS Record API calls to be executed together.
- ///
- ///
- ///
- ///
- /// Although Cloudflare will execute the batched operations in a single database transaction,
- /// Cloudflare's distributed KV store must treat each record change as a single key-value pair.
- /// This means that the propagation of changes is not atomic.
- /// See the documentation for more information.
- ///
- ///
- /// The operations you specify within the batch request body are always executed in the following order
- ///
- /// Deletes (delete)
- /// Updates (patch)
- /// Overwrites (put)
- /// Creates (post)
- ///
- ///
- ///
- ///
- /// The .
- /// The request information.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> BatchDnsRecords(this ICloudflareClient client, BatchDnsRecordsRequest request, CancellationToken cancellationToken = default)
- {
- request.ZoneId.ValidateCloudflareId();
-
- // Validate Deletes
- var deletes = new List();
- foreach (string recordId in request.DnsRecordIdsToDelete)
- {
- recordId.ValidateCloudflareId();
- deletes.Add(new InternalDnsRecordId { Id = recordId });
- }
-
- // Validate Updates
- var updates = new List();
- foreach (var update in request.DnsRecordsToUpdate)
- {
- update.Id.ValidateCloudflareId();
- if (update.ZoneId != request.ZoneId)
- throw new ArgumentException($"The ZoneId of the update request ({update.ZoneId}) does not match the ZoneId of the batch request ({request.ZoneId}).");
-
- var baseReq = ValidateDnsRecordRequest(update);
- updates.Add(new InternalBatchUpdateRequest(update.Id, baseReq));
- }
-
- // Validate Overwrites
- var overwrites = new List();
- foreach (var overwrite in request.DnsRecordsToOverwrite)
- {
- overwrite.Id.ValidateCloudflareId();
- if (overwrite.ZoneId != request.ZoneId)
- throw new ArgumentException($"The ZoneId of the overwrite request ({overwrite.ZoneId}) does not match the ZoneId of the batch request ({request.ZoneId}).");
-
- var baseReq = ValidateDnsRecordRequest(overwrite);
- overwrites.Add(new InternalBatchUpdateRequest(overwrite.Id, baseReq));
- }
-
- // Validate Creates
- var creates = new List();
- foreach (var create in request.DnsRecordsToCreate)
- creates.Add(ValidateDnsRecordRequest(create));
-
- var req = new InternalBatchRequest();
-
- if (deletes.Count > 0)
- req.Deletes = deletes;
-
- if (updates.Count > 0)
- req.Patches = updates;
-
- if (overwrites.Count > 0)
- req.Puts = overwrites;
-
- if (creates.Count > 0)
- req.Posts = creates;
-
- return client.PostAsync($"zones/{request.ZoneId}/dns_records/batch", req, cancellationToken: cancellationToken);
- }
-
- ///
- /// You can export your BIND config through this endpoint.
- ///
- ///
- /// See the documentation for more information.
- ///
- /// The .
- /// The zone ID.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> ExportDnsRecords(this ICloudflareClient client, string zoneId, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- return client.GetAsync($"zones/{zoneId}/dns_records/export", cancellationToken: cancellationToken);
- }
-
- ///
- /// You can upload your BIND config through this endpoint.
- ///
- ///
- /// See the documentation for more information.
- ///
- /// The .
- /// The request information.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> ImportDnsRecords(this ICloudflareClient client, ImportDnsRecordsRequest request, CancellationToken cancellationToken = default)
- {
- request.ZoneId.ValidateCloudflareId();
-
- if (string.IsNullOrWhiteSpace(request.File))
- throw new ArgumentNullException(nameof(request.File));
-
- var req = new MultipartFormDataContent();
-
- if (request.Proxied.HasValue)
- req.Add(new StringContent(request.Proxied.Value.ToString().ToLowerInvariant()), "proxied");
-
- byte[] content = File.Exists(request.File)
- ? File.ReadAllBytes(request.File)
- : Encoding.UTF8.GetBytes(request.File);
-
- req.Add(new ByteArrayContent(content), "file");
-
- return client.PostAsync($"zones/{request.ZoneId}/dns_records/import", req, cancellationToken: cancellationToken);
- }
-
- ///
- /// Scan for common DNS records on your domain and automatically add them to your zone.
- ///
- /// Useful if you haven't updated your nameservers yet.
- ///
- /// The .
- /// The zone ID.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> ScanDnsRecords(this ICloudflareClient client, string zoneId, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- return client.PostAsync($"zones/{zoneId}/dns_records/scan", null, cancellationToken: cancellationToken);
- }
-
- ///
- /// Deletes a DNS record.
- ///
- /// The .
- /// The zone ID.
- /// The record ID.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> DeleteDnsRecord(this ICloudflareClient client, string zoneId, string dnsRecordId, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- dnsRecordId.ValidateCloudflareId();
- return client.DeleteAsync($"zones/{zoneId}/dns_records/{dnsRecordId}", cancellationToken: cancellationToken);
- }
-
- ///
- /// Returns details for a DNS record.
- ///
- /// The .
- /// The zone ID.
- /// The record ID.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> DnsRecordDetails(this ICloudflareClient client, string zoneId, string dnsRecordId, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- dnsRecordId.ValidateCloudflareId();
- return client.GetAsync($"zones/{zoneId}/dns_records/{dnsRecordId}", cancellationToken: cancellationToken);
- }
-
- ///
- /// Update an existing DNS record.
- ///
- ///
- ///
- /// A/AAAA records cannot exist on the same name as CNAME records.
- /// NS records cannot exist on the same name as any other record type.
- /// Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.
- ///
- ///
- /// The .
- /// The request information.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> UpdateDnsRecord(this ICloudflareClient client, UpdateDnsRecordRequest request, CancellationToken cancellationToken = default)
- {
- request.ZoneId.ValidateCloudflareId();
- request.Id.ValidateCloudflareId();
-
- var req = ValidateDnsRecordRequest(request);
-
- return client.PatchAsync($"zones/{request.ZoneId}/dns_records/{request.Id}", req, cancellationToken: cancellationToken);
- }
-
- ///
- /// Overwrite an existing DNS record.
- ///
- ///
- ///
- /// A/AAAA records cannot exist on the same name as CNAME records.
- /// NS records cannot exist on the same name as any other record type.
- /// Domain names are always represented in Punycode, even if Unicode characters were used when creating the record.
- ///
- ///
- /// The .
- /// The request information.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static Task> OverwriteDnsRecord(this ICloudflareClient client, OverwriteDnsRecordRequest request, CancellationToken cancellationToken = default)
- {
- request.ZoneId.ValidateCloudflareId();
- request.Id.ValidateCloudflareId();
-
- var req = ValidateDnsRecordRequest(request);
-
- return client.PutAsync($"zones/{request.ZoneId}/dns_records/{request.Id}", req, cancellationToken: cancellationToken);
- }
-
- private static InternalDnsRecordRequest ValidateDnsRecordRequest(CreateDnsRecordRequest request)
- {
- if (string.IsNullOrWhiteSpace(request.Name))
- throw new ArgumentNullException(nameof(request.Name));
-
- if (!Enum.IsDefined(typeof(DnsRecordType), request.Type))
- throw new ArgumentOutOfRangeException(nameof(request.Type), request.Type, "Value must be one of the 'ZoneDnsRecordType' enum values.");
-
- var req = new InternalDnsRecordRequest(request.Type, request.Name)
- {
- Comment = request.Comment?.Trim(),
- Proxied = request.Proxied,
- Tags = request.Tags?.Where(t => !string.IsNullOrWhiteSpace(t)).ToList()
- };
-
- if (!_dataComponentTypes.Contains(request.Type) && string.IsNullOrWhiteSpace(request.Content))
- throw new ArgumentNullException(nameof(request.Content));
- else
- req.Content = request.Content?.Trim();
-
- if (request.Type == DnsRecordType.Cname && request.Settings != null && request.Settings is DnsRecord.CnameSettings cnameSettings)
- req.Settings = new DnsRecord.CnameSettings(cnameSettings.FlattenCname);
-
- if (_dataComponentTypes.Contains(request.Type) && request.Data == null)
- throw new ArgumentNullException(nameof(request.Data));
-
- if (_priorityTypes.Contains(request.Type))
- {
- if (!request.Priority.HasValue)
- throw new ArgumentNullException(nameof(request.Priority));
-
- req.Priority = request.Priority.Value;
- }
-
- if (request.Ttl.HasValue)
- {
- if (request.Ttl == 1)
- {
- req.Ttl = 1;
- }
- else if (request.Ttl < 30 || 86400 < request.Ttl)
- {
- throw new ArgumentOutOfRangeException(nameof(request.Ttl), request.Ttl, "Value must be between 60 (Enterprise: 30) and 86400.");
- }
- else
- {
- req.Ttl = request.Ttl;
- }
- }
-
- switch (request.Type)
- {
- case DnsRecordType.Caa:
- if (request.Data is DnsRecord.CaaData caaData)
- {
- if (string.IsNullOrWhiteSpace(caaData.Tag))
- throw new ArgumentNullException(nameof(caaData.Tag));
-
- if (string.IsNullOrWhiteSpace(caaData.Value))
- throw new ArgumentNullException(nameof(caaData.Value));
-
- req.Data = new DnsRecord.CaaData(caaData.Flags, caaData.Tag, caaData.Value);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'CaaData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Cert:
- if (request.Data is DnsRecord.CertData certData)
- {
- if (string.IsNullOrWhiteSpace(certData.Certificate))
- throw new ArgumentNullException(nameof(certData.Certificate));
-
- req.Data = new DnsRecord.CertData(certData.Algorithm, certData.Certificate, certData.KeyTag, certData.Type);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'CertData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.DnsKey:
- if (request.Data is DnsRecord.DnsKeyData dnsKeyData)
- {
- if (string.IsNullOrWhiteSpace(dnsKeyData.PublicKey))
- throw new ArgumentNullException(nameof(dnsKeyData.PublicKey));
-
- req.Data = new DnsRecord.DnsKeyData(dnsKeyData.Algorithm, dnsKeyData.Flags, dnsKeyData.Protocol, dnsKeyData.PublicKey);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'DnsKeyData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Ds:
- if (request.Data is DnsRecord.DsData dsData)
- {
- if (string.IsNullOrWhiteSpace(dsData.Digest))
- throw new ArgumentNullException(nameof(dsData.Digest));
-
- req.Data = new DnsRecord.DsData(dsData.Algorithm, dsData.Digest, dsData.DigestType, dsData.KeyTag);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'DsData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Https:
- if (request.Data is DnsRecord.HttpsData httpsData)
- {
- if (string.IsNullOrWhiteSpace(httpsData.Target))
- throw new ArgumentNullException(nameof(httpsData.Target));
-
- if (string.IsNullOrWhiteSpace(httpsData.Value))
- throw new ArgumentNullException(nameof(httpsData.Value));
-
- req.Data = new DnsRecord.HttpsData(httpsData.Priority, httpsData.Target, httpsData.Value);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'HttpsData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Loc:
- if (request.Data is DnsRecord.LocData locData)
- {
- if (locData.LatitudeDegrees < 0 || 90 < locData.LatitudeDegrees)
- throw new ArgumentOutOfRangeException(nameof(locData.LatitudeDegrees), locData.LatitudeDegrees, "Value must be between 0 and 90.");
-
- if (locData.LatitudeMinutes < 0 || 59 < locData.LatitudeMinutes)
- throw new ArgumentOutOfRangeException(nameof(locData.LatitudeMinutes), locData.LatitudeMinutes, "Value must be between 0 and 59.");
-
- if (locData.LatitudeSeconds < 0 || 59.999 < locData.LatitudeSeconds)
- throw new ArgumentOutOfRangeException(nameof(locData.LatitudeSeconds), locData.LatitudeSeconds, "Value must be between 0 and 59.999.");
-
- if (!Enum.IsDefined(typeof(DnsRecord.LatitudeDirection), locData.LatitudeDirection))
- throw new ArgumentOutOfRangeException(nameof(locData.LatitudeDirection), locData.LatitudeDirection, "Value must be one of the 'ZoneDnsRecord.LatitudeDirection' enum values.");
-
- if (locData.LongitudeDegrees < 0 || 180 < locData.LongitudeDegrees)
- throw new ArgumentOutOfRangeException(nameof(locData.LongitudeDegrees), locData.LongitudeDegrees, "Value must be between 0 and 180.");
-
- if (locData.LongitudeMinutes < 0 || 59 < locData.LongitudeMinutes)
- throw new ArgumentOutOfRangeException(nameof(locData.LongitudeMinutes), locData.LongitudeMinutes, "Value must be between 0 and 59.");
-
- if (locData.LongitudeSeconds < 0 || 59.999 < locData.LongitudeSeconds)
- throw new ArgumentOutOfRangeException(nameof(locData.LongitudeSeconds), locData.LongitudeSeconds, "Value must be between 0 and 59.999.");
-
- if (!Enum.IsDefined(typeof(DnsRecord.LongitudeDirection), locData.LongitudeDirection))
- throw new ArgumentOutOfRangeException(nameof(locData.LongitudeDirection), locData.LongitudeDirection, "Value must be one of the 'ZoneDnsRecord.LongitudeDirection' enum values.");
-
- if (locData.Altitude < -100_000 || 42_849_672.95 < locData.Altitude)
- throw new ArgumentOutOfRangeException(nameof(locData.Altitude), locData.Altitude, "Value must be between -100,000.00 and 42,849,672.95.");
-
- if (locData.Size < 0 || 90_000_000 < locData.Size)
- throw new ArgumentOutOfRangeException(nameof(locData.Size), locData.Size, "Value must be between 0 and 90,000,000.");
-
- if (locData.PrecisionHorizontal < 0 || 90_000_000 < locData.PrecisionHorizontal)
- throw new ArgumentOutOfRangeException(nameof(locData.PrecisionHorizontal), locData.PrecisionHorizontal, "Value must be between 0 and 90,000,000.");
-
- if (locData.PrecisionVertical < 0 || 90_000_000 < locData.PrecisionVertical)
- throw new ArgumentOutOfRangeException(nameof(locData.PrecisionVertical), locData.PrecisionVertical, "Value must be between 0 and 90,000,000.");
-
- req.Data = new DnsRecord.LocData(
- latitudeDegrees: locData.LatitudeDegrees,
- latitudeMinutes: locData.LatitudeMinutes,
- latitudeSeconds: Math.Floor(locData.LatitudeSeconds * 1000) / 1000, // Truncate to 3 decimal places
- latitudeDirection: locData.LatitudeDirection,
- longitudeDegrees: locData.LongitudeDegrees,
- longitudeMinutes: locData.LongitudeMinutes,
- longitudeSeconds: Math.Floor(locData.LongitudeSeconds * 1000) / 1000, // Truncate to 3 decimal places
- longitudeDirection: locData.LongitudeDirection,
- altitude: Math.Floor(locData.Altitude * 100) / 100, // Truncate to 2 decimal places
- size: locData.Size,
- precisionHorizontal: locData.PrecisionHorizontal,
- precisionVertical: locData.PrecisionVertical
- );
- }
- else
- {
- throw new ArgumentException("Value must be of type 'LocData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.NaPtr:
- if (request.Data is DnsRecord.NaPtrData naPtrData)
- {
- if (string.IsNullOrWhiteSpace(naPtrData.Flags))
- throw new ArgumentNullException(nameof(naPtrData.Flags));
-
- if (string.IsNullOrWhiteSpace(naPtrData.Regex))
- throw new ArgumentNullException(nameof(naPtrData.Regex));
-
- if (string.IsNullOrWhiteSpace(naPtrData.Replacement))
- throw new ArgumentNullException(nameof(naPtrData.Replacement));
-
- if (string.IsNullOrWhiteSpace(naPtrData.Service))
- throw new ArgumentNullException(nameof(naPtrData.Service));
-
- req.Data = new DnsRecord.NaPtrData(
- naPtrData.Flags,
- naPtrData.Order,
- naPtrData.Preference,
- naPtrData.Regex,
- naPtrData.Replacement,
- naPtrData.Service
- );
- }
- else
- {
- throw new ArgumentException("Value must be of type 'NaPtrData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.SMimeA:
- if (request.Data is DnsRecord.SMimeAData sMimeAData)
- {
- if (string.IsNullOrWhiteSpace(sMimeAData.Certificate))
- throw new ArgumentNullException(nameof(sMimeAData.Certificate));
-
- req.Data = new DnsRecord.SMimeAData(sMimeAData.Certificate, sMimeAData.MatchingType, sMimeAData.Selector, sMimeAData.Usage);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'SMimeAData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Srv:
- if (request.Data is DnsRecord.SrvData srvData)
- {
- if (string.IsNullOrWhiteSpace(srvData.Target))
- throw new ArgumentNullException(nameof(srvData.Target));
-
- req.Data = new DnsRecord.SrvData(srvData.Port, srvData.Priority, srvData.Target, srvData.Weight);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'SrvData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.SshFp:
- if (request.Data is DnsRecord.SshFpData sshFpData)
- {
- if (string.IsNullOrWhiteSpace(sshFpData.Fingerprint))
- throw new ArgumentNullException(nameof(sshFpData.Fingerprint));
-
- req.Data = new DnsRecord.SshFpData(sshFpData.Algorithm, sshFpData.Fingerprint, sshFpData.Type);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'SshFpData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.SvcB:
- if (request.Data is DnsRecord.SvcBData svcBData)
- {
- if (string.IsNullOrWhiteSpace(svcBData.Target))
- throw new ArgumentNullException(nameof(svcBData.Target));
-
- if (string.IsNullOrWhiteSpace(svcBData.Value))
- throw new ArgumentNullException(nameof(svcBData.Value));
-
- req.Data = new DnsRecord.SvcBData(svcBData.Priority, svcBData.Target, svcBData.Value);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'SvcBData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.TlsA:
- if (request.Data is DnsRecord.TlsAData tlsAData)
- {
- if (string.IsNullOrWhiteSpace(tlsAData.Certificate))
- throw new ArgumentNullException(nameof(tlsAData.Certificate));
-
- req.Data = new DnsRecord.TlsAData(tlsAData.Certificate, tlsAData.MatchingType, tlsAData.Selector, tlsAData.Usage);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'TlsAData'.", nameof(request.Data));
- }
- break;
-
- case DnsRecordType.Uri:
- if (request.Data is DnsRecord.UriData uriData)
- {
- if (string.IsNullOrWhiteSpace(uriData.Target))
- throw new ArgumentNullException(nameof(uriData.Target));
-
- req.Data = new DnsRecord.UriData(uriData.Target, uriData.Weight);
- }
- else
- {
- throw new ArgumentException("Value must be of type 'UriData'.", nameof(request.Data));
- }
- break;
- }
-
- return req;
- }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/DnsRecordType.cs b/Extensions/Cloudflare.Zones/Enums/DnsRecordType.cs
deleted file mode 100644
index f1de08a..0000000
--- a/Extensions/Cloudflare.Zones/Enums/DnsRecordType.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// DNS record types.
- ///
- ///
- /// A list with short description can be found @wikipedia.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum DnsRecordType : int
- {
- ///
- /// Address record.
- ///
- ///
- /// Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host, but it is also used for DNSBLs, storing subnet masks in RFC 1101, etc.
- ///
- /// example.com. 3600 IN A 93.184.215.14
- ///
- ///
- [EnumMember(Value = "A")]
- A = 1,
-
- ///
- /// Name server record.
- ///
- ///
- /// Delegates a DNS zone to use the given authoritative name servers.
- ///
- /// example.com. 86400 IN NS a.iana-servers.net.
- ///
- ///
- [EnumMember(Value = "NS")]
- Ns = 2,
-
- ///
- /// Canonical name record.
- ///
- ///
- /// Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
- ///
- /// autodiscover.example.com. 86400 IN CNAME mail.example.com.
- ///
- ///
- [EnumMember(Value = "CNAME")]
- Cname = 5,
-
- ///
- /// PTR Resource Record.
- ///
- ///
- /// Pointer to a canonical name. Unlike a CNAME, DNS processing stops and just the name is returned. The most common use is for implementing reverse DNS lookups, but other uses include such things as DNS-SD.
- ///
- /// 14.215.184.93.in-addr.arpa. 86400 IN PTR example.com.
- ///
- ///
- [EnumMember(Value = "PTR")]
- Ptr = 12,
-
- ///
- /// Mail exchange record.
- ///
- ///
- /// List of mail exchange servers that accept email for a domain.
- ///
- /// example.com. 43200 IN MX 0 mail.example.com.
- ///
- ///
- [EnumMember(Value = "MX")]
- Mx = 15,
-
- ///
- /// Text record.
- ///
- ///
- /// Originally for arbitrary human-readable text in a DNS record. Since the early 1990s, however, this record more often carries machine-readable data, such as specified by RFC 1464, opportunistic encryption, Sender Policy Framework, DKIM, DMARC, DNS-SD, etc.
- ///
- /// More information about TXT records on Cloudflare.
- ///
- /// example.com. 86400 IN TXT "v=spf1 -all"
- ///
- ///
- [EnumMember(Value = "TXT")]
- Txt = 16,
-
- ///
- /// IPv6 address record.
- ///
- ///
- /// Returns a 128-bit IPv6 address, most commonly used to map hostnames to an IP address of the host.
- ///
- /// example.com. 3600 IN AAAA 2606:2800:21f:cb07:6820:80da:af6b:8b2c
- ///
- ///
- [EnumMember(Value = "AAAA")]
- Aaaa = 28,
-
- ///
- /// Location record.
- ///
- ///
- /// Specifies a geographical location associated with a domain name.
- ///
- /// SW1A2AA.find.me.uk. 2592000 IN LOC 51 30 12.748 N 0 7 39.611 W 0.00m 0.00m 0.00m 0.00m
- ///
- ///
- [EnumMember(Value = "LOC")]
- Loc = 29,
-
- ///
- /// Service locator.
- ///
- ///
- /// Generalized service location record, used for newer protocols instead of creating protocol-specific records such as MX.
- ///
- /// _autodiscover._tcp.example.com. 604800 IN SRV 1 0 443 mail.example.com.
- ///
- ///
- [EnumMember(Value = "SRV")]
- Srv = 33,
-
- ///
- /// Naming Authority Pointer.
- ///
- ///
- /// Allows regular-expression-based rewriting of domain names which can then be used as URIs, further domain names to lookups, etc.
- ///
- /// example.com. 86400 IN NAPTR 100 10 "S" "SIP+D2T" "" _sip._tcp.example.com.
- ///
- ///
- [EnumMember(Value = "NAPTR")]
- NaPtr = 35,
-
- ///
- /// Certificate record.
- ///
- ///
- /// Stores PKIX, SPKI, PGP, etc.
- ///
- /// example.com. 86400 IN CERT 2 77 2 TUlJQ1l6Q0NBY3lnQXdJQkFnSUJBREFOQmdrcWh
- ///
- ///
- [EnumMember(Value = "CERT")]
- Cert = 37,
-
- ///
- /// Delegation signer.
- ///
- ///
- /// The record used to identify the DNSSEC signing key of a delegated zone.
- ///
- /// example.com. 86400 IN DS 370 13 2 BE74359954660069D5C63D200C39F5603827D7DD02B56F120EE9F3A8 6764247C
- ///
- ///
- [EnumMember(Value = "DS")]
- Ds = 43,
-
- ///
- /// SSH Public Key Fingerprint.
- ///
- ///
- /// Resource record for publishing SSH public host key fingerprints in the DNS, in order to aid in verifying the authenticity of the host. RFC 6594 defines ECC SSH keys and SHA-256 hashes. See the IANA SSHFP RR parameters registry for details.
- ///
- /// example.com. 600 IN SSHFP 2 1 123456789abcdef67890123456789abcdef67890
- ///
- ///
- [EnumMember(Value = "SSHFP")]
- SshFp = 44,
-
- ///
- /// DNS Key record.
- ///
- ///
- /// The key record used in DNSSEC. Uses the same format as the KEY record.
- ///
- /// example.com. 3600 IN DNSKEY 256 3 13 OtuN/SL9sE+SDQ0tOLeezr1KzUNi77FflTjxQylUhm3V7m13Vz9tYQuc SGK0pyxISo9CQsszubAwJSypq3li3g==
- ///
- ///
- [EnumMember(Value = "DNSKEY")]
- DnsKey = 48,
-
- ///
- /// TLSA certificate association.
- ///
- ///
- /// A record for DANE. RFC 6698 defines "The TLSA DNS resource record is used to associate a TLS server certificate or public key with the domain name where the record is found, thus forming a 'TLSA certificate association'".
- ///
- /// _443._tcp.example.com. 3600 IN TLSA 3 0 18cb0fc6c527506a053f4f14c8464bebbd6dede2738d11468dd953d7d6a3021f1
- ///
- ///
- [EnumMember(Value = "TLSA")]
- TlsA = 52,
-
- ///
- /// S/MIME cert association.
- ///
- ///
- /// Associates an S/MIME certificate with a domain name for sender authentication.
- ///
- /// example.com. 3600 IN SMIMEA 0 0 0 keyKEY1234keyKEY
- ///
- ///
- [EnumMember(Value = "SMIMEA")]
- SMimeA = 53,
-
- ///
- /// OpenPGP public key record.
- ///
- ///
- /// A DNS-based Authentication of Named Entities (DANE) method for publishing and locating OpenPGP public keys in DNS for a specific email address using an OPENPGPKEY DNS resource record.
- ///
- /// 00d8d3f11739d2f3537099982b4674c29fc59a8fda350fca1379613a._openpgpkey.example.com. 3600 IN OPENPGPKEY a2V5S0VZMTIzNGtleUtFWQ==
- ///
- ///
- [EnumMember(Value = "OPENPGPKEY")]
- OpenPgpgKey = 61,
-
- ///
- /// Service Binding.
- ///
- ///
- /// RR that improves performance for clients that need to resolve many resources to access a domain.
- ///
- /// example.com. 3600 IN SVCB 1 . alpn="h2,http/1.1"
- ///
- ///
- [EnumMember(Value = "SVCB")]
- SvcB = 64,
-
- ///
- /// HTTPS Binding.
- ///
- ///
- /// RR that improves performance for clients that need to resolve many resources to access a domain.
- ///
- /// example.com. 3600 IN HTTPS 1 svc.example.com. alpn=h2
- ///
- ///
- [EnumMember(Value = "HTTPS")]
- Https = 65,
-
- ///
- /// Uniform Resource Identifier.
- ///
- ///
- /// Can be used for publishing mappings from hostnames to URIs.
- ///
- /// _ftp._tcp.example.com. 3600 IN URI 10 1 "ftp://ftp.example.com/public"
- ///
- ///
- [EnumMember(Value = "URI")]
- Uri = 256,
-
- ///
- /// Certification Authority Authorization
- ///
- ///
- /// DNS Certification Authority Authorization, constraining acceptable CAs for a host/domain.
- ///
- /// example.com. 604800 IN CAA 0 issue "letsencrypt.org"
- ///
- ///
- [EnumMember(Value = "CAA")]
- Caa = 257,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/DnsRecordsOrderBy.cs b/Extensions/Cloudflare.Zones/Enums/DnsRecordsOrderBy.cs
deleted file mode 100644
index 556716e..0000000
--- a/Extensions/Cloudflare.Zones/Enums/DnsRecordsOrderBy.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Possible fields to order DNS records by.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum DnsRecordsOrderBy
- {
- ///
- /// Order by record type.
- ///
- [EnumMember(Value = "type")]
- Type = 1,
-
- ///
- /// Order by record name.
- ///
- [EnumMember(Value = "name")]
- Name = 2,
-
- ///
- /// Order by record content.
- ///
- [EnumMember(Value = "content")]
- Content = 3,
-
- ///
- /// Order by record TTL.
- ///
- [EnumMember(Value = "ttl")]
- Ttl = 4,
-
- ///
- /// Order by record proxied.
- ///
- [EnumMember(Value = "proxied")]
- Proxied = 5
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/NameserverType.cs b/Extensions/Cloudflare.Zones/Enums/NameserverType.cs
deleted file mode 100644
index 0ab1625..0000000
--- a/Extensions/Cloudflare.Zones/Enums/NameserverType.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The nameserver type.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum NameserverType
- {
- ///
- /// Cloudflare standard.
- ///
- [EnumMember(Value = "cloudflare.standard")]
- CloudflareStandard = 1,
-
- ///
- /// Cloudflare random.
- ///
- [EnumMember(Value = "cloudflare.standard.random")]
- CloudflareRandom = 2,
-
- ///
- /// Custom specified by account.
- ///
- [EnumMember(Value = "custom.account")]
- CustomAccount = 3,
-
- ///
- /// Custom specified by tenant.
- ///
- [EnumMember(Value = "custom.tenant")]
- CustomTenant = 4,
-
- ///
- /// Custom specified by zone.
- ///
- [EnumMember(Value = "custom.zone")]
- CustomZone = 5,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/ZoneMode.cs b/Extensions/Cloudflare.Zones/Enums/ZoneMode.cs
deleted file mode 100644
index b7a05a6..0000000
--- a/Extensions/Cloudflare.Zones/Enums/ZoneMode.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Zone modes.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum ZoneMode
- {
- ///
- /// Standard.
- ///
- [EnumMember(Value = "standard")]
- Standard = 1,
-
- ///
- /// Only as CDN.
- ///
- [EnumMember(Value = "cdn_only")]
- CdnOnly = 2,
-
- ///
- /// Only as DNS.
- ///
- [EnumMember(Value = "dns_only")]
- DnsOnly = 3,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/ZoneStatus.cs b/Extensions/Cloudflare.Zones/Enums/ZoneStatus.cs
deleted file mode 100644
index 4573506..0000000
--- a/Extensions/Cloudflare.Zones/Enums/ZoneStatus.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// A zone status.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum ZoneStatus
- {
- ///
- /// Zone is initializing.
- ///
- [EnumMember(Value = "initializing")]
- Initializing = 1,
-
- ///
- /// Zone is pending.
- ///
- [EnumMember(Value = "pending")]
- Pending = 2,
-
- ///
- /// Zone is active.
- ///
- [EnumMember(Value = "active")]
- Active = 3,
-
- ///
- /// Zone has been moved.
- ///
- [EnumMember(Value = "moved")]
- Moved = 4,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/ZoneType.cs b/Extensions/Cloudflare.Zones/Enums/ZoneType.cs
deleted file mode 100644
index 31a7bbb..0000000
--- a/Extensions/Cloudflare.Zones/Enums/ZoneType.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Zone type.
- ///
- ///
- /// A full zone implies that DNS is hosted with Cloudflare.
- /// A partial zone is typically a partner-hosted zone or a CNAME setup.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum ZoneType
- {
- ///
- /// Full Setup (most common).
- ///
- ///
- /// Use Cloudflare as your primary DNS provider and manage your DNS records on Cloudflare.
- ///
- [EnumMember(Value = "full")]
- Full = 1,
-
- ///
- /// Zone transfers.
- ///
- ///
- /// Use Cloudflare and another DNS provider together across your entire zone to increase availability and fault tolerance.
- ///
- /// DNS records will be transferred between providers using
- /// AXFR or IXFR.
- ///
- [EnumMember(Value = "secondary")]
- Secondary = 2,
-
- ///
- /// Partial (CNAME) setup.
- ///
- ///
- /// Keep your primary DNS provider and only use Cloudflare's reverse proxy for individual subdomains.
- ///
- [EnumMember(Value = "partial")]
- Partial = 3,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Enums/ZonesOrderBy.cs b/Extensions/Cloudflare.Zones/Enums/ZonesOrderBy.cs
deleted file mode 100644
index 4d3884a..0000000
--- a/Extensions/Cloudflare.Zones/Enums/ZonesOrderBy.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Converters;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Possible fields to order zones by.
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum ZonesOrderBy
- {
- ///
- /// Order by zone name.
- ///
- [EnumMember(Value = "name")]
- Name = 1,
-
- ///
- /// Order by zone status.
- ///
- [EnumMember(Value = "status")]
- Status = 2,
-
- ///
- /// Order by account ID.
- ///
- [EnumMember(Value = "account.id")]
- AccountId = 3,
-
- ///
- /// Order by account name.
- ///
- [EnumMember(Value = "account.name")]
- AccountName = 4,
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Filters/ListDnsRecordsFilter.cs b/Extensions/Cloudflare.Zones/Filters/ListDnsRecordsFilter.cs
deleted file mode 100644
index d5f1eeb..0000000
--- a/Extensions/Cloudflare.Zones/Filters/ListDnsRecordsFilter.cs
+++ /dev/null
@@ -1,402 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Filter for listing DNS records.
- ///
- public class ListDnsRecordsFilter : IQueryParameterFilter
- {
- #region Comment
-
- ///
- /// Exact value of the DNS record comment.
- /// This is a convenience alias for .
- ///
- public string? Comment { get; set; }
-
- ///
- /// If this parameter is present, only records without a comment are returned.
- ///
- public bool? CommentAbsent { get; set; }
-
- ///
- /// Substring of the DNS record comment.
- /// Comment filters are case-insensitive.
- ///
- public string? CommentContains { get; set; }
-
- ///
- /// Suffix of the DNS record comment.
- /// Comment filters are case-insensitive.
- ///
- public string? CommentEndsWith { get; set; }
-
- ///
- /// Exact value of the DNS record comment.
- /// Comment filters are case-insensitive.
- ///
- public string? CommentExact { get; set; }
-
- ///
- /// If this parameter is present, only records with a comment are returned.
- ///
- public bool? CommentPresent { get; set; }
-
- ///
- /// Prefix of the DNS record comment.
- /// Comment filters are case-insensitive.
- ///
- public string? CommentStartsWith { get; set; }
-
- #endregion Comment
-
- #region Content
-
- ///
- /// Exact value of the DNS record Content.
- /// This is a convenience alias for .
- ///
- public string? Content { get; set; }
-
- ///
- /// Substring of the DNS record Content.
- /// Content filters are case-insensitive.
- ///
- public string? ContentContains { get; set; }
-
- ///
- /// Suffix of the DNS record Content.
- /// Content filters are case-insensitive.
- ///
- public string? ContentEndsWith { get; set; }
-
- ///
- /// Exact value of the DNS record Content.
- /// Content filters are case-insensitive.
- ///
- public string? ContentExact { get; set; }
-
- ///
- /// Prefix of the DNS record Content.
- /// Content filters are case-insensitive.
- ///
- public string? ContentStartsWith { get; set; }
-
- #endregion Content
-
- ///
- /// Direction to order DNS records in.
- ///
- public SortDirection? Direction { get; set; }
-
- ///
- /// Whether to match all search requirements or at least one (any).
- ///
- ///
- ///
- /// If set to , acts like a logical AND between filters.
- ///
- /// If set to , acts like a logical OR instead.
- ///
- ///
- /// Note that the interaction between tag filters is controlled by the parameter instead.
- ///
- ///
- public FilterMatchType? Match { get; set; }
-
- #region Name
-
- ///
- /// Exact value of the DNS record Name.
- /// This is a convenience alias for .
- ///
- public string? Name { get; set; }
-
- ///
- /// Substring of the DNS record Name.
- /// Name filters are case-insensitive.
- ///
- public string? NameContains { get; set; }
-
- ///
- /// Suffix of the DNS record Name.
- /// Name filters are case-insensitive.
- ///
- public string? NameEndsWith { get; set; }
-
- ///
- /// Exact value of the DNS record Name.
- /// Name filters are case-insensitive.
- ///
- public string? NameExact { get; set; }
-
- ///
- /// Prefix of the DNS record Name.
- /// Name filters are case-insensitive.
- ///
- public string? NameStartsWith { get; set; }
-
- #endregion Name
-
- ///
- /// Field to order DNS records by.
- ///
- public DnsRecordsOrderBy? OrderBy { get; set; }
-
- ///
- /// Page number of paginated results.
- ///
- /// 1 <= X
- public int? Page { get; set; }
-
- ///
- /// Number of DNS records per page.
- ///
- /// 1 <= X <= 5,000,000
- public int? PerPage { get; set; }
-
- ///
- /// Whether the record is receiving the performance and security benefits of Cloudflare.
- ///
- public bool? Proxied { get; set; }
-
- ///
- /// Allows searching in multiple properties of a DNS record simultaneously.
- ///
- ///
- ///
- /// This parameter is intended for human users, not automation.
- /// Its exact behavior is intentionally left unspecified and is subject to change in the future.
- ///
- ///
- ///
- /// This parameter works independently of the setting.
- ///
- /// For automated searches, please use the other available parameters.
- ///
- ///
- ///
- public string? Search { get; set; }
-
- #region Tag
-
- ///
- /// Condition on the DNS record tag.
- ///
- ///
- ///
- /// Parameter values can be of the form <tag-name>:<tag-value> to search for an exact name:value pair,
- /// or just <tag-name> to search for records with a specific tag name regardless of its value.
- ///
- ///
- /// This is a convenience shorthand for the more powerful tag.<predicate> parameters.
- ///
- /// Examples:
- ///
- /// tag=important is equivalent to tag.present=important
- /// tag=team:DNS is equivalent to tag.exact=team:DNS
- ///
- ///
- ///
- public string? Tag { get; set; }
-
- ///
- /// Name of a tag which must not be present on the DNS record.
- /// Tag filters are case-insensitive.
- ///
- public string? TagAbsent { get; set; }
-
- ///
- /// A tag and value, of the form <tag-name>:<tag-value>.
- /// Tag filters are case-insensitive.
- ///
- ///
- /// The API will only return DNS records that have a tag named <tag-name> whose value contains <tag-value>.
- ///
- public string? TagContains { get; set; }
-
- ///
- /// A tag and value, of the form <tag-name>:<tag-value>.
- /// Tag filters are case-insensitive.
- ///
- ///
- /// The API will only return DNS records that have a tag named <tag-name> whose value ends with <tag-value>.
- ///
- public string? TagEndsWith { get; set; }
-
- ///
- /// A tag and value, of the form <tag-name>:<tag-value>.
- /// Tag filters are case-insensitive.
- ///
- ///
- /// The API will only return DNS records that have a tag named <tag-name> whose value is <tag-value>.
- ///
- public string? TagExact { get; set; }
-
- ///
- /// Name of a tag which must be present on the DNS record.
- /// Tag filters are case-insensitive.
- ///
- public string? TagPresent { get; set; }
-
- ///
- /// A tag and value, of the form <tag-name>:<tag-value>.
- /// Tag filters are case-insensitive.
- ///
- ///
- /// The API will only return DNS records that have a tag named <tag-name> whose value starts with <tag-value>.
- ///
- public string? TagStartsWith { get; set; }
-
- #endregion Tag
-
- ///
- /// Whether to match all tag search requirements or at least one (any).
- ///
- ///
- ///
- /// If set to , acts like a logical AND between filters.
- ///
- /// If set to , acts like a logical OR instead.
- ///
- ///
- /// Note that the regular parameter is still used to combine the resulting condition with other filters that aren't related to tags.
- ///
- ///
- public FilterMatchType? TagMatch { get; set; }
-
- ///
- /// Record type.
- ///
- public DnsRecordType? Type { get; set; }
-
- ///
- public IDictionary GetQueryParameters()
- {
- var dict = new Dictionary();
-
-#pragma warning disable CS8602, CS8604 // There will be no null value below.
-
- #region Comment
-
- if (!string.IsNullOrWhiteSpace(Comment))
- dict.Add("comment", Comment.Trim());
-
- if (CommentAbsent.HasValue && CommentAbsent.Value)
- dict.Add("comment.absent", "true");
-
- if (!string.IsNullOrWhiteSpace(CommentContains))
- dict.Add("comment.contains", CommentContains.Trim());
-
- if (!string.IsNullOrWhiteSpace(CommentEndsWith))
- dict.Add("comment.endswith", CommentEndsWith.Trim());
-
- if (!string.IsNullOrWhiteSpace(CommentExact))
- dict.Add("comment.exact", CommentExact.Trim());
-
- if (CommentPresent.HasValue && CommentPresent.Value)
- dict.Add("comment.present", "true");
-
- if (!string.IsNullOrWhiteSpace(CommentStartsWith))
- dict.Add("comment.startswith", CommentStartsWith.Trim());
-
- #endregion Comment
-
- #region Content
-
- if (!string.IsNullOrWhiteSpace(Content))
- dict.Add("content", Content.Trim());
-
- if (!string.IsNullOrWhiteSpace(ContentContains))
- dict.Add("content.contains", ContentContains.Trim());
-
- if (!string.IsNullOrWhiteSpace(ContentEndsWith))
- dict.Add("content.endswith", ContentEndsWith.Trim());
-
- if (!string.IsNullOrWhiteSpace(ContentExact))
- dict.Add("content.exact", ContentExact.Trim());
-
- if (!string.IsNullOrWhiteSpace(ContentStartsWith))
- dict.Add("content.startswith", ContentStartsWith.Trim());
-
- #endregion Content
-
- if (Direction.HasValue && Enum.IsDefined(typeof(SortDirection), Direction.Value))
- dict.Add("direction", Direction.Value.GetEnumMemberValue());
-
- if (Match.HasValue && Enum.IsDefined(typeof(FilterMatchType), Match.Value))
- dict.Add("match", Match.Value.GetEnumMemberValue());
-
- #region Name
-
- if (!string.IsNullOrWhiteSpace(Name))
- dict.Add("name", Name.Trim());
-
- if (!string.IsNullOrWhiteSpace(NameContains))
- dict.Add("name.contains", NameContains.Trim());
-
- if (!string.IsNullOrWhiteSpace(NameEndsWith))
- dict.Add("name.endswith", NameEndsWith.Trim());
-
- if (!string.IsNullOrWhiteSpace(NameExact))
- dict.Add("name.exact", NameExact.Trim());
-
- if (!string.IsNullOrWhiteSpace(NameStartsWith))
- dict.Add("name.startswith", NameStartsWith.Trim());
-
- #endregion Name
-
- if (OrderBy.HasValue && Enum.IsDefined(typeof(DnsRecordsOrderBy), OrderBy.Value))
- dict.Add("order", OrderBy.Value.GetEnumMemberValue());
-
- if (Page.HasValue && Page.Value >= 1)
- dict.Add("page", Page.Value.ToString());
-
- if (PerPage.HasValue && PerPage.Value >= 1 && PerPage.Value <= 5_000_000)
- dict.Add("per_page", PerPage.Value.ToString());
-
- if (Proxied.HasValue)
- dict.Add("proxied", Proxied.Value.ToString().ToLowerInvariant());
-
- if (!string.IsNullOrWhiteSpace(Search))
- dict.Add("search", Search.Trim());
-
- #region Tag
-
- if (!string.IsNullOrWhiteSpace(Tag))
- dict.Add("tag", Tag.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagAbsent))
- dict.Add("tag.absent", TagAbsent.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagContains))
- dict.Add("tag.contains", TagContains.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagEndsWith))
- dict.Add("tag.endswith", TagEndsWith.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagExact))
- dict.Add("tag.exact", TagExact.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagPresent))
- dict.Add("tag.present", TagPresent.Trim());
-
- if (!string.IsNullOrWhiteSpace(TagStartsWith))
- dict.Add("tag.startswith", TagStartsWith.Trim());
-
- #endregion Tag
-
- if (TagMatch.HasValue && Enum.IsDefined(typeof(FilterMatchType), TagMatch.Value))
- dict.Add("tag_match", TagMatch.Value.GetEnumMemberValue());
-
- if (Type.HasValue && Enum.IsDefined(typeof(DnsRecordType), Type.Value))
- dict.Add("type", Type.Value.GetEnumMemberValue());
-
-#pragma warning restore CS8602, CS8604
-
- return dict;
- }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Filters/ListZonesFilter.cs b/Extensions/Cloudflare.Zones/Filters/ListZonesFilter.cs
deleted file mode 100644
index acc50d1..0000000
--- a/Extensions/Cloudflare.Zones/Filters/ListZonesFilter.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Filter for listing zones.
- ///
- public class ListZonesFilter : IQueryParameterFilter
- {
- ///
- /// An account ID.
- ///
- public string? AccountId { get; set; }
-
- ///
- /// An account Name.
- ///
- ///
- /// Optional filter operators can be provided to extend refine the search:
- ///
- /// equal (default)
- /// not_equal
- /// starts_with
- /// ends_with
- /// contains
- /// starts_with_case_sensitive
- /// ends_with_case_sensitive
- /// contains_case_sensitive
- ///
- ///
- /// Dev Account
- /// contains:Test
- public string? AccountName { get; set; }
-
- ///
- /// Direction to order zones.
- ///
- public SortDirection? Direction { get; set; }
-
- ///
- /// Whether to match all search requirements or at least one (any).
- ///
- public FilterMatchType? Match { get; set; }
-
- ///
- /// A domain name.
- ///
- ///
- /// Optional filter operators can be provided to extend refine the search:
- ///
- /// equal (default)
- /// not_equal
- /// starts_with
- /// ends_with
- /// contains
- /// starts_with_case_sensitive
- /// ends_with_case_sensitive
- /// contains_case_sensitive
- ///
- ///
- /// example.com
- /// contains:.org
- /// ends_with:arpa
- /// starts_with:dev
- public string? Name { get; set; }
-
- ///
- /// Field to order zones by.
- ///
- public ZonesOrderBy? OrderBy { get; set; }
-
- ///
- /// Page number of paginated results.
- ///
- /// 1 <= X
- public int? Page { get; set; }
-
- ///
- /// Number of zones per page.
- ///
- /// 5 <= X <= 50
- public int? PerPage { get; set; }
-
- ///
- /// A zone status.
- ///
- public ZoneStatus? Status { get; set; }
-
- ///
- public IDictionary GetQueryParameters()
- {
- var dict = new Dictionary();
-
-#pragma warning disable CS8602, CS8604 // There will be no null value below.
-
- if (!string.IsNullOrWhiteSpace(AccountId))
- dict.Add("account.id", AccountId.Trim());
-
- if (!string.IsNullOrWhiteSpace(AccountName))
- dict.Add("account.name", AccountName.Trim());
-
- if (Direction.HasValue && Enum.IsDefined(typeof(SortDirection), Direction.Value))
- dict.Add("direction", Direction.Value.GetEnumMemberValue());
-
- if (Match.HasValue && Enum.IsDefined(typeof(FilterMatchType), Match.Value))
- dict.Add("match", Match.Value.GetEnumMemberValue());
-
- if (!string.IsNullOrWhiteSpace(Name))
- dict.Add("name", Name);
-
- if (OrderBy.HasValue && Enum.IsDefined(typeof(ZonesOrderBy), OrderBy.Value))
- dict.Add("order", OrderBy.Value.GetEnumMemberValue());
-
- if (Page.HasValue && Page.Value >= 1)
- dict.Add("page", Page.Value.ToString());
-
- if (PerPage.HasValue && PerPage.Value >= 5 && PerPage.Value <= 50)
- dict.Add("per_page", PerPage.Value.ToString());
-
- if (Status.HasValue && Enum.IsDefined(typeof(ZoneStatus), Status.Value))
- dict.Add("status", Status.Value.GetEnumMemberValue());
-
-#pragma warning restore CS8602, CS8604
-
- return dict;
- }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Filters/CreateZoneHoldFilter.cs b/Extensions/Cloudflare.Zones/Internals/Filters/CreateZoneHoldFilter.cs
deleted file mode 100644
index e69e2fd..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Filters/CreateZoneHoldFilter.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Filters
-{
- internal class CreateZoneHoldFilter : IQueryParameterFilter
- {
- public bool IncludeSubdomains { get; set; }
-
- public IDictionary GetQueryParameters()
- {
- var dict = new Dictionary();
-
- if (IncludeSubdomains)
- dict.Add("include_subdomains", "true");
-
- return dict;
- }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Filters/DeleteZoneHoldFilter.cs b/Extensions/Cloudflare.Zones/Internals/Filters/DeleteZoneHoldFilter.cs
deleted file mode 100644
index 134e16b..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Filters/DeleteZoneHoldFilter.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Filters
-{
- internal class DeleteZoneHoldFilter : IQueryParameterFilter
- {
- public DateTime? HoldAfter { get; set; }
-
- public IDictionary GetQueryParameters()
- {
- var dict = new Dictionary();
-
- if (HoldAfter.HasValue)
- dict.Add("hold_after", HoldAfter.Value.ToUniversalTime().ToString("yyyy-MM-dd'T'HH:mm:ss'Z'"));
-
- return dict;
- }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalBatchRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalBatchRequest.cs
deleted file mode 100644
index 002f999..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalBatchRequest.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalBatchRequest
- {
- [JsonProperty("deletes")]
- public IList? Deletes { get; set; }
-
- [JsonProperty("patches")]
- public IList? Patches { get; set; }
-
- [JsonProperty("puts")]
- public IList? Puts { get; set; }
-
- [JsonProperty("posts")]
- public IList? Posts { get; set; }
- }
-
- internal class InternalDnsRecordId
- {
- [JsonProperty("id")]
- public string? Id { get; set; }
- }
-
- internal class InternalBatchUpdateRequest(string id, InternalDnsRecordRequest baseInstance)
- {
- [JsonProperty("id")]
- public string Id { get; set; } = id;
-
- [JsonProperty("comment")]
- public string? Comment { get; set; } = baseInstance.Comment;
-
- [JsonProperty("name")]
- public string Name { get; set; } = baseInstance.Name;
-
- [JsonProperty("proxied")]
- public bool Proxied { get; set; } = baseInstance.Proxied;
-
- [JsonProperty("settings")]
- public object? Settings { get; set; } = baseInstance.Settings;
-
- [JsonProperty("tags")]
- public IList? Tags { get; set; } = baseInstance.Tags;
-
- [JsonProperty("ttl")]
- public int? Ttl { get; set; } = baseInstance.Ttl;
-
- [JsonProperty("data")]
- public object? Data { get; set; } = baseInstance.Data;
-
- [JsonProperty("content")]
- public string? Content { get; set; } = baseInstance.Content;
-
- [JsonProperty("priority")]
- public ushort? Priority { get; set; } = baseInstance.Priority;
-
- [JsonProperty("type")]
- public DnsRecordType Type { get; set; } = baseInstance.Type;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalCreateZoneRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalCreateZoneRequest.cs
deleted file mode 100644
index f63542b..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalCreateZoneRequest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalCreateZoneRequest
- {
- public InternalCreateZoneRequest(AccountBase account, string name)
- {
- Account = account;
- Name = name;
- }
-
- [JsonProperty("account")]
- public AccountBase Account { get; set; }
-
- [JsonProperty("name")]
- public string Name { get; set; }
-
- [JsonProperty("type")]
- public ZoneType? Type { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalDnsRecordRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalDnsRecordRequest.cs
deleted file mode 100644
index da9c9b0..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalDnsRecordRequest.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalDnsRecordRequest
- {
- public InternalDnsRecordRequest(DnsRecordType type, string name)
- {
- Type = type;
- Name = name;
- }
-
- [JsonProperty("comment")]
- public string? Comment { get; set; }
-
- [JsonProperty("name")]
- public string Name { get; set; }
-
- [JsonProperty("proxied")]
- public bool Proxied { get; set; }
-
- [JsonProperty("settings")]
- public object? Settings { get; set; }
-
- [JsonProperty("tags")]
- public IList? Tags { get; set; }
-
- [JsonProperty("ttl")]
- public int? Ttl { get; set; }
-
- [JsonProperty("data")]
- public object? Data { get; set; }
-
- [JsonProperty("content")]
- public string? Content { get; set; }
-
- [JsonProperty("priority")]
- public ushort? Priority { get; set; }
-
- [JsonProperty("type")]
- public DnsRecordType Type { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalEditZoneRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalEditZoneRequest.cs
deleted file mode 100644
index 30e1e0f..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalEditZoneRequest.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalEditZoneRequest
- {
- [JsonProperty("type")]
- public ZoneType? Type { get; set; }
-
- [JsonProperty("vanity_name_servers")]
- public IList? VanityNameServers { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalPurgeCacheRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalPurgeCacheRequest.cs
deleted file mode 100644
index a554106..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalPurgeCacheRequest.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalPurgeCacheRequest
- {
- [JsonProperty("purge_everything")]
- public bool? PurgeEverything { get; set; }
-
- [JsonProperty("tags")]
- public IList? Tags { get; set; }
-
- [JsonProperty("hosts")]
- public IList? Hostnames { get; set; }
-
- [JsonProperty("prefixes")]
- public IList? Prefixes { get; set; }
-
- [JsonProperty("files")]
- public IList? Urls { get; set; }
-
- [JsonProperty("files")]
- public IList? UrlsWithHeaders { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateDnsSettingsRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateDnsSettingsRequest.cs
deleted file mode 100644
index 78d20fb..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateDnsSettingsRequest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalUpdateDnsSettingsRequest
- {
- [JsonProperty("flatten_all_cnames")]
- public bool? FlattenAllCnames { get; set; }
-
- [JsonProperty("foundation_dns")]
- public bool? FoundationDns { get; set; }
-
- [JsonProperty("multi_provider")]
- public bool? MultiProvider { get; set; }
-
- [JsonProperty("nameservers")]
- public Nameserver? Nameservers { get; set; }
-
- [JsonProperty("ns_ttl")]
- public int? NameserverTtl { get; set; }
-
- [JsonProperty("secondary_overrides")]
- public bool? SecondaryOverrides { get; set; }
-
- [JsonProperty("soa")]
- public StartOfAuthority? Soa { get; set; }
-
- [JsonProperty("zone_mode")]
- public ZoneMode? Mode { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateSecurityTxtRequest.cs b/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateSecurityTxtRequest.cs
deleted file mode 100644
index b1a950a..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/InternalUpdateSecurityTxtRequest.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class InternalUpdateSecurityTxtRequest
- {
- [JsonProperty("acknowledgements")]
- public IList? Acknowledgements { get; set; }
-
- [JsonProperty("canonical")]
- public IList? Canonical { get; set; }
-
- [JsonProperty("contact")]
- public IList? Contact { get; set; }
-
- [JsonProperty("enabled")]
- public bool? Enabled { get; set; }
-
- [JsonProperty("encryption")]
- public IList? Encryption { get; set; }
-
- [JsonProperty("expires")]
- public DateTime? Expires { get; set; }
-
- [JsonProperty("hiring")]
- public IList? Hiring { get; set; }
-
- [JsonProperty("policy")]
- public IList? Policy { get; set; }
-
- [JsonProperty("preferredLanguages")]
- public string? PreferredLanguages { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Internals/Requests/PurgeUrlWithHeaders.cs b/Extensions/Cloudflare.Zones/Internals/Requests/PurgeUrlWithHeaders.cs
deleted file mode 100644
index 9dfbadf..0000000
--- a/Extensions/Cloudflare.Zones/Internals/Requests/PurgeUrlWithHeaders.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
-{
- internal class PurgeUrlWithHeaders
- {
- [JsonProperty("headers")]
- public Dictionary Headers { get; set; } = [];
-
- [JsonProperty("url")]
- public string? Url { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/BatchDnsRecordsResult.cs b/Extensions/Cloudflare.Zones/Models/BatchDnsRecordsResult.cs
deleted file mode 100644
index 9ba4dcb..0000000
--- a/Extensions/Cloudflare.Zones/Models/BatchDnsRecordsResult.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The DNS batch execution response.
- ///
- public class BatchDnsRecordsResult
- {
- ///
- /// The deleted records.
- ///
- [JsonProperty("deletes")]
- public IList? DeletedRecords { get; set; }
-
- ///
- /// The updated records.
- ///
- [JsonProperty("patches")]
- public IList? UpdatedRecords { get; set; }
-
- ///
- /// The overwritten records.
- ///
- [JsonProperty("puts")]
- public IList? OverwrittenRecords { get; set; }
-
- ///
- /// The created records.
- ///
- [JsonProperty("posts")]
- public IList? CreatedRecords { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/DnsRecord.cs b/Extensions/Cloudflare.Zones/Models/DnsRecord.cs
deleted file mode 100644
index ff2b9a2..0000000
--- a/Extensions/Cloudflare.Zones/Models/DnsRecord.cs
+++ /dev/null
@@ -1,702 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.Serialization;
-using Newtonsoft.Json.Linq;
-using Newtonsoft.Json.Serialization;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// DNS record.
- ///
- public class DnsRecord
- {
- ///
- /// Identifier.
- ///
- [JsonProperty("id")]
- public string? Id { get; set; }
-
- ///
- /// Identifier of the zone.
- ///
- [JsonProperty("zone_id")]
- public string? ZoneId { get; set; }
-
- ///
- /// Name of the zone.
- ///
- [JsonProperty("zone_name")]
- public string? ZoneName { get; set; }
-
- ///
- /// DNS record name (or @ for the zone apex) in Punycode.
- ///
- [JsonProperty("name")]
- public string? Name { get; set; }
-
- ///
- /// Record type.
- ///
- [JsonProperty("type")]
- public DnsRecordType Type { get; set; }
-
- ///
- /// A valid record content.
- ///
- [JsonProperty("content")]
- public string? Content { get; set; }
-
- ///
- /// The priority.
- ///
- ///
- /// Required for , and records; unused by other record types.
- /// Records with lower priorities are preferred.
- ///
- [JsonProperty("priority")]
- public ushort? Priority { get; set; }
-
- ///
- /// Components associated with the record.
- ///
- [JsonProperty("data")]
- public object? Data { get; set; }
-
- ///
- /// Whether the record can be proxied by Cloudflare or not.
- ///
- [JsonProperty("proxiable")]
- public bool Proxiable { get; set; }
-
- ///
- /// Whether the record is receiving the performance and security benefits of Cloudflare.
- ///
- [JsonProperty("proxied")]
- public bool Proxied { get; set; }
-
- ///
- /// Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'.
- /// Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
- ///
- /// Unit: seconds. Range: 60 <= X <= 86400
- [JsonProperty("ttl")]
- public int Ttl { get; set; }
-
- ///
- /// Settings for the DNS record.
- ///
- [JsonProperty("settings")]
- public object? Settings { get; set; }
-
- ///
- /// Extra Cloudflare-specific information about the record.
- ///
- [JsonProperty("meta")]
- public DnsRecordMeta? Meta { get; set; }
-
- ///
- /// Comments or notes about the DNS record. This field has no effect on DNS responses.
- ///
- [JsonProperty("comment")]
- public string? Comment { get; set; }
-
- ///
- /// Custom tags for the DNS record. This field has no effect on DNS responses.
- ///
- [JsonProperty("tags")]
- public IList? Tags { get; set; }
-
- ///
- /// When the record was created.
- ///
- [JsonProperty("created_on")]
- public DateTime CreatedOn { get; set; }
-
- ///
- /// When the record was last modified.
- ///
- [JsonProperty("modified_on")]
- public DateTime ModifiedOn { get; set; }
-
- ///
- /// When the record comment was last modified. Omitted if there is no comment.
- ///
- [JsonProperty("comment_modified_on")]
- public DateTime? CommentModifiedOn { get; set; }
-
- ///
- /// When the record tags were last modified. Omitted if there are no tags.
- ///
- [JsonProperty("tags_modified_on")]
- public DateTime? TagsModifiedOn { get; set; }
-
- #region Type definitions for data fields
-
- ///
- /// Returns the data strong typed (as might be from deserialization).
- ///
- [ExcludeFromCodeCoverage]
- public object? GetTypedData()
- {
- return Type switch
- {
- DnsRecordType.Caa => GetTypedData(),
- DnsRecordType.Cert => GetTypedData(),
- DnsRecordType.DnsKey => GetTypedData(),
- DnsRecordType.Ds => GetTypedData(),
- DnsRecordType.Https => GetTypedData(),
- DnsRecordType.Loc => GetTypedData(),
- DnsRecordType.NaPtr => GetTypedData(),
- DnsRecordType.SMimeA => GetTypedData(),
- DnsRecordType.Srv => GetTypedData(),
- DnsRecordType.SshFp => GetTypedData(),
- DnsRecordType.SvcB => GetTypedData(),
- DnsRecordType.TlsA => GetTypedData(),
- DnsRecordType.Uri => GetTypedData(),
- _ => null
- };
- }
-
- ///
- /// Returns the data strong typed (as might be from deserialization).
- ///
- /// The type of the data.
- [ExcludeFromCodeCoverage]
- public T? GetTypedData()
- where T : class
- {
- if (Data == null)
- return default;
-
- if (Data is JObject jo)
- return jo.ToObject();
-
- return (T)Data;
- }
-
- ///
- /// Components of a CAA record.
- ///
- public class CaaData(byte flags, string tag, string value)
- {
- ///
- /// Flags for the CAA record
- ///
- /// Range: 0 <= X <= 255
- [JsonProperty("flags")]
- public byte Flags { get; set; } = flags;
-
- ///
- /// Name of the property controlled by this record (e.g.: issue, issuewild, iodef).
- ///
- [JsonProperty("tag")]
- public string Tag { get; set; } = tag;
-
- ///
- /// Value of the record. This field's semantics depend on the chosen tag.
- ///
- [JsonProperty("value")]
- public string Value { get; set; } = value;
- }
-
- ///
- /// Components of a CERT record.
- ///
- public class CertData(byte algorithm, string certificate, ushort keyTag, ushort type)
- {
- ///
- /// Algorithm of the certificate
- ///
- [JsonProperty("algorithm")]
- public byte Algorithm { get; set; } = algorithm;
-
- ///
- /// Base64 encoded certificate.
- ///
- [JsonProperty("certificate")]
- public string Certificate { get; set; } = certificate;
-
- ///
- /// Key tag.
- ///
- [JsonProperty("key_tag")]
- public ushort KeyTag { get; set; } = keyTag;
-
- ///
- /// Type.
- ///
- [JsonProperty("type")]
- public ushort Type { get; set; } = type;
- }
-
- ///
- /// Components of a DNSKEY record.
- ///
- public class DnsKeyData(byte algorithm, ushort flags, byte protocol, string publicKey)
- {
- ///
- /// Algorithm of the certificate
- ///
- [JsonProperty("algorithm")]
- public byte Algorithm { get; set; } = algorithm;
-
- ///
- /// Algorithm of the certificate
- ///
- [JsonProperty("flags")]
- public ushort Flags { get; set; } = flags;
-
- ///
- /// Algorithm of the certificate
- ///
- [JsonProperty("protocol")]
- public byte Protocol { get; set; } = protocol;
-
- ///
- /// Public key.
- ///
- [JsonProperty("public_key")]
- public string PublicKey { get; set; } = publicKey;
- }
-
- ///
- /// Components of a DS record.
- ///
- public class DsData(byte algorithm, string digest, byte digestType, ushort keyTag)
- {
- ///
- /// Algorithm of the certificate
- ///
- [JsonProperty("algorithm")]
- public byte Algorithm { get; set; } = algorithm;
-
- ///
- /// Digest.
- ///
- [JsonProperty("digest")]
- public string Digest { get; set; } = digest;
-
- ///
- /// Digest type.
- ///
- [JsonProperty("digest_type")]
- public byte DigestType { get; set; } = digestType;
-
- ///
- /// Key tag.
- ///
- [JsonProperty("key_tag")]
- public ushort KeyTag { get; set; } = keyTag;
- }
-
- ///
- /// Components of an HTTPS record.
- ///
- public class HttpsData(ushort priority, string target, string value)
- {
- ///
- /// Priority.
- ///
- [JsonProperty("priority")]
- public ushort Priority { get; set; } = priority;
-
- ///
- /// Target.
- ///
- [JsonProperty("target")]
- public string Target { get; set; } = target;
-
- ///
- /// Value.
- ///
- [JsonProperty("Value")]
- public string Value { get; set; } = value;
- }
-
- ///
- /// Components of a LOC record.
- ///
- public class LocData(int latitudeDegrees, int latitudeMinutes, double latitudeSeconds, LatitudeDirection latitudeDirection,
- int longitudeDegrees, int longitudeMinutes, double longitudeSeconds, LongitudeDirection longitudeDirection,
- double altitude, int size, int precisionHorizontal, int precisionVertical)
- {
- ///
- /// Degrees of latitude.
- ///
- /// Unit: degree. Range: 0 <= X <= 90
- [JsonProperty("lat_degrees")]
- public int LatitudeDegrees { get; set; } = latitudeDegrees;
-
- ///
- /// Minutes of latitude.
- ///
- /// Unit: minute. Range: 0 <= X <= 59
- [JsonProperty("lat_minutes")]
- public int LatitudeMinutes { get; set; } = latitudeMinutes;
-
- ///
- /// Seconds of latitude.
- ///
- /// Unit: second. Range: 0 <= X <= 59.999
- [JsonProperty("lat_seconds")]
- public double LatitudeSeconds { get; set; } = latitudeSeconds;
-
- ///
- /// Latitude direction.
- ///
- [JsonProperty("lat_direction")]
- public LatitudeDirection LatitudeDirection { get; set; } = latitudeDirection;
-
- ///
- /// Degrees of longitude.
- ///
- /// Unit: degree. Range: 0 <= X <= 180
- [JsonProperty("long_degrees")]
- public int LongitudeDegrees { get; set; } = longitudeDegrees;
-
- ///
- /// Minutes of longitude.
- ///
- /// Unit: minute. Range: 0 <= X <= 59
- [JsonProperty("long_minutes")]
- public int LongitudeMinutes { get; set; } = longitudeMinutes;
-
- ///
- /// Seconds of longitude.
- ///
- /// Unit: second. Range: 0 <= X <= 59.999
- [JsonProperty("long_seconds")]
- public double LongitudeSeconds { get; set; } = longitudeSeconds;
-
- ///
- /// Longitude direction.
- ///
- [JsonProperty("long_direction")]
- public LongitudeDirection LongitudeDirection { get; set; } = longitudeDirection;
-
- ///
- /// Altitude of location in meters.
- ///
- /// Unit: meter. Range: -100_000.00 <= X <= 42_849_672.95
- [JsonProperty("altitude")]
- public double Altitude { get; set; } = altitude;
-
- ///
- /// Size of location in meters.
- ///
- /// Unit: meter. Range: 0 <= X <= 90_000_000
- [JsonProperty("size")]
- public int Size { get; set; } = size;
-
- ///
- /// Horizontal precision of location.
- ///
- /// Unit: meter. Range: 0 <= X <= 90_000_000
- [JsonProperty("precision_horz")]
- public int PrecisionHorizontal { get; set; } = precisionHorizontal;
-
- ///
- /// Vertical precision of location.
- ///
- /// Unit: meter. Range: 0 <= X <= 90_000_000
- [JsonProperty("precision_vert")]
- public int PrecisionVertical { get; set; } = precisionVertical;
- }
-
- ///
- /// Components of a NAPTR record.
- ///
- public class NaPtrData(string flags, ushort order, ushort preference, string regex, string replacement, string service)
- {
- ///
- /// Flags.
- ///
- [JsonProperty("flags")]
- public string Flags { get; set; } = flags;
-
- ///
- /// Order.
- ///
- [JsonProperty("order")]
- public ushort Order { get; set; } = order;
-
- ///
- /// Preference.
- ///
- [JsonProperty("preference")]
- public ushort Preference { get; set; } = preference;
-
- ///
- /// Service.
- ///
- [JsonProperty("regex")]
- public string Regex { get; set; } = regex;
-
- ///
- /// Replacement.
- ///
- [JsonProperty("replacement")]
- public string Replacement { get; set; } = replacement;
-
- ///
- /// Service.
- ///
- [JsonProperty("service")]
- public string Service { get; set; } = service;
- }
-
- ///
- /// Components of a SMIMEA record.
- ///
- public class SMimeAData(string certificate, byte matchingType, byte selector, byte usage)
- {
- ///
- /// Certificate.
- ///
- [JsonProperty("certificate")]
- public string Certificate { get; set; } = certificate;
-
- ///
- /// Matching type.
- ///
- [JsonProperty("matching_type")]
- public byte MatchingType { get; set; } = matchingType;
-
- ///
- /// Selector.
- ///
- [JsonProperty("selector")]
- public byte Selector { get; set; } = selector;
-
- ///
- /// Usage.
- ///
- [JsonProperty("usage")]
- public byte Usage { get; set; } = usage;
- }
-
- ///
- /// Components of a SRV record.
- ///
- public class SrvData(ushort port, ushort priority, string target, ushort weight)
- {
- ///
- /// The port of the service.
- ///
- [JsonProperty("port")]
- public ushort Port { get; set; } = port;
-
- ///
- /// The priority of the service.
- ///
- ///
- /// Required for , and records; unused by other record types.
- /// Records with lower priorities are preferred.
- ///
- [JsonProperty("priority")]
- public ushort Priority { get; set; } = priority;
-
- ///
- /// A valid hostname.
- ///
- [JsonProperty("target")]
- public string Target { get; set; } = target;
-
- ///
- /// The weight of the record.
- ///
- [JsonProperty("weight")]
- public ushort Weight { get; set; } = weight;
- }
-
- ///
- /// Components of a SSHFP record.
- ///
- public class SshFpData(byte algorithm, string fingerprint, byte type)
- {
- ///
- /// Algorithm.
- ///
- [JsonProperty("algorithm")]
- public byte Algorithm { get; set; } = algorithm;
-
- ///
- /// Fingerprint.
- ///
- [JsonProperty("fingerprint")]
- public string Fingerprint { get; set; } = fingerprint;
-
- ///
- /// Type.
- ///
- [JsonProperty("type")]
- public byte Type { get; set; } = type;
- }
-
- ///
- /// Components of a SVCB record.
- ///
- public class SvcBData(ushort priority, string target, string value)
- {
- ///
- /// The priority of the service binding.
- ///
- [JsonProperty("priority")]
- public ushort Priority { get; set; } = priority;
-
- ///
- /// A valid target.
- ///
- [JsonProperty("target")]
- public string Target { get; set; } = target;
-
- ///
- /// The value of the service binding.
- ///
- ///
- /// e.g. alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"
- ///
- [JsonProperty("value")]
- public string Value { get; set; } = value;
- }
-
- ///
- /// Components of a TLSA record.
- ///
- public class TlsAData(string certificate, byte matchingType, byte selector, byte usage)
- {
- ///
- /// Certificate.
- ///
- [JsonProperty("certificate")]
- public string Certificate { get; set; } = certificate;
-
- ///
- /// Matching type.
- ///
- [JsonProperty("matching_type")]
- public byte MatchingType { get; set; } = matchingType;
-
- ///
- /// Selector.
- ///
- [JsonProperty("selector")]
- public byte Selector { get; set; } = selector;
-
- ///
- /// Usage.
- ///
- [JsonProperty("usage")]
- public byte Usage { get; set; } = usage;
- }
-
- ///
- /// Components of a URI record.
- ///
- public class UriData(string target, ushort weight)
- {
- ///
- /// A valid target.
- ///
- [JsonProperty("target")]
- public string Target { get; set; } = target;
-
- ///
- /// The weight of the record.
- ///
- [JsonProperty("weight")]
- public ushort Weight { get; set; } = weight;
- }
-
- #region Enums for data fields
-
- ///
- /// Directions for latitude.
- ///
- public enum LatitudeDirection
- {
- ///
- /// North.
- ///
- [EnumMember(Value = "N")]
- North = 1,
-
- ///
- /// South.
- ///
- [EnumMember(Value = "S")]
- South = 2
- }
-
- ///
- /// Directions for longitude.
- ///
- public enum LongitudeDirection
- {
- ///
- /// East.
- ///
- [EnumMember(Value = "E")]
- East = 1,
-
- ///
- /// West.
- ///
- [EnumMember(Value = "W")]
- West = 2
- }
-
- #endregion Enums for data fields
-
- #endregion Type definitions for data fields
-
- #region Type definitions for settings fields
-
- ///
- /// Returns the settings strong typed (as might be from deserialization).
- ///
- [ExcludeFromCodeCoverage]
- public object? GetTypedSettings()
- {
- return Type switch
- {
- DnsRecordType.Cname => GetTypedSettings(),
- _ => null
- };
- }
-
- ///
- /// Returns the settings strong typed (as might be from deserialization).
- ///
- /// The type of the settings.
- [ExcludeFromCodeCoverage]
- public T? GetTypedSettings()
- where T : class
- {
- if (Settings == null)
- return default;
-
- if (Settings is JObject jo)
- return jo.ToObject();
-
- return (T)Settings;
- }
-
- ///
- /// Settings for the DNS record.
- ///
- public class CnameSettings(bool flattenCname)
- {
- ///
- /// If enabled, causes the CNAME record to be resolved externally and the resulting address records (e.g., A and AAAA) to be returned instead of the CNAME record itself.
- /// This setting has no effect on proxied records, which are always flattened.
- ///
- [JsonProperty("flatten_cname")]
- public bool FlattenCname { get; set; } = flattenCname;
- }
-
- #endregion Type definitions for settings fields
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/DnsRecordMeta.cs b/Extensions/Cloudflare.Zones/Models/DnsRecordMeta.cs
deleted file mode 100644
index e4b9e34..0000000
--- a/Extensions/Cloudflare.Zones/Models/DnsRecordMeta.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Extra Cloudflare-specific information about the record.
- ///
- public class DnsRecordMeta
- {
- ///
- /// Whether the record was automatically added.
- ///
- [JsonProperty("auto_added")]
- public bool AutoAdded { get; set; }
-
- ///
- /// Whether the record is managed by apps.
- ///
- [JsonProperty("managed_by_apps")]
- public bool ManagedByApps { get; set; }
-
- ///
- /// Whether the record is managed by argo tunnel.
- ///
- [JsonProperty("managed_by_argo_tunnel")]
- public bool ManagedByArgoTunnel { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/IdResponse.cs b/Extensions/Cloudflare.Zones/Models/IdResponse.cs
deleted file mode 100644
index cfc1f5a..0000000
--- a/Extensions/Cloudflare.Zones/Models/IdResponse.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The deleted id.
- ///
- public class IdResponse
- {
- ///
- /// Identifier.
- ///
- // <= 32 characters
- [JsonProperty("id")]
- public string? Id { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/ImportDnsRecordsResult.cs b/Extensions/Cloudflare.Zones/Models/ImportDnsRecordsResult.cs
deleted file mode 100644
index 676bcac..0000000
--- a/Extensions/Cloudflare.Zones/Models/ImportDnsRecordsResult.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The DNS records import result.
- ///
- public class ImportDnsRecordsResult
- {
- ///
- /// Number of DNS records added.
- ///
- [JsonProperty("recs_added")]
- public int? RecordsAdded { get; set; }
-
- ///
- /// Total number of DNS records parsed.
- ///
- [JsonProperty("total_records_parsed")]
- public int? TotalRecordsParsed { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/Nameserver.cs b/Extensions/Cloudflare.Zones/Models/Nameserver.cs
deleted file mode 100644
index 093b353..0000000
--- a/Extensions/Cloudflare.Zones/Models/Nameserver.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// A nameserver.
- ///
- public class Nameserver
- {
- ///
- /// The nameserver type.
- ///
- [JsonProperty("type")]
- public NameserverType Type { get; set; }
-
- // TODO: DEPRECATED? - not available on API request.
- /////
- ///// Configured nameserver set to be used for this zone.
- /////
- ///// Range: 1 <= X <= 5
- //[JsonProperty("ns_set")]
- //public int NameserverSet { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/SecurityTxt.cs b/Extensions/Cloudflare.Zones/Models/SecurityTxt.cs
deleted file mode 100644
index c5b19d8..0000000
--- a/Extensions/Cloudflare.Zones/Models/SecurityTxt.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The security TXT record.
- ///
- public class SecurityTxt
- {
- ///
- /// The acknowledgements.
- ///
- [JsonProperty("acknowledgements")]
- public IList? Acknowledgements { get; set; }
-
- ///
- /// The canonical.
- ///
- [JsonProperty("canonical")]
- public IList? Canonical { get; set; }
-
- ///
- /// The contact.
- ///
- [JsonProperty("contact")]
- public IList? Contact { get; set; }
-
- ///
- /// A value indicating whether this security.txt is enabled.
- ///
- [JsonProperty("enabled")]
- public bool? Enabled { get; set; }
-
- ///
- ///The encryption.
- ///
- [JsonProperty("encryption")]
- public IList? Encryption { get; set; }
-
- ///
- /// The expiry.
- ///
- [JsonProperty("expires")]
- public DateTime? Expires { get; set; }
-
- ///
- /// The hiring.
- ///
- [JsonProperty("hiring")]
- public IList? Hiring { get; set; }
-
- ///
- /// The policies.
- ///
- [JsonProperty("policy")]
- public IList? Policy { get; set; }
-
- ///
- /// The preferred languages.
- ///
- [JsonProperty("preferredLanguages")]
- public string? PreferredLanguages { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/StartOfAuthority.cs b/Extensions/Cloudflare.Zones/Models/StartOfAuthority.cs
deleted file mode 100644
index 29555dc..0000000
--- a/Extensions/Cloudflare.Zones/Models/StartOfAuthority.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The SOA (Start of Authority) record.
- ///
- public class StartOfAuthority
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The primary nameserver.
- /// The zone administrator. First dot will be interpreted as @-sign.
- /// The time to live of the SOA record.
- /// Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.
- /// Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.
- /// Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.
- /// The time to live (TTL) for negative caching of records within the zone.
- public StartOfAuthority(string primaryNameserver, string zoneAdministrator, int ttl, int refresh, int retry, int expire, int minimumTtl)
- {
- PrimaryNameserver = primaryNameserver;
- ZoneAdministrator = zoneAdministrator;
- Ttl = ttl;
- Refresh = refresh;
- Retry = retry;
- Expire = expire;
- MinimumTtl = minimumTtl;
- }
-
- ///
- /// Time in seconds of being unable to query the primary server after which secondary servers should stop serving the zone.
- ///
- /// Unit: seconds. Range: 86400 <= X <= 2419200
- [JsonProperty("expire")]
- public int Expire { get; set; }
-
- ///
- /// The time to live (TTL) for negative caching of records within the zone.
- ///
- /// Unit: seconds. Range: 60 <= X <= 86400
- [JsonProperty("min_ttl")]
- public int MinimumTtl { get; set; }
-
- ///
- /// The primary nameserver, which may be used for outbound zone transfers.
- ///
- [JsonProperty("mname", NullValueHandling = NullValueHandling.Include)]
- public string PrimaryNameserver { get; set; }
-
- ///
- /// Time in seconds after which secondary servers should re-check the SOA record to see if the zone has been updated.
- ///
- /// Unit: seconds. Range: 600 <= X <= 86400
- [JsonProperty("refresh")]
- public int Refresh { get; set; }
-
- ///
- /// Time in seconds after which secondary servers should retry queries after the primary server was unresponsive.
- ///
- /// Unit: seconds. Range: 600 <= X <= 86400
- [JsonProperty("retry")]
- public int Retry { get; set; }
-
- ///
- /// The email address of the zone administrator, with the first label representing the local part of the email address.
- ///
- ///
- /// The first dot is interpreted as @ sign.
- ///
- /// admin.example.com => admin@example.com
- ///
- /// test\.user.example.org => test.user@example.org
- ///
- [JsonProperty("rname", NullValueHandling = NullValueHandling.Include)]
- public string ZoneAdministrator { get; set; }
-
- ///
- /// The time to live (TTL) of the SOA record itself.
- ///
- /// Unit: seconds. Range: 300 <= X <= 86400
- [JsonProperty("ttl")]
- public int Ttl { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/Zone.cs b/Extensions/Cloudflare.Zones/Models/Zone.cs
deleted file mode 100644
index 7178177..0000000
--- a/Extensions/Cloudflare.Zones/Models/Zone.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// A DNS Zone.
- ///
- public class Zone
- {
- ///
- /// Identifier.
- ///
- // <= 32 characters
- [JsonProperty("id")]
- public string? Id { get; set; }
-
- ///
- /// The account the zone belongs to.
- ///
- [JsonProperty("account")]
- public AccountBase? Account { get; set; }
-
- ///
- /// The last time proof of ownership was detected and the zone was made active.
- ///
- [JsonProperty("activated_on")]
- public DateTime ActivatedOn { get; set; }
-
- ///
- /// When the zone was created.
- ///
- [JsonProperty("created_on")]
- public DateTime CreatedOn { get; set; }
-
- ///
- /// The interval (in seconds) from when development mode expires (positive integer)
- /// or last expired (negative integer) for the domain.
- /// If development mode has never been enabled, this value is 0.
- ///
- [JsonProperty("development_mode")]
- public int DevelopmentMode { get; set; }
-
- ///
- /// Metadata about the zone.
- ///
- [JsonProperty("meta")]
- public ZoneMetaData? Meta { get; set; }
-
- ///
- /// When the zone was last modified.
- ///
- [JsonProperty("modified_on")]
- public DateTime ModifiedOn { get; set; }
-
- ///
- /// The domain name.
- ///
- // <= 253 characters
- [JsonProperty("name")]
- public string? Name { get; set; }
-
- ///
- /// The name servers Cloudflare assigns to a zone.
- ///
- [JsonProperty("name_servers")]
- public IReadOnlyList? NameServers { get; set; }
-
- ///
- /// DNS host at the time of switching to Cloudflare.
- ///
- [JsonProperty("original_dnshost")]
- public string? OriginalDnshost { get; set; }
-
- ///
- /// Original name servers before moving to Cloudflare.
- ///
- [JsonProperty("original_name_servers")]
- public IReadOnlyList? OriginalNameServers { get; set; }
-
- ///
- /// Registrar for the domain at the time of switching to Cloudflare.
- ///
- [JsonProperty("original_registrar")]
- public string? OriginalRegistrar { get; set; }
-
- ///
- /// The owner of the zone.
- ///
- [JsonProperty("owner")]
- public OwnerBase? Owner { get; set; }
-
- ///
- /// Indicates whether the zone is only using Cloudflare DNS services.
- /// A value means the zone will not receive security or performance benefits.
- ///
- [JsonProperty("paused")]
- public bool Paused { get; set; }
-
- ///
- /// The zone status on Cloudflare.
- ///
- [JsonProperty("status")]
- public ZoneStatus Status { get; set; }
-
- ///
- /// A full zone implies that DNS is hosted with Cloudflare.
- /// A partial zone is typically a partner-hosted zone or a CNAME setup..
- ///
- [JsonProperty("type")]
- public ZoneType Type { get; set; }
-
- ///
- /// An array of domains used for custom name servers.
- /// This is only available for Business and Enterprise plans.
- ///
- [JsonProperty("vanity_name_servers")]
- public IReadOnlyList? VanityNameServers { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/ZoneDnsSetting.cs b/Extensions/Cloudflare.Zones/Models/ZoneDnsSetting.cs
deleted file mode 100644
index 394220f..0000000
--- a/Extensions/Cloudflare.Zones/Models/ZoneDnsSetting.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The DNS settings.
- ///
- public class ZoneDnsSetting
- {
- ///
- /// Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations,
- /// a CNAME record at the zone apex will always be flattened.
- ///
- [JsonProperty("flatten_all_cnames")]
- public bool FlattenAllCnames { get; set; }
-
- ///
- /// Whether to enable Foundation DNS Advanced Nameservers on the zone.
- ///
- [JsonProperty("foundation_dns")]
- public bool FoundationDns { get; set; }
-
- ///
- /// Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist,
- /// and to respect NS records at the zone apex during outbound zone transfers.
- ///
- [JsonProperty("multi_provider")]
- public bool MultiProvider { get; set; }
-
- ///
- /// Settings determining the nameservers through which the zone should be available.
- ///
- [JsonProperty("nameservers")]
- public Nameserver? Nameservers { get; set; }
-
- ///
- /// The time to live (TTL) of the zone's nameserver (NS) records.
- ///
- // 30 <= X <= 86400
- [JsonProperty("ns_ttl")]
- public int NameserverTtl { get; set; }
-
- ///
- /// Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.
- ///
- [JsonProperty("secondary_overrides")]
- public bool SecondaryOverrides { get; set; }
-
- ///
- /// Components of the zone's SOA record.
- ///
- [JsonProperty("soa")]
- public StartOfAuthority? SOA { get; set; }
-
- ///
- /// Whether the zone mode is a regular or CDN/DNS only zone.
- ///
- [JsonProperty("zone_mode")]
- public ZoneMode Mode { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/ZoneHold.cs b/Extensions/Cloudflare.Zones/Models/ZoneHold.cs
deleted file mode 100644
index 86cef14..0000000
--- a/Extensions/Cloudflare.Zones/Models/ZoneHold.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// A zone hold.
- ///
- public class ZoneHold
- {
- ///
- /// Gets or sets a value indicating whether the zone is on hold.
- ///
- [JsonProperty("hold")]
- public bool Hold { get; set; }
-
- ///
- /// Gets or sets an information whether subdomains are included in the hold.
- ///
- [JsonProperty("include_subdomains")]
- public string? IncludeSubdomains { get; set; }
-
- ///
- /// Gets or sets the time after which the zone is no longer on hold.
- ///
- [JsonProperty("hold_after")]
- public DateTime HoldAfter { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Models/ZoneMetaData.cs b/Extensions/Cloudflare.Zones/Models/ZoneMetaData.cs
deleted file mode 100644
index 8cf1050..0000000
--- a/Extensions/Cloudflare.Zones/Models/ZoneMetaData.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// The zone metadata.
- ///
- public class ZoneMetaData
- {
- ///
- /// The zone is only configured for CDN.
- ///
- [JsonProperty("cdn_only")]
- public bool CdnOnly { get; set; }
-
- ///
- /// Number of Custom Certificates the zone can have.
- ///
- [JsonProperty("custom_certificate_quota")]
- public int CustomCertificateQuota { get; set; }
-
- ///
- /// The zone is only configured for DNS.
- ///
- [JsonProperty("dns_only")]
- public bool DnsOnly { get; set; }
-
- ///
- /// The zone is setup with Foundation DNS.
- ///
- [JsonProperty("foundation_dns")]
- public bool FoundationDns { get; set; }
-
- ///
- /// Number of Page Rules a zone can have.
- ///
- [JsonProperty("page_rule_quota")]
- public int PageRuleQuota { get; set; }
-
- ///
- /// The zone has been flagged for phishing.
- ///
- [JsonProperty("phishing_detected")]
- public bool PhishingDetected { get; set; }
-
- ///
- /// Step.
- ///
- [JsonProperty("step")]
- public int Step { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/RegexPatterns.cs b/Extensions/Cloudflare.Zones/RegexPatterns.cs
deleted file mode 100644
index cede63f..0000000
--- a/Extensions/Cloudflare.Zones/RegexPatterns.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Text.RegularExpressions;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- internal static class RegexPatterns
- {
- public static readonly Regex ZoneName = new(@"^([a-zA-Z0-9][\-a-zA-Z0-9]*\.)+[\-a-zA-Z0-9]{2,20}$", RegexOptions.Compiled);
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/BatchDnsRecordsRequest.cs b/Extensions/Cloudflare.Zones/Requests/BatchDnsRecordsRequest.cs
deleted file mode 100644
index 7bc12ed..0000000
--- a/Extensions/Cloudflare.Zones/Requests/BatchDnsRecordsRequest.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Batch of DNS Record API calls to be executed together.
- ///
- ///
- /// Execution order: Delete, Update, Overwrite, Create
- ///
- public class BatchDnsRecordsRequest(string zoneId)
- {
- ///
- /// The zone identifier.
- ///
- public string ZoneId { get; set; } = zoneId;
-
- ///
- /// The DNS record identifiers to delete.
- ///
- public IList DnsRecordIdsToDelete { get; set; } = [];
-
- ///
- /// The DNS records to update.
- ///
- public IList DnsRecordsToUpdate { get; set; } = [];
-
- ///
- /// The DNS records to overwrite.
- ///
- public IList DnsRecordsToOverwrite { get; set; } = [];
-
- ///
- /// The DNS records to create.
- ///
- public IList DnsRecordsToCreate { get; set; } = [];
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/CreateDnsRecordRequest.cs b/Extensions/Cloudflare.Zones/Requests/CreateDnsRecordRequest.cs
deleted file mode 100644
index 11e92cc..0000000
--- a/Extensions/Cloudflare.Zones/Requests/CreateDnsRecordRequest.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to create a new DNS record.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The zone identifier.
- /// DNS record name (or @ for the zone apex).
- /// Record type.
- public class CreateDnsRecordRequest(string zoneId, string name, DnsRecordType type)
- {
- ///
- /// The zone identifier.
- ///
- public string ZoneId { get; set; } = zoneId;
-
- ///
- /// Comments or notes about the DNS record.
- ///
- ///
- /// This field has no effect on DNS responses.
- ///
- public string? Comment { get; set; }
-
- ///
- /// DNS record name (or @ for the zone apex) in Punycode.
- ///
- public string Name { get; set; } = name;
-
- ///
- /// Whether the record is receiving the performance and security benefits of Cloudflare.
- ///
- public bool Proxied { get; set; }
-
- ///
- /// Settings for the DNS record.
- ///
- public object? Settings { get; set; }
-
- ///
- /// Custom tags for the DNS record.
- ///
- ///
- /// This field has no effect on DNS responses.
- ///
- public IList? Tags { get; set; }
-
- ///
- /// Time To Live (TTL) of the DNS record in seconds.
- ///
- ///
- /// Setting to 1 means 'automatic'.
- /// Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones.
- ///
- public int? Ttl { get; set; }
-
- ///
- /// Components of a record.
- ///
- ///
- /// Caution: This field has priority over the field.
- ///
- public object? Data { get; set; }
-
- ///
- /// A valid content.
- ///
- ///
- /// Caution: This field has no effect for record types with specific values.
- ///
- public string? Content { get; set; }
-
- ///
- /// A priority.
- ///
- ///
- /// Required for , and records; unused by other record types.
- /// Records with lower priorities are preferred.
- ///
- public ushort? Priority { get; set; }
-
- ///
- /// Record type.
- ///
- public DnsRecordType Type { get; set; } = type;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/CreateZoneRequest.cs b/Extensions/Cloudflare.Zones/Requests/CreateZoneRequest.cs
deleted file mode 100644
index c67c028..0000000
--- a/Extensions/Cloudflare.Zones/Requests/CreateZoneRequest.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to create a new zone.
- ///
- ///
- /// Request to create a new zone.
- ///
- /// The account identifier.
- /// The domain name.
- public class CreateZoneRequest(string accountId, string name)
- {
- ///
- /// The account identifier.
- ///
- public string AccountId { get; set; } = accountId;
-
- ///
- /// The domain name.
- ///
- public string Name { get; set; } = name;
-
- ///
- /// The zone type.
- ///
- ///
- ///
- /// A full zone implies that DNS is hosted with Cloudflare.
- /// A partial zone is typically a partner-hosted zone or a CNAME setup.
- ///
- ///
- /// If not set, Cloudflare will use as default.
- ///
- ///
- public ZoneType? Type { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/EditZoneRequest.cs b/Extensions/Cloudflare.Zones/Requests/EditZoneRequest.cs
deleted file mode 100644
index 370bcc3..0000000
--- a/Extensions/Cloudflare.Zones/Requests/EditZoneRequest.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// A request to edit a zone.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The zone identifier.
- public class EditZoneRequest(string id)
- {
-
- ///
- /// Identifier.
- ///
- public string Id { get; set; } = id;
-
- ///
- /// A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.
- ///
- /// This parameter is only available to Enterprise customers or if it has been explicitly enabled on a zone.
- ///
- public ZoneType? Type { get; set; }
-
- ///
- /// An array of domains used for custom name servers.
- ///
- /// This is only available for Business and Enterprise plans.
- ///
- public IList? VanityNameServers { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/ImportDnsRecordsRequest.cs b/Extensions/Cloudflare.Zones/Requests/ImportDnsRecordsRequest.cs
deleted file mode 100644
index 9c032d7..0000000
--- a/Extensions/Cloudflare.Zones/Requests/ImportDnsRecordsRequest.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to import DNS records from a BIND configuration file.
- ///
- public class ImportDnsRecordsRequest(string zoneId, string file)
- {
- ///
- /// The zone identifier.
- ///
- public string ZoneId { get; set; } = zoneId;
-
- ///
- /// Whether or not proxiable records should receive the performance and security benefits of Cloudflare.
- ///
- public bool? Proxied { get; set; }
-
- ///
- /// BIND config to import.
- ///
- ///
- /// If the property is an absolute path, the content of that file will be used as the BIND configuration.
- ///
- /// Otherwise the property will be treated as BIND configuration itself.
- ///
- public string File { get; set; } = file;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/OverwriteDnsRecordRequest.cs b/Extensions/Cloudflare.Zones/Requests/OverwriteDnsRecordRequest.cs
deleted file mode 100644
index 3bdf0ed..0000000
--- a/Extensions/Cloudflare.Zones/Requests/OverwriteDnsRecordRequest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to overwrite a DNS record.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The DNS record identifier.
- /// The zone identifier.
- /// DNS record name (or @ for the zone apex).
- /// Record type.
- public class OverwriteDnsRecordRequest(string id, string zoneId, string name, DnsRecordType type) : CreateDnsRecordRequest(zoneId, name, type)
- {
- ///
- /// The DNS record identifier.
- ///
- public string Id { get; set; } = id;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/UpdateDnsRecordRequest.cs b/Extensions/Cloudflare.Zones/Requests/UpdateDnsRecordRequest.cs
deleted file mode 100644
index b065ceb..0000000
--- a/Extensions/Cloudflare.Zones/Requests/UpdateDnsRecordRequest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to update a DNS record.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The DNS record identifier.
- /// The zone identifier.
- /// DNS record name (or @ for the zone apex).
- /// Record type.
- public class UpdateDnsRecordRequest(string id, string zoneId, string name, DnsRecordType type) : CreateDnsRecordRequest(zoneId, name, type)
- {
- ///
- /// The DNS record identifier.
- ///
- public string Id { get; set; } = id;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/UpdateDnsSettingsRequest.cs b/Extensions/Cloudflare.Zones/Requests/UpdateDnsSettingsRequest.cs
deleted file mode 100644
index 04b74b0..0000000
--- a/Extensions/Cloudflare.Zones/Requests/UpdateDnsSettingsRequest.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Update DNS settings request.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The zone identifier.
- public class UpdateDnsSettingsRequest(string id)
- {
-
- ///
- /// The zone identifier.
- ///
- public string Id { get; set; } = id;
-
- ///
- /// Whether to flatten all CNAME records in the zone. Note that, due to DNS limitations,
- /// a CNAME record at the zone apex will always be flattened.
- ///
- public bool? FlattenAllCnames { get; set; }
-
- ///
- /// Whether to enable Foundation DNS Advanced Nameservers on the zone.
- ///
- public bool? FoundationDns { get; set; }
-
- ///
- /// Whether to enable multi-provider DNS, which causes Cloudflare to activate the zone even when non-Cloudflare NS records exist,
- /// and to respect NS records at the zone apex during outbound zone transfers.
- ///
- public bool? MultiProvider { get; set; }
-
- ///
- /// Settings determining the nameservers through which the zone should be available.
- ///
- public Nameserver? Nameservers { get; set; }
-
- ///
- /// The time to live (TTL) of the zone's nameserver (NS) records.
- ///
- /// Unit: seconds. Range: 30 <= X <= 86400
- public int? NameserverTtl { get; set; }
-
- ///
- /// Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.
- ///
- public bool? SecondaryOverrides { get; set; }
-
- ///
- /// Components of the zone's SOA record.
- ///
- public StartOfAuthority? SOA { get; set; }
-
- ///
- /// Whether the zone mode is a regular or CDN/DNS only zone.
- ///
- public ZoneMode? Mode { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/UpdateSecurityTxtRequest.cs b/Extensions/Cloudflare.Zones/Requests/UpdateSecurityTxtRequest.cs
deleted file mode 100644
index 09a4c53..0000000
--- a/Extensions/Cloudflare.Zones/Requests/UpdateSecurityTxtRequest.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Request to update security.txt
- ///
- public class UpdateSecurityTxtRequest(string zoneId)
- {
- ///
- /// The zone identifier.
- ///
- public string ZoneId { get; set; } = zoneId;
-
- ///
- /// Gets or sets the acknowledgements.
- ///
- ///
- /// Example: https://example.com/hall-of-fame.html
- ///
- public IList? Acknowledgements { get; set; }
-
- ///
- /// Gets or sets the canonical.
- ///
- ///
- /// Example: https://www.example.com/.well-known/security.txt
- ///
- public IList? Canonical { get; set; }
-
- ///
- /// Gets or sets the contact.
- ///
- ///
- /// Examples:
- ///
- /// mailto:security@example.com
- /// tel:+1-201-555-0123
- /// https://example.com/security-contact.html
- ///
- ///
- public IList? Contact { get; set; }
-
- ///
- /// Gets or sets a value indicating whether this security.txt is enabled.
- ///
- public bool? Enabled { get; set; }
-
- ///
- /// Gets or sets the encryption.
- ///
- ///
- /// Examples:
- ///
- /// https://example.com/pgp-key.txt
- /// dns:5d2d37ab76d47d36._openpgpkey.example.com?type=OPENPGPKEY
- /// openpgp4fpr:5f2de5521c63a801ab59ccb603d49de44b29100f
- ///
- ///
- public IList? Encryption { get; set; }
-
- ///
- /// Gets or sets the expires.
- ///
- ///
- /// NOTE: The value will be converted to UTC when the is not .
- ///
- public DateTime? Expires { get; set; }
-
- ///
- /// Gets or sets the hiring.
- ///
- ///
- /// Example: https://example.com/jobs.html
- ///
- public IList? Hiring { get; set; }
-
- ///
- /// Gets or sets the policies.
- ///
- ///
- /// Example: https://example.com/disclosure-policy.html
- ///
- public IList? Policy { get; set; }
-
- ///
- /// Gets or sets the preferred languages.
- ///
- ///
- /// Examples:
- ///
- /// en
- /// es
- /// fr
- ///
- ///
- public IList? PreferredLanguages { get; set; }
- }
-}
diff --git a/Extensions/Cloudflare.Zones/Requests/ZonePurgeCachedUrlRequest.cs b/Extensions/Cloudflare.Zones/Requests/ZonePurgeCachedUrlRequest.cs
deleted file mode 100644
index 30ca0b8..0000000
--- a/Extensions/Cloudflare.Zones/Requests/ZonePurgeCachedUrlRequest.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Collections.Generic;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Url with headers to purge.
- ///
- ///
- /// Initializes a new instance of the class.
- ///
- /// The url to purge.
- public class ZonePurgeCachedUrlRequest(string url)
- {
- ///
- /// Defined headers to specifiy the purge request.
- ///
- public Dictionary Headers { get; set; } = [];
-
- ///
- /// The file url to purge.
- ///
- public string Url { get; set; } = url;
- }
-}
diff --git a/Extensions/Cloudflare.Zones/SecurityCenterExtensions.cs b/Extensions/Cloudflare.Zones/SecurityCenterExtensions.cs
deleted file mode 100644
index c82f87b..0000000
--- a/Extensions/Cloudflare.Zones/SecurityCenterExtensions.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using AMWD.Net.Api.Cloudflare.Zones.Internals.Requests;
-
-namespace AMWD.Net.Api.Cloudflare.Zones
-{
- ///
- /// Extensions for security center section of a zone.
- ///
- public static class SecurityCenterExtensions
- {
- ///
- /// Delete security.txt
- ///
- /// The .
- /// The zone ID.
- /// A cancellation token used to propagate notification that this operation should be canceled.
- public static async Task DeleteSecurityTxt(this ICloudflareClient client, string zoneId, CancellationToken cancellationToken = default)
- {
- zoneId.ValidateCloudflareId();
- return await client.DeleteAsync