UNPKG

tuix-timesheets-api

Version:

This package facilitates the client request to tuix timesheets api

1,416 lines (1,162 loc) 157 kB
/* tslint:disable */ /* eslint-disable */ /** * Tuix Services * Tuix Services API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { AccountInfoDTO, AdjustedTimesheetDTO, AdjustedTimesheetEntryDTO, AdjustedTimesheetUpadateEntryDTO, ClientDTO, CompanyDTO, CreateEmployeeInvoiceInputDTO, CreateGithubUserDto, CreateJiraAccountDto, CreateJiraUserDto, CreateSubscriptionDTO, CreateUserDto, EmailTemplates, EmployeeDTO, EmployeeInvoiceDTO, EmployeeUpdateDTO, ErrorDTO, GithubAccountDto, GithubCommitCountDTO, GithubUserDto, GlobalTimesheetDTO, GlobalTimesheetEntryDTO, GlobalTimesheetEntryUpdateDTO, HolidayCreateDTO, HolidayDTO, JiraAccountDto, JiraUserDto, PaginatedAdjustedTimesheets, PaginatedClientInvoices, PaginatedClients, PaginatedEmployeeInvoices, PaginatedEmployeeProjects, PaginatedEmployees, PaginatedGlobalTimesheets, PaginatedHolidaysDTO, PaginatedProjects, PaginatedTimesheets, PaginatedUsers, PdfTemplateDTO, ProjectDTO, ProjectInputDTO, ProjectUpdateDTO, SDKTestRequestDTO, SDKTestResponseDTO, SendNewsletterDto, SlackAccountReponseDto, SlackUserDto, Subscription, SubscriptionsSentResponseDto, TeamUpdateDTO, TimesheetDTO, TimesheetEntryUpdateDTO, UpdateUserDto, UserDTOSc, UserInputDTOSc, UserUpdateDTOSc, } from '../models/index'; import { AccountInfoDTOFromJSON, AccountInfoDTOToJSON, AdjustedTimesheetDTOFromJSON, AdjustedTimesheetDTOToJSON, AdjustedTimesheetEntryDTOFromJSON, AdjustedTimesheetEntryDTOToJSON, AdjustedTimesheetUpadateEntryDTOFromJSON, AdjustedTimesheetUpadateEntryDTOToJSON, ClientDTOFromJSON, ClientDTOToJSON, CompanyDTOFromJSON, CompanyDTOToJSON, CreateEmployeeInvoiceInputDTOFromJSON, CreateEmployeeInvoiceInputDTOToJSON, CreateGithubUserDtoFromJSON, CreateGithubUserDtoToJSON, CreateJiraAccountDtoFromJSON, CreateJiraAccountDtoToJSON, CreateJiraUserDtoFromJSON, CreateJiraUserDtoToJSON, CreateSubscriptionDTOFromJSON, CreateSubscriptionDTOToJSON, CreateUserDtoFromJSON, CreateUserDtoToJSON, EmailTemplatesFromJSON, EmailTemplatesToJSON, EmployeeDTOFromJSON, EmployeeDTOToJSON, EmployeeInvoiceDTOFromJSON, EmployeeInvoiceDTOToJSON, EmployeeUpdateDTOFromJSON, EmployeeUpdateDTOToJSON, ErrorDTOFromJSON, ErrorDTOToJSON, GithubAccountDtoFromJSON, GithubAccountDtoToJSON, GithubCommitCountDTOFromJSON, GithubCommitCountDTOToJSON, GithubUserDtoFromJSON, GithubUserDtoToJSON, GlobalTimesheetDTOFromJSON, GlobalTimesheetDTOToJSON, GlobalTimesheetEntryDTOFromJSON, GlobalTimesheetEntryDTOToJSON, GlobalTimesheetEntryUpdateDTOFromJSON, GlobalTimesheetEntryUpdateDTOToJSON, HolidayCreateDTOFromJSON, HolidayCreateDTOToJSON, HolidayDTOFromJSON, HolidayDTOToJSON, JiraAccountDtoFromJSON, JiraAccountDtoToJSON, JiraUserDtoFromJSON, JiraUserDtoToJSON, PaginatedAdjustedTimesheetsFromJSON, PaginatedAdjustedTimesheetsToJSON, PaginatedClientInvoicesFromJSON, PaginatedClientInvoicesToJSON, PaginatedClientsFromJSON, PaginatedClientsToJSON, PaginatedEmployeeInvoicesFromJSON, PaginatedEmployeeInvoicesToJSON, PaginatedEmployeeProjectsFromJSON, PaginatedEmployeeProjectsToJSON, PaginatedEmployeesFromJSON, PaginatedEmployeesToJSON, PaginatedGlobalTimesheetsFromJSON, PaginatedGlobalTimesheetsToJSON, PaginatedHolidaysDTOFromJSON, PaginatedHolidaysDTOToJSON, PaginatedProjectsFromJSON, PaginatedProjectsToJSON, PaginatedTimesheetsFromJSON, PaginatedTimesheetsToJSON, PaginatedUsersFromJSON, PaginatedUsersToJSON, PdfTemplateDTOFromJSON, PdfTemplateDTOToJSON, ProjectDTOFromJSON, ProjectDTOToJSON, ProjectInputDTOFromJSON, ProjectInputDTOToJSON, ProjectUpdateDTOFromJSON, ProjectUpdateDTOToJSON, SDKTestRequestDTOFromJSON, SDKTestRequestDTOToJSON, SDKTestResponseDTOFromJSON, SDKTestResponseDTOToJSON, SendNewsletterDtoFromJSON, SendNewsletterDtoToJSON, SlackAccountReponseDtoFromJSON, SlackAccountReponseDtoToJSON, SlackUserDtoFromJSON, SlackUserDtoToJSON, SubscriptionFromJSON, SubscriptionToJSON, SubscriptionsSentResponseDtoFromJSON, SubscriptionsSentResponseDtoToJSON, TeamUpdateDTOFromJSON, TeamUpdateDTOToJSON, TimesheetDTOFromJSON, TimesheetDTOToJSON, TimesheetEntryUpdateDTOFromJSON, TimesheetEntryUpdateDTOToJSON, UpdateUserDtoFromJSON, UpdateUserDtoToJSON, UserDTOScFromJSON, UserDTOScToJSON, UserInputDTOScFromJSON, UserInputDTOScToJSON, UserUpdateDTOScFromJSON, UserUpdateDTOScToJSON, } from '../models/index'; export interface AddJiraAccountRequest { createJiraAccountDto: CreateJiraAccountDto; } export interface ApproveAdjustedTimesheetRequest { projectId: string; timesheetId: string; } export interface ApproveGlobalTimesheetRequest { projectId: string; timesheetId: string; } export interface ApproveTimesheetRequest { projectId: string; timesheetId: string; } export interface CreateClientRequest { clientDTO: ClientDTO; } export interface CreateCompanyRequest { companyDTO: CompanyDTO; } export interface CreateEmployeeInvoiceRequest { employeeId: string; createEmployeeInvoiceInputDTO: CreateEmployeeInvoiceInputDTO; } export interface CreateGithubUserRequest { createGithubUserDto: CreateGithubUserDto; } export interface CreateHolidayRequest { holidayCreateDTO: HolidayCreateDTO; } export interface CreateJiraUserRequest { createJiraUserDto: CreateJiraUserDto; } export interface CreateProjectRequest { projectInputDTO: ProjectInputDTO; } export interface CreateSlackUserRequest { createUserDto: CreateUserDto; } export interface CreateSubscriptionRequest { createSubscriptionDTO: CreateSubscriptionDTO; } export interface CreateUserRequest { userInputDTOSc: UserInputDTOSc; } export interface DeleteClientRequest { clientId: string; } export interface DeleteCompanyRequest { companyId: string; } export interface DeleteEmployeeRequest { employeeId: string; } export interface DeleteHolidayRequest { holidayId: string; } export interface DeleteProjectRequest { projectId: string; } export interface DeleteSubscriptionRequest { id: string; } export interface DeleteUserRequest { id: string; } export interface DownloadAdjustedTimesheetPdfRequest { projectId: string; timesheetId: string; } export interface DownloadClientInvoicePdfRequest { invoiceId: string; clientId: string; } export interface DownloadEmployeeInvoicePdfRequest { employeeId: string; employeeInvoiceId: string; } export interface DownloadGlobalTimesheetPdfRequest { projectId: string; timesheetId: string; } export interface DownloadTimesheetPdfRequest { projectId: string; timesheetId: string; } export interface EmployeesControllerGetCommitsByUserIdRequest { from: Date; to: Date; groupBy: EmployeesControllerGetCommitsByUserIdGroupByEnum; employeeId: any; } export interface EmployeesControllerGetMyCommitsRequest { from: Date; to: Date; groupBy: EmployeesControllerGetMyCommitsGroupByEnum; } export interface EmployeesEmployeeIdGetRequest { employeeId: string; } export interface GetAdjustedTimesheetRequest { projectId: string; timesheetId: string; } export interface GetAdjustedTimesheetsRequest { projectId: string; page?: number; pageSize?: number; } export interface GetClientByIdRequest { clientId: string; } export interface GetClientInvoicesRequest { clientId: string; page?: number; pageSize?: number; } export interface GetClientsRequest { page?: number; pageSize?: number; } export interface GetCompanyRequest { companyId: string; } export interface GetEmployeeInvoicesRequest { employeeId: string; page?: number; pageSize?: number; } export interface GetEmployeeTimesheetsRequest { projectId: string; page?: number; pageSize?: number; } export interface GetEmployeesRequest { page?: number; pageSize?: number; activated?: boolean; } export interface GetGlobalTimesheetRequest { projectId: string; timesheetId: string; } export interface GetGlobalTimesheetsRequest { projectId: string; page?: number; pageSize?: number; } export interface GetHolidaysRequest { page?: number; pageSize?: number; } export interface GetHolidaysByEmployeeRequest { employeeId: string; page?: number; pageSize?: number; } export interface GetPdfTemplateRequest { id: string; } export interface GetProjectByIdRequest { projectId: string; } export interface GetProjectsRequest { page?: number; pageSize?: number; } export interface GetProjectsAsEmployeeRequest { page?: number; pageSize?: number; } export interface GetTeamRequest { projectId: string; page?: number; pageSize?: number; } export interface GetTemplateByIdRequest { id: string; } export interface GetTimesheetRequest { projectId: string; timesheetId: string; } export interface GetTimesheetsRequest { projectId: string; page?: number; pageSize?: number; } export interface GetUserByIdRequest { id: string; } export interface InviteEmployeeRequest { employeeDTO: EmployeeDTO; } export interface OpenSentTimesheetRequest { projectId: string; timesheetId: string; } export interface RemoveJiraAccountRequest { jiraAccountId: string; } export interface SdkTestRequest { sDKTestRequestDTO: SDKTestRequestDTO; } export interface SendEmailRequest { from: string; to: string; subject: string; templateUUID: string; body?: string; data?: string; file?: Blob; } export interface SendNewsletterToSubscribersRequest { sendNewsletterDto: SendNewsletterDto; } export interface SendTimesheetRequest { projectId: string; timesheetId: string; } export interface UpdateAdjustedEntryRequest { projectId: string; timesheetId: string; entryId: string; adjustedTimesheetUpadateEntryDTO: AdjustedTimesheetUpadateEntryDTO; } export interface UpdateClientRequest { clientId: string; clientDTO: ClientDTO; } export interface UpdateCompanyRequest { companyId: string; companyDTO: CompanyDTO; } export interface UpdateEmployeeDataRequest { employeeId: string; employeeUpdateDTO: EmployeeUpdateDTO; } export interface UpdateGlobalTimesheetEntryRequest { projectId: string; timesheetId: string; entryId: string; globalTimesheetEntryUpdateDTO: GlobalTimesheetEntryUpdateDTO; } export interface UpdateProjectRequest { projectId: string; projectUpdateDTO: ProjectUpdateDTO; } export interface UpdateSlackbotUserRequest { userId: string; updateUserDto: UpdateUserDto; } export interface UpdateTeamRequest { projectId: string; teamUpdateDTO: TeamUpdateDTO; } export interface UpdateTimesheetEntryRequest { projectId: string; timesheetId: string; entryId: string; timesheetEntryUpdateDTO: TimesheetEntryUpdateDTO; } export interface UpdateUserRequest { id: string; userUpdateDTOSc: UserUpdateDTOSc; } export interface UploadPdfTemplateRequest { file: Blob; name: string; } export interface UploadTemplateRequest { name: string; file: Blob; } /** * */ export class TuixTimesheetsClientApi extends runtime.BaseAPI { /** * Add a new jira account to the user */ async addJiraAccountRaw(requestParameters: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraAccountDto>> { if (requestParameters.createJiraAccountDto === null || requestParameters.createJiraAccountDto === undefined) { throw new runtime.RequiredError('createJiraAccountDto','Required parameter requestParameters.createJiraAccountDto was null or undefined when calling addJiraAccount.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/jira-users/jira-accounts`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateJiraAccountDtoToJSON(requestParameters.createJiraAccountDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => JiraAccountDtoFromJSON(jsonValue)); } /** * Add a new jira account to the user */ async addJiraAccount(requestParameters: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraAccountDto> { const response = await this.addJiraAccountRaw(requestParameters, initOverrides); return await response.value(); } /** * Aprove an adjustedTimesheet in a project * Aprove an adjustedTimesheet in a project */ async approveAdjustedTimesheetRaw(requestParameters: ApproveAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveAdjustedTimesheet.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveAdjustedTimesheet.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}/adjusted-timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))), method: 'PATCH', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Aprove an adjustedTimesheet in a project * Aprove an adjustedTimesheet in a project */ async approveAdjustedTimesheet(requestParameters: ApproveAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.approveAdjustedTimesheetRaw(requestParameters, initOverrides); } /** * Approve a global timesheet * Approve a global timesheet */ async approveGlobalTimesheetRaw(requestParameters: ApproveGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveGlobalTimesheet.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveGlobalTimesheet.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}/global-timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))), method: 'PATCH', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Approve a global timesheet * Approve a global timesheet */ async approveGlobalTimesheet(requestParameters: ApproveGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.approveGlobalTimesheetRaw(requestParameters, initOverrides); } /** * Approve a timesheet * Approve a timesheet */ async approveTimesheetRaw(requestParameters: ApproveTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveTimesheet.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveTimesheet.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}/timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))), method: 'PATCH', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Approve a timesheet * Approve a timesheet */ async approveTimesheet(requestParameters: ApproveTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.approveTimesheetRaw(requestParameters, initOverrides); } /** * Create client */ async createClientRaw(requestParameters: CreateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientDTO>> { if (requestParameters.clientDTO === null || requestParameters.clientDTO === undefined) { throw new runtime.RequiredError('clientDTO','Required parameter requestParameters.clientDTO was null or undefined when calling createClient.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/clients`, method: 'POST', headers: headerParameters, query: queryParameters, body: ClientDTOToJSON(requestParameters.clientDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ClientDTOFromJSON(jsonValue)); } /** * Create client */ async createClient(requestParameters: CreateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientDTO> { const response = await this.createClientRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a company * Creates a new company */ async createCompanyRaw(requestParameters: CreateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompanyDTO>> { if (requestParameters.companyDTO === null || requestParameters.companyDTO === undefined) { throw new runtime.RequiredError('companyDTO','Required parameter requestParameters.companyDTO was null or undefined when calling createCompany.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/companies`, method: 'POST', headers: headerParameters, query: queryParameters, body: CompanyDTOToJSON(requestParameters.companyDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => CompanyDTOFromJSON(jsonValue)); } /** * Create a company * Creates a new company */ async createCompany(requestParameters: CreateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompanyDTO> { const response = await this.createCompanyRaw(requestParameters, initOverrides); return await response.value(); } /** * Create an employee invoice * Create an employee invoice */ async createEmployeeInvoiceRaw(requestParameters: CreateEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeInvoiceDTO>> { if (requestParameters.employeeId === null || requestParameters.employeeId === undefined) { throw new runtime.RequiredError('employeeId','Required parameter requestParameters.employeeId was null or undefined when calling createEmployeeInvoice.'); } if (requestParameters.createEmployeeInvoiceInputDTO === null || requestParameters.createEmployeeInvoiceInputDTO === undefined) { throw new runtime.RequiredError('createEmployeeInvoiceInputDTO','Required parameter requestParameters.createEmployeeInvoiceInputDTO was null or undefined when calling createEmployeeInvoice.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/employees/{employeeId}/invoices`.replace(`{${"employeeId"}}`, encodeURIComponent(String(requestParameters.employeeId))), method: 'POST', headers: headerParameters, query: queryParameters, body: CreateEmployeeInvoiceInputDTOToJSON(requestParameters.createEmployeeInvoiceInputDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeInvoiceDTOFromJSON(jsonValue)); } /** * Create an employee invoice * Create an employee invoice */ async createEmployeeInvoice(requestParameters: CreateEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmployeeInvoiceDTO> { const response = await this.createEmployeeInvoiceRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createGithubUserRaw(requestParameters: CreateGithubUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GithubUserDto>> { if (requestParameters.createGithubUserDto === null || requestParameters.createGithubUserDto === undefined) { throw new runtime.RequiredError('createGithubUserDto','Required parameter requestParameters.createGithubUserDto was null or undefined when calling createGithubUser.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/github-users`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateGithubUserDtoToJSON(requestParameters.createGithubUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => GithubUserDtoFromJSON(jsonValue)); } /** * */ async createGithubUser(requestParameters: CreateGithubUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GithubUserDto> { const response = await this.createGithubUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Allows a user to add a holiday */ async createHolidayRaw(requestParameters: CreateHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HolidayDTO>> { if (requestParameters.holidayCreateDTO === null || requestParameters.holidayCreateDTO === undefined) { throw new runtime.RequiredError('holidayCreateDTO','Required parameter requestParameters.holidayCreateDTO was null or undefined when calling createHoliday.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/holidays`, method: 'POST', headers: headerParameters, query: queryParameters, body: HolidayCreateDTOToJSON(requestParameters.holidayCreateDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => HolidayDTOFromJSON(jsonValue)); } /** * Allows a user to add a holiday */ async createHoliday(requestParameters: CreateHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HolidayDTO> { const response = await this.createHolidayRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a new user */ async createJiraUserRaw(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraUserDto>> { if (requestParameters.createJiraUserDto === null || requestParameters.createJiraUserDto === undefined) { throw new runtime.RequiredError('createJiraUserDto','Required parameter requestParameters.createJiraUserDto was null or undefined when calling createJiraUser.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/jira-users`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateJiraUserDtoToJSON(requestParameters.createJiraUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => JiraUserDtoFromJSON(jsonValue)); } /** * Create a new user */ async createJiraUser(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraUserDto> { const response = await this.createJiraUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a project * Creates a new project */ async createProjectRaw(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDTO>> { if (requestParameters.projectInputDTO === null || requestParameters.projectInputDTO === undefined) { throw new runtime.RequiredError('projectInputDTO','Required parameter requestParameters.projectInputDTO was null or undefined when calling createProject.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects`, method: 'POST', headers: headerParameters, query: queryParameters, body: ProjectInputDTOToJSON(requestParameters.projectInputDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProjectDTOFromJSON(jsonValue)); } /** * Create a project * Creates a new project */ async createProject(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDTO> { const response = await this.createProjectRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createSlackUserRaw(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackAccountReponseDto>> { if (requestParameters.createUserDto === null || requestParameters.createUserDto === undefined) { throw new runtime.RequiredError('createUserDto','Required parameter requestParameters.createUserDto was null or undefined when calling createSlackUser.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/slackbot-users`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateUserDtoToJSON(requestParameters.createUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => SlackAccountReponseDtoFromJSON(jsonValue)); } /** * */ async createSlackUser(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackAccountReponseDto> { const response = await this.createSlackUserRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createSubscriptionRaw(requestParameters: CreateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subscription>> { if (requestParameters.createSubscriptionDTO === null || requestParameters.createSubscriptionDTO === undefined) { throw new runtime.RequiredError('createSubscriptionDTO','Required parameter requestParameters.createSubscriptionDTO was null or undefined when calling createSubscription.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; const response = await this.request({ path: `/subscriptions`, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateSubscriptionDTOToJSON(requestParameters.createSubscriptionDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionFromJSON(jsonValue)); } /** * */ async createSubscription(requestParameters: CreateSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subscription> { const response = await this.createSubscriptionRaw(requestParameters, initOverrides); return await response.value(); } /** * Create user * Create a user */ async createUserRaw(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserDTOSc>> { if (requestParameters.userInputDTOSc === null || requestParameters.userInputDTOSc === undefined) { throw new runtime.RequiredError('userInputDTOSc','Required parameter requestParameters.userInputDTOSc was null or undefined when calling createUser.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/test-users`, method: 'POST', headers: headerParameters, query: queryParameters, body: UserInputDTOScToJSON(requestParameters.userInputDTOSc), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => UserDTOScFromJSON(jsonValue)); } /** * Create user * Create a user */ async createUser(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserDTOSc> { const response = await this.createUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Delete client */ async deleteClientRaw(requestParameters: DeleteClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.clientId === null || requestParameters.clientId === undefined) { throw new runtime.RequiredError('clientId','Required parameter requestParameters.clientId was null or undefined when calling deleteClient.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/clients/{clientId}`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete client */ async deleteClient(requestParameters: DeleteClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteClientRaw(requestParameters, initOverrides); } /** * Delete a company * delete a company */ async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.companyId === null || requestParameters.companyId === undefined) { throw new runtime.RequiredError('companyId','Required parameter requestParameters.companyId was null or undefined when calling deleteCompany.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters.companyId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete a company * delete a company */ async deleteCompany(requestParameters: DeleteCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteCompanyRaw(requestParameters, initOverrides); } /** * Delete an employee * Delete an employee */ async deleteEmployeeRaw(requestParameters: DeleteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.employeeId === null || requestParameters.employeeId === undefined) { throw new runtime.RequiredError('employeeId','Required parameter requestParameters.employeeId was null or undefined when calling deleteEmployee.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/employees/{employeeId}`.replace(`{${"employeeId"}}`, encodeURIComponent(String(requestParameters.employeeId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete an employee * Delete an employee */ async deleteEmployee(requestParameters: DeleteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteEmployeeRaw(requestParameters, initOverrides); } /** * */ async deleteGithubUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/github-users`, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * */ async deleteGithubUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteGithubUserRaw(initOverrides); } /** * Delete a holiday * delete a holiday */ async deleteHolidayRaw(requestParameters: DeleteHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.holidayId === null || requestParameters.holidayId === undefined) { throw new runtime.RequiredError('holidayId','Required parameter requestParameters.holidayId was null or undefined when calling deleteHoliday.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/holidays/{holidayId}`.replace(`{${"holidayId"}}`, encodeURIComponent(String(requestParameters.holidayId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete a holiday * delete a holiday */ async deleteHoliday(requestParameters: DeleteHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteHolidayRaw(requestParameters, initOverrides); } /** * Delete a project * delete a project */ async deleteProjectRaw(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling deleteProject.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete a project * delete a project */ async deleteProject(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteProjectRaw(requestParameters, initOverrides); } /** * */ async deleteSlackUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/slackbot-users`, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * */ async deleteSlackUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteSlackUserRaw(initOverrides); } /** * */ async deleteSubscriptionRaw(requestParameters: DeleteSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteSubscription.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ path: `/subscriptions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * */ async deleteSubscription(requestParameters: DeleteSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteSubscriptionRaw(requestParameters, initOverrides); } /** * Delete user * Delete a user by ID */ async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling deleteUser.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/test-users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Delete user * Delete a user by ID */ async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { await this.deleteUserRaw(requestParameters, initOverrides); } /** * Download an AdjustedTimesheet report in PDF format * Download an AdjustedTimesheet report in PDF format */ async downloadAdjustedTimesheetPdfRaw(requestParameters: DownloadAdjustedTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling downloadAdjustedTimesheetPdf.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling downloadAdjustedTimesheetPdf.'); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}/adjusted-timesheets/{timesheetId}/download`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse<string>(response); } else { return new runtime.TextApiResponse(response) as any; } } /** * Download an AdjustedTimesheet report in PDF format * Download an AdjustedTimesheet report in PDF format */ async downloadAdjustedTimesheetPdf(requestParameters: DownloadAdjustedTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> { const response = await this.downloadAdjustedTimesheetPdfRaw(requestParameters, initOverrides); return await response.value(); } /** * Download client invoice pdf * Download client invoice pdf */ async downloadClientInvoicePdfRaw(requestParameters: DownloadClientInvoicePdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> { if (requestParameters.invoiceId === null || requestPa