export type Body4 = {subAccountIds: Array}; export type UpdateApiCorporateGroupUnlinkGroupIdSubAccountsArgs = {groupId: string, body: Body4}; export type UpdateApiCorporateGroupUnlinkGroupIdSubAccountsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete sub-account from group * * PUT /corporate/group/unlink/{groupId}/subAccounts * * Also accepts auth: partner-key */ export const updateApiCorporateGroupUnlinkGroupIdSubAccounts = async (args: UpdateApiCorporateGroupUnlinkGroupIdSubAccountsArgs, options?: UpdateApiCorporateGroupUnlinkGroupIdSubAccountsOptions) => { const {baseUrl = "https://api.brevo.com/v3", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/corporate/group/unlink/${encodeURIComponent(String(args.groupId))}/subAccounts${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };