tuix-timesheets-api
Version:
This package facilitates the client request to tuix timesheets api
1,026 lines • 120 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 current user
* 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 current user
* 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 with the provided information Collaborator role required
* 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 with the provided information Collaborator role required
* 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();
}
/**
* Create a new Slack user account
* Create Slack user
*/
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.SlackAccountResponseDTOFromJSON)(jsonValue));
}
/**
* Create a new Slack user account
* Create Slack user
*/
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);
}
/**
* Delete the authenticated user\'s Slack account
* Delete Slack user
*/
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);
}
/**
* Delete the authenticated user\'s Slack account
* Delete Slack user
*/
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 (requ