export type UpdateApiV1DomainsDomainIdComplianceProvidersProviderTogglePreviewScreeningArgs = {domainId: string, provider: 'ELLIPTIC' | 'CHAINALYSIS', enabled: boolean}; export type UpdateApiV1DomainsDomainIdComplianceProvidersProviderTogglePreviewScreeningOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enables or disables the preview screening for an existing provider connection * * PUT /v1/domains/{domainId}/compliance/providers/{provider}/toggle-preview-screening */ export const updateApiV1DomainsDomainIdComplianceProvidersProviderTogglePreviewScreening = async (args: UpdateApiV1DomainsDomainIdComplianceProvidersProviderTogglePreviewScreeningArgs, options: UpdateApiV1DomainsDomainIdComplianceProvidersProviderTogglePreviewScreeningOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.enabled != null) query.append("enabled", String(args.enabled)) if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/domains/${encodeURIComponent(String(args.domainId))}/compliance/providers/${encodeURIComponent(String(args.provider))}/toggle-preview-screening${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 };