import { ApiResponse , RequestOptions } from '../core' ; import { BulkCreateTeamMembersRequest , bulkCreateTeamMembersRequestSchema , } from '../models/bulkCreateTeamMembersRequest' ; import { BulkCreateTeamMembersResponse , bulkCreateTeamMembersResponseSchema , } from '../models/bulkCreateTeamMembersResponse' ; import { BulkUpdateTeamMembersRequest , bulkUpdateTeamMembersRequestSchema , } from '../models/bulkUpdateTeamMembersRequest' ; import { BulkUpdateTeamMembersResponse , bulkUpdateTeamMembersResponseSchema , } from '../models/bulkUpdateTeamMembersResponse' ; import { CreateTeamMemberRequest , createTeamMemberRequestSchema , } from '../models/createTeamMemberRequest' ; import { CreateTeamMemberResponse , createTeamMemberResponseSchema , } from '../models/createTeamMemberResponse' ; import { RetrieveTeamMemberResponse , retrieveTeamMemberResponseSchema , } from '../models/retrieveTeamMemberResponse' ; import { RetrieveWageSettingResponse , retrieveWageSettingResponseSchema , } from '../models/retrieveWageSettingResponse' ; import { SearchTeamMembersRequest , searchTeamMembersRequestSchema , } from '../models/searchTeamMembersRequest' ; import { SearchTeamMembersResponse , searchTeamMembersResponseSchema , } from '../models/searchTeamMembersResponse' ; import { UpdateTeamMemberRequest , updateTeamMemberRequestSchema , } from '../models/updateTeamMemberRequest' ; import { UpdateTeamMemberResponse , updateTeamMemberResponseSchema , } from '../models/updateTeamMemberResponse' ; import { UpdateWageSettingRequest , updateWageSettingRequestSchema , } from '../models/updateWageSettingRequest' ; import { UpdateWageSettingResponse , updateWageSettingResponseSchema , } from '../models/updateWageSettingResponse' ; import { string } from '../schema' ; import { BaseApi } from './baseApi' ; export class TeamApi extends BaseApi { param body return async createTeamMember ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/team-members' ) ; const mapped = req . prepareArgs ( { body : [ body , createTeamMemberRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( createTeamMemberResponseSchema , requestOptions ) ; } param body return async bulkCreateTeamMembers ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/team-members/bulk-create' ) ; const mapped = req . prepareArgs ( { body : [ body , bulkCreateTeamMembersRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( bulkCreateTeamMembersResponseSchema , requestOptions ) ; } param body return async bulkUpdateTeamMembers ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/team-members/bulk-update' ) ; const mapped = req . prepareArgs ( { body : [ body , bulkUpdateTeamMembersRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( bulkUpdateTeamMembersResponseSchema , requestOptions ) ; } param body return async searchTeamMembers ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/team-members/search' ) ; const mapped = req . prepareArgs ( { body : [ body , searchTeamMembersRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( searchTeamMembersResponseSchema , requestOptions ) ; } param teamMemberId return async retrieveTeamMember ( teamMemberId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { teamMemberId : [ teamMemberId , string ( ) ] } ) ; req . appendTemplatePath `/v2/team-members/${ mapped . teamMemberId }` ; return req . callAsJson ( retrieveTeamMemberResponseSchema , requestOptions ) ; } param teamMemberId param body return async updateTeamMember ( teamMemberId , body , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { teamMemberId : [ teamMemberId , string ( ) ] , body : [ body , updateTeamMemberRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/team-members/${ mapped . teamMemberId }` ; return req . callAsJson ( updateTeamMemberResponseSchema , requestOptions ) ; } param teamMemberId return async retrieveWageSetting ( teamMemberId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { teamMemberId : [ teamMemberId , string ( ) ] } ) ; req . appendTemplatePath `/v2/team-members/${ mapped . teamMemberId }/wage-setting` ; return req . callAsJson ( retrieveWageSettingResponseSchema , requestOptions ) ; } param teamMemberId param body return async updateWageSetting ( teamMemberId , body , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { teamMemberId : [ teamMemberId , string ( ) ] , body : [ body , updateWageSettingRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . appendTemplatePath `/v2/team-members/${ mapped . teamMemberId }/wage-setting` ; return req . callAsJson ( updateWageSettingResponseSchema , requestOptions ) ; } }