tuix-timesheets-api
Version:
This package facilitates the client request to tuix timesheets api
2,550 lines • 124 kB
JavaScript
"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.GetMyCommitsGroupByEnum = exports.GetCommitsByUserIDGroupByEnum = 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();
}
/**
* Approve an adjustedTimesheet in a project
* Approve 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);
}
/**
* Approve an adjustedTimesheet in a project
* Approve 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.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId 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/{userId}/invoices`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
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();
}
/**
* Create a new GitHub user account
* Create GitHub user
*/
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));
}
/**
* Create a new GitHub user account
* Create GitHub user
*/
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();
}
/**
* Create a new API token
* Create a new API token with role-based permissions
*/
async createTokenRaw(requestParameters, initOverrides) {
if (requestParameters.tokenInputDTO === null || requestParameters.tokenInputDTO === undefined) {
throw new runtime.RequiredError('tokenInputDTO', 'Required parameter requestParameters.tokenInputDTO was null or undefined when calling createToken.');
}
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: `/pats`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.TokenInputDTOToJSON)(requestParameters.tokenInputDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateTokenResponseDTOFromJSON)(jsonValue));
}
/**
* Create a new API token
* Create a new API token with role-based permissions
*/
async createToken(requestParameters, initOverrides) {
const response = await this.createTokenRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Delete client
* 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
* 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.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId 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/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
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);
}
/**
* Delete an employee invoice
* Delete an employee invoice
*/
async deleteEmployeeInvoiceRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling deleteEmployeeInvoice.');
}
if (requestParameters.employeeInvoiceId === null || requestParameters.employeeInvoiceId === undefined) {
throw new runtime.RequiredError('employeeInvoiceId', 'Required parameter requestParameters.employeeInvoiceId was null or undefined when calling deleteEmployeeInvoice.');
}
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/{userId}/invoices/{employeeInvoiceId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"employeeInvoiceId"}}`, encodeURIComponent(String(requestParameters.employeeInvoiceId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete an employee invoice
* Delete an employee invoice
*/
async deleteEmployeeInvoice(requestParameters, initOverrides) {
await this.deleteEmployeeInvoiceRaw(requestParameters, initOverrides);
}
/**
* Delete the authenticated user\'s GitHub account
* Delete GitHub user
*/
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);
}
/**
* Delete the authenticated user\'s GitHub account
* Delete GitHub user
*/
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);
}
/**
* Delete token
* Delete an API token by ID
*/
async deleteTokenRaw(requestParameters, initOverrides) {
if (requestParameters.tokenId === null || requestParameters.tokenId === undefined) {
throw new runtime.RequiredError('tokenId', 'Required parameter requestParameters.tokenId was null or undefined when calling deleteToken.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/pats/{tokenId}`.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters.tokenId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete token
* Delete an API token by ID
*/
async deleteToken(requestParameters, initOverrides) {
await this.deleteTokenRaw(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.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId 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/{userId}/invoices/{employeeInvoiceId}/download`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).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();
}
/**
* 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,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdjustedTimesheetDTOFromJSON)(jsonValue));
}
/**
* Get an adjustedTimesheet
* Get an adjustedTimesheet
*/
async getAdjustedTimesheet(requestParameters, initOverrides) {
const response = await this.getAdjustedTimesheetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all adjustedTimesheets in a project
* Get all adjustedTimesheets in a project
*/
async getAdjustedTimesheetsRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getAdjustedTimesheets.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedAdjustedTimesheetsFromJSON)(jsonValue));
}
/**
* Get all adjustedTimesheets in a project
* Get all adjustedTimesheets in a project
*/
async getAdjustedTimesheets(requestParameters, initOverrides) {
const response = await this.getAdjustedTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get client by id
*/
async getClientByIdRaw(requestParameters, initOverrides) {
if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
throw new runtime.RequiredError('clientId', 'Required parameter requestParameters.clientId was null or undefined when calling getClientById.');
}
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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClientDTOFromJSON)(jsonValue));
}
/**
* Get client by id
*/
async getClientById(requestParameters, initOverrides) {
const response = await this.getClientByIdRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all invoices from client
* Get all invoices from client
*/
async getClientInvoicesRaw(requestParameters, initOverrides) {
if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
throw new runtime.RequiredError('clientId', 'Required parameter requestParameters.clientId was null or undefined when calling getClientInvoices.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
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`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedClientInvoicesFromJSON)(jsonValue));
}
/**
* Get all invoices from client
* Get all invoices from client
*/
async getClientInvoices(requestParameters, initOverrides) {
const response = await this.getClientInvoicesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all clients from company
* Get all clients from company
*/
async getClientsRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/clients`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedClientsFromJSON)(jsonValue));
}
/**
* Get all clients from company
* Get all clients from company
*/
async getClients(requestParameters = {}, initOverrides) {
const response = await this.getClientsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get commit statistics for a specific user
* Get commits by user ID
*/
async getCommitsByUserIDRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getCommitsByUserID.');
}
if (requestParameters.from === null || requestParameters.from === undefined) {
throw new runtime.RequiredError('from', 'Required parameter requestParameters.from was null or undefined when calling getCommitsByUserID.');
}
if (requestParameters.to === null || requestParameters.to === undefined) {
throw new runtime.RequiredError('to', 'Required parameter requestParameters.to was null or undefined when calling getCommitsByUserID.');
}
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/{userId}/commits`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.GithubCommitCountDTOFromJSON));
}
/**
* Get commit statistics for a specific user
* Get commits by user ID
*/
async getCommitsByUserID(requestParameters, initOverrides) {
const response = await this.getCommitsByUserIDRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all companies a user belongs to
* Get all companies a user belongs to
*/
async getCompaniesRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/companies`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.CompanyDTOFromJSON));
}
/**
* Get all companies a user belongs to
* Get all companies a user belongs to
*/
async getCompanies(requestParameters = {}, initOverrides) {
const response = await this.getCompaniesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a company
* Get a company by ID
*/
async getCompanyRaw(requestParameters, initOverrides) {
if (requestParameters.companyId === null || requestParameters.companyId === undefined) {
throw new runtime.RequiredError('companyId', 'Required parameter requestParameters.companyId was null or undefined when calling getCompany.');
}
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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompanyDTOFromJSON)(jsonValue));
}
/**
* Get a company
* Get a company by ID
*/
async getCompany(requestParameters, initOverrides) {
const response = await this.getCompanyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get employee info
* Get employee info
*/
async getEmployeeRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getEmployee.');
}
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/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
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 getEmployee(requestParameters, initOverrides) {
const response = await this.getEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all employee invoices
* Get all employee invoices
*/
async getEmployeeInvoicesRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getEmployeeInvoices.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees/{userId}/invoices`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedEmployeeInvoicesFromJSON)(jsonValue));
}
/**
* Get all employee invoices
* Get all employee invoices
*/
async getEmployeeInvoices(requestParameters, initOverrides) {
const response = await this.getEmployeeInvoicesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all timesheets of an employee in a project
* Get all timesheets of an employee in a project
*/
async getEmployeeTimesheetsRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getEmployeeTimesheets.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/employee-timesheets`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedTimesheetsFromJSON)(jsonValue));
}
/**
* Get all timesheets of an employee in a project
* Get all timesheets of an employee in a project
*/
async getEmployeeTimesheets(requestParameters, initOverrides) {
const response = await this.getEmployeeTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* List employees
* List employees
*/
async getEmployeesRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.activated !== undefined) {
queryParameters['activated'] = requestParameters.activated;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedEmployeesFromJSON)(jsonValue));
}
/**
* List employees
* List employees
*/
async getEmployees(requestParameters = {}, initOverrides) {
const response = await this.getEmployeesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get GitHub account for the authenticated user
* Get GitHub account
*/
async getGithubAccountRaw(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-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GithubAccountDTOFromJSON)(jsonValue));
}
/**
* Get GitHub account for the authenticated user
* Get GitHub account
*/
async getGithubAccount(initOverrides) {
const response = await this.getGithubAccountRaw(initOverrides);
return await response.value();
}
/**
* Get a global timesheet
* Get a global timesheet
*/
async getGlobalTimesheetRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getGlobalTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling getGlobalTimesheet.');
}
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}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GlobalTimesheetDTOFromJSON)(jsonValue));
}
/**
* Get a global timesheet
* Get a global timesheet
*/
async getGlobalTimesheet(requestParameters, initOverrides) {
const response = await this.getGlobalTimesheetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all global timesheets in a project
* Get all global timesheets in a project
*/
async getGlobalTimesheetsRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getGlobalTimesheets.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedGlobalTimesheetsFromJSON)(jsonValue));
}
/**
* Get all global timesheets in a project
* Get all global timesheets in a project
*/
async getGlobalTimesheets(requestParameters, initOverrides) {
const response = await this.getGlobalTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns a paginated list of a user\'s holidays
*/
async getHolidaysRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/holidays`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedHolidaysDTOFromJSON)(jsonValue));
}
/**
* Returns a paginated list of a user\'s holidays
*/
async getHolidays(requestParameters = {}, initOverrides) {
const response = await this.getHolidaysRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* returns a paginated list of a user\'s holidays
*/
async getHolidaysByEmployeeRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling getHolidaysByEmployee.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees/{userId}/holidays`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedHolidaysDTOFromJSON)(jsonValue));
}
/**
* returns a paginated list of a user\'s holidays
*/
async getHolidaysByEmployee(requestParameters, initOverrides) {
const response = await this.getHolidaysByEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get jira accounts
*/
async getJiraAccountsRaw(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: `/jira-users/jira-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.JiraAccountDtoFromJSON));
}
/**
* Get jira accounts
*/
async getJiraAccounts(initOverrides) {
const response = await this.getJiraAccountsRaw(initOverrides);
return await response.value();
}
/**
* Get user
*/
async getJiraUserRaw(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: `/jira-users`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.JiraUserDtoFromJSON)(jsonValue));
}
/**
* Get user
*/
async getJiraUser(initOverrides) {
const response = await this.getJiraUserRaw(initOverrides);
return await response.value();
}
/**
* Get my account info
* Get my account info
*/
async getMyAccountRaw(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: `/me`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AccountInfoDTOFromJSON)(jsonValue));
}
/**
* Get my account info
* Get my account info
*/
async getMyAccount(initOverrides) {
const response = await this.getMyAccountRaw(initOverrides);
return await response.value();
}
/**
* Get commit statistics for the authenticated user
* Get my commits
*/
async getMyCommitsRaw(requestParameters, initOverrides) {
if (requestParameters.from === null || requestParameters.from === undefined) {
throw new runtime.RequiredError('from', 'Required parameter requestParameters.from was null or undefined when calling getMyCommits.');
}
if (requestParameters.to === null || requestParameters.to === undefined) {
throw new runtime.RequiredError('to', 'Required parameter requestParameters.to was null or undefined when calling getMyCommits.');
}
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));
}
/**
* Get commit statistics for the authenticated user
* Get my commits
*/
async getMyCommits(requestParameters, initOverrides) {
const response = await this.getMyCommitsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get template by id
* Get template by id
*/
async getPdfTemplateRaw(requestParameters, initOverrides) {
if (requestParameters.id === null || requestParameters.id === undefined) {
throw new runtime.RequiredError('id', 'Required parameter requestParameters.id was null or undefined when calling getPdfTemplate.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/pdf-templates/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
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);
}
}
/**
* Get template by id
* Get template by id
*/
async getPdfTemplate(requestParameters, initOverrides) {
const response = await this.getPdfTemplateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all templates
* Get all templates
*/
async getPdfTemplatesRaw(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: `/pdf-templates`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PdfTemplateDTOFromJSON));
}
/**
* Get all templates
* Get all templates
*/
async getPdfTemplates(initOverrides) {
const response = await this.getPdfTemplatesRaw(initOverrides);
return await response.value();
}
/**
* Get a project
* Get a project by ID
*/
async getProjectByIdRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getProjectById.');
}
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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProjectDTOFromJSON)(jsonValue));
}
/**
* Get a project
* Get a project by ID
*/
async getProjectById(requestParameters, initOverrides) {
const response = await this.getProjectByIdRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all projects a user or employee has access to
* Get all projects a user or employee has access to
*/
async getProjectsRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedProjectsFromJSON)(jsonValue));
}
/**
* Get all projects a user or employee has access to
* Get all projects a user or employee has access to
*/
async getProjects(requestParameters = {}, initOverrides) {
const response = await this.getProjectsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all projects an employee has access to
* Get all projects an employee has access to
*/
async getProjectsAsEmployeeRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employee-projects`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedEmployeeProjectsFromJSON)(jsonValue));
}
/**
* Get all projects an employee has access to
* Get all projects an employee has access to
*/
async getProjectsAsEmployee(requestParameters = {}, initOverrides) {
const response = await this.getProjectsAsEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async getSlackAccountRaw(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: `/slack-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SlackAccountReponseDtoFromJSON)(jsonValue));
}
/**
*
*/
async getSlackAccount(initOverrides) {
const response = await this.getSlackAccountRaw(initOverrides);
return await response.value();
}
/**
* Get all users in a project
* Get all users in a project
*/
async getTeamRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getTeam.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/team`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedUsersFromJSON)(jsonValue));
}
/**
* Get all users in a project
* Get all users in a project
*/
async getTeam(requestParameters, initOverrides) {
const response = await this.getTeamRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a timesheet
* Get a timesheet
*/
async getTimesheetRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling getTimesheet.');
}
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}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TimesheetDTOFromJSON)(jsonValue));
}
/**
* Get a timesheet
* Get a timesheet
*/
async getTimesheet(requestParameters, initOverrides) {
const response = await this.getTimesheetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all timesheets in a project without timesheet entries.
* Get all timesheets in a project without timesheet entries.
*/
async getTimesheetsRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getTimesheets.');
}
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedTimesheetsFromJSON)(jsonValue));
}
/**
* Get all timesheets in a project without timesheet entries.
* Get all timesheets in a project without timesheet entries.
*/
async getTimesheets(requestParameters, initOverrides) {
const response = await this.getTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get token by ID
* Get a specific API token by ID
*/
async getTokenRaw(requestParameters, initOverrides) {
if (requestParameters.tokenId === null || requestParameters.tokenId === undefined) {
throw new runtime.RequiredError('tokenId', 'Required parameter requestParameters.tokenId was null or undefined when calling getToken.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/pats/{tokenId}`.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters.tokenId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TokenDTOFromJSON)(jsonValue));
}
/**
* Get token by ID
* Get a specific API token by ID
*/
async getToken(requestParameters, initOverrides) {
const response = await this.getTokenRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get permissions for current user
* Get all available permissions for current user based on their role
*/
async getUserPermissionsRaw(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: `/permissions`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.RolePermissionsDTOFromJSON)(jsonValue));
}
/**
* Get permissions for current user
* Get all available permissions for current user based on their role
*/
async getUserPermissions(initOverrides) {
const response = await this.getUserPermissionsRaw(initOverrides);
return await response.value();
}
/**
* Get all tokens for current user with pagination
* Get all API tokens for current user with pagination
*/
async getUserTokensRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/pats`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedTokensFromJSON)(jsonValue));
}
/**
* Get all tokens for current user with pagination
* Get all API tokens for current user with pagination
*/
async getUserTokens(requestParameters = {}, initOverrides) {
const response = await this.getUserTokensRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async handleActionRaw(initOverrides) {
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/slack-actions`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*
*/
async handleAction(initOverrides) {
await this.handleActionRaw(initOverrides);
}
/**
* Invite an employee to a company
* Invite an employee to a company
*/
async inviteEmployeeRaw(requestParameters, initOverrides) {
if (requestParameters.employeeDTO === null || requestParameters.employeeDTO === undefined) {
throw new runtime.RequiredError('employeeDTO', 'Required parameter requestParameters.employeeDTO was null or undefined when calling inviteEmployee.');
}
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/invite`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.EmployeeDTOToJSON)(requestParameters.employeeDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EmployeeDTOFromJSON)(jsonValue));
}
/**
* Invite an employee to a company
* Invite an employee to a company
*/
async inviteEmployee(requestParameters, initOverrides) {
const response = await this.inviteEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Mark an employee invoice as paid
* Mark an employee invoice as paid
*/
async markEmployeeInvoiceAsPaidRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling markEmployeeInvoiceAsPaid.');
}
if (requestParameters.employeeInvoiceId === null || requestParameters.employeeInvoiceId === undefined) {
throw new runtime.RequiredError('employeeInvoiceId', 'Required parameter requestParameters.employeeInvoiceId was null or undefined when calling markEmployeeInvoiceAsPaid.');
}
if (requestParameters.markEmployeeInvoicePaidDTO === null || requestParameters.markEmployeeInvoicePaidDTO === undefined) {
throw new runtime.RequiredError('markEmployeeInvoicePaidDTO', 'Required parameter requestParameters.markEmployeeInvoicePaidDTO was null or undefined when calling markEmployeeInvoiceAsPaid.');
}
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/{userId}/invoices/{employeeInvoiceId}/mark-paid`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"employeeInvoiceId"}}`, encodeURIComponent(String(requestParameters.employeeInvoiceId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.MarkEmployeeInvoicePaidDTOToJSON)(requestParameters.markEmployeeInvoicePaidDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Mark an employee invoice as paid
* Mark an employee invoice as paid
*/
async markEmployeeInvoiceAsPaid(requestParameters, initOverrides) {
await this.markEmployeeInvoiceAsPaidRaw(requestParameters, initOverrides);
}
/**
* Mark a client invoice as paid
* Mark a client invoice as paid with the specified date and time
*/
async markInvoiceAsPaidRaw(requestParameters, initOverrides) {
if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
throw new runtime.RequiredError('clientId', 'Required parameter requestParameters.clientId was null or undefined when calling markInvoiceAsPaid.');
}
if (requestParameters.invoiceId === null || requestParameters.invoiceId === undefined) {
throw new runtime.RequiredError('invoiceId', 'Required parameter requestParameters.invoiceId was null or undefined when calling markInvoiceAsPaid.');
}
if (requestParameters.markInvoicePaidDTO === null || requestParameters.markInvoicePaidDTO === undefined) {
throw new runtime.RequiredError('markInvoicePaidDTO', 'Required parameter requestParameters.markInvoicePaidDTO was null or undefined when calling markInvoiceAsPaid.');
}
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/{clientId}/invoices/{invoiceId}/mark-paid`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))).replace(`{${"invoiceId"}}`, encodeURIComponent(String(requestParameters.invoiceId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.MarkInvoicePaidDTOToJSON)(requestParameters.markInvoicePaidDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Mark a client invoice as paid
* Mark a client invoice as paid with the specified date and time
*/
async markInvoiceAsPaid(requestParameters, initOverrides) {
await this.markInvoiceAsPaidRaw(requestParameters, initOverrides);
}
/**
* Open a sent timesheet
* Open a sent timesheet
*/
async openSentTimesheetRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling openSentTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling openSentTimesheet.');
}
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}/open`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Open a sent timesheet
* Open a sent timesheet
*/
async openSentTimesheet(requestParameters, initOverrides) {
await this.openSentTimesheetRaw(requestParameters, initOverrides);
}
/**
* Remove jira account
*/
async removeJiraAccountRaw(requestParameters, initOverrides) {
if (requestParameters.jiraAccountId === null || requestParameters.jiraAccountId === undefined) {
throw new runtime.RequiredError('jiraAccountId', 'Required parameter requestParameters.jiraAccountId was null or undefined when calling removeJiraAccount.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/jira-users/jira-accounts/{jiraAccountId}`.replace(`{${"jiraAccountId"}}`, encodeURIComponent(String(requestParameters.jiraAccountId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Remove jira account
*/
async removeJiraAccount(requestParameters, initOverrides) {
await this.removeJiraAccountRaw(requestParameters, initOverrides);
}
/**
* Send a timesheet
* Send a timesheet
*/
async sendTimesheetRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling sendTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling sendTimesheet.');
}
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}/send`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Send a timesheet
* Send a timesheet
*/
async sendTimesheet(requestParameters, initOverrides) {
await this.sendTimesheetRaw(requestParameters, initOverrides);
}
/**
* Update an adjusted timesheet entry
* Update an adjusted timesheet entry
*/
async updateAdjustedEntryRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateAdjustedEntry.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling updateAdjustedEntry.');
}
if (requestParameters.entryId === null || requestParameters.entryId === undefined) {
throw new runtime.RequiredError('entryId', 'Required parameter requestParameters.entryId was null or undefined when calling updateAdjustedEntry.');
}
if (requestParameters.adjustedTimesheetUpdateEntryDTO === null || requestParameters.adjustedTimesheetUpdateEntryDTO === undefined) {
throw new runtime.RequiredError('adjustedTimesheetUpdateEntryDTO', 'Required parameter requestParameters.adjustedTimesheetUpdateEntryDTO was null or undefined when calling updateAdjustedEntry.');
}
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/{projectId}/adjusted-timesheets/{timesheetId}/entries/{entryId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))).replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters.entryId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.AdjustedTimesheetUpdateEntryDTOToJSON)(requestParameters.adjustedTimesheetUpdateEntryDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdjustedTimesheetEntryDTOFromJSON)(jsonValue));
}
/**
* Update an adjusted timesheet entry
* Update an adjusted timesheet entry
*/
async updateAdjustedEntry(requestParameters, initOverrides) {
const response = await this.updateAdjustedEntryRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update client
*/
async updateClientRaw(requestParameters, initOverrides) {
if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
throw new runtime.RequiredError('clientId', 'Required parameter requestParameters.clientId was null or undefined when calling updateClient.');
}
if (requestParameters.clientDTO === null || requestParameters.clientDTO === undefined) {
throw new runtime.RequiredError('clientDTO', 'Required parameter requestParameters.clientDTO was null or undefined when calling updateClient.');
}
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/{clientId}`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.ClientDTOToJSON)(requestParameters.clientDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ClientDTOFromJSON)(jsonValue));
}
/**
* Update client
*/
async updateClient(requestParameters, initOverrides) {
const response = await this.updateClientRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a company
* Update a company by ID
*/
async updateCompanyRaw(requestParameters, initOverrides) {
if (requestParameters.companyId === null || requestParameters.companyId === undefined) {
throw new runtime.RequiredError('companyId', 'Required parameter requestParameters.companyId was null or undefined when calling updateCompany.');
}
if (requestParameters.companyDTO === null || requestParameters.companyDTO === undefined) {
throw new runtime.RequiredError('companyDTO', 'Required parameter requestParameters.companyDTO was null or undefined when calling updateCompany.');
}
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/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters.companyId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.CompanyDTOToJSON)(requestParameters.companyDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CompanyDTOFromJSON)(jsonValue));
}
/**
* Update a company
* Update a company by ID
*/
async updateCompany(requestParameters, initOverrides) {
const response = await this.updateCompanyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update an employee
* Update an employee
*/
async updateEmployeeDataRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling updateEmployeeData.');
}
if (requestParameters.employeeUpdateDTO === null || requestParameters.employeeUpdateDTO === undefined) {
throw new runtime.RequiredError('employeeUpdateDTO', 'Required parameter requestParameters.employeeUpdateDTO was null or undefined when calling updateEmployeeData.');
}
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/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.EmployeeUpdateDTOToJSON)(requestParameters.employeeUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EmployeeDTOFromJSON)(jsonValue));
}
/**
* Update an employee
* Update an employee
*/
async updateEmployeeData(requestParameters, initOverrides) {
const response = await this.updateEmployeeDataRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a global timesheet entry
* Update a global timesheet entry
*/
async updateGlobalTimesheetEntryRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateGlobalTimesheetEntry.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling updateGlobalTimesheetEntry.');
}
if (requestParameters.entryId === null || requestParameters.entryId === undefined) {
throw new runtime.RequiredError('entryId', 'Required parameter requestParameters.entryId was null or undefined when calling updateGlobalTimesheetEntry.');
}
if (requestParameters.globalTimesheetEntryUpdateDTO === null || requestParameters.globalTimesheetEntryUpdateDTO === undefined) {
throw new runtime.RequiredError('globalTimesheetEntryUpdateDTO', 'Required parameter requestParameters.globalTimesheetEntryUpdateDTO was null or undefined when calling updateGlobalTimesheetEntry.');
}
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/{projectId}/global-timesheets/{timesheetId}/entries/{entryId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))).replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters.entryId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.GlobalTimesheetEntryUpdateDTOToJSON)(requestParameters.globalTimesheetEntryUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GlobalTimesheetEntryDTOFromJSON)(jsonValue));
}
/**
* Update a global timesheet entry
* Update a global timesheet entry
*/
async updateGlobalTimesheetEntry(requestParameters, initOverrides) {
const response = await this.updateGlobalTimesheetEntryRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a project
* Update a project by ID
*/
async updateProjectRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateProject.');
}
if (requestParameters.projectUpdateDTO === null || requestParameters.projectUpdateDTO === undefined) {
throw new runtime.RequiredError('projectUpdateDTO', 'Required parameter requestParameters.projectUpdateDTO was null or undefined when calling updateProject.');
}
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/{projectId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.ProjectUpdateDTOToJSON)(requestParameters.projectUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ProjectDTOFromJSON)(jsonValue));
}
/**
* Update a project
* Update a project by ID
*/
async updateProject(requestParameters, initOverrides) {
const response = await this.updateProjectRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async updateSlackbotUserRaw(requestParameters, initOverrides) {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId', 'Required parameter requestParameters.userId was null or undefined when calling updateSlackbotUser.');
}
if (requestParameters.updateUserDto === null || requestParameters.updateUserDto === undefined) {
throw new runtime.RequiredError('updateUserDto', 'Required parameter requestParameters.updateUserDto was null or undefined when calling updateSlackbotUser.');
}
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/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.UpdateUserDtoToJSON)(requestParameters.updateUserDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SlackUserDtoFromJSON)(jsonValue));
}
/**
*
*/
async updateSlackbotUser(requestParameters, initOverrides) {
const response = await this.updateSlackbotUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a project team
* Update a project team
*/
async updateTeamRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateTeam.');
}
if (requestParameters.teamUpdateDTO === null || requestParameters.teamUpdateDTO === undefined) {
throw new runtime.RequiredError('teamUpdateDTO', 'Required parameter requestParameters.teamUpdateDTO was null or undefined when calling updateTeam.');
}
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/{projectId}/team`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.TeamUpdateDTOToJSON)(requestParameters.teamUpdateDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Update a project team
* Update a project team
*/
async updateTeam(requestParameters, initOverrides) {
await this.updateTeamRaw(requestParameters, initOverrides);
}
/**
* Update a timesheet entry
* Update a timesheet entry
*/
async updateTimesheetEntryRaw(requestParameters, initOverrides) {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateTimesheetEntry.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId', 'Required parameter requestParameters.timesheetId was null or undefined when calling updateTimesheetEntry.');
}
if (requestParameters.entryId === null || requestParameters.entryId === undefined) {
throw new runtime.RequiredError('entryId', 'Required parameter requestParameters.entryId was null or undefined when calling updateTimesheetEntry.');
}
if (requestParameters.timesheetEntryUpdateDTO === null || requestParameters.timesheetEntryUpdateDTO === undefined) {
throw new runtime.RequiredError('timesheetEntryUpdateDTO', 'Required parameter requestParameters.timesheetEntryUpdateDTO was null or undefined when calling updateTimesheetEntry.');
}
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/{projectId}/timesheets/{timesheetId}/entries/{entryId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))).replace(`{${"entryId"}}`, encodeURIComponent(String(requestParameters.entryId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.TimesheetEntryUpdateDTOToJSON)(requestParameters.timesheetEntryUpdateDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Update a timesheet entry
* Update a timesheet entry
*/
async updateTimesheetEntry(requestParameters, initOverrides) {
await this.updateTimesheetEntryRaw(requestParameters, initOverrides);
}
/**
* Upload template
* Upload template
*/
async uploadPdfTemplateRaw(requestParameters, initOverrides) {
if (requestParameters.file === null || requestParameters.file === undefined) {
throw new runtime.RequiredError('file', 'Required parameter requestParameters.file was null or undefined when calling uploadPdfTemplate.');
}
if (requestParameters.name === null || requestParameters.name === undefined) {
throw new runtime.RequiredError('name', 'Required parameter requestParameters.name was null or undefined when calling uploadPdfTemplate.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const consumes = [
{ contentType: 'multipart/form-data' },
];
// @ts-ignore: canConsumeForm may be unused
const canConsumeForm = runtime.canConsumeForm(consumes);
let formParams;
let useForm = false;
// use FormData to transmit files using content-type "multipart/form-data"
useForm = canConsumeForm;
if (useForm) {
formParams = new FormData();
}
else {
formParams = new URLSearchParams();
}
if (requestParameters.file !== undefined) {
formParams.append('file', requestParameters.file);
}
if (requestParameters.name !== undefined) {
formParams.append('name', requestParameters.name);
}
const response = await this.request({
path: `/pdf-templates`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: formParams,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PdfTemplateDTOFromJSON)(jsonValue));
}
/**
* Upload template
* Upload template
*/
async uploadPdfTemplate(requestParameters, initOverrides) {
const response = await this.uploadPdfTemplateRaw(requestParameters, initOverrides);
return await response.value();
}
}
exports.TuixTimesheetsClientApi = TuixTimesheetsClientApi;
/**
* @export
*/
exports.GetCommitsByUserIDGroupByEnum = {
HourOfDay: 'hourOfDay',
Year: 'year',
Month: 'month',
Day: 'day'
};
/**
* @export
*/
exports.GetMyCommitsGroupByEnum = {
HourOfDay: 'hourOfDay',
Year: 'year',
Month: 'month',
Day: 'day'
};
//# sourceMappingURL=TuixTimesheetsClientApi.js.map