import { ApiResponse , RequestOptions } from '../core' ; import { ListCashDrawerShiftEventsResponse , listCashDrawerShiftEventsResponseSchema , } from '../models/listCashDrawerShiftEventsResponse' ; import { ListCashDrawerShiftsResponse , listCashDrawerShiftsResponseSchema , } from '../models/listCashDrawerShiftsResponse' ; import { RetrieveCashDrawerShiftResponse , retrieveCashDrawerShiftResponseSchema , } from '../models/retrieveCashDrawerShiftResponse' ; import { number , optional , string } from '../schema' ; import { BaseApi } from './baseApi' ; export class CashDrawersApi extends BaseApi { param locationId param sortOrder param beginTime param endTime param limit param cursor return async listCashDrawerShifts ( locationId , sortOrder ? , beginTime ? , endTime ? , limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/cash-drawers/shifts' ) ; const mapped = req . prepareArgs ( { locationId : [ locationId , string ( ) ] , sortOrder : [ sortOrder , optional ( string ( ) ) ] , beginTime : [ beginTime , optional ( string ( ) ) ] , endTime : [ endTime , optional ( string ( ) ) ] , limit : [ limit , optional ( number ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'location_id' , mapped . locationId ) ; req . query ( 'sort_order' , mapped . sortOrder ) ; req . query ( 'begin_time' , mapped . beginTime ) ; req . query ( 'end_time' , mapped . endTime ) ; req . query ( 'limit' , mapped . limit ) ; req . query ( 'cursor' , mapped . cursor ) ; return req . callAsJson ( listCashDrawerShiftsResponseSchema , requestOptions ) ; } param locationId param shiftId return async retrieveCashDrawerShift ( locationId , shiftId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { locationId : [ locationId , string ( ) ] , shiftId : [ shiftId , string ( ) ] , } ) ; req . query ( 'location_id' , mapped . locationId ) ; req . appendTemplatePath `/v2/cash-drawers/shifts/${ mapped . shiftId }` ; return req . callAsJson ( retrieveCashDrawerShiftResponseSchema , requestOptions ) ; } param locationId param shiftId param limit param cursor return async listCashDrawerShiftEvents ( locationId , shiftId , limit ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { locationId : [ locationId , string ( ) ] , shiftId : [ shiftId , 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 ) ; req . appendTemplatePath `/v2/cash-drawers/shifts/${ mapped . shiftId }/events` ; return req . callAsJson ( listCashDrawerShiftEventsResponseSchema , requestOptions ) ; } }