export type PayScheduleAssignmentBody = {type: 'single' | 'hourly_salaried' | 'by_employee' | 'by_department' | null, hourly_pay_schedule_uuid?: string | undefined, salaried_pay_schedule_uuid?: string | undefined, default_pay_schedule_uuid?: string | undefined, partial_assignment?: boolean | undefined, employees?: (Array<{employee_uuid?: string | undefined, pay_schedule_uuid?: string | undefined}>) | undefined, departments?: (Array<{department_uuid?: string | undefined, pay_schedule_uuid?: string | undefined}>) | undefined}; export type CreateApiV1CompaniesCompanyIdPaySchedulesAssignArgs = {'X-Gusto-API-Version'?: '2026-06-15' | undefined, company_id: string, body: PayScheduleAssignmentBody}; export type CreateApiV1CompaniesCompanyIdPaySchedulesAssignOptions = {baseUrl?: string | undefined, CompanyAccessAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Assign pay schedules for a company * * POST /v1/companies/{company_id}/pay_schedules/assign */ export const createApiV1CompaniesCompanyIdPaySchedulesAssign = async (args: CreateApiV1CompaniesCompanyIdPaySchedulesAssignArgs, options?: CreateApiV1CompaniesCompanyIdPaySchedulesAssignOptions) => { const {baseUrl = "https://api.gusto-demo.com", fetch: fetchFn = fetch, CompanyAccessAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Gusto-API-Version'] != null) headers.set("X-Gusto-API-Version", String(args['X-Gusto-API-Version'])) if (CompanyAccessAuth !== undefined) headers.set('authorization', `Bearer ${CompanyAccessAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/companies/${encodeURIComponent(String(args.company_id))}/pay_schedules/assign${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 };