/**
 * Cloudflare DNS-FIREWALL API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service dns-firewall
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetAnalyticReportRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    dimensions: Schema.optional(Schema.String).pipe(T.HttpQuery("dimensions")),
    filters: Schema.optional(Schema.String).pipe(T.HttpQuery("filters")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    metrics: Schema.optional(Schema.String).pipe(T.HttpQuery("metrics")),
    since: Schema.optional(Schema.String).pipe(T.HttpQuery("since")),
    sort: Schema.optional(Schema.String).pipe(T.HttpQuery("sort")),
    until: Schema.optional(Schema.String).pipe(T.HttpQuery("until")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}/dns_analytics/report",
}));
export const GetAnalyticReportResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    data: Schema.Array(Schema.Struct({
        dimensions: Schema.Array(Schema.String),
        metrics: Schema.Array(Schema.Number),
    })),
    dataLag: Schema.Number,
    max: Schema.Unknown,
    min: Schema.Unknown,
    query: Schema.Struct({
        dimensions: Schema.Array(Schema.String),
        limit: Schema.Number,
        metrics: Schema.Array(Schema.String),
        since: Schema.String,
        until: Schema.String,
        filters: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sort: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }),
    rows: Schema.Number,
    totals: Schema.Unknown,
})
    .pipe(Schema.encodeKeys({
    data: "data",
    dataLag: "data_lag",
    max: "max",
    min: "min",
    query: "query",
    rows: "rows",
    totals: "totals",
}))
    .pipe(T.ResponsePath("result"));
export const getAnalyticReport = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyticReportRequest,
    output: GetAnalyticReportResponse,
    errors: [],
}));
export const GetAnalyticReportBytimeRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    dimensions: Schema.optional(Schema.String).pipe(T.HttpQuery("dimensions")),
    filters: Schema.optional(Schema.String).pipe(T.HttpQuery("filters")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    metrics: Schema.optional(Schema.String).pipe(T.HttpQuery("metrics")),
    since: Schema.optional(Schema.String).pipe(T.HttpQuery("since")),
    sort: Schema.optional(Schema.String).pipe(T.HttpQuery("sort")),
    timeDelta: Schema.optional(Schema.Literals([
        "all",
        "auto",
        "year",
        "quarter",
        "month",
        "week",
        "day",
        "hour",
        "dekaminute",
        "minute",
    ])).pipe(T.HttpQuery("time_delta")),
    until: Schema.optional(Schema.String).pipe(T.HttpQuery("until")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}/dns_analytics/report/bytime",
}));
export const GetAnalyticReportBytimeResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    data: Schema.Array(Schema.Struct({
        dimensions: Schema.Array(Schema.String),
        metrics: Schema.Array(Schema.Array(Schema.Number)),
    })),
    dataLag: Schema.Number,
    max: Schema.Unknown,
    min: Schema.Unknown,
    query: Schema.Struct({
        dimensions: Schema.Array(Schema.String),
        limit: Schema.Number,
        metrics: Schema.Array(Schema.String),
        since: Schema.String,
        timeDelta: Schema.Literals([
            "all",
            "auto",
            "year",
            "quarter",
            "month",
            "week",
            "day",
            "hour",
            "dekaminute",
            "minute",
        ]),
        until: Schema.String,
        filters: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sort: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        dimensions: "dimensions",
        limit: "limit",
        metrics: "metrics",
        since: "since",
        timeDelta: "time_delta",
        until: "until",
        filters: "filters",
        sort: "sort",
    })),
    rows: Schema.Number,
    timeIntervals: Schema.Array(Schema.Array(Schema.String)),
    totals: Schema.Unknown,
})
    .pipe(Schema.encodeKeys({
    data: "data",
    dataLag: "data_lag",
    max: "max",
    min: "min",
    query: "query",
    rows: "rows",
    timeIntervals: "time_intervals",
    totals: "totals",
}))
    .pipe(T.ResponsePath("result"));
export const getAnalyticReportBytime = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyticReportBytimeRequest,
    output: GetAnalyticReportBytimeResponse,
    errors: [],
}));
export const GetDnsFirewallRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}",
}));
export const GetDnsFirewallResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    deprecateAnyRequests: Schema.Boolean,
    dnsFirewallIps: Schema.Array(Schema.String),
    ecsFallback: Schema.Boolean,
    maximumCacheTtl: Schema.Number,
    minimumCacheTtl: Schema.Number,
    modifiedOn: Schema.String,
    name: Schema.String,
    negativeCacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    ratelimit: Schema.Union([Schema.Number, Schema.Null]),
    retries: Schema.Number,
    upstreamIps: Schema.Array(Schema.String),
    attackMitigation: Schema.optional(Schema.Union([
        Schema.Struct({
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            enabled: "enabled",
            onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    deprecateAnyRequests: "deprecate_any_requests",
    dnsFirewallIps: "dns_firewall_ips",
    ecsFallback: "ecs_fallback",
    maximumCacheTtl: "maximum_cache_ttl",
    minimumCacheTtl: "minimum_cache_ttl",
    modifiedOn: "modified_on",
    name: "name",
    negativeCacheTtl: "negative_cache_ttl",
    ratelimit: "ratelimit",
    retries: "retries",
    upstreamIps: "upstream_ips",
    attackMitigation: "attack_mitigation",
}))
    .pipe(T.ResponsePath("result"));
export const getDnsFirewall = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetDnsFirewallRequest,
    output: GetDnsFirewallResponse,
    errors: [],
}));
export const ListDnsFirewallsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/dns_firewall" }));
export const ListDnsFirewallsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        deprecateAnyRequests: Schema.Boolean,
        dnsFirewallIps: Schema.Array(Schema.String),
        ecsFallback: Schema.Boolean,
        maximumCacheTtl: Schema.Number,
        minimumCacheTtl: Schema.Number,
        modifiedOn: Schema.String,
        name: Schema.String,
        negativeCacheTtl: Schema.Union([Schema.Number, Schema.Null]),
        ratelimit: Schema.Union([Schema.Number, Schema.Null]),
        retries: Schema.Number,
        upstreamIps: Schema.Array(Schema.String),
        attackMitigation: Schema.optional(Schema.Union([
            Schema.Struct({
                enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                enabled: "enabled",
                onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
            })),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        deprecateAnyRequests: "deprecate_any_requests",
        dnsFirewallIps: "dns_firewall_ips",
        ecsFallback: "ecs_fallback",
        maximumCacheTtl: "maximum_cache_ttl",
        minimumCacheTtl: "minimum_cache_ttl",
        modifiedOn: "modified_on",
        name: "name",
        negativeCacheTtl: "negative_cache_ttl",
        ratelimit: "ratelimit",
        retries: "retries",
        upstreamIps: "upstream_ips",
        attackMitigation: "attack_mitigation",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listDnsFirewalls = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListDnsFirewallsRequest,
    output: ListDnsFirewallsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateDnsFirewallRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.String,
    upstreamIps: Schema.Array(Schema.String),
    attackMitigation: Schema.optional(Schema.Union([
        Schema.Struct({
            enabled: Schema.optional(Schema.Boolean),
            onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Boolean),
        }).pipe(Schema.encodeKeys({
            enabled: "enabled",
            onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
        })),
        Schema.Null,
    ])),
    deprecateAnyRequests: Schema.optional(Schema.Boolean),
    ecsFallback: Schema.optional(Schema.Boolean),
    maximumCacheTtl: Schema.optional(Schema.Number),
    minimumCacheTtl: Schema.optional(Schema.Number),
    negativeCacheTtl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    ratelimit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    retries: Schema.optional(Schema.Number),
}).pipe(Schema.encodeKeys({
    name: "name",
    upstreamIps: "upstream_ips",
    attackMitigation: "attack_mitigation",
    deprecateAnyRequests: "deprecate_any_requests",
    ecsFallback: "ecs_fallback",
    maximumCacheTtl: "maximum_cache_ttl",
    minimumCacheTtl: "minimum_cache_ttl",
    negativeCacheTtl: "negative_cache_ttl",
    ratelimit: "ratelimit",
    retries: "retries",
}), T.Http({ method: "POST", path: "/accounts/{account_id}/dns_firewall" }));
export const CreateDnsFirewallResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    deprecateAnyRequests: Schema.Boolean,
    dnsFirewallIps: Schema.Array(Schema.String),
    ecsFallback: Schema.Boolean,
    maximumCacheTtl: Schema.Number,
    minimumCacheTtl: Schema.Number,
    modifiedOn: Schema.String,
    name: Schema.String,
    negativeCacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    ratelimit: Schema.Union([Schema.Number, Schema.Null]),
    retries: Schema.Number,
    upstreamIps: Schema.Array(Schema.String),
    attackMitigation: Schema.optional(Schema.Union([
        Schema.Struct({
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            enabled: "enabled",
            onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    deprecateAnyRequests: "deprecate_any_requests",
    dnsFirewallIps: "dns_firewall_ips",
    ecsFallback: "ecs_fallback",
    maximumCacheTtl: "maximum_cache_ttl",
    minimumCacheTtl: "minimum_cache_ttl",
    modifiedOn: "modified_on",
    name: "name",
    negativeCacheTtl: "negative_cache_ttl",
    ratelimit: "ratelimit",
    retries: "retries",
    upstreamIps: "upstream_ips",
    attackMitigation: "attack_mitigation",
}))
    .pipe(T.ResponsePath("result"));
export const createDnsFirewall = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateDnsFirewallRequest,
    output: CreateDnsFirewallResponse,
    errors: [],
}));
export const PatchDnsFirewallRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    attackMitigation: Schema.optional(Schema.Union([
        Schema.Struct({
            enabled: Schema.optional(Schema.Boolean),
            onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Boolean),
        }).pipe(Schema.encodeKeys({
            enabled: "enabled",
            onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
        })),
        Schema.Null,
    ])),
    deprecateAnyRequests: Schema.optional(Schema.Boolean),
    ecsFallback: Schema.optional(Schema.Boolean),
    maximumCacheTtl: Schema.optional(Schema.Number),
    minimumCacheTtl: Schema.optional(Schema.Number),
    name: Schema.optional(Schema.String),
    negativeCacheTtl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    ratelimit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    retries: Schema.optional(Schema.Number),
    upstreamIps: Schema.optional(Schema.Array(Schema.String)),
}).pipe(Schema.encodeKeys({
    attackMitigation: "attack_mitigation",
    deprecateAnyRequests: "deprecate_any_requests",
    ecsFallback: "ecs_fallback",
    maximumCacheTtl: "maximum_cache_ttl",
    minimumCacheTtl: "minimum_cache_ttl",
    name: "name",
    negativeCacheTtl: "negative_cache_ttl",
    ratelimit: "ratelimit",
    retries: "retries",
    upstreamIps: "upstream_ips",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}",
}));
export const PatchDnsFirewallResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    deprecateAnyRequests: Schema.Boolean,
    dnsFirewallIps: Schema.Array(Schema.String),
    ecsFallback: Schema.Boolean,
    maximumCacheTtl: Schema.Number,
    minimumCacheTtl: Schema.Number,
    modifiedOn: Schema.String,
    name: Schema.String,
    negativeCacheTtl: Schema.Union([Schema.Number, Schema.Null]),
    ratelimit: Schema.Union([Schema.Number, Schema.Null]),
    retries: Schema.Number,
    upstreamIps: Schema.Array(Schema.String),
    attackMitigation: Schema.optional(Schema.Union([
        Schema.Struct({
            enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            onlyWhenUpstreamUnhealthy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            enabled: "enabled",
            onlyWhenUpstreamUnhealthy: "only_when_upstream_unhealthy",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    deprecateAnyRequests: "deprecate_any_requests",
    dnsFirewallIps: "dns_firewall_ips",
    ecsFallback: "ecs_fallback",
    maximumCacheTtl: "maximum_cache_ttl",
    minimumCacheTtl: "minimum_cache_ttl",
    modifiedOn: "modified_on",
    name: "name",
    negativeCacheTtl: "negative_cache_ttl",
    ratelimit: "ratelimit",
    retries: "retries",
    upstreamIps: "upstream_ips",
    attackMitigation: "attack_mitigation",
}))
    .pipe(T.ResponsePath("result"));
export const patchDnsFirewall = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchDnsFirewallRequest,
    output: PatchDnsFirewallResponse,
    errors: [],
}));
export const DeleteDnsFirewallRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}",
}));
export const DeleteDnsFirewallResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteDnsFirewall = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteDnsFirewallRequest,
    output: DeleteDnsFirewallResponse,
    errors: [],
}));
export const GetReverseDnRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}/reverse_dns",
}));
export const GetReverseDnResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ptr: Schema.Record(Schema.String, Schema.Unknown),
}).pipe(T.ResponsePath("result"));
export const getReverseDn = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetReverseDnRequest,
    output: GetReverseDnResponse,
    errors: [],
}));
export const PatchReverseDnRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    dnsFirewallId: Schema.String.pipe(T.HttpPath("dnsFirewallId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ptr: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/dns_firewall/{dnsFirewallId}/reverse_dns",
}));
export const PatchReverseDnResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ptr: Schema.Record(Schema.String, Schema.Unknown),
}).pipe(T.ResponsePath("result"));
export const patchReverseDn = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchReverseDnRequest,
    output: PatchReverseDnResponse,
    errors: [],
}));
//# sourceMappingURL=dns-firewall.js.map