snaptrade-typescript-sdk 8.17.0 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +147 -183
  2. package/dist/api/account-information-api-custom.d.ts +3 -3
  3. package/dist/api/account-information-api-custom.js +27 -27
  4. package/dist/api/account-information-api.d.ts +526 -527
  5. package/dist/api/account-information-api.js +1049 -1050
  6. package/dist/api/api-status-api-custom.d.ts +3 -3
  7. package/dist/api/api-status-api-custom.js +27 -27
  8. package/dist/api/api-status-api.d.ts +70 -71
  9. package/dist/api/api-status-api.js +203 -204
  10. package/dist/api/authentication-api-custom.d.ts +3 -3
  11. package/dist/api/authentication-api-custom.js +27 -27
  12. package/dist/api/authentication-api.d.ts +267 -268
  13. package/dist/api/authentication-api.js +661 -662
  14. package/dist/api/connections-api-custom.d.ts +3 -3
  15. package/dist/api/connections-api-custom.js +27 -27
  16. package/dist/api/connections-api.d.ts +275 -276
  17. package/dist/api/connections-api.js +583 -584
  18. package/dist/api/error-logs-api-custom.d.ts +3 -3
  19. package/dist/api/error-logs-api-custom.js +27 -27
  20. package/dist/api/error-logs-api.d.ts +94 -95
  21. package/dist/api/error-logs-api.js +240 -241
  22. package/dist/api/options-api-custom.d.ts +3 -3
  23. package/dist/api/options-api-custom.js +27 -27
  24. package/dist/api/options-api.d.ts +369 -370
  25. package/dist/api/options-api.js +730 -731
  26. package/dist/api/reference-data-api-custom.d.ts +3 -3
  27. package/dist/api/reference-data-api-custom.js +27 -27
  28. package/dist/api/reference-data-api.d.ts +468 -469
  29. package/dist/api/reference-data-api.js +1246 -1247
  30. package/dist/api/trading-api-custom.d.ts +3 -3
  31. package/dist/api/trading-api-custom.js +27 -27
  32. package/dist/api/trading-api.d.ts +403 -634
  33. package/dist/api/trading-api.js +841 -1282
  34. package/dist/api/transactions-and-reporting-api-custom.d.ts +3 -3
  35. package/dist/api/transactions-and-reporting-api-custom.js +27 -27
  36. package/dist/api/transactions-and-reporting-api.d.ts +218 -219
  37. package/dist/api/transactions-and-reporting-api.js +403 -404
  38. package/dist/api.d.ts +19 -21
  39. package/dist/api.js +37 -39
  40. package/dist/base.d.ts +54 -55
  41. package/dist/base.js +81 -82
  42. package/dist/client-custom.d.ts +4 -4
  43. package/dist/client-custom.js +9 -9
  44. package/dist/client.d.ts +25 -27
  45. package/dist/client.js +50 -52
  46. package/dist/common.d.ts +67 -67
  47. package/dist/common.js +236 -233
  48. package/dist/configuration.d.ts +99 -100
  49. package/dist/configuration.js +55 -56
  50. package/dist/index.d.ts +14 -15
  51. package/dist/index.js +32 -33
  52. package/dist/jest.config.d.ts +3 -3
  53. package/dist/jest.config.js +13 -13
  54. package/dist/models/account-holdings-account.d.ts +53 -54
  55. package/dist/models/account-holdings-account.js +14 -15
  56. package/dist/models/account-holdings.d.ts +46 -47
  57. package/dist/models/account-holdings.js +14 -15
  58. package/dist/models/account-order-record-status.d.ts +16 -17
  59. package/dist/models/account-order-record-status.js +14 -15
  60. package/dist/models/account-order-record.d.ts +132 -133
  61. package/dist/models/account-order-record.js +14 -15
  62. package/dist/models/account-simple.d.ts +43 -44
  63. package/dist/models/account-simple.js +14 -15
  64. package/dist/models/account-sync-status.d.ts +24 -25
  65. package/dist/models/account-sync-status.js +14 -15
  66. package/dist/models/account.d.ts +82 -83
  67. package/dist/models/account.js +14 -15
  68. package/dist/models/action.d.ts +16 -17
  69. package/dist/models/action.js +14 -15
  70. package/dist/models/authentication-login-snap-trade-user200-response.d.ts +17 -18
  71. package/dist/models/authentication-login-snap-trade-user200-response.js +14 -15
  72. package/dist/models/balance.d.ts +31 -32
  73. package/dist/models/balance.js +14 -15
  74. package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +36 -37
  75. package/dist/models/brokerage-authorization-type-read-only-brokerage.js +14 -15
  76. package/dist/models/brokerage-authorization-type-read-only.d.ts +46 -47
  77. package/dist/models/brokerage-authorization-type-read-only.js +14 -15
  78. package/dist/models/brokerage-authorization-type.d.ts +26 -27
  79. package/dist/models/brokerage-authorization-type.js +14 -15
  80. package/dist/models/brokerage-authorization.d.ts +75 -76
  81. package/dist/models/brokerage-authorization.js +14 -15
  82. package/dist/models/brokerage-symbol.d.ts +50 -51
  83. package/dist/models/brokerage-symbol.js +14 -15
  84. package/dist/models/brokerage-type.d.ts +30 -31
  85. package/dist/models/brokerage-type.js +14 -15
  86. package/dist/models/brokerage.d.ts +127 -128
  87. package/dist/models/brokerage.js +14 -15
  88. package/dist/models/calculated-trade.d.ts +31 -32
  89. package/dist/models/calculated-trade.js +14 -15
  90. package/dist/models/cash-restriction.d.ts +50 -51
  91. package/dist/models/cash-restriction.js +14 -15
  92. package/dist/models/connections-session-events200-response-inner.d.ts +16 -17
  93. package/dist/models/connections-session-events200-response-inner.js +14 -15
  94. package/dist/models/currency.d.ts +36 -37
  95. package/dist/models/currency.js +14 -15
  96. package/dist/models/delete-user-response.d.ts +30 -31
  97. package/dist/models/delete-user-response.js +14 -15
  98. package/dist/models/dividend-at-date.d.ts +36 -37
  99. package/dist/models/dividend-at-date.js +14 -15
  100. package/dist/models/encrypted-response-encrypted-message-data.d.ts +36 -37
  101. package/dist/models/encrypted-response-encrypted-message-data.js +14 -15
  102. package/dist/models/encrypted-response.d.ts +30 -31
  103. package/dist/models/encrypted-response.js +14 -15
  104. package/dist/models/exchange-rate-pairs.d.ts +37 -38
  105. package/dist/models/exchange-rate-pairs.js +14 -15
  106. package/dist/models/exchange.d.ts +66 -67
  107. package/dist/models/exchange.js +14 -15
  108. package/dist/models/excluded-asset.d.ts +25 -26
  109. package/dist/models/excluded-asset.js +14 -15
  110. package/dist/models/index.d.ts +108 -108
  111. package/dist/models/index.js +124 -124
  112. package/dist/models/jwt.d.ts +24 -25
  113. package/dist/models/jwt.js +14 -15
  114. package/dist/models/login-redirect-uri.d.ts +29 -30
  115. package/dist/models/login-redirect-uri.js +14 -15
  116. package/dist/models/manual-trade-and-impact.d.ts +38 -39
  117. package/dist/models/manual-trade-and-impact.js +14 -15
  118. package/dist/models/manual-trade-balance.d.ts +38 -39
  119. package/dist/models/manual-trade-balance.js +14 -15
  120. package/dist/models/manual-trade-form.d.ts +68 -69
  121. package/dist/models/manual-trade-form.js +14 -15
  122. package/dist/models/manual-trade-symbol.d.ts +55 -56
  123. package/dist/models/manual-trade-symbol.js +14 -15
  124. package/dist/models/manual-trade.d.ts +70 -71
  125. package/dist/models/manual-trade.js +14 -15
  126. package/dist/models/model-asset-class-details.d.ts +32 -32
  127. package/dist/models/model-asset-class-details.js +14 -15
  128. package/dist/models/model-asset-class-target.d.ts +25 -26
  129. package/dist/models/model-asset-class-target.js +14 -15
  130. package/dist/models/model-asset-class.d.ts +30 -31
  131. package/dist/models/model-asset-class.js +14 -15
  132. package/dist/models/model-portfolio-asset-class.d.ts +31 -32
  133. package/dist/models/model-portfolio-asset-class.js +14 -15
  134. package/dist/models/model-portfolio-details.d.ts +39 -39
  135. package/dist/models/model-portfolio-details.js +14 -15
  136. package/dist/models/model-portfolio-security.d.ts +31 -32
  137. package/dist/models/model-portfolio-security.js +14 -15
  138. package/dist/models/model-portfolio.d.ts +38 -39
  139. package/dist/models/model-portfolio.js +14 -15
  140. package/dist/models/model400-failed-request-response.d.ts +30 -31
  141. package/dist/models/model400-failed-request-response.js +14 -15
  142. package/dist/models/model401-failed-request-response.d.ts +30 -31
  143. package/dist/models/model401-failed-request-response.js +14 -15
  144. package/dist/models/model403-failed-request-response.d.ts +30 -31
  145. package/dist/models/model403-failed-request-response.js +14 -15
  146. package/dist/models/model404-failed-request-response.d.ts +30 -31
  147. package/dist/models/model404-failed-request-response.js +14 -15
  148. package/dist/models/monthly-dividends.d.ts +31 -32
  149. package/dist/models/monthly-dividends.js +14 -15
  150. package/dist/models/net-contributions.d.ts +36 -37
  151. package/dist/models/net-contributions.js +14 -15
  152. package/dist/models/net-dividend.d.ts +37 -38
  153. package/dist/models/net-dividend.js +14 -15
  154. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +36 -37
  155. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +14 -15
  156. package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +37 -38
  157. package/dist/models/option-chain-inner-chain-per-root-inner.js +14 -15
  158. package/dist/models/option-chain-inner.d.ts +49 -50
  159. package/dist/models/option-chain-inner.js +14 -15
  160. package/dist/models/option-leg.d.ts +38 -39
  161. package/dist/models/option-leg.js +14 -15
  162. package/dist/models/option-strategy-legs-inner.d.ts +41 -42
  163. package/dist/models/option-strategy-legs-inner.js +14 -15
  164. package/dist/models/option-strategy.d.ts +50 -51
  165. package/dist/models/option-strategy.js +14 -15
  166. package/dist/models/options-get-option-strategy-request.d.ts +38 -39
  167. package/dist/models/options-get-option-strategy-request.js +14 -15
  168. package/dist/models/options-holdings.d.ts +56 -57
  169. package/dist/models/options-holdings.js +14 -15
  170. package/dist/models/options-place-option-strategy-request.d.ts +38 -39
  171. package/dist/models/options-place-option-strategy-request.js +14 -15
  172. package/dist/models/options-position.d.ts +62 -63
  173. package/dist/models/options-position.js +14 -15
  174. package/dist/models/options-symbol.d.ts +85 -86
  175. package/dist/models/options-symbol.js +14 -15
  176. package/dist/models/order-type.d.ts +16 -17
  177. package/dist/models/order-type.js +14 -15
  178. package/dist/models/partner-data.d.ts +91 -92
  179. package/dist/models/partner-data.js +14 -15
  180. package/dist/models/past-value.d.ts +36 -37
  181. package/dist/models/past-value.js +14 -15
  182. package/dist/models/performance-custom.d.ts +137 -138
  183. package/dist/models/performance-custom.js +14 -15
  184. package/dist/models/portfolio-group-info.d.ts +92 -93
  185. package/dist/models/portfolio-group-info.js +14 -15
  186. package/dist/models/portfolio-group-position.d.ts +37 -38
  187. package/dist/models/portfolio-group-position.js +14 -15
  188. package/dist/models/portfolio-group-settings.d.ts +49 -50
  189. package/dist/models/portfolio-group-settings.js +14 -15
  190. package/dist/models/portfolio-group.d.ts +30 -31
  191. package/dist/models/portfolio-group.js +14 -15
  192. package/dist/models/position-symbol.d.ts +55 -56
  193. package/dist/models/position-symbol.js +14 -15
  194. package/dist/models/position.d.ts +55 -56
  195. package/dist/models/position.js +14 -15
  196. package/dist/models/redirect-tokenand-pin.d.ts +30 -31
  197. package/dist/models/redirect-tokenand-pin.js +14 -15
  198. package/dist/models/security-type.d.ts +42 -43
  199. package/dist/models/security-type.js +14 -15
  200. package/dist/models/session-event.d.ts +62 -63
  201. package/dist/models/session-event.js +14 -15
  202. package/dist/models/snap-trade-apidisclaimer-accept-status.d.ts +30 -31
  203. package/dist/models/snap-trade-apidisclaimer-accept-status.js +14 -15
  204. package/dist/models/snap-trade-holdings-account-account-id.d.ts +75 -76
  205. package/dist/models/snap-trade-holdings-account-account-id.js +14 -15
  206. package/dist/models/snap-trade-holdings-account.d.ts +70 -71
  207. package/dist/models/snap-trade-holdings-account.js +14 -15
  208. package/dist/models/snap-trade-holdings-total-value.d.ts +30 -31
  209. package/dist/models/snap-trade-holdings-total-value.js +14 -15
  210. package/dist/models/snap-trade-login-user-request-body.d.ts +49 -50
  211. package/dist/models/snap-trade-login-user-request-body.js +14 -15
  212. package/dist/models/snap-trade-register-user-request-body.d.ts +29 -30
  213. package/dist/models/snap-trade-register-user-request-body.js +14 -15
  214. package/dist/models/status.d.ts +36 -37
  215. package/dist/models/status.js +14 -15
  216. package/dist/models/strategy-impact-legs-inner.d.ts +60 -61
  217. package/dist/models/strategy-impact-legs-inner.js +14 -15
  218. package/dist/models/strategy-impact.d.ts +85 -86
  219. package/dist/models/strategy-impact.js +14 -15
  220. package/dist/models/strategy-order-place-orders-inner-legs-inner.d.ts +60 -61
  221. package/dist/models/strategy-order-place-orders-inner-legs-inner.js +14 -15
  222. package/dist/models/strategy-order-place-orders-inner.d.ts +277 -278
  223. package/dist/models/strategy-order-place-orders-inner.js +14 -15
  224. package/dist/models/strategy-order-place.d.ts +31 -32
  225. package/dist/models/strategy-order-place.js +14 -15
  226. package/dist/models/strategy-order-record.d.ts +89 -90
  227. package/dist/models/strategy-order-record.js +14 -15
  228. package/dist/models/strategy-quotes-greek.d.ts +48 -49
  229. package/dist/models/strategy-quotes-greek.js +14 -15
  230. package/dist/models/strategy-quotes.d.ts +56 -57
  231. package/dist/models/strategy-quotes.js +14 -15
  232. package/dist/models/sub-period-return-rate.d.ts +36 -37
  233. package/dist/models/sub-period-return-rate.js +14 -15
  234. package/dist/models/symbol-query.d.ts +23 -24
  235. package/dist/models/symbol-query.js +14 -15
  236. package/dist/models/symbol.d.ts +63 -64
  237. package/dist/models/symbol.js +14 -15
  238. package/dist/models/symbols-quotes-inner.d.ts +54 -55
  239. package/dist/models/symbols-quotes-inner.js +14 -15
  240. package/dist/models/target-asset.d.ts +57 -57
  241. package/dist/models/target-asset.js +14 -15
  242. package/dist/models/time-in-force.d.ts +16 -17
  243. package/dist/models/time-in-force.js +14 -15
  244. package/dist/models/trade-execution-status.d.ts +80 -81
  245. package/dist/models/trade-execution-status.js +14 -15
  246. package/dist/models/trade-impact.d.ts +50 -51
  247. package/dist/models/trade-impact.js +14 -15
  248. package/dist/models/trade.d.ts +71 -71
  249. package/dist/models/trade.js +14 -15
  250. package/dist/models/trading-cancel-user-account-order-request.d.ts +23 -24
  251. package/dist/models/trading-cancel-user-account-order-request.js +14 -15
  252. package/dist/models/trading-place-ocoorder-request.d.ts +29 -30
  253. package/dist/models/trading-place-ocoorder-request.js +14 -15
  254. package/dist/models/transactions-status.d.ts +29 -30
  255. package/dist/models/transactions-status.js +14 -15
  256. package/dist/models/underlying-symbol.d.ts +63 -64
  257. package/dist/models/underlying-symbol.js +14 -15
  258. package/dist/models/universal-activity.d.ts +118 -119
  259. package/dist/models/universal-activity.js +14 -15
  260. package/dist/models/universal-symbol-ticker.d.ts +69 -70
  261. package/dist/models/universal-symbol-ticker.js +14 -15
  262. package/dist/models/universal-symbol.d.ts +69 -69
  263. package/dist/models/universal-symbol.js +14 -15
  264. package/dist/models/user-error-log.d.ts +54 -55
  265. package/dist/models/user-error-log.js +14 -15
  266. package/dist/models/user-idand-secret.d.ts +30 -31
  267. package/dist/models/user-idand-secret.js +14 -15
  268. package/dist/models/user-settings.d.ts +79 -80
  269. package/dist/models/user-settings.js +14 -15
  270. package/dist/models/usexchange.d.ts +72 -73
  271. package/dist/models/usexchange.js +14 -15
  272. package/dist/pagination/page-types.d.ts +26 -27
  273. package/dist/pagination/page-types.js +12 -13
  274. package/dist/pagination/page.d.ts +35 -36
  275. package/dist/pagination/page.js +60 -61
  276. package/dist/pagination/pageable.d.ts +57 -58
  277. package/dist/pagination/pageable.js +126 -127
  278. package/dist/pagination/paginate.d.ts +16 -17
  279. package/dist/pagination/paginate.js +77 -78
  280. package/dist/requestAfterHook.d.ts +8 -8
  281. package/dist/requestAfterHook.js +45 -45
  282. package/dist/requestBeforeHook.d.ts +9 -9
  283. package/dist/requestBeforeHook.js +8 -8
  284. package/package.json +42 -42
  285. package/dist/api/portfolio-management-api-custom.d.ts +0 -3
  286. package/dist/api/portfolio-management-api-custom.js +0 -27
  287. package/dist/api/portfolio-management-api.d.ts +0 -1612
  288. package/dist/api/portfolio-management-api.js +0 -3534
@@ -1,731 +1,730 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * SnapTrade
6
- * Connect brokerage accounts to your app for live positions and trading
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- * Contact: api@snaptrade.com
10
- *
11
- * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12
- * https://konfigthis.com
13
- * Do not edit the class manually.
14
- */
15
- var __extends = (this && this.__extends) || (function () {
16
- var extendStatics = function (d, b) {
17
- extendStatics = Object.setPrototypeOf ||
18
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
- return extendStatics(d, b);
21
- };
22
- return function (d, b) {
23
- if (typeof b !== "function" && b !== null)
24
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
- extendStatics(d, b);
26
- function __() { this.constructor = d; }
27
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
- };
29
- })();
30
- var __assign = (this && this.__assign) || function () {
31
- __assign = Object.assign || function(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
- t[p] = s[p];
36
- }
37
- return t;
38
- };
39
- return __assign.apply(this, arguments);
40
- };
41
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
- return new (P || (P = Promise))(function (resolve, reject) {
44
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
- step((generator = generator.apply(thisArg, _arguments || [])).next());
48
- });
49
- };
50
- var __generator = (this && this.__generator) || function (thisArg, body) {
51
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
- function verb(n) { return function (v) { return step([n, v]); }; }
54
- function step(op) {
55
- if (f) throw new TypeError("Generator is already executing.");
56
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
- if (y = 0, t) op = [op[0] & 2, t.value];
59
- switch (op[0]) {
60
- case 0: case 1: t = op; break;
61
- case 4: _.label++; return { value: op[1], done: false };
62
- case 5: _.label++; y = op[1]; op = [0]; continue;
63
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
- default:
65
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
- if (t[2]) _.ops.pop();
70
- _.trys.pop(); continue;
71
- }
72
- op = body.call(thisArg, _);
73
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
- }
76
- };
77
- Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.OptionsApi = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
79
- var axios_1 = require("axios");
80
- // Some imports not used depending on template conditions
81
- // @ts-ignore
82
- var common_1 = require("../common");
83
- // @ts-ignore
84
- var base_1 = require("../base");
85
- var requestBeforeHook_1 = require("../requestBeforeHook");
86
- var options_api_custom_1 = require("./options-api-custom");
87
- /**
88
- * OptionsApi - axios parameter creator
89
- * @export
90
- */
91
- var OptionsApiAxiosParamCreator = function (configuration) {
92
- var _this = this;
93
- return {
94
- /**
95
- *
96
- * @summary Creates an option strategy object that will be used to place an option strategy order
97
- * @param {string} userId
98
- * @param {string} userSecret
99
- * @param {string} accountId The ID of the account get positions.
100
- * @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
101
- * @param {*} [options] Override http request option.
102
- * @throws {RequiredError}
103
- */
104
- getOptionStrategy: function (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options) {
105
- if (options === void 0) { options = {}; }
106
- return __awaiter(_this, void 0, void 0, function () {
107
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0:
111
- // verify required parameter 'userId' is not null or undefined
112
- (0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
113
- // verify required parameter 'userSecret' is not null or undefined
114
- (0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
115
- // verify required parameter 'accountId' is not null or undefined
116
- (0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
117
- // verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
118
- (0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
119
- localVarPath = "/accounts/{accountId}/optionStrategy"
120
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
121
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
122
- if (configuration) {
123
- baseOptions = configuration.baseOptions;
124
- }
125
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
126
- localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
127
- localVarQueryParameter = {};
128
- // authentication PartnerClientId required
129
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
130
- // authentication PartnerSignature required
131
- ];
132
- case 1:
133
- // authentication PartnerClientId required
134
- _a.sent();
135
- // authentication PartnerSignature required
136
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
137
- // authentication PartnerTimestamp required
138
- ];
139
- case 2:
140
- // authentication PartnerSignature required
141
- _a.sent();
142
- // authentication PartnerTimestamp required
143
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
144
- case 3:
145
- // authentication PartnerTimestamp required
146
- _a.sent();
147
- if (userId !== undefined) {
148
- localVarQueryParameter['userId'] = userId;
149
- }
150
- if (userSecret !== undefined) {
151
- localVarQueryParameter['userSecret'] = userSecret;
152
- }
153
- localVarHeaderParameter['Content-Type'] = 'application/json';
154
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
155
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
156
- (0, requestBeforeHook_1.requestBeforeHook)({
157
- requestBody: optionsGetOptionStrategyRequest,
158
- queryParameters: localVarQueryParameter,
159
- requestConfig: localVarRequestOptions,
160
- path: localVarPath,
161
- configuration: configuration
162
- });
163
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
164
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
165
- return [2 /*return*/, {
166
- url: (0, common_1.toPathString)(localVarUrlObj),
167
- options: localVarRequestOptions,
168
- }];
169
- }
170
- });
171
- });
172
- },
173
- /**
174
- *
175
- * @summary Get the options chain
176
- * @param {string} userId
177
- * @param {string} userSecret
178
- * @param {string} accountId The ID of the account get positions.
179
- * @param {string} symbol Universal symbol ID if symbol
180
- * @param {*} [options] Override http request option.
181
- * @throws {RequiredError}
182
- */
183
- getOptionsChain: function (userId, userSecret, accountId, symbol, options) {
184
- if (options === void 0) { options = {}; }
185
- return __awaiter(_this, void 0, void 0, function () {
186
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
187
- return __generator(this, function (_a) {
188
- switch (_a.label) {
189
- case 0:
190
- // verify required parameter 'userId' is not null or undefined
191
- (0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
192
- // verify required parameter 'userSecret' is not null or undefined
193
- (0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
194
- // verify required parameter 'accountId' is not null or undefined
195
- (0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
196
- // verify required parameter 'symbol' is not null or undefined
197
- (0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
198
- localVarPath = "/accounts/{accountId}/optionsChain"
199
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
200
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
201
- if (configuration) {
202
- baseOptions = configuration.baseOptions;
203
- }
204
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
205
- localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
206
- localVarQueryParameter = {};
207
- // authentication PartnerClientId required
208
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
209
- // authentication PartnerSignature required
210
- ];
211
- case 1:
212
- // authentication PartnerClientId required
213
- _a.sent();
214
- // authentication PartnerSignature required
215
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
216
- // authentication PartnerTimestamp required
217
- ];
218
- case 2:
219
- // authentication PartnerSignature required
220
- _a.sent();
221
- // authentication PartnerTimestamp required
222
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
223
- case 3:
224
- // authentication PartnerTimestamp required
225
- _a.sent();
226
- if (userId !== undefined) {
227
- localVarQueryParameter['userId'] = userId;
228
- }
229
- if (userSecret !== undefined) {
230
- localVarQueryParameter['userSecret'] = userSecret;
231
- }
232
- if (symbol !== undefined) {
233
- localVarQueryParameter['symbol'] = symbol;
234
- }
235
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
236
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
237
- (0, requestBeforeHook_1.requestBeforeHook)({
238
- queryParameters: localVarQueryParameter,
239
- requestConfig: localVarRequestOptions,
240
- path: localVarPath,
241
- configuration: configuration
242
- });
243
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
244
- return [2 /*return*/, {
245
- url: (0, common_1.toPathString)(localVarUrlObj),
246
- options: localVarRequestOptions,
247
- }];
248
- }
249
- });
250
- });
251
- },
252
- /**
253
- *
254
- * @summary Get latest market data of option strategy
255
- * @param {string} userId
256
- * @param {string} userSecret
257
- * @param {string} accountId The ID of the account get positions.
258
- * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
259
- * @param {*} [options] Override http request option.
260
- * @throws {RequiredError}
261
- */
262
- getOptionsStrategyQuote: function (userId, userSecret, accountId, optionStrategyId, options) {
263
- if (options === void 0) { options = {}; }
264
- return __awaiter(_this, void 0, void 0, function () {
265
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
266
- return __generator(this, function (_a) {
267
- switch (_a.label) {
268
- case 0:
269
- // verify required parameter 'userId' is not null or undefined
270
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
271
- // verify required parameter 'userSecret' is not null or undefined
272
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
273
- // verify required parameter 'accountId' is not null or undefined
274
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
275
- // verify required parameter 'optionStrategyId' is not null or undefined
276
- (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
277
- localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}"
278
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
279
- .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
280
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
281
- if (configuration) {
282
- baseOptions = configuration.baseOptions;
283
- }
284
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
285
- localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
286
- localVarQueryParameter = {};
287
- // authentication PartnerClientId required
288
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
289
- // authentication PartnerSignature required
290
- ];
291
- case 1:
292
- // authentication PartnerClientId required
293
- _a.sent();
294
- // authentication PartnerSignature required
295
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
296
- // authentication PartnerTimestamp required
297
- ];
298
- case 2:
299
- // authentication PartnerSignature required
300
- _a.sent();
301
- // authentication PartnerTimestamp required
302
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
303
- case 3:
304
- // authentication PartnerTimestamp required
305
- _a.sent();
306
- if (userId !== undefined) {
307
- localVarQueryParameter['userId'] = userId;
308
- }
309
- if (userSecret !== undefined) {
310
- localVarQueryParameter['userSecret'] = userSecret;
311
- }
312
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
313
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
314
- (0, requestBeforeHook_1.requestBeforeHook)({
315
- queryParameters: localVarQueryParameter,
316
- requestConfig: localVarRequestOptions,
317
- path: localVarPath,
318
- configuration: configuration
319
- });
320
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
321
- return [2 /*return*/, {
322
- url: (0, common_1.toPathString)(localVarUrlObj),
323
- options: localVarRequestOptions,
324
- }];
325
- }
326
- });
327
- });
328
- },
329
- /**
330
- *
331
- * @summary Get the options holdings in the account
332
- * @param {string} userId
333
- * @param {string} userSecret
334
- * @param {string} accountId The ID of the account get positions.
335
- * @param {*} [options] Override http request option.
336
- * @throws {RequiredError}
337
- */
338
- listOptionHoldings: function (userId, userSecret, accountId, options) {
339
- if (options === void 0) { options = {}; }
340
- return __awaiter(_this, void 0, void 0, function () {
341
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
342
- return __generator(this, function (_a) {
343
- switch (_a.label) {
344
- case 0:
345
- // verify required parameter 'userId' is not null or undefined
346
- (0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
347
- // verify required parameter 'userSecret' is not null or undefined
348
- (0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
349
- // verify required parameter 'accountId' is not null or undefined
350
- (0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
351
- localVarPath = "/accounts/{accountId}/options"
352
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
353
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
354
- if (configuration) {
355
- baseOptions = configuration.baseOptions;
356
- }
357
- localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
358
- localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
359
- localVarQueryParameter = {};
360
- // authentication PartnerClientId required
361
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
362
- // authentication PartnerSignature required
363
- ];
364
- case 1:
365
- // authentication PartnerClientId required
366
- _a.sent();
367
- // authentication PartnerSignature required
368
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
369
- // authentication PartnerTimestamp required
370
- ];
371
- case 2:
372
- // authentication PartnerSignature required
373
- _a.sent();
374
- // authentication PartnerTimestamp required
375
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
376
- case 3:
377
- // authentication PartnerTimestamp required
378
- _a.sent();
379
- if (userId !== undefined) {
380
- localVarQueryParameter['userId'] = userId;
381
- }
382
- if (userSecret !== undefined) {
383
- localVarQueryParameter['userSecret'] = userSecret;
384
- }
385
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
386
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
387
- (0, requestBeforeHook_1.requestBeforeHook)({
388
- queryParameters: localVarQueryParameter,
389
- requestConfig: localVarRequestOptions,
390
- path: localVarPath,
391
- configuration: configuration
392
- });
393
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
394
- return [2 /*return*/, {
395
- url: (0, common_1.toPathString)(localVarUrlObj),
396
- options: localVarRequestOptions,
397
- }];
398
- }
399
- });
400
- });
401
- },
402
- /**
403
- *
404
- * @summary Place an option strategy order on the brokerage
405
- * @param {string} userId
406
- * @param {string} userSecret
407
- * @param {string} accountId The ID of the account get positions.
408
- * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
409
- * @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
410
- * @param {*} [options] Override http request option.
411
- * @throws {RequiredError}
412
- */
413
- placeOptionStrategy: function (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options) {
414
- if (options === void 0) { options = {}; }
415
- return __awaiter(_this, void 0, void 0, function () {
416
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
417
- return __generator(this, function (_a) {
418
- switch (_a.label) {
419
- case 0:
420
- // verify required parameter 'userId' is not null or undefined
421
- (0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
422
- // verify required parameter 'userSecret' is not null or undefined
423
- (0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
424
- // verify required parameter 'accountId' is not null or undefined
425
- (0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
426
- // verify required parameter 'optionStrategyId' is not null or undefined
427
- (0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
428
- // verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
429
- (0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
430
- localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute"
431
- .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
432
- .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
433
- localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
434
- if (configuration) {
435
- baseOptions = configuration.baseOptions;
436
- }
437
- localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
438
- localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
439
- localVarQueryParameter = {};
440
- // authentication PartnerClientId required
441
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
442
- // authentication PartnerSignature required
443
- ];
444
- case 1:
445
- // authentication PartnerClientId required
446
- _a.sent();
447
- // authentication PartnerSignature required
448
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
449
- // authentication PartnerTimestamp required
450
- ];
451
- case 2:
452
- // authentication PartnerSignature required
453
- _a.sent();
454
- // authentication PartnerTimestamp required
455
- return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
456
- case 3:
457
- // authentication PartnerTimestamp required
458
- _a.sent();
459
- if (userId !== undefined) {
460
- localVarQueryParameter['userId'] = userId;
461
- }
462
- if (userSecret !== undefined) {
463
- localVarQueryParameter['userSecret'] = userSecret;
464
- }
465
- localVarHeaderParameter['Content-Type'] = 'application/json';
466
- headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
467
- localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
468
- (0, requestBeforeHook_1.requestBeforeHook)({
469
- requestBody: optionsPlaceOptionStrategyRequest,
470
- queryParameters: localVarQueryParameter,
471
- requestConfig: localVarRequestOptions,
472
- path: localVarPath,
473
- configuration: configuration
474
- });
475
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
476
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
477
- return [2 /*return*/, {
478
- url: (0, common_1.toPathString)(localVarUrlObj),
479
- options: localVarRequestOptions,
480
- }];
481
- }
482
- });
483
- });
484
- },
485
- };
486
- };
487
- exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
488
- /**
489
- * OptionsApi - functional programming interface
490
- * @export
491
- */
492
- var OptionsApiFp = function (configuration) {
493
- var localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
494
- return {
495
- /**
496
- *
497
- * @summary Creates an option strategy object that will be used to place an option strategy order
498
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
499
- * @param {*} [options] Override http request option.
500
- * @throws {RequiredError}
501
- */
502
- getOptionStrategy: function (requestParameters, options) {
503
- return __awaiter(this, void 0, void 0, function () {
504
- var localVarAxiosArgs;
505
- return __generator(this, function (_a) {
506
- switch (_a.label) {
507
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options)];
508
- case 1:
509
- localVarAxiosArgs = _a.sent();
510
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
511
- }
512
- });
513
- });
514
- },
515
- /**
516
- *
517
- * @summary Get the options chain
518
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
519
- * @param {*} [options] Override http request option.
520
- * @throws {RequiredError}
521
- */
522
- getOptionsChain: function (requestParameters, options) {
523
- return __awaiter(this, void 0, void 0, function () {
524
- var localVarAxiosArgs;
525
- return __generator(this, function (_a) {
526
- switch (_a.label) {
527
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options)];
528
- case 1:
529
- localVarAxiosArgs = _a.sent();
530
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
531
- }
532
- });
533
- });
534
- },
535
- /**
536
- *
537
- * @summary Get latest market data of option strategy
538
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
539
- * @param {*} [options] Override http request option.
540
- * @throws {RequiredError}
541
- */
542
- getOptionsStrategyQuote: function (requestParameters, options) {
543
- return __awaiter(this, void 0, void 0, function () {
544
- var localVarAxiosArgs;
545
- return __generator(this, function (_a) {
546
- switch (_a.label) {
547
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options)];
548
- case 1:
549
- localVarAxiosArgs = _a.sent();
550
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
551
- }
552
- });
553
- });
554
- },
555
- /**
556
- *
557
- * @summary Get the options holdings in the account
558
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
559
- * @param {*} [options] Override http request option.
560
- * @throws {RequiredError}
561
- */
562
- listOptionHoldings: function (requestParameters, options) {
563
- return __awaiter(this, void 0, void 0, function () {
564
- var localVarAxiosArgs;
565
- return __generator(this, function (_a) {
566
- switch (_a.label) {
567
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options)];
568
- case 1:
569
- localVarAxiosArgs = _a.sent();
570
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
571
- }
572
- });
573
- });
574
- },
575
- /**
576
- *
577
- * @summary Place an option strategy order on the brokerage
578
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
579
- * @param {*} [options] Override http request option.
580
- * @throws {RequiredError}
581
- */
582
- placeOptionStrategy: function (requestParameters, options) {
583
- return __awaiter(this, void 0, void 0, function () {
584
- var localVarAxiosArgs;
585
- return __generator(this, function (_a) {
586
- switch (_a.label) {
587
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters, options)];
588
- case 1:
589
- localVarAxiosArgs = _a.sent();
590
- return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
591
- }
592
- });
593
- });
594
- },
595
- };
596
- };
597
- exports.OptionsApiFp = OptionsApiFp;
598
- /**
599
- * OptionsApi - factory interface
600
- * @export
601
- */
602
- var OptionsApiFactory = function (configuration, basePath, axios) {
603
- var localVarFp = (0, exports.OptionsApiFp)(configuration);
604
- return {
605
- /**
606
- *
607
- * @summary Creates an option strategy object that will be used to place an option strategy order
608
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
609
- * @param {*} [options] Override http request option.
610
- * @throws {RequiredError}
611
- */
612
- getOptionStrategy: function (requestParameters, options) {
613
- return localVarFp.getOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
614
- },
615
- /**
616
- *
617
- * @summary Get the options chain
618
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
619
- * @param {*} [options] Override http request option.
620
- * @throws {RequiredError}
621
- */
622
- getOptionsChain: function (requestParameters, options) {
623
- return localVarFp.getOptionsChain(requestParameters, options).then(function (request) { return request(axios, basePath); });
624
- },
625
- /**
626
- *
627
- * @summary Get latest market data of option strategy
628
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
629
- * @param {*} [options] Override http request option.
630
- * @throws {RequiredError}
631
- */
632
- getOptionsStrategyQuote: function (requestParameters, options) {
633
- return localVarFp.getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(axios, basePath); });
634
- },
635
- /**
636
- *
637
- * @summary Get the options holdings in the account
638
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
639
- * @param {*} [options] Override http request option.
640
- * @throws {RequiredError}
641
- */
642
- listOptionHoldings: function (requestParameters, options) {
643
- return localVarFp.listOptionHoldings(requestParameters, options).then(function (request) { return request(axios, basePath); });
644
- },
645
- /**
646
- *
647
- * @summary Place an option strategy order on the brokerage
648
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
649
- * @param {*} [options] Override http request option.
650
- * @throws {RequiredError}
651
- */
652
- placeOptionStrategy: function (requestParameters, options) {
653
- return localVarFp.placeOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
654
- },
655
- };
656
- };
657
- exports.OptionsApiFactory = OptionsApiFactory;
658
- /**
659
- * OptionsApi - object-oriented interface
660
- * @export
661
- * @class OptionsApi
662
- * @extends {BaseAPI}
663
- */
664
- var OptionsApi = /** @class */ (function (_super) {
665
- __extends(OptionsApi, _super);
666
- function OptionsApi() {
667
- return _super !== null && _super.apply(this, arguments) || this;
668
- }
669
- /**
670
- *
671
- * @summary Creates an option strategy object that will be used to place an option strategy order
672
- * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
673
- * @param {*} [options] Override http request option.
674
- * @throws {RequiredError}
675
- * @memberof OptionsApi
676
- */
677
- OptionsApi.prototype.getOptionStrategy = function (requestParameters, options) {
678
- var _this = this;
679
- return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
680
- };
681
- /**
682
- *
683
- * @summary Get the options chain
684
- * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
685
- * @param {*} [options] Override http request option.
686
- * @throws {RequiredError}
687
- * @memberof OptionsApi
688
- */
689
- OptionsApi.prototype.getOptionsChain = function (requestParameters, options) {
690
- var _this = this;
691
- return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
692
- };
693
- /**
694
- *
695
- * @summary Get latest market data of option strategy
696
- * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
697
- * @param {*} [options] Override http request option.
698
- * @throws {RequiredError}
699
- * @memberof OptionsApi
700
- */
701
- OptionsApi.prototype.getOptionsStrategyQuote = function (requestParameters, options) {
702
- var _this = this;
703
- return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
704
- };
705
- /**
706
- *
707
- * @summary Get the options holdings in the account
708
- * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
709
- * @param {*} [options] Override http request option.
710
- * @throws {RequiredError}
711
- * @memberof OptionsApi
712
- */
713
- OptionsApi.prototype.listOptionHoldings = function (requestParameters, options) {
714
- var _this = this;
715
- return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
716
- };
717
- /**
718
- *
719
- * @summary Place an option strategy order on the brokerage
720
- * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
721
- * @param {*} [options] Override http request option.
722
- * @throws {RequiredError}
723
- * @memberof OptionsApi
724
- */
725
- OptionsApi.prototype.placeOptionStrategy = function (requestParameters, options) {
726
- var _this = this;
727
- return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
728
- };
729
- return OptionsApi;
730
- }(options_api_custom_1.OptionsApiCustom));
731
- exports.OptionsApi = OptionsApi;
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * SnapTrade
6
+ * Connect brokerage accounts to your app for live positions and trading
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: api@snaptrade.com
10
+ *
11
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12
+ * Do not edit the class manually.
13
+ */
14
+ var __extends = (this && this.__extends) || (function () {
15
+ var extendStatics = function (d, b) {
16
+ extendStatics = Object.setPrototypeOf ||
17
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
19
+ return extendStatics(d, b);
20
+ };
21
+ return function (d, b) {
22
+ if (typeof b !== "function" && b !== null)
23
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
24
+ extendStatics(d, b);
25
+ function __() { this.constructor = d; }
26
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
27
+ };
28
+ })();
29
+ var __assign = (this && this.__assign) || function () {
30
+ __assign = Object.assign || function(t) {
31
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
32
+ s = arguments[i];
33
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
34
+ t[p] = s[p];
35
+ }
36
+ return t;
37
+ };
38
+ return __assign.apply(this, arguments);
39
+ };
40
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
41
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
42
+ return new (P || (P = Promise))(function (resolve, reject) {
43
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
44
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
45
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
46
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
47
+ });
48
+ };
49
+ var __generator = (this && this.__generator) || function (thisArg, body) {
50
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
51
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
52
+ function verb(n) { return function (v) { return step([n, v]); }; }
53
+ function step(op) {
54
+ if (f) throw new TypeError("Generator is already executing.");
55
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
56
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
57
+ if (y = 0, t) op = [op[0] & 2, t.value];
58
+ switch (op[0]) {
59
+ case 0: case 1: t = op; break;
60
+ case 4: _.label++; return { value: op[1], done: false };
61
+ case 5: _.label++; y = op[1]; op = [0]; continue;
62
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
63
+ default:
64
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
65
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
66
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
67
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
68
+ if (t[2]) _.ops.pop();
69
+ _.trys.pop(); continue;
70
+ }
71
+ op = body.call(thisArg, _);
72
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
73
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
74
+ }
75
+ };
76
+ Object.defineProperty(exports, "__esModule", { value: true });
77
+ exports.OptionsApi = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
78
+ var axios_1 = require("axios");
79
+ // Some imports not used depending on template conditions
80
+ // @ts-ignore
81
+ var common_1 = require("../common");
82
+ // @ts-ignore
83
+ var base_1 = require("../base");
84
+ var requestBeforeHook_1 = require("../requestBeforeHook");
85
+ var options_api_custom_1 = require("./options-api-custom");
86
+ /**
87
+ * OptionsApi - axios parameter creator
88
+ * @export
89
+ */
90
+ var OptionsApiAxiosParamCreator = function (configuration) {
91
+ var _this = this;
92
+ return {
93
+ /**
94
+ *
95
+ * @summary Creates an option strategy object that will be used to place an option strategy order
96
+ * @param {string} userId
97
+ * @param {string} userSecret
98
+ * @param {string} accountId The ID of the account get positions.
99
+ * @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
100
+ * @param {*} [options] Override http request option.
101
+ * @throws {RequiredError}
102
+ */
103
+ getOptionStrategy: function (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options) {
104
+ if (options === void 0) { options = {}; }
105
+ return __awaiter(_this, void 0, void 0, function () {
106
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
107
+ return __generator(this, function (_a) {
108
+ switch (_a.label) {
109
+ case 0:
110
+ // verify required parameter 'userId' is not null or undefined
111
+ (0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
112
+ // verify required parameter 'userSecret' is not null or undefined
113
+ (0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
114
+ // verify required parameter 'accountId' is not null or undefined
115
+ (0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
116
+ // verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
117
+ (0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
118
+ localVarPath = "/accounts/{accountId}/optionStrategy"
119
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
120
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
121
+ if (configuration) {
122
+ baseOptions = configuration.baseOptions;
123
+ }
124
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
125
+ localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
126
+ localVarQueryParameter = {};
127
+ // authentication PartnerClientId required
128
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
129
+ // authentication PartnerSignature required
130
+ ];
131
+ case 1:
132
+ // authentication PartnerClientId required
133
+ _a.sent();
134
+ // authentication PartnerSignature required
135
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
136
+ // authentication PartnerTimestamp required
137
+ ];
138
+ case 2:
139
+ // authentication PartnerSignature required
140
+ _a.sent();
141
+ // authentication PartnerTimestamp required
142
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
143
+ case 3:
144
+ // authentication PartnerTimestamp required
145
+ _a.sent();
146
+ if (userId !== undefined) {
147
+ localVarQueryParameter['userId'] = userId;
148
+ }
149
+ if (userSecret !== undefined) {
150
+ localVarQueryParameter['userSecret'] = userSecret;
151
+ }
152
+ localVarHeaderParameter['Content-Type'] = 'application/json';
153
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
154
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
155
+ (0, requestBeforeHook_1.requestBeforeHook)({
156
+ requestBody: optionsGetOptionStrategyRequest,
157
+ queryParameters: localVarQueryParameter,
158
+ requestConfig: localVarRequestOptions,
159
+ path: localVarPath,
160
+ configuration: configuration
161
+ });
162
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
163
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
164
+ return [2 /*return*/, {
165
+ url: (0, common_1.toPathString)(localVarUrlObj),
166
+ options: localVarRequestOptions,
167
+ }];
168
+ }
169
+ });
170
+ });
171
+ },
172
+ /**
173
+ *
174
+ * @summary Get the options chain
175
+ * @param {string} userId
176
+ * @param {string} userSecret
177
+ * @param {string} accountId The ID of the account get positions.
178
+ * @param {string} symbol Universal symbol ID if symbol
179
+ * @param {*} [options] Override http request option.
180
+ * @throws {RequiredError}
181
+ */
182
+ getOptionsChain: function (userId, userSecret, accountId, symbol, options) {
183
+ if (options === void 0) { options = {}; }
184
+ return __awaiter(_this, void 0, void 0, function () {
185
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
186
+ return __generator(this, function (_a) {
187
+ switch (_a.label) {
188
+ case 0:
189
+ // verify required parameter 'userId' is not null or undefined
190
+ (0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
191
+ // verify required parameter 'userSecret' is not null or undefined
192
+ (0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
193
+ // verify required parameter 'accountId' is not null or undefined
194
+ (0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
195
+ // verify required parameter 'symbol' is not null or undefined
196
+ (0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
197
+ localVarPath = "/accounts/{accountId}/optionsChain"
198
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
199
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
200
+ if (configuration) {
201
+ baseOptions = configuration.baseOptions;
202
+ }
203
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
204
+ localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
205
+ localVarQueryParameter = {};
206
+ // authentication PartnerClientId required
207
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
208
+ // authentication PartnerSignature required
209
+ ];
210
+ case 1:
211
+ // authentication PartnerClientId required
212
+ _a.sent();
213
+ // authentication PartnerSignature required
214
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
215
+ // authentication PartnerTimestamp required
216
+ ];
217
+ case 2:
218
+ // authentication PartnerSignature required
219
+ _a.sent();
220
+ // authentication PartnerTimestamp required
221
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
222
+ case 3:
223
+ // authentication PartnerTimestamp required
224
+ _a.sent();
225
+ if (userId !== undefined) {
226
+ localVarQueryParameter['userId'] = userId;
227
+ }
228
+ if (userSecret !== undefined) {
229
+ localVarQueryParameter['userSecret'] = userSecret;
230
+ }
231
+ if (symbol !== undefined) {
232
+ localVarQueryParameter['symbol'] = symbol;
233
+ }
234
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
235
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
236
+ (0, requestBeforeHook_1.requestBeforeHook)({
237
+ queryParameters: localVarQueryParameter,
238
+ requestConfig: localVarRequestOptions,
239
+ path: localVarPath,
240
+ configuration: configuration
241
+ });
242
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
243
+ return [2 /*return*/, {
244
+ url: (0, common_1.toPathString)(localVarUrlObj),
245
+ options: localVarRequestOptions,
246
+ }];
247
+ }
248
+ });
249
+ });
250
+ },
251
+ /**
252
+ *
253
+ * @summary Get latest market data of option strategy
254
+ * @param {string} userId
255
+ * @param {string} userSecret
256
+ * @param {string} accountId The ID of the account get positions.
257
+ * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
258
+ * @param {*} [options] Override http request option.
259
+ * @throws {RequiredError}
260
+ */
261
+ getOptionsStrategyQuote: function (userId, userSecret, accountId, optionStrategyId, options) {
262
+ if (options === void 0) { options = {}; }
263
+ return __awaiter(_this, void 0, void 0, function () {
264
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
265
+ return __generator(this, function (_a) {
266
+ switch (_a.label) {
267
+ case 0:
268
+ // verify required parameter 'userId' is not null or undefined
269
+ (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
270
+ // verify required parameter 'userSecret' is not null or undefined
271
+ (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
272
+ // verify required parameter 'accountId' is not null or undefined
273
+ (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
274
+ // verify required parameter 'optionStrategyId' is not null or undefined
275
+ (0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
276
+ localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}"
277
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
278
+ .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
279
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
280
+ if (configuration) {
281
+ baseOptions = configuration.baseOptions;
282
+ }
283
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
284
+ localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
285
+ localVarQueryParameter = {};
286
+ // authentication PartnerClientId required
287
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
288
+ // authentication PartnerSignature required
289
+ ];
290
+ case 1:
291
+ // authentication PartnerClientId required
292
+ _a.sent();
293
+ // authentication PartnerSignature required
294
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
295
+ // authentication PartnerTimestamp required
296
+ ];
297
+ case 2:
298
+ // authentication PartnerSignature required
299
+ _a.sent();
300
+ // authentication PartnerTimestamp required
301
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
302
+ case 3:
303
+ // authentication PartnerTimestamp required
304
+ _a.sent();
305
+ if (userId !== undefined) {
306
+ localVarQueryParameter['userId'] = userId;
307
+ }
308
+ if (userSecret !== undefined) {
309
+ localVarQueryParameter['userSecret'] = userSecret;
310
+ }
311
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
312
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
313
+ (0, requestBeforeHook_1.requestBeforeHook)({
314
+ queryParameters: localVarQueryParameter,
315
+ requestConfig: localVarRequestOptions,
316
+ path: localVarPath,
317
+ configuration: configuration
318
+ });
319
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
320
+ return [2 /*return*/, {
321
+ url: (0, common_1.toPathString)(localVarUrlObj),
322
+ options: localVarRequestOptions,
323
+ }];
324
+ }
325
+ });
326
+ });
327
+ },
328
+ /**
329
+ *
330
+ * @summary Get the options holdings in the account
331
+ * @param {string} userId
332
+ * @param {string} userSecret
333
+ * @param {string} accountId The ID of the account get positions.
334
+ * @param {*} [options] Override http request option.
335
+ * @throws {RequiredError}
336
+ */
337
+ listOptionHoldings: function (userId, userSecret, accountId, options) {
338
+ if (options === void 0) { options = {}; }
339
+ return __awaiter(_this, void 0, void 0, function () {
340
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
341
+ return __generator(this, function (_a) {
342
+ switch (_a.label) {
343
+ case 0:
344
+ // verify required parameter 'userId' is not null or undefined
345
+ (0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
346
+ // verify required parameter 'userSecret' is not null or undefined
347
+ (0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
348
+ // verify required parameter 'accountId' is not null or undefined
349
+ (0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
350
+ localVarPath = "/accounts/{accountId}/options"
351
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
352
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
353
+ if (configuration) {
354
+ baseOptions = configuration.baseOptions;
355
+ }
356
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
357
+ localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
358
+ localVarQueryParameter = {};
359
+ // authentication PartnerClientId required
360
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
361
+ // authentication PartnerSignature required
362
+ ];
363
+ case 1:
364
+ // authentication PartnerClientId required
365
+ _a.sent();
366
+ // authentication PartnerSignature required
367
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
368
+ // authentication PartnerTimestamp required
369
+ ];
370
+ case 2:
371
+ // authentication PartnerSignature required
372
+ _a.sent();
373
+ // authentication PartnerTimestamp required
374
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
375
+ case 3:
376
+ // authentication PartnerTimestamp required
377
+ _a.sent();
378
+ if (userId !== undefined) {
379
+ localVarQueryParameter['userId'] = userId;
380
+ }
381
+ if (userSecret !== undefined) {
382
+ localVarQueryParameter['userSecret'] = userSecret;
383
+ }
384
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
385
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
386
+ (0, requestBeforeHook_1.requestBeforeHook)({
387
+ queryParameters: localVarQueryParameter,
388
+ requestConfig: localVarRequestOptions,
389
+ path: localVarPath,
390
+ configuration: configuration
391
+ });
392
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
393
+ return [2 /*return*/, {
394
+ url: (0, common_1.toPathString)(localVarUrlObj),
395
+ options: localVarRequestOptions,
396
+ }];
397
+ }
398
+ });
399
+ });
400
+ },
401
+ /**
402
+ *
403
+ * @summary Place an option strategy order on the brokerage
404
+ * @param {string} userId
405
+ * @param {string} userSecret
406
+ * @param {string} accountId The ID of the account get positions.
407
+ * @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
408
+ * @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
409
+ * @param {*} [options] Override http request option.
410
+ * @throws {RequiredError}
411
+ */
412
+ placeOptionStrategy: function (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options) {
413
+ if (options === void 0) { options = {}; }
414
+ return __awaiter(_this, void 0, void 0, function () {
415
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
416
+ return __generator(this, function (_a) {
417
+ switch (_a.label) {
418
+ case 0:
419
+ // verify required parameter 'userId' is not null or undefined
420
+ (0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
421
+ // verify required parameter 'userSecret' is not null or undefined
422
+ (0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
423
+ // verify required parameter 'accountId' is not null or undefined
424
+ (0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
425
+ // verify required parameter 'optionStrategyId' is not null or undefined
426
+ (0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
427
+ // verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
428
+ (0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
429
+ localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute"
430
+ .replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
431
+ .replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
432
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
433
+ if (configuration) {
434
+ baseOptions = configuration.baseOptions;
435
+ }
436
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
437
+ localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
438
+ localVarQueryParameter = {};
439
+ // authentication PartnerClientId required
440
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration: configuration })
441
+ // authentication PartnerSignature required
442
+ ];
443
+ case 1:
444
+ // authentication PartnerClientId required
445
+ _a.sent();
446
+ // authentication PartnerSignature required
447
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration: configuration })
448
+ // authentication PartnerTimestamp required
449
+ ];
450
+ case 2:
451
+ // authentication PartnerSignature required
452
+ _a.sent();
453
+ // authentication PartnerTimestamp required
454
+ return [4 /*yield*/, (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration: configuration })];
455
+ case 3:
456
+ // authentication PartnerTimestamp required
457
+ _a.sent();
458
+ if (userId !== undefined) {
459
+ localVarQueryParameter['userId'] = userId;
460
+ }
461
+ if (userSecret !== undefined) {
462
+ localVarQueryParameter['userSecret'] = userSecret;
463
+ }
464
+ localVarHeaderParameter['Content-Type'] = 'application/json';
465
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
466
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
467
+ (0, requestBeforeHook_1.requestBeforeHook)({
468
+ requestBody: optionsPlaceOptionStrategyRequest,
469
+ queryParameters: localVarQueryParameter,
470
+ requestConfig: localVarRequestOptions,
471
+ path: localVarPath,
472
+ configuration: configuration
473
+ });
474
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
475
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
476
+ return [2 /*return*/, {
477
+ url: (0, common_1.toPathString)(localVarUrlObj),
478
+ options: localVarRequestOptions,
479
+ }];
480
+ }
481
+ });
482
+ });
483
+ },
484
+ };
485
+ };
486
+ exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
487
+ /**
488
+ * OptionsApi - functional programming interface
489
+ * @export
490
+ */
491
+ var OptionsApiFp = function (configuration) {
492
+ var localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
493
+ return {
494
+ /**
495
+ *
496
+ * @summary Creates an option strategy object that will be used to place an option strategy order
497
+ * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
498
+ * @param {*} [options] Override http request option.
499
+ * @throws {RequiredError}
500
+ */
501
+ getOptionStrategy: function (requestParameters, options) {
502
+ return __awaiter(this, void 0, void 0, function () {
503
+ var localVarAxiosArgs;
504
+ return __generator(this, function (_a) {
505
+ switch (_a.label) {
506
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options)];
507
+ case 1:
508
+ localVarAxiosArgs = _a.sent();
509
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
510
+ }
511
+ });
512
+ });
513
+ },
514
+ /**
515
+ *
516
+ * @summary Get the options chain
517
+ * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
518
+ * @param {*} [options] Override http request option.
519
+ * @throws {RequiredError}
520
+ */
521
+ getOptionsChain: function (requestParameters, options) {
522
+ return __awaiter(this, void 0, void 0, function () {
523
+ var localVarAxiosArgs;
524
+ return __generator(this, function (_a) {
525
+ switch (_a.label) {
526
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options)];
527
+ case 1:
528
+ localVarAxiosArgs = _a.sent();
529
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
530
+ }
531
+ });
532
+ });
533
+ },
534
+ /**
535
+ *
536
+ * @summary Get latest market data of option strategy
537
+ * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
538
+ * @param {*} [options] Override http request option.
539
+ * @throws {RequiredError}
540
+ */
541
+ getOptionsStrategyQuote: function (requestParameters, options) {
542
+ return __awaiter(this, void 0, void 0, function () {
543
+ var localVarAxiosArgs;
544
+ return __generator(this, function (_a) {
545
+ switch (_a.label) {
546
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options)];
547
+ case 1:
548
+ localVarAxiosArgs = _a.sent();
549
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
550
+ }
551
+ });
552
+ });
553
+ },
554
+ /**
555
+ *
556
+ * @summary Get the options holdings in the account
557
+ * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
558
+ * @param {*} [options] Override http request option.
559
+ * @throws {RequiredError}
560
+ */
561
+ listOptionHoldings: function (requestParameters, options) {
562
+ return __awaiter(this, void 0, void 0, function () {
563
+ var localVarAxiosArgs;
564
+ return __generator(this, function (_a) {
565
+ switch (_a.label) {
566
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options)];
567
+ case 1:
568
+ localVarAxiosArgs = _a.sent();
569
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
570
+ }
571
+ });
572
+ });
573
+ },
574
+ /**
575
+ *
576
+ * @summary Place an option strategy order on the brokerage
577
+ * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
578
+ * @param {*} [options] Override http request option.
579
+ * @throws {RequiredError}
580
+ */
581
+ placeOptionStrategy: function (requestParameters, options) {
582
+ return __awaiter(this, void 0, void 0, function () {
583
+ var localVarAxiosArgs;
584
+ return __generator(this, function (_a) {
585
+ switch (_a.label) {
586
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters, options)];
587
+ case 1:
588
+ localVarAxiosArgs = _a.sent();
589
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
590
+ }
591
+ });
592
+ });
593
+ },
594
+ };
595
+ };
596
+ exports.OptionsApiFp = OptionsApiFp;
597
+ /**
598
+ * OptionsApi - factory interface
599
+ * @export
600
+ */
601
+ var OptionsApiFactory = function (configuration, basePath, axios) {
602
+ var localVarFp = (0, exports.OptionsApiFp)(configuration);
603
+ return {
604
+ /**
605
+ *
606
+ * @summary Creates an option strategy object that will be used to place an option strategy order
607
+ * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
608
+ * @param {*} [options] Override http request option.
609
+ * @throws {RequiredError}
610
+ */
611
+ getOptionStrategy: function (requestParameters, options) {
612
+ return localVarFp.getOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
613
+ },
614
+ /**
615
+ *
616
+ * @summary Get the options chain
617
+ * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
618
+ * @param {*} [options] Override http request option.
619
+ * @throws {RequiredError}
620
+ */
621
+ getOptionsChain: function (requestParameters, options) {
622
+ return localVarFp.getOptionsChain(requestParameters, options).then(function (request) { return request(axios, basePath); });
623
+ },
624
+ /**
625
+ *
626
+ * @summary Get latest market data of option strategy
627
+ * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
628
+ * @param {*} [options] Override http request option.
629
+ * @throws {RequiredError}
630
+ */
631
+ getOptionsStrategyQuote: function (requestParameters, options) {
632
+ return localVarFp.getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(axios, basePath); });
633
+ },
634
+ /**
635
+ *
636
+ * @summary Get the options holdings in the account
637
+ * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
638
+ * @param {*} [options] Override http request option.
639
+ * @throws {RequiredError}
640
+ */
641
+ listOptionHoldings: function (requestParameters, options) {
642
+ return localVarFp.listOptionHoldings(requestParameters, options).then(function (request) { return request(axios, basePath); });
643
+ },
644
+ /**
645
+ *
646
+ * @summary Place an option strategy order on the brokerage
647
+ * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
648
+ * @param {*} [options] Override http request option.
649
+ * @throws {RequiredError}
650
+ */
651
+ placeOptionStrategy: function (requestParameters, options) {
652
+ return localVarFp.placeOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
653
+ },
654
+ };
655
+ };
656
+ exports.OptionsApiFactory = OptionsApiFactory;
657
+ /**
658
+ * OptionsApi - object-oriented interface
659
+ * @export
660
+ * @class OptionsApi
661
+ * @extends {BaseAPI}
662
+ */
663
+ var OptionsApi = /** @class */ (function (_super) {
664
+ __extends(OptionsApi, _super);
665
+ function OptionsApi() {
666
+ return _super !== null && _super.apply(this, arguments) || this;
667
+ }
668
+ /**
669
+ *
670
+ * @summary Creates an option strategy object that will be used to place an option strategy order
671
+ * @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
672
+ * @param {*} [options] Override http request option.
673
+ * @throws {RequiredError}
674
+ * @memberof OptionsApi
675
+ */
676
+ OptionsApi.prototype.getOptionStrategy = function (requestParameters, options) {
677
+ var _this = this;
678
+ return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
679
+ };
680
+ /**
681
+ *
682
+ * @summary Get the options chain
683
+ * @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
684
+ * @param {*} [options] Override http request option.
685
+ * @throws {RequiredError}
686
+ * @memberof OptionsApi
687
+ */
688
+ OptionsApi.prototype.getOptionsChain = function (requestParameters, options) {
689
+ var _this = this;
690
+ return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
691
+ };
692
+ /**
693
+ *
694
+ * @summary Get latest market data of option strategy
695
+ * @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
696
+ * @param {*} [options] Override http request option.
697
+ * @throws {RequiredError}
698
+ * @memberof OptionsApi
699
+ */
700
+ OptionsApi.prototype.getOptionsStrategyQuote = function (requestParameters, options) {
701
+ var _this = this;
702
+ return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
703
+ };
704
+ /**
705
+ *
706
+ * @summary Get the options holdings in the account
707
+ * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
708
+ * @param {*} [options] Override http request option.
709
+ * @throws {RequiredError}
710
+ * @memberof OptionsApi
711
+ */
712
+ OptionsApi.prototype.listOptionHoldings = function (requestParameters, options) {
713
+ var _this = this;
714
+ return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
715
+ };
716
+ /**
717
+ *
718
+ * @summary Place an option strategy order on the brokerage
719
+ * @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
720
+ * @param {*} [options] Override http request option.
721
+ * @throws {RequiredError}
722
+ * @memberof OptionsApi
723
+ */
724
+ OptionsApi.prototype.placeOptionStrategy = function (requestParameters, options) {
725
+ var _this = this;
726
+ return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
727
+ };
728
+ return OptionsApi;
729
+ }(options_api_custom_1.OptionsApiCustom));
730
+ exports.OptionsApi = OptionsApi;