@pescheckit/pescheck-client 0.0.5
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 +97 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +200 -0
- package/dist/apis/AuthenticationApi.d.ts +131 -0
- package/dist/apis/AuthenticationApi.js +168 -0
- package/dist/apis/ChecksApi.d.ts +91 -0
- package/dist/apis/ChecksApi.js +116 -0
- package/dist/apis/DivisionsApi.d.ts +211 -0
- package/dist/apis/DivisionsApi.js +264 -0
- package/dist/apis/OAuthApi.d.ts +124 -0
- package/dist/apis/OAuthApi.js +159 -0
- package/dist/apis/ProfilesApi.d.ts +270 -0
- package/dist/apis/ProfilesApi.js +334 -0
- package/dist/apis/ScreeningsApi.d.ts +172 -0
- package/dist/apis/ScreeningsApi.js +216 -0
- package/dist/apis/WebhooksApi.d.ts +168 -0
- package/dist/apis/WebhooksApi.js +213 -0
- package/dist/apis/index.d.ts +7 -0
- package/dist/apis/index.js +25 -0
- package/dist/esm/apis/AuthenticationApi.d.ts +131 -0
- package/dist/esm/apis/AuthenticationApi.js +164 -0
- package/dist/esm/apis/ChecksApi.d.ts +91 -0
- package/dist/esm/apis/ChecksApi.js +112 -0
- package/dist/esm/apis/DivisionsApi.d.ts +211 -0
- package/dist/esm/apis/DivisionsApi.js +260 -0
- package/dist/esm/apis/OAuthApi.d.ts +124 -0
- package/dist/esm/apis/OAuthApi.js +155 -0
- package/dist/esm/apis/ProfilesApi.d.ts +270 -0
- package/dist/esm/apis/ProfilesApi.js +330 -0
- package/dist/esm/apis/ScreeningsApi.d.ts +172 -0
- package/dist/esm/apis/ScreeningsApi.js +212 -0
- package/dist/esm/apis/WebhooksApi.d.ts +168 -0
- package/dist/esm/apis/WebhooksApi.js +209 -0
- package/dist/esm/apis/index.d.ts +7 -0
- package/dist/esm/apis/index.js +9 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/CustomTokenObtainPair.d.ts +38 -0
- package/dist/esm/models/CustomTokenObtainPair.js +47 -0
- package/dist/esm/models/DivisionReadOnly.d.ts +116 -0
- package/dist/esm/models/DivisionReadOnly.js +73 -0
- package/dist/esm/models/DivisionWrite.d.ts +98 -0
- package/dist/esm/models/DivisionWrite.js +78 -0
- package/dist/esm/models/JWTGeneration.d.ts +50 -0
- package/dist/esm/models/JWTGeneration.js +51 -0
- package/dist/esm/models/JWTResponse.d.ts +62 -0
- package/dist/esm/models/JWTResponse.js +61 -0
- package/dist/esm/models/OAuthApplication.d.ts +84 -0
- package/dist/esm/models/OAuthApplication.js +68 -0
- package/dist/esm/models/OAuthApplicationResponse.d.ts +98 -0
- package/dist/esm/models/OAuthApplicationResponse.js +80 -0
- package/dist/esm/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
- package/dist/esm/models/PaginatedDivisionReadOnlyList.js +56 -0
- package/dist/esm/models/PaginatedV2ProfileListItemList.d.ts +51 -0
- package/dist/esm/models/PaginatedV2ProfileListItemList.js +56 -0
- package/dist/esm/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
- package/dist/esm/models/PaginatedV2ScreeningListItemList.js +56 -0
- package/dist/esm/models/PatchedDivisionWrite.d.ts +98 -0
- package/dist/esm/models/PatchedDivisionWrite.js +62 -0
- package/dist/esm/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
- package/dist/esm/models/PatchedV2ProfilePartialUpdate.js +43 -0
- package/dist/esm/models/TokenRefresh.d.ts +38 -0
- package/dist/esm/models/TokenRefresh.js +44 -0
- package/dist/esm/models/V2Candidate.d.ts +592 -0
- package/dist/esm/models/V2Candidate.js +318 -0
- package/dist/esm/models/V2CheckField.d.ts +56 -0
- package/dist/esm/models/V2CheckField.js +53 -0
- package/dist/esm/models/V2CheckInfo.d.ts +100 -0
- package/dist/esm/models/V2CheckInfo.js +76 -0
- package/dist/esm/models/V2Document.d.ts +115 -0
- package/dist/esm/models/V2Document.js +84 -0
- package/dist/esm/models/V2DocumentContent.d.ts +40 -0
- package/dist/esm/models/V2DocumentContent.js +45 -0
- package/dist/esm/models/V2Money.d.ts +38 -0
- package/dist/esm/models/V2Money.js +47 -0
- package/dist/esm/models/V2ProfileCheck.d.ts +85 -0
- package/dist/esm/models/V2ProfileCheck.js +68 -0
- package/dist/esm/models/V2ProfileCheckEntry.d.ts +120 -0
- package/dist/esm/models/V2ProfileCheckEntry.js +87 -0
- package/dist/esm/models/V2ProfileCreate.d.ts +45 -0
- package/dist/esm/models/V2ProfileCreate.js +50 -0
- package/dist/esm/models/V2ProfileDetail.d.ts +94 -0
- package/dist/esm/models/V2ProfileDetail.js +75 -0
- package/dist/esm/models/V2ProfileListItem.d.ts +68 -0
- package/dist/esm/models/V2ProfileListItem.js +61 -0
- package/dist/esm/models/V2ProfileUpdate.d.ts +47 -0
- package/dist/esm/models/V2ProfileUpdate.js +50 -0
- package/dist/esm/models/V2ProfileUpdateCheck.d.ts +96 -0
- package/dist/esm/models/V2ProfileUpdateCheck.js +74 -0
- package/dist/esm/models/V2ScreeningCheck.d.ts +95 -0
- package/dist/esm/models/V2ScreeningCheck.js +72 -0
- package/dist/esm/models/V2ScreeningCheckEntry.d.ts +135 -0
- package/dist/esm/models/V2ScreeningCheckEntry.js +92 -0
- package/dist/esm/models/V2ScreeningCheckListItem.d.ts +93 -0
- package/dist/esm/models/V2ScreeningCheckListItem.js +74 -0
- package/dist/esm/models/V2ScreeningCreate.d.ts +46 -0
- package/dist/esm/models/V2ScreeningCreate.js +51 -0
- package/dist/esm/models/V2ScreeningDetail.d.ts +83 -0
- package/dist/esm/models/V2ScreeningDetail.js +70 -0
- package/dist/esm/models/V2ScreeningDetailProfile.d.ts +38 -0
- package/dist/esm/models/V2ScreeningDetailProfile.js +43 -0
- package/dist/esm/models/V2ScreeningListItem.d.ts +85 -0
- package/dist/esm/models/V2ScreeningListItem.js +69 -0
- package/dist/esm/models/VerifyWebhook.d.ts +34 -0
- package/dist/esm/models/VerifyWebhook.js +43 -0
- package/dist/esm/models/Webhook.d.ts +71 -0
- package/dist/esm/models/Webhook.js +69 -0
- package/dist/esm/models/WebhookResponse.d.ts +87 -0
- package/dist/esm/models/WebhookResponse.js +51 -0
- package/dist/esm/models/index.d.ts +36 -0
- package/dist/esm/models/index.js +38 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +349 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/CustomTokenObtainPair.d.ts +38 -0
- package/dist/models/CustomTokenObtainPair.js +54 -0
- package/dist/models/DivisionReadOnly.d.ts +116 -0
- package/dist/models/DivisionReadOnly.js +80 -0
- package/dist/models/DivisionWrite.d.ts +98 -0
- package/dist/models/DivisionWrite.js +85 -0
- package/dist/models/JWTGeneration.d.ts +50 -0
- package/dist/models/JWTGeneration.js +58 -0
- package/dist/models/JWTResponse.d.ts +62 -0
- package/dist/models/JWTResponse.js +68 -0
- package/dist/models/OAuthApplication.d.ts +84 -0
- package/dist/models/OAuthApplication.js +76 -0
- package/dist/models/OAuthApplicationResponse.d.ts +98 -0
- package/dist/models/OAuthApplicationResponse.js +88 -0
- package/dist/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
- package/dist/models/PaginatedDivisionReadOnlyList.js +63 -0
- package/dist/models/PaginatedV2ProfileListItemList.d.ts +51 -0
- package/dist/models/PaginatedV2ProfileListItemList.js +63 -0
- package/dist/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
- package/dist/models/PaginatedV2ScreeningListItemList.js +63 -0
- package/dist/models/PatchedDivisionWrite.d.ts +98 -0
- package/dist/models/PatchedDivisionWrite.js +69 -0
- package/dist/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
- package/dist/models/PatchedV2ProfilePartialUpdate.js +50 -0
- package/dist/models/TokenRefresh.d.ts +38 -0
- package/dist/models/TokenRefresh.js +51 -0
- package/dist/models/V2Candidate.d.ts +592 -0
- package/dist/models/V2Candidate.js +326 -0
- package/dist/models/V2CheckField.d.ts +56 -0
- package/dist/models/V2CheckField.js +60 -0
- package/dist/models/V2CheckInfo.d.ts +100 -0
- package/dist/models/V2CheckInfo.js +83 -0
- package/dist/models/V2Document.d.ts +115 -0
- package/dist/models/V2Document.js +92 -0
- package/dist/models/V2DocumentContent.d.ts +40 -0
- package/dist/models/V2DocumentContent.js +52 -0
- package/dist/models/V2Money.d.ts +38 -0
- package/dist/models/V2Money.js +54 -0
- package/dist/models/V2ProfileCheck.d.ts +85 -0
- package/dist/models/V2ProfileCheck.js +76 -0
- package/dist/models/V2ProfileCheckEntry.d.ts +120 -0
- package/dist/models/V2ProfileCheckEntry.js +95 -0
- package/dist/models/V2ProfileCreate.d.ts +45 -0
- package/dist/models/V2ProfileCreate.js +57 -0
- package/dist/models/V2ProfileDetail.d.ts +94 -0
- package/dist/models/V2ProfileDetail.js +82 -0
- package/dist/models/V2ProfileListItem.d.ts +68 -0
- package/dist/models/V2ProfileListItem.js +68 -0
- package/dist/models/V2ProfileUpdate.d.ts +47 -0
- package/dist/models/V2ProfileUpdate.js +57 -0
- package/dist/models/V2ProfileUpdateCheck.d.ts +96 -0
- package/dist/models/V2ProfileUpdateCheck.js +82 -0
- package/dist/models/V2ScreeningCheck.d.ts +95 -0
- package/dist/models/V2ScreeningCheck.js +80 -0
- package/dist/models/V2ScreeningCheckEntry.d.ts +135 -0
- package/dist/models/V2ScreeningCheckEntry.js +100 -0
- package/dist/models/V2ScreeningCheckListItem.d.ts +93 -0
- package/dist/models/V2ScreeningCheckListItem.js +82 -0
- package/dist/models/V2ScreeningCreate.d.ts +46 -0
- package/dist/models/V2ScreeningCreate.js +58 -0
- package/dist/models/V2ScreeningDetail.d.ts +83 -0
- package/dist/models/V2ScreeningDetail.js +77 -0
- package/dist/models/V2ScreeningDetailProfile.d.ts +38 -0
- package/dist/models/V2ScreeningDetailProfile.js +50 -0
- package/dist/models/V2ScreeningListItem.d.ts +85 -0
- package/dist/models/V2ScreeningListItem.js +76 -0
- package/dist/models/VerifyWebhook.d.ts +34 -0
- package/dist/models/VerifyWebhook.js +50 -0
- package/dist/models/Webhook.d.ts +71 -0
- package/dist/models/Webhook.js +77 -0
- package/dist/models/WebhookResponse.d.ts +87 -0
- package/dist/models/WebhookResponse.js +58 -0
- package/dist/models/index.d.ts +36 -0
- package/dist/models/index.js +54 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +365 -0
- package/docs/AuthenticationApi.md +227 -0
- package/docs/ChecksApi.md +150 -0
- package/docs/CustomTokenObtainPair.md +37 -0
- package/docs/DivisionReadOnly.md +62 -0
- package/docs/DivisionWrite.md +56 -0
- package/docs/DivisionsApi.md +380 -0
- package/docs/JWTGeneration.md +41 -0
- package/docs/JWTResponse.md +45 -0
- package/docs/OAuthApi.md +222 -0
- package/docs/OAuthApplication.md +43 -0
- package/docs/OAuthApplicationResponse.md +49 -0
- package/docs/PaginatedDivisionReadOnlyList.md +40 -0
- package/docs/PaginatedV2ProfileListItemList.md +40 -0
- package/docs/PaginatedV2ScreeningListItemList.md +40 -0
- package/docs/PatchedDivisionWrite.md +56 -0
- package/docs/PatchedV2ProfilePartialUpdate.md +37 -0
- package/docs/ProfilesApi.md +456 -0
- package/docs/ScreeningsApi.md +302 -0
- package/docs/TokenRefresh.md +36 -0
- package/docs/V2Candidate.md +53 -0
- package/docs/V2CheckField.md +43 -0
- package/docs/V2CheckInfo.md +57 -0
- package/docs/V2Document.md +45 -0
- package/docs/V2DocumentContent.md +37 -0
- package/docs/V2Money.md +36 -0
- package/docs/V2ProfileCheck.md +37 -0
- package/docs/V2ProfileCheckEntry.md +46 -0
- package/docs/V2ProfileCreate.md +38 -0
- package/docs/V2ProfileDetail.md +54 -0
- package/docs/V2ProfileListItem.md +46 -0
- package/docs/V2ProfileUpdate.md +39 -0
- package/docs/V2ProfileUpdateCheck.md +39 -0
- package/docs/V2ScreeningCheck.md +41 -0
- package/docs/V2ScreeningCheckEntry.md +50 -0
- package/docs/V2ScreeningCheckListItem.md +39 -0
- package/docs/V2ScreeningCreate.md +38 -0
- package/docs/V2ScreeningDetail.md +50 -0
- package/docs/V2ScreeningDetailProfile.md +36 -0
- package/docs/V2ScreeningListItem.md +51 -0
- package/docs/VerifyWebhook.md +35 -0
- package/docs/Webhook.md +43 -0
- package/docs/WebhookResponse.md +53 -0
- package/docs/WebhooksApi.md +305 -0
- package/package.json +25 -0
- package/src/apis/AuthenticationApi.ts +285 -0
- package/src/apis/ChecksApi.ts +181 -0
- package/src/apis/DivisionsApi.ts +462 -0
- package/src/apis/OAuthApi.ts +256 -0
- package/src/apis/ProfilesApi.ts +583 -0
- package/src/apis/ScreeningsApi.ts +376 -0
- package/src/apis/WebhooksApi.ts +363 -0
- package/src/apis/index.ts +9 -0
- package/src/index.ts +5 -0
- package/src/models/CustomTokenObtainPair.ts +75 -0
- package/src/models/DivisionReadOnly.ts +177 -0
- package/src/models/DivisionWrite.ts +160 -0
- package/src/models/JWTGeneration.ts +91 -0
- package/src/models/JWTResponse.ts +110 -0
- package/src/models/OAuthApplication.ts +130 -0
- package/src/models/OAuthApplicationResponse.ts +151 -0
- package/src/models/PaginatedDivisionReadOnlyList.ts +101 -0
- package/src/models/PaginatedV2ProfileListItemList.ts +101 -0
- package/src/models/PaginatedV2ScreeningListItemList.ts +101 -0
- package/src/models/PatchedDivisionWrite.ts +152 -0
- package/src/models/PatchedV2ProfilePartialUpdate.ts +74 -0
- package/src/models/TokenRefresh.ts +73 -0
- package/src/models/V2Candidate.ts +649 -0
- package/src/models/V2CheckField.ts +97 -0
- package/src/models/V2CheckInfo.ts +168 -0
- package/src/models/V2Document.ts +166 -0
- package/src/models/V2DocumentContent.ts +76 -0
- package/src/models/V2Money.ts +75 -0
- package/src/models/V2ProfileCheck.ts +122 -0
- package/src/models/V2ProfileCheckEntry.ts +173 -0
- package/src/models/V2ProfileCreate.ts +91 -0
- package/src/models/V2ProfileDetail.ts +162 -0
- package/src/models/V2ProfileListItem.ts +115 -0
- package/src/models/V2ProfileUpdate.ts +93 -0
- package/src/models/V2ProfileUpdateCheck.ts +135 -0
- package/src/models/V2ScreeningCheck.ts +136 -0
- package/src/models/V2ScreeningCheckEntry.ts +181 -0
- package/src/models/V2ScreeningCheckListItem.ts +133 -0
- package/src/models/V2ScreeningCreate.ts +98 -0
- package/src/models/V2ScreeningDetail.ts +152 -0
- package/src/models/V2ScreeningDetailProfile.ts +73 -0
- package/src/models/V2ScreeningListItem.ts +154 -0
- package/src/models/VerifyWebhook.ts +68 -0
- package/src/models/Webhook.ts +118 -0
- package/src/models/WebhookResponse.ts +140 -0
- package/src/models/index.ts +38 -0
- package/src/runtime.ts +449 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pescheck API
|
|
5
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.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
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type V2CheckInfo,
|
|
18
|
+
V2CheckInfoFromJSON,
|
|
19
|
+
V2CheckInfoToJSON,
|
|
20
|
+
} from '../models/V2CheckInfo';
|
|
21
|
+
|
|
22
|
+
export interface V2ChecksListRequest {
|
|
23
|
+
checkType?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface V2ChecksRetrieveRequest {
|
|
27
|
+
checkType: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ChecksApi - interface
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface ChecksApiInterface
|
|
35
|
+
*/
|
|
36
|
+
export interface ChecksApiInterface {
|
|
37
|
+
/**
|
|
38
|
+
* Creates request options for v2ChecksList without sending the request
|
|
39
|
+
* @param {string} [checkType] Restrict the list to a single check type.
|
|
40
|
+
* @throws {RequiredError}
|
|
41
|
+
* @memberof ChecksApiInterface
|
|
42
|
+
*/
|
|
43
|
+
v2ChecksListRequestOpts(requestParameters: V2ChecksListRequest): Promise<runtime.RequestOpts>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
47
|
+
* @param {string} [checkType] Restrict the list to a single check type.
|
|
48
|
+
* @param {*} [options] Override http request option.
|
|
49
|
+
* @throws {RequiredError}
|
|
50
|
+
* @memberof ChecksApiInterface
|
|
51
|
+
*/
|
|
52
|
+
v2ChecksListRaw(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<V2CheckInfo>>>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
56
|
+
*/
|
|
57
|
+
v2ChecksList(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<V2CheckInfo>>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates request options for v2ChecksRetrieve without sending the request
|
|
61
|
+
* @param {string} checkType
|
|
62
|
+
* @throws {RequiredError}
|
|
63
|
+
* @memberof ChecksApiInterface
|
|
64
|
+
*/
|
|
65
|
+
v2ChecksRetrieveRequestOpts(requestParameters: V2ChecksRetrieveRequest): Promise<runtime.RequestOpts>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param {string} checkType
|
|
70
|
+
* @param {*} [options] Override http request option.
|
|
71
|
+
* @throws {RequiredError}
|
|
72
|
+
* @memberof ChecksApiInterface
|
|
73
|
+
*/
|
|
74
|
+
v2ChecksRetrieveRaw(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V2CheckInfo>>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*/
|
|
78
|
+
v2ChecksRetrieve(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V2CheckInfo>;
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
export class ChecksApi extends runtime.BaseAPI implements ChecksApiInterface {
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates request options for v2ChecksList without sending the request
|
|
89
|
+
*/
|
|
90
|
+
async v2ChecksListRequestOpts(requestParameters: V2ChecksListRequest): Promise<runtime.RequestOpts> {
|
|
91
|
+
const queryParameters: any = {};
|
|
92
|
+
|
|
93
|
+
if (requestParameters['checkType'] != null) {
|
|
94
|
+
queryParameters['check_type'] = requestParameters['checkType'];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
98
|
+
|
|
99
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
100
|
+
// oauth required
|
|
101
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
let urlPath = `/api/v2/checks/`;
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
path: urlPath,
|
|
109
|
+
method: 'GET',
|
|
110
|
+
headers: headerParameters,
|
|
111
|
+
query: queryParameters,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
117
|
+
*/
|
|
118
|
+
async v2ChecksListRaw(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<V2CheckInfo>>> {
|
|
119
|
+
const requestOptions = await this.v2ChecksListRequestOpts(requestParameters);
|
|
120
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
121
|
+
|
|
122
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(V2CheckInfoFromJSON));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
127
|
+
*/
|
|
128
|
+
async v2ChecksList(requestParameters: V2ChecksListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<V2CheckInfo>> {
|
|
129
|
+
const response = await this.v2ChecksListRaw(requestParameters, initOverrides);
|
|
130
|
+
return await response.value();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Creates request options for v2ChecksRetrieve without sending the request
|
|
135
|
+
*/
|
|
136
|
+
async v2ChecksRetrieveRequestOpts(requestParameters: V2ChecksRetrieveRequest): Promise<runtime.RequestOpts> {
|
|
137
|
+
if (requestParameters['checkType'] == null) {
|
|
138
|
+
throw new runtime.RequiredError(
|
|
139
|
+
'checkType',
|
|
140
|
+
'Required parameter "checkType" was null or undefined when calling v2ChecksRetrieve().'
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const queryParameters: any = {};
|
|
145
|
+
|
|
146
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
147
|
+
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
// oauth required
|
|
150
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
let urlPath = `/api/v2/checks/{check_type}/`;
|
|
155
|
+
urlPath = urlPath.replace('{check_type}', encodeURIComponent(String(requestParameters['checkType'])));
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
path: urlPath,
|
|
159
|
+
method: 'GET',
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
*/
|
|
167
|
+
async v2ChecksRetrieveRaw(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V2CheckInfo>> {
|
|
168
|
+
const requestOptions = await this.v2ChecksRetrieveRequestOpts(requestParameters);
|
|
169
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
170
|
+
|
|
171
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => V2CheckInfoFromJSON(jsonValue));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
*/
|
|
176
|
+
async v2ChecksRetrieve(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V2CheckInfo> {
|
|
177
|
+
const response = await this.v2ChecksRetrieveRaw(requestParameters, initOverrides);
|
|
178
|
+
return await response.value();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
}
|
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pescheck API
|
|
5
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.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
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type DivisionReadOnly,
|
|
18
|
+
DivisionReadOnlyFromJSON,
|
|
19
|
+
DivisionReadOnlyToJSON,
|
|
20
|
+
} from '../models/DivisionReadOnly';
|
|
21
|
+
import {
|
|
22
|
+
type DivisionWrite,
|
|
23
|
+
DivisionWriteFromJSON,
|
|
24
|
+
DivisionWriteToJSON,
|
|
25
|
+
} from '../models/DivisionWrite';
|
|
26
|
+
import {
|
|
27
|
+
type PaginatedDivisionReadOnlyList,
|
|
28
|
+
PaginatedDivisionReadOnlyListFromJSON,
|
|
29
|
+
PaginatedDivisionReadOnlyListToJSON,
|
|
30
|
+
} from '../models/PaginatedDivisionReadOnlyList';
|
|
31
|
+
import {
|
|
32
|
+
type PatchedDivisionWrite,
|
|
33
|
+
PatchedDivisionWriteFromJSON,
|
|
34
|
+
PatchedDivisionWriteToJSON,
|
|
35
|
+
} from '../models/PatchedDivisionWrite';
|
|
36
|
+
|
|
37
|
+
export interface V2OrganisationsDivisionsCreateRequest {
|
|
38
|
+
divisionWrite: Omit<DivisionWrite, 'id'>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface V2OrganisationsDivisionsListRequest {
|
|
42
|
+
page?: number;
|
|
43
|
+
pageSize?: number;
|
|
44
|
+
paginate?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface V2OrganisationsDivisionsPartialUpdateRequest {
|
|
48
|
+
id: string;
|
|
49
|
+
patchedDivisionWrite?: Omit<PatchedDivisionWrite, 'id'>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface V2OrganisationsDivisionsRetrieveRequest {
|
|
53
|
+
id: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface V2OrganisationsDivisionsUpdateRequest {
|
|
57
|
+
id: string;
|
|
58
|
+
divisionWrite: Omit<DivisionWrite, 'id'>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* DivisionsApi - interface
|
|
63
|
+
*
|
|
64
|
+
* @export
|
|
65
|
+
* @interface DivisionsApiInterface
|
|
66
|
+
*/
|
|
67
|
+
export interface DivisionsApiInterface {
|
|
68
|
+
/**
|
|
69
|
+
* Creates request options for v2OrganisationsDivisionsCreate without sending the request
|
|
70
|
+
* @param {DivisionWrite} divisionWrite
|
|
71
|
+
* @throws {RequiredError}
|
|
72
|
+
* @memberof DivisionsApiInterface
|
|
73
|
+
*/
|
|
74
|
+
v2OrganisationsDivisionsCreateRequestOpts(requestParameters: V2OrganisationsDivisionsCreateRequest): Promise<runtime.RequestOpts>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
78
|
+
* @param {DivisionWrite} divisionWrite
|
|
79
|
+
* @param {*} [options] Override http request option.
|
|
80
|
+
* @throws {RequiredError}
|
|
81
|
+
* @memberof DivisionsApiInterface
|
|
82
|
+
*/
|
|
83
|
+
v2OrganisationsDivisionsCreateRaw(requestParameters: V2OrganisationsDivisionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
87
|
+
*/
|
|
88
|
+
v2OrganisationsDivisionsCreate(requestParameters: V2OrganisationsDivisionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Creates request options for v2OrganisationsDivisionsList without sending the request
|
|
92
|
+
* @param {number} [page] A page number within the paginated result set.
|
|
93
|
+
* @param {number} [pageSize] Number of results to return per page.
|
|
94
|
+
* @param {boolean} [paginate] Enable/disable pagination. When false, max 500 records returned.
|
|
95
|
+
* @throws {RequiredError}
|
|
96
|
+
* @memberof DivisionsApiInterface
|
|
97
|
+
*/
|
|
98
|
+
v2OrganisationsDivisionsListRequestOpts(requestParameters: V2OrganisationsDivisionsListRequest): Promise<runtime.RequestOpts>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
102
|
+
* @param {number} [page] A page number within the paginated result set.
|
|
103
|
+
* @param {number} [pageSize] Number of results to return per page.
|
|
104
|
+
* @param {boolean} [paginate] Enable/disable pagination. When false, max 500 records returned.
|
|
105
|
+
* @param {*} [options] Override http request option.
|
|
106
|
+
* @throws {RequiredError}
|
|
107
|
+
* @memberof DivisionsApiInterface
|
|
108
|
+
*/
|
|
109
|
+
v2OrganisationsDivisionsListRaw(requestParameters: V2OrganisationsDivisionsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedDivisionReadOnlyList>>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
113
|
+
*/
|
|
114
|
+
v2OrganisationsDivisionsList(requestParameters: V2OrganisationsDivisionsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedDivisionReadOnlyList>;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Creates request options for v2OrganisationsDivisionsPartialUpdate without sending the request
|
|
118
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
119
|
+
* @param {PatchedDivisionWrite} [patchedDivisionWrite]
|
|
120
|
+
* @throws {RequiredError}
|
|
121
|
+
* @memberof DivisionsApiInterface
|
|
122
|
+
*/
|
|
123
|
+
v2OrganisationsDivisionsPartialUpdateRequestOpts(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest): Promise<runtime.RequestOpts>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
127
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
128
|
+
* @param {PatchedDivisionWrite} [patchedDivisionWrite]
|
|
129
|
+
* @param {*} [options] Override http request option.
|
|
130
|
+
* @throws {RequiredError}
|
|
131
|
+
* @memberof DivisionsApiInterface
|
|
132
|
+
*/
|
|
133
|
+
v2OrganisationsDivisionsPartialUpdateRaw(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
137
|
+
*/
|
|
138
|
+
v2OrganisationsDivisionsPartialUpdate(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Creates request options for v2OrganisationsDivisionsRetrieve without sending the request
|
|
142
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
143
|
+
* @throws {RequiredError}
|
|
144
|
+
* @memberof DivisionsApiInterface
|
|
145
|
+
*/
|
|
146
|
+
v2OrganisationsDivisionsRetrieveRequestOpts(requestParameters: V2OrganisationsDivisionsRetrieveRequest): Promise<runtime.RequestOpts>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
150
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
151
|
+
* @param {*} [options] Override http request option.
|
|
152
|
+
* @throws {RequiredError}
|
|
153
|
+
* @memberof DivisionsApiInterface
|
|
154
|
+
*/
|
|
155
|
+
v2OrganisationsDivisionsRetrieveRaw(requestParameters: V2OrganisationsDivisionsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionReadOnly>>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
159
|
+
*/
|
|
160
|
+
v2OrganisationsDivisionsRetrieve(requestParameters: V2OrganisationsDivisionsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionReadOnly>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Creates request options for v2OrganisationsDivisionsUpdate without sending the request
|
|
164
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
165
|
+
* @param {DivisionWrite} divisionWrite
|
|
166
|
+
* @throws {RequiredError}
|
|
167
|
+
* @memberof DivisionsApiInterface
|
|
168
|
+
*/
|
|
169
|
+
v2OrganisationsDivisionsUpdateRequestOpts(requestParameters: V2OrganisationsDivisionsUpdateRequest): Promise<runtime.RequestOpts>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
173
|
+
* @param {string} id A UUID string identifying this organisation.
|
|
174
|
+
* @param {DivisionWrite} divisionWrite
|
|
175
|
+
* @param {*} [options] Override http request option.
|
|
176
|
+
* @throws {RequiredError}
|
|
177
|
+
* @memberof DivisionsApiInterface
|
|
178
|
+
*/
|
|
179
|
+
v2OrganisationsDivisionsUpdateRaw(requestParameters: V2OrganisationsDivisionsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
183
|
+
*/
|
|
184
|
+
v2OrganisationsDivisionsUpdate(requestParameters: V2OrganisationsDivisionsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite>;
|
|
185
|
+
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
export class DivisionsApi extends runtime.BaseAPI implements DivisionsApiInterface {
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Creates request options for v2OrganisationsDivisionsCreate without sending the request
|
|
195
|
+
*/
|
|
196
|
+
async v2OrganisationsDivisionsCreateRequestOpts(requestParameters: V2OrganisationsDivisionsCreateRequest): Promise<runtime.RequestOpts> {
|
|
197
|
+
if (requestParameters['divisionWrite'] == null) {
|
|
198
|
+
throw new runtime.RequiredError(
|
|
199
|
+
'divisionWrite',
|
|
200
|
+
'Required parameter "divisionWrite" was null or undefined when calling v2OrganisationsDivisionsCreate().'
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const queryParameters: any = {};
|
|
205
|
+
|
|
206
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
207
|
+
|
|
208
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
209
|
+
|
|
210
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
211
|
+
// oauth required
|
|
212
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
let urlPath = `/api/v2/organisations/divisions/`;
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
path: urlPath,
|
|
220
|
+
method: 'POST',
|
|
221
|
+
headers: headerParameters,
|
|
222
|
+
query: queryParameters,
|
|
223
|
+
body: DivisionWriteToJSON(requestParameters['divisionWrite']),
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
229
|
+
*/
|
|
230
|
+
async v2OrganisationsDivisionsCreateRaw(requestParameters: V2OrganisationsDivisionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>> {
|
|
231
|
+
const requestOptions = await this.v2OrganisationsDivisionsCreateRequestOpts(requestParameters);
|
|
232
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
233
|
+
|
|
234
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DivisionWriteFromJSON(jsonValue));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
|
|
239
|
+
*/
|
|
240
|
+
async v2OrganisationsDivisionsCreate(requestParameters: V2OrganisationsDivisionsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite> {
|
|
241
|
+
const response = await this.v2OrganisationsDivisionsCreateRaw(requestParameters, initOverrides);
|
|
242
|
+
return await response.value();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Creates request options for v2OrganisationsDivisionsList without sending the request
|
|
247
|
+
*/
|
|
248
|
+
async v2OrganisationsDivisionsListRequestOpts(requestParameters: V2OrganisationsDivisionsListRequest): Promise<runtime.RequestOpts> {
|
|
249
|
+
const queryParameters: any = {};
|
|
250
|
+
|
|
251
|
+
if (requestParameters['page'] != null) {
|
|
252
|
+
queryParameters['page'] = requestParameters['page'];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (requestParameters['pageSize'] != null) {
|
|
256
|
+
queryParameters['page_size'] = requestParameters['pageSize'];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (requestParameters['paginate'] != null) {
|
|
260
|
+
queryParameters['paginate'] = requestParameters['paginate'];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
264
|
+
|
|
265
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
266
|
+
// oauth required
|
|
267
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
let urlPath = `/api/v2/organisations/divisions/`;
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
path: urlPath,
|
|
275
|
+
method: 'GET',
|
|
276
|
+
headers: headerParameters,
|
|
277
|
+
query: queryParameters,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
283
|
+
*/
|
|
284
|
+
async v2OrganisationsDivisionsListRaw(requestParameters: V2OrganisationsDivisionsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedDivisionReadOnlyList>> {
|
|
285
|
+
const requestOptions = await this.v2OrganisationsDivisionsListRequestOpts(requestParameters);
|
|
286
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
287
|
+
|
|
288
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedDivisionReadOnlyListFromJSON(jsonValue));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
|
|
293
|
+
*/
|
|
294
|
+
async v2OrganisationsDivisionsList(requestParameters: V2OrganisationsDivisionsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedDivisionReadOnlyList> {
|
|
295
|
+
const response = await this.v2OrganisationsDivisionsListRaw(requestParameters, initOverrides);
|
|
296
|
+
return await response.value();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Creates request options for v2OrganisationsDivisionsPartialUpdate without sending the request
|
|
301
|
+
*/
|
|
302
|
+
async v2OrganisationsDivisionsPartialUpdateRequestOpts(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest): Promise<runtime.RequestOpts> {
|
|
303
|
+
if (requestParameters['id'] == null) {
|
|
304
|
+
throw new runtime.RequiredError(
|
|
305
|
+
'id',
|
|
306
|
+
'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsPartialUpdate().'
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const queryParameters: any = {};
|
|
311
|
+
|
|
312
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
313
|
+
|
|
314
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
315
|
+
|
|
316
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
317
|
+
// oauth required
|
|
318
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
let urlPath = `/api/v2/organisations/divisions/{id}/`;
|
|
323
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
324
|
+
|
|
325
|
+
return {
|
|
326
|
+
path: urlPath,
|
|
327
|
+
method: 'PATCH',
|
|
328
|
+
headers: headerParameters,
|
|
329
|
+
query: queryParameters,
|
|
330
|
+
body: PatchedDivisionWriteToJSON(requestParameters['patchedDivisionWrite']),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
336
|
+
*/
|
|
337
|
+
async v2OrganisationsDivisionsPartialUpdateRaw(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>> {
|
|
338
|
+
const requestOptions = await this.v2OrganisationsDivisionsPartialUpdateRequestOpts(requestParameters);
|
|
339
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
340
|
+
|
|
341
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DivisionWriteFromJSON(jsonValue));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
346
|
+
*/
|
|
347
|
+
async v2OrganisationsDivisionsPartialUpdate(requestParameters: V2OrganisationsDivisionsPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite> {
|
|
348
|
+
const response = await this.v2OrganisationsDivisionsPartialUpdateRaw(requestParameters, initOverrides);
|
|
349
|
+
return await response.value();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Creates request options for v2OrganisationsDivisionsRetrieve without sending the request
|
|
354
|
+
*/
|
|
355
|
+
async v2OrganisationsDivisionsRetrieveRequestOpts(requestParameters: V2OrganisationsDivisionsRetrieveRequest): Promise<runtime.RequestOpts> {
|
|
356
|
+
if (requestParameters['id'] == null) {
|
|
357
|
+
throw new runtime.RequiredError(
|
|
358
|
+
'id',
|
|
359
|
+
'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsRetrieve().'
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const queryParameters: any = {};
|
|
364
|
+
|
|
365
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
366
|
+
|
|
367
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
368
|
+
// oauth required
|
|
369
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
let urlPath = `/api/v2/organisations/divisions/{id}/`;
|
|
374
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
375
|
+
|
|
376
|
+
return {
|
|
377
|
+
path: urlPath,
|
|
378
|
+
method: 'GET',
|
|
379
|
+
headers: headerParameters,
|
|
380
|
+
query: queryParameters,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
386
|
+
*/
|
|
387
|
+
async v2OrganisationsDivisionsRetrieveRaw(requestParameters: V2OrganisationsDivisionsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionReadOnly>> {
|
|
388
|
+
const requestOptions = await this.v2OrganisationsDivisionsRetrieveRequestOpts(requestParameters);
|
|
389
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
390
|
+
|
|
391
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DivisionReadOnlyFromJSON(jsonValue));
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
|
|
396
|
+
*/
|
|
397
|
+
async v2OrganisationsDivisionsRetrieve(requestParameters: V2OrganisationsDivisionsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionReadOnly> {
|
|
398
|
+
const response = await this.v2OrganisationsDivisionsRetrieveRaw(requestParameters, initOverrides);
|
|
399
|
+
return await response.value();
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Creates request options for v2OrganisationsDivisionsUpdate without sending the request
|
|
404
|
+
*/
|
|
405
|
+
async v2OrganisationsDivisionsUpdateRequestOpts(requestParameters: V2OrganisationsDivisionsUpdateRequest): Promise<runtime.RequestOpts> {
|
|
406
|
+
if (requestParameters['id'] == null) {
|
|
407
|
+
throw new runtime.RequiredError(
|
|
408
|
+
'id',
|
|
409
|
+
'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsUpdate().'
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if (requestParameters['divisionWrite'] == null) {
|
|
414
|
+
throw new runtime.RequiredError(
|
|
415
|
+
'divisionWrite',
|
|
416
|
+
'Required parameter "divisionWrite" was null or undefined when calling v2OrganisationsDivisionsUpdate().'
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const queryParameters: any = {};
|
|
421
|
+
|
|
422
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
423
|
+
|
|
424
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
425
|
+
|
|
426
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
427
|
+
// oauth required
|
|
428
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
let urlPath = `/api/v2/organisations/divisions/{id}/`;
|
|
433
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
434
|
+
|
|
435
|
+
return {
|
|
436
|
+
path: urlPath,
|
|
437
|
+
method: 'PUT',
|
|
438
|
+
headers: headerParameters,
|
|
439
|
+
query: queryParameters,
|
|
440
|
+
body: DivisionWriteToJSON(requestParameters['divisionWrite']),
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
446
|
+
*/
|
|
447
|
+
async v2OrganisationsDivisionsUpdateRaw(requestParameters: V2OrganisationsDivisionsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DivisionWrite>> {
|
|
448
|
+
const requestOptions = await this.v2OrganisationsDivisionsUpdateRequestOpts(requestParameters);
|
|
449
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
450
|
+
|
|
451
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DivisionWriteFromJSON(jsonValue));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
|
|
456
|
+
*/
|
|
457
|
+
async v2OrganisationsDivisionsUpdate(requestParameters: V2OrganisationsDivisionsUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DivisionWrite> {
|
|
458
|
+
const response = await this.v2OrganisationsDivisionsUpdateRaw(requestParameters, initOverrides);
|
|
459
|
+
return await response.value();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
}
|