Added some Zone features
This commit is contained in:
120
Extensions/Cloudflare.Zones/Models/Zone.cs
Normal file
120
Extensions/Cloudflare.Zones/Models/Zone.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A DNS Zone.
|
||||
/// </summary>
|
||||
public class Zone
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
// <= 32 characters
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The account the zone belongs to.
|
||||
/// </summary>
|
||||
[JsonProperty("account")]
|
||||
public AccountBase 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 ZoneMetaData Meta { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When the zone was last modified.
|
||||
/// </summary>
|
||||
[JsonProperty("modified_on")]
|
||||
public DateTime ModifiedOn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The domain name.
|
||||
/// </summary>
|
||||
// <= 253 characters
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name servers Cloudflare assigns to a zone.
|
||||
/// </summary>
|
||||
[JsonProperty("name_servers")]
|
||||
public IReadOnlyList<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 IReadOnlyList<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 OwnerBase Owner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the zone is only using Cloudflare DNS services.
|
||||
/// A <see langword="true"/> value means the zone will not receive security or performance benefits.
|
||||
/// </summary>
|
||||
[JsonProperty("paused")]
|
||||
public bool Paused { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The zone status on Cloudflare.
|
||||
/// </summary>
|
||||
[JsonProperty("status")]
|
||||
public ZoneStatus Status { 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.
|
||||
/// <em>This is only available for Business and Enterprise plans.</em>
|
||||
/// </summary>
|
||||
[JsonProperty("vanity_name_servers")]
|
||||
public IReadOnlyList<string> VanityNameServers { get; set; }
|
||||
}
|
||||
}
|
||||
28
Extensions/Cloudflare.Zones/Models/ZoneHold.cs
Normal file
28
Extensions/Cloudflare.Zones/Models/ZoneHold.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// A zone hold.
|
||||
/// </summary>
|
||||
public class ZoneHold
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the zone is on hold.
|
||||
/// </summary>
|
||||
[JsonProperty("hold")]
|
||||
public bool Hold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an information whether subdomains are included in the hold.
|
||||
/// </summary>
|
||||
[JsonProperty("include_subdomains")]
|
||||
public string IncludeSubdomains { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time after which the zone is no longer on hold.
|
||||
/// </summary>
|
||||
[JsonProperty("hold_after")]
|
||||
public DateTime HoldAfter { get; set; }
|
||||
}
|
||||
}
|
||||
15
Extensions/Cloudflare.Zones/Models/ZoneIdResponse.cs
Normal file
15
Extensions/Cloudflare.Zones/Models/ZoneIdResponse.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// The deleted zone.
|
||||
/// </summary>
|
||||
public class ZoneIdResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifier.
|
||||
/// </summary>
|
||||
// <= 32 characters
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
50
Extensions/Cloudflare.Zones/Models/ZoneMetaData.cs
Normal file
50
Extensions/Cloudflare.Zones/Models/ZoneMetaData.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones
|
||||
{
|
||||
/// <summary>
|
||||
/// The zone metadata.
|
||||
/// </summary>
|
||||
public class ZoneMetaData
|
||||
{
|
||||
/// <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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user