export type CreateApiV1TenantsTenantIdRealmsRealmIdIdentitiesBatchDeleteArgs = {tenant_id: string, realm_id: string, body: {ids: Array}}; export type CreateApiV1TenantsTenantIdRealmsRealmIdIdentitiesBatchDeleteOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Batch delete identities. * * POST /v1/tenants/{tenant_id}/realms/{realm_id}/identities:batchDelete */ export const createApiV1TenantsTenantIdRealmsRealmIdIdentitiesBatchDelete = async (args: CreateApiV1TenantsTenantIdRealmsRealmIdIdentitiesBatchDeleteArgs, options?: CreateApiV1TenantsTenantIdRealmsRealmIdIdentitiesBatchDeleteOptions) => { const {baseUrl = "https://api-us.beyondidentity.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/tenants/${encodeURIComponent(String(args.tenant_id))}/realms/${encodeURIComponent(String(args.realm_id))}/identities:batchDelete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };