export type CreateApiStoragezoneResetReadOnlyPasswordArgs = {id: number}; export type CreateApiStoragezoneResetReadOnlyPasswordOptions = {baseUrl?: string | undefined, AccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset Read-Only Password * * POST /storagezone/resetReadOnlyPassword */ export const createApiStoragezoneResetReadOnlyPassword = async (args: CreateApiStoragezoneResetReadOnlyPasswordArgs, options?: CreateApiStoragezoneResetReadOnlyPasswordOptions) => { const {baseUrl = "https://api.bunny.net", fetch: fetchFn = fetch, AccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (AccessKey !== undefined) headers.set("AccessKey", AccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/storagezone/resetReadOnlyPassword${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };