tuix-timesheets-api
Version:
This package facilitates the client request to tuix timesheets api
3,666 lines • 151 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,
PdfTemplateDTO,
ProjectDTO,
ProjectInputDTO,
ProjectUpdateDTO,
RolePermissionsDTO,
SlackAccountReponseDto,
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,
PdfTemplateDTOFromJSON,
PdfTemplateDTOToJSON,
ProjectDTOFromJSON,
ProjectDTOToJSON,
ProjectInputDTOFromJSON,
ProjectInputDTOToJSON,
ProjectUpdateDTOFromJSON,
ProjectUpdateDTOToJSON,
RolePermissionsDTOFromJSON,
RolePermissionsDTOToJSON,
SlackAccountReponseDtoFromJSON,
SlackAccountReponseDtoToJSON,
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 GetPdfTemplateRequest {
id: string;
}
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 UpdateSlackbotUserRequest {
userId: string;
updateUserDto: UpdateUserDto;
}
export interface UpdateTeamRequest {
projectId: string;
teamUpdateDTO: TeamUpdateDTO;
}
export interface UpdateTimesheetEntryRequest {
projectId: string;
timesheetId: string;
entryId: string;
timesheetEntryUpdateDTO: TimesheetEntryUpdateDTO;
}
export interface UploadPdfTemplateRequest {
file: Blob;
name: string;
}
/**
*
*/
export class TuixTimesheetsClientApi extends runtime.BaseAPI {
/**
* Add a new jira account to the user
*/
async addJiraAccountRaw(requestParameters: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraAccountDto>> {
if (requestParameters.createJiraAccountDto === null || requestParameters.createJiraAccountDto === undefined) {
throw new runtime.RequiredError('createJiraAccountDto','Required parameter requestParameters.createJiraAccountDto was null or undefined when calling addJiraAccount.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/jira-users/jira-accounts`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateJiraAccountDtoToJSON(requestParameters.createJiraAccountDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => JiraAccountDtoFromJSON(jsonValue));
}
/**
* Add a new jira account to the user
*/
async addJiraAccount(requestParameters: AddJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraAccountDto> {
const response = await this.addJiraAccountRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* 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
*/
async createJiraUserRaw(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraUserDto>> {
if (requestParameters.createJiraUserDto === null || requestParameters.createJiraUserDto === undefined) {
throw new runtime.RequiredError('createJiraUserDto','Required parameter requestParameters.createJiraUserDto was null or undefined when calling createJiraUser.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/jira-users`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateJiraUserDtoToJSON(requestParameters.createJiraUserDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => JiraUserDtoFromJSON(jsonValue));
}
/**
* Create a new user
*/
async createJiraUser(requestParameters: CreateJiraUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraUserDto> {
const response = await this.createJiraUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a project
* Creates a new project
*/
async createProjectRaw(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDTO>> {
if (requestParameters.projectInputDTO === null || requestParameters.projectInputDTO === undefined) {
throw new runtime.RequiredError('projectInputDTO','Required parameter requestParameters.projectInputDTO was null or undefined when calling createProject.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/projects`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ProjectInputDTOToJSON(requestParameters.projectInputDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ProjectDTOFromJSON(jsonValue));
}
/**
* Create a project
* Creates a new project
*/
async createProject(requestParameters: CreateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDTO> {
const response = await this.createProjectRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async createSlackUserRaw(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackAccountReponseDto>> {
if (requestParameters.createUserDto === null || requestParameters.createUserDto === undefined) {
throw new runtime.RequiredError('createUserDto','Required parameter requestParameters.createUserDto was null or undefined when calling createSlackUser.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/slackbot-users`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateUserDtoToJSON(requestParameters.createUserDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => SlackAccountReponseDtoFromJSON(jsonValue));
}
/**
*
*/
async createSlackUser(requestParameters: CreateSlackUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackAccountReponseDto> {
const response = await this.createSlackUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* 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);
}
/**
*
*/
async deleteSlackUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const response = await this.request({
path: `/slackbot-users`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*
*/
async deleteSlackUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteSlackUserRaw(initOverrides);
}
/**
* 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) {
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: 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}/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<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Download client invoice pdf
* Download client invoice pdf
*/
async downloadClientInvoicePdf(requestParameters: DownloadClientInvoicePdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
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: DownloadEmployeeInvoicePdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
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: 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}/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<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Download the employee invoice report in PDF format
* Download the employee invoice report in PDF format
*/
async downloadEmployeeInvoicePdf(requestParameters: DownloadEmployeeInvoicePdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
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: DownloadGlobalTimesheetPdfRequest, 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 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: 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}/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 a global timesheet report in PDF format
* Download a global timesheet report in PDF format
*/
async downloadGlobalTimesheetPdf(requestParameters: DownloadGlobalTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
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: DownloadTimesheetPdfRequest, 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 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: 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}/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 a timesheet report in PDF format
* Download a timesheet report in PDF format
*/
async downloadTimesheetPdf(requestParameters: DownloadTimesheetPdfRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.downloadTimesheetPdfRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get an adjustedTimesheet
* Get an adjustedTimesheet
*/
async getAdjustedTimesheetRaw(requestParameters: GetAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdjustedTimesheetDTO>> {
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: 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}`.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) => AdjustedTimesheetDTOFromJSON(jsonValue));
}
/**
* Get an adjustedTimesheet
* Get an adjustedTimesheet
*/
async getAdjustedTimesheet(requestParameters: GetAdjustedTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdjustedTimesheetDTO> {
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: GetAdjustedTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedAdjustedTimesheets>> {
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: any = {};
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: 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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedAdjustedTimesheetsFromJSON(jsonValue));
}
/**
* Get all adjustedTimesheets in a project
* Get all adjustedTimesheets in a project
*/
async getAdjustedTimesheets(requestParameters: GetAdjustedTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedAdjustedTimesheets> {
const response = await this.getAdjustedTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get client by id
*/
async getClientByIdRaw(requestParameters: GetClientByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientDTO>> {
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: 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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ClientDTOFromJSON(jsonValue));
}
/**
* Get client by id
*/
async getClientById(requestParameters: GetClientByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientDTO> {
const response = await this.getClientByIdRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all invoices from client
* Get all invoices from client
*/
async getClientInvoicesRaw(requestParameters: GetClientInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedClientInvoices>> {
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: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedClientInvoicesFromJSON(jsonValue));
}
/**
* Get all invoices from client
* Get all invoices from client
*/
async getClientInvoices(requestParameters: GetClientInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedClientInvoices> {
const response = await this.getClientInvoicesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all clients from company
* Get all clients from company
*/
async getClientsRaw(requestParameters: GetClientsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedClients>> {
const queryParameters: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedClientsFromJSON(jsonValue));
}
/**
* Get all clients from company
* Get all clients from company
*/
async getClients(requestParameters: GetClientsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedClients> {
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: GetCommitsByUserIDRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GithubCommitCountDTO>>> {
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: any = {};
if (requestParameters.from !== undefined) {
queryParameters['from'] = (requestParameters.from as any).toISOString().substring(0,10);
}
if (requestParameters.to !== undefined) {
queryParameters['to'] = (requestParameters.to as any).toISOString().substring(0,10);
}
if (requestParameters.groupBy !== undefined) {
queryParameters['groupBy'] = requestParameters.groupBy;
}
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}/commits`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GithubCommitCountDTOFromJSON));
}
/**
* Get commit statistics for a specific user
* Get commits by user ID
*/
async getCommitsByUserID(requestParameters: GetCommitsByUserIDRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GithubCommitCountDTO>> {
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: GetCompaniesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CompanyDTO>>> {
const queryParameters: any = {};
if (requestParameters.search !== undefined) {
queryParameters['search'] = requestParameters.search;
}
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`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CompanyDTOFromJSON));
}
/**
* Get all companies a user belongs to
* Get all companies a user belongs to
*/
async getCompanies(requestParameters: GetCompaniesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CompanyDTO>> {
const response = await this.getCompaniesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a company
* Get a company by ID
*/
async getCompanyRaw(requestParameters: GetCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompanyDTO>> {
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: 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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CompanyDTOFromJSON(jsonValue));
}
/**
* Get a company
* Get a company by ID
*/
async getCompany(requestParameters: GetCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompanyDTO> {
const response = await this.getCompanyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get employee info
* Get employee info
*/
async getEmployeeRaw(requestParameters: GetEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeDTO>> {
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: 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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeDTOFromJSON(jsonValue));
}
/**
* Get employee info
* Get employee info
*/
async getEmployee(requestParameters: GetEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmployeeDTO> {
const response = await this.getEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all employee invoices
* Get all employee invoices
*/
async getEmployeeInvoicesRaw(requestParameters: GetEmployeeInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedEmployeeInvoices>> {
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: any = {};
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: 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`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedEmployeeInvoicesFromJSON(jsonValue));
}
/**
* Get all employee invoices
* Get all employee invoices
*/
async getEmployeeInvoices(requestParameters: GetEmployeeInvoicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedEmployeeInvoices> {
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: GetEmployeeTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedTimesheets>> {
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: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedTimesheetsFromJSON(jsonValue));
}
/**
* Get all timesheets of an employee in a project
* Get all timesheets of an employee in a project
*/
async getEmployeeTimesheets(requestParameters: GetEmployeeTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedTimesheets> {
const response = await this.getEmployeeTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* List employees
* List employees
*/
async getEmployeesRaw(requestParameters: GetEmployeesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedEmployees>> {
const queryParameters: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedEmployeesFromJSON(jsonValue));
}
/**
* List employees
* List employees
*/
async getEmployees(requestParameters: GetEmployeesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedEmployees> {
const response = await this.getEmployeesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get GitHub account for the authenticated user
* Get GitHub account
*/
async getGithubAccountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GithubAccountDTO>> {
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-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => GithubAccountDTOFromJSON(jsonValue));
}
/**
* Get GitHub account for the authenticated user
* Get GitHub account
*/
async getGithubAccount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GithubAccountDTO> {
const response = await this.getGithubAccountRaw(initOverrides);
return await response.value();
}
/**
* Get a global timesheet
* Get a global timesheet
*/
async getGlobalTimesheetRaw(requestParameters: GetGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalTimesheetDTO>> {
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: 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}`.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) => GlobalTimesheetDTOFromJSON(jsonValue));
}
/**
* Get a global timesheet
* Get a global timesheet
*/
async getGlobalTimesheet(requestParameters: GetGlobalTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalTimesheetDTO> {
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: GetGlobalTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedGlobalTimesheets>> {
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: any = {};
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: 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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedGlobalTimesheetsFromJSON(jsonValue));
}
/**
* Get all global timesheets in a project
* Get all global timesheets in a project
*/
async getGlobalTimesheets(requestParameters: GetGlobalTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedGlobalTimesheets> {
const response = await this.getGlobalTimesheetsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns a paginated list of a user\'s holidays
*/
async getHolidaysRaw(requestParameters: GetHolidaysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedHolidaysDTO>> {
const queryParameters: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedHolidaysDTOFromJSON(jsonValue));
}
/**
* Returns a paginated list of a user\'s holidays
*/
async getHolidays(requestParameters: GetHolidaysRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedHolidaysDTO> {
const response = await this.getHolidaysRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* returns a paginated list of a user\'s holidays
*/
async getHolidaysByEmployeeRaw(requestParameters: GetHolidaysByEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedHolidaysDTO>> {
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: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedHolidaysDTOFromJSON(jsonValue));
}
/**
* returns a paginated list of a user\'s holidays
*/
async getHolidaysByEmployee(requestParameters: GetHolidaysByEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedHolidaysDTO> {
const response = await this.getHolidaysByEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get jira accounts
*/
async getJiraAccountsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<JiraAccountDto>>> {
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: `/jira-users/jira-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(JiraAccountDtoFromJSON));
}
/**
* Get jira accounts
*/
async getJiraAccounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<JiraAccountDto>> {
const response = await this.getJiraAccountsRaw(initOverrides);
return await response.value();
}
/**
* Get user
*/
async getJiraUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JiraUserDto>> {
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: `/jira-users`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => JiraUserDtoFromJSON(jsonValue));
}
/**
* Get user
*/
async getJiraUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JiraUserDto> {
const response = await this.getJiraUserRaw(initOverrides);
return await response.value();
}
/**
* Get my account info
* Get my account info
*/
async getMyAccountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountInfoDTO>> {
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: `/me`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AccountInfoDTOFromJSON(jsonValue));
}
/**
* Get my account info
* Get my account info
*/
async getMyAccount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountInfoDTO> {
const response = await this.getMyAccountRaw(initOverrides);
return await response.value();
}
/**
* Get commit statistics for the authenticated user
* Get my commits
*/
async getMyCommitsRaw(requestParameters: GetMyCommitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GithubCommitCountDTO>>> {
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: any = {};
if (requestParameters.from !== undefined) {
queryParameters['from'] = (requestParameters.from as any).toISOString().substring(0,10);
}
if (requestParameters.to !== undefined) {
queryParameters['to'] = (requestParameters.to as any).toISOString().substring(0,10);
}
if (requestParameters.groupBy !== undefined) {
queryParameters['groupBy'] = requestParameters.groupBy;
}
const headerParameters: runtime.HTTPHeaders = {};
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(GithubCommitCountDTOFromJSON));
}
/**
* Get commit statistics for the authenticated user
* Get my commits
*/
async getMyCommits(requestParameters: GetMyCommitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GithubCommitCountDTO>> {
const response = await this.getMyCommitsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get template by id
* Get template by id
*/
async getPdfTemplateRaw(requestParameters: GetPdfTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
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: 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: `/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<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Get template by id
* Get template by id
*/
async getPdfTemplate(requestParameters: GetPdfTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.getPdfTemplateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get all templates
* Get all templates
*/
async getPdfTemplatesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PdfTemplateDTO>>> {
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: `/pdf-templates`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PdfTemplateDTOFromJSON));
}
/**
* Get all templates
* Get all templates
*/
async getPdfTemplates(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PdfTemplateDTO>> {
const response = await this.getPdfTemplatesRaw(initOverrides);
return await response.value();
}
/**
* Get a project
* Get a project by ID
*/
async getProjectByIdRaw(requestParameters: GetProjectByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDTO>> {
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: 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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ProjectDTOFromJSON(jsonValue));
}
/**
* Get a project
* Get a project by ID
*/
async getProjectById(requestParameters: GetProjectByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDTO> {
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: GetProjectsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedProjects>> {
const queryParameters: any = {};
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: runtime.HTTPHeaders = {};
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) => 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: GetProjectsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedProjects> {
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: GetProjectsAsEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedEmployeeProjects>> {
const queryParameters: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedEmployeeProjectsFromJSON(jsonValue));
}
/**
* Get all projects an employee has access to
* Get all projects an employee has access to
*/
async getProjectsAsEmployee(requestParameters: GetProjectsAsEmployeeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedEmployeeProjects> {
const response = await this.getProjectsAsEmployeeRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async getSlackAccountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackAccountReponseDto>> {
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: `/slack-accounts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => SlackAccountReponseDtoFromJSON(jsonValue));
}
/**
*
*/
async getSlackAccount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackAccountReponseDto> {
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: GetTeamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedUsers>> {
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: any = {};
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: runtime.HTTPHeaders = {};
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) => PaginatedUsersFromJSON(jsonValue));
}
/**
* Get all users in a project
* Get all users in a project
*/
async getTeam(requestParameters: GetTeamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedUsers> {
const response = await this.getTeamRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a timesheet
* Get a timesheet
*/
async getTimesheetRaw(requestParameters: GetTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimesheetDTO>> {
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: 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}`.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) => TimesheetDTOFromJSON(jsonValue));
}
/**
* Get a timesheet
* Get a timesheet
*/
async getTimesheet(requestParameters: GetTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimesheetDTO> {
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: GetTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedTimesheets>> {
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: any = {};
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: 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`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTimesheetsFromJSON(jsonValue));
}
/**
* Get all timesheets in a project without timesheet entries.
* Get all timesheets in a project without timesheet entries.
*/
async getTimesheets(requestParameters: GetTimesheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedTimesheets> {
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: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenDTO>> {
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: 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: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => TokenDTOFromJSON(jsonValue));
}
/**
* Get token by ID
* Get a specific API token by ID
*/
async getToken(requestParameters: GetTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenDTO> {
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?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RolePermissionsDTO>> {
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: `/permissions`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RolePermissionsDTOFromJSON(jsonValue));
}
/**
* Get permissions for current user
* Get all available permissions for current user based on their role
*/
async getUserPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RolePermissionsDTO> {
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: GetUserTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedTokens>> {
const queryParameters: any = {};
if (requestParameters.page !== undefined) {
queryParameters['page'] = requestParameters.page;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
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`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTokensFromJSON(jsonValue));
}
/**
* Get all tokens for current user with pagination
* Get all API tokens for current user with pagination
*/
async getUserTokens(requestParameters: GetUserTokensRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedTokens> {
const response = await this.getUserTokensRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async handleActionRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/slack-actions`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*
*/
async handleAction(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.handleActionRaw(initOverrides);
}
/**
* Invite an employee to a company
* Invite an employee to a company
*/
async inviteEmployeeRaw(requestParameters: InviteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeDTO>> {
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: 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/invite`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: EmployeeDTOToJSON(requestParameters.employeeDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeDTOFromJSON(jsonValue));
}
/**
* Invite an employee to a company
* Invite an employee to a company
*/
async inviteEmployee(requestParameters: InviteEmployeeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmployeeDTO> {
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: MarkEmployeeInvoiceAsPaidRequest, 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 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: 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/{employeeInvoiceId}/mark-paid`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))).replace(`{${"employeeInvoiceId"}}`, encodeURIComponent(String(requestParameters.employeeInvoiceId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: MarkEmployeeInvoicePaidDTOToJSON(requestParameters.markEmployeeInvoicePaidDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Mark an employee invoice as paid
* Mark an employee invoice as paid
*/
async markEmployeeInvoiceAsPaid(requestParameters: MarkEmployeeInvoiceAsPaidRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
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: MarkInvoiceAsPaidRequest, 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 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: 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/{clientId}/invoices/{invoiceId}/mark-paid`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))).replace(`{${"invoiceId"}}`, encodeURIComponent(String(requestParameters.invoiceId))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: 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: MarkInvoiceAsPaidRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.markInvoiceAsPaidRaw(requestParameters, initOverrides);
}
/**
* Open a sent timesheet
* Open a sent timesheet
*/
async openSentTimesheetRaw(requestParameters: OpenSentTimesheetRequest, 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 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: 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}/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: OpenSentTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.openSentTimesheetRaw(requestParameters, initOverrides);
}
/**
* Remove jira account
*/
async removeJiraAccountRaw(requestParameters: RemoveJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
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: 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: `/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: RemoveJiraAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.removeJiraAccountRaw(requestParameters, initOverrides);
}
/**
* Send a timesheet
* Send a timesheet
*/
async sendTimesheetRaw(requestParameters: SendTimesheetRequest, 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 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: 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}/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: SendTimesheetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.sendTimesheetRaw(requestParameters, initOverrides);
}
/**
* Update an adjusted timesheet entry
* Update an adjusted timesheet entry
*/
async updateAdjustedEntryRaw(requestParameters: UpdateAdjustedEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdjustedTimesheetEntryDTO>> {
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: 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/{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: AdjustedTimesheetUpdateEntryDTOToJSON(requestParameters.adjustedTimesheetUpdateEntryDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AdjustedTimesheetEntryDTOFromJSON(jsonValue));
}
/**
* Update an adjusted timesheet entry
* Update an adjusted timesheet entry
*/
async updateAdjustedEntry(requestParameters: UpdateAdjustedEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdjustedTimesheetEntryDTO> {
const response = await this.updateAdjustedEntryRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update client
*/
async updateClientRaw(requestParameters: UpdateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ClientDTO>> {
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: 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/{clientId}`.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters.clientId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: ClientDTOToJSON(requestParameters.clientDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ClientDTOFromJSON(jsonValue));
}
/**
* Update client
*/
async updateClient(requestParameters: UpdateClientRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClientDTO> {
const response = await this.updateClientRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a company
* Update a company by ID
*/
async updateCompanyRaw(requestParameters: UpdateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CompanyDTO>> {
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: 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/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters.companyId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: CompanyDTOToJSON(requestParameters.companyDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CompanyDTOFromJSON(jsonValue));
}
/**
* Update a company
* Update a company by ID
*/
async updateCompany(requestParameters: UpdateCompanyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CompanyDTO> {
const response = await this.updateCompanyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update an employee
* Update an employee
*/
async updateEmployeeDataRaw(requestParameters: UpdateEmployeeDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeDTO>> {
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: 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}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: EmployeeUpdateDTOToJSON(requestParameters.employeeUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeDTOFromJSON(jsonValue));
}
/**
* Update an employee
* Update an employee
*/
async updateEmployeeData(requestParameters: UpdateEmployeeDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmployeeDTO> {
const response = await this.updateEmployeeDataRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a global timesheet entry
* Update a global timesheet entry
*/
async updateGlobalTimesheetEntryRaw(requestParameters: UpdateGlobalTimesheetEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GlobalTimesheetEntryDTO>> {
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: 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/{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: GlobalTimesheetEntryUpdateDTOToJSON(requestParameters.globalTimesheetEntryUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => GlobalTimesheetEntryDTOFromJSON(jsonValue));
}
/**
* Update a global timesheet entry
* Update a global timesheet entry
*/
async updateGlobalTimesheetEntry(requestParameters: UpdateGlobalTimesheetEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GlobalTimesheetEntryDTO> {
const response = await this.updateGlobalTimesheetEntryRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a project
* Update a project by ID
*/
async updateProjectRaw(requestParameters: UpdateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProjectDTO>> {
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: 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/{projectId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: ProjectUpdateDTOToJSON(requestParameters.projectUpdateDTO),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ProjectDTOFromJSON(jsonValue));
}
/**
* Update a project
* Update a project by ID
*/
async updateProject(requestParameters: UpdateProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDTO> {
const response = await this.updateProjectRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*
*/
async updateSlackbotUserRaw(requestParameters: UpdateSlackbotUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SlackUserDto>> {
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: 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/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: UpdateUserDtoToJSON(requestParameters.updateUserDto),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => SlackUserDtoFromJSON(jsonValue));
}
/**
*
*/
async updateSlackbotUser(requestParameters: UpdateSlackbotUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SlackUserDto> {
const response = await this.updateSlackbotUserRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update a project team
* Update a project team
*/
async updateTeamRaw(requestParameters: UpdateTeamRequest, 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 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: 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/{projectId}/team`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: TeamUpdateDTOToJSON(requestParameters.teamUpdateDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Update a project team
* Update a project team
*/
async updateTeam(requestParameters: UpdateTeamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.updateTeamRaw(requestParameters, initOverrides);
}
/**
* Update a timesheet entry
* Update a timesheet entry
*/
async updateTimesheetEntryRaw(requestParameters: UpdateTimesheetEntryRequest, 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 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: 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/{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: TimesheetEntryUpdateDTOToJSON(requestParameters.timesheetEntryUpdateDTO),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Update a timesheet entry
* Update a timesheet entry
*/
async updateTimesheetEntry(requestParameters: UpdateTimesheetEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.updateTimesheetEntryRaw(requestParameters, initOverrides);
}
/**
* Upload template
* Upload template
*/
async uploadPdfTemplateRaw(requestParameters: UploadPdfTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PdfTemplateDTO>> {
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: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // auth0Authorizer authentication
}
const consumes: runtime.Consume[] = [
{ contentType: 'multipart/form-data' },
];
// @ts-ignore: canConsumeForm may be unused
const canConsumeForm = runtime.canConsumeForm(consumes);
let formParams: { append(param: string, value: any): any };
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 as any);
}
if (requestParameters.name !== undefined) {
formParams.append('name', requestParameters.name as any);
}
const response = await this.request({
path: `/pdf-templates`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: formParams,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => PdfTemplateDTOFromJSON(jsonValue));
}
/**
* Upload template
* Upload template
*/
async uploadPdfTemplate(requestParameters: UploadPdfTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PdfTemplateDTO> {
const response = await this.uploadPdfTemplateRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const GetCommitsByUserIDGroupByEnum = {
HourOfDay: 'hourOfDay',
Year: 'year',
Month: 'month',
Day: 'day'
} as const;
export type GetCommitsByUserIDGroupByEnum = typeof GetCommitsByUserIDGroupByEnum[keyof typeof GetCommitsByUserIDGroupByEnum];
/**
* @export
*/
export const GetMyCommitsGroupByEnum = {
HourOfDay: 'hourOfDay',
Year: 'year',
Month: 'month',
Day: 'day'
} as const;
export type GetMyCommitsGroupByEnum = typeof GetMyCommitsGroupByEnum[keyof typeof GetMyCommitsGroupByEnum];