Moving folder structure
This commit is contained in:
69
src/Extensions/Cloudflare.Zones/Models/AvailableRatePlan.cs
Normal file
69
src/Extensions/Cloudflare.Zones/Models/AvailableRatePlan.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A Cloudflare available plan.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/plans.ts#L60">Source</see>
|
||||
/// </summary>
|
||||
public class AvailableRatePlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether you can subscribe to this plan.
|
||||
/// </summary>
|
||||
[JsonProperty("can_subscribe")]
|
||||
public bool? CanSubscribe { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The monetary unit in which pricing information is displayed.
|
||||
/// </summary>
|
||||
[JsonProperty("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this plan is managed externally.
|
||||
/// </summary>
|
||||
[JsonProperty("externally_managed")]
|
||||
public bool? ExternallyManaged { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The frequency at which you will be billed for this plan.
|
||||
/// </summary>
|
||||
[JsonProperty("frequency")]
|
||||
public RenewFrequency? Frequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether you are currently subscribed to this plan.
|
||||
/// </summary>
|
||||
[JsonProperty("is_subscribed")]
|
||||
public bool? IsSubscribed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this plan has a legacy discount applied.
|
||||
/// </summary>
|
||||
[JsonProperty("legacy_discount")]
|
||||
public bool? LegacyDiscount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The legacy identifier for this rate plan, if any.
|
||||
/// </summary>
|
||||
[JsonProperty("legacy_id")]
|
||||
public string? LegacyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The plan name.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The amount you will be billed for this plan.
|
||||
/// </summary>
|
||||
[JsonProperty("price")]
|
||||
public decimal? Price { get; set; }
|
||||
}
|
||||
}
|
||||
394
src/Extensions/Cloudflare.Zones/Models/Domain.cs
Normal file
394
src/Extensions/Cloudflare.Zones/Models/Domain.cs
Normal file
@@ -0,0 +1,394 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A Cloudflare registrar domain.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L79">Source</see>
|
||||
/// </summary>
|
||||
public class Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// Domain identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows if a domain is available for transferring into Cloudflare Registrar.
|
||||
/// </summary>
|
||||
[JsonProperty("available")]
|
||||
public bool? Available { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if the domain can be registered as a new domain.
|
||||
/// </summary>
|
||||
[JsonProperty("can_register")]
|
||||
public bool? CanRegister { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows time of creation.
|
||||
/// </summary>
|
||||
[JsonProperty("created_at")]
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows name of current registrar.
|
||||
/// </summary>
|
||||
[JsonProperty("current_registrar")]
|
||||
public string? CurrentRegistrar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows when domain name registration expires.
|
||||
/// </summary>
|
||||
[JsonProperty("expires_at")]
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows whether a registrar lock is in place for a domain.
|
||||
/// </summary>
|
||||
[JsonProperty("locked")]
|
||||
public bool? Locked { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows contact information for domain registrant.
|
||||
/// </summary>
|
||||
[JsonProperty("registrant_contact")]
|
||||
public DomainRegistrantContact? RegistrantContact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A comma-separated list of registry status codes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A full list of status codes can be found at <see href="https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en">EPP Status Codes</see>.
|
||||
/// </remarks>
|
||||
[JsonProperty("registry_statuses")]
|
||||
public string? RegistryStatuses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether a particular TLD is currently supported by Cloudflare Registrar.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Refer to <see href="https://www.cloudflare.com/tld-policies/">TLD Policies</see> for a list of supported TLDs.
|
||||
/// </remarks>
|
||||
[JsonProperty("supported_tld")]
|
||||
public bool? SupportedTld { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Statuses for domain transfers into Cloudflare Registrar.
|
||||
/// </summary>
|
||||
[JsonProperty("transfer_in")]
|
||||
public DomainTransferIn? TransferIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last updated.
|
||||
/// </summary>
|
||||
[JsonProperty("updated_at")]
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows contact information for domain registrant.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L149">Source</see>
|
||||
/// </summary>
|
||||
public class DomainRegistrantContact
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DomainRegistrantContact"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">Address.</param>
|
||||
/// <param name="city">City.</param>
|
||||
/// <param name="state">State.</param>
|
||||
/// <param name="organization">User's organization.</param>
|
||||
public DomainRegistrantContact(string address, string city, string state, string organization)
|
||||
{
|
||||
Address = address;
|
||||
City = city;
|
||||
State = state;
|
||||
Organization = organization;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Address.
|
||||
/// </summary>
|
||||
[JsonProperty("address")]
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// City.
|
||||
/// </summary>
|
||||
[JsonProperty("city")]
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The country in which the user lives..
|
||||
/// </summary>
|
||||
[JsonProperty("country")]
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's first name.
|
||||
/// </summary>
|
||||
[JsonProperty("first_name")]
|
||||
public string? FirstName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's last name.
|
||||
/// </summary>
|
||||
[JsonProperty("last_name")]
|
||||
public string? LastName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of organization.
|
||||
/// </summary>
|
||||
[JsonProperty("organization")]
|
||||
public string Organization { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User's telephone number.
|
||||
/// </summary>
|
||||
[JsonProperty("phone")]
|
||||
public string? Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// State.
|
||||
/// </summary>
|
||||
[JsonProperty("state")]
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zipcode or postal code where the user lives.
|
||||
/// </summary>
|
||||
[JsonProperty("zip")]
|
||||
public string? ZipCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contact Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional address line for unit, floor, suite, etc.
|
||||
/// </summary>
|
||||
[JsonProperty("address2")]
|
||||
public string? Address2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The contact email address of the user.
|
||||
/// </summary>
|
||||
[JsonProperty("email")]
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contact fax number.
|
||||
/// </summary>
|
||||
[JsonProperty("fax")]
|
||||
public string? Fax { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Statuses for domain transfers into Cloudflare Registrar.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L219">Source</see>
|
||||
/// </summary>
|
||||
public class DomainTransferIn
|
||||
{
|
||||
/// <summary>
|
||||
/// Form of authorization has been accepted by the registrant.
|
||||
/// </summary>
|
||||
[JsonProperty("accept_foa")]
|
||||
public DomainTransferInAcceptFoa? AcceptFoa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows transfer status with the registry.
|
||||
/// </summary>
|
||||
[JsonProperty("approve_transfer")]
|
||||
public DomainTransferInApproveTransfer? ApproveTransfer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if cancellation is still possible.
|
||||
/// </summary>
|
||||
[JsonProperty("can_cancel_transfer")]
|
||||
public bool? CanCancelTransfer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Privacy guards are disabled at the foreign registrar.
|
||||
/// </summary>
|
||||
[JsonProperty("disable_privacy")]
|
||||
public DomainTransferInDisablePrivacy? DisablePrivacy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Auth code has been entered and verified.
|
||||
/// </summary>
|
||||
[JsonProperty("enter_auth_code")]
|
||||
public DomainTransferInEnterAuthCode? EnterAuthCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Domain is unlocked at the foreign registrar.
|
||||
/// </summary>
|
||||
[JsonProperty("unlock_domain")]
|
||||
public DomainTransferInUnlockDomain? UnlockDomain { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L223">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DomainTransferInAcceptFoa
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "needed")]
|
||||
Needed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ok.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ok")]
|
||||
Ok = 2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L228">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DomainTransferInApproveTransfer
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "needed")]
|
||||
Needed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ok.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ok")]
|
||||
Ok = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Pending.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Trying.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "trying")]
|
||||
Trying = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Rejected.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "rejected")]
|
||||
Rejected = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Unknown.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown = 6
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L238">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DomainTransferInDisablePrivacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "needed")]
|
||||
Needed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ok.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ok")]
|
||||
Ok = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Unknown.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L243">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DomainTransferInEnterAuthCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "needed")]
|
||||
Needed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ok.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ok")]
|
||||
Ok = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Pending.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Trying.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "trying")]
|
||||
Trying = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Rejected.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "rejected")]
|
||||
Rejected = 5
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/registrar/domains.ts#L248">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum DomainTransferInUnlockDomain
|
||||
{
|
||||
/// <summary>
|
||||
/// Needed.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "needed")]
|
||||
Needed = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Ok.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ok")]
|
||||
Ok = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Pending.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Trying.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "trying")]
|
||||
Trying = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Unknown.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unknown")]
|
||||
Unknown = 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Advanced protection from Distributed Denial of Service (DDoS) attacks on your
|
||||
/// website. This is an uneditable value that is <see cref="OnOffState.On"/> in the
|
||||
/// case of Business and Enterprise zones.
|
||||
/// </summary>
|
||||
public class AdvancedDDoS : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AdvancedDDoS"/> class.
|
||||
/// </summary>
|
||||
public AdvancedDDoS()
|
||||
{
|
||||
Id = ZoneSettingId.AdvancedDDoS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
44
src/Extensions/Cloudflare.Zones/Models/Settings/Aegis.cs
Normal file
44
src/Extensions/Cloudflare.Zones/Models/Settings/Aegis.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your
|
||||
/// layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your
|
||||
/// account so that you can increase your origin security by only allowing traffic
|
||||
/// from a small list of IP addresses.
|
||||
/// </summary>
|
||||
public class Aegis : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Aegis"/> class.
|
||||
/// </summary>
|
||||
public Aegis()
|
||||
{
|
||||
Id = ZoneSettingId.Aegis;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public AegisValue? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Value of the zone setting.
|
||||
/// </summary>
|
||||
public class AegisValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the feature is enabled or not.
|
||||
/// </summary>
|
||||
[JsonProperty("enabled")]
|
||||
public bool? Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Egress pool id which refers to a grouping of dedicated egress IPs through which
|
||||
/// Cloudflare will connect to origin.
|
||||
/// </summary>
|
||||
[JsonProperty("pool_id")]
|
||||
public string? PoolId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// When enabled, Cloudflare serves limited copies of web pages available from the
|
||||
/// <see href="https://archive.org/web/">Internet Archive's Wayback Machine</see>
|
||||
/// if your server is offline.
|
||||
/// Refer to <see href="https://developers.cloudflare.com/cache/about/always-online">Always Online</see>
|
||||
/// for more information.
|
||||
/// </summary>
|
||||
public class AlwaysOnline : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AlwaysOnline"/> class.
|
||||
/// </summary>
|
||||
public AlwaysOnline()
|
||||
{
|
||||
Id = ZoneSettingId.AlwaysOnline;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// If enabled, any <c>http://</c> URL is converted to <c>https://</c> through a 301
|
||||
/// redirect.
|
||||
/// </summary>
|
||||
public class AlwaysUseHTTPS : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AlwaysUseHTTPS"/> class.
|
||||
/// </summary>
|
||||
public AlwaysUseHTTPS()
|
||||
{
|
||||
Id = ZoneSettingId.AlwaysUseHTTPS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off Automatic HTTPS Rewrites.
|
||||
/// </summary>
|
||||
public class AutomaticHTTPSRewrites : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AutomaticHTTPSRewrites"/> class.
|
||||
/// </summary>
|
||||
public AutomaticHTTPSRewrites()
|
||||
{
|
||||
Id = ZoneSettingId.AutomaticHTTPSRewrites;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Apply custom caching based on the option selected.
|
||||
/// </summary>
|
||||
public class AutomaticPlatformOptimization
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether or not
|
||||
/// <see href="https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/">cache by device type</see>
|
||||
/// is enabled.
|
||||
/// </summary>
|
||||
[JsonProperty("cache_by_device_type")]
|
||||
public bool? CacheByDeviceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether or not Cloudflare proxy is enabled.
|
||||
/// </summary>
|
||||
[JsonProperty("cf")]
|
||||
public bool? CloudflareProxyEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether or not Automatic Platform Optimization is enabled.
|
||||
/// </summary>
|
||||
[JsonProperty("enabled")]
|
||||
public bool? Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An array of hostnames where Automatic Platform Optimization for WordPress is activated.
|
||||
/// </summary>
|
||||
[JsonProperty("hostnames")]
|
||||
public IReadOnlyCollection<string>? Hostnames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether or not site is powered by WordPress.
|
||||
/// </summary>
|
||||
[JsonProperty("wordpress")]
|
||||
public bool? WordPress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether or not
|
||||
/// <see href="https://wordpress.org/plugins/cloudflare/">Cloudflare for WordPress plugin</see>
|
||||
/// is installed.
|
||||
/// </summary>
|
||||
[JsonProperty("wp_plugin")]
|
||||
public bool? WpPlugin { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Extensions/Cloudflare.Zones/Models/Settings/Brotli.cs
Normal file
23
src/Extensions/Cloudflare.Zones/Models/Settings/Brotli.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// When the client requesting an asset supports the Brotli compression algorithm,
|
||||
/// Cloudflare will serve a Brotli compressed version of the asset.
|
||||
/// </summary>
|
||||
public class Brotli : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Brotli"/> class.
|
||||
/// </summary>
|
||||
public Brotli()
|
||||
{
|
||||
Id = ZoneSettingId.Brotli;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Control how long resources cached by client browsers remain valid.
|
||||
/// </summary>
|
||||
public class BrowserCacheTTL : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BrowserCacheTTL"/> class.
|
||||
/// </summary>
|
||||
public BrowserCacheTTL()
|
||||
{
|
||||
Id = ZoneSettingId.BrowserCacheTTL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of seconds to cache resources for.
|
||||
/// The API prohibits setting this to 0 for non-Enterprise domains.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public int? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Inspect the visitor's browser for headers commonly associated with spammers and
|
||||
/// certain bots.
|
||||
/// </summary>
|
||||
public class BrowserCheck : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BrowserCheck"/> class.
|
||||
/// </summary>
|
||||
public BrowserCheck()
|
||||
{
|
||||
Id = ZoneSettingId.BrowserCheck;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Browser Integrity Check.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// How to flatten the cname destination.
|
||||
/// </summary>
|
||||
[Obsolete("Please use the DNS Settings route instead.")]
|
||||
public class CNAMEFlattening : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CNAMEFlattening"/> class.
|
||||
/// </summary>
|
||||
public CNAMEFlattening()
|
||||
{
|
||||
Id = ZoneSettingId.CNAMEFlattening;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[Obsolete("Please use the DNS Settings route instead.")]
|
||||
[JsonProperty("value")]
|
||||
public string? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Apply custom caching based on the option selected.
|
||||
/// </summary>
|
||||
public class CacheLevel : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CacheLevel"/> class.
|
||||
/// </summary>
|
||||
public CacheLevel()
|
||||
{
|
||||
Id = ZoneSettingId.CacheLevel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public CacheLevelOption? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply custom caching based on the option selected.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L365">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum CacheLevelOption
|
||||
{
|
||||
/// <summary>
|
||||
/// Cloudflare does not cache.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "bypass")]
|
||||
Bypass = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Delivers resources from cache when there is no query string.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "basic")]
|
||||
Basic = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Delivers the same resource to everyone independent of the query string.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "simplified")]
|
||||
Simplified = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Caches all static content that has a query string.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "aggressive")]
|
||||
Aggressive = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Treats all content as static and caches all file types beyond the
|
||||
/// <see href="https://developers.cloudflare.com/cache/concepts/default-cache-behavior/#default-cached-file-extensions">Cloudflare default cached content</see>
|
||||
/// </summary>
|
||||
[EnumMember(Value = "cache_everything")]
|
||||
CacheEverything = 5
|
||||
}
|
||||
}
|
||||
103
src/Extensions/Cloudflare.Zones/Models/Settings/ChallengeTTL.cs
Normal file
103
src/Extensions/Cloudflare.Zones/Models/Settings/ChallengeTTL.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Specify how long a visitor is allowed access to your site after successfully
|
||||
/// completing a challenge (such as a CAPTCHA). After the TTL has expired the
|
||||
/// visitor will have to complete a new challenge. We recommend a 15 - 45 minute
|
||||
/// setting and will attempt to honor any setting above 45 minutes.
|
||||
/// (<see href="https://support.cloudflare.com/hc/en-us/articles/200170136"/>).
|
||||
/// </summary>
|
||||
public class ChallengeTTL : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChallengeTTL"/> class.
|
||||
/// </summary>
|
||||
public ChallengeTTL()
|
||||
{
|
||||
Id = ZoneSettingId.ChallengeTTL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public ChallengeTTLValue Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The time-to-live (TTL) of the challenge.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L403">Soruce</see>
|
||||
/// </summary>
|
||||
public enum ChallengeTTLValue : int
|
||||
{
|
||||
/// <summary>
|
||||
/// 5 minutes.
|
||||
/// </summary>
|
||||
FiveMinutes = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 15 minutes.
|
||||
/// </summary>
|
||||
FifteenMinutes = 900,
|
||||
|
||||
/// <summary>
|
||||
/// 30 minutes.
|
||||
/// </summary>
|
||||
HalfHour = 1800,
|
||||
|
||||
/// <summary>
|
||||
/// 45 minutes.
|
||||
/// </summary>
|
||||
ThreeQuartersHour = 2700,
|
||||
|
||||
/// <summary>
|
||||
/// 1 hour.
|
||||
/// </summary>
|
||||
Hour = 3600,
|
||||
|
||||
/// <summary>
|
||||
/// 2 hours.
|
||||
/// </summary>
|
||||
TwoHours = 7200,
|
||||
|
||||
/// <summary>
|
||||
/// 3 hours.
|
||||
/// </summary>
|
||||
ThreeHours = 10800,
|
||||
|
||||
/// <summary>
|
||||
/// 4 hours.
|
||||
/// </summary>
|
||||
FourHours = 14400,
|
||||
|
||||
/// <summary>
|
||||
/// 8 hours.
|
||||
/// </summary>
|
||||
EightHours = 28800,
|
||||
|
||||
/// <summary>
|
||||
/// 16 hours.
|
||||
/// </summary>
|
||||
SixteenHours = 57600,
|
||||
|
||||
/// <summary>
|
||||
/// 1 day.
|
||||
/// </summary>
|
||||
Day = 86400,
|
||||
|
||||
/// <summary>
|
||||
/// 1 week.
|
||||
/// </summary>
|
||||
Week = 604800,
|
||||
|
||||
/// <summary>
|
||||
/// 30 days.
|
||||
/// </summary>
|
||||
Month = 2592000,
|
||||
|
||||
/// <summary>
|
||||
/// 365 days.
|
||||
/// </summary>
|
||||
Year = 31536000
|
||||
}
|
||||
}
|
||||
23
src/Extensions/Cloudflare.Zones/Models/Settings/Ciphers.cs
Normal file
23
src/Extensions/Cloudflare.Zones/Models/Settings/Ciphers.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// An allowlist of ciphers for TLS termination. These ciphers must be in the
|
||||
/// BoringSSL format.
|
||||
/// </summary>
|
||||
public class Ciphers : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Ciphers"/> class.
|
||||
/// </summary>
|
||||
public Ciphers()
|
||||
{
|
||||
Id = ZoneSettingId.Ciphers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public IReadOnlyCollection<string> Value { get; set; } = [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Development Mode temporarily allows you to enter development mode for your
|
||||
/// websites if you need to make changes to your site.This will bypass Cloudflare's
|
||||
/// accelerated cache and slow down your site, but is useful if you are making
|
||||
/// changes to cacheable content (like images, css, or JavaScript) and would like to
|
||||
/// see those changes right away. Once entered, development mode will last for 3
|
||||
/// hours and then automatically toggle off.
|
||||
/// </summary>
|
||||
public class DevelopmentMode : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DevelopmentMode"/> class.
|
||||
/// </summary>
|
||||
public DevelopmentMode()
|
||||
{
|
||||
Id = ZoneSettingId.DevelopmentMode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current state of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 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 zero.
|
||||
/// </summary>
|
||||
[JsonProperty("time_remaining")]
|
||||
public int? TimeRemaining { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// When enabled, Cloudflare will attempt to speed up overall page loads by serving
|
||||
/// <c>103</c> responses with <c>Link</c> headers from the final response. Refer to
|
||||
/// <see href="https://developers.cloudflare.com/cache/about/early-hints">Early Hints</see>
|
||||
/// for more information.
|
||||
/// </summary>
|
||||
public class EarlyHints : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EarlyHints"/> class.
|
||||
/// </summary>
|
||||
public EarlyHints()
|
||||
{
|
||||
Id = ZoneSettingId.EarlyHints;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off <strong>Email Obfuscation</strong>.
|
||||
/// </summary>
|
||||
public class EmailObfuscation : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EmailObfuscation"/> class.
|
||||
/// </summary>
|
||||
public EmailObfuscation()
|
||||
{
|
||||
Id = ZoneSettingId.EmailObfuscation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Enhance your website's font delivery with Cloudflare Fonts. Deliver Google
|
||||
/// Hosted fonts from your own domain, boost performance, and enhance user privacy.
|
||||
/// Refer to the Cloudflare Fonts documentation for more information.
|
||||
/// </summary>
|
||||
public class FontSettings : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FontSettings"/> class.
|
||||
/// </summary>
|
||||
public FontSettings()
|
||||
{
|
||||
Id = ZoneSettingId.FontSettings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// HTTP/2 Edge Prioritization optimises the delivery of resources served through
|
||||
/// HTTP/2 to improve page load performance.It also supports fine control of
|
||||
/// content delivery when used in conjunction with Workers.
|
||||
/// </summary>
|
||||
public class H2Prioritization : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="H2Prioritization"/> class.
|
||||
/// </summary>
|
||||
public H2Prioritization()
|
||||
{
|
||||
Id = ZoneSettingId.H2Prioritization;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffCustomState Value { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Extensions/Cloudflare.Zones/Models/Settings/HTTP2.cs
Normal file
22
src/Extensions/Cloudflare.Zones/Models/Settings/HTTP2.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// HTTP/2 enabled for this zone.
|
||||
/// </summary>
|
||||
public class HTTP2 : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HTTP2"/> class.
|
||||
/// </summary>
|
||||
public HTTP2()
|
||||
{
|
||||
Id = ZoneSettingId.HTTP2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Extensions/Cloudflare.Zones/Models/Settings/HTTP3.cs
Normal file
22
src/Extensions/Cloudflare.Zones/Models/Settings/HTTP3.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// HTTP/3 enabled for this zone.
|
||||
/// </summary>
|
||||
public class HTTP3 : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HTTP3"/> class.
|
||||
/// </summary>
|
||||
public HTTP3()
|
||||
{
|
||||
Id = ZoneSettingId.HTTP3;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// When enabled, the Hotlink Protection option ensures that other sites cannot suck
|
||||
/// up your bandwidth by building pages that use images hosted on your site.Anytime
|
||||
/// a request for an image on your site hits Cloudflare, we check to ensure that
|
||||
/// it's not another site requesting them. People will still be able to download and
|
||||
/// view images from your page, but other sites won't be able to steal them for use
|
||||
/// on their own pages.
|
||||
/// (<see href="https://support.cloudflare.com/hc/en-us/articles/200170026"/>).
|
||||
/// </summary>
|
||||
public class HotlinkProtection : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HotlinkProtection"/> class.
|
||||
/// </summary>
|
||||
public HotlinkProtection()
|
||||
{
|
||||
Id = ZoneSettingId.HotlinkProtection;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Cloudflare adds a CF-IPCountry HTTP header containing the country code that
|
||||
/// corresponds to the visitor.
|
||||
/// </summary>
|
||||
public class IPGeolocation : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IPGeolocation"/> class.
|
||||
/// </summary>
|
||||
public IPGeolocation()
|
||||
{
|
||||
Id = ZoneSettingId.IPGeolocation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of adding the IP Geolocation Header.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/Extensions/Cloudflare.Zones/Models/Settings/IPV6.cs
Normal file
23
src/Extensions/Cloudflare.Zones/Models/Settings/IPV6.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable IPv6 on all subdomains that are Cloudflare enabled.
|
||||
/// (<see href="https://support.cloudflare.com/hc/en-us/articles/200168586"/>).
|
||||
/// </summary>
|
||||
public class IPV6 : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IPV6"/> class.
|
||||
/// </summary>
|
||||
public IPV6()
|
||||
{
|
||||
Id = ZoneSettingId.IPV6;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Image Transformations provides on-demand resizing, conversion and optimization
|
||||
/// for images served through Cloudflare's network. Refer to the
|
||||
/// <see href="https://developers.cloudflare.com/images/">Image Transformations documentation</see>
|
||||
/// for more information.
|
||||
/// </summary>
|
||||
public class ImageResizing : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImageResizing"/> class.
|
||||
/// </summary>
|
||||
public ImageResizing()
|
||||
{
|
||||
Id = ZoneSettingId.ImageResizing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffOpenState Value { get; set; }
|
||||
}
|
||||
}
|
||||
119
src/Extensions/Cloudflare.Zones/Models/Settings/MaxUpload.cs
Normal file
119
src/Extensions/Cloudflare.Zones/Models/Settings/MaxUpload.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum size of an allowable upload.
|
||||
/// </summary>
|
||||
public class MaxUpload : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="MaxUpload"/> class.
|
||||
/// </summary>
|
||||
public MaxUpload()
|
||||
{
|
||||
Id = ZoneSettingId.MaxUpload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public MaxUploadSize Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maximum size of an allowable upload.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1980">Soruce</see>
|
||||
/// </summary>
|
||||
public enum MaxUploadSize : int
|
||||
{
|
||||
/// <summary>
|
||||
/// 100 MB.
|
||||
/// </summary>
|
||||
M100 = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 125 MB.
|
||||
/// </summary>
|
||||
M125 = 125,
|
||||
|
||||
/// <summary>
|
||||
/// 150 MB.
|
||||
/// </summary>
|
||||
M150 = 150,
|
||||
|
||||
/// <summary>
|
||||
/// 175 MB.
|
||||
/// </summary>
|
||||
M175 = 175,
|
||||
|
||||
/// <summary>
|
||||
/// 200 MB.
|
||||
/// </summary>
|
||||
M200 = 200,
|
||||
|
||||
/// <summary>
|
||||
/// 225 MB.
|
||||
/// </summary>
|
||||
M225 = 225,
|
||||
|
||||
/// <summary>
|
||||
/// 250 MB.
|
||||
/// </summary>
|
||||
M250 = 250,
|
||||
|
||||
/// <summary>
|
||||
/// 275 MB.
|
||||
/// </summary>
|
||||
M275 = 275,
|
||||
|
||||
/// <summary>
|
||||
/// 300 MB.
|
||||
/// </summary>
|
||||
M300 = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 325 MB.
|
||||
/// </summary>
|
||||
M325 = 325,
|
||||
|
||||
/// <summary>
|
||||
/// 350 MB.
|
||||
/// </summary>
|
||||
M350 = 350,
|
||||
|
||||
/// <summary>
|
||||
/// 375 MB.
|
||||
/// </summary>
|
||||
M375 = 375,
|
||||
|
||||
/// <summary>
|
||||
/// 400 MB.
|
||||
/// </summary>
|
||||
M400 = 400,
|
||||
|
||||
/// <summary>
|
||||
/// 425 MB.
|
||||
/// </summary>
|
||||
M425 = 425,
|
||||
|
||||
/// <summary>
|
||||
/// 450 MB.
|
||||
/// </summary>
|
||||
M450 = 450,
|
||||
|
||||
/// <summary>
|
||||
/// 475 MB.
|
||||
/// </summary>
|
||||
M475 = 475,
|
||||
|
||||
/// <summary>
|
||||
/// 500 MB.
|
||||
/// </summary>
|
||||
M500 = 500,
|
||||
|
||||
/// <summary>
|
||||
/// 1000 MB (1 GB).
|
||||
/// </summary>
|
||||
G1 = 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Only accepts HTTPS requests that use at least the TLS protocol version
|
||||
/// specified. For example, if TLS 1.1 is selected, TLS 1.0 connections will be
|
||||
/// rejected, while 1.1, 1.2, and 1.3 (if enabled) will be permitted.
|
||||
/// </summary>
|
||||
public class MinTLSVersion : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MinTLSVersion"/> class.
|
||||
/// </summary>
|
||||
public MinTLSVersion()
|
||||
{
|
||||
Id = ZoneSettingId.MinTLSVersion;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
public TlsVersion? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Available TLS versions.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L785">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum TlsVersion
|
||||
{
|
||||
/// <summary>
|
||||
/// TLS 1.0
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1.0")]
|
||||
Tls10 = 1,
|
||||
|
||||
/// <summary>
|
||||
/// TLS 1.1
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1.1")]
|
||||
Tls11 = 2,
|
||||
|
||||
/// <summary>
|
||||
/// TLS 1.2
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1.2")]
|
||||
Tls12 = 3,
|
||||
|
||||
/// <summary>
|
||||
/// TLS 1.3
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1.3")]
|
||||
Tls13 = 4
|
||||
}
|
||||
}
|
||||
24
src/Extensions/Cloudflare.Zones/Models/Settings/Mirage.cs
Normal file
24
src/Extensions/Cloudflare.Zones/Models/Settings/Mirage.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Cloudflare Mirage reduces bandwidth used by images in mobile browsers. It can
|
||||
/// accelerate loading of image-heavy websites on very slow mobile connections and
|
||||
/// HTTP/1.
|
||||
/// </summary>
|
||||
public class Mirage : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Mirage"/> class.
|
||||
/// </summary>
|
||||
public Mirage()
|
||||
{
|
||||
Id = ZoneSettingId.Mirage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Mirage.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
34
src/Extensions/Cloudflare.Zones/Models/Settings/NEL.cs
Normal file
34
src/Extensions/Cloudflare.Zones/Models/Settings/NEL.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Enable Network Error Logging reporting on your zone. (Beta)
|
||||
/// </summary>
|
||||
public class NEL : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NEL"/> class.
|
||||
/// </summary>
|
||||
public NEL()
|
||||
{
|
||||
Id = ZoneSettingId.NEL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public NELValue? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
public class NELValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("enabled")]
|
||||
public bool? Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Opportunistic Encryption allows browsers to access HTTP URIs over an encrypted
|
||||
/// TLS channel. It's not a substitute for HTTPS, but provides additional security
|
||||
/// for otherwise vulnerable requests.
|
||||
/// </summary>
|
||||
public class OpportunisticEncryption : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpportunisticEncryption"/> class.
|
||||
/// </summary>
|
||||
public OpportunisticEncryption()
|
||||
{
|
||||
Id = ZoneSettingId.OpportunisticEncryption;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Opportunistic Encryption.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Add an Alt-Svc header to all legitimate requests from Tor, allowing the
|
||||
/// connection to use our onion services instead of exit nodes.
|
||||
/// </summary>
|
||||
public class OpportunisticOnion : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpportunisticOnion"/> class.
|
||||
/// </summary>
|
||||
public OpportunisticOnion()
|
||||
{
|
||||
Id = ZoneSettingId.OpportunisticOnion;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also
|
||||
/// on Cloudflare.
|
||||
/// </summary>
|
||||
public class OrangeToOrange : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OrangeToOrange"/> class.
|
||||
/// </summary>
|
||||
public OrangeToOrange()
|
||||
{
|
||||
Id = ZoneSettingId.OrangeToOrange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off Cloudflare error pages generated from issues sent from the origin
|
||||
/// server. If enabled, this setting triggers error pages issued by the origin.
|
||||
/// </summary>
|
||||
public class OriginErrorPagePassThru : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OriginErrorPagePassThru"/> class.
|
||||
/// </summary>
|
||||
public OriginErrorPagePassThru()
|
||||
{
|
||||
Id = ZoneSettingId.OriginErrorPagePassThru;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Origin Error Page Passthru.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum HTTP version supported by the origin server.
|
||||
/// </summary>
|
||||
public class OriginMaxHTTPVersion : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OriginMaxHTTPVersion"/> class.
|
||||
/// </summary>
|
||||
public OriginMaxHTTPVersion()
|
||||
{
|
||||
Id = ZoneSettingId.OriginMaxHTTPVersion;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The value of the feature.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public HttpVersion Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// HTTP versions.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L984">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum HttpVersion
|
||||
{
|
||||
/// <summary>
|
||||
/// HTTP/1
|
||||
/// </summary>
|
||||
[EnumMember(Value = "1")]
|
||||
HTTP1 = 1,
|
||||
|
||||
/// <summary>
|
||||
/// HTTP/2
|
||||
/// </summary>
|
||||
[EnumMember(Value = "2")]
|
||||
HTTP2 = 2
|
||||
}
|
||||
}
|
||||
51
src/Extensions/Cloudflare.Zones/Models/Settings/Polish.cs
Normal file
51
src/Extensions/Cloudflare.Zones/Models/Settings/Polish.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Apply options from the Polish feature of the Cloudflare Speed app.
|
||||
/// </summary>
|
||||
public class Polish : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Polish"/> class.
|
||||
/// </summary>
|
||||
public Polish()
|
||||
{
|
||||
Id = ZoneSettingId.Polish;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The level of Polish you want applied to your origin.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public PolishLevel? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The level of Polish.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1001">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum PolishLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// No Polish.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "off")]
|
||||
Off = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Basic Polish.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "lossless")]
|
||||
LossLess = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Full Polish.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "lossy")]
|
||||
Lossy = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Cloudflare will prefetch any URLs that are included in the response headers.
|
||||
/// This is limited to Enterprise Zones.
|
||||
/// </summary>
|
||||
public class PrefetchPreload : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PrefetchPreload"/> class.
|
||||
/// </summary>
|
||||
public PrefetchPreload()
|
||||
{
|
||||
Id = ZoneSettingId.PrefetchPreload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Privacy Pass.
|
||||
/// </summary>
|
||||
[Obsolete("Privacy Pass v1 was deprecated in 2023.")]
|
||||
public class PrivacyPass : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PrivacyPass"/> class.
|
||||
/// </summary>
|
||||
public PrivacyPass()
|
||||
{
|
||||
Id = ZoneSettingId.PrivacyPass;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Maximum time between two read operations from origin.
|
||||
/// </summary>
|
||||
public class ProxyReadTimeout : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProxyReadTimeout"/> class.
|
||||
/// </summary>
|
||||
public ProxyReadTimeout()
|
||||
{
|
||||
Id = ZoneSettingId.ProxyReadTimeout;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public int Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// The value set for the Pseudo IPv4 setting.
|
||||
/// </summary>
|
||||
public class PseudoIPV4 : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PseudoIPV4"/> class.
|
||||
/// </summary>
|
||||
public PseudoIPV4()
|
||||
{
|
||||
Id = ZoneSettingId.PseudoIPV4;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public PseudoIPV4Value Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pseudo IPv4 values.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1081">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum PseudoIPV4Value
|
||||
{
|
||||
/// <summary>
|
||||
/// Off.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "off")]
|
||||
Off = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Add a header.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "add_header")]
|
||||
AddHeader = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Add header or overwrite if exists.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "overwrite_header")]
|
||||
OverwriteHeader = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Automatically replace insecure JavaScript libraries with safer and faster
|
||||
/// alternatives provided under cdnjs and powered by Cloudflare. Currently supports
|
||||
/// the following libraries: Polyfill under polyfill.io.
|
||||
/// </summary>
|
||||
public class ReplaceInsecureJS : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReplaceInsecureJS"/> class.
|
||||
/// </summary>
|
||||
public ReplaceInsecureJS()
|
||||
{
|
||||
Id = ZoneSettingId.ReplaceInsecureJS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off whether Cloudflare should wait for an entire file from the origin
|
||||
/// server before forwarding it to the site visitor. By default, Cloudflare sends
|
||||
/// packets to the client as they arrive from the origin server.
|
||||
/// </summary>
|
||||
public class ResponseBuffering : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ResponseBuffering"/> class.
|
||||
/// </summary>
|
||||
public ResponseBuffering()
|
||||
{
|
||||
Id = ZoneSettingId.ResponseBuffering;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Response Buffering.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off Rocket Loader in the Cloudflare Speed app.
|
||||
/// </summary>
|
||||
public class RocketLoader : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RocketLoader"/> class.
|
||||
/// </summary>
|
||||
public RocketLoader()
|
||||
{
|
||||
Id = ZoneSettingId.RocketLoader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Rocket Loader.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
69
src/Extensions/Cloudflare.Zones/Models/Settings/SSL.cs
Normal file
69
src/Extensions/Cloudflare.Zones/Models/Settings/SSL.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Control options for the SSL feature of the Edge Certificates tab in the
|
||||
/// Cloudflare SSL/TLS app.
|
||||
/// </summary>
|
||||
public class SSL : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="SSL"/> class.
|
||||
/// </summary>
|
||||
public SSL()
|
||||
{
|
||||
Id = ZoneSettingId.SSL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The encryption mode that Cloudflare uses to connect to your origin server.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public SslMode? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SSL encryption modes.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1307">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum SslMode
|
||||
{
|
||||
/// <summary>
|
||||
/// No encryption applied.
|
||||
/// Turning off SSL disables HTTPS and causes browsers to show a warning that your website is not secure.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "off")]
|
||||
Off = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enable encryption only between your visitors and Cloudflare.
|
||||
/// This will avoid browser security warnings, but all connections between Cloudflare and your origin are made through HTTP.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "flexible")]
|
||||
Flexible = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enable encryption end-to-end.
|
||||
/// Use this mode when your origin server supports SSL certification but does not use a valid, publicly trusted certificate.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "full")]
|
||||
Full = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Enable encryption end-to-end and enforce validation on origin certificates.
|
||||
/// Use Cloudflare’s Origin CA to generate certificates for your origin.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "strict")]
|
||||
Strict = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Enforce encryption between Cloudflare and your origin.
|
||||
/// Use this mode to guarantee connections to your origin will always be encrypted, regardless of your visitor’s request.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "origin_pull")]
|
||||
OriginPull = 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Enrollment in the SSL/TLS Recommender service which tries to detect and
|
||||
/// recommend (by sending periodic emails) the most secure SSL/TLS setting your
|
||||
/// origin servers support.
|
||||
/// </summary>
|
||||
[Obsolete("SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS: ssl_automatic_mode")]
|
||||
public class SSLRecommender : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SSLRecommender"/> class.
|
||||
/// </summary>
|
||||
public SSLRecommender()
|
||||
{
|
||||
Id = ZoneSettingId.SSLRecommender;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public string? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Time (in seconds) that a resource will be ensured to remain on Cloudflare's
|
||||
/// cache servers.
|
||||
/// </summary>
|
||||
public class SchemasEdgeCacheTTL : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SchemasEdgeCacheTTL"/> class.
|
||||
/// </summary>
|
||||
public SchemasEdgeCacheTTL()
|
||||
{
|
||||
Id = ZoneSettingId.SchemasEdgeCacheTTL;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public EdgeCacheTTLValue Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The time-to-live (TTL) of the challenge.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1873">Soruce</see>
|
||||
/// </summary>
|
||||
public enum EdgeCacheTTLValue : int
|
||||
{
|
||||
/// <summary>
|
||||
/// 30 seconds.
|
||||
/// </summary>
|
||||
HalfMinute = 30,
|
||||
|
||||
/// <summary>
|
||||
/// 1 minute.
|
||||
/// </summary>
|
||||
Minute = 60,
|
||||
|
||||
/// <summary>
|
||||
/// 5 minutes.
|
||||
/// </summary>
|
||||
FiveMinutes = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 20 minutes.
|
||||
/// </summary>
|
||||
TwentyMinutes = 1200,
|
||||
|
||||
/// <summary>
|
||||
/// 30 minutes.
|
||||
/// </summary>
|
||||
HalfHour = 1800,
|
||||
|
||||
/// <summary>
|
||||
/// 1 hour.
|
||||
/// </summary>
|
||||
Hour = 3600,
|
||||
|
||||
/// <summary>
|
||||
/// 2 hours.
|
||||
/// </summary>
|
||||
TwoHours = 7200,
|
||||
|
||||
/// <summary>
|
||||
/// 3 hours.
|
||||
/// </summary>
|
||||
ThreeHours = 10800,
|
||||
|
||||
/// <summary>
|
||||
/// 4 hours.
|
||||
/// </summary>
|
||||
FourHours = 14400,
|
||||
|
||||
/// <summary>
|
||||
/// 5 hours.
|
||||
/// </summary>
|
||||
FiveHours = 18000,
|
||||
|
||||
/// <summary>
|
||||
/// 8 hours.
|
||||
/// </summary>
|
||||
EightHours = 28800,
|
||||
|
||||
/// <summary>
|
||||
/// 12 hours.
|
||||
/// </summary>
|
||||
HalfDay = 43200,
|
||||
|
||||
/// <summary>
|
||||
/// 16 hours.
|
||||
/// </summary>
|
||||
SixteenHours = 57600,
|
||||
|
||||
/// <summary>
|
||||
/// 20 hours.
|
||||
/// </summary>
|
||||
TwentyHours = 72000,
|
||||
|
||||
/// <summary>
|
||||
/// 1 day.
|
||||
/// </summary>
|
||||
Day = 86400,
|
||||
|
||||
/// <summary>
|
||||
/// 2 days.
|
||||
/// </summary>
|
||||
TwoDays = 172800,
|
||||
|
||||
/// <summary>
|
||||
/// 3 days.
|
||||
/// </summary>
|
||||
ThreeDays = 259200,
|
||||
|
||||
/// <summary>
|
||||
/// 4 days.
|
||||
/// </summary>
|
||||
FourDays = 345600,
|
||||
|
||||
/// <summary>
|
||||
/// 5 days.
|
||||
/// </summary>
|
||||
FiveDays = 432000,
|
||||
|
||||
/// <summary>
|
||||
/// 6 days.
|
||||
/// </summary>
|
||||
SixDays = 518400,
|
||||
|
||||
/// <summary>
|
||||
/// 1 week.
|
||||
/// </summary>
|
||||
Week = 604800,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Cloudflare security header for a zone.
|
||||
/// </summary>
|
||||
public class SecurityHeaders : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SecurityHeaders"/> class.
|
||||
/// </summary>
|
||||
public SecurityHeaders()
|
||||
{
|
||||
Id = ZoneSettingId.SecurityHeaders;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public SecurityHeaderValue? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
public class SecurityHeaderValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Strict Transport Security.
|
||||
/// </summary>
|
||||
[JsonProperty("strict_transport_security")]
|
||||
public SecurityHeaderStrictTransportSecurity? StrictTransportSecurity { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strict Transport Security.
|
||||
/// </summary>
|
||||
public class SecurityHeaderStrictTransportSecurity
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not strict transport security is enabled.
|
||||
/// </summary>
|
||||
[JsonProperty("enabled")]
|
||||
public bool? Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Include all subdomains for strict transport security.
|
||||
/// </summary>
|
||||
[JsonProperty("include_subdomains")]
|
||||
public bool? IncludeSubdomains { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Max age in seconds of the strict transport security.
|
||||
/// </summary>
|
||||
[JsonProperty("max_age")]
|
||||
public int? MaxAge { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not to include <c>X-Content-Type-Options: nosniff</c> header.
|
||||
/// </summary>
|
||||
[JsonProperty("nosniff")]
|
||||
public bool? NoSniff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enable automatic preload of the HSTS configuration.
|
||||
/// </summary>
|
||||
[JsonProperty("preload")]
|
||||
public bool? Preload { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Control options for the <strong>Security Level</strong> feature from the <strong>Security</strong> app.
|
||||
/// </summary>
|
||||
public class SecurityLevel : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SecurityLevel"/> class.
|
||||
/// </summary>
|
||||
public SecurityLevel()
|
||||
{
|
||||
Id = ZoneSettingId.SecurityLevel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public SecurityLevelValue? Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Security levels.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1223">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum SecurityLevelValue
|
||||
{
|
||||
/// <summary>
|
||||
/// Off.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "off")]
|
||||
Off = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Essentially off.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "essentially_off")]
|
||||
EssentiallyOff = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Low.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "low")]
|
||||
Low = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Medium.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "medium")]
|
||||
Medium = 4,
|
||||
|
||||
/// <summary>
|
||||
/// High.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "high")]
|
||||
High = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Under Attack.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "under_attack")]
|
||||
UnderAttack = 6
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// If there is sensitive content on your website that you want visible to real
|
||||
/// visitors, but that you want to hide from suspicious visitors, all you have to do
|
||||
/// is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
|
||||
/// be excluded from suspicious visitors in the following SSE tags: <c><!--sse--></!--sse--></c>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For example: <c><!--sse-->Bad visitors won't see my phone number, 555-555-5555</!--sse--></c>
|
||||
/// <br/>
|
||||
/// Note: SSE only will work with HTML. If you have HTML minification enabled,
|
||||
/// you won't see the SSE tags in your HTML source when it's served through Cloudflare.
|
||||
/// SSE will still function in this case, as Cloudflare's HTML minification and SSE
|
||||
/// functionality occur on-the-fly as the resource moves through our network to the visitor's computer.
|
||||
/// (<see href="https://support.cloudflare.com/hc/en-us/articles/200170036"/>).
|
||||
/// </remarks>
|
||||
public class ServerSideExcludes : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerSideExcludes"/> class.
|
||||
/// </summary>
|
||||
public ServerSideExcludes()
|
||||
{
|
||||
Id = ZoneSettingId.ServerSideExcludes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off the reordering of query strings. When query strings have the same
|
||||
/// structure, caching improves.
|
||||
/// </summary>
|
||||
public class SortQueryStringForCache : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SortQueryStringForCache"/> class.
|
||||
/// </summary>
|
||||
public SortQueryStringForCache()
|
||||
{
|
||||
Id = ZoneSettingId.SortQueryStringForCache;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of Query String Sort.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Only allows TLS1.2.
|
||||
/// </summary>
|
||||
public class TLS1_2Only : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TLS1_2Only"/> class.
|
||||
/// </summary>
|
||||
public TLS1_2Only()
|
||||
{
|
||||
Id = ZoneSettingId.TLS1_2Only;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
51
src/Extensions/Cloudflare.Zones/Models/Settings/TLS1_3.cs
Normal file
51
src/Extensions/Cloudflare.Zones/Models/Settings/TLS1_3.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables Crypto TLS 1.3 feature for a zone.
|
||||
/// </summary>
|
||||
public class TLS1_3 : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables Crypto TLS 1.3 feature for a zone.
|
||||
/// </summary>
|
||||
public TLS1_3()
|
||||
{
|
||||
Id = ZoneSettingId.TLS1_3;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public TlsOption Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Available TLS options.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/settings.ts#L1352">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum TlsOption
|
||||
{
|
||||
/// <summary>
|
||||
/// Off.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "off")]
|
||||
Off = 1,
|
||||
|
||||
/// <summary>
|
||||
/// On.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "on")]
|
||||
On = 2,
|
||||
|
||||
/// <summary>
|
||||
/// ZRT refers to <see href="https://blog.cloudflare.com/introducing-0-rtt/">Zero Round Trip Time Resumption (0-RTT)</see>.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "zrt")]
|
||||
ZeroRoundTrip = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// TLS Client Auth requires Cloudflare to connect to your origin server using a
|
||||
/// client certificate (Enterprise Only).
|
||||
/// </summary>
|
||||
public class TLSClientAuth : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize a new instance of the <see cref="TLSClientAuth"/> class.
|
||||
/// </summary>
|
||||
public TLSClientAuth()
|
||||
{
|
||||
Id = ZoneSettingId.TLSClientAuth;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off the True-Client-IP Header feature of the Cloudflare Network app.
|
||||
/// </summary>
|
||||
public class TrueClientIPHeader : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TrueClientIPHeader"/> class.
|
||||
/// </summary>
|
||||
public TrueClientIPHeader()
|
||||
{
|
||||
Id = ZoneSettingId.TrueClientIPHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of True Client IP Header.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
24
src/Extensions/Cloudflare.Zones/Models/Settings/WAF.cs
Normal file
24
src/Extensions/Cloudflare.Zones/Models/Settings/WAF.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// Turn on or off
|
||||
/// <see href="https://developers.cloudflare.com/waf/reference/legacy/old-waf-managed-rules/">WAF managed rules (previous version, deprecated)</see>.
|
||||
/// You cannot enable or disable individual WAF managed rules via Page Rules.
|
||||
/// </summary>
|
||||
public class WAF : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WAF"/> class.
|
||||
/// </summary>
|
||||
public WAF()
|
||||
{
|
||||
Id = ZoneSettingId.WAF;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The status of WAF managed rules (previous version).
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState? Value { get; set; }
|
||||
}
|
||||
}
|
||||
24
src/Extensions/Cloudflare.Zones/Models/Settings/WebP.cs
Normal file
24
src/Extensions/Cloudflare.Zones/Models/Settings/WebP.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// When the client requesting the image supports the WebP image codec, and WebP
|
||||
/// offers a performance advantage over the original image format, Cloudflare will
|
||||
/// serve a WebP version of the original image.
|
||||
/// </summary>
|
||||
public class WebP : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WebP"/> class.
|
||||
/// </summary>
|
||||
public WebP()
|
||||
{
|
||||
Id = ZoneSettingId.WebP;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
27
src/Extensions/Cloudflare.Zones/Models/Settings/Websocket.cs
Normal file
27
src/Extensions/Cloudflare.Zones/Models/Settings/Websocket.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// WebSockets are open connections sustained between the client and the origin
|
||||
/// server. Inside a WebSockets connection, the client and the origin can pass data
|
||||
/// back and forth without having to reestablish sessions. This makes exchanging
|
||||
/// data within a WebSockets connection fast. WebSockets are often used for real-time
|
||||
/// applications such as live chat and gaming. For more information refer to
|
||||
/// <see href="https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-Cloudflare-with-WebSockets-">Can I use Cloudflare with Websockets</see>.
|
||||
/// </summary>
|
||||
public class Websocket : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Websocket"/> class.
|
||||
/// </summary>
|
||||
public Websocket()
|
||||
{
|
||||
Id = ZoneSettingId.Websocket;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
22
src/Extensions/Cloudflare.Zones/Models/Settings/ZeroRTT.cs
Normal file
22
src/Extensions/Cloudflare.Zones/Models/Settings/ZeroRTT.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// 0-RTT session resumption enabled for this zone.
|
||||
/// </summary>
|
||||
public class ZeroRTT : ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ZeroRTT"/> class.
|
||||
/// </summary>
|
||||
public ZeroRTT()
|
||||
{
|
||||
Id = ZoneSettingId.ZeroRTT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Current value of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("value")]
|
||||
public OnOffState Value { get; set; }
|
||||
}
|
||||
}
|
||||
408
src/Extensions/Cloudflare.Zones/Models/Zone.cs
Normal file
408
src/Extensions/Cloudflare.Zones/Models/Zone.cs
Normal file
@@ -0,0 +1,408 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A Cloudflare zone.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L231">Source</see>
|
||||
/// </summary>
|
||||
public class Zone
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Zone"/> class.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifier.</param>
|
||||
/// <param name="name">The domain name.</param>
|
||||
/// <param name="nameServers">The name servers Cloudflare assigns to the zone.</param>
|
||||
/// <param name="account">The account the zone belongs to.</param>
|
||||
/// <param name="meta">Metadata about the zone.</param>
|
||||
/// <param name="owner">The owner of the zone.</param>
|
||||
public Zone(string id, string name, IReadOnlyCollection<string> nameServers, ZoneAccount account, ZoneMeta meta, ZoneOwner owner)
|
||||
{
|
||||
Id = id;
|
||||
Account = account;
|
||||
Meta = meta;
|
||||
Name = name;
|
||||
NameServers = nameServers;
|
||||
Owner = owner;
|
||||
|
||||
#pragma warning disable CS0612
|
||||
Plan = new();
|
||||
#pragma warning restore CS0612
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The account the zone belongs to.
|
||||
/// </summary>
|
||||
[JsonProperty("account")]
|
||||
public ZoneAccount Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last time proof of ownership was detected and the zone was made active.
|
||||
/// </summary>
|
||||
[JsonProperty("activated_on")]
|
||||
public DateTime? ActivatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When the zone was created.
|
||||
/// </summary>
|
||||
[JsonProperty("created_on")]
|
||||
public DateTime CreatedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[JsonProperty("development_mode")]
|
||||
public int DevelopmentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Metadata about the zone.
|
||||
/// </summary>
|
||||
[JsonProperty("meta")]
|
||||
public ZoneMeta Meta { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When the zone was last modified.
|
||||
/// </summary>
|
||||
[JsonProperty("modified_on")]
|
||||
public DateTime ModifiedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The domain name.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name servers Cloudflare assigns to a zone.
|
||||
/// </summary>
|
||||
[JsonProperty("name_servers")]
|
||||
public IReadOnlyCollection<string> NameServers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DNS host at the time of switching to Cloudflare.
|
||||
/// </summary>
|
||||
[JsonProperty("original_dnshost")]
|
||||
public string? OriginalDnsHost { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Original name servers before moving to Cloudflare.
|
||||
/// </summary>
|
||||
[JsonProperty("original_name_servers")]
|
||||
public IReadOnlyCollection<string>? OriginalNameServers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Registrar for the domain at the time of switching to Cloudflare.
|
||||
/// </summary>
|
||||
[JsonProperty("original_registrar")]
|
||||
public string? OriginalRegistrar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The owner of the zone.
|
||||
/// </summary>
|
||||
[JsonProperty("owner")]
|
||||
public ZoneOwner Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A Zones subscription information.
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
[JsonProperty("plan")]
|
||||
public ZonePlan Plan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allows the customer to use a custom apex.
|
||||
/// <em>Tenants Only Configuration</em>.
|
||||
/// </summary>
|
||||
[JsonProperty("cname_suffix")]
|
||||
public string? CnameSuffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the zone is only using Cloudflare DNS services.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A <see langword="true"/> value means the zone will not receive security or performance benefits.
|
||||
/// </remarks>
|
||||
[JsonProperty("paused")]
|
||||
public bool? Paused { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Legacy permissions based on legacy user membership information.
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
[JsonProperty("permissions")]
|
||||
public IReadOnlyCollection<string>? Permissions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zone status on Cloudflare.
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public ZoneStatus? Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The root organizational unit that this zone belongs to (such as a tenant or organization).
|
||||
/// </summary>
|
||||
[JsonProperty("tenant")]
|
||||
public ZoneTenant? Tenant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The immediate parent organizational unit that this zone belongs to (such as under a tenant or sub-organization).
|
||||
/// </summary>
|
||||
[JsonProperty("tenant_unit")]
|
||||
public ZoneTenantUnit? TenantUnit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A full zone implies that DNS is hosted with Cloudflare.
|
||||
/// A partial zone is typically a partner-hosted zone or a CNAME setup.
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
public ZoneType? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An array of domains used for custom name servers.
|
||||
/// This is only available for Business and Enterprise plans.
|
||||
/// </summary>
|
||||
[JsonProperty("vanity_name_servers")]
|
||||
public IReadOnlyCollection<string>? VanityNameServers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Verification key for partial zone setup.
|
||||
/// </summary>
|
||||
[JsonProperty("verification_key")]
|
||||
public string? VerificationKey { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The account the zone belongs to.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L359">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneAccount
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the account.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metadata about the zone.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L374">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneMeta
|
||||
{
|
||||
/// <summary>
|
||||
/// The zone is only configured for CDN.
|
||||
/// </summary>
|
||||
[JsonProperty("cdn_only")]
|
||||
public bool? CdnOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of Custom Certificates the zone can have.
|
||||
/// </summary>
|
||||
[JsonProperty("custom_certificate_quota")]
|
||||
public int? CustomCertificateQuota { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zone is only configured for DNS.
|
||||
/// </summary>
|
||||
[JsonProperty("dns_only")]
|
||||
public bool? DnsOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zone is setup with Foundation DNS.
|
||||
/// </summary>
|
||||
[JsonProperty("foundation_dns")]
|
||||
public bool? FoundationDns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of Page Rules a zone can have.
|
||||
/// </summary>
|
||||
[JsonProperty("page_rule_quota")]
|
||||
public int? PageRuleQuota { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zone has been flagged for phishing.
|
||||
/// </summary>
|
||||
[JsonProperty("phishing_detected")]
|
||||
public bool? PhishingDetected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Step.
|
||||
/// </summary>
|
||||
[JsonProperty("step")]
|
||||
public int? Step { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The owner of the zone.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L411">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneOwner
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the owner.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The type of owner.
|
||||
/// </summary>
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Zones subscription information.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L431">Source</see>
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
public class ZonePlan
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// States if the subscription can be activated.
|
||||
/// </summary>
|
||||
[JsonProperty("can_subscribe")]
|
||||
public bool? CanSubscribe { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The denomination of the customer.
|
||||
/// </summary>
|
||||
[JsonProperty("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If this Zone is managed by another company.
|
||||
/// </summary>
|
||||
[JsonProperty("externally_managed")]
|
||||
public bool? ExternallyManaged { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How often the customer is billed.
|
||||
/// </summary>
|
||||
[JsonProperty("frequency")]
|
||||
public RenewFrequency? Frequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// States if the subscription active.
|
||||
/// </summary>
|
||||
[JsonProperty("is_subscribed")]
|
||||
public bool? IsSubscribed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the legacy discount applies to this Zone.
|
||||
/// </summary>
|
||||
[JsonProperty("legacy_discount")]
|
||||
public bool? LegacyDiscount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The legacy name of the plan.
|
||||
/// </summary>
|
||||
[JsonProperty("legacy_id")]
|
||||
public string? LegacyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the owner.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How much the customer is paying.
|
||||
/// </summary>
|
||||
[JsonProperty("price")]
|
||||
public decimal? Price { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Zone status.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L323">Source</see>
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ZoneStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializing.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "initializing")]
|
||||
Initializing = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Pending.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Active.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "active")]
|
||||
Active = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Moved.
|
||||
/// </summary>
|
||||
[EnumMember(Value = "moved")]
|
||||
Moved = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The root organizational unit that this zone belongs to (such as a tenant or organization).
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L487">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneTenant
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the Tenant account.
|
||||
/// </summary>
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The immediate parent organizational unit that this zone belongs to (such as under a tenant or sub-organization).
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/zones.ts#L503">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneTenantUnit
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
}
|
||||
}
|
||||
27
src/Extensions/Cloudflare.Zones/Models/ZoneHold.cs
Normal file
27
src/Extensions/Cloudflare.Zones/Models/ZoneHold.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A Cloudflare zone hold.
|
||||
/// <see href="https://github.com/cloudflare/cloudflare-typescript/blob/v4.4.1/src/resources/zones/holds.ts#L88">Source</see>
|
||||
/// </summary>
|
||||
public class ZoneHold
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the zone is on hold.
|
||||
/// </summary>
|
||||
[JsonProperty("hold")]
|
||||
public bool? Hold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The hold is enabled if the value is in the past.
|
||||
/// </summary>
|
||||
[JsonProperty("hold_after")]
|
||||
public DateTime? HoldAfter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to include subdomains in the hold.
|
||||
/// </summary>
|
||||
[JsonProperty("include_subdomains")]
|
||||
public bool? IncludeSubdomains { get; set; }
|
||||
}
|
||||
}
|
||||
26
src/Extensions/Cloudflare.Zones/Models/ZoneSettingBase.cs
Normal file
26
src/Extensions/Cloudflare.Zones/Models/ZoneSettingBase.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A Cloudflare zone setting.
|
||||
/// </summary>
|
||||
public abstract class ZoneSettingBase
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID of the zone setting.
|
||||
/// </summary>
|
||||
[JsonProperty("id")]
|
||||
public ZoneSettingId? Id { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).
|
||||
/// </summary>
|
||||
[JsonProperty("editable")]
|
||||
public bool? Editable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last time this setting was modified.
|
||||
/// </summary>
|
||||
[JsonProperty("modified_on")]
|
||||
public DateTime? ModifiedOn { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user