export type DeleteApiV01OrgsOrgNameArgs = {org_name: string}; export type DeleteApiV01OrgsOrgNameOptions = {baseUrl?: string | undefined, APIToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a single organization * * DELETE /v0.1/orgs/{org_name} */ export const deleteApiV01OrgsOrgName = async (args: DeleteApiV01OrgsOrgNameArgs, options?: DeleteApiV01OrgsOrgNameOptions) => { const {baseUrl = "https://api.appcenter.ms", fetch: fetchFn = fetch, APIToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIToken !== undefined) headers.set("X-API-Token", APIToken) const url = `${baseUrl.replace(/\/+$/, '')}/v0.1/orgs/${encodeURIComponent(String(args.org_name))}${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 };