@wastesentry/trak-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +120 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/apis/DefaultApi.ts +176 -0
- package/apis/InfoApi.ts +80 -0
- package/apis/ManifestApi.ts +604 -0
- package/apis/MyProfileApi.ts +63 -0
- package/apis/OrgsApi.ts +172 -0
- package/apis/PegasusApi.ts +336 -0
- package/apis/ProfileApi.ts +229 -0
- package/apis/SiteApi.ts +108 -0
- package/apis/SitesApi.ts +119 -0
- package/apis/SyncApi.ts +55 -0
- package/apis/TeamsApi.ts +673 -0
- package/apis/index.ts +12 -0
- package/docs/AdditionalInfo.md +41 -0
- package/docs/DefaultApi.md +235 -0
- package/docs/ESignature.md +43 -0
- package/docs/Handler.md +41 -0
- package/docs/HandlerSearch.md +34 -0
- package/docs/HandlerSearchSiteTypeEnum.md +31 -0
- package/docs/InfoApi.md +81 -0
- package/docs/Invitation.md +42 -0
- package/docs/LockReasonEnum.md +31 -0
- package/docs/Manifest.md +93 -0
- package/docs/ManifestApi.md +907 -0
- package/docs/ManifestPhone.md +35 -0
- package/docs/Membership.md +42 -0
- package/docs/Mtn.md +39 -0
- package/docs/MyProfileApi.md +73 -0
- package/docs/NullEnum.md +30 -0
- package/docs/OpenInvitation.md +38 -0
- package/docs/Org.md +39 -0
- package/docs/OrgsApi.md +232 -0
- package/docs/PaginatedInvitationList.md +38 -0
- package/docs/PaginatedMtnList.md +38 -0
- package/docs/PaginatedOrgList.md +38 -0
- package/docs/PaginatedSiteList.md +38 -0
- package/docs/PaginatedTeamList.md +38 -0
- package/docs/PaperSignature.md +35 -0
- package/docs/PatchedInvitation.md +42 -0
- package/docs/PatchedProfile.md +35 -0
- package/docs/PatchedRcrainfoProfile.md +45 -0
- package/docs/PatchedTeam.md +48 -0
- package/docs/Price.md +42 -0
- package/docs/Profile.md +35 -0
- package/docs/ProfileApi.md +241 -0
- package/docs/QuickerSign.md +43 -0
- package/docs/RcraAddress.md +45 -0
- package/docs/RcraContact.md +43 -0
- package/docs/RcraPhone.md +35 -0
- package/docs/RcraSite.md +57 -0
- package/docs/RcraSitePermission.md +45 -0
- package/docs/RcraSiteSiteTypeEnum.md +31 -0
- package/docs/RcrainfoProfile.md +45 -0
- package/docs/RoleEnum.md +31 -0
- package/docs/Signer.md +49 -0
- package/docs/Site.md +35 -0
- package/docs/SiteApi.md +147 -0
- package/docs/SiteManifestSyncRequest.md +32 -0
- package/docs/SiteManifestSyncResponse.md +32 -0
- package/docs/SitesApi.md +155 -0
- package/docs/StatusC23Enum.md +31 -0
- package/docs/Subscription.md +51 -0
- package/docs/SubscriptionItem.md +36 -0
- package/docs/SubscriptionStatusEnum.md +31 -0
- package/docs/SyncApi.md +73 -0
- package/docs/Team.md +48 -0
- package/docs/TeamsApi.md +965 -0
- package/docs/TrakUser.md +43 -0
- package/docs/Transporter.md +41 -0
- package/docs/UserInvitationsResponse.md +32 -0
- package/docs/WasteLine.md +55 -0
- package/index.ts +5 -0
- package/models/AdditionalInfo.ts +96 -0
- package/models/AggregateEmployeeData.ts +83 -0
- package/models/DepartmentEnum.ts +59 -0
- package/models/ESignature.ts +112 -0
- package/models/Employee.ts +125 -0
- package/models/Handler.ts +126 -0
- package/models/HandlerSearch.ts +84 -0
- package/models/HandlerSearchSiteTypeEnum.ts +57 -0
- package/models/Invitation.ts +116 -0
- package/models/LockReasonEnum.ts +55 -0
- package/models/Manifest.ts +353 -0
- package/models/ManifestPhone.ts +73 -0
- package/models/Membership.ts +115 -0
- package/models/Mtn.ts +98 -0
- package/models/NullEnum.ts +50 -0
- package/models/OpenInvitation.ts +88 -0
- package/models/Org.ts +88 -0
- package/models/PaginatedEmployeeList.ts +98 -0
- package/models/PaginatedInvitationList.ts +98 -0
- package/models/PaginatedMtnList.ts +98 -0
- package/models/PaginatedOrgList.ts +98 -0
- package/models/PaginatedSiteList.ts +98 -0
- package/models/PaginatedTeamList.ts +98 -0
- package/models/PaperSignature.ts +74 -0
- package/models/PatchedEmployee.ts +118 -0
- package/models/PatchedInvitation.ts +112 -0
- package/models/PatchedProfile.ts +79 -0
- package/models/PatchedRcrainfoProfile.ts +119 -0
- package/models/PatchedTeam.ts +143 -0
- package/models/Price.ts +106 -0
- package/models/Profile.ts +80 -0
- package/models/QuickerSign.ts +108 -0
- package/models/RcraAddress.ts +113 -0
- package/models/RcraContact.ts +112 -0
- package/models/RcraPhone.ts +73 -0
- package/models/RcraSite.ts +200 -0
- package/models/RcraSitePermission.ts +121 -0
- package/models/RcraSiteSiteTypeEnum.ts +57 -0
- package/models/RcrainfoProfile.ts +120 -0
- package/models/RoleEnum.ts +53 -0
- package/models/Signer.ts +136 -0
- package/models/Site.ts +81 -0
- package/models/SiteManifestSyncRequest.ts +65 -0
- package/models/SiteManifestSyncResponse.ts +65 -0
- package/models/StatusC23Enum.ts +67 -0
- package/models/StatusEnum.ts +63 -0
- package/models/Subscription.ts +168 -0
- package/models/SubscriptionItem.ts +90 -0
- package/models/SubscriptionStatusEnum.ts +63 -0
- package/models/Team.ts +151 -0
- package/models/TrakUser.ts +106 -0
- package/models/Transporter.ts +120 -0
- package/models/UserInvitationsResponse.ts +73 -0
- package/models/WasteLine.ts +157 -0
- package/models/index.ts +50 -0
- package/package.json +17 -0
- package/runtime.ts +432 -0
package/apis/OrgsApi.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* trak
|
|
5
|
+
* Hazardous waste tracking application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.7.2
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
Org,
|
|
19
|
+
PaginatedOrgList,
|
|
20
|
+
PaginatedSiteList,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
OrgFromJSON,
|
|
24
|
+
OrgToJSON,
|
|
25
|
+
PaginatedOrgListFromJSON,
|
|
26
|
+
PaginatedOrgListToJSON,
|
|
27
|
+
PaginatedSiteListFromJSON,
|
|
28
|
+
PaginatedSiteListToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface OrgsListRequest {
|
|
32
|
+
page?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface OrgsRetrieveRequest {
|
|
36
|
+
orgSlug: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface OrgsSitesListRequest {
|
|
40
|
+
orgSlug: string;
|
|
41
|
+
page?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export class OrgsApi extends runtime.BaseAPI {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* View all organizations that the user has access to.
|
|
51
|
+
*/
|
|
52
|
+
async orgsListRaw(requestParameters: OrgsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedOrgList>> {
|
|
53
|
+
const queryParameters: any = {};
|
|
54
|
+
|
|
55
|
+
if (requestParameters['page'] != null) {
|
|
56
|
+
queryParameters['page'] = requestParameters['page'];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
60
|
+
|
|
61
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
62
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
let urlPath = `/api/v1/orgs`;
|
|
67
|
+
|
|
68
|
+
const response = await this.request({
|
|
69
|
+
path: urlPath,
|
|
70
|
+
method: 'GET',
|
|
71
|
+
headers: headerParameters,
|
|
72
|
+
query: queryParameters,
|
|
73
|
+
}, initOverrides);
|
|
74
|
+
|
|
75
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOrgListFromJSON(jsonValue));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* View all organizations that the user has access to.
|
|
80
|
+
*/
|
|
81
|
+
async orgsList(requestParameters: OrgsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedOrgList> {
|
|
82
|
+
const response = await this.orgsListRaw(requestParameters, initOverrides);
|
|
83
|
+
return await response.value();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Retrieve details for a given Org.
|
|
88
|
+
*/
|
|
89
|
+
async orgsRetrieveRaw(requestParameters: OrgsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Org>> {
|
|
90
|
+
if (requestParameters['orgSlug'] == null) {
|
|
91
|
+
throw new runtime.RequiredError(
|
|
92
|
+
'orgSlug',
|
|
93
|
+
'Required parameter "orgSlug" was null or undefined when calling orgsRetrieve().'
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const queryParameters: any = {};
|
|
98
|
+
|
|
99
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
100
|
+
|
|
101
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
102
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
let urlPath = `/api/v1/orgs/{org_slug}`;
|
|
107
|
+
urlPath = urlPath.replace(`{${"org_slug"}}`, encodeURIComponent(String(requestParameters['orgSlug'])));
|
|
108
|
+
|
|
109
|
+
const response = await this.request({
|
|
110
|
+
path: urlPath,
|
|
111
|
+
method: 'GET',
|
|
112
|
+
headers: headerParameters,
|
|
113
|
+
query: queryParameters,
|
|
114
|
+
}, initOverrides);
|
|
115
|
+
|
|
116
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OrgFromJSON(jsonValue));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve details for a given Org.
|
|
121
|
+
*/
|
|
122
|
+
async orgsRetrieve(requestParameters: OrgsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Org> {
|
|
123
|
+
const response = await this.orgsRetrieveRaw(requestParameters, initOverrides);
|
|
124
|
+
return await response.value();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* View all sites that the user has access to.
|
|
129
|
+
*/
|
|
130
|
+
async orgsSitesListRaw(requestParameters: OrgsSitesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedSiteList>> {
|
|
131
|
+
if (requestParameters['orgSlug'] == null) {
|
|
132
|
+
throw new runtime.RequiredError(
|
|
133
|
+
'orgSlug',
|
|
134
|
+
'Required parameter "orgSlug" was null or undefined when calling orgsSitesList().'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const queryParameters: any = {};
|
|
139
|
+
|
|
140
|
+
if (requestParameters['page'] != null) {
|
|
141
|
+
queryParameters['page'] = requestParameters['page'];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
145
|
+
|
|
146
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
147
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
let urlPath = `/api/v1/orgs/{org_slug}/sites`;
|
|
152
|
+
urlPath = urlPath.replace(`{${"org_slug"}}`, encodeURIComponent(String(requestParameters['orgSlug'])));
|
|
153
|
+
|
|
154
|
+
const response = await this.request({
|
|
155
|
+
path: urlPath,
|
|
156
|
+
method: 'GET',
|
|
157
|
+
headers: headerParameters,
|
|
158
|
+
query: queryParameters,
|
|
159
|
+
}, initOverrides);
|
|
160
|
+
|
|
161
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedSiteListFromJSON(jsonValue));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* View all sites that the user has access to.
|
|
166
|
+
*/
|
|
167
|
+
async orgsSitesList(requestParameters: OrgsSitesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedSiteList> {
|
|
168
|
+
const response = await this.orgsSitesListRaw(requestParameters, initOverrides);
|
|
169
|
+
return await response.value();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* trak
|
|
5
|
+
* Hazardous waste tracking application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
AggregateEmployeeData,
|
|
19
|
+
Employee,
|
|
20
|
+
PaginatedEmployeeList,
|
|
21
|
+
PatchedEmployee,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
AggregateEmployeeDataFromJSON,
|
|
25
|
+
AggregateEmployeeDataToJSON,
|
|
26
|
+
EmployeeFromJSON,
|
|
27
|
+
EmployeeToJSON,
|
|
28
|
+
PaginatedEmployeeListFromJSON,
|
|
29
|
+
PaginatedEmployeeListToJSON,
|
|
30
|
+
PatchedEmployeeFromJSON,
|
|
31
|
+
PatchedEmployeeToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface EmployeesCreateRequest {
|
|
35
|
+
employee: Omit<Employee, 'id'|'user'|'created_at'|'updated_at'>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface EmployeesDestroyRequest {
|
|
39
|
+
id: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface EmployeesListRequest {
|
|
43
|
+
page?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface EmployeesPartialUpdateRequest {
|
|
47
|
+
id: number;
|
|
48
|
+
patchedEmployee?: Omit<PatchedEmployee, 'id'|'user'|'created_at'|'updated_at'>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface EmployeesRetrieveRequest {
|
|
52
|
+
id: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface EmployeesUpdateRequest {
|
|
56
|
+
id: number;
|
|
57
|
+
employee: Omit<Employee, 'id'|'user'|'created_at'|'updated_at'>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export class PegasusApi extends runtime.BaseAPI {
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
*/
|
|
67
|
+
async employeesAggregateDataRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AggregateEmployeeData>> {
|
|
68
|
+
const queryParameters: any = {};
|
|
69
|
+
|
|
70
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
71
|
+
|
|
72
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
73
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
74
|
+
}
|
|
75
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
76
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const response = await this.request({
|
|
80
|
+
path: `/pegasus/employees/api/employee-data/`,
|
|
81
|
+
method: 'GET',
|
|
82
|
+
headers: headerParameters,
|
|
83
|
+
query: queryParameters,
|
|
84
|
+
}, initOverrides);
|
|
85
|
+
|
|
86
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AggregateEmployeeDataFromJSON(jsonValue));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
*/
|
|
91
|
+
async employeesAggregateData(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AggregateEmployeeData> {
|
|
92
|
+
const response = await this.employeesAggregateDataRaw(initOverrides);
|
|
93
|
+
return await response.value();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*/
|
|
98
|
+
async employeesCreateRaw(requestParameters: EmployeesCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Employee>> {
|
|
99
|
+
if (requestParameters['employee'] == null) {
|
|
100
|
+
throw new runtime.RequiredError(
|
|
101
|
+
'employee',
|
|
102
|
+
'Required parameter "employee" was null or undefined when calling employeesCreate().'
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const queryParameters: any = {};
|
|
107
|
+
|
|
108
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
109
|
+
|
|
110
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
111
|
+
|
|
112
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
113
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
114
|
+
}
|
|
115
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
116
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const response = await this.request({
|
|
120
|
+
path: `/pegasus/employees/api/employees/`,
|
|
121
|
+
method: 'POST',
|
|
122
|
+
headers: headerParameters,
|
|
123
|
+
query: queryParameters,
|
|
124
|
+
body: EmployeeToJSON(requestParameters['employee']),
|
|
125
|
+
}, initOverrides);
|
|
126
|
+
|
|
127
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeFromJSON(jsonValue));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
*/
|
|
132
|
+
async employeesCreate(requestParameters: EmployeesCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Employee> {
|
|
133
|
+
const response = await this.employeesCreateRaw(requestParameters, initOverrides);
|
|
134
|
+
return await response.value();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
*/
|
|
139
|
+
async employeesDestroyRaw(requestParameters: EmployeesDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
140
|
+
if (requestParameters['id'] == null) {
|
|
141
|
+
throw new runtime.RequiredError(
|
|
142
|
+
'id',
|
|
143
|
+
'Required parameter "id" was null or undefined when calling employeesDestroy().'
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const queryParameters: any = {};
|
|
148
|
+
|
|
149
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
150
|
+
|
|
151
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
152
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
153
|
+
}
|
|
154
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
155
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const response = await this.request({
|
|
159
|
+
path: `/pegasus/employees/api/employees/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
160
|
+
method: 'DELETE',
|
|
161
|
+
headers: headerParameters,
|
|
162
|
+
query: queryParameters,
|
|
163
|
+
}, initOverrides);
|
|
164
|
+
|
|
165
|
+
return new runtime.VoidApiResponse(response);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
*/
|
|
170
|
+
async employeesDestroy(requestParameters: EmployeesDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
171
|
+
await this.employeesDestroyRaw(requestParameters, initOverrides);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
*/
|
|
176
|
+
async employeesListRaw(requestParameters: EmployeesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedEmployeeList>> {
|
|
177
|
+
const queryParameters: any = {};
|
|
178
|
+
|
|
179
|
+
if (requestParameters['page'] != null) {
|
|
180
|
+
queryParameters['page'] = requestParameters['page'];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
184
|
+
|
|
185
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
186
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
187
|
+
}
|
|
188
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
189
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const response = await this.request({
|
|
193
|
+
path: `/pegasus/employees/api/employees/`,
|
|
194
|
+
method: 'GET',
|
|
195
|
+
headers: headerParameters,
|
|
196
|
+
query: queryParameters,
|
|
197
|
+
}, initOverrides);
|
|
198
|
+
|
|
199
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedEmployeeListFromJSON(jsonValue));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
*/
|
|
204
|
+
async employeesList(requestParameters: EmployeesListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedEmployeeList> {
|
|
205
|
+
const response = await this.employeesListRaw(requestParameters, initOverrides);
|
|
206
|
+
return await response.value();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
*/
|
|
211
|
+
async employeesPartialUpdateRaw(requestParameters: EmployeesPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Employee>> {
|
|
212
|
+
if (requestParameters['id'] == null) {
|
|
213
|
+
throw new runtime.RequiredError(
|
|
214
|
+
'id',
|
|
215
|
+
'Required parameter "id" was null or undefined when calling employeesPartialUpdate().'
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const queryParameters: any = {};
|
|
220
|
+
|
|
221
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
222
|
+
|
|
223
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
224
|
+
|
|
225
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
226
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
227
|
+
}
|
|
228
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
229
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const response = await this.request({
|
|
233
|
+
path: `/pegasus/employees/api/employees/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
234
|
+
method: 'PATCH',
|
|
235
|
+
headers: headerParameters,
|
|
236
|
+
query: queryParameters,
|
|
237
|
+
body: PatchedEmployeeToJSON(requestParameters['patchedEmployee']),
|
|
238
|
+
}, initOverrides);
|
|
239
|
+
|
|
240
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeFromJSON(jsonValue));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
*/
|
|
245
|
+
async employeesPartialUpdate(requestParameters: EmployeesPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Employee> {
|
|
246
|
+
const response = await this.employeesPartialUpdateRaw(requestParameters, initOverrides);
|
|
247
|
+
return await response.value();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
*/
|
|
252
|
+
async employeesRetrieveRaw(requestParameters: EmployeesRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Employee>> {
|
|
253
|
+
if (requestParameters['id'] == null) {
|
|
254
|
+
throw new runtime.RequiredError(
|
|
255
|
+
'id',
|
|
256
|
+
'Required parameter "id" was null or undefined when calling employeesRetrieve().'
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const queryParameters: any = {};
|
|
261
|
+
|
|
262
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
263
|
+
|
|
264
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
265
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
266
|
+
}
|
|
267
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
268
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const response = await this.request({
|
|
272
|
+
path: `/pegasus/employees/api/employees/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
273
|
+
method: 'GET',
|
|
274
|
+
headers: headerParameters,
|
|
275
|
+
query: queryParameters,
|
|
276
|
+
}, initOverrides);
|
|
277
|
+
|
|
278
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeFromJSON(jsonValue));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
*/
|
|
283
|
+
async employeesRetrieve(requestParameters: EmployeesRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Employee> {
|
|
284
|
+
const response = await this.employeesRetrieveRaw(requestParameters, initOverrides);
|
|
285
|
+
return await response.value();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
*/
|
|
290
|
+
async employeesUpdateRaw(requestParameters: EmployeesUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Employee>> {
|
|
291
|
+
if (requestParameters['id'] == null) {
|
|
292
|
+
throw new runtime.RequiredError(
|
|
293
|
+
'id',
|
|
294
|
+
'Required parameter "id" was null or undefined when calling employeesUpdate().'
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (requestParameters['employee'] == null) {
|
|
299
|
+
throw new runtime.RequiredError(
|
|
300
|
+
'employee',
|
|
301
|
+
'Required parameter "employee" was null or undefined when calling employeesUpdate().'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const queryParameters: any = {};
|
|
306
|
+
|
|
307
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
308
|
+
|
|
309
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
310
|
+
|
|
311
|
+
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
|
|
312
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
313
|
+
}
|
|
314
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
315
|
+
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const response = await this.request({
|
|
319
|
+
path: `/pegasus/employees/api/employees/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
320
|
+
method: 'PUT',
|
|
321
|
+
headers: headerParameters,
|
|
322
|
+
query: queryParameters,
|
|
323
|
+
body: EmployeeToJSON(requestParameters['employee']),
|
|
324
|
+
}, initOverrides);
|
|
325
|
+
|
|
326
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => EmployeeFromJSON(jsonValue));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
*/
|
|
331
|
+
async employeesUpdate(requestParameters: EmployeesUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Employee> {
|
|
332
|
+
const response = await this.employeesUpdateRaw(requestParameters, initOverrides);
|
|
333
|
+
return await response.value();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
}
|