"use strict";
// File generated from our OpenAPI spec by Stainless.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Speed = void 0;
const resource_1 = require("cloudflare/resource");
const AvailabilitiesAPI = __importStar(require("cloudflare/resources/speed/availabilities"));
const PagesAPI = __importStar(require("cloudflare/resources/speed/pages"));
const ScheduleAPI = __importStar(require("cloudflare/resources/speed/schedule"));
const TestsAPI = __importStar(require("cloudflare/resources/speed/tests"));
class Speed extends resource_1.APIResource {
    constructor() {
        super(...arguments);
        this.tests = new TestsAPI.Tests(this._client);
        this.schedule = new ScheduleAPI.Schedule(this._client);
        this.availabilities = new AvailabilitiesAPI.Availabilities(this._client);
        this.pages = new PagesAPI.Pages(this._client);
    }
    /**
     * Deletes a scheduled test for a page.
     */
    delete(url, params, options) {
        const { zone_id, region } = params;
        return this._client.delete(`/zones/${zone_id}/speed_api/schedule/${url}`, {
            query: { region },
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Retrieves the test schedule for a page in a specific region.
     */
    scheduleGet(url, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/schedule/${url}`, {
            query,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists the core web vital metrics trend over time for a specific page.
     */
    trendsList(url, params, options) {
        const { zone_id, ...query } = params;
        return this._client.get(`/zones/${zone_id}/speed_api/pages/${url}/trend`, {
            query,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
}
exports.Speed = Speed;
(function (Speed) {
    Speed.Tests = TestsAPI.Tests;
    Speed.Schedule = ScheduleAPI.Schedule;
    Speed.Availabilities = AvailabilitiesAPI.Availabilities;
    Speed.Pages = PagesAPI.Pages;
})(Speed = exports.Speed || (exports.Speed = {}));
//# sourceMappingURL=speed.js.map