// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as AvailabilitiesAPI from 'cloudflare/resources/speed/availabilities';
import * as PagesAPI from 'cloudflare/resources/speed/pages';
import * as ScheduleAPI from 'cloudflare/resources/speed/schedule';
import * as TestsAPI from 'cloudflare/resources/speed/tests';
export class Speed extends 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);
    }
}
(function (Speed) {
    Speed.Tests = TestsAPI.Tests;
    Speed.Schedule = ScheduleAPI.Schedule;
    Speed.Availabilities = AvailabilitiesAPI.Availabilities;
    Speed.Pages = PagesAPI.Pages;
})(Speed || (Speed = {}));
//# sourceMappingURL=speed.mjs.map