export type TesterGroupsSchemasBulkImportSchema = {emails: Array}; export type CreateApiApiV3TesterGroupsTesterGroupIdContactsArgs = {tester_group_id: string, body: TesterGroupsSchemasBulkImportSchema}; export type CreateApiApiV3TesterGroupsTesterGroupIdContactsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Bulk import contacts to the tester group * * POST /api/v3/tester-groups/{tester_group_id}/contacts */ export const createApiApiV3TesterGroupsTesterGroupIdContacts = async (args: CreateApiApiV3TesterGroupsTesterGroupIdContactsArgs, options?: CreateApiApiV3TesterGroupsTesterGroupIdContactsOptions) => { const {baseUrl = "https://codemagic.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("x-auth-token", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/tester-groups/${encodeURIComponent(String(args.tester_group_id))}/contacts${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 };