tuix-timesheets-api
Version:
This package facilitates the client request to tuix timesheets api
1,389 lines (1,145 loc) • 147 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Tuix Services
* Tuix Services API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
AccountInfoDTO,
AdjustedTimesheetDTO,
AdjustedTimesheetEntryDTO,
AdjustedTimesheetUpdateEntryDTO,
ClientDTO,
CompanyDTO,
CreateEmployeeInvoiceInputDTO,
CreateGithubUserDTO,
CreateJiraAccountDTO,
CreateJiraUserDTO,
CreateTokenResponseDTO,
CreateUserDTO,
EmployeeDTO,
EmployeeInvoiceDTO,
EmployeeUpdateDTO,
ErrorDTO,
GithubAccountDTO,
GithubCommitCountDTO,
GithubUserDTO,
GlobalTimesheetDTO,
GlobalTimesheetEntryDTO,
GlobalTimesheetEntryUpdateDTO,
HolidayCreateDTO,
HolidayDTO,
JiraAccountDTO,
JiraUserDTO,
MarkEmployeeInvoicePaidDTO,
MarkInvoicePaidDTO,
PaginatedAdjustedTimesheets,
PaginatedClientInvoices,
PaginatedClients,
PaginatedEmployeeInvoices,
PaginatedEmployeeProjects,
PaginatedEmployees,
PaginatedGlobalTimesheets,
PaginatedHolidaysDTO,
PaginatedProjects,
PaginatedTimesheets,
PaginatedTokens,
PaginatedUsers,
ProjectDTO,
ProjectInputDTO,
ProjectUpdateDTO,
RolePermissionsDTO,
SlackAccountResponseDTO,
SlackUserDTO,
TeamUpdateDTO,
TimesheetDTO,
TimesheetEntryUpdateDTO,
TokenDTO,
TokenInputDTO,
TokenValidationErrorDTO,
UpdateUserDTO,
} from '../models/index';
import {
AccountInfoDTOFromJSON,
AccountInfoDTOToJSON,
AdjustedTimesheetDTOFromJSON,
AdjustedTimesheetDTOToJSON,
AdjustedTimesheetEntryDTOFromJSON,
AdjustedTimesheetEntryDTOToJSON,
AdjustedTimesheetUpdateEntryDTOFromJSON,
AdjustedTimesheetUpdateEntryDTOToJSON,
ClientDTOFromJSON,
ClientDTOToJSON,
CompanyDTOFromJSON,
CompanyDTOToJSON,
CreateEmployeeInvoiceInputDTOFromJSON,
CreateEmployeeInvoiceInputDTOToJSON,
CreateGithubUserDTOFromJSON,
CreateGithubUserDTOToJSON,
CreateJiraAccountDTOFromJSON,
CreateJiraAccountDTOToJSON,
CreateJiraUserDTOFromJSON,
CreateJiraUserDTOToJSON,
CreateTokenResponseDTOFromJSON,
CreateTokenResponseDTOToJSON,
CreateUserDTOFromJSON,
CreateUserDTOToJSON,
EmployeeDTOFromJSON,
EmployeeDTOToJSON,
EmployeeInvoiceDTOFromJSON,
EmployeeInvoiceDTOToJSON,
EmployeeUpdateDTOFromJSON,
EmployeeUpdateDTOToJSON,
ErrorDTOFromJSON,
ErrorDTOToJSON,
GithubAccountDTOFromJSON,
GithubAccountDTOToJSON,
GithubCommitCountDTOFromJSON,
GithubCommitCountDTOToJSON,
GithubUserDTOFromJSON,
GithubUserDTOToJSON,
GlobalTimesheetDTOFromJSON,
GlobalTimesheetDTOToJSON,
GlobalTimesheetEntryDTOFromJSON,
GlobalTimesheetEntryDTOToJSON,
GlobalTimesheetEntryUpdateDTOFromJSON,
GlobalTimesheetEntryUpdateDTOToJSON,
HolidayCreateDTOFromJSON,
HolidayCreateDTOToJSON,
HolidayDTOFromJSON,
HolidayDTOToJSON,
JiraAccountDTOFromJSON,
JiraAccountDTOToJSON,
JiraUserDTOFromJSON,
JiraUserDTOToJSON,
MarkEmployeeInvoicePaidDTOFromJSON,
MarkEmployeeInvoicePaidDTOToJSON,
MarkInvoicePaidDTOFromJSON,
MarkInvoicePaidDTOToJSON,
PaginatedAdjustedTimesheetsFromJSON,
PaginatedAdjustedTimesheetsToJSON,
PaginatedClientInvoicesFromJSON,
PaginatedClientInvoicesToJSON,
PaginatedClientsFromJSON,
PaginatedClientsToJSON,
PaginatedEmployeeInvoicesFromJSON,
PaginatedEmployeeInvoicesToJSON,
PaginatedEmployeeProjectsFromJSON,
PaginatedEmployeeProjectsToJSON,
PaginatedEmployeesFromJSON,
PaginatedEmployeesToJSON,
PaginatedGlobalTimesheetsFromJSON,
PaginatedGlobalTimesheetsToJSON,
PaginatedHolidaysDTOFromJSON,
PaginatedHolidaysDTOToJSON,
PaginatedProjectsFromJSON,
PaginatedProjectsToJSON,
PaginatedTimesheetsFromJSON,
PaginatedTimesheetsToJSON,
PaginatedTokensFromJSON,
PaginatedTokensToJSON,
PaginatedUsersFromJSON,
PaginatedUsersToJSON,
ProjectDTOFromJSON,
ProjectDTOToJSON,
ProjectInputDTOFromJSON,
ProjectInputDTOToJSON,
ProjectUpdateDTOFromJSON,
ProjectUpdateDTOToJSON,
RolePermissionsDTOFromJSON,
RolePermissionsDTOToJSON,
SlackAccountResponseDTOFromJSON,
SlackAccountResponseDTOToJSON,
SlackUserDTOFromJSON,
SlackUserDTOToJSON,
TeamUpdateDTOFromJSON,
TeamUpdateDTOToJSON,
TimesheetDTOFromJSON,
TimesheetDTOToJSON,
TimesheetEntryUpdateDTOFromJSON,
TimesheetEntryUpdateDTOToJSON,
TokenDTOFromJSON,
TokenDTOToJSON,
TokenInputDTOFromJSON,
TokenInputDTOToJSON,
TokenValidationErrorDTOFromJSON,
TokenValidationErrorDTOToJSON,
UpdateUserDTOFromJSON,
UpdateUserDTOToJSON,
} from '../models/index';
export interface AddJiraAccountRequest {
createJiraAccountDTO: CreateJiraAccountDTO;
}
export interface ApproveAdjustedTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface ApproveGlobalTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface ApproveTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface CreateClientRequest {
clientDTO: ClientDTO;
}
export interface CreateCompanyRequest {
companyDTO: CompanyDTO;
}
export interface CreateEmployeeInvoiceRequest {
userId: string;
createEmployeeInvoiceInputDTO: CreateEmployeeInvoiceInputDTO;
}
export interface CreateGithubUserRequest {
createGithubUserDTO: CreateGithubUserDTO;
}
export interface CreateHolidayRequest {
holidayCreateDTO: HolidayCreateDTO;
}
export interface CreateJiraUserRequest {
createJiraUserDTO: CreateJiraUserDTO;
}
export interface CreateProjectRequest {
projectInputDTO: ProjectInputDTO;
}
export interface CreateSlackUserRequest {
createUserDTO: CreateUserDTO;
}
export interface CreateTokenRequest {
tokenInputDTO: TokenInputDTO;
}
export interface DeleteClientRequest {
clientId: string;
}
export interface DeleteCompanyRequest {
companyId: string;
}
export interface DeleteEmployeeRequest {
userId: string;
}
export interface DeleteEmployeeInvoiceRequest {
userId: string;
employeeInvoiceId: string;
}
export interface DeleteHolidayRequest {
holidayId: string;
}
export interface DeleteProjectRequest {
projectId: string;
}
export interface DeleteTokenRequest {
tokenId: string;
}
export interface DownloadAdjustedTimesheetPdfRequest {
projectId: string;
timesheetId: string;
}
export interface DownloadClientInvoicePdfRequest {
invoiceId: string;
clientId: string;
}
export interface DownloadEmployeeInvoicePdfRequest {
userId: string;
employeeInvoiceId: string;
}
export interface DownloadGlobalTimesheetPdfRequest {
projectId: string;
timesheetId: string;
}
export interface DownloadTimesheetPdfRequest {
projectId: string;
timesheetId: string;
}
export interface GetAdjustedTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface GetAdjustedTimesheetsRequest {
projectId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetClientByIdRequest {
clientId: string;
}
export interface GetClientInvoicesRequest {
clientId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetClientsRequest {
page?: number;
pageSize?: number;
search?: string;
}
export interface GetCommitsByUserIDRequest {
userId: string;
from: Date;
to: Date;
groupBy?: GetCommitsByUserIDGroupByEnum;
}
export interface GetCompaniesRequest {
search?: string;
}
export interface GetCompanyRequest {
companyId: string;
}
export interface GetEmployeeRequest {
userId: string;
}
export interface GetEmployeeInvoicesRequest {
userId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetEmployeeTimesheetsRequest {
projectId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetEmployeesRequest {
page?: number;
pageSize?: number;
activated?: boolean;
search?: string;
}
export interface GetGlobalTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface GetGlobalTimesheetsRequest {
projectId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetHolidaysRequest {
page?: number;
pageSize?: number;
search?: string;
}
export interface GetHolidaysByEmployeeRequest {
userId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetMyCommitsRequest {
from: Date;
to: Date;
groupBy?: GetMyCommitsGroupByEnum;
}
export interface GetProjectByIdRequest {
projectId: string;
}
export interface GetProjectsRequest {
page?: number;
pageSize?: number;
search?: string;
}
export interface GetProjectsAsEmployeeRequest {
page?: number;
pageSize?: number;
search?: string;
}
export interface GetTeamRequest {
projectId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface GetTimesheetsRequest {
projectId: string;
page?: number;
pageSize?: number;
search?: string;
}
export interface GetTokenRequest {
tokenId: string;
}
export interface GetUserTokensRequest {
page?: number;
pageSize?: number;
}
export interface InviteEmployeeRequest {
employeeDTO: EmployeeDTO;
}
export interface MarkEmployeeInvoiceAsPaidRequest {
userId: string;
employeeInvoiceId: string;
markEmployeeInvoicePaidDTO: MarkEmployeeInvoicePaidDTO;
}
export interface MarkInvoiceAsPaidRequest {
clientId: string;
invoiceId: string;
markInvoicePaidDTO: MarkInvoicePaidDTO;
}
export interface OpenSentTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface RemoveJiraAccountRequest {
jiraAccountId: string;
}
export interface SendTimesheetRequest {
projectId: string;
timesheetId: string;
}
export interface UpdateAdjustedEntryRequest {
projectId: string;
timesheetId: string;
entryId: string;
adjustedTimesheetUpdateEntryDTO: AdjustedTimesheetUpdateEntryDTO;
}
export interface UpdateClientRequest {
clientId: string;
clientDTO: ClientDTO;
}
export interface UpdateCompanyRequest {
companyId: string;
companyDTO: CompanyDTO;
}
export interface UpdateEmployeeDataRequest {
userId: string;
employeeUpdateDTO: EmployeeUpdateDTO;
}
export interface UpdateGlobalTimesheetEntryRequest {
projectId: string;
timesheetId: string;
entryId: string;
globalTimesheetEntryUpdateDTO: GlobalTimesheetEntryUpdateDTO;
}
export interface UpdateProjectRequest {
projectId: string;
projectUpdateDTO: ProjectUpdateDTO;
}
export interface UpdateSlackUserRequest {
userId: string;
updateUserDTO: UpdateUserDTO;
}
export interface UpdateTeamRequest {
projectId: string;
teamUpdateDTO: TeamUpdateDTO;
}
export interface UpdateTimesheetEntryRequest {
projectId: string;
timesheetId: string;
entryId: string;
timesheetEntryUpdateDTO: TimesheetEntryUpdateDTO;
}
/**
*
*/
export 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: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraAccountDTO>> {
if (requestParameters.createJiraAccountDTO === null || requestParameters.createJiraAccountDTO === undefined) {
throw new runtime.RequiredError('createJiraAccountDTO','Required parameter requestParameters.createJiraAccountDTO was null or undefined when calling addJiraAccount.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/jira-users/jira-accounts`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateJiraAccountDTOToJSON(requestParameters.createJiraAccountDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => JiraAccountDTOFromJSON(jsonValue));
}
/**
* Add a new jira account to the current user
* Add a new jira account to the user
*/
async addJiraAccount(requestParameters: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraAccountDTO> {
const response = await this.addJiraAccountRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Approve an adjustedTimesheet in a project
* Approve an adjustedTimesheet in a project
*/
async approveAdjustedTimesheetRaw(requestParameters: ApproveAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveAdjustedTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveAdjustedTimesheet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/adjusted-timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Approve an adjustedTimesheet in a project
* Approve an adjustedTimesheet in a project
*/
async approveAdjustedTimesheet(requestParameters: ApproveAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.approveAdjustedTimesheetRaw(requestParameters, initOverrides);
}
/**
* Approve a global timesheet
* Approve a global timesheet
*/
async approveGlobalTimesheetRaw(requestParameters: ApproveGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveGlobalTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveGlobalTimesheet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/global-timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Approve a global timesheet
* Approve a global timesheet
*/
async approveGlobalTimesheet(requestParameters: ApproveGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.approveGlobalTimesheetRaw(requestParameters, initOverrides);
}
/**
* Approve a timesheet
* Approve a timesheet
*/
async approveTimesheetRaw(requestParameters: ApproveTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling approveTimesheet.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling approveTimesheet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/timesheets/{timesheetId}/approve`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Approve a timesheet
* Approve a timesheet
*/
async approveTimesheet(requestParameters: ApproveTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.approveTimesheetRaw(requestParameters, initOverrides);
}
/**
* Create client
*/
async createClientRaw(requestParameters: CreateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientDTO>> {
if (requestParameters.clientDTO === null || requestParameters.clientDTO === undefined) {
throw new runtime.RequiredError('clientDTO','Required parameter requestParameters.clientDTO was null or undefined when calling createClient.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/clients`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ClientDTOToJSON(requestParameters.clientDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ClientDTOFromJSON(jsonValue));
}
/**
* Create client
*/
async createClient(requestParameters: CreateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientDTO> {
const response = await this.createClientRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a company
* Creates a new company
*/
async createCompanyRaw(requestParameters: CreateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompanyDTO>> {
if (requestParameters.companyDTO === null || requestParameters.companyDTO === undefined) {
throw new runtime.RequiredError('companyDTO','Required parameter requestParameters.companyDTO was null or undefined when calling createCompany.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/companies`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CompanyDTOToJSON(requestParameters.companyDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CompanyDTOFromJSON(jsonValue));
}
/**
* Create a company
* Creates a new company
*/
async createCompany(requestParameters: CreateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompanyDTO> {
const response = await this.createCompanyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create an employee invoice
* Create an employee invoice
*/
async createEmployeeInvoiceRaw(requestParameters: CreateEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeInvoiceDTO>> {
if (requestParameters.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: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees/{userId}/invoices`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateEmployeeInvoiceInputDTOToJSON(requestParameters.createEmployeeInvoiceInputDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeInvoiceDTOFromJSON(jsonValue));
}
/**
* Create an employee invoice
* Create an employee invoice
*/
async createEmployeeInvoice(requestParameters: CreateEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmployeeInvoiceDTO> {
const response = await this.createEmployeeInvoiceRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a new GitHub user account
* Create GitHub user
*/
async createGithubUserRaw(requestParameters: CreateGithubUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GithubUserDTO>> {
if (requestParameters.createGithubUserDTO === null || requestParameters.createGithubUserDTO === undefined) {
throw new runtime.RequiredError('createGithubUserDTO','Required parameter requestParameters.createGithubUserDTO was null or undefined when calling createGithubUser.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/github-users`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateGithubUserDTOToJSON(requestParameters.createGithubUserDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => GithubUserDTOFromJSON(jsonValue));
}
/**
* Create a new GitHub user account
* Create GitHub user
*/
async createGithubUser(requestParameters: CreateGithubUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GithubUserDTO> {
const response = await this.createGithubUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Allows a user to add a holiday
*/
async createHolidayRaw(requestParameters: CreateHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HolidayDTO>> {
if (requestParameters.holidayCreateDTO === null || requestParameters.holidayCreateDTO === undefined) {
throw new runtime.RequiredError('holidayCreateDTO','Required parameter requestParameters.holidayCreateDTO was null or undefined when calling createHoliday.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/holidays`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HolidayCreateDTOToJSON(requestParameters.holidayCreateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HolidayDTOFromJSON(jsonValue));
}
/**
* Allows a user to add a holiday
*/
async createHoliday(requestParameters: CreateHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HolidayDTO> {
const response = await this.createHolidayRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a new user with the provided information Collaborator role required
* Create a new user
*/
async createJiraUserRaw(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraUserDTO>> {
if (requestParameters.createJiraUserDTO === null || requestParameters.createJiraUserDTO === undefined) {
throw new runtime.RequiredError('createJiraUserDTO','Required parameter requestParameters.createJiraUserDTO was null or undefined when calling createJiraUser.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/jira-users`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateJiraUserDTOToJSON(requestParameters.createJiraUserDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => JiraUserDTOFromJSON(jsonValue));
}
/**
* Create a new user with the provided information Collaborator role required
* Create a new user
*/
async createJiraUser(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraUserDTO> {
const response = await this.createJiraUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a project
* Creates a new project
*/
async createProjectRaw(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDTO>> {
if (requestParameters.projectInputDTO === null || requestParameters.projectInputDTO === undefined) {
throw new runtime.RequiredError('projectInputDTO','Required parameter requestParameters.projectInputDTO was null or undefined when calling createProject.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ProjectInputDTOToJSON(requestParameters.projectInputDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ProjectDTOFromJSON(jsonValue));
}
/**
* Create a project
* Creates a new project
*/
async createProject(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDTO> {
const response = await this.createProjectRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a new Slack user account
* Create Slack user
*/
async createSlackUserRaw(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackAccountResponseDTO>> {
if (requestParameters.createUserDTO === null || requestParameters.createUserDTO === undefined) {
throw new runtime.RequiredError('createUserDTO','Required parameter requestParameters.createUserDTO was null or undefined when calling createSlackUser.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/slackbot-users`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateUserDTOToJSON(requestParameters.createUserDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => SlackAccountResponseDTOFromJSON(jsonValue));
}
/**
* Create a new Slack user account
* Create Slack user
*/
async createSlackUser(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackAccountResponseDTO> {
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: CreateTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTokenResponseDTO>> {
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: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/pats`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: TokenInputDTOToJSON(requestParameters.tokenInputDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CreateTokenResponseDTOFromJSON(jsonValue));
}
/**
* Create a new API token
* Create a new API token with role-based permissions
*/
async createToken(requestParameters: CreateTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTokenResponseDTO> {
const response = await this.createTokenRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Delete client
* Delete client
*/
async deleteClientRaw(requestParameters: DeleteClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
throw new runtime.RequiredError('clientId','Required parameter requestParameters.clientId was null or undefined when calling deleteClient.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/clients/{clientId}`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete client
* Delete client
*/
async deleteClient(requestParameters: DeleteClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteClientRaw(requestParameters, initOverrides);
}
/**
* Delete a company
* Delete a company
*/
async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.companyId === null || requestParameters.companyId === undefined) {
throw new runtime.RequiredError('companyId','Required parameter requestParameters.companyId was null or undefined when calling deleteCompany.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters.companyId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a company
* Delete a company
*/
async deleteCompany(requestParameters: DeleteCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteCompanyRaw(requestParameters, initOverrides);
}
/**
* Delete an employee
* Delete an employee
*/
async deleteEmployeeRaw(requestParameters: DeleteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.userId === null || requestParameters.userId === undefined) {
throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteEmployee.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees/{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: DeleteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteEmployeeRaw(requestParameters, initOverrides);
}
/**
* Delete an employee invoice
* Delete an employee invoice
*/
async deleteEmployeeInvoiceRaw(requestParameters: DeleteEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
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: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/employees/{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: DeleteEmployeeInvoiceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteEmployeeInvoiceRaw(requestParameters, initOverrides);
}
/**
* Delete the authenticated user\'s GitHub account
* Delete GitHub user
*/
async deleteGithubUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/github-users`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete the authenticated user\'s GitHub account
* Delete GitHub user
*/
async deleteGithubUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteGithubUserRaw(initOverrides);
}
/**
* Delete a holiday
* Delete a holiday
*/
async deleteHolidayRaw(requestParameters: DeleteHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.holidayId === null || requestParameters.holidayId === undefined) {
throw new runtime.RequiredError('holidayId','Required parameter requestParameters.holidayId was null or undefined when calling deleteHoliday.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/holidays/{holidayId}`.replace(`{${"holidayId"}}`, encodeURIComponent(String(requestParameters.holidayId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a holiday
* Delete a holiday
*/
async deleteHoliday(requestParameters: DeleteHolidayRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteHolidayRaw(requestParameters, initOverrides);
}
/**
* Delete a project
* Delete a project
*/
async deleteProjectRaw(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling deleteProject.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a project
* Delete a project
*/
async deleteProject(requestParameters: DeleteProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteProjectRaw(requestParameters, initOverrides);
}
/**
* Delete the authenticated user\'s Slack account
* Delete Slack user
*/
async deleteSlackUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/slackbot-users`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete the authenticated user\'s Slack account
* Delete Slack user
*/
async deleteSlackUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteSlackUserRaw(initOverrides);
}
/**
* Delete token
* Delete an API token by ID
*/
async deleteTokenRaw(requestParameters: DeleteTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
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: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/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: DeleteTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteTokenRaw(requestParameters, initOverrides);
}
/**
* Download an AdjustedTimesheet report in PDF format
* Download an AdjustedTimesheet report in PDF format
*/
async downloadAdjustedTimesheetPdfRaw(requestParameters: DownloadAdjustedTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling downloadAdjustedTimesheetPdf.');
}
if (requestParameters.timesheetId === null || requestParameters.timesheetId === undefined) {
throw new runtime.RequiredError('timesheetId','Required parameter requestParameters.timesheetId was null or undefined when calling downloadAdjustedTimesheetPdf.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects/{projectId}/adjusted-timesheets/{timesheetId}/download`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"timesheetId"}}`, encodeURIComponent(String(requestParameters.timesheetId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Download an AdjustedTimesheet report in PDF format
* Download an AdjustedTimesheet report in PDF format
*/
async downloadAdjustedTimesheetPdf(requestParameters: DownloadAdjustedTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.downloadAdjustedTimesheetPdfRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Download client invoice pdf
* Download client invoice pdf
*/
async downloadClientInvoicePdfRaw(requestParameters: DownloadClientInvoicePdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters.invoiceId === null || requestParameters.invoiceId === undefined) {
th