export type DeleteApiResellerChildrenChildIdentifierArgs = {childIdentifier: string}; export type DeleteApiResellerChildrenChildIdentifierOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a single reseller child based on the child identifier supplied * * DELETE /reseller/children/{childIdentifier} * * Also accepts auth: partner-key */ export const deleteApiResellerChildrenChildIdentifier = async (args: DeleteApiResellerChildrenChildIdentifierArgs, options?: DeleteApiResellerChildrenChildIdentifierOptions) => { const {baseUrl = "https://api.brevo.com/v3", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/reseller/children/${encodeURIComponent(String(args.childIdentifier))}${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 };