export type BusinessEntityID = string; export type DeleteApiV1OrganizationBusinessEntitiesIdArgs = {id: BusinessEntityID}; export type DeleteApiV1OrganizationBusinessEntitiesIdOptions = {baseUrl?: string | undefined, OAuth2ClientCredentialsProduction?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a business entity * * DELETE /v1/organization/business_entities/{id} * * Also accepts auth: OAuth2AuthCodeProduction */ export const deleteApiV1OrganizationBusinessEntitiesId = async (args: DeleteApiV1OrganizationBusinessEntitiesIdArgs, options?: DeleteApiV1OrganizationBusinessEntitiesIdOptions) => { const {baseUrl = "https://api.sinai.com", fetch: fetchFn = fetch, OAuth2ClientCredentialsProduction} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2ClientCredentialsProduction !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentialsProduction}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organization/business_entities/${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 };