export type GetApiEvereeV1ContractorsJobsArgs = {companyIntegrationId?: string | undefined, companyId?: number | undefined, search?: string | undefined, filter?: string | undefined, 'company-id': string}; export type GetApiEvereeV1ContractorsJobsOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /everee/v1/contractors/jobs */ export const getApiEvereeV1ContractorsJobs = async (args: GetApiEvereeV1ContractorsJobsArgs, options: GetApiEvereeV1ContractorsJobsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.companyIntegrationId != null) query.append("companyIntegrationId", String(args.companyIntegrationId)) if (args.companyId != null) query.append("companyId", String(args.companyId)) if (args.search != null) query.append("search", String(args.search)) if (args.filter != null) query.append("filter", String(args.filter)) if (args['company-id'] != null) headers.set("company-id", String(args['company-id'])) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/everee/v1/contractors/jobs${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 undefined };