/**
 * Cloudflare SPEED API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service speed
 */
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 ListAvailabilitiesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/speed_api/availabilities",
}));
export const ListAvailabilitiesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    quota: Schema.optional(Schema.Union([
        Schema.Struct({
            plan: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            quotasPerPlan: Schema.optional(Schema.Union([
                Schema.Struct({
                    value: Schema.optional(Schema.Union([
                        Schema.Struct({
                            business: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            enterprise: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            free: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            pro: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
            remainingSchedules: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            remainingTests: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            scheduleQuotasPerPlan: Schema.optional(Schema.Union([
                Schema.Struct({
                    value: Schema.optional(Schema.Union([
                        Schema.Struct({
                            business: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            enterprise: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            free: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            pro: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    regions: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([
                Schema.Literals([
                    "asia-east1",
                    "asia-northeast1",
                    "asia-northeast2",
                    "asia-south1",
                    "asia-southeast1",
                    "australia-southeast1",
                    "europe-north1",
                    "europe-southwest1",
                    "europe-west1",
                    "europe-west2",
                    "europe-west3",
                    "europe-west4",
                    "europe-west8",
                    "europe-west9",
                    "me-west1",
                    "southamerica-east1",
                    "us-central1",
                    "us-east1",
                    "us-east4",
                    "us-south1",
                    "us-west1",
                ]),
                Schema.Null,
            ])),
        })),
        Schema.Null,
    ])),
    regionsPerPlan: Schema.optional(Schema.Union([
        Schema.Struct({
            business: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    value: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "asia-east1",
                            "asia-northeast1",
                            "asia-northeast2",
                            "asia-south1",
                            "asia-southeast1",
                            "australia-southeast1",
                            "europe-north1",
                            "europe-southwest1",
                            "europe-west1",
                            "europe-west2",
                            "europe-west3",
                            "europe-west4",
                            "europe-west8",
                            "europe-west9",
                            "me-west1",
                            "southamerica-east1",
                            "us-central1",
                            "us-east1",
                            "us-east4",
                            "us-south1",
                            "us-west1",
                        ]),
                        Schema.Null,
                    ])),
                })),
                Schema.Null,
            ])),
            enterprise: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    value: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "asia-east1",
                            "asia-northeast1",
                            "asia-northeast2",
                            "asia-south1",
                            "asia-southeast1",
                            "australia-southeast1",
                            "europe-north1",
                            "europe-southwest1",
                            "europe-west1",
                            "europe-west2",
                            "europe-west3",
                            "europe-west4",
                            "europe-west8",
                            "europe-west9",
                            "me-west1",
                            "southamerica-east1",
                            "us-central1",
                            "us-east1",
                            "us-east4",
                            "us-south1",
                            "us-west1",
                        ]),
                        Schema.Null,
                    ])),
                })),
                Schema.Null,
            ])),
            free: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    value: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "asia-east1",
                            "asia-northeast1",
                            "asia-northeast2",
                            "asia-south1",
                            "asia-southeast1",
                            "australia-southeast1",
                            "europe-north1",
                            "europe-southwest1",
                            "europe-west1",
                            "europe-west2",
                            "europe-west3",
                            "europe-west4",
                            "europe-west8",
                            "europe-west9",
                            "me-west1",
                            "southamerica-east1",
                            "us-central1",
                            "us-east1",
                            "us-east4",
                            "us-south1",
                            "us-west1",
                        ]),
                        Schema.Null,
                    ])),
                })),
                Schema.Null,
            ])),
            pro: Schema.optional(Schema.Union([
                Schema.Array(Schema.Struct({
                    label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    value: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "asia-east1",
                            "asia-northeast1",
                            "asia-northeast2",
                            "asia-south1",
                            "asia-southeast1",
                            "australia-southeast1",
                            "europe-north1",
                            "europe-southwest1",
                            "europe-west1",
                            "europe-west2",
                            "europe-west3",
                            "europe-west4",
                            "europe-west8",
                            "europe-west9",
                            "me-west1",
                            "southamerica-east1",
                            "us-central1",
                            "us-east1",
                            "us-east4",
                            "us-south1",
                            "us-west1",
                        ]),
                        Schema.Null,
                    ])),
                })),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const listAvailabilities = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListAvailabilitiesRequest,
    output: ListAvailabilitiesResponse,
    errors: [],
}));
export const ListPagesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/speed_api/pages" }));
export const ListPagesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        region: Schema.optional(Schema.Union([
            Schema.Struct({
                label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                value: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "asia-east1",
                        "asia-northeast1",
                        "asia-northeast2",
                        "asia-south1",
                        "asia-southeast1",
                        "australia-southeast1",
                        "europe-north1",
                        "europe-southwest1",
                        "europe-west1",
                        "europe-west2",
                        "europe-west3",
                        "europe-west4",
                        "europe-west8",
                        "europe-west9",
                        "me-west1",
                        "southamerica-east1",
                        "us-central1",
                        "us-east1",
                        "us-east4",
                        "us-south1",
                        "us-west1",
                    ]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        scheduleFrequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
        tests: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                date: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                desktopReport: Schema.optional(Schema.Union([
                    Schema.Struct({
                        cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        deviceType: Schema.optional(Schema.Union([
                            Schema.Literals(["DESKTOP", "MOBILE"]),
                            Schema.Null,
                        ])),
                        error: Schema.optional(Schema.Union([
                            Schema.Struct({
                                code: Schema.optional(Schema.Union([
                                    Schema.Literals([
                                        "NOT_REACHABLE",
                                        "DNS_FAILURE",
                                        "NOT_HTML",
                                        "LIGHTHOUSE_TIMEOUT",
                                        "UNKNOWN",
                                    ]),
                                    Schema.Null,
                                ])),
                                detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }),
                            Schema.Null,
                        ])),
                        fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        state: Schema.optional(Schema.Union([
                            Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                            Schema.Null,
                        ])),
                        tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                mobileReport: Schema.optional(Schema.Union([
                    Schema.Struct({
                        cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        deviceType: Schema.optional(Schema.Union([
                            Schema.Literals(["DESKTOP", "MOBILE"]),
                            Schema.Null,
                        ])),
                        error: Schema.optional(Schema.Union([
                            Schema.Struct({
                                code: Schema.optional(Schema.Union([
                                    Schema.Literals([
                                        "NOT_REACHABLE",
                                        "DNS_FAILURE",
                                        "NOT_HTML",
                                        "LIGHTHOUSE_TIMEOUT",
                                        "UNKNOWN",
                                    ]),
                                    Schema.Null,
                                ])),
                                detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }),
                            Schema.Null,
                        ])),
                        fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        state: Schema.optional(Schema.Union([
                            Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                            Schema.Null,
                        ])),
                        tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                region: Schema.optional(Schema.Union([
                    Schema.Struct({
                        label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        value: Schema.optional(Schema.Union([
                            Schema.Literals([
                                "asia-east1",
                                "asia-northeast1",
                                "asia-northeast2",
                                "asia-south1",
                                "asia-southeast1",
                                "australia-southeast1",
                                "europe-north1",
                                "europe-southwest1",
                                "europe-west1",
                                "europe-west2",
                                "europe-west3",
                                "europe-west4",
                                "europe-west8",
                                "europe-west9",
                                "me-west1",
                                "southamerica-east1",
                                "us-central1",
                                "us-east1",
                                "us-east4",
                                "us-south1",
                                "us-west1",
                            ]),
                            Schema.Null,
                        ])),
                    }),
                    Schema.Null,
                ])),
                scheduleFrequency: Schema.optional(Schema.Union([
                    Schema.Literals(["DAILY", "WEEKLY"]),
                    Schema.Null,
                ])),
                url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            })),
            Schema.Null,
        ])),
        url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const listPages = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListPagesRequest,
    output: ListPagesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const TrendPageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    deviceType: Schema.Literals(["DESKTOP", "MOBILE"]).pipe(T.HttpQuery("deviceType")),
    metrics: Schema.String.pipe(T.HttpQuery("metrics")),
    region: Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ]).pipe(T.HttpQuery("region")),
    start: Schema.String.pipe(T.HttpQuery("start")),
    tz: Schema.String.pipe(T.HttpQuery("tz")),
    end: Schema.optional(Schema.String).pipe(T.HttpQuery("end")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/speed_api/pages/{url}/trend",
}));
export const TrendPageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    cls: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    fcp: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    lcp: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    performanceScore: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    si: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    tbt: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    ttfb: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
    tti: Schema.optional(Schema.Union([
        Schema.Array(Schema.Union([Schema.Number, Schema.Null])),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const trendPage = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TrendPageRequest,
    output: TrendPageResponse,
    errors: [],
}));
export const GetPageTestRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    testId: Schema.String.pipe(T.HttpPath("testId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/speed_api/pages/{url}/tests/{testId}",
}));
export const GetPageTestResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    date: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    desktopReport: Schema.optional(Schema.Union([
        Schema.Struct({
            cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            deviceType: Schema.optional(Schema.Union([Schema.Literals(["DESKTOP", "MOBILE"]), Schema.Null])),
            error: Schema.optional(Schema.Union([
                Schema.Struct({
                    code: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "NOT_REACHABLE",
                            "DNS_FAILURE",
                            "NOT_HTML",
                            "LIGHTHOUSE_TIMEOUT",
                            "UNKNOWN",
                        ]),
                        Schema.Null,
                    ])),
                    detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
                Schema.Null,
            ])),
            fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            state: Schema.optional(Schema.Union([
                Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                Schema.Null,
            ])),
            tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    mobileReport: Schema.optional(Schema.Union([
        Schema.Struct({
            cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            deviceType: Schema.optional(Schema.Union([Schema.Literals(["DESKTOP", "MOBILE"]), Schema.Null])),
            error: Schema.optional(Schema.Union([
                Schema.Struct({
                    code: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "NOT_REACHABLE",
                            "DNS_FAILURE",
                            "NOT_HTML",
                            "LIGHTHOUSE_TIMEOUT",
                            "UNKNOWN",
                        ]),
                        Schema.Null,
                    ])),
                    detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
                Schema.Null,
            ])),
            fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            state: Schema.optional(Schema.Union([
                Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                Schema.Null,
            ])),
            tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    region: Schema.optional(Schema.Union([
        Schema.Struct({
            label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([
                Schema.Literals([
                    "asia-east1",
                    "asia-northeast1",
                    "asia-northeast2",
                    "asia-south1",
                    "asia-southeast1",
                    "australia-southeast1",
                    "europe-north1",
                    "europe-southwest1",
                    "europe-west1",
                    "europe-west2",
                    "europe-west3",
                    "europe-west4",
                    "europe-west8",
                    "europe-west9",
                    "me-west1",
                    "southamerica-east1",
                    "us-central1",
                    "us-east1",
                    "us-east4",
                    "us-south1",
                    "us-west1",
                ]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    scheduleFrequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getPageTest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPageTestRequest,
    output: GetPageTestResponse,
    errors: [],
}));
export const ListPageTestsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    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")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])).pipe(T.HttpQuery("region")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/speed_api/pages/{url}/tests",
}));
export const ListPageTestsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        date: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        desktopReport: Schema.optional(Schema.Union([
            Schema.Struct({
                cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                deviceType: Schema.optional(Schema.Union([
                    Schema.Literals(["DESKTOP", "MOBILE"]),
                    Schema.Null,
                ])),
                error: Schema.optional(Schema.Union([
                    Schema.Struct({
                        code: Schema.optional(Schema.Union([
                            Schema.Literals([
                                "NOT_REACHABLE",
                                "DNS_FAILURE",
                                "NOT_HTML",
                                "LIGHTHOUSE_TIMEOUT",
                                "UNKNOWN",
                            ]),
                            Schema.Null,
                        ])),
                        detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                state: Schema.optional(Schema.Union([
                    Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                    Schema.Null,
                ])),
                tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }),
            Schema.Null,
        ])),
        mobileReport: Schema.optional(Schema.Union([
            Schema.Struct({
                cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                deviceType: Schema.optional(Schema.Union([
                    Schema.Literals(["DESKTOP", "MOBILE"]),
                    Schema.Null,
                ])),
                error: Schema.optional(Schema.Union([
                    Schema.Struct({
                        code: Schema.optional(Schema.Union([
                            Schema.Literals([
                                "NOT_REACHABLE",
                                "DNS_FAILURE",
                                "NOT_HTML",
                                "LIGHTHOUSE_TIMEOUT",
                                "UNKNOWN",
                            ]),
                            Schema.Null,
                        ])),
                        detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                state: Schema.optional(Schema.Union([
                    Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                    Schema.Null,
                ])),
                tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }),
            Schema.Null,
        ])),
        region: Schema.optional(Schema.Union([
            Schema.Struct({
                label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                value: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "asia-east1",
                        "asia-northeast1",
                        "asia-northeast2",
                        "asia-south1",
                        "asia-southeast1",
                        "australia-southeast1",
                        "europe-north1",
                        "europe-southwest1",
                        "europe-west1",
                        "europe-west2",
                        "europe-west3",
                        "europe-west4",
                        "europe-west8",
                        "europe-west9",
                        "me-west1",
                        "southamerica-east1",
                        "us-central1",
                        "us-east1",
                        "us-east4",
                        "us-south1",
                        "us-west1",
                    ]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        scheduleFrequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
        url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    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 listPageTests = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListPageTestsRequest,
    output: ListPageTestsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreatePageTestRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])),
}).pipe(T.Http({
    method: "POST",
    path: "/zones/{zone_id}/speed_api/pages/{url}/tests",
}));
export const CreatePageTestResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    date: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    desktopReport: Schema.optional(Schema.Union([
        Schema.Struct({
            cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            deviceType: Schema.optional(Schema.Union([Schema.Literals(["DESKTOP", "MOBILE"]), Schema.Null])),
            error: Schema.optional(Schema.Union([
                Schema.Struct({
                    code: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "NOT_REACHABLE",
                            "DNS_FAILURE",
                            "NOT_HTML",
                            "LIGHTHOUSE_TIMEOUT",
                            "UNKNOWN",
                        ]),
                        Schema.Null,
                    ])),
                    detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
                Schema.Null,
            ])),
            fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            state: Schema.optional(Schema.Union([
                Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                Schema.Null,
            ])),
            tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    mobileReport: Schema.optional(Schema.Union([
        Schema.Struct({
            cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            deviceType: Schema.optional(Schema.Union([Schema.Literals(["DESKTOP", "MOBILE"]), Schema.Null])),
            error: Schema.optional(Schema.Union([
                Schema.Struct({
                    code: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "NOT_REACHABLE",
                            "DNS_FAILURE",
                            "NOT_HTML",
                            "LIGHTHOUSE_TIMEOUT",
                            "UNKNOWN",
                        ]),
                        Schema.Null,
                    ])),
                    detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
                Schema.Null,
            ])),
            fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            state: Schema.optional(Schema.Union([
                Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                Schema.Null,
            ])),
            tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }),
        Schema.Null,
    ])),
    region: Schema.optional(Schema.Union([
        Schema.Struct({
            label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([
                Schema.Literals([
                    "asia-east1",
                    "asia-northeast1",
                    "asia-northeast2",
                    "asia-south1",
                    "asia-southeast1",
                    "australia-southeast1",
                    "europe-north1",
                    "europe-southwest1",
                    "europe-west1",
                    "europe-west2",
                    "europe-west3",
                    "europe-west4",
                    "europe-west8",
                    "europe-west9",
                    "me-west1",
                    "southamerica-east1",
                    "us-central1",
                    "us-east1",
                    "us-east4",
                    "us-south1",
                    "us-west1",
                ]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    scheduleFrequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const createPageTest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreatePageTestRequest,
    output: CreatePageTestResponse,
    errors: [],
}));
export const DeletePageTestRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])).pipe(T.HttpQuery("region")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/speed_api/pages/{url}/tests",
}));
export const DeletePageTestResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deletePageTest = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeletePageTestRequest,
    output: DeletePageTestResponse,
    errors: [],
}));
export const GetScheduleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])).pipe(T.HttpQuery("region")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/speed_api/schedule/{url}" }));
export const GetScheduleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    frequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
    region: Schema.optional(Schema.Union([
        Schema.Literals([
            "asia-east1",
            "asia-northeast1",
            "asia-northeast2",
            "asia-south1",
            "asia-southeast1",
            "australia-southeast1",
            "europe-north1",
            "europe-southwest1",
            "europe-west1",
            "europe-west2",
            "europe-west3",
            "europe-west4",
            "europe-west8",
            "europe-west9",
            "me-west1",
            "southamerica-east1",
            "us-central1",
            "us-east1",
            "us-east4",
            "us-south1",
            "us-west1",
        ]),
        Schema.Null,
    ])),
    url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetScheduleRequest,
    output: GetScheduleResponse,
    errors: [],
}));
export const CreateScheduleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])).pipe(T.HttpQuery("region")),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/speed_api/schedule/{url}" }));
export const CreateScheduleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schedule: Schema.optional(Schema.Union([
        Schema.Struct({
            frequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
            region: Schema.optional(Schema.Union([
                Schema.Literals([
                    "asia-east1",
                    "asia-northeast1",
                    "asia-northeast2",
                    "asia-south1",
                    "asia-southeast1",
                    "australia-southeast1",
                    "europe-north1",
                    "europe-southwest1",
                    "europe-west1",
                    "europe-west2",
                    "europe-west3",
                    "europe-west4",
                    "europe-west8",
                    "europe-west9",
                    "me-west1",
                    "southamerica-east1",
                    "us-central1",
                    "us-east1",
                    "us-east4",
                    "us-south1",
                    "us-west1",
                ]),
                Schema.Null,
            ])),
            url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    test: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            date: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            desktopReport: Schema.optional(Schema.Union([
                Schema.Struct({
                    cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    deviceType: Schema.optional(Schema.Union([
                        Schema.Literals(["DESKTOP", "MOBILE"]),
                        Schema.Null,
                    ])),
                    error: Schema.optional(Schema.Union([
                        Schema.Struct({
                            code: Schema.optional(Schema.Union([
                                Schema.Literals([
                                    "NOT_REACHABLE",
                                    "DNS_FAILURE",
                                    "NOT_HTML",
                                    "LIGHTHOUSE_TIMEOUT",
                                    "UNKNOWN",
                                ]),
                                Schema.Null,
                            ])),
                            detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        }),
                        Schema.Null,
                    ])),
                    fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    state: Schema.optional(Schema.Union([
                        Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                        Schema.Null,
                    ])),
                    tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
            mobileReport: Schema.optional(Schema.Union([
                Schema.Struct({
                    cls: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    deviceType: Schema.optional(Schema.Union([
                        Schema.Literals(["DESKTOP", "MOBILE"]),
                        Schema.Null,
                    ])),
                    error: Schema.optional(Schema.Union([
                        Schema.Struct({
                            code: Schema.optional(Schema.Union([
                                Schema.Literals([
                                    "NOT_REACHABLE",
                                    "DNS_FAILURE",
                                    "NOT_HTML",
                                    "LIGHTHOUSE_TIMEOUT",
                                    "UNKNOWN",
                                ]),
                                Schema.Null,
                            ])),
                            detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            finalDisplayedUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        }),
                        Schema.Null,
                    ])),
                    fcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    jsonReportUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    lcp: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    performanceScore: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    si: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    state: Schema.optional(Schema.Union([
                        Schema.Literals(["RUNNING", "COMPLETE", "FAILED"]),
                        Schema.Null,
                    ])),
                    tbt: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    ttfb: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                    tti: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                }),
                Schema.Null,
            ])),
            region: Schema.optional(Schema.Union([
                Schema.Struct({
                    label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    value: Schema.optional(Schema.Union([
                        Schema.Literals([
                            "asia-east1",
                            "asia-northeast1",
                            "asia-northeast2",
                            "asia-south1",
                            "asia-southeast1",
                            "australia-southeast1",
                            "europe-north1",
                            "europe-southwest1",
                            "europe-west1",
                            "europe-west2",
                            "europe-west3",
                            "europe-west4",
                            "europe-west8",
                            "europe-west9",
                            "me-west1",
                            "southamerica-east1",
                            "us-central1",
                            "us-east1",
                            "us-east4",
                            "us-south1",
                            "us-west1",
                        ]),
                        Schema.Null,
                    ])),
                }),
                Schema.Null,
            ])),
            scheduleFrequency: Schema.optional(Schema.Union([Schema.Literals(["DAILY", "WEEKLY"]), Schema.Null])),
            url: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
}).pipe(T.ResponsePath("result"));
export const createSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateScheduleRequest,
    output: CreateScheduleResponse,
    errors: [],
}));
export const DeleteScheduleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    url: Schema.String.pipe(T.HttpPath("url")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    region: Schema.optional(Schema.Literals([
        "asia-east1",
        "asia-northeast1",
        "asia-northeast2",
        "asia-south1",
        "asia-southeast1",
        "australia-southeast1",
        "europe-north1",
        "europe-southwest1",
        "europe-west1",
        "europe-west2",
        "europe-west3",
        "europe-west4",
        "europe-west8",
        "europe-west9",
        "me-west1",
        "southamerica-east1",
        "us-central1",
        "us-east1",
        "us-east4",
        "us-south1",
        "us-west1",
    ])).pipe(T.HttpQuery("region")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/speed_api/schedule/{url}",
}));
export const DeleteScheduleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteSchedule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteScheduleRequest,
    output: DeleteScheduleResponse,
    errors: [],
}));
//# sourceMappingURL=speed.js.map