export type GetApiV1OrganizationsEmployeesCustomFieldsArgs = {body: {RAW_BODY?: string | undefined}}; export type GetApiV1OrganizationsEmployeesCustomFieldsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get custom fields details * * GET /v1/organizations/employees/custom_fields */ export const getApiV1OrganizationsEmployeesCustomFields = async (args: GetApiV1OrganizationsEmployeesCustomFieldsArgs, options?: GetApiV1OrganizationsEmployeesCustomFieldsOptions) => { const {baseUrl = "https://api.zenoti.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/employees/custom_fields${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", 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 (await res.json()) as unknown };