Add "ZoneHold" extensions

This commit is contained in:
2025-06-24 20:44:09 +02:00
parent f9b7dcb7d2
commit 682f25ae75
13 changed files with 724 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Represents a request to create a zone hold.
/// </summary>
public class CreateZoneHoldRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="CreateZoneHoldRequest"/> class.
/// </summary>
/// <param name="zoneId">The zone identifier.</param>
public CreateZoneHoldRequest(string zoneId)
{
ZoneId = zoneId;
}
/// <summary>
/// The zone identifier.
/// </summary>
public string ZoneId { get; set; }
/// <summary>
/// If provided, the zone hold will extend to block any subdomain of the given zone, as well as SSL4SaaS Custom Hostnames.
/// </summary>
/// <remarks>
/// For example, a zone hold on a zone with the hostname 'example.com' and
/// <c><see cref="IncludeSubdomains"/>=<see langword="true"/></c> will block
/// 'example.com', 'staging.example.com', 'api.staging.example.com', etc.
/// </remarks>
public bool? IncludeSubdomains { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Represents a request to remove a zone hold.
/// </summary>
public class RemoveZoneHoldRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="RemoveZoneHoldRequest"/> class.
/// </summary>
/// <param name="zoneId">The zone identifier.</param>
public RemoveZoneHoldRequest(string zoneId)
{
ZoneId = zoneId;
}
/// <summary>
/// The zone identifier.
/// </summary>
public string ZoneId { get; set; }
/// <summary>
/// If it is provided, the hold will be temporarily disabled,
/// then automatically re-enabled by the system at the time specified in this timestamp.
/// Otherwise, the hold will be disabled indefinitely.
/// </summary>
public DateTime? HoldAfter { get; set; }
}
}

View File

@@ -0,0 +1,37 @@
namespace AMWD.Net.Api.Cloudflare.Zones
{
/// <summary>
/// Represents a request to update a zone hold.
/// </summary>
public class UpdateZoneHoldRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="UpdateZoneHoldRequest"/> class.
/// </summary>
/// <param name="zoneId">The zone identifier.</param>
public UpdateZoneHoldRequest(string zoneId)
{
ZoneId = zoneId;
}
/// <summary>
/// The zone identifier.
/// </summary>
public string ZoneId { get; set; }
/// <summary>
/// If the value is provided and future-dated, the hold will be temporarily disabled,
/// then automatically re-enabled by the system at the time specified in this timestamp.
/// A past-dated value will have no effect on an existing, enabled hold.
/// Providing an empty string will set its value to the current time.
/// </summary>
public DateTime? HoldAfter { get; set; }
/// <summary>
/// If <see langword="true"/>, the zone hold will extend to block any subdomain of the given zone, as well as SSL4SaaS Custom Hostnames.
/// For example, a zone hold on a zone with the hostname 'example.com' and <c><see cref="IncludeSubdomains"/>=<see langword="true"/></c>
/// will block 'example.com', 'staging.example.com', 'api.staging.example.com', etc.
/// </summary>
public bool? IncludeSubdomains { get; set; }
}
}