UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

63 lines • 2.43 kB
// 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 BaseMaintenanceConfigs = /* @__PURE__ */ (() => { class BaseMaintenanceConfigs extends APIResource { /** * Update the maintenance configuration for a catalog. This allows you to enable or * disable compaction and adjust target file sizes for optimization. * * @example * ```ts * const maintenanceConfig = * await client.basinCatalog.maintenanceConfigs.update( * 'my-data-bucket', * { * account_id: '0123456789abcdef0123456789abcdef', * compaction: { * state: 'enabled', * target_size_mb: '256', * }, * snapshot_expiration: { * max_snapshot_age: '14d', * min_snapshots_to_keep: 5, * state: 'enabled', * }, * }, * ); * ``` */ update(bucketName, params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/basin-catalog/${bucketName}/maintenance-configs`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Retrieve the maintenance configuration for a specific catalog, including * compaction settings and credential status. * * @example * ```ts * const maintenanceConfig = * await client.basinCatalog.maintenanceConfigs.get( * 'my-data-bucket', * { account_id: '0123456789abcdef0123456789abcdef' }, * ); * ``` */ get(bucketName, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/basin-catalog/${bucketName}/maintenance-configs`, options)._thenUnwrap((obj) => obj.result); } } BaseMaintenanceConfigs._key = Object.freeze([ 'basinCatalog', 'maintenanceConfigs', ]); return BaseMaintenanceConfigs; })(); export class MaintenanceConfigs extends BaseMaintenanceConfigs { } //# sourceMappingURL=maintenance-configs.mjs.map