export type AccountID = number; export type ProjectID = string; export type UserID = string; export type TargetGroupID = string; export type TargetGroupIds = Array; export type CreateBulkUpdateTargetGroupProjectManagerJobRequest = {project_manager_id?: UserID | undefined, target_group_ids?: TargetGroupIds | undefined}; export type CreateApiDemandAccountsAccountIdProjectsProjectIdBatchJobsUpdateTargetGroupProjectManagersArgs = {account_id: AccountID, project_id: ProjectID, body: CreateBulkUpdateTargetGroupProjectManagerJobRequest}; export type CreateApiDemandAccountsAccountIdProjectsProjectIdBatchJobsUpdateTargetGroupProjectManagersOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a bulk update target group project managers job * * POST /demand/accounts/{account_id}/projects/{project_id}/batch-jobs/update-target-group-project-managers */ export const createApiDemandAccountsAccountIdProjectsProjectIdBatchJobsUpdateTargetGroupProjectManagers = async (args: CreateApiDemandAccountsAccountIdProjectsProjectIdBatchJobsUpdateTargetGroupProjectManagersArgs, options?: CreateApiDemandAccountsAccountIdProjectsProjectIdBatchJobsUpdateTargetGroupProjectManagersOptions) => { const {baseUrl = "https://api.cint.com/v1", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/demand/accounts/${encodeURIComponent(String(args.account_id))}/projects/${encodeURIComponent(String(args.project_id))}/batch-jobs/update-target-group-project-managers${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 };