/**
 * Cloudflare SPECTRUM API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service spectrum
 */
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 GetAnalyticAggregateCurrentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    appID: Schema.optional(Schema.String).pipe(T.HttpQuery("appID")),
    coloName: Schema.optional(Schema.String).pipe(T.HttpQuery("colo_name")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/spectrum/analytics/aggregate/current",
}));
export const GetAnalyticAggregateCurrentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    appID: Schema.String,
    bytesEgress: Schema.Number,
    bytesIngress: Schema.Number,
    connections: Schema.Number,
    durationAvg: Schema.Number,
})).pipe(T.ResponsePath("result"));
export const getAnalyticAggregateCurrent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyticAggregateCurrentRequest,
    output: GetAnalyticAggregateCurrentResponse,
    errors: [],
}));
export const GetAnalyticEventBytimeRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    timeDelta: Schema.Literals([
        "year",
        "quarter",
        "month",
        "week",
        "day",
        "hour",
        "dekaminute",
        "minute",
    ]).pipe(T.HttpQuery("time_delta")),
    dimensions: Schema.optional(Schema.Array(Schema.Literals(["event", "appID", "coloName", "ipVersion"]))).pipe(T.HttpQuery("dimensions")),
    filters: Schema.optional(Schema.String).pipe(T.HttpQuery("filters")),
    metrics: Schema.optional(Schema.Array(Schema.Literals([
        "count",
        "bytesIngress",
        "bytesEgress",
        "durationAvg",
        "durationMedian",
        "duration90th",
        "duration99th",
    ]))).pipe(T.HttpQuery("metrics")),
    since: Schema.optional(Schema.String).pipe(T.HttpQuery("since")),
    sort: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("sort")),
    until: Schema.optional(Schema.String).pipe(T.HttpQuery("until")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/spectrum/analytics/events/bytime",
}));
export const GetAnalyticEventBytimeResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    data: Schema.Array(Schema.Struct({
        dimensions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        metrics: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Array(Schema.Number),
                Schema.Array(Schema.Array(Schema.Number)),
            ]),
            Schema.Null,
        ])),
    })),
    dataLag: Schema.Number,
    max: Schema.Record(Schema.String, Schema.Unknown),
    min: Schema.Record(Schema.String, Schema.Unknown),
    query: Schema.Struct({
        dimensions: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals(["event", "appID", "coloName", "ipVersion"])),
            Schema.Null,
        ])),
        filters: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        limit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        metrics: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "count",
                "bytesIngress",
                "bytesEgress",
                "durationAvg",
                "durationMedian",
                "duration90th",
                "duration99th",
            ])),
            Schema.Null,
        ])),
        since: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sort: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        until: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }),
    rows: Schema.Number,
    totals: Schema.Record(Schema.String, Schema.Unknown),
    timeIntervals: Schema.optional(Schema.Union([Schema.Array(Schema.Array(Schema.String)), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    data: "data",
    dataLag: "data_lag",
    max: "max",
    min: "min",
    query: "query",
    rows: "rows",
    totals: "totals",
    timeIntervals: "time_intervals",
}))
    .pipe(T.ResponsePath("result"));
export const getAnalyticEventBytime = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyticEventBytimeRequest,
    output: GetAnalyticEventBytimeResponse,
    errors: [],
}));
export const GetAnalyticEventSummaryRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    dimensions: Schema.optional(Schema.Array(Schema.Literals(["event", "appID", "coloName", "ipVersion"]))).pipe(T.HttpQuery("dimensions")),
    filters: Schema.optional(Schema.String).pipe(T.HttpQuery("filters")),
    metrics: Schema.optional(Schema.Array(Schema.Literals([
        "count",
        "bytesIngress",
        "bytesEgress",
        "durationAvg",
        "durationMedian",
        "duration90th",
        "duration99th",
    ]))).pipe(T.HttpQuery("metrics")),
    since: Schema.optional(Schema.String).pipe(T.HttpQuery("since")),
    sort: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("sort")),
    until: Schema.optional(Schema.String).pipe(T.HttpQuery("until")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/spectrum/analytics/events/summary",
}));
export const GetAnalyticEventSummaryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    data: Schema.Array(Schema.Struct({
        dimensions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        metrics: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Array(Schema.Number),
                Schema.Array(Schema.Array(Schema.Number)),
            ]),
            Schema.Null,
        ])),
    })),
    dataLag: Schema.Number,
    max: Schema.Record(Schema.String, Schema.Unknown),
    min: Schema.Record(Schema.String, Schema.Unknown),
    query: Schema.Struct({
        dimensions: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals(["event", "appID", "coloName", "ipVersion"])),
            Schema.Null,
        ])),
        filters: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        limit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        metrics: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "count",
                "bytesIngress",
                "bytesEgress",
                "durationAvg",
                "durationMedian",
                "duration90th",
                "duration99th",
            ])),
            Schema.Null,
        ])),
        since: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sort: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        until: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }),
    rows: Schema.Number,
    totals: Schema.Record(Schema.String, Schema.Unknown),
    timeIntervals: Schema.optional(Schema.Union([Schema.Array(Schema.Array(Schema.String)), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    data: "data",
    dataLag: "data_lag",
    max: "max",
    min: "min",
    query: "query",
    rows: "rows",
    totals: "totals",
    timeIntervals: "time_intervals",
}))
    .pipe(T.ResponsePath("result"));
export const getAnalyticEventSummary = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyticEventSummaryRequest,
    output: GetAnalyticEventSummaryResponse,
    errors: [],
}));
export const GetAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    appId: Schema.String.pipe(T.HttpPath("appId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/spectrum/apps/{appId}" }));
export const GetAppResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        trafficType: Schema.Literals(["direct", "http", "https"]),
        argoSmartRouting: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        edgeIps: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    connectivity: Schema.optional(Schema.Union([
                        Schema.Literals(["all", "ipv4", "ipv6"]),
                        Schema.Null,
                    ])),
                    type: Schema.optional(Schema.Union([Schema.Literal("dynamic"), Schema.Null])),
                }),
                Schema.Struct({
                    ips: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    type: Schema.optional(Schema.Union([Schema.Literal("static"), Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        ipFirewall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        originDns: Schema.optional(Schema.Union([
            Schema.Struct({
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                ttl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                type: Schema.optional(Schema.Union([
                    Schema.Literals(["", "A", "AAAA", "SRV"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        originPort: Schema.optional(Schema.Union([Schema.Union([Schema.Number, Schema.String]), Schema.Null])),
        proxyProtocol: Schema.optional(Schema.Union([
            Schema.Literals(["off", "v1", "v2", "simple"]),
            Schema.Null,
        ])),
        tls: Schema.optional(Schema.Union([
            Schema.Literals(["off", "flexible", "full", "strict"]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        trafficType: "traffic_type",
        argoSmartRouting: "argo_smart_routing",
        edgeIps: "edge_ips",
        ipFirewall: "ip_firewall",
        originDirect: "origin_direct",
        originDns: "origin_dns",
        originPort: "origin_port",
        proxyProtocol: "proxy_protocol",
        tls: "tls",
    })),
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        originDirect: "origin_direct",
    })),
]).pipe(T.ResponsePath("result"));
export const getApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAppRequest,
    output: GetAppResponse,
    errors: [],
}));
export const ListAppsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    order: Schema.optional(Schema.Literals(["protocol", "app_id", "created_on", "modified_on", "dns"])).pipe(T.HttpQuery("order")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/spectrum/apps" }));
export const ListAppsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            createdOn: Schema.String,
            dns: Schema.Struct({
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
            }),
            modifiedOn: Schema.String,
            protocol: Schema.String,
            trafficType: Schema.Literals(["direct", "http", "https"]),
            argoSmartRouting: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            edgeIps: Schema.optional(Schema.Union([
                Schema.Union([
                    Schema.Struct({
                        connectivity: Schema.optional(Schema.Union([
                            Schema.Literals(["all", "ipv4", "ipv6"]),
                            Schema.Null,
                        ])),
                        type: Schema.optional(Schema.Union([Schema.Literal("dynamic"), Schema.Null])),
                    }),
                    Schema.Struct({
                        ips: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                        type: Schema.optional(Schema.Union([Schema.Literal("static"), Schema.Null])),
                    }),
                ]),
                Schema.Null,
            ])),
            ipFirewall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            originDns: Schema.optional(Schema.Union([
                Schema.Struct({
                    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    ttl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    type: Schema.optional(Schema.Union([
                        Schema.Literals(["", "A", "AAAA", "SRV"]),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
            originPort: Schema.optional(Schema.Union([
                Schema.Union([Schema.Number, Schema.String]),
                Schema.Null,
            ])),
            proxyProtocol: Schema.optional(Schema.Union([
                Schema.Literals(["off", "v1", "v2", "simple"]),
                Schema.Null,
            ])),
            tls: Schema.optional(Schema.Union([
                Schema.Literals(["off", "flexible", "full", "strict"]),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdOn: "created_on",
            dns: "dns",
            modifiedOn: "modified_on",
            protocol: "protocol",
            trafficType: "traffic_type",
            argoSmartRouting: "argo_smart_routing",
            edgeIps: "edge_ips",
            ipFirewall: "ip_firewall",
            originDirect: "origin_direct",
            originDns: "origin_dns",
            originPort: "origin_port",
            proxyProtocol: "proxy_protocol",
            tls: "tls",
        })),
        Schema.Struct({
            id: Schema.String,
            createdOn: Schema.String,
            dns: Schema.Struct({
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
            }),
            modifiedOn: Schema.String,
            protocol: Schema.String,
            originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        }).pipe(Schema.encodeKeys({
            id: "id",
            createdOn: "created_on",
            dns: "dns",
            modifiedOn: "modified_on",
            protocol: "protocol",
            originDirect: "origin_direct",
        })),
    ])),
    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 listApps = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAppsRequest,
    output: ListAppsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    dns: Schema.Struct({
        name: Schema.optional(Schema.String),
        type: Schema.optional(Schema.Literals(["CNAME", "ADDRESS"])),
    }),
    protocol: Schema.String,
    trafficType: Schema.Literals(["direct", "http", "https"]),
    argoSmartRouting: Schema.optional(Schema.Boolean),
    edgeIps: Schema.optional(Schema.Union([
        Schema.Struct({
            connectivity: Schema.optional(Schema.Literals(["all", "ipv4", "ipv6"])),
            type: Schema.optional(Schema.Literal("dynamic")),
        }),
        Schema.Struct({
            ips: Schema.optional(Schema.Array(Schema.String)),
            type: Schema.optional(Schema.Literal("static")),
        }),
    ])),
    ipFirewall: Schema.optional(Schema.Boolean),
    originDirect: Schema.optional(Schema.Array(Schema.String)),
    originDns: Schema.optional(Schema.Struct({
        name: Schema.optional(Schema.String),
        ttl: Schema.optional(Schema.Number),
        type: Schema.optional(Schema.Literals(["", "A", "AAAA", "SRV"])),
    })),
    originPort: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
    proxyProtocol: Schema.optional(Schema.Literals(["off", "v1", "v2", "simple"])),
    tls: Schema.optional(Schema.Literals(["off", "flexible", "full", "strict"])),
}).pipe(Schema.encodeKeys({
    dns: "dns",
    protocol: "protocol",
    trafficType: "traffic_type",
    argoSmartRouting: "argo_smart_routing",
    edgeIps: "edge_ips",
    ipFirewall: "ip_firewall",
    originDirect: "origin_direct",
    originDns: "origin_dns",
    originPort: "origin_port",
    proxyProtocol: "proxy_protocol",
    tls: "tls",
}), T.Http({ method: "POST", path: "/zones/{zone_id}/spectrum/apps" }));
export const CreateAppResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        trafficType: Schema.Literals(["direct", "http", "https"]),
        argoSmartRouting: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        edgeIps: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    connectivity: Schema.optional(Schema.Union([
                        Schema.Literals(["all", "ipv4", "ipv6"]),
                        Schema.Null,
                    ])),
                    type: Schema.optional(Schema.Union([Schema.Literal("dynamic"), Schema.Null])),
                }),
                Schema.Struct({
                    ips: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    type: Schema.optional(Schema.Union([Schema.Literal("static"), Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        ipFirewall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        originDns: Schema.optional(Schema.Union([
            Schema.Struct({
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                ttl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                type: Schema.optional(Schema.Union([
                    Schema.Literals(["", "A", "AAAA", "SRV"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        originPort: Schema.optional(Schema.Union([Schema.Union([Schema.Number, Schema.String]), Schema.Null])),
        proxyProtocol: Schema.optional(Schema.Union([
            Schema.Literals(["off", "v1", "v2", "simple"]),
            Schema.Null,
        ])),
        tls: Schema.optional(Schema.Union([
            Schema.Literals(["off", "flexible", "full", "strict"]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        trafficType: "traffic_type",
        argoSmartRouting: "argo_smart_routing",
        edgeIps: "edge_ips",
        ipFirewall: "ip_firewall",
        originDirect: "origin_direct",
        originDns: "origin_dns",
        originPort: "origin_port",
        proxyProtocol: "proxy_protocol",
        tls: "tls",
    })),
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        originDirect: "origin_direct",
    })),
]).pipe(T.ResponsePath("result"));
export const createApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAppRequest,
    output: CreateAppResponse,
    errors: [],
}));
export const UpdateAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    appId: Schema.String.pipe(T.HttpPath("appId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    dns: Schema.Struct({
        name: Schema.optional(Schema.String),
        type: Schema.optional(Schema.Literals(["CNAME", "ADDRESS"])),
    }),
    protocol: Schema.String,
    trafficType: Schema.Literals(["direct", "http", "https"]),
    argoSmartRouting: Schema.optional(Schema.Boolean),
    edgeIps: Schema.optional(Schema.Union([
        Schema.Struct({
            connectivity: Schema.optional(Schema.Literals(["all", "ipv4", "ipv6"])),
            type: Schema.optional(Schema.Literal("dynamic")),
        }),
        Schema.Struct({
            ips: Schema.optional(Schema.Array(Schema.String)),
            type: Schema.optional(Schema.Literal("static")),
        }),
    ])),
    ipFirewall: Schema.optional(Schema.Boolean),
    originDirect: Schema.optional(Schema.Array(Schema.String)),
    originDns: Schema.optional(Schema.Struct({
        name: Schema.optional(Schema.String),
        ttl: Schema.optional(Schema.Number),
        type: Schema.optional(Schema.Literals(["", "A", "AAAA", "SRV"])),
    })),
    originPort: Schema.optional(Schema.Union([Schema.Number, Schema.String])),
    proxyProtocol: Schema.optional(Schema.Literals(["off", "v1", "v2", "simple"])),
    tls: Schema.optional(Schema.Literals(["off", "flexible", "full", "strict"])),
}).pipe(Schema.encodeKeys({
    dns: "dns",
    protocol: "protocol",
    trafficType: "traffic_type",
    argoSmartRouting: "argo_smart_routing",
    edgeIps: "edge_ips",
    ipFirewall: "ip_firewall",
    originDirect: "origin_direct",
    originDns: "origin_dns",
    originPort: "origin_port",
    proxyProtocol: "proxy_protocol",
    tls: "tls",
}), T.Http({ method: "PUT", path: "/zones/{zone_id}/spectrum/apps/{appId}" }));
export const UpdateAppResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        trafficType: Schema.Literals(["direct", "http", "https"]),
        argoSmartRouting: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        edgeIps: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    connectivity: Schema.optional(Schema.Union([
                        Schema.Literals(["all", "ipv4", "ipv6"]),
                        Schema.Null,
                    ])),
                    type: Schema.optional(Schema.Union([Schema.Literal("dynamic"), Schema.Null])),
                }),
                Schema.Struct({
                    ips: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    type: Schema.optional(Schema.Union([Schema.Literal("static"), Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        ipFirewall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        originDns: Schema.optional(Schema.Union([
            Schema.Struct({
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                ttl: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                type: Schema.optional(Schema.Union([
                    Schema.Literals(["", "A", "AAAA", "SRV"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        originPort: Schema.optional(Schema.Union([Schema.Union([Schema.Number, Schema.String]), Schema.Null])),
        proxyProtocol: Schema.optional(Schema.Union([
            Schema.Literals(["off", "v1", "v2", "simple"]),
            Schema.Null,
        ])),
        tls: Schema.optional(Schema.Union([
            Schema.Literals(["off", "flexible", "full", "strict"]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        trafficType: "traffic_type",
        argoSmartRouting: "argo_smart_routing",
        edgeIps: "edge_ips",
        ipFirewall: "ip_firewall",
        originDirect: "origin_direct",
        originDns: "origin_dns",
        originPort: "origin_port",
        proxyProtocol: "proxy_protocol",
        tls: "tls",
    })),
    Schema.Struct({
        id: Schema.String,
        createdOn: Schema.String,
        dns: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([Schema.Literals(["CNAME", "ADDRESS"]), Schema.Null])),
        }),
        modifiedOn: Schema.String,
        protocol: Schema.String,
        originDirect: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdOn: "created_on",
        dns: "dns",
        modifiedOn: "modified_on",
        protocol: "protocol",
        originDirect: "origin_direct",
    })),
]).pipe(T.ResponsePath("result"));
export const updateApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAppRequest,
    output: UpdateAppResponse,
    errors: [],
}));
export const DeleteAppRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    appId: Schema.String.pipe(T.HttpPath("appId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "DELETE", path: "/zones/{zone_id}/spectrum/apps/{appId}" }));
export const DeleteAppResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAppRequest,
    output: DeleteAppResponse,
    errors: [],
}));
//# sourceMappingURL=spectrum.js.map