export type DeleteApiResellerChildrenChildIdentifierDomainsDomainNameArgs = {childIdentifier: string, domainName: string}; export type DeleteApiResellerChildrenChildIdentifierDomainsDomainNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the sender domain of the reseller child based on the childIdentifier and domainName passed * * DELETE /reseller/children/{childIdentifier}/domains/{domainName} * * Also accepts auth: partner-key */ export const deleteApiResellerChildrenChildIdentifierDomainsDomainName = async (args: DeleteApiResellerChildrenChildIdentifierDomainsDomainNameArgs, options?: DeleteApiResellerChildrenChildIdentifierDomainsDomainNameOptions) => { 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))}/domains/${encodeURIComponent(String(args.domainName))}${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 };