Reorganize Zone Extension
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Filters
|
||||
{
|
||||
internal class CreateZoneHoldFilter : IQueryParameterFilter
|
||||
{
|
||||
public bool IncludeSubdomains { get; set; }
|
||||
|
||||
public IDictionary<string, string> GetQueryParameters()
|
||||
{
|
||||
var dict = new Dictionary<string, string>();
|
||||
|
||||
if (IncludeSubdomains)
|
||||
dict.Add("include_subdomains", "true");
|
||||
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Filters
|
||||
{
|
||||
internal class DeleteZoneHoldFilter : IQueryParameterFilter
|
||||
{
|
||||
public DateTime? HoldAfter { get; set; }
|
||||
|
||||
public IDictionary<string, string> GetQueryParameters()
|
||||
{
|
||||
var dict = new Dictionary<string, string>();
|
||||
|
||||
if (HoldAfter.HasValue)
|
||||
dict.Add("hold_after", HoldAfter.Value.ToUniversalTime().ToString("yyyy-MM-dd'T'HH:mm:ss'Z'"));
|
||||
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalBatchRequest
|
||||
{
|
||||
[JsonProperty("deletes")]
|
||||
public IList<InternalDnsRecordId>? Deletes { get; set; }
|
||||
|
||||
[JsonProperty("patches")]
|
||||
public IList<InternalBatchUpdateRequest>? Patches { get; set; }
|
||||
|
||||
[JsonProperty("puts")]
|
||||
public IList<InternalBatchUpdateRequest>? Puts { get; set; }
|
||||
|
||||
[JsonProperty("posts")]
|
||||
public IList<InternalDnsRecordRequest>? Posts { get; set; }
|
||||
}
|
||||
|
||||
internal class InternalDnsRecordId
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
}
|
||||
|
||||
internal class InternalBatchUpdateRequest(string id, InternalDnsRecordRequest baseInstance)
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; } = id;
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string? Comment { get; set; } = baseInstance.Comment;
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; } = baseInstance.Name;
|
||||
|
||||
[JsonProperty("proxied")]
|
||||
public bool Proxied { get; set; } = baseInstance.Proxied;
|
||||
|
||||
[JsonProperty("settings")]
|
||||
public object? Settings { get; set; } = baseInstance.Settings;
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public IList<string>? Tags { get; set; } = baseInstance.Tags;
|
||||
|
||||
[JsonProperty("ttl")]
|
||||
public int? Ttl { get; set; } = baseInstance.Ttl;
|
||||
|
||||
[JsonProperty("data")]
|
||||
public object? Data { get; set; } = baseInstance.Data;
|
||||
|
||||
[JsonProperty("content")]
|
||||
public string? Content { get; set; } = baseInstance.Content;
|
||||
|
||||
[JsonProperty("priority")]
|
||||
public ushort? Priority { get; set; } = baseInstance.Priority;
|
||||
|
||||
[JsonProperty("type")]
|
||||
public DnsRecordType Type { get; set; } = baseInstance.Type;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalCreateZoneRequest
|
||||
{
|
||||
public InternalCreateZoneRequest(AccountBase account, string name)
|
||||
{
|
||||
Account = account;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
[JsonProperty("account")]
|
||||
public AccountBase Account { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public ZoneType? Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalDnsRecordRequest
|
||||
{
|
||||
public InternalDnsRecordRequest(DnsRecordType type, string name)
|
||||
{
|
||||
Type = type;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("proxied")]
|
||||
public bool Proxied { get; set; }
|
||||
|
||||
[JsonProperty("settings")]
|
||||
public object? Settings { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public IList<string>? Tags { get; set; }
|
||||
|
||||
[JsonProperty("ttl")]
|
||||
public int? Ttl { get; set; }
|
||||
|
||||
[JsonProperty("data")]
|
||||
public object? Data { get; set; }
|
||||
|
||||
[JsonProperty("content")]
|
||||
public string? Content { get; set; }
|
||||
|
||||
[JsonProperty("priority")]
|
||||
public ushort? Priority { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public DnsRecordType Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalEditZoneRequest
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public ZoneType? Type { get; set; }
|
||||
|
||||
[JsonProperty("vanity_name_servers")]
|
||||
public IList<string>? VanityNameServers { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalPurgeCacheRequest
|
||||
{
|
||||
[JsonProperty("purge_everything")]
|
||||
public bool? PurgeEverything { get; set; }
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public IList<string>? Tags { get; set; }
|
||||
|
||||
[JsonProperty("hosts")]
|
||||
public IList<string>? Hostnames { get; set; }
|
||||
|
||||
[JsonProperty("prefixes")]
|
||||
public IList<string>? Prefixes { get; set; }
|
||||
|
||||
[JsonProperty("files")]
|
||||
public IList<string>? Urls { get; set; }
|
||||
|
||||
[JsonProperty("files")]
|
||||
public IList<PurgeUrlWithHeaders>? UrlsWithHeaders { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalUpdateDnsSettingsRequest
|
||||
{
|
||||
[JsonProperty("flatten_all_cnames")]
|
||||
public bool? FlattenAllCnames { get; set; }
|
||||
|
||||
[JsonProperty("foundation_dns")]
|
||||
public bool? FoundationDns { get; set; }
|
||||
|
||||
[JsonProperty("multi_provider")]
|
||||
public bool? MultiProvider { get; set; }
|
||||
|
||||
[JsonProperty("nameservers")]
|
||||
public Nameserver? Nameservers { get; set; }
|
||||
|
||||
[JsonProperty("ns_ttl")]
|
||||
public int? NameserverTtl { get; set; }
|
||||
|
||||
[JsonProperty("secondary_overrides")]
|
||||
public bool? SecondaryOverrides { get; set; }
|
||||
|
||||
[JsonProperty("soa")]
|
||||
public StartOfAuthority? Soa { get; set; }
|
||||
|
||||
[JsonProperty("zone_mode")]
|
||||
public ZoneMode? Mode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class InternalUpdateSecurityTxtRequest
|
||||
{
|
||||
[JsonProperty("acknowledgements")]
|
||||
public IList<string>? Acknowledgements { get; set; }
|
||||
|
||||
[JsonProperty("canonical")]
|
||||
public IList<string>? Canonical { get; set; }
|
||||
|
||||
[JsonProperty("contact")]
|
||||
public IList<string>? Contact { get; set; }
|
||||
|
||||
[JsonProperty("enabled")]
|
||||
public bool? Enabled { get; set; }
|
||||
|
||||
[JsonProperty("encryption")]
|
||||
public IList<string>? Encryption { get; set; }
|
||||
|
||||
[JsonProperty("expires")]
|
||||
public DateTime? Expires { get; set; }
|
||||
|
||||
[JsonProperty("hiring")]
|
||||
public IList<string>? Hiring { get; set; }
|
||||
|
||||
[JsonProperty("policy")]
|
||||
public IList<string>? Policy { get; set; }
|
||||
|
||||
[JsonProperty("preferredLanguages")]
|
||||
public string? PreferredLanguages { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AMWD.Net.Api.Cloudflare.Zones.Internals.Requests
|
||||
{
|
||||
internal class PurgeUrlWithHeaders
|
||||
{
|
||||
[JsonProperty("headers")]
|
||||
public Dictionary<string, string> Headers { get; set; } = [];
|
||||
|
||||
[JsonProperty("url")]
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user