migamake-api-cloudflare 0.2.0

A library to work with Cloudflare apis
Documentation
//! Declares enums used with [Zone](crate::zone::Zone) and [various dns record](crate::dns)
use serde::Serialize;
use strum::Display;

/// Type for search
///
/// [Reference](https://api.cloudflare.com/#zone-list-zones)
#[derive(Debug, PartialEq, Display)]
pub enum Search {
    #[strum(to_string = "any")]
    Any,
    #[strum(to_string = "all")]
    All,
}

/// Type for dns record
///
/// Can be used to filter for dns records or create a dns record
/// [Reference](https://api.cloudflare.com/#zone-list-zones)
#[derive(Debug, Display, Serialize, PartialEq)]
#[strum(serialize_all = "UPPERCASE")]
pub enum DnsRecordType {
    A,
    AAAA,
    CNAME,
    TXT,
    SRV,
    MX,
    NS,
    CAA,
    PTR,
    SPF,
}
/// direction to order by
/// For list of zones order by zones
/// For list of dns records order by domain
#[derive(Display)]
#[strum(serialize_all = "lowercase")]
pub enum Direction {
    Asc,
    Desc,
}
/// status of a zone
#[derive(Display)]
#[strum(serialize_all = "lowercase")]
pub enum Status {
    Active,
    Pending,
    Initializing,
    Moved,
    Deleted,
    Deactivated,
}
/// Type to order zones by
#[derive(Display)]
pub enum Order {
    #[strum(to_string = "name")]
    Name,
    #[strum(to_string = "status")]
    Status,
    #[strum(to_string = "account.id")]
    AccountId,
    #[strum(to_string = "account.name")]
    AccountName,
}

/// Type of http request
#[derive(Debug, PartialEq)]
pub(crate) enum HttpVerb {
    GET,
    POST,
    DELETE,
}