// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as DownloadAPI from 'cloudflaredev/resources/pcaps/download';
import * as OwnershipAPI from 'cloudflaredev/resources/pcaps/ownership';
import { SinglePage } from 'cloudflaredev/pagination';
export class PCAPs extends APIResource {
    constructor() {
        super(...arguments);
        this.ownership = new OwnershipAPI.OwnershipResource(this._client);
        this.download = new DownloadAPI.Download(this._client);
    }
    /**
     * Create new PCAP request for account.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/pcaps`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists all packet capture requests for an account.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/pcaps`, PCAPListResponsesSinglePage, options);
    }
    /**
     * Get information for a PCAP request by id.
     */
    get(pcapId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/pcaps/${pcapId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class PCAPListResponsesSinglePage extends SinglePage {
}
(function (PCAPs) {
    PCAPs.OwnershipResource = OwnershipAPI.OwnershipResource;
    PCAPs.Download = DownloadAPI.Download;
})(PCAPs || (PCAPs = {}));
//# sourceMappingURL=pcaps.mjs.map