import { ApiResponse , RequestOptions } from '../core' ; import { CreateBreakTypeRequest , createBreakTypeRequestSchema , } from '../models/createBreakTypeRequest' ; import { CreateBreakTypeResponse , createBreakTypeResponseSchema , } from '../models/createBreakTypeResponse' ; import { CreateShiftRequest , createShiftRequestSchema , } from '../models/createShiftRequest' ; import { CreateShiftResponse , createShiftResponseSchema , } from '../models/createShiftResponse' ; import { DeleteBreakTypeResponse , deleteBreakTypeResponseSchema , } from '../models/deleteBreakTypeResponse' ; import { DeleteShiftResponse , deleteShiftResponseSchema , } from '../models/deleteShiftResponse' ; import { GetBreakTypeResponse , getBreakTypeResponseSchema , } from '../models/getBreakTypeResponse' ; import { GetEmployeeWageResponse , getEmployeeWageResponseSchema , } from '../models/getEmployeeWageResponse' ; import { GetShiftResponse , getShiftResponseSchema , } from '../models/getShiftResponse' ; import { GetTeamMemberWageResponse , getTeamMemberWageResponseSchema , } from '../models/getTeamMemberWageResponse' ; import { ListBreakTypesResponse , listBreakTypesResponseSchema , } from '../models/listBreakTypesResponse' ; import { ListEmployeeWagesResponse , listEmployeeWagesResponseSchema , } from '../models/listEmployeeWagesResponse' ; import { ListTeamMemberWagesResponse , listTeamMemberWagesResponseSchema , } from '../models/listTeamMemberWagesResponse' ; import { ListWorkweekConfigsResponse , listWorkweekConfigsResponseSchema , } from '../models/listWorkweekConfigsResponse' ; import { SearchShiftsRequest , searchShiftsRequestSchema , } from '../models/searchShiftsRequest' ; import { SearchShiftsResponse , searchShiftsResponseSchema , } from '../models/searchShiftsResponse' ; import { UpdateBreakTypeRequest , updateBreakTypeRequestSchema , } from '../models/updateBreakTypeRequest' ; import { UpdateBreakTypeResponse , updateBreakTypeResponseSchema , } from '../models/updateBreakTypeResponse' ; import { UpdateShiftRequest , updateShiftRequestSchema , } from '../models/updateShiftRequest' ; import { UpdateShiftResponse , updateShiftResponseSchema , } from '../models/updateShiftResponse' ; import { UpdateWorkweekConfigRequest , updateWorkweekConfigRequestSchema , } from '../models/updateWorkweekConfigRequest' ; import { UpdateWorkweekConfigResponse , updateWorkweekConfigResponseSchema , } from '../models/updateWorkweekConfigResponse' ; import { number , optional , string } from '../schema' ; import { BaseApi } from './baseApi' ; export class LaborApi extends BaseApi { param locationId param limit param cursor return async listBreakTypes ( locationId ? , limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/labor/break-types' ) ; const mapped = req . prepareArgs ( { locationId : [ locationId , optional ( string ( ) ) ] , limit : [ limit , optional ( number ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'location_id' , mapped . locationId ) ; req . query ( 'limit' , mapped . limit ) ; req . query ( 'cursor' , mapped . cursor ) ; return req . callAsJson ( listBreakTypesResponseSchema , requestOptions ) ; } param body return async createBreakType ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/labor/break-types' ) ; const mapped = req . prepareArgs ( { body : [ body , createBreakTypeRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( createBreakTypeResponseSchema , requestOptions ) ; } param id return async deleteBreakType ( id , requestOptions ? ) { const req = this . createRequest ( 'DELETE' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/break-types/${ mapped . id }` ; return req . callAsJson ( deleteBreakTypeResponseSchema , requestOptions ) ; } param id return async getBreakType ( id , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/break-types/${ mapped . id }` ; return req . callAsJson ( getBreakTypeResponseSchema , requestOptions ) ; } param id param body return async updateBreakType ( id , body , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] , body : [ body , updateBreakTypeRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/labor/break-types/${ mapped . id }` ; return req . callAsJson ( updateBreakTypeResponseSchema , requestOptions ) ; } param employeeId param limit param cursor return deprecated async listEmployeeWages ( employeeId ? , limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/labor/employee-wages' ) ; const mapped = req . prepareArgs ( { employeeId : [ employeeId , optional ( string ( ) ) ] , limit : [ limit , optional ( number ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'employee_id' , mapped . employeeId ) ; req . query ( 'limit' , mapped . limit ) ; req . query ( 'cursor' , mapped . cursor ) ; req . deprecated ( 'LaborApi.listEmployeeWages' ) ; return req . callAsJson ( listEmployeeWagesResponseSchema , requestOptions ) ; } param id return deprecated async getEmployeeWage ( id , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/employee-wages/${ mapped . id }` ; req . deprecated ( 'LaborApi.getEmployeeWage' ) ; return req . callAsJson ( getEmployeeWageResponseSchema , requestOptions ) ; } param body return async createShift ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/labor/shifts' ) ; const mapped = req . prepareArgs ( { body : [ body , createShiftRequestSchema ] } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( createShiftResponseSchema , requestOptions ) ; } param body return async searchShifts ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/labor/shifts/search' ) ; const mapped = req . prepareArgs ( { body : [ body , searchShiftsRequestSchema ] } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( searchShiftsResponseSchema , requestOptions ) ; } param id return async deleteShift ( id , requestOptions ? ) { const req = this . createRequest ( 'DELETE' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/shifts/${ mapped . id }` ; return req . callAsJson ( deleteShiftResponseSchema , requestOptions ) ; } param id return async getShift ( id , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/shifts/${ mapped . id }` ; return req . callAsJson ( getShiftResponseSchema , requestOptions ) ; } param id param body return async updateShift ( id , body , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] , body : [ body , updateShiftRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/labor/shifts/${ mapped . id }` ; return req . callAsJson ( updateShiftResponseSchema , requestOptions ) ; } param teamMemberId param limit param cursor return async listTeamMemberWages ( teamMemberId ? , limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/labor/team-member-wages' ) ; const mapped = req . prepareArgs ( { teamMemberId : [ teamMemberId , optional ( string ( ) ) ] , limit : [ limit , optional ( number ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'team_member_id' , mapped . teamMemberId ) ; req . query ( 'limit' , mapped . limit ) ; req . query ( 'cursor' , mapped . cursor ) ; return req . callAsJson ( listTeamMemberWagesResponseSchema , requestOptions ) ; } param id return async getTeamMemberWage ( id , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] } ) ; req . appendTemplatePath `/v2/labor/team-member-wages/${ mapped . id }` ; return req . callAsJson ( getTeamMemberWageResponseSchema , requestOptions ) ; } param limit param cursor return async listWorkweekConfigs ( limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/labor/workweek-configs' ) ; const mapped = req . prepareArgs ( { limit : [ limit , optional ( number ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'limit' , mapped . limit ) ; req . query ( 'cursor' , mapped . cursor ) ; return req . callAsJson ( listWorkweekConfigsResponseSchema , requestOptions ) ; } param id param body return async updateWorkweekConfig ( id , body , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { id : [ id , string ( ) ] , body : [ body , updateWorkweekConfigRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/labor/workweek-configs/${ mapped . id }` ; return req . callAsJson ( updateWorkweekConfigResponseSchema , requestOptions ) ; } }