cloudflare
Version:
The official TypeScript library for the Cloudflare API
51 lines • 1.95 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../resource.mjs";
export class SippyResource extends APIResource {
/**
* Sets configuration for Sippy for an existing R2 bucket.
*/
update(bucketName, params, options) {
const { account_id, jurisdiction, ...body } = params;
return this._client.put(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
body,
...options,
headers: {
...(jurisdiction?.toString() != null ?
{ 'cf-r2-jurisdiction': jurisdiction?.toString() }
: undefined),
...options?.headers,
},
})._thenUnwrap((obj) => obj.result);
}
/**
* Disables Sippy on this bucket
*/
delete(bucketName, params, options) {
const { account_id, jurisdiction } = params;
return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
...options,
headers: {
...(jurisdiction?.toString() != null ?
{ 'cf-r2-jurisdiction': jurisdiction?.toString() }
: undefined),
...options?.headers,
},
})._thenUnwrap((obj) => obj.result);
}
/**
* Gets configuration for Sippy for an existing R2 bucket.
*/
get(bucketName, params, options) {
const { account_id, jurisdiction } = params;
return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}/sippy`, {
...options,
headers: {
...(jurisdiction?.toString() != null ?
{ 'cf-r2-jurisdiction': jurisdiction?.toString() }
: undefined),
...options?.headers,
},
})._thenUnwrap((obj) => obj.result);
}
}
//# sourceMappingURL=sippy.mjs.map