migamake_api_cloudflare/
parameters.rs

1//! Declares enums used with [Zone](crate::zone::Zone) and [various dns record](crate::dns)
2use serde::Serialize;
3use strum::Display;
4
5/// Type for search
6///
7/// [Reference](https://api.cloudflare.com/#zone-list-zones)
8#[derive(Debug, PartialEq, Display)]
9pub enum Search {
10    #[strum(to_string = "any")]
11    Any,
12    #[strum(to_string = "all")]
13    All,
14}
15
16/// Type for dns record
17///
18/// Can be used to filter for dns records or create a dns record
19/// [Reference](https://api.cloudflare.com/#zone-list-zones)
20#[derive(Debug, Display, Serialize, PartialEq)]
21#[strum(serialize_all = "UPPERCASE")]
22pub enum DnsRecordType {
23    A,
24    AAAA,
25    CNAME,
26    TXT,
27    SRV,
28    MX,
29    NS,
30    CAA,
31    PTR,
32    SPF,
33}
34/// direction to order by
35/// For list of zones order by zones
36/// For list of dns records order by domain
37#[derive(Display)]
38#[strum(serialize_all = "lowercase")]
39pub enum Direction {
40    Asc,
41    Desc,
42}
43/// status of a zone
44#[derive(Display)]
45#[strum(serialize_all = "lowercase")]
46pub enum Status {
47    Active,
48    Pending,
49    Initializing,
50    Moved,
51    Deleted,
52    Deactivated,
53}
54/// Type to order zones by
55#[derive(Display)]
56pub enum Order {
57    #[strum(to_string = "name")]
58    Name,
59    #[strum(to_string = "status")]
60    Status,
61    #[strum(to_string = "account.id")]
62    AccountId,
63    #[strum(to_string = "account.name")]
64    AccountName,
65}
66
67/// Type of http request
68#[derive(Debug, PartialEq)]
69pub(crate) enum HttpVerb {
70    GET,
71    POST,
72    DELETE,
73}