export type HeadApiApiV1OrgsOrgIdBucketsNameArgs = {orgId: number, name: string, secretId?: string | undefined, secretName?: string | undefined, cloudType: 'amazon' | 'google' | 'azure', resourceGroup?: string | undefined, storageAccount?: string | undefined, location?: string | undefined}; export type HeadApiApiV1OrgsOrgIdBucketsNameOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get object store bucket status * * HEAD /api/v1/orgs/{orgId}/buckets/{name} */ export const headApiApiV1OrgsOrgIdBucketsName = async (args: HeadApiApiV1OrgsOrgIdBucketsNameArgs, options?: HeadApiApiV1OrgsOrgIdBucketsNameOptions) => { const {baseUrl = "http://localhost:9090", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.secretId != null) headers.set("secretId", String(args.secretId)) if (args.secretName != null) headers.set("secretName", String(args.secretName)) if (args.cloudType != null) query.append("cloudType", String(args.cloudType)) if (args.resourceGroup != null) query.append("resourceGroup", String(args.resourceGroup)) if (args.storageAccount != null) query.append("storageAccount", String(args.storageAccount)) if (args.location != null) query.append("location", String(args.location)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/orgs/${encodeURIComponent(String(args.orgId))}/buckets/${encodeURIComponent(String(args.name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "HEAD", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };