export type GetApiCompaniesCompanyPaydaysCOPYArgs = {company: string, start?: string | undefined, processing_period?: ('four_day' | 'two_day' | 'one_day') | undefined}; export type GetApiCompaniesCompanyPaydaysCOPYOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get company paydays * * GET /companies/{company}/paydays (COPY) */ export const getApiCompaniesCompanyPaydaysCOPY = async (args: GetApiCompaniesCompanyPaydaysCOPYArgs, options?: GetApiCompaniesCompanyPaydaysCOPYOptions) => { const {baseUrl = "https://sandbox.checkhq.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.start != null) query.append("start", String(args.start)) if (args.processing_period != null) query.append("processing_period", String(args.processing_period)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/companies/${encodeURIComponent(String(args.company))}/paydays (COPY)${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };