export type CreateApiPhrVVersionWebhookSyncChecksCompanyIntegrationIdEmployeeIdYearMonthArgs = {companyIntegrationId: string, employeeId: string, year: number, month: number, version: string, 'company-id': string}; export type CreateApiPhrVVersionWebhookSyncChecksCompanyIntegrationIdEmployeeIdYearMonthOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /phr/v{version}/Webhook/SyncChecks/{companyIntegrationId}/{employeeId}/{year}/{month} */ export const createApiPhrVVersionWebhookSyncChecksCompanyIntegrationIdEmployeeIdYearMonth = async (args: CreateApiPhrVVersionWebhookSyncChecksCompanyIntegrationIdEmployeeIdYearMonthArgs, options: CreateApiPhrVVersionWebhookSyncChecksCompanyIntegrationIdEmployeeIdYearMonthOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['company-id'] != null) headers.set("company-id", String(args['company-id'])) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/phr/v${encodeURIComponent(String(args.version))}/Webhook/SyncChecks/${encodeURIComponent(String(args.companyIntegrationId))}/${encodeURIComponent(String(args.employeeId))}/${encodeURIComponent(String(args.year))}/${encodeURIComponent(String(args.month))}${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 };