{
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "$id": "https://cdn.yepdevelopment.com/schemas/cloudflare-ddns.schema.json",
    "title": "cloudflare-ddns config",
    "description": "Defines configuration settings used by cloudflare-ddns.",
    "type": "object",
    "required": [
        "cloudflare",
        "a",
        "aaaa",
        "purgeUnknownRecords",
        "ttl"
    ],
    "properties": {
        "cloudflare": {
            "description": "An array of JSON objects containing zone information such as DNS records and credentials. Each JSON object corresponds to a single zone. You can define multiple objects if you would like cloudflare-ddns to update multiple zones.",
            "type": "array",
            "items": {
                "description": "A JSON object used to configure a single zone.",
                "type": "object",
                "required": [
                    "authentication",
                    "zone_id",
                    "subdomains"
                ],
                "properties": {
                    "authentication": {
                        "description": "A JSON object containing everything related to authenticating with Cloudflare's API.",
                        "type": "object",
                        "anyOf": [
                            {
                                "required": [
                                    "api_token"
                                ]
                            },
                            {
                                "required": [
                                    "api_key"
                                ]
                            }
                        ],
                        "properties": {
                            "api_token": {
                                "description": "The API token that will be used to authenticate changes to this zone. This would be your zone token.",
                                "type": "string"
                            },
                            "api_key": {
                                "description": "A JSON object containing an account token and the corresponding account's email (similar to a username and password). This is less secure since it violates the principle of least privilege.",
                                "type": "object",
                                "deprecated": true,
                                "required": [
                                    "api_key",
                                    "account_email"
                                ],
                                "properties": {
                                    "api_key": {
                                        "description": "The account token associated with the given email.",
                                        "type": "string"
                                    },
                                    "account_email": {
                                        "description": "The email of a Cloudflare account to use for authentication.",
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "zone_id": {
                        "description": "The ID of this zone. You can get this from the Cloudflare dashboard when you select a domain.",
                        "type": "string"
                    },
                    "subdomains": {
                        "description": "An array of JSON objects representing DNS records (only A and AAAA records are supported).",
                        "type": "array",
                        "items": {
                            "description": "A JSON object representing a single DNS record.",
                            "type": "object",
                            "properties": {
                                "name": {
                                    "description": "A string that references a DNS record by a subdomain prefix or the root domain itself.",
                                    "type": "string",
                                    "anyOf": [
                                        {
                                            "description": "Represents the DNS record for the root domain.",
                                            "enum": [
                                                "@"
                                            ]
                                        },
                                        {
                                            "description": "Represents the DNS record for a subdomain. Note that this should only contain the subdomain portion, without the base domain. For example, if you had a subdomain called 'sub1.example.com', this value should simply be 'sub1'.",
                                            "type": "string"
                                        }
                                    ]
                                },
                                "proxied": {
                                    "description": "A boolean flag that determines whether requests to this (sub)domain should be proxied through Cloudflare or passed straight to the origin server.",
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            }
        },
        "a": {
            "description": "A boolean flag that determines whether DNS A (IPv4) records should be updated.",
            "type": "boolean"
        },
        "aaaa": {
            "description": "A boolean flag that determines whether DNS AAAA (IPv6) records should be updated.",
            "type": "boolean"
        },
        "purgeUnknownRecords": {
            "description": "A boolean flag that determines whether extraneous DNS records not defined in the 'cloudflare.subdomains' section should be removed.",
            "type": "boolean"
        },
        "ttl": {
            "description": "A number that determines how long DNS records are cached for (and thus how long it will take for DNS updates to propagate), in seconds.",
            "type": "number"
        }
    }
}