cloudflare
Version:
The official TypeScript library for the Cloudflare API
40 lines • 1.6 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as DownloadAPI from 'cloudflare/resources/pcaps/download';
import * as OwnershipAPI from 'cloudflare/resources/pcaps/ownership';
import { SinglePage } from 'cloudflare/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