@cosmotech/aip-client 0.0.1-rc1 → 0.0.1-rc2

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.
Files changed (65) hide show
  1. package/.github/workflows/publish.yaml +25 -0
  2. package/README.md +3 -3
  3. package/api/default-api.ts +122 -0
  4. package/api/metric-api.ts +451 -0
  5. package/api/metric-costs-per-year-api.ts +493 -0
  6. package/api/objective-api.ts +451 -0
  7. package/api/objective-weight-api.ts +472 -0
  8. package/api/value-framework-api.ts +451 -0
  9. package/api.ts +23 -0
  10. package/base.ts +86 -0
  11. package/common.ts +150 -0
  12. package/configuration.ts +110 -0
  13. package/git_push.sh +57 -0
  14. package/index.ts +18 -0
  15. package/models/httpvalidation-error.ts +33 -0
  16. package/models/index.ts +20 -0
  17. package/{src/models/MeasurementType.ts → models/measurement-type.ts} +4 -11
  18. package/models/metric-costs-per-year-create.ts +54 -0
  19. package/models/metric-costs-per-year-response.ts +60 -0
  20. package/models/metric-costs-per-year-update.ts +36 -0
  21. package/models/metric-create.ts +80 -0
  22. package/models/metric-response.ts +104 -0
  23. package/{src/models/MetricType.ts → models/metric-type.ts} +4 -11
  24. package/models/metric-update.ts +80 -0
  25. package/models/objective-create.ts +36 -0
  26. package/models/objective-response.ts +60 -0
  27. package/models/objective-update.ts +36 -0
  28. package/models/objective-weight-create.ts +42 -0
  29. package/models/objective-weight-response.ts +48 -0
  30. package/models/objective-weight-update.ts +30 -0
  31. package/models/validation-error-loc-inner.ts +24 -0
  32. package/models/validation-error.ts +57 -0
  33. package/models/value-framework-create.ts +36 -0
  34. package/models/value-framework-response.ts +60 -0
  35. package/models/value-framework-update.ts +36 -0
  36. package/package.json +17 -10
  37. package/tsconfig.json +4 -2
  38. package/src/apis/DefaultApi.ts +0 -53
  39. package/src/apis/MetricApi.ts +0 -256
  40. package/src/apis/MetricCostsPerYearApi.ts +0 -286
  41. package/src/apis/ObjectiveApi.ts +0 -256
  42. package/src/apis/ObjectiveWeightApi.ts +0 -271
  43. package/src/apis/ValueFrameworkApi.ts +0 -256
  44. package/src/apis/index.ts +0 -8
  45. package/src/index.ts +0 -5
  46. package/src/models/HTTPValidationError.ts +0 -72
  47. package/src/models/MetricCostsPerYearCreate.ts +0 -102
  48. package/src/models/MetricCostsPerYearResponse.ts +0 -110
  49. package/src/models/MetricCostsPerYearUpdate.ts +0 -73
  50. package/src/models/MetricCreate.ts +0 -139
  51. package/src/models/MetricResponse.ts +0 -174
  52. package/src/models/MetricUpdate.ts +0 -134
  53. package/src/models/ObjectiveCreate.ts +0 -74
  54. package/src/models/ObjectiveResponse.ts +0 -109
  55. package/src/models/ObjectiveUpdate.ts +0 -73
  56. package/src/models/ObjectiveWeightCreate.ts +0 -83
  57. package/src/models/ObjectiveWeightResponse.ts +0 -91
  58. package/src/models/ObjectiveWeightUpdate.ts +0 -65
  59. package/src/models/ValidationError.ts +0 -91
  60. package/src/models/ValidationErrorLocInner.ts +0 -44
  61. package/src/models/ValueFrameworkCreate.ts +0 -74
  62. package/src/models/ValueFrameworkResponse.ts +0 -109
  63. package/src/models/ValueFrameworkUpdate.ts +0 -73
  64. package/src/models/index.ts +0 -22
  65. package/src/runtime.ts +0 -431
@@ -0,0 +1,25 @@
1
+ name: Node.js Package on npm
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write
10
+
11
+ jobs:
12
+ build:
13
+ name: Build & Publish
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v5
17
+ - uses: actions/setup-node@v6
18
+ with:
19
+ node-version: '24'
20
+ registry-url: 'https://registry.npmjs.org'
21
+ scope: '@cosmotech'
22
+ - run: npm version ${{ github.event.release.tag_name }} --allow-same-version --no-git-tag-version
23
+ - run: npm install
24
+ - run: npm publish --tag ${{ github.event.release.prerelease && 'prerelease' || 'latest' }}
25
+
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- ## @cosmotech/aip-client@0.0.1-rc1
1
+ ## @cosmotech/aip-client@0.0.1-rc2
2
2
 
3
- This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
3
+ This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
5
5
  Environment
6
6
  * Node.js
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @cosmotech/aip-client@0.0.1-rc1 --save
39
+ npm install @cosmotech/aip-client@0.0.1-rc2 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -0,0 +1,122 @@
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 type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ /**
25
+ * DefaultApi - axios parameter creator
26
+ * @export
27
+ */
28
+ export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
29
+ return {
30
+ /**
31
+ *
32
+ * @summary Root
33
+ * @param {*} [options] Override http request option.
34
+ * @throws {RequiredError}
35
+ */
36
+ root: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
37
+ const localVarPath = `/about`;
38
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
39
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
40
+ let baseOptions;
41
+ if (configuration) {
42
+ baseOptions = configuration.baseOptions;
43
+ }
44
+
45
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
46
+ const localVarHeaderParameter = {} as any;
47
+ const localVarQueryParameter = {} as any;
48
+
49
+
50
+
51
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
52
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
53
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
54
+
55
+ return {
56
+ url: toPathString(localVarUrlObj),
57
+ options: localVarRequestOptions,
58
+ };
59
+ },
60
+ }
61
+ };
62
+
63
+ /**
64
+ * DefaultApi - functional programming interface
65
+ * @export
66
+ */
67
+ export const DefaultApiFp = function(configuration?: Configuration) {
68
+ const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
69
+ return {
70
+ /**
71
+ *
72
+ * @summary Root
73
+ * @param {*} [options] Override http request option.
74
+ * @throws {RequiredError}
75
+ */
76
+ async root(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
77
+ const localVarAxiosArgs = await localVarAxiosParamCreator.root(options);
78
+ const index = configuration?.serverIndex ?? 0;
79
+ const operationBasePath = operationServerMap['DefaultApi.root']?.[index]?.url;
80
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
81
+ },
82
+ }
83
+ };
84
+
85
+ /**
86
+ * DefaultApi - factory interface
87
+ * @export
88
+ */
89
+ export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
90
+ const localVarFp = DefaultApiFp(configuration)
91
+ return {
92
+ /**
93
+ *
94
+ * @summary Root
95
+ * @param {*} [options] Override http request option.
96
+ * @throws {RequiredError}
97
+ */
98
+ root(options?: any): AxiosPromise<any> {
99
+ return localVarFp.root(options).then((request) => request(axios, basePath));
100
+ },
101
+ };
102
+ };
103
+
104
+ /**
105
+ * DefaultApi - object-oriented interface
106
+ * @export
107
+ * @class DefaultApi
108
+ * @extends {BaseAPI}
109
+ */
110
+ export class DefaultApi extends BaseAPI {
111
+ /**
112
+ *
113
+ * @summary Root
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ * @memberof DefaultApi
117
+ */
118
+ public root(options?: RawAxiosRequestConfig) {
119
+ return DefaultApiFp(this.configuration).root(options).then((request) => request(this.axios, this.basePath));
120
+ }
121
+ }
122
+
@@ -0,0 +1,451 @@
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 type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import { MetricCreate } from '../models';
26
+ // @ts-ignore
27
+ import { MetricResponse } from '../models';
28
+ // @ts-ignore
29
+ import { MetricUpdate } from '../models';
30
+ /**
31
+ * MetricApi - axios parameter creator
32
+ * @export
33
+ */
34
+ export const MetricApiAxiosParamCreator = function (configuration?: Configuration) {
35
+ return {
36
+ /**
37
+ * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
38
+ * @summary Delete a metric
39
+ * @param {string} metricId UUID of the metric
40
+ * @param {*} [options] Override http request option.
41
+ * @throws {RequiredError}
42
+ */
43
+ deleteMetric: async (metricId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
44
+ // verify required parameter 'metricId' is not null or undefined
45
+ assertParamExists('deleteMetric', 'metricId', metricId)
46
+ const localVarPath = `/metric/{metric_id}`
47
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)));
48
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
49
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
50
+ let baseOptions;
51
+ if (configuration) {
52
+ baseOptions = configuration.baseOptions;
53
+ }
54
+
55
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
56
+ const localVarHeaderParameter = {} as any;
57
+ const localVarQueryParameter = {} as any;
58
+
59
+ // authentication OAuth2AuthorizationCodeBearer required
60
+ // oauth required
61
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
62
+
63
+
64
+
65
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
66
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
67
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
68
+
69
+ return {
70
+ url: toPathString(localVarUrlObj),
71
+ options: localVarRequestOptions,
72
+ };
73
+ },
74
+ /**
75
+ * Retrieve a single metric by its ID.
76
+ * @summary Get a metric by ID
77
+ * @param {string} metricId UUID of the metric
78
+ * @param {*} [options] Override http request option.
79
+ * @throws {RequiredError}
80
+ */
81
+ getMetricById: async (metricId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
82
+ // verify required parameter 'metricId' is not null or undefined
83
+ assertParamExists('getMetricById', 'metricId', metricId)
84
+ const localVarPath = `/metric/{metric_id}`
85
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)));
86
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
87
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
88
+ let baseOptions;
89
+ if (configuration) {
90
+ baseOptions = configuration.baseOptions;
91
+ }
92
+
93
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
94
+ const localVarHeaderParameter = {} as any;
95
+ const localVarQueryParameter = {} as any;
96
+
97
+ // authentication OAuth2AuthorizationCodeBearer required
98
+ // oauth required
99
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
100
+
101
+
102
+
103
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
104
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
105
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
106
+
107
+ return {
108
+ url: toPathString(localVarUrlObj),
109
+ options: localVarRequestOptions,
110
+ };
111
+ },
112
+ /**
113
+ * Retrieve a paginated list of all metrics.
114
+ * @summary List metrics
115
+ * @param {number} [offset] Number of records to skip
116
+ * @param {number} [limit] Max number of records to return
117
+ * @param {*} [options] Override http request option.
118
+ * @throws {RequiredError}
119
+ */
120
+ getMetrics: async (offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
121
+ const localVarPath = `/metric/`;
122
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
123
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
124
+ let baseOptions;
125
+ if (configuration) {
126
+ baseOptions = configuration.baseOptions;
127
+ }
128
+
129
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
130
+ const localVarHeaderParameter = {} as any;
131
+ const localVarQueryParameter = {} as any;
132
+
133
+ // authentication OAuth2AuthorizationCodeBearer required
134
+ // oauth required
135
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
136
+
137
+ if (offset !== undefined) {
138
+ localVarQueryParameter['offset'] = offset;
139
+ }
140
+
141
+ if (limit !== undefined) {
142
+ localVarQueryParameter['limit'] = limit;
143
+ }
144
+
145
+
146
+
147
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
148
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
149
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
150
+
151
+ return {
152
+ url: toPathString(localVarUrlObj),
153
+ options: localVarRequestOptions,
154
+ };
155
+ },
156
+ /**
157
+ * Update one or more fields of an existing metric. Only the fields included in the request body will be modified; omitted fields remain unchanged.
158
+ * @summary Partially update a metric
159
+ * @param {string} metricId UUID of the metric
160
+ * @param {MetricUpdate} metricUpdate
161
+ * @param {*} [options] Override http request option.
162
+ * @throws {RequiredError}
163
+ */
164
+ patchMetric: async (metricId: string, metricUpdate: MetricUpdate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
165
+ // verify required parameter 'metricId' is not null or undefined
166
+ assertParamExists('patchMetric', 'metricId', metricId)
167
+ // verify required parameter 'metricUpdate' is not null or undefined
168
+ assertParamExists('patchMetric', 'metricUpdate', metricUpdate)
169
+ const localVarPath = `/metric/{metric_id}`
170
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)));
171
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
172
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
173
+ let baseOptions;
174
+ if (configuration) {
175
+ baseOptions = configuration.baseOptions;
176
+ }
177
+
178
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
179
+ const localVarHeaderParameter = {} as any;
180
+ const localVarQueryParameter = {} as any;
181
+
182
+ // authentication OAuth2AuthorizationCodeBearer required
183
+ // oauth required
184
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
185
+
186
+
187
+
188
+ localVarHeaderParameter['Content-Type'] = 'application/json';
189
+
190
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
191
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
192
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
193
+ localVarRequestOptions.data = serializeDataIfNeeded(metricUpdate, localVarRequestOptions, configuration)
194
+
195
+ return {
196
+ url: toPathString(localVarUrlObj),
197
+ options: localVarRequestOptions,
198
+ };
199
+ },
200
+ /**
201
+ * Create a new metric linked to an objective. Requires metric_type (monetized/tracked/bounded) and measurement_type (maximization/minimization).
202
+ * @summary Create a metric
203
+ * @param {MetricCreate} metricCreate
204
+ * @param {*} [options] Override http request option.
205
+ * @throws {RequiredError}
206
+ */
207
+ postMetric: async (metricCreate: MetricCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
208
+ // verify required parameter 'metricCreate' is not null or undefined
209
+ assertParamExists('postMetric', 'metricCreate', metricCreate)
210
+ const localVarPath = `/metric/`;
211
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
212
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
213
+ let baseOptions;
214
+ if (configuration) {
215
+ baseOptions = configuration.baseOptions;
216
+ }
217
+
218
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
219
+ const localVarHeaderParameter = {} as any;
220
+ const localVarQueryParameter = {} as any;
221
+
222
+ // authentication OAuth2AuthorizationCodeBearer required
223
+ // oauth required
224
+ await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
225
+
226
+
227
+
228
+ localVarHeaderParameter['Content-Type'] = 'application/json';
229
+
230
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
231
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
232
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
233
+ localVarRequestOptions.data = serializeDataIfNeeded(metricCreate, localVarRequestOptions, configuration)
234
+
235
+ return {
236
+ url: toPathString(localVarUrlObj),
237
+ options: localVarRequestOptions,
238
+ };
239
+ },
240
+ }
241
+ };
242
+
243
+ /**
244
+ * MetricApi - functional programming interface
245
+ * @export
246
+ */
247
+ export const MetricApiFp = function(configuration?: Configuration) {
248
+ const localVarAxiosParamCreator = MetricApiAxiosParamCreator(configuration)
249
+ return {
250
+ /**
251
+ * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
252
+ * @summary Delete a metric
253
+ * @param {string} metricId UUID of the metric
254
+ * @param {*} [options] Override http request option.
255
+ * @throws {RequiredError}
256
+ */
257
+ async deleteMetric(metricId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
258
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMetric(metricId, options);
259
+ const index = configuration?.serverIndex ?? 0;
260
+ const operationBasePath = operationServerMap['MetricApi.deleteMetric']?.[index]?.url;
261
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
262
+ },
263
+ /**
264
+ * Retrieve a single metric by its ID.
265
+ * @summary Get a metric by ID
266
+ * @param {string} metricId UUID of the metric
267
+ * @param {*} [options] Override http request option.
268
+ * @throws {RequiredError}
269
+ */
270
+ async getMetricById(metricId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
271
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMetricById(metricId, options);
272
+ const index = configuration?.serverIndex ?? 0;
273
+ const operationBasePath = operationServerMap['MetricApi.getMetricById']?.[index]?.url;
274
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
275
+ },
276
+ /**
277
+ * Retrieve a paginated list of all metrics.
278
+ * @summary List metrics
279
+ * @param {number} [offset] Number of records to skip
280
+ * @param {number} [limit] Max number of records to return
281
+ * @param {*} [options] Override http request option.
282
+ * @throws {RequiredError}
283
+ */
284
+ async getMetrics(offset?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetricResponse>>> {
285
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMetrics(offset, limit, options);
286
+ const index = configuration?.serverIndex ?? 0;
287
+ const operationBasePath = operationServerMap['MetricApi.getMetrics']?.[index]?.url;
288
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
289
+ },
290
+ /**
291
+ * Update one or more fields of an existing metric. Only the fields included in the request body will be modified; omitted fields remain unchanged.
292
+ * @summary Partially update a metric
293
+ * @param {string} metricId UUID of the metric
294
+ * @param {MetricUpdate} metricUpdate
295
+ * @param {*} [options] Override http request option.
296
+ * @throws {RequiredError}
297
+ */
298
+ async patchMetric(metricId: string, metricUpdate: MetricUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
299
+ const localVarAxiosArgs = await localVarAxiosParamCreator.patchMetric(metricId, metricUpdate, options);
300
+ const index = configuration?.serverIndex ?? 0;
301
+ const operationBasePath = operationServerMap['MetricApi.patchMetric']?.[index]?.url;
302
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
303
+ },
304
+ /**
305
+ * Create a new metric linked to an objective. Requires metric_type (monetized/tracked/bounded) and measurement_type (maximization/minimization).
306
+ * @summary Create a metric
307
+ * @param {MetricCreate} metricCreate
308
+ * @param {*} [options] Override http request option.
309
+ * @throws {RequiredError}
310
+ */
311
+ async postMetric(metricCreate: MetricCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
312
+ const localVarAxiosArgs = await localVarAxiosParamCreator.postMetric(metricCreate, options);
313
+ const index = configuration?.serverIndex ?? 0;
314
+ const operationBasePath = operationServerMap['MetricApi.postMetric']?.[index]?.url;
315
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
316
+ },
317
+ }
318
+ };
319
+
320
+ /**
321
+ * MetricApi - factory interface
322
+ * @export
323
+ */
324
+ export const MetricApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
325
+ const localVarFp = MetricApiFp(configuration)
326
+ return {
327
+ /**
328
+ * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
329
+ * @summary Delete a metric
330
+ * @param {string} metricId UUID of the metric
331
+ * @param {*} [options] Override http request option.
332
+ * @throws {RequiredError}
333
+ */
334
+ deleteMetric(metricId: string, options?: any): AxiosPromise<void> {
335
+ return localVarFp.deleteMetric(metricId, options).then((request) => request(axios, basePath));
336
+ },
337
+ /**
338
+ * Retrieve a single metric by its ID.
339
+ * @summary Get a metric by ID
340
+ * @param {string} metricId UUID of the metric
341
+ * @param {*} [options] Override http request option.
342
+ * @throws {RequiredError}
343
+ */
344
+ getMetricById(metricId: string, options?: any): AxiosPromise<MetricResponse> {
345
+ return localVarFp.getMetricById(metricId, options).then((request) => request(axios, basePath));
346
+ },
347
+ /**
348
+ * Retrieve a paginated list of all metrics.
349
+ * @summary List metrics
350
+ * @param {number} [offset] Number of records to skip
351
+ * @param {number} [limit] Max number of records to return
352
+ * @param {*} [options] Override http request option.
353
+ * @throws {RequiredError}
354
+ */
355
+ getMetrics(offset?: number, limit?: number, options?: any): AxiosPromise<Array<MetricResponse>> {
356
+ return localVarFp.getMetrics(offset, limit, options).then((request) => request(axios, basePath));
357
+ },
358
+ /**
359
+ * Update one or more fields of an existing metric. Only the fields included in the request body will be modified; omitted fields remain unchanged.
360
+ * @summary Partially update a metric
361
+ * @param {string} metricId UUID of the metric
362
+ * @param {MetricUpdate} metricUpdate
363
+ * @param {*} [options] Override http request option.
364
+ * @throws {RequiredError}
365
+ */
366
+ patchMetric(metricId: string, metricUpdate: MetricUpdate, options?: any): AxiosPromise<MetricResponse> {
367
+ return localVarFp.patchMetric(metricId, metricUpdate, options).then((request) => request(axios, basePath));
368
+ },
369
+ /**
370
+ * Create a new metric linked to an objective. Requires metric_type (monetized/tracked/bounded) and measurement_type (maximization/minimization).
371
+ * @summary Create a metric
372
+ * @param {MetricCreate} metricCreate
373
+ * @param {*} [options] Override http request option.
374
+ * @throws {RequiredError}
375
+ */
376
+ postMetric(metricCreate: MetricCreate, options?: any): AxiosPromise<MetricResponse> {
377
+ return localVarFp.postMetric(metricCreate, options).then((request) => request(axios, basePath));
378
+ },
379
+ };
380
+ };
381
+
382
+ /**
383
+ * MetricApi - object-oriented interface
384
+ * @export
385
+ * @class MetricApi
386
+ * @extends {BaseAPI}
387
+ */
388
+ export class MetricApi extends BaseAPI {
389
+ /**
390
+ * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
391
+ * @summary Delete a metric
392
+ * @param {string} metricId UUID of the metric
393
+ * @param {*} [options] Override http request option.
394
+ * @throws {RequiredError}
395
+ * @memberof MetricApi
396
+ */
397
+ public deleteMetric(metricId: string, options?: RawAxiosRequestConfig) {
398
+ return MetricApiFp(this.configuration).deleteMetric(metricId, options).then((request) => request(this.axios, this.basePath));
399
+ }
400
+
401
+ /**
402
+ * Retrieve a single metric by its ID.
403
+ * @summary Get a metric by ID
404
+ * @param {string} metricId UUID of the metric
405
+ * @param {*} [options] Override http request option.
406
+ * @throws {RequiredError}
407
+ * @memberof MetricApi
408
+ */
409
+ public getMetricById(metricId: string, options?: RawAxiosRequestConfig) {
410
+ return MetricApiFp(this.configuration).getMetricById(metricId, options).then((request) => request(this.axios, this.basePath));
411
+ }
412
+
413
+ /**
414
+ * Retrieve a paginated list of all metrics.
415
+ * @summary List metrics
416
+ * @param {number} [offset] Number of records to skip
417
+ * @param {number} [limit] Max number of records to return
418
+ * @param {*} [options] Override http request option.
419
+ * @throws {RequiredError}
420
+ * @memberof MetricApi
421
+ */
422
+ public getMetrics(offset?: number, limit?: number, options?: RawAxiosRequestConfig) {
423
+ return MetricApiFp(this.configuration).getMetrics(offset, limit, options).then((request) => request(this.axios, this.basePath));
424
+ }
425
+
426
+ /**
427
+ * Update one or more fields of an existing metric. Only the fields included in the request body will be modified; omitted fields remain unchanged.
428
+ * @summary Partially update a metric
429
+ * @param {string} metricId UUID of the metric
430
+ * @param {MetricUpdate} metricUpdate
431
+ * @param {*} [options] Override http request option.
432
+ * @throws {RequiredError}
433
+ * @memberof MetricApi
434
+ */
435
+ public patchMetric(metricId: string, metricUpdate: MetricUpdate, options?: RawAxiosRequestConfig) {
436
+ return MetricApiFp(this.configuration).patchMetric(metricId, metricUpdate, options).then((request) => request(this.axios, this.basePath));
437
+ }
438
+
439
+ /**
440
+ * Create a new metric linked to an objective. Requires metric_type (monetized/tracked/bounded) and measurement_type (maximization/minimization).
441
+ * @summary Create a metric
442
+ * @param {MetricCreate} metricCreate
443
+ * @param {*} [options] Override http request option.
444
+ * @throws {RequiredError}
445
+ * @memberof MetricApi
446
+ */
447
+ public postMetric(metricCreate: MetricCreate, options?: RawAxiosRequestConfig) {
448
+ return MetricApiFp(this.configuration).postMetric(metricCreate, options).then((request) => request(this.axios, this.basePath));
449
+ }
450
+ }
451
+