@cosmotech/aip-client 0.2.0-dev2 → 0.2.0-dev4

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 (308) hide show
  1. package/README.md +147 -4
  2. package/api/default-api.ts +8 -15
  3. package/api/favored-option-api.ts +210 -0
  4. package/api/impact-api.ts +507 -0
  5. package/api/investment-api.ts +1464 -0
  6. package/api/metric-api.ts +185 -164
  7. package/api/metric-costs-api.ts +144 -0
  8. package/api/metric-costs-per-year-api.ts +200 -200
  9. package/api/objective-api.ts +538 -44
  10. package/api/objective-weight-api.ts +190 -190
  11. package/api/objective-weights-api.ts +144 -0
  12. package/api/option-api.ts +925 -0
  13. package/api/value-framework-api.ts +1223 -109
  14. package/api/value-framework-costs-api.ts +239 -0
  15. package/api/value-framework-weights-api.ts +144 -0
  16. package/api.ts +9 -1
  17. package/base.ts +1 -25
  18. package/common.ts +20 -43
  19. package/configuration.ts +31 -20
  20. package/dist/api/default-api.d.ts +3 -10
  21. package/dist/api/default-api.js +7 -13
  22. package/dist/api/favored-option-api.d.ts +104 -0
  23. package/dist/api/favored-option-api.js +209 -0
  24. package/dist/api/impact-api.d.ts +245 -0
  25. package/dist/api/impact-api.js +493 -0
  26. package/dist/api/investment-api.d.ts +677 -0
  27. package/dist/api/investment-api.js +1394 -0
  28. package/dist/api/metric-api.d.ts +97 -88
  29. package/dist/api/metric-api.js +185 -157
  30. package/dist/api/metric-costs-api.d.ts +75 -0
  31. package/dist/api/metric-costs-api.js +146 -0
  32. package/dist/api/metric-costs-per-year-api.d.ts +105 -108
  33. package/dist/api/metric-costs-per-year-api.js +199 -192
  34. package/dist/api/objective-api.d.ts +242 -21
  35. package/dist/api/objective-api.js +508 -37
  36. package/dist/api/objective-weight-api.d.ts +105 -108
  37. package/dist/api/objective-weight-api.js +189 -182
  38. package/dist/api/objective-weights-api.d.ts +75 -0
  39. package/dist/api/objective-weights-api.js +146 -0
  40. package/dist/api/option-api.d.ts +436 -0
  41. package/dist/api/option-api.js +888 -0
  42. package/dist/api/value-framework-api.d.ts +528 -21
  43. package/dist/api/value-framework-api.js +1138 -78
  44. package/dist/api/value-framework-costs-api.d.ts +119 -0
  45. package/dist/api/value-framework-costs-api.js +236 -0
  46. package/dist/api/value-framework-weights-api.d.ts +75 -0
  47. package/dist/api/value-framework-weights-api.js +146 -0
  48. package/dist/api.d.ts +9 -1
  49. package/dist/api.js +9 -1
  50. package/dist/base.d.ts +1 -25
  51. package/dist/base.js +1 -20
  52. package/dist/common.d.ts +6 -37
  53. package/dist/common.js +17 -39
  54. package/dist/configuration.d.ts +25 -18
  55. package/dist/configuration.js +4 -3
  56. package/dist/esm/api/default-api.d.ts +3 -10
  57. package/dist/esm/api/default-api.js +7 -13
  58. package/dist/esm/api/favored-option-api.d.ts +104 -0
  59. package/dist/esm/api/favored-option-api.js +202 -0
  60. package/dist/esm/api/impact-api.d.ts +245 -0
  61. package/dist/esm/api/impact-api.js +486 -0
  62. package/dist/esm/api/investment-api.d.ts +677 -0
  63. package/dist/esm/api/investment-api.js +1387 -0
  64. package/dist/esm/api/metric-api.d.ts +97 -88
  65. package/dist/esm/api/metric-api.js +185 -157
  66. package/dist/esm/api/metric-costs-api.d.ts +75 -0
  67. package/dist/esm/api/metric-costs-api.js +139 -0
  68. package/dist/esm/api/metric-costs-per-year-api.d.ts +105 -108
  69. package/dist/esm/api/metric-costs-per-year-api.js +199 -192
  70. package/dist/esm/api/objective-api.d.ts +242 -21
  71. package/dist/esm/api/objective-api.js +508 -37
  72. package/dist/esm/api/objective-weight-api.d.ts +105 -108
  73. package/dist/esm/api/objective-weight-api.js +189 -182
  74. package/dist/esm/api/objective-weights-api.d.ts +75 -0
  75. package/dist/esm/api/objective-weights-api.js +139 -0
  76. package/dist/esm/api/option-api.d.ts +436 -0
  77. package/dist/esm/api/option-api.js +881 -0
  78. package/dist/esm/api/value-framework-api.d.ts +528 -21
  79. package/dist/esm/api/value-framework-api.js +1137 -77
  80. package/dist/esm/api/value-framework-costs-api.d.ts +119 -0
  81. package/dist/esm/api/value-framework-costs-api.js +229 -0
  82. package/dist/esm/api/value-framework-weights-api.d.ts +75 -0
  83. package/dist/esm/api/value-framework-weights-api.js +139 -0
  84. package/dist/esm/api.d.ts +9 -1
  85. package/dist/esm/api.js +9 -1
  86. package/dist/esm/base.d.ts +1 -25
  87. package/dist/esm/base.js +1 -20
  88. package/dist/esm/common.d.ts +6 -37
  89. package/dist/esm/common.js +15 -38
  90. package/dist/esm/configuration.d.ts +25 -18
  91. package/dist/esm/configuration.js +4 -3
  92. package/dist/esm/index.d.ts +1 -1
  93. package/dist/esm/index.js +1 -1
  94. package/dist/esm/models/evolution-type.d.ts +16 -0
  95. package/dist/esm/models/evolution-type.js +17 -0
  96. package/dist/esm/models/favored-option-request.d.ts +20 -0
  97. package/dist/esm/models/{validation-error-loc-inner.js → favored-option-request.js} +1 -1
  98. package/dist/esm/models/favored-option-response.d.ts +20 -0
  99. package/dist/esm/models/favored-option-response.js +14 -0
  100. package/dist/esm/models/httpvalidation-error.d.ts +2 -12
  101. package/dist/esm/models/httpvalidation-error.js +1 -1
  102. package/dist/esm/models/impact-apiresponse.d.ts +33 -0
  103. package/dist/esm/models/impact-apiresponse.js +14 -0
  104. package/dist/esm/models/impact-create.d.ts +37 -0
  105. package/dist/esm/models/impact-create.js +14 -0
  106. package/dist/esm/models/impact-update.d.ts +22 -0
  107. package/dist/esm/models/impact-update.js +14 -0
  108. package/dist/esm/models/index.d.ts +13 -1
  109. package/dist/esm/models/index.js +13 -1
  110. package/dist/esm/models/investment-create.d.ts +21 -0
  111. package/dist/esm/models/investment-create.js +14 -0
  112. package/dist/esm/models/investment-response.d.ts +26 -0
  113. package/dist/esm/models/investment-response.js +14 -0
  114. package/dist/esm/models/investment-update.d.ts +18 -0
  115. package/dist/esm/models/investment-update.js +14 -0
  116. package/dist/esm/models/{validation-error-loc-inner.d.ts → location-inner.d.ts} +2 -7
  117. package/dist/esm/models/location-inner.js +14 -0
  118. package/dist/esm/models/measurement-type.d.ts +1 -6
  119. package/dist/esm/models/measurement-type.js +1 -6
  120. package/dist/esm/models/metric-costs-per-year-create.d.ts +1 -17
  121. package/dist/esm/models/metric-costs-per-year-create.js +1 -1
  122. package/dist/esm/models/metric-costs-per-year-response.d.ts +1 -18
  123. package/dist/esm/models/metric-costs-per-year-response.js +1 -1
  124. package/dist/esm/models/metric-costs-per-year-update.d.ts +1 -13
  125. package/dist/esm/models/metric-costs-per-year-update.js +1 -1
  126. package/dist/esm/models/metric-create.d.ts +3 -28
  127. package/dist/esm/models/metric-create.js +1 -1
  128. package/dist/esm/models/metric-response.d.ts +3 -50
  129. package/dist/esm/models/metric-response.js +1 -1
  130. package/dist/esm/models/metric-type.d.ts +1 -6
  131. package/dist/esm/models/metric-type.js +1 -6
  132. package/dist/esm/models/metric-update.d.ts +3 -35
  133. package/dist/esm/models/metric-update.js +1 -1
  134. package/dist/esm/models/objective-create.d.ts +1 -10
  135. package/dist/esm/models/objective-create.js +1 -1
  136. package/dist/esm/models/objective-response.d.ts +1 -30
  137. package/dist/esm/models/objective-response.js +1 -1
  138. package/dist/esm/models/objective-update.d.ts +1 -13
  139. package/dist/esm/models/objective-update.js +1 -1
  140. package/dist/esm/models/objective-weight-create.d.ts +1 -9
  141. package/dist/esm/models/objective-weight-create.js +1 -1
  142. package/dist/esm/models/objective-weight-response.d.ts +1 -14
  143. package/dist/esm/models/objective-weight-response.js +1 -1
  144. package/dist/esm/models/objective-weight-update.d.ts +1 -8
  145. package/dist/esm/models/objective-weight-update.js +1 -1
  146. package/dist/esm/models/option-create.d.ts +33 -0
  147. package/dist/esm/models/option-create.js +14 -0
  148. package/dist/esm/models/option-response.d.ts +32 -0
  149. package/dist/esm/models/option-response.js +14 -0
  150. package/dist/esm/models/option-update.d.ts +21 -0
  151. package/dist/esm/models/option-update.js +14 -0
  152. package/dist/esm/models/validation-error.d.ts +3 -33
  153. package/dist/esm/models/validation-error.js +1 -1
  154. package/dist/esm/models/value-framework-create.d.ts +1 -10
  155. package/dist/esm/models/value-framework-create.js +1 -1
  156. package/dist/esm/models/value-framework-response.d.ts +1 -30
  157. package/dist/esm/models/value-framework-response.js +1 -1
  158. package/dist/esm/models/value-framework-update.d.ts +1 -13
  159. package/dist/esm/models/value-framework-update.js +1 -1
  160. package/dist/index.d.ts +1 -1
  161. package/dist/index.js +1 -1
  162. package/dist/models/evolution-type.d.ts +16 -0
  163. package/dist/models/evolution-type.js +20 -0
  164. package/dist/models/favored-option-request.d.ts +20 -0
  165. package/dist/models/{validation-error-loc-inner.js → favored-option-request.js} +1 -1
  166. package/dist/models/favored-option-response.d.ts +20 -0
  167. package/dist/models/favored-option-response.js +15 -0
  168. package/dist/models/httpvalidation-error.d.ts +2 -12
  169. package/dist/models/httpvalidation-error.js +1 -1
  170. package/dist/models/impact-apiresponse.d.ts +33 -0
  171. package/dist/models/impact-apiresponse.js +15 -0
  172. package/dist/models/impact-create.d.ts +37 -0
  173. package/dist/models/impact-create.js +15 -0
  174. package/dist/models/impact-update.d.ts +22 -0
  175. package/dist/models/impact-update.js +15 -0
  176. package/dist/models/index.d.ts +13 -1
  177. package/dist/models/index.js +13 -1
  178. package/dist/models/investment-create.d.ts +21 -0
  179. package/dist/models/investment-create.js +15 -0
  180. package/dist/models/investment-response.d.ts +26 -0
  181. package/dist/models/investment-response.js +15 -0
  182. package/dist/models/investment-update.d.ts +18 -0
  183. package/dist/models/investment-update.js +15 -0
  184. package/dist/models/{validation-error-loc-inner.d.ts → location-inner.d.ts} +2 -7
  185. package/dist/models/location-inner.js +15 -0
  186. package/dist/models/measurement-type.d.ts +1 -6
  187. package/dist/models/measurement-type.js +1 -6
  188. package/dist/models/metric-costs-per-year-create.d.ts +1 -17
  189. package/dist/models/metric-costs-per-year-create.js +1 -1
  190. package/dist/models/metric-costs-per-year-response.d.ts +1 -18
  191. package/dist/models/metric-costs-per-year-response.js +1 -1
  192. package/dist/models/metric-costs-per-year-update.d.ts +1 -13
  193. package/dist/models/metric-costs-per-year-update.js +1 -1
  194. package/dist/models/metric-create.d.ts +3 -28
  195. package/dist/models/metric-create.js +1 -1
  196. package/dist/models/metric-response.d.ts +3 -50
  197. package/dist/models/metric-response.js +1 -1
  198. package/dist/models/metric-type.d.ts +1 -6
  199. package/dist/models/metric-type.js +1 -6
  200. package/dist/models/metric-update.d.ts +3 -35
  201. package/dist/models/metric-update.js +1 -1
  202. package/dist/models/objective-create.d.ts +1 -10
  203. package/dist/models/objective-create.js +1 -1
  204. package/dist/models/objective-response.d.ts +1 -30
  205. package/dist/models/objective-response.js +1 -1
  206. package/dist/models/objective-update.d.ts +1 -13
  207. package/dist/models/objective-update.js +1 -1
  208. package/dist/models/objective-weight-create.d.ts +1 -9
  209. package/dist/models/objective-weight-create.js +1 -1
  210. package/dist/models/objective-weight-response.d.ts +1 -14
  211. package/dist/models/objective-weight-response.js +1 -1
  212. package/dist/models/objective-weight-update.d.ts +1 -8
  213. package/dist/models/objective-weight-update.js +1 -1
  214. package/dist/models/option-create.d.ts +33 -0
  215. package/dist/models/option-create.js +15 -0
  216. package/dist/models/option-response.d.ts +32 -0
  217. package/dist/models/option-response.js +15 -0
  218. package/dist/models/option-update.d.ts +21 -0
  219. package/dist/models/option-update.js +15 -0
  220. package/dist/models/validation-error.d.ts +3 -33
  221. package/dist/models/validation-error.js +1 -1
  222. package/dist/models/value-framework-create.d.ts +1 -10
  223. package/dist/models/value-framework-create.js +1 -1
  224. package/dist/models/value-framework-response.d.ts +1 -30
  225. package/dist/models/value-framework-response.js +1 -1
  226. package/dist/models/value-framework-update.d.ts +1 -13
  227. package/dist/models/value-framework-update.js +1 -1
  228. package/docs/DefaultApi.md +51 -0
  229. package/docs/EvolutionType.md +10 -0
  230. package/docs/FavoredOptionApi.md +119 -0
  231. package/docs/FavoredOptionRequest.md +21 -0
  232. package/docs/FavoredOptionResponse.md +21 -0
  233. package/docs/HTTPValidationError.md +20 -0
  234. package/docs/ImpactAPIResponse.md +39 -0
  235. package/docs/ImpactApi.md +312 -0
  236. package/docs/ImpactCreate.md +29 -0
  237. package/docs/ImpactUpdate.md +29 -0
  238. package/docs/InvestmentApi.md +987 -0
  239. package/docs/InvestmentCreate.md +23 -0
  240. package/docs/InvestmentResponse.md +33 -0
  241. package/docs/InvestmentUpdate.md +23 -0
  242. package/docs/LocationInner.md +18 -0
  243. package/docs/MeasurementType.md +10 -0
  244. package/docs/MetricApi.md +299 -0
  245. package/docs/MetricCostsApi.md +66 -0
  246. package/docs/MetricCostsPerYearApi.md +307 -0
  247. package/docs/MetricCostsPerYearCreate.md +27 -0
  248. package/docs/MetricCostsPerYearResponse.md +31 -0
  249. package/docs/MetricCostsPerYearUpdate.md +23 -0
  250. package/docs/MetricCreate.md +33 -0
  251. package/docs/MetricResponse.md +43 -0
  252. package/docs/MetricType.md +12 -0
  253. package/docs/MetricUpdate.md +31 -0
  254. package/docs/ObjectiveApi.md +633 -0
  255. package/docs/ObjectiveCreate.md +23 -0
  256. package/docs/ObjectiveResponse.md +31 -0
  257. package/docs/ObjectiveUpdate.md +23 -0
  258. package/docs/ObjectiveWeightApi.md +298 -0
  259. package/docs/ObjectiveWeightCreate.md +25 -0
  260. package/docs/ObjectiveWeightResponse.md +27 -0
  261. package/docs/ObjectiveWeightUpdate.md +21 -0
  262. package/docs/ObjectiveWeightsApi.md +66 -0
  263. package/docs/OptionApi.md +602 -0
  264. package/docs/OptionCreate.md +29 -0
  265. package/docs/OptionResponse.md +39 -0
  266. package/docs/OptionUpdate.md +29 -0
  267. package/docs/ValidationError.md +28 -0
  268. package/docs/ValueFrameworkApi.md +1053 -0
  269. package/docs/ValueFrameworkCostsApi.md +128 -0
  270. package/docs/ValueFrameworkCreate.md +23 -0
  271. package/docs/ValueFrameworkResponse.md +31 -0
  272. package/docs/ValueFrameworkUpdate.md +23 -0
  273. package/docs/ValueFrameworkWeightsApi.md +66 -0
  274. package/index.ts +1 -1
  275. package/models/evolution-type.ts +26 -0
  276. package/models/favored-option-request.ts +26 -0
  277. package/models/favored-option-response.ts +26 -0
  278. package/models/httpvalidation-error.ts +2 -12
  279. package/models/impact-apiresponse.ts +43 -0
  280. package/models/impact-create.ts +47 -0
  281. package/models/impact-update.ts +32 -0
  282. package/models/index.ts +13 -1
  283. package/models/investment-create.ts +27 -0
  284. package/models/investment-response.ts +32 -0
  285. package/models/investment-update.ts +24 -0
  286. package/models/{validation-error-loc-inner.ts → location-inner.ts} +2 -7
  287. package/models/measurement-type.ts +1 -6
  288. package/models/metric-costs-per-year-create.ts +1 -17
  289. package/models/metric-costs-per-year-response.ts +1 -18
  290. package/models/metric-costs-per-year-update.ts +1 -13
  291. package/models/metric-create.ts +3 -28
  292. package/models/metric-response.ts +3 -50
  293. package/models/metric-type.ts +1 -6
  294. package/models/metric-update.ts +3 -35
  295. package/models/objective-create.ts +1 -10
  296. package/models/objective-response.ts +1 -30
  297. package/models/objective-update.ts +1 -13
  298. package/models/objective-weight-create.ts +1 -9
  299. package/models/objective-weight-response.ts +1 -14
  300. package/models/objective-weight-update.ts +1 -8
  301. package/models/option-create.ts +39 -0
  302. package/models/option-response.ts +38 -0
  303. package/models/option-update.ts +27 -0
  304. package/models/validation-error.ts +3 -33
  305. package/models/value-framework-create.ts +1 -10
  306. package/models/value-framework-response.ts +1 -30
  307. package/models/value-framework-update.ts +1 -13
  308. package/package.json +4 -4
package/api/metric-api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Asset Investment Planning
5
5
  * API for Asset Investment Planning
6
6
  *
7
- * The version of the OpenAPI document: 0.2.0-dev2
7
+ * The version of the OpenAPI document: 0.2.0-dev3
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,33 +18,35 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
18
  import globalAxios from 'axios';
19
19
  // Some imports not used depending on template conditions
20
20
  // @ts-ignore
21
- import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
22
22
  // @ts-ignore
23
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
23
+ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
24
  // @ts-ignore
25
- import { MetricCreate } from '../models';
25
+ import type { MetricCreate } from '../models';
26
26
  // @ts-ignore
27
- import { MetricResponse } from '../models';
27
+ import type { MetricResponse } from '../models';
28
28
  // @ts-ignore
29
- import { MetricUpdate } from '../models';
29
+ import type { MetricUpdate } from '../models';
30
30
  /**
31
31
  * MetricApi - axios parameter creator
32
- * @export
33
32
  */
34
33
  export const MetricApiAxiosParamCreator = function (configuration?: Configuration) {
35
34
  return {
36
35
  /**
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
36
+ * Create a new metric under this objective.
37
+ * @summary Create a metric for this objective
38
+ * @param {string} objectiveId UUID of the objective
39
+ * @param {MetricCreate} metricCreate
40
40
  * @param {*} [options] Override http request option.
41
41
  * @throws {RequiredError}
42
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)));
43
+ createMetricForObjective: async (objectiveId: string, metricCreate: MetricCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
44
+ // verify required parameter 'objectiveId' is not null or undefined
45
+ assertParamExists('createMetricForObjective', 'objectiveId', objectiveId)
46
+ // verify required parameter 'metricCreate' is not null or undefined
47
+ assertParamExists('createMetricForObjective', 'metricCreate', metricCreate)
48
+ const localVarPath = `/objective/{objective_id}/metric/`
49
+ .replace(`{${"objective_id"}}`, encodeURIComponent(String(objectiveId)));
48
50
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
49
51
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
50
52
  let baseOptions;
@@ -52,7 +54,7 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
52
54
  baseOptions = configuration.baseOptions;
53
55
  }
54
56
 
55
- const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
57
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
56
58
  const localVarHeaderParameter = {} as any;
57
59
  const localVarQueryParameter = {} as any;
58
60
 
@@ -60,11 +62,13 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
60
62
  // oauth required
61
63
  await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
62
64
 
65
+ localVarHeaderParameter['Content-Type'] = 'application/json';
66
+ localVarHeaderParameter['Accept'] = 'application/json';
63
67
 
64
-
65
68
  setSearchParams(localVarUrlObj, localVarQueryParameter);
66
69
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
67
70
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
71
+ localVarRequestOptions.data = serializeDataIfNeeded(metricCreate, localVarRequestOptions, configuration)
68
72
 
69
73
  return {
70
74
  url: toPathString(localVarUrlObj),
@@ -72,17 +76,21 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
72
76
  };
73
77
  },
74
78
  /**
75
- * Retrieve a single metric by its ID.
76
- * @summary Get a metric by ID
79
+ * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
80
+ * @summary Delete a metric for this objective
77
81
  * @param {string} metricId UUID of the metric
82
+ * @param {string} objectiveId UUID of the objective
78
83
  * @param {*} [options] Override http request option.
79
84
  * @throws {RequiredError}
80
85
  */
81
- getMetricById: async (metricId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
86
+ deleteMetricForObjective: async (metricId: string, objectiveId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
82
87
  // 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)));
88
+ assertParamExists('deleteMetricForObjective', 'metricId', metricId)
89
+ // verify required parameter 'objectiveId' is not null or undefined
90
+ assertParamExists('deleteMetricForObjective', 'objectiveId', objectiveId)
91
+ const localVarPath = `/objective/{objective_id}/metric/{metric_id}`
92
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)))
93
+ .replace(`{${"objective_id"}}`, encodeURIComponent(String(objectiveId)));
86
94
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
87
95
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
88
96
  let baseOptions;
@@ -90,7 +98,7 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
90
98
  baseOptions = configuration.baseOptions;
91
99
  }
92
100
 
93
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
101
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
94
102
  const localVarHeaderParameter = {} as any;
95
103
  const localVarQueryParameter = {} as any;
96
104
 
@@ -99,7 +107,6 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
99
107
  await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
100
108
 
101
109
 
102
-
103
110
  setSearchParams(localVarUrlObj, localVarQueryParameter);
104
111
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
105
112
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -110,15 +117,21 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
110
117
  };
111
118
  },
112
119
  /**
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
120
+ * Retrieve a specific metric for the objective.
121
+ * @summary Get a metric for this objective
122
+ * @param {string} metricId UUID of the metric
123
+ * @param {string} objectiveId UUID of the objective
117
124
  * @param {*} [options] Override http request option.
118
125
  * @throws {RequiredError}
119
126
  */
120
- getMetrics: async (offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
121
- const localVarPath = `/metric/`;
127
+ getMetricForObjective: async (metricId: string, objectiveId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
128
+ // verify required parameter 'metricId' is not null or undefined
129
+ assertParamExists('getMetricForObjective', 'metricId', metricId)
130
+ // verify required parameter 'objectiveId' is not null or undefined
131
+ assertParamExists('getMetricForObjective', 'objectiveId', objectiveId)
132
+ const localVarPath = `/objective/{objective_id}/metric/{metric_id}`
133
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)))
134
+ .replace(`{${"objective_id"}}`, encodeURIComponent(String(objectiveId)));
122
135
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
123
136
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
124
137
  let baseOptions;
@@ -134,16 +147,8 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
134
147
  // oauth required
135
148
  await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
136
149
 
137
- if (offset !== undefined) {
138
- localVarQueryParameter['offset'] = offset;
139
- }
140
-
141
- if (limit !== undefined) {
142
- localVarQueryParameter['limit'] = limit;
143
- }
144
-
150
+ localVarHeaderParameter['Accept'] = 'application/json';
145
151
 
146
-
147
152
  setSearchParams(localVarUrlObj, localVarQueryParameter);
148
153
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
149
154
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -154,20 +159,19 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
154
159
  };
155
160
  },
156
161
  /**
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
162
+ * Retrieve a paginated list of all metrics for a specific objective.
163
+ * @summary List metrics for this objective
164
+ * @param {string} objectiveId UUID of the objective
165
+ * @param {number} [offset] Number of records to skip
166
+ * @param {number} [limit] Max number of records to return
161
167
  * @param {*} [options] Override http request option.
162
168
  * @throws {RequiredError}
163
169
  */
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)));
170
+ getMetricsForObjective: async (objectiveId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
171
+ // verify required parameter 'objectiveId' is not null or undefined
172
+ assertParamExists('getMetricsForObjective', 'objectiveId', objectiveId)
173
+ const localVarPath = `/objective/{objective_id}/metric/`
174
+ .replace(`{${"objective_id"}}`, encodeURIComponent(String(objectiveId)));
171
175
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
172
176
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
173
177
  let baseOptions;
@@ -175,7 +179,7 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
175
179
  baseOptions = configuration.baseOptions;
176
180
  }
177
181
 
178
- const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
182
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
179
183
  const localVarHeaderParameter = {} as any;
180
184
  const localVarQueryParameter = {} as any;
181
185
 
@@ -183,14 +187,19 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
183
187
  // oauth required
184
188
  await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
185
189
 
190
+ if (offset !== undefined) {
191
+ localVarQueryParameter['offset'] = offset;
192
+ }
186
193
 
187
-
188
- localVarHeaderParameter['Content-Type'] = 'application/json';
194
+ if (limit !== undefined) {
195
+ localVarQueryParameter['limit'] = limit;
196
+ }
197
+
198
+ localVarHeaderParameter['Accept'] = 'application/json';
189
199
 
190
200
  setSearchParams(localVarUrlObj, localVarQueryParameter);
191
201
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
192
202
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
193
- localVarRequestOptions.data = serializeDataIfNeeded(metricUpdate, localVarRequestOptions, configuration)
194
203
 
195
204
  return {
196
205
  url: toPathString(localVarUrlObj),
@@ -198,16 +207,24 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
198
207
  };
199
208
  },
200
209
  /**
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
210
+ * Update one or more fields of an existing metric. Only the fields included in the request body will be modified; omitted fields remain unchanged.
211
+ * @summary Partially update a metric for this objective
212
+ * @param {string} metricId UUID of the metric
213
+ * @param {string} objectiveId UUID of the objective
214
+ * @param {MetricUpdate} metricUpdate
204
215
  * @param {*} [options] Override http request option.
205
216
  * @throws {RequiredError}
206
217
  */
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/`;
218
+ patchMetricForObjective: async (metricId: string, objectiveId: string, metricUpdate: MetricUpdate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
219
+ // verify required parameter 'metricId' is not null or undefined
220
+ assertParamExists('patchMetricForObjective', 'metricId', metricId)
221
+ // verify required parameter 'objectiveId' is not null or undefined
222
+ assertParamExists('patchMetricForObjective', 'objectiveId', objectiveId)
223
+ // verify required parameter 'metricUpdate' is not null or undefined
224
+ assertParamExists('patchMetricForObjective', 'metricUpdate', metricUpdate)
225
+ const localVarPath = `/objective/{objective_id}/metric/{metric_id}`
226
+ .replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)))
227
+ .replace(`{${"objective_id"}}`, encodeURIComponent(String(objectiveId)));
211
228
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
212
229
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
213
230
  let baseOptions;
@@ -215,7 +232,7 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
215
232
  baseOptions = configuration.baseOptions;
216
233
  }
217
234
 
218
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
235
+ const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
219
236
  const localVarHeaderParameter = {} as any;
220
237
  const localVarQueryParameter = {} as any;
221
238
 
@@ -223,14 +240,13 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
223
240
  // oauth required
224
241
  await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
225
242
 
226
-
227
-
228
243
  localVarHeaderParameter['Content-Type'] = 'application/json';
244
+ localVarHeaderParameter['Accept'] = 'application/json';
229
245
 
230
246
  setSearchParams(localVarUrlObj, localVarQueryParameter);
231
247
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
232
248
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
233
- localVarRequestOptions.data = serializeDataIfNeeded(metricCreate, localVarRequestOptions, configuration)
249
+ localVarRequestOptions.data = serializeDataIfNeeded(metricUpdate, localVarRequestOptions, configuration)
234
250
 
235
251
  return {
236
252
  url: toPathString(localVarUrlObj),
@@ -242,210 +258,215 @@ export const MetricApiAxiosParamCreator = function (configuration?: Configuratio
242
258
 
243
259
  /**
244
260
  * MetricApi - functional programming interface
245
- * @export
246
261
  */
247
262
  export const MetricApiFp = function(configuration?: Configuration) {
248
263
  const localVarAxiosParamCreator = MetricApiAxiosParamCreator(configuration)
249
264
  return {
265
+ /**
266
+ * Create a new metric under this objective.
267
+ * @summary Create a metric for this objective
268
+ * @param {string} objectiveId UUID of the objective
269
+ * @param {MetricCreate} metricCreate
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ async createMetricForObjective(objectiveId: string, metricCreate: MetricCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
274
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createMetricForObjective(objectiveId, metricCreate, options);
275
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
276
+ const localVarOperationServerBasePath = operationServerMap['MetricApi.createMetricForObjective']?.[localVarOperationServerIndex]?.url;
277
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
278
+ },
250
279
  /**
251
280
  * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
252
- * @summary Delete a metric
281
+ * @summary Delete a metric for this objective
253
282
  * @param {string} metricId UUID of the metric
283
+ * @param {string} objectiveId UUID of the objective
254
284
  * @param {*} [options] Override http request option.
255
285
  * @throws {RequiredError}
256
286
  */
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);
287
+ async deleteMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
288
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMetricForObjective(metricId, objectiveId, options);
289
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
290
+ const localVarOperationServerBasePath = operationServerMap['MetricApi.deleteMetricForObjective']?.[localVarOperationServerIndex]?.url;
291
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
262
292
  },
263
293
  /**
264
- * Retrieve a single metric by its ID.
265
- * @summary Get a metric by ID
294
+ * Retrieve a specific metric for the objective.
295
+ * @summary Get a metric for this objective
266
296
  * @param {string} metricId UUID of the metric
297
+ * @param {string} objectiveId UUID of the objective
267
298
  * @param {*} [options] Override http request option.
268
299
  * @throws {RequiredError}
269
300
  */
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);
301
+ async getMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
302
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMetricForObjective(metricId, objectiveId, options);
303
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
304
+ const localVarOperationServerBasePath = operationServerMap['MetricApi.getMetricForObjective']?.[localVarOperationServerIndex]?.url;
305
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
275
306
  },
276
307
  /**
277
- * Retrieve a paginated list of all metrics.
278
- * @summary List metrics
308
+ * Retrieve a paginated list of all metrics for a specific objective.
309
+ * @summary List metrics for this objective
310
+ * @param {string} objectiveId UUID of the objective
279
311
  * @param {number} [offset] Number of records to skip
280
312
  * @param {number} [limit] Max number of records to return
281
313
  * @param {*} [options] Override http request option.
282
314
  * @throws {RequiredError}
283
315
  */
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);
316
+ async getMetricsForObjective(objectiveId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetricResponse>>> {
317
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getMetricsForObjective(objectiveId, offset, limit, options);
318
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
319
+ const localVarOperationServerBasePath = operationServerMap['MetricApi.getMetricsForObjective']?.[localVarOperationServerIndex]?.url;
320
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
289
321
  },
290
322
  /**
291
323
  * 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
324
+ * @summary Partially update a metric for this objective
293
325
  * @param {string} metricId UUID of the metric
326
+ * @param {string} objectiveId UUID of the objective
294
327
  * @param {MetricUpdate} metricUpdate
295
328
  * @param {*} [options] Override http request option.
296
329
  * @throws {RequiredError}
297
330
  */
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);
331
+ async patchMetricForObjective(metricId: string, objectiveId: string, metricUpdate: MetricUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MetricResponse>> {
332
+ const localVarAxiosArgs = await localVarAxiosParamCreator.patchMetricForObjective(metricId, objectiveId, metricUpdate, options);
333
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
334
+ const localVarOperationServerBasePath = operationServerMap['MetricApi.patchMetricForObjective']?.[localVarOperationServerIndex]?.url;
335
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
316
336
  },
317
337
  }
318
338
  };
319
339
 
320
340
  /**
321
341
  * MetricApi - factory interface
322
- * @export
323
342
  */
324
343
  export const MetricApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
325
344
  const localVarFp = MetricApiFp(configuration)
326
345
  return {
346
+ /**
347
+ * Create a new metric under this objective.
348
+ * @summary Create a metric for this objective
349
+ * @param {string} objectiveId UUID of the objective
350
+ * @param {MetricCreate} metricCreate
351
+ * @param {*} [options] Override http request option.
352
+ * @throws {RequiredError}
353
+ */
354
+ createMetricForObjective(objectiveId: string, metricCreate: MetricCreate, options?: RawAxiosRequestConfig): AxiosPromise<MetricResponse> {
355
+ return localVarFp.createMetricForObjective(objectiveId, metricCreate, options).then((request) => request(axios, basePath));
356
+ },
327
357
  /**
328
358
  * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
329
- * @summary Delete a metric
359
+ * @summary Delete a metric for this objective
330
360
  * @param {string} metricId UUID of the metric
361
+ * @param {string} objectiveId UUID of the objective
331
362
  * @param {*} [options] Override http request option.
332
363
  * @throws {RequiredError}
333
364
  */
334
- deleteMetric(metricId: string, options?: any): AxiosPromise<void> {
335
- return localVarFp.deleteMetric(metricId, options).then((request) => request(axios, basePath));
365
+ deleteMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
366
+ return localVarFp.deleteMetricForObjective(metricId, objectiveId, options).then((request) => request(axios, basePath));
336
367
  },
337
368
  /**
338
- * Retrieve a single metric by its ID.
339
- * @summary Get a metric by ID
369
+ * Retrieve a specific metric for the objective.
370
+ * @summary Get a metric for this objective
340
371
  * @param {string} metricId UUID of the metric
372
+ * @param {string} objectiveId UUID of the objective
341
373
  * @param {*} [options] Override http request option.
342
374
  * @throws {RequiredError}
343
375
  */
344
- getMetricById(metricId: string, options?: any): AxiosPromise<MetricResponse> {
345
- return localVarFp.getMetricById(metricId, options).then((request) => request(axios, basePath));
376
+ getMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig): AxiosPromise<MetricResponse> {
377
+ return localVarFp.getMetricForObjective(metricId, objectiveId, options).then((request) => request(axios, basePath));
346
378
  },
347
379
  /**
348
- * Retrieve a paginated list of all metrics.
349
- * @summary List metrics
380
+ * Retrieve a paginated list of all metrics for a specific objective.
381
+ * @summary List metrics for this objective
382
+ * @param {string} objectiveId UUID of the objective
350
383
  * @param {number} [offset] Number of records to skip
351
384
  * @param {number} [limit] Max number of records to return
352
385
  * @param {*} [options] Override http request option.
353
386
  * @throws {RequiredError}
354
387
  */
355
- getMetrics(offset?: number, limit?: number, options?: any): AxiosPromise<Array<MetricResponse>> {
356
- return localVarFp.getMetrics(offset, limit, options).then((request) => request(axios, basePath));
388
+ getMetricsForObjective(objectiveId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<MetricResponse>> {
389
+ return localVarFp.getMetricsForObjective(objectiveId, offset, limit, options).then((request) => request(axios, basePath));
357
390
  },
358
391
  /**
359
392
  * 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
393
+ * @summary Partially update a metric for this objective
361
394
  * @param {string} metricId UUID of the metric
395
+ * @param {string} objectiveId UUID of the objective
362
396
  * @param {MetricUpdate} metricUpdate
363
397
  * @param {*} [options] Override http request option.
364
398
  * @throws {RequiredError}
365
399
  */
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));
400
+ patchMetricForObjective(metricId: string, objectiveId: string, metricUpdate: MetricUpdate, options?: RawAxiosRequestConfig): AxiosPromise<MetricResponse> {
401
+ return localVarFp.patchMetricForObjective(metricId, objectiveId, metricUpdate, options).then((request) => request(axios, basePath));
378
402
  },
379
403
  };
380
404
  };
381
405
 
382
406
  /**
383
407
  * MetricApi - object-oriented interface
384
- * @export
385
- * @class MetricApi
386
- * @extends {BaseAPI}
387
408
  */
388
409
  export class MetricApi extends BaseAPI {
410
+ /**
411
+ * Create a new metric under this objective.
412
+ * @summary Create a metric for this objective
413
+ * @param {string} objectiveId UUID of the objective
414
+ * @param {MetricCreate} metricCreate
415
+ * @param {*} [options] Override http request option.
416
+ * @throws {RequiredError}
417
+ */
418
+ public createMetricForObjective(objectiveId: string, metricCreate: MetricCreate, options?: RawAxiosRequestConfig) {
419
+ return MetricApiFp(this.configuration).createMetricForObjective(objectiveId, metricCreate, options).then((request) => request(this.axios, this.basePath));
420
+ }
421
+
389
422
  /**
390
423
  * Delete an existing metric by its ID. Associated metric costs per year are also deleted via cascade.
391
- * @summary Delete a metric
424
+ * @summary Delete a metric for this objective
392
425
  * @param {string} metricId UUID of the metric
426
+ * @param {string} objectiveId UUID of the objective
393
427
  * @param {*} [options] Override http request option.
394
428
  * @throws {RequiredError}
395
- * @memberof MetricApi
396
429
  */
397
- public deleteMetric(metricId: string, options?: RawAxiosRequestConfig) {
398
- return MetricApiFp(this.configuration).deleteMetric(metricId, options).then((request) => request(this.axios, this.basePath));
430
+ public deleteMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig) {
431
+ return MetricApiFp(this.configuration).deleteMetricForObjective(metricId, objectiveId, options).then((request) => request(this.axios, this.basePath));
399
432
  }
400
433
 
401
434
  /**
402
- * Retrieve a single metric by its ID.
403
- * @summary Get a metric by ID
435
+ * Retrieve a specific metric for the objective.
436
+ * @summary Get a metric for this objective
404
437
  * @param {string} metricId UUID of the metric
438
+ * @param {string} objectiveId UUID of the objective
405
439
  * @param {*} [options] Override http request option.
406
440
  * @throws {RequiredError}
407
- * @memberof MetricApi
408
441
  */
409
- public getMetricById(metricId: string, options?: RawAxiosRequestConfig) {
410
- return MetricApiFp(this.configuration).getMetricById(metricId, options).then((request) => request(this.axios, this.basePath));
442
+ public getMetricForObjective(metricId: string, objectiveId: string, options?: RawAxiosRequestConfig) {
443
+ return MetricApiFp(this.configuration).getMetricForObjective(metricId, objectiveId, options).then((request) => request(this.axios, this.basePath));
411
444
  }
412
445
 
413
446
  /**
414
- * Retrieve a paginated list of all metrics.
415
- * @summary List metrics
447
+ * Retrieve a paginated list of all metrics for a specific objective.
448
+ * @summary List metrics for this objective
449
+ * @param {string} objectiveId UUID of the objective
416
450
  * @param {number} [offset] Number of records to skip
417
451
  * @param {number} [limit] Max number of records to return
418
452
  * @param {*} [options] Override http request option.
419
453
  * @throws {RequiredError}
420
- * @memberof MetricApi
421
454
  */
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));
455
+ public getMetricsForObjective(objectiveId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig) {
456
+ return MetricApiFp(this.configuration).getMetricsForObjective(objectiveId, offset, limit, options).then((request) => request(this.axios, this.basePath));
424
457
  }
425
458
 
426
459
  /**
427
460
  * 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
461
+ * @summary Partially update a metric for this objective
429
462
  * @param {string} metricId UUID of the metric
463
+ * @param {string} objectiveId UUID of the objective
430
464
  * @param {MetricUpdate} metricUpdate
431
465
  * @param {*} [options] Override http request option.
432
466
  * @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
467
  */
447
- public postMetric(metricCreate: MetricCreate, options?: RawAxiosRequestConfig) {
448
- return MetricApiFp(this.configuration).postMetric(metricCreate, options).then((request) => request(this.axios, this.basePath));
468
+ public patchMetricForObjective(metricId: string, objectiveId: string, metricUpdate: MetricUpdate, options?: RawAxiosRequestConfig) {
469
+ return MetricApiFp(this.configuration).patchMetricForObjective(metricId, objectiveId, metricUpdate, options).then((request) => request(this.axios, this.basePath));
449
470
  }
450
471
  }
451
472