export type DeleteApiV1OrganizationsIdArgs = {id: string, 'Content-Type'?: string | undefined, 'X-Request-Id'?: string | undefined, Authorization?: string | undefined}; export type DeleteApiV1OrganizationsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Organization * * DELETE /v1/organizations/{id} */ export const deleteApiV1OrganizationsId = async (args: DeleteApiV1OrganizationsIdArgs, options?: DeleteApiV1OrganizationsIdOptions) => { const {baseUrl = "https://identity.sandbox.lerian.net", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };