// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as BucketsAPI from 'cloudflaredev/resources/r2/buckets';
import { CursorPagination } from 'cloudflaredev/pagination';
export class Buckets extends APIResource {
    /**
     * Creates a new R2 bucket.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/r2/buckets`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists all R2 buckets on your account
     */
    list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/r2/buckets`, BucketsCursorPagination, {
            query,
            ...options,
        });
    }
    /**
     * Deletes an existing R2 bucket.
     */
    delete(bucketName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/r2/buckets/${bucketName}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Gets metadata for an existing R2 bucket.
     */
    get(bucketName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/r2/buckets/${bucketName}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class BucketsCursorPagination extends CursorPagination {
}
(function (Buckets) {
    Buckets.BucketsCursorPagination = BucketsAPI.BucketsCursorPagination;
})(Buckets || (Buckets = {}));
//# sourceMappingURL=buckets.mjs.map