export type UpdateApiV1DomainsDomainIdComplianceProvidersProviderPauseConnectionArgs = {domainId: string, provider: 'ELLIPTIC' | 'CHAINALYSIS' | 'NOTABENE', paused: boolean}; export type UpdateApiV1DomainsDomainIdComplianceProvidersProviderPauseConnectionOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Pause/unpause an existing external provider connection * * PUT /v1/domains/{domainId}/compliance/providers/{provider}/pause-connection */ export const updateApiV1DomainsDomainIdComplianceProvidersProviderPauseConnection = async (args: UpdateApiV1DomainsDomainIdComplianceProvidersProviderPauseConnectionArgs, options: UpdateApiV1DomainsDomainIdComplianceProvidersProviderPauseConnectionOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.paused != null) query.append("paused", String(args.paused)) if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/domains/${encodeURIComponent(String(args.domainId))}/compliance/providers/${encodeURIComponent(String(args.provider))}/pause-connection${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };