export type DeleteApiManagementV20OrganisationsOrganisationIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, organisationId: string, verificationToken: string}; export type DeleteApiManagementV20OrganisationsOrganisationIdOptions = {baseUrl?: string | undefined, BasicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Organization * * DELETE /management/v2.0/organisations/{organisationId} */ export const deleteApiManagementV20OrganisationsOrganisationId = async (args: DeleteApiManagementV20OrganisationsOrganisationIdArgs, options?: DeleteApiManagementV20OrganisationsOrganisationIdOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, BasicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args.verificationToken != null) query.append("verificationToken", String(args.verificationToken)) if (BasicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${BasicAuth.username}:${BasicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/management/v2.0/organisations/${encodeURIComponent(String(args.organisationId))}${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 };