Changed folder structure, added explicit nullable for extensions.

This commit is contained in:
2024-10-31 13:07:39 +01:00
parent eadd35ac09
commit 935632df27
45 changed files with 1121 additions and 214 deletions

View File

@@ -0,0 +1,37 @@
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Request to create a new zone.
/// </summary>
/// <remarks>
/// Request to create a new zone.
/// </remarks>
/// <param name="accountId">The account identifier.</param>
/// <param name="name">The domain name.</param>
public class CreateZoneRequest(string accountId, string name)
{
/// <summary>
/// The account identifier.
/// </summary>
public string AccountId { get; set; } = accountId;
/// <summary>
/// The domain name.
/// </summary>
public string Name { get; set; } = name;
/// <summary>
/// The zone type.
/// </summary>
/// <remarks>
/// <para>
/// A full zone implies that DNS is hosted with Cloudflare.
/// A partial zone is typically a partner-hosted zone or a CNAME setup.
/// </para>
/// <para>
/// If not set, Cloudflare will use <see cref="ZoneType.Full"/> as default.
/// </para>
/// </remarks>
public ZoneType? Type { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
using System.Collections.Generic;
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// A request to edit a zone.
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="EditZoneRequest"/> class.
/// </remarks>
/// <param name="id">The zone identifier.</param>
public class EditZoneRequest(string id)
{
/// <summary>
/// Identifier.
/// </summary>
public string Id { get; set; } = id;
/// <summary>
/// A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.
/// <br/>
/// <em>This parameter is only available to Enterprise customers or if it has been explicitly enabled on a zone.</em>
/// </summary>
public ZoneType? Type { get; set; }
/// <summary>
/// An array of domains used for custom name servers.
/// <br/>
/// <em>This is only available for Business and Enterprise plans.</em>
/// </summary>
public IList<string>? VanityNameServers { get; set; }
}
}

View File

@@ -0,0 +1,61 @@
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Update DNS settings request.
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="UpdateDnsSettingsRequest"/> class.
/// </remarks>
/// <param name="id">The zone identifier.</param>
public class UpdateDnsSettingsRequest(string id)
{
/// <summary>
/// The zone identifier.
/// </summary>
public string Id { get; set; } = id;
/// <summary>
/// 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.
/// </summary>
public bool? FlattenAllCnames { get; set; }
/// <summary>
/// Whether to enable Foundation DNS Advanced Nameservers on the zone.
/// </summary>
public bool? FoundationDns { get; set; }
/// <summary>
/// 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.
/// </summary>
public bool? MultiProvider { get; set; }
/// <summary>
/// Settings determining the nameservers through which the zone should be available.
/// </summary>
public Nameserver? Nameservers { get; set; }
/// <summary>
/// The time to live (TTL) of the zone's nameserver (NS) records.
/// </summary>
/// <value>Unit: seconds. Range: <c>30 &lt;=</c> X <c>&lt;= 86400</c></value>
public int? NameserverTtl { get; set; }
/// <summary>
/// Allows a Secondary DNS zone to use (proxied) override records and CNAME flattening at the zone apex.
/// </summary>
public bool? SecondaryOverrides { get; set; }
/// <summary>
/// Components of the zone's SOA record.
/// </summary>
public StartOfAuthority? SOA { get; set; }
/// <summary>
/// Whether the zone mode is a regular or CDN/DNS only zone.
/// </summary>
public ZoneMode? Mode { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Url with headers to purge.
/// </summary>
/// <remarks>
/// Initializes a new instance of the <see cref="ZonePurgeCachedUrlRequest"/> class.
/// </remarks>
/// <param name="url">The url to purge.</param>
public class ZonePurgeCachedUrlRequest(string url)
{
/// <summary>
/// Defined headers to specifiy the purge request.
/// </summary>
public Dictionary<string, string> Headers { get; set; } = [];
/// <summary>
/// The file url to purge.
/// </summary>
public string Url { get; set; } = url;
}
}