export type RemoveTrustCenterSubscriptionBody = {emails: Array, subscription_types?: Array | undefined}; export type CreateApiTrustExchangeTrustCenterSubscriptionRemoveArgs = {body: RemoveTrustCenterSubscriptionBody}; export type CreateApiTrustExchangeTrustCenterSubscriptionRemoveOptions = {baseUrl?: string | undefined, APIKeyInHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Trust Center subscribers * * POST /trust_exchange/trust_center/subscription/remove */ export const createApiTrustExchangeTrustCenterSubscriptionRemove = async (args: CreateApiTrustExchangeTrustCenterSubscriptionRemoveArgs, options?: CreateApiTrustExchangeTrustCenterSubscriptionRemoveOptions) => { const {baseUrl = "https://cyber-risk.upguard.com/api/public", fetch: fetchFn = fetch, APIKeyInHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIKeyInHeader !== undefined) headers.set("Authorization", APIKeyInHeader) const url = `${baseUrl.replace(/\/+$/, '')}/trust_exchange/trust_center/subscription/remove${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 };