export type CreateApiRestApiV1AccountsAccountIdMonitorOnlySlavesCopierArgs = {accountId: string}; export type CreateApiRestApiV1AccountsAccountIdMonitorOnlySlavesCopierOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set all copiers of all slave accounts to monitor-only mode * * POST /rest/api/v1/accounts/{accountId}/monitorOnlySlavesCopier */ export const createApiRestApiV1AccountsAccountIdMonitorOnlySlavesCopier = async (args: CreateApiRestApiV1AccountsAccountIdMonitorOnlySlavesCopierArgs, options?: CreateApiRestApiV1AccountsAccountIdMonitorOnlySlavesCopierOptions) => { const {baseUrl = "https://api.metacopier.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-API-KEY", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/rest/api/v1/accounts/${encodeURIComponent(String(args.accountId))}/monitorOnlySlavesCopier${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };