cloudflare
Version:
The official TypeScript library for the Cloudflare API
40 lines • 1.45 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { buildHeaders } from "../../../internal/headers.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseDownload = /* @__PURE__ */ (() => {
class BaseDownload extends APIResource {
/**
* Download PCAP information into a file. Response is a binary PCAP file.
*
* @example
* ```ts
* const download =
* await client.magicTransit.pcaps.download.get(
* '023e105f4ecef8ad9ca31a8372d0c353',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
*
* const content = await download.blob();
* console.log(content);
* ```
*/
get(pcapID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/pcaps/${pcapID}/download`, {
...options,
headers: buildHeaders([{ Accept: 'application/vnd.tcpdump.pcap' }, options?.headers]),
__binaryResponse: true,
});
}
}
BaseDownload._key = Object.freeze([
'magicTransit',
'pcaps',
'download',
]);
return BaseDownload;
})();
export class Download extends BaseDownload {
}
//# sourceMappingURL=download.mjs.map