@cosmotech/aip-client 0.0.1-rc1
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/README.md +45 -0
- package/package.json +29 -0
- package/src/apis/DefaultApi.ts +53 -0
- package/src/apis/MetricApi.ts +256 -0
- package/src/apis/MetricCostsPerYearApi.ts +286 -0
- package/src/apis/ObjectiveApi.ts +256 -0
- package/src/apis/ObjectiveWeightApi.ts +271 -0
- package/src/apis/ValueFrameworkApi.ts +256 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +5 -0
- package/src/models/HTTPValidationError.ts +72 -0
- package/src/models/MeasurementType.ts +38 -0
- package/src/models/MetricCostsPerYearCreate.ts +102 -0
- package/src/models/MetricCostsPerYearResponse.ts +110 -0
- package/src/models/MetricCostsPerYearUpdate.ts +73 -0
- package/src/models/MetricCreate.ts +139 -0
- package/src/models/MetricResponse.ts +174 -0
- package/src/models/MetricType.ts +39 -0
- package/src/models/MetricUpdate.ts +134 -0
- package/src/models/ObjectiveCreate.ts +74 -0
- package/src/models/ObjectiveResponse.ts +109 -0
- package/src/models/ObjectiveUpdate.ts +73 -0
- package/src/models/ObjectiveWeightCreate.ts +83 -0
- package/src/models/ObjectiveWeightResponse.ts +91 -0
- package/src/models/ObjectiveWeightUpdate.ts +65 -0
- package/src/models/ValidationError.ts +91 -0
- package/src/models/ValidationErrorLocInner.ts +44 -0
- package/src/models/ValueFrameworkCreate.ts +74 -0
- package/src/models/ValueFrameworkResponse.ts +109 -0
- package/src/models/ValueFrameworkUpdate.ts +73 -0
- package/src/models/index.ts +22 -0
- package/src/runtime.ts +431 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Asset Investment Planning
|
|
5
|
+
* API for Asset Investment Planning
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0-rc1
|
|
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
|
+
ObjectiveCreate,
|
|
19
|
+
ObjectiveResponse,
|
|
20
|
+
ObjectiveUpdate,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
ObjectiveCreateFromJSON,
|
|
24
|
+
ObjectiveCreateToJSON,
|
|
25
|
+
ObjectiveResponseFromJSON,
|
|
26
|
+
ObjectiveResponseToJSON,
|
|
27
|
+
ObjectiveUpdateFromJSON,
|
|
28
|
+
ObjectiveUpdateToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface DeleteObjectiveObjectiveObjectiveIdDeleteRequest {
|
|
32
|
+
objectiveId: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface GetObjectiveByIdObjectiveObjectiveIdGetRequest {
|
|
36
|
+
objectiveId: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface GetObjectivesObjectiveGetRequest {
|
|
40
|
+
offset?: number;
|
|
41
|
+
limit?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface PatchObjectiveObjectiveObjectiveIdPatchRequest {
|
|
45
|
+
objectiveId: string;
|
|
46
|
+
objectiveUpdate: ObjectiveUpdate;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface PostObjectiveObjectivePostRequest {
|
|
50
|
+
objectiveCreate: ObjectiveCreate;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export class ObjectiveApi extends runtime.BaseAPI {
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Delete an existing objective by its ID. Associated metrics and objective weights are also deleted via cascade.
|
|
60
|
+
* Delete an objective
|
|
61
|
+
*/
|
|
62
|
+
async deleteObjectiveObjectiveObjectiveIdDeleteRaw(requestParameters: DeleteObjectiveObjectiveObjectiveIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
63
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
64
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling deleteObjectiveObjectiveObjectiveIdDelete.');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const queryParameters: any = {};
|
|
68
|
+
|
|
69
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
70
|
+
|
|
71
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
72
|
+
// oauth required
|
|
73
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const response = await this.request({
|
|
77
|
+
path: `/objective/{objective_id}`.replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
78
|
+
method: 'DELETE',
|
|
79
|
+
headers: headerParameters,
|
|
80
|
+
query: queryParameters,
|
|
81
|
+
}, initOverrides);
|
|
82
|
+
|
|
83
|
+
return new runtime.VoidApiResponse(response);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Delete an existing objective by its ID. Associated metrics and objective weights are also deleted via cascade.
|
|
88
|
+
* Delete an objective
|
|
89
|
+
*/
|
|
90
|
+
async deleteObjectiveObjectiveObjectiveIdDelete(requestParameters: DeleteObjectiveObjectiveObjectiveIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
91
|
+
await this.deleteObjectiveObjectiveObjectiveIdDeleteRaw(requestParameters, initOverrides);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Retrieve a single objective by its ID.
|
|
96
|
+
* Get an objective by ID
|
|
97
|
+
*/
|
|
98
|
+
async getObjectiveByIdObjectiveObjectiveIdGetRaw(requestParameters: GetObjectiveByIdObjectiveObjectiveIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveResponse>> {
|
|
99
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
100
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling getObjectiveByIdObjectiveObjectiveIdGet.');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const queryParameters: any = {};
|
|
104
|
+
|
|
105
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
106
|
+
|
|
107
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
108
|
+
// oauth required
|
|
109
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const response = await this.request({
|
|
113
|
+
path: `/objective/{objective_id}`.replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
114
|
+
method: 'GET',
|
|
115
|
+
headers: headerParameters,
|
|
116
|
+
query: queryParameters,
|
|
117
|
+
}, initOverrides);
|
|
118
|
+
|
|
119
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveResponseFromJSON(jsonValue));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Retrieve a single objective by its ID.
|
|
124
|
+
* Get an objective by ID
|
|
125
|
+
*/
|
|
126
|
+
async getObjectiveByIdObjectiveObjectiveIdGet(requestParameters: GetObjectiveByIdObjectiveObjectiveIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveResponse> {
|
|
127
|
+
const response = await this.getObjectiveByIdObjectiveObjectiveIdGetRaw(requestParameters, initOverrides);
|
|
128
|
+
return await response.value();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Retrieve a paginated list of all objectives.
|
|
133
|
+
* List objectives
|
|
134
|
+
*/
|
|
135
|
+
async getObjectivesObjectiveGetRaw(requestParameters: GetObjectivesObjectiveGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ObjectiveResponse>>> {
|
|
136
|
+
const queryParameters: any = {};
|
|
137
|
+
|
|
138
|
+
if (requestParameters.offset !== undefined) {
|
|
139
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (requestParameters.limit !== undefined) {
|
|
143
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
147
|
+
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
// oauth required
|
|
150
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const response = await this.request({
|
|
154
|
+
path: `/objective/`,
|
|
155
|
+
method: 'GET',
|
|
156
|
+
headers: headerParameters,
|
|
157
|
+
query: queryParameters,
|
|
158
|
+
}, initOverrides);
|
|
159
|
+
|
|
160
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ObjectiveResponseFromJSON));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Retrieve a paginated list of all objectives.
|
|
165
|
+
* List objectives
|
|
166
|
+
*/
|
|
167
|
+
async getObjectivesObjectiveGet(requestParameters: GetObjectivesObjectiveGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ObjectiveResponse>> {
|
|
168
|
+
const response = await this.getObjectivesObjectiveGetRaw(requestParameters, initOverrides);
|
|
169
|
+
return await response.value();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Update one or more fields of an existing objective. Only the fields included in the request body will be modified; omitted fields remain unchanged.
|
|
174
|
+
* Partially update an objective
|
|
175
|
+
*/
|
|
176
|
+
async patchObjectiveObjectiveObjectiveIdPatchRaw(requestParameters: PatchObjectiveObjectiveObjectiveIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveResponse>> {
|
|
177
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
178
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling patchObjectiveObjectiveObjectiveIdPatch.');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (requestParameters.objectiveUpdate === null || requestParameters.objectiveUpdate === undefined) {
|
|
182
|
+
throw new runtime.RequiredError('objectiveUpdate','Required parameter requestParameters.objectiveUpdate was null or undefined when calling patchObjectiveObjectiveObjectiveIdPatch.');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const queryParameters: any = {};
|
|
186
|
+
|
|
187
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
188
|
+
|
|
189
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
190
|
+
|
|
191
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
192
|
+
// oauth required
|
|
193
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const response = await this.request({
|
|
197
|
+
path: `/objective/{objective_id}`.replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
198
|
+
method: 'PATCH',
|
|
199
|
+
headers: headerParameters,
|
|
200
|
+
query: queryParameters,
|
|
201
|
+
body: ObjectiveUpdateToJSON(requestParameters.objectiveUpdate),
|
|
202
|
+
}, initOverrides);
|
|
203
|
+
|
|
204
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveResponseFromJSON(jsonValue));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Update one or more fields of an existing objective. Only the fields included in the request body will be modified; omitted fields remain unchanged.
|
|
209
|
+
* Partially update an objective
|
|
210
|
+
*/
|
|
211
|
+
async patchObjectiveObjectiveObjectiveIdPatch(requestParameters: PatchObjectiveObjectiveObjectiveIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveResponse> {
|
|
212
|
+
const response = await this.patchObjectiveObjectiveObjectiveIdPatchRaw(requestParameters, initOverrides);
|
|
213
|
+
return await response.value();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Create a new objective. Name must be unique and non-empty.
|
|
218
|
+
* Create an objective
|
|
219
|
+
*/
|
|
220
|
+
async postObjectiveObjectivePostRaw(requestParameters: PostObjectiveObjectivePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveResponse>> {
|
|
221
|
+
if (requestParameters.objectiveCreate === null || requestParameters.objectiveCreate === undefined) {
|
|
222
|
+
throw new runtime.RequiredError('objectiveCreate','Required parameter requestParameters.objectiveCreate was null or undefined when calling postObjectiveObjectivePost.');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const queryParameters: any = {};
|
|
226
|
+
|
|
227
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
228
|
+
|
|
229
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
230
|
+
|
|
231
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
232
|
+
// oauth required
|
|
233
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const response = await this.request({
|
|
237
|
+
path: `/objective/`,
|
|
238
|
+
method: 'POST',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
body: ObjectiveCreateToJSON(requestParameters.objectiveCreate),
|
|
242
|
+
}, initOverrides);
|
|
243
|
+
|
|
244
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveResponseFromJSON(jsonValue));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Create a new objective. Name must be unique and non-empty.
|
|
249
|
+
* Create an objective
|
|
250
|
+
*/
|
|
251
|
+
async postObjectiveObjectivePost(requestParameters: PostObjectiveObjectivePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveResponse> {
|
|
252
|
+
const response = await this.postObjectiveObjectivePostRaw(requestParameters, initOverrides);
|
|
253
|
+
return await response.value();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Asset Investment Planning
|
|
5
|
+
* API for Asset Investment Planning
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0-rc1
|
|
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
|
+
ObjectiveWeightCreate,
|
|
19
|
+
ObjectiveWeightResponse,
|
|
20
|
+
ObjectiveWeightUpdate,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
ObjectiveWeightCreateFromJSON,
|
|
24
|
+
ObjectiveWeightCreateToJSON,
|
|
25
|
+
ObjectiveWeightResponseFromJSON,
|
|
26
|
+
ObjectiveWeightResponseToJSON,
|
|
27
|
+
ObjectiveWeightUpdateFromJSON,
|
|
28
|
+
ObjectiveWeightUpdateToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface DeleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDeleteRequest {
|
|
32
|
+
frameworkId: string;
|
|
33
|
+
objectiveId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GetObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGetRequest {
|
|
37
|
+
frameworkId: string;
|
|
38
|
+
objectiveId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetObjectiveWeightsObjectiveWeightGetRequest {
|
|
42
|
+
offset?: number;
|
|
43
|
+
limit?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface PatchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatchRequest {
|
|
47
|
+
frameworkId: string;
|
|
48
|
+
objectiveId: string;
|
|
49
|
+
objectiveWeightUpdate: ObjectiveWeightUpdate;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface PostObjectiveWeightObjectiveWeightPostRequest {
|
|
53
|
+
objectiveWeightCreate: ObjectiveWeightCreate;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export class ObjectiveWeightApi extends runtime.BaseAPI {
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Delete an objective weight link by its composite key (framework_id, objective_id).
|
|
63
|
+
* Delete an objective weight
|
|
64
|
+
*/
|
|
65
|
+
async deleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDeleteRaw(requestParameters: DeleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
66
|
+
if (requestParameters.frameworkId === null || requestParameters.frameworkId === undefined) {
|
|
67
|
+
throw new runtime.RequiredError('frameworkId','Required parameter requestParameters.frameworkId was null or undefined when calling deleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDelete.');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
71
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling deleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDelete.');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const queryParameters: any = {};
|
|
75
|
+
|
|
76
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
77
|
+
|
|
78
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
79
|
+
// oauth required
|
|
80
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const response = await this.request({
|
|
84
|
+
path: `/objective_weight/{framework_id}/{objective_id}`.replace(`{${"framework_id"}}`, encodeURIComponent(String(requestParameters.frameworkId))).replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
85
|
+
method: 'DELETE',
|
|
86
|
+
headers: headerParameters,
|
|
87
|
+
query: queryParameters,
|
|
88
|
+
}, initOverrides);
|
|
89
|
+
|
|
90
|
+
return new runtime.VoidApiResponse(response);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Delete an objective weight link by its composite key (framework_id, objective_id).
|
|
95
|
+
* Delete an objective weight
|
|
96
|
+
*/
|
|
97
|
+
async deleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDelete(requestParameters: DeleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
98
|
+
await this.deleteObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdDeleteRaw(requestParameters, initOverrides);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Retrieve the weight for a specific objective within a specific framework.
|
|
103
|
+
* Get an objective weight by framework and objective
|
|
104
|
+
*/
|
|
105
|
+
async getObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGetRaw(requestParameters: GetObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveWeightResponse>> {
|
|
106
|
+
if (requestParameters.frameworkId === null || requestParameters.frameworkId === undefined) {
|
|
107
|
+
throw new runtime.RequiredError('frameworkId','Required parameter requestParameters.frameworkId was null or undefined when calling getObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGet.');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
111
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling getObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGet.');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const queryParameters: any = {};
|
|
115
|
+
|
|
116
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
117
|
+
|
|
118
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
119
|
+
// oauth required
|
|
120
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const response = await this.request({
|
|
124
|
+
path: `/objective_weight/{framework_id}/{objective_id}`.replace(`{${"framework_id"}}`, encodeURIComponent(String(requestParameters.frameworkId))).replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
125
|
+
method: 'GET',
|
|
126
|
+
headers: headerParameters,
|
|
127
|
+
query: queryParameters,
|
|
128
|
+
}, initOverrides);
|
|
129
|
+
|
|
130
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveWeightResponseFromJSON(jsonValue));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Retrieve the weight for a specific objective within a specific framework.
|
|
135
|
+
* Get an objective weight by framework and objective
|
|
136
|
+
*/
|
|
137
|
+
async getObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGet(requestParameters: GetObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveWeightResponse> {
|
|
138
|
+
const response = await this.getObjectiveWeightByKeysObjectiveWeightFrameworkIdObjectiveIdGetRaw(requestParameters, initOverrides);
|
|
139
|
+
return await response.value();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Retrieve a paginated list of all objective-framework weight assignments.
|
|
144
|
+
* List objective weights
|
|
145
|
+
*/
|
|
146
|
+
async getObjectiveWeightsObjectiveWeightGetRaw(requestParameters: GetObjectiveWeightsObjectiveWeightGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ObjectiveWeightResponse>>> {
|
|
147
|
+
const queryParameters: any = {};
|
|
148
|
+
|
|
149
|
+
if (requestParameters.offset !== undefined) {
|
|
150
|
+
queryParameters['offset'] = requestParameters.offset;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (requestParameters.limit !== undefined) {
|
|
154
|
+
queryParameters['limit'] = requestParameters.limit;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
158
|
+
|
|
159
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
160
|
+
// oauth required
|
|
161
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const response = await this.request({
|
|
165
|
+
path: `/objective_weight/`,
|
|
166
|
+
method: 'GET',
|
|
167
|
+
headers: headerParameters,
|
|
168
|
+
query: queryParameters,
|
|
169
|
+
}, initOverrides);
|
|
170
|
+
|
|
171
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ObjectiveWeightResponseFromJSON));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve a paginated list of all objective-framework weight assignments.
|
|
176
|
+
* List objective weights
|
|
177
|
+
*/
|
|
178
|
+
async getObjectiveWeightsObjectiveWeightGet(requestParameters: GetObjectiveWeightsObjectiveWeightGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ObjectiveWeightResponse>> {
|
|
179
|
+
const response = await this.getObjectiveWeightsObjectiveWeightGetRaw(requestParameters, initOverrides);
|
|
180
|
+
return await response.value();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Update the weight of an objective within a value framework. Identified by the composite key (framework_id, objective_id).
|
|
185
|
+
* Partially update an objective weight
|
|
186
|
+
*/
|
|
187
|
+
async patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatchRaw(requestParameters: PatchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveWeightResponse>> {
|
|
188
|
+
if (requestParameters.frameworkId === null || requestParameters.frameworkId === undefined) {
|
|
189
|
+
throw new runtime.RequiredError('frameworkId','Required parameter requestParameters.frameworkId was null or undefined when calling patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatch.');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (requestParameters.objectiveId === null || requestParameters.objectiveId === undefined) {
|
|
193
|
+
throw new runtime.RequiredError('objectiveId','Required parameter requestParameters.objectiveId was null or undefined when calling patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatch.');
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (requestParameters.objectiveWeightUpdate === null || requestParameters.objectiveWeightUpdate === undefined) {
|
|
197
|
+
throw new runtime.RequiredError('objectiveWeightUpdate','Required parameter requestParameters.objectiveWeightUpdate was null or undefined when calling patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatch.');
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const queryParameters: any = {};
|
|
201
|
+
|
|
202
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
203
|
+
|
|
204
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
205
|
+
|
|
206
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
207
|
+
// oauth required
|
|
208
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const response = await this.request({
|
|
212
|
+
path: `/objective_weight/{framework_id}/{objective_id}`.replace(`{${"framework_id"}}`, encodeURIComponent(String(requestParameters.frameworkId))).replace(`{${"objective_id"}}`, encodeURIComponent(String(requestParameters.objectiveId))),
|
|
213
|
+
method: 'PATCH',
|
|
214
|
+
headers: headerParameters,
|
|
215
|
+
query: queryParameters,
|
|
216
|
+
body: ObjectiveWeightUpdateToJSON(requestParameters.objectiveWeightUpdate),
|
|
217
|
+
}, initOverrides);
|
|
218
|
+
|
|
219
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveWeightResponseFromJSON(jsonValue));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Update the weight of an objective within a value framework. Identified by the composite key (framework_id, objective_id).
|
|
224
|
+
* Partially update an objective weight
|
|
225
|
+
*/
|
|
226
|
+
async patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatch(requestParameters: PatchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveWeightResponse> {
|
|
227
|
+
const response = await this.patchObjectiveWeightObjectiveWeightFrameworkIdObjectiveIdPatchRaw(requestParameters, initOverrides);
|
|
228
|
+
return await response.value();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Assign a weight to an objective within a framework. Weight must be >= 0, defaults to 1.0.
|
|
233
|
+
* Create an objective weight
|
|
234
|
+
*/
|
|
235
|
+
async postObjectiveWeightObjectiveWeightPostRaw(requestParameters: PostObjectiveWeightObjectiveWeightPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ObjectiveWeightResponse>> {
|
|
236
|
+
if (requestParameters.objectiveWeightCreate === null || requestParameters.objectiveWeightCreate === undefined) {
|
|
237
|
+
throw new runtime.RequiredError('objectiveWeightCreate','Required parameter requestParameters.objectiveWeightCreate was null or undefined when calling postObjectiveWeightObjectiveWeightPost.');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const queryParameters: any = {};
|
|
241
|
+
|
|
242
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
243
|
+
|
|
244
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
245
|
+
|
|
246
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
247
|
+
// oauth required
|
|
248
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2AuthorizationCodeBearer", []);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const response = await this.request({
|
|
252
|
+
path: `/objective_weight/`,
|
|
253
|
+
method: 'POST',
|
|
254
|
+
headers: headerParameters,
|
|
255
|
+
query: queryParameters,
|
|
256
|
+
body: ObjectiveWeightCreateToJSON(requestParameters.objectiveWeightCreate),
|
|
257
|
+
}, initOverrides);
|
|
258
|
+
|
|
259
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ObjectiveWeightResponseFromJSON(jsonValue));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Assign a weight to an objective within a framework. Weight must be >= 0, defaults to 1.0.
|
|
264
|
+
* Create an objective weight
|
|
265
|
+
*/
|
|
266
|
+
async postObjectiveWeightObjectiveWeightPost(requestParameters: PostObjectiveWeightObjectiveWeightPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ObjectiveWeightResponse> {
|
|
267
|
+
const response = await this.postObjectiveWeightObjectiveWeightPostRaw(requestParameters, initOverrides);
|
|
268
|
+
return await response.value();
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
}
|