UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

69 lines • 2.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConnectivityPrecheck = exports.BaseConnectivityPrecheck = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseConnectivityPrecheck = /* @__PURE__ */ (() => { class BaseConnectivityPrecheck extends resource_1.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((0, path_1.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((0, path_1.path) `/accounts/${account_id}/slurper/target/connectivity-precheck`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseConnectivityPrecheck._key = Object.freeze([ 'r2', 'superSlurper', 'connectivityPrecheck', ]); return BaseConnectivityPrecheck; })(); exports.BaseConnectivityPrecheck = BaseConnectivityPrecheck; class ConnectivityPrecheck extends BaseConnectivityPrecheck { } exports.ConnectivityPrecheck = ConnectivityPrecheck; //# sourceMappingURL=connectivity-precheck.js.map