UNPKG

tuix-timesheets-api

Version:

This package facilitates the client request to tuix timesheets api

1,019 lines 128 kB
"use strict"; /* 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. */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmployeesControllerGetMyCommitsGroupByEnum = exports.EmployeesControllerGetCommitsByUserIdGroupByEnum = exports.TuixTimesheetsClientApi = void 0; const runtime = __importStar(require("../runtime")); const index_1 = require("../models/index"); /** * */ class TuixTimesheetsClientApi extends runtime.BaseAPI { /** * Add a new jira account to the user */ async addJiraAccountRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CreateJiraAccountDtoToJSON)(requestParameters.createJiraAccountDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JiraAccountDtoFromJSON)(jsonValue)); } /** * Add a new jira account to the user */ async addJiraAccount(requestParameters, initOverrides) { 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, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.approveAdjustedTimesheetRaw(requestParameters, initOverrides); } /** * Approve a global timesheet * Approve a global timesheet */ async approveGlobalTimesheetRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.approveGlobalTimesheetRaw(requestParameters, initOverrides); } /** * Approve a timesheet * Approve a timesheet */ async approveTimesheetRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.approveTimesheetRaw(requestParameters, initOverrides); } /** * Create client */ async createClientRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.ClientDTOToJSON)(requestParameters.clientDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClientDTOFromJSON)(jsonValue)); } /** * Create client */ async createClient(requestParameters, initOverrides) { const response = await this.createClientRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a company * Creates a new company */ async createCompanyRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CompanyDTOToJSON)(requestParameters.companyDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompanyDTOFromJSON)(jsonValue)); } /** * Create a company * Creates a new company */ async createCompany(requestParameters, initOverrides) { const response = await this.createCompanyRaw(requestParameters, initOverrides); return await response.value(); } /** * Create an employee invoice * Create an employee invoice */ async createEmployeeInvoiceRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CreateEmployeeInvoiceInputDTOToJSON)(requestParameters.createEmployeeInvoiceInputDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EmployeeInvoiceDTOFromJSON)(jsonValue)); } /** * Create an employee invoice * Create an employee invoice */ async createEmployeeInvoice(requestParameters, initOverrides) { const response = await this.createEmployeeInvoiceRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createGithubUserRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CreateGithubUserDtoToJSON)(requestParameters.createGithubUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GithubUserDtoFromJSON)(jsonValue)); } /** * */ async createGithubUser(requestParameters, initOverrides) { const response = await this.createGithubUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Allows a user to add a holiday */ async createHolidayRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.HolidayCreateDTOToJSON)(requestParameters.holidayCreateDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.HolidayDTOFromJSON)(jsonValue)); } /** * Allows a user to add a holiday */ async createHoliday(requestParameters, initOverrides) { const response = await this.createHolidayRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a new user */ async createJiraUserRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CreateJiraUserDtoToJSON)(requestParameters.createJiraUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JiraUserDtoFromJSON)(jsonValue)); } /** * Create a new user */ async createJiraUser(requestParameters, initOverrides) { const response = await this.createJiraUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Create a project * Creates a new project */ async createProjectRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.ProjectInputDTOToJSON)(requestParameters.projectInputDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProjectDTOFromJSON)(jsonValue)); } /** * Create a project * Creates a new project */ async createProject(requestParameters, initOverrides) { const response = await this.createProjectRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createSlackUserRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.CreateUserDtoToJSON)(requestParameters.createUserDto), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SlackAccountReponseDtoFromJSON)(jsonValue)); } /** * */ async createSlackUser(requestParameters, initOverrides) { const response = await this.createSlackUserRaw(requestParameters, initOverrides); return await response.value(); } /** * */ async createSubscriptionRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; const response = await this.request({ path: `/subscriptions`, method: 'POST', headers: headerParameters, query: queryParameters, body: (0, index_1.CreateSubscriptionDTOToJSON)(requestParameters.createSubscriptionDTO), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SubscriptionFromJSON)(jsonValue)); } /** * */ async createSubscription(requestParameters, initOverrides) { const response = await this.createSubscriptionRaw(requestParameters, initOverrides); return await response.value(); } /** * Create user * Create a user */ async createUserRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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: (0, index_1.UserInputDTOScToJSON)(requestParameters.userInputDTOSc), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UserDTOScFromJSON)(jsonValue)); } /** * Create user * Create a user */ async createUser(requestParameters, initOverrides) { const response = await this.createUserRaw(requestParameters, initOverrides); return await response.value(); } /** * Delete client */ async deleteClientRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteClientRaw(requestParameters, initOverrides); } /** * Delete a company * delete a company */ async deleteCompanyRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteCompanyRaw(requestParameters, initOverrides); } /** * Delete an employee * Delete an employee */ async deleteEmployeeRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteEmployeeRaw(requestParameters, initOverrides); } /** * */ async deleteGithubUserRaw(initOverrides) { const queryParameters = {}; const headerParameters = {}; 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) { await this.deleteGithubUserRaw(initOverrides); } /** * Delete a holiday * delete a holiday */ async deleteHolidayRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteHolidayRaw(requestParameters, initOverrides); } /** * Delete a project * delete a project */ async deleteProjectRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteProjectRaw(requestParameters, initOverrides); } /** * */ async deleteSlackUserRaw(initOverrides) { const queryParameters = {}; const headerParameters = {}; 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) { await this.deleteSlackUserRaw(initOverrides); } /** * */ async deleteSubscriptionRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteSubscriptionRaw(requestParameters, initOverrides); } /** * Delete user * Delete a user by ID */ async deleteUserRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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, initOverrides) { await this.deleteUserRaw(requestParameters, initOverrides); } /** * Download an AdjustedTimesheet report in PDF format * Download an AdjustedTimesheet report in PDF format */ async downloadAdjustedTimesheetPdfRaw(requestParameters, initOverrides) { 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 = {}; const headerParameters = {}; 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(response); } else { return new runtime.TextApiResponse(response); } } /** * Download an AdjustedTimesheet report in PDF format * Download an AdjustedTimesheet report in PDF format */ async downloadAdjustedTimesheetPdf(requestParameters, initOverrides) { const response = await this.downloadAdjustedTimesheetPdfRaw(requestParameters, initOverrides); return await response.value(); } /** * Download client invoice pdf * Download client invoice pdf */ async downloadClientInvoicePdfRaw(requestParameters, initOverrides) { if (requestParameters.invoiceId === null || requestParameters.invoiceId === undefined) { throw new runtime.RequiredError('invoiceId', 'Required parameter requestParameters.invoiceId was null or undefined when calling downloadClientInvoicePdf.'); } if (requestParameters.clientId === null || requestParameters.clientId === undefined) { throw new runtime.RequiredError('clientId', 'Required parameter requestParameters.clientId was null or undefined when calling downloadClientInvoicePdf.'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/clients/{clientId}/invoices/{invoiceId}/download`.replace(`{${"invoiceId"}}`, encodeURIComponent(String(requestParameters.invoiceId))).replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } } /** * Download client invoice pdf * Download client invoice pdf */ async downloadClientInvoicePdf(requestParameters, initOverrides) { const response = await this.downloadClientInvoicePdfRaw(requestParameters, initOverrides); return await response.value(); } /** * Download the employee invoice report in PDF format * Download the employee invoice report in PDF format */ async downloadEmployeeInvoicePdfRaw(requestParameters, initOverrides) { if (requestParameters.employeeId === null || requestParameters.employeeId === undefined) { throw new runtime.RequiredError('employeeId', 'Required parameter requestParameters.employeeId was null or undefined when calling downloadEmployeeInvoicePdf.'); } if (requestParameters.employeeInvoiceId === null || requestParameters.employeeInvoiceId === undefined) { throw new runtime.RequiredError('employeeInvoiceId', 'Required parameter requestParameters.employeeInvoiceId was null or undefined when calling downloadEmployeeInvoicePdf.'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/employees/{employeeId}/invoices/{employeeInvoiceId}/download`.replace(`{${"employeeId"}}`, encodeURIComponent(String(requestParameters.employeeId))).replace(`{${"employeeInvoiceId"}}`, encodeURIComponent(String(requestParameters.employeeInvoiceId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } } /** * Download the employee invoice report in PDF format * Download the employee invoice report in PDF format */ async downloadEmployeeInvoicePdf(requestParameters, initOverrides) { const response = await this.downloadEmployeeInvoicePdfRaw(requestParameters, initOverrides); return await response.value(); } /** * Download a global timesheet report in PDF format * Download a global timesheet report in PDF format */ async downloadGlobalTimesheetPdfRaw(requestParameters, initOverrides) { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling downloadGlobalTimesheetPdf.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling downloadGlobalTimesheetPdf.'); } const queryParameters = {}; const headerParameters = {}; 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}/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(response); } else { return new runtime.TextApiResponse(response); } } /** * Download a global timesheet report in PDF format * Download a global timesheet report in PDF format */ async downloadGlobalTimesheetPdf(requestParameters, initOverrides) { const response = await this.downloadGlobalTimesheetPdfRaw(requestParameters, initOverrides); return await response.value(); } /** * Download a timesheet report in PDF format * Download a timesheet report in PDF format */ async downloadTimesheetPdfRaw(requestParameters, initOverrides) { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling downloadTimesheetPdf.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling downloadTimesheetPdf.'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/projects/{projectId}/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(response); } else { return new runtime.TextApiResponse(response); } } /** * Download a timesheet report in PDF format * Download a timesheet report in PDF format */ async downloadTimesheetPdf(requestParameters, initOverrides) { const response = await this.downloadTimesheetPdfRaw(requestParameters, initOverrides); return await response.value(); } /** */ async employeesControllerGetCommitsByUserIdRaw(requestParameters, initOverrides) { if (requestParameters.from === null || requestParameters.from === undefined) { throw new runtime.RequiredError('from', 'Required parameter requestParameters.from was null or undefined when calling employeesControllerGetCommitsByUserId.'); } if (requestParameters.to === null || requestParameters.to === undefined) { throw new runtime.RequiredError('to', 'Required parameter requestParameters.to was null or undefined when calling employeesControllerGetCommitsByUserId.'); } if (requestParameters.groupBy === null || requestParameters.groupBy === undefined) { throw new runtime.RequiredError('groupBy', 'Required parameter requestParameters.groupBy was null or undefined when calling employeesControllerGetCommitsByUserId.'); } if (requestParameters.employeeId === null || requestParameters.employeeId === undefined) { throw new runtime.RequiredError('employeeId', 'Required parameter requestParameters.employeeId was null or undefined when calling employeesControllerGetCommitsByUserId.'); } const queryParameters = {}; if (requestParameters.from !== undefined) { queryParameters['from'] = requestParameters.from.toISOString().substring(0, 10); } if (requestParameters.to !== undefined) { queryParameters['to'] = requestParameters.to.toISOString().substring(0, 10); } if (requestParameters.groupBy !== undefined) { queryParameters['groupBy'] = requestParameters.groupBy; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/employees/{employeeId}/commits`.replace(`{${"employeeId"}}`, encodeURIComponent(String(requestParameters.employeeId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.GithubCommitCountDTOFromJSON)); } /** */ async employeesControllerGetCommitsByUserId(requestParameters, initOverrides) { const response = await this.employeesControllerGetCommitsByUserIdRaw(requestParameters, initOverrides); return await response.value(); } /** */ async employeesControllerGetMyCommitsRaw(requestParameters, initOverrides) { if (requestParameters.from === null || requestParameters.from === undefined) { throw new runtime.RequiredError('from', 'Required parameter requestParameters.from was null or undefined when calling employeesControllerGetMyCommits.'); } if (requestParameters.to === null || requestParameters.to === undefined) { throw new runtime.RequiredError('to', 'Required parameter requestParameters.to was null or undefined when calling employeesControllerGetMyCommits.'); } if (requestParameters.groupBy === null || requestParameters.groupBy === undefined) { throw new runtime.RequiredError('groupBy', 'Required parameter requestParameters.groupBy was null or undefined when calling employeesControllerGetMyCommits.'); } const queryParameters = {}; if (requestParameters.from !== undefined) { queryParameters['from'] = requestParameters.from.toISOString().substring(0, 10); } if (requestParameters.to !== undefined) { queryParameters['to'] = requestParameters.to.toISOString().substring(0, 10); } if (requestParameters.groupBy !== undefined) { queryParameters['groupBy'] = requestParameters.groupBy; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication } const response = await this.request({ path: `/commits`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.GithubCommitCountDTOFromJSON)); } /** */ async employeesControllerGetMyCommits(requestParameters, initOverrides) { const response = await this.employeesControllerGetMyCommitsRaw(requestParameters, initOverrides); return await response.value(); } /** * Get employee info * Get employee info */ async employeesEmployeeIdGetRaw(requestParameters, initOverrides) { if (requestParameters.employeeId === null || requestParameters.employeeId === undefined) { throw new runtime.RequiredError('employeeId', 'Required parameter requestParameters.employeeId was null or undefined when calling employeesEmployeeIdGet.'); } const queryParameters = {}; const headerParameters = {}; 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: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EmployeeDTOFromJSON)(jsonValue)); } /** * Get employee info * Get employee info */ async employeesEmployeeIdGet(requestParameters, initOverrides) { const response = await this.employeesEmployeeIdGetRaw(requestParameters, initOverrides); return await response.value(); } /** * Get an adjustedTimesheet * Get an adjustedTimesheet */ async getAdjustedTimesheetRaw(requestParameters, initOverrides) { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getAdjustedTimesheet.'); } if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) { throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling getAdjustedTimesheet.'); } const queryParameters = {}; const headerParameters = {}; 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}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverri