cloudflare
Version:
The official TypeScript library for the Cloudflare API
64 lines • 2.26 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseConnectivityPrecheck = /* @__PURE__ */ (() => {
class BaseConnectivityPrecheck extends APIResource {
/**
* Check whether tokens are valid against the source bucket
*
* @example
* ```ts
* const response =
* await client.r2.superSlurper.connectivityPrecheck.source({
* account_id: 'account_id',
* bucket: 'bucket',
* secret: {
* accessKeyId: 'accessKeyId',
* secretAccessKey: 'secretAccessKey',
* },
* vendor: 's3',
* });
* ```
*/
source(params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/slurper/source/connectivity-precheck`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Check whether tokens are valid against the target bucket
*
* @example
* ```ts
* const response =
* await client.r2.superSlurper.connectivityPrecheck.target({
* account_id: 'account_id',
* bucket: 'bucket',
* secret: {
* accessKeyId: 'accessKeyId',
* secretAccessKey: 'secretAccessKey',
* },
* vendor: 'r2',
* });
* ```
*/
target(params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/slurper/target/connectivity-precheck`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseConnectivityPrecheck._key = Object.freeze([
'r2',
'superSlurper',
'connectivityPrecheck',
]);
return BaseConnectivityPrecheck;
})();
export class ConnectivityPrecheck extends BaseConnectivityPrecheck {
}
//# sourceMappingURL=connectivity-precheck.mjs.map