export type GetApiProjectsProjectIdStorageS3BucketsCountArgs = {project_id: string}; export type GetApiProjectsProjectIdStorageS3BucketsCountOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns the number of S3 buckets in the project. * * GET /projects/{project_id}/storage/s3/buckets/count */ export const getApiProjectsProjectIdStorageS3BucketsCount = async (args: GetApiProjectsProjectIdStorageS3BucketsCountArgs, options?: GetApiProjectsProjectIdStorageS3BucketsCountOptions) => { const {baseUrl = "https://api.cloud.crusoe.ai/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_id))}/storage/s3/buckets/count${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };