snaptrade 1.2.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 (422) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +10 -0
  3. data/Gemfile.lock +84 -0
  4. data/README.md +254 -0
  5. data/Rakefile +10 -0
  6. data/docs/APIStatusApi.md +57 -0
  7. data/docs/Account.md +36 -0
  8. data/docs/AccountHoldings.md +24 -0
  9. data/docs/AccountHoldingsAccount.md +26 -0
  10. data/docs/AccountInformationApi.md +535 -0
  11. data/docs/AccountOrderRecord.md +52 -0
  12. data/docs/AccountOrderRecordStatus.md +15 -0
  13. data/docs/AccountSimple.md +24 -0
  14. data/docs/AccountSyncStatus.md +18 -0
  15. data/docs/Action.md +15 -0
  16. data/docs/AuthType.md +15 -0
  17. data/docs/AuthenticationApi.md +314 -0
  18. data/docs/AuthenticationLoginSnapTradeUser200Response.md +49 -0
  19. data/docs/Balance.md +20 -0
  20. data/docs/Brokerage.md +52 -0
  21. data/docs/BrokerageAuthorization.md +34 -0
  22. data/docs/BrokerageAuthorizationType.md +18 -0
  23. data/docs/BrokerageAuthorizationTypeReadOnly.md +24 -0
  24. data/docs/BrokerageAuthorizationTypeReadOnlyBrokerage.md +22 -0
  25. data/docs/BrokerageAuthorizationTypeReadOnlyType.md +15 -0
  26. data/docs/BrokerageAuthorizationTypeType.md +15 -0
  27. data/docs/BrokerageSymbol.md +26 -0
  28. data/docs/BrokerageType.md +20 -0
  29. data/docs/CalculatedTrade.md +20 -0
  30. data/docs/CashRestriction.md +26 -0
  31. data/docs/ConnectionType.md +15 -0
  32. data/docs/ConnectionsApi.md +265 -0
  33. data/docs/ConnectionsSessionEvents200ResponseInner.md +30 -0
  34. data/docs/Currency.md +22 -0
  35. data/docs/DeleteUserResponse.md +20 -0
  36. data/docs/DividendAtDate.md +22 -0
  37. data/docs/EncryptedResponse.md +20 -0
  38. data/docs/EncryptedResponseEncryptedMessageData.md +22 -0
  39. data/docs/ErrorLogsApi.md +68 -0
  40. data/docs/Exchange.md +32 -0
  41. data/docs/ExchangeRatePairs.md +22 -0
  42. data/docs/ExcludedAsset.md +18 -0
  43. data/docs/JWT.md +18 -0
  44. data/docs/LoginRedirectURI.md +20 -0
  45. data/docs/ManualTrade.md +32 -0
  46. data/docs/ManualTradeAndImpact.md +22 -0
  47. data/docs/ManualTradeBalance.md +22 -0
  48. data/docs/ManualTradeForm.md +32 -0
  49. data/docs/ManualTradeSymbol.md +28 -0
  50. data/docs/Model400FailedRequestResponse.md +20 -0
  51. data/docs/Model401FailedRequestResponse.md +20 -0
  52. data/docs/Model403FailedRequestResponse.md +20 -0
  53. data/docs/Model404FailedRequestResponse.md +20 -0
  54. data/docs/ModelAssetClass.md +20 -0
  55. data/docs/ModelAssetClassDetails.md +20 -0
  56. data/docs/ModelAssetClassTarget.md +18 -0
  57. data/docs/ModelPortfolio.md +22 -0
  58. data/docs/ModelPortfolioAssetClass.md +20 -0
  59. data/docs/ModelPortfolioDetails.md +22 -0
  60. data/docs/ModelPortfolioSecurity.md +20 -0
  61. data/docs/ModelType.md +15 -0
  62. data/docs/MonthlyDividends.md +20 -0
  63. data/docs/NetContributions.md +22 -0
  64. data/docs/NetDividend.md +22 -0
  65. data/docs/OptionChainInner.md +26 -0
  66. data/docs/OptionChainInnerChainPerRootInner.md +22 -0
  67. data/docs/OptionChainInnerChainPerRootInnerChainPerStrikePriceInner.md +22 -0
  68. data/docs/OptionLeg.md +22 -0
  69. data/docs/OptionLegAction.md +15 -0
  70. data/docs/OptionStrategy.md +26 -0
  71. data/docs/OptionStrategyLegsInner.md +24 -0
  72. data/docs/OptionsApi.md +390 -0
  73. data/docs/OptionsGetOptionStrategyRequest.md +22 -0
  74. data/docs/OptionsHoldings.md +28 -0
  75. data/docs/OptionsPlaceOptionStrategyRequest.md +22 -0
  76. data/docs/OptionsPosition.md +30 -0
  77. data/docs/OptionsSymbol.md +38 -0
  78. data/docs/OrderStrategyExecuteBodyOrderType.md +15 -0
  79. data/docs/OrderStrategyExecuteBodyTimeInForce.md +15 -0
  80. data/docs/OrderType.md +15 -0
  81. data/docs/PartnerData.md +40 -0
  82. data/docs/PastValue.md +22 -0
  83. data/docs/PerformanceCustom.md +54 -0
  84. data/docs/PortfolioGroup.md +20 -0
  85. data/docs/PortfolioGroupInfo.md +38 -0
  86. data/docs/PortfolioGroupPosition.md +22 -0
  87. data/docs/PortfolioGroupSettings.md +26 -0
  88. data/docs/PortfolioManagementApi.md +2014 -0
  89. data/docs/Position.md +28 -0
  90. data/docs/PositionSymbol.md +28 -0
  91. data/docs/RedirectTokenandPin.md +20 -0
  92. data/docs/ReferenceDataApi.md +595 -0
  93. data/docs/SecurityType.md +24 -0
  94. data/docs/SessionEvent.md +30 -0
  95. data/docs/SessionEventType.md +15 -0
  96. data/docs/SnapTradeAPIDisclaimerAcceptStatus.md +20 -0
  97. data/docs/SnapTradeHoldingsAccount.md +32 -0
  98. data/docs/SnapTradeHoldingsAccountAccountId.md +34 -0
  99. data/docs/SnapTradeHoldingsTotalValue.md +20 -0
  100. data/docs/SnapTradeLoginUserRequestBody.md +26 -0
  101. data/docs/SnapTradeRegisterUserRequestBody.md +20 -0
  102. data/docs/State.md +15 -0
  103. data/docs/Status.md +22 -0
  104. data/docs/StrategyImpact.md +38 -0
  105. data/docs/StrategyImpactLegsInner.md +30 -0
  106. data/docs/StrategyOrderPlace.md +20 -0
  107. data/docs/StrategyOrderPlaceOrdersInner.md +102 -0
  108. data/docs/StrategyOrderPlaceOrdersInnerLegsInner.md +30 -0
  109. data/docs/StrategyOrderRecord.md +38 -0
  110. data/docs/StrategyOrderRecordOrderType.md +15 -0
  111. data/docs/StrategyOrderRecordStatus.md +15 -0
  112. data/docs/StrategyOrderRecordTimeInForce.md +15 -0
  113. data/docs/StrategyQuotes.md +28 -0
  114. data/docs/StrategyQuotesGreek.md +26 -0
  115. data/docs/StrategyType.md +15 -0
  116. data/docs/SubPeriodReturnRate.md +22 -0
  117. data/docs/Symbol.md +30 -0
  118. data/docs/SymbolQuery.md +18 -0
  119. data/docs/SymbolsQuotes.md +28 -0
  120. data/docs/TargetAsset.md +28 -0
  121. data/docs/TimeInForce.md +15 -0
  122. data/docs/Trade.md +32 -0
  123. data/docs/TradeAction.md +15 -0
  124. data/docs/TradeExecutionStatus.md +34 -0
  125. data/docs/TradeExecutionStatusAction.md +15 -0
  126. data/docs/TradeImpact.md +26 -0
  127. data/docs/TradingApi.md +799 -0
  128. data/docs/TradingCancelUserAccountOrderRequest.md +18 -0
  129. data/docs/TradingPlaceOCOOrderRequest.md +20 -0
  130. data/docs/TransactionsAndReportingApi.md +183 -0
  131. data/docs/TransactionsStatus.md +20 -0
  132. data/docs/Type.md +15 -0
  133. data/docs/USExchange.md +34 -0
  134. data/docs/UnderlyingSymbol.md +30 -0
  135. data/docs/UniversalActivity.md +46 -0
  136. data/docs/UniversalSymbol.md +32 -0
  137. data/docs/UniversalSymbolTicker.md +32 -0
  138. data/docs/UserErrorLog.md +28 -0
  139. data/docs/UserIDandSecret.md +20 -0
  140. data/docs/UserSettings.md +36 -0
  141. data/lib/snaptrade/api/account_information_api.rb +801 -0
  142. data/lib/snaptrade/api/api_status_api.rb +98 -0
  143. data/lib/snaptrade/api/authentication_api.rb +481 -0
  144. data/lib/snaptrade/api/connections_api.rb +398 -0
  145. data/lib/snaptrade/api/error_logs_api.rb +112 -0
  146. data/lib/snaptrade/api/options_api.rb +591 -0
  147. data/lib/snaptrade/api/portfolio_management_api.rb +2791 -0
  148. data/lib/snaptrade/api/reference_data_api.rb +894 -0
  149. data/lib/snaptrade/api/trading_api.rb +1150 -0
  150. data/lib/snaptrade/api/transactions_and_reporting_api.rb +283 -0
  151. data/lib/snaptrade/api_client.rb +427 -0
  152. data/lib/snaptrade/api_client_custom.rb +32 -0
  153. data/lib/snaptrade/api_error.rb +55 -0
  154. data/lib/snaptrade/configuration.rb +374 -0
  155. data/lib/snaptrade/models/account.rb +303 -0
  156. data/lib/snaptrade/models/account_holdings.rb +249 -0
  157. data/lib/snaptrade/models/account_holdings_account.rb +260 -0
  158. data/lib/snaptrade/models/account_order_record.rb +382 -0
  159. data/lib/snaptrade/models/account_order_record_status.rb +56 -0
  160. data/lib/snaptrade/models/account_simple.rb +245 -0
  161. data/lib/snaptrade/models/account_sync_status.rb +218 -0
  162. data/lib/snaptrade/models/action.rb +38 -0
  163. data/lib/snaptrade/models/auth_type.rb +40 -0
  164. data/lib/snaptrade/models/authentication_login_snap_trade_user200_response.rb +103 -0
  165. data/lib/snaptrade/models/balance.rb +228 -0
  166. data/lib/snaptrade/models/brokerage.rb +377 -0
  167. data/lib/snaptrade/models/brokerage_authorization.rb +297 -0
  168. data/lib/snaptrade/models/brokerage_authorization_type.rb +217 -0
  169. data/lib/snaptrade/models/brokerage_authorization_type_read_only.rb +244 -0
  170. data/lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb +237 -0
  171. data/lib/snaptrade/models/brokerage_authorization_type_read_only_type.rb +38 -0
  172. data/lib/snaptrade/models/brokerage_authorization_type_type.rb +38 -0
  173. data/lib/snaptrade/models/brokerage_symbol.rb +255 -0
  174. data/lib/snaptrade/models/brokerage_type.rb +227 -0
  175. data/lib/snaptrade/models/calculated_trade.rb +229 -0
  176. data/lib/snaptrade/models/cash_restriction.rb +254 -0
  177. data/lib/snaptrade/models/connection_type.rb +38 -0
  178. data/lib/snaptrade/models/connections_session_events200_response_inner.rb +293 -0
  179. data/lib/snaptrade/models/currency.rb +236 -0
  180. data/lib/snaptrade/models/delete_user_response.rb +229 -0
  181. data/lib/snaptrade/models/dividend_at_date.rb +240 -0
  182. data/lib/snaptrade/models/encrypted_response.rb +227 -0
  183. data/lib/snaptrade/models/encrypted_response_encrypted_message_data.rb +235 -0
  184. data/lib/snaptrade/models/exchange.rb +282 -0
  185. data/lib/snaptrade/models/exchange_rate_pairs.rb +236 -0
  186. data/lib/snaptrade/models/excluded_asset.rb +218 -0
  187. data/lib/snaptrade/models/jwt.rb +218 -0
  188. data/lib/snaptrade/models/login_redirect_uri.rb +228 -0
  189. data/lib/snaptrade/models/manual_trade.rb +283 -0
  190. data/lib/snaptrade/models/manual_trade_and_impact.rb +238 -0
  191. data/lib/snaptrade/models/manual_trade_balance.rb +238 -0
  192. data/lib/snaptrade/models/manual_trade_form.rb +285 -0
  193. data/lib/snaptrade/models/manual_trade_symbol.rb +264 -0
  194. data/lib/snaptrade/models/model400_failed_request_response.rb +229 -0
  195. data/lib/snaptrade/models/model401_failed_request_response.rb +229 -0
  196. data/lib/snaptrade/models/model403_failed_request_response.rb +229 -0
  197. data/lib/snaptrade/models/model404_failed_request_response.rb +229 -0
  198. data/lib/snaptrade/models/model_asset_class.rb +226 -0
  199. data/lib/snaptrade/models/model_asset_class_details.rb +228 -0
  200. data/lib/snaptrade/models/model_asset_class_target.rb +217 -0
  201. data/lib/snaptrade/models/model_portfolio.rb +237 -0
  202. data/lib/snaptrade/models/model_portfolio_asset_class.rb +250 -0
  203. data/lib/snaptrade/models/model_portfolio_details.rb +239 -0
  204. data/lib/snaptrade/models/model_portfolio_security.rb +250 -0
  205. data/lib/snaptrade/models/model_type.rb +39 -0
  206. data/lib/snaptrade/models/monthly_dividends.rb +229 -0
  207. data/lib/snaptrade/models/net_contributions.rb +237 -0
  208. data/lib/snaptrade/models/net_dividend.rb +237 -0
  209. data/lib/snaptrade/models/option_chain_inner.rb +255 -0
  210. data/lib/snaptrade/models/option_chain_inner_chain_per_root_inner.rb +237 -0
  211. data/lib/snaptrade/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner.rb +238 -0
  212. data/lib/snaptrade/models/option_leg.rb +237 -0
  213. data/lib/snaptrade/models/option_leg_action.rb +40 -0
  214. data/lib/snaptrade/models/option_strategy.rb +255 -0
  215. data/lib/snaptrade/models/option_strategy_legs_inner.rb +244 -0
  216. data/lib/snaptrade/models/options_get_option_strategy_request.rb +252 -0
  217. data/lib/snaptrade/models/options_holdings.rb +267 -0
  218. data/lib/snaptrade/models/options_place_option_strategy_request.rb +251 -0
  219. data/lib/snaptrade/models/options_position.rb +275 -0
  220. data/lib/snaptrade/models/options_symbol.rb +310 -0
  221. data/lib/snaptrade/models/order_strategy_execute_body_order_type.rb +40 -0
  222. data/lib/snaptrade/models/order_strategy_execute_body_time_in_force.rb +38 -0
  223. data/lib/snaptrade/models/order_type.rb +40 -0
  224. data/lib/snaptrade/models/partner_data.rb +331 -0
  225. data/lib/snaptrade/models/past_value.rb +236 -0
  226. data/lib/snaptrade/models/performance_custom.rb +416 -0
  227. data/lib/snaptrade/models/portfolio_group.rb +226 -0
  228. data/lib/snaptrade/models/portfolio_group_info.rb +326 -0
  229. data/lib/snaptrade/models/portfolio_group_position.rb +238 -0
  230. data/lib/snaptrade/models/portfolio_group_settings.rb +277 -0
  231. data/lib/snaptrade/models/position.rb +271 -0
  232. data/lib/snaptrade/models/position_symbol.rb +264 -0
  233. data/lib/snaptrade/models/redirect_tokenand_pin.rb +227 -0
  234. data/lib/snaptrade/models/security_type.rb +245 -0
  235. data/lib/snaptrade/models/session_event.rb +274 -0
  236. data/lib/snaptrade/models/session_event_type.rb +43 -0
  237. data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +227 -0
  238. data/lib/snaptrade/models/snap_trade_holdings_account.rb +284 -0
  239. data/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb +296 -0
  240. data/lib/snaptrade/models/snap_trade_holdings_total_value.rb +227 -0
  241. data/lib/snaptrade/models/snap_trade_login_user_request_body.rb +254 -0
  242. data/lib/snaptrade/models/snap_trade_register_user_request_body.rb +229 -0
  243. data/lib/snaptrade/models/state.rb +41 -0
  244. data/lib/snaptrade/models/status.rb +236 -0
  245. data/lib/snaptrade/models/strategy_impact.rb +310 -0
  246. data/lib/snaptrade/models/strategy_impact_legs_inner.rb +271 -0
  247. data/lib/snaptrade/models/strategy_order_place.rb +229 -0
  248. data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +597 -0
  249. data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +271 -0
  250. data/lib/snaptrade/models/strategy_order_record.rb +312 -0
  251. data/lib/snaptrade/models/strategy_order_record_order_type.rb +40 -0
  252. data/lib/snaptrade/models/strategy_order_record_status.rb +55 -0
  253. data/lib/snaptrade/models/strategy_order_record_time_in_force.rb +38 -0
  254. data/lib/snaptrade/models/strategy_quotes.rb +265 -0
  255. data/lib/snaptrade/models/strategy_quotes_greek.rb +253 -0
  256. data/lib/snaptrade/models/strategy_type.rb +37 -0
  257. data/lib/snaptrade/models/sub_period_return_rate.rb +239 -0
  258. data/lib/snaptrade/models/symbol.rb +272 -0
  259. data/lib/snaptrade/models/symbol_query.rb +218 -0
  260. data/lib/snaptrade/models/symbols_quotes.rb +263 -0
  261. data/lib/snaptrade/models/target_asset.rb +290 -0
  262. data/lib/snaptrade/models/time_in_force.rb +39 -0
  263. data/lib/snaptrade/models/trade.rb +281 -0
  264. data/lib/snaptrade/models/trade_action.rb +38 -0
  265. data/lib/snaptrade/models/trade_execution_status.rb +296 -0
  266. data/lib/snaptrade/models/trade_execution_status_action.rb +38 -0
  267. data/lib/snaptrade/models/trade_impact.rb +257 -0
  268. data/lib/snaptrade/models/trading_cancel_user_account_order_request.rb +217 -0
  269. data/lib/snaptrade/models/trading_place_oco_order_request.rb +230 -0
  270. data/lib/snaptrade/models/transactions_status.rb +229 -0
  271. data/lib/snaptrade/models/type.rb +38 -0
  272. data/lib/snaptrade/models/underlying_symbol.rb +275 -0
  273. data/lib/snaptrade/models/universal_activity.rb +349 -0
  274. data/lib/snaptrade/models/universal_symbol.rb +284 -0
  275. data/lib/snaptrade/models/universal_symbol_ticker.rb +283 -0
  276. data/lib/snaptrade/models/us_exchange.rb +291 -0
  277. data/lib/snaptrade/models/user_error_log.rb +263 -0
  278. data/lib/snaptrade/models/user_i_dand_secret.rb +229 -0
  279. data/lib/snaptrade/models/user_settings.rb +299 -0
  280. data/lib/snaptrade/version.rb +13 -0
  281. data/lib/snaptrade.rb +214 -0
  282. data/snaptrade.gemspec +41 -0
  283. data/spec/api/account_information_api_spec.rb +135 -0
  284. data/spec/api/api_status_api_spec.rb +42 -0
  285. data/spec/api/authentication_api_spec.rb +88 -0
  286. data/spec/api/connections_api_spec.rb +82 -0
  287. data/spec/api/error_logs_api_spec.rb +43 -0
  288. data/spec/api/options_api_spec.rb +101 -0
  289. data/spec/api/portfolio_management_api_spec.rb +395 -0
  290. data/spec/api/reference_data_api_spec.rb +150 -0
  291. data/spec/api/trading_api_spec.rb +163 -0
  292. data/spec/api/transactions_and_reporting_api_spec.rb +67 -0
  293. data/spec/api_client_spec.rb +193 -0
  294. data/spec/configuration_spec.rb +40 -0
  295. data/spec/getting_started_spec.rb +144 -0
  296. data/spec/models/account_holdings_account_spec.rb +54 -0
  297. data/spec/models/account_holdings_spec.rb +48 -0
  298. data/spec/models/account_order_record_spec.rb +132 -0
  299. data/spec/models/account_order_record_status_spec.rb +24 -0
  300. data/spec/models/account_simple_spec.rb +48 -0
  301. data/spec/models/account_spec.rb +84 -0
  302. data/spec/models/account_sync_status_spec.rb +30 -0
  303. data/spec/models/action_spec.rb +24 -0
  304. data/spec/models/auth_type_spec.rb +24 -0
  305. data/spec/models/authentication_login_snap_trade_user200_response_spec.rb +27 -0
  306. data/spec/models/balance_spec.rb +36 -0
  307. data/spec/models/brokerage_authorization_spec.rb +78 -0
  308. data/spec/models/brokerage_authorization_type_read_only_brokerage_spec.rb +42 -0
  309. data/spec/models/brokerage_authorization_type_read_only_spec.rb +48 -0
  310. data/spec/models/brokerage_authorization_type_read_only_type_spec.rb +24 -0
  311. data/spec/models/brokerage_authorization_type_spec.rb +30 -0
  312. data/spec/models/brokerage_authorization_type_type_spec.rb +24 -0
  313. data/spec/models/brokerage_spec.rb +132 -0
  314. data/spec/models/brokerage_symbol_spec.rb +54 -0
  315. data/spec/models/brokerage_type_spec.rb +36 -0
  316. data/spec/models/calculated_trade_spec.rb +36 -0
  317. data/spec/models/cash_restriction_spec.rb +54 -0
  318. data/spec/models/connection_type_spec.rb +24 -0
  319. data/spec/models/connections_session_events200_response_inner_spec.rb +66 -0
  320. data/spec/models/currency_spec.rb +42 -0
  321. data/spec/models/delete_user_response_spec.rb +36 -0
  322. data/spec/models/dividend_at_date_spec.rb +42 -0
  323. data/spec/models/encrypted_response_encrypted_message_data_spec.rb +42 -0
  324. data/spec/models/encrypted_response_spec.rb +36 -0
  325. data/spec/models/exchange_rate_pairs_spec.rb +42 -0
  326. data/spec/models/exchange_spec.rb +72 -0
  327. data/spec/models/excluded_asset_spec.rb +30 -0
  328. data/spec/models/jwt_spec.rb +30 -0
  329. data/spec/models/login_redirect_uri_spec.rb +36 -0
  330. data/spec/models/manual_trade_and_impact_spec.rb +42 -0
  331. data/spec/models/manual_trade_balance_spec.rb +42 -0
  332. data/spec/models/manual_trade_form_spec.rb +72 -0
  333. data/spec/models/manual_trade_spec.rb +72 -0
  334. data/spec/models/manual_trade_symbol_spec.rb +60 -0
  335. data/spec/models/model400_failed_request_response_spec.rb +36 -0
  336. data/spec/models/model401_failed_request_response_spec.rb +36 -0
  337. data/spec/models/model403_failed_request_response_spec.rb +36 -0
  338. data/spec/models/model404_failed_request_response_spec.rb +36 -0
  339. data/spec/models/model_asset_class_details_spec.rb +36 -0
  340. data/spec/models/model_asset_class_spec.rb +36 -0
  341. data/spec/models/model_asset_class_target_spec.rb +30 -0
  342. data/spec/models/model_portfolio_asset_class_spec.rb +36 -0
  343. data/spec/models/model_portfolio_details_spec.rb +42 -0
  344. data/spec/models/model_portfolio_security_spec.rb +36 -0
  345. data/spec/models/model_portfolio_spec.rb +42 -0
  346. data/spec/models/model_type_spec.rb +24 -0
  347. data/spec/models/monthly_dividends_spec.rb +36 -0
  348. data/spec/models/net_contributions_spec.rb +42 -0
  349. data/spec/models/net_dividend_spec.rb +42 -0
  350. data/spec/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner_spec.rb +42 -0
  351. data/spec/models/option_chain_inner_chain_per_root_inner_spec.rb +42 -0
  352. data/spec/models/option_chain_inner_spec.rb +54 -0
  353. data/spec/models/option_leg_action_spec.rb +24 -0
  354. data/spec/models/option_leg_spec.rb +42 -0
  355. data/spec/models/option_strategy_legs_inner_spec.rb +48 -0
  356. data/spec/models/option_strategy_spec.rb +54 -0
  357. data/spec/models/options_get_option_strategy_request_spec.rb +42 -0
  358. data/spec/models/options_holdings_spec.rb +60 -0
  359. data/spec/models/options_place_option_strategy_request_spec.rb +42 -0
  360. data/spec/models/options_position_spec.rb +66 -0
  361. data/spec/models/options_symbol_spec.rb +90 -0
  362. data/spec/models/order_strategy_execute_body_order_type_spec.rb +24 -0
  363. data/spec/models/order_strategy_execute_body_time_in_force_spec.rb +24 -0
  364. data/spec/models/order_type_spec.rb +24 -0
  365. data/spec/models/partner_data_spec.rb +96 -0
  366. data/spec/models/past_value_spec.rb +42 -0
  367. data/spec/models/performance_custom_spec.rb +138 -0
  368. data/spec/models/portfolio_group_info_spec.rb +90 -0
  369. data/spec/models/portfolio_group_position_spec.rb +42 -0
  370. data/spec/models/portfolio_group_settings_spec.rb +54 -0
  371. data/spec/models/portfolio_group_spec.rb +36 -0
  372. data/spec/models/position_spec.rb +60 -0
  373. data/spec/models/position_symbol_spec.rb +60 -0
  374. data/spec/models/redirect_tokenand_pin_spec.rb +36 -0
  375. data/spec/models/security_type_spec.rb +48 -0
  376. data/spec/models/session_event_spec.rb +66 -0
  377. data/spec/models/session_event_type_spec.rb +24 -0
  378. data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +36 -0
  379. data/spec/models/snap_trade_holdings_account_account_id_spec.rb +78 -0
  380. data/spec/models/snap_trade_holdings_account_spec.rb +72 -0
  381. data/spec/models/snap_trade_holdings_total_value_spec.rb +36 -0
  382. data/spec/models/snap_trade_login_user_request_body_spec.rb +54 -0
  383. data/spec/models/snap_trade_register_user_request_body_spec.rb +36 -0
  384. data/spec/models/state_spec.rb +24 -0
  385. data/spec/models/status_spec.rb +42 -0
  386. data/spec/models/strategy_impact_legs_inner_spec.rb +66 -0
  387. data/spec/models/strategy_impact_spec.rb +90 -0
  388. data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +66 -0
  389. data/spec/models/strategy_order_place_orders_inner_spec.rb +282 -0
  390. data/spec/models/strategy_order_place_spec.rb +36 -0
  391. data/spec/models/strategy_order_record_order_type_spec.rb +24 -0
  392. data/spec/models/strategy_order_record_spec.rb +90 -0
  393. data/spec/models/strategy_order_record_status_spec.rb +24 -0
  394. data/spec/models/strategy_order_record_time_in_force_spec.rb +24 -0
  395. data/spec/models/strategy_quotes_greek_spec.rb +54 -0
  396. data/spec/models/strategy_quotes_spec.rb +60 -0
  397. data/spec/models/strategy_type_spec.rb +24 -0
  398. data/spec/models/sub_period_return_rate_spec.rb +42 -0
  399. data/spec/models/symbol_query_spec.rb +30 -0
  400. data/spec/models/symbol_spec.rb +66 -0
  401. data/spec/models/symbols_quotes_spec.rb +60 -0
  402. data/spec/models/target_asset_spec.rb +60 -0
  403. data/spec/models/time_in_force_spec.rb +24 -0
  404. data/spec/models/trade_action_spec.rb +24 -0
  405. data/spec/models/trade_execution_status_action_spec.rb +24 -0
  406. data/spec/models/trade_execution_status_spec.rb +78 -0
  407. data/spec/models/trade_impact_spec.rb +54 -0
  408. data/spec/models/trade_spec.rb +72 -0
  409. data/spec/models/trading_cancel_user_account_order_request_spec.rb +30 -0
  410. data/spec/models/trading_place_oco_order_request_spec.rb +36 -0
  411. data/spec/models/transactions_status_spec.rb +36 -0
  412. data/spec/models/type_spec.rb +24 -0
  413. data/spec/models/underlying_symbol_spec.rb +66 -0
  414. data/spec/models/universal_activity_spec.rb +114 -0
  415. data/spec/models/universal_symbol_spec.rb +72 -0
  416. data/spec/models/universal_symbol_ticker_spec.rb +72 -0
  417. data/spec/models/us_exchange_spec.rb +78 -0
  418. data/spec/models/user_error_log_spec.rb +60 -0
  419. data/spec/models/user_i_dand_secret_spec.rb +36 -0
  420. data/spec/models/user_settings_spec.rb +84 -0
  421. data/spec/spec_helper.rb +109 -0
  422. metadata +664 -0
@@ -0,0 +1,2791 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+
9
+ =end
10
+
11
+ require 'cgi'
12
+
13
+ module SnapTrade
14
+ class PortfolioManagementApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+
21
+ # Adds an asset to exclude to a portfolio group
22
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to exclude an asset.
23
+ # @param id [String]
24
+ # @param symbol [String]
25
+ # @param raw_symbol [String]
26
+ # @param description [String]
27
+ # @param currency [Currency]
28
+ # @param exchange [Exchange]
29
+ # @param type [SecurityType]
30
+ # @param currencies [Array<Currency>]
31
+ # @param body [UniversalSymbol]
32
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
33
+ def add_portfolio_excluded_asset(portfolio_group_id:, id: SENTINEL, symbol: SENTINEL, raw_symbol: SENTINEL, description: SENTINEL, currency: SENTINEL, exchange: SENTINEL, type: SENTINEL, currencies: SENTINEL, extra: {})
34
+ _body = {}
35
+ _body[:id] = id if id != SENTINEL
36
+ _body[:symbol] = symbol if symbol != SENTINEL
37
+ _body[:raw_symbol] = raw_symbol if raw_symbol != SENTINEL
38
+ _body[:description] = description if description != SENTINEL
39
+ _body[:currency] = currency if currency != SENTINEL
40
+ _body[:exchange] = exchange if exchange != SENTINEL
41
+ _body[:type] = type if type != SENTINEL
42
+ _body[:currencies] = currencies if currencies != SENTINEL
43
+ extra[:universal_symbol] = _body if !_body.empty?
44
+
45
+ data, _status_code, _headers = add_portfolio_excluded_asset_with_http_info_impl(portfolio_group_id, extra)
46
+ data
47
+ end
48
+
49
+ # Adds an asset to exclude to a portfolio group
50
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to exclude an asset.
51
+ # @param id [String]
52
+ # @param symbol [String]
53
+ # @param raw_symbol [String]
54
+ # @param description [String]
55
+ # @param currency [Currency]
56
+ # @param exchange [Exchange]
57
+ # @param type [SecurityType]
58
+ # @param currencies [Array<Currency>]
59
+ # @param body [UniversalSymbol]
60
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
61
+ def add_portfolio_excluded_asset_with_http_info(portfolio_group_id:, id: SENTINEL, symbol: SENTINEL, raw_symbol: SENTINEL, description: SENTINEL, currency: SENTINEL, exchange: SENTINEL, type: SENTINEL, currencies: SENTINEL, extra: {})
62
+ _body = {}
63
+ _body[:id] = id if id != SENTINEL
64
+ _body[:symbol] = symbol if symbol != SENTINEL
65
+ _body[:raw_symbol] = raw_symbol if raw_symbol != SENTINEL
66
+ _body[:description] = description if description != SENTINEL
67
+ _body[:currency] = currency if currency != SENTINEL
68
+ _body[:exchange] = exchange if exchange != SENTINEL
69
+ _body[:type] = type if type != SENTINEL
70
+ _body[:currencies] = currencies if currencies != SENTINEL
71
+ extra[:universal_symbol] = _body if !_body.empty?
72
+
73
+ add_portfolio_excluded_asset_with_http_info_impl(portfolio_group_id, extra)
74
+ end
75
+
76
+ # Adds an asset to exclude to a portfolio group
77
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to exclude an asset.
78
+ # @param [Hash] opts the optional parameters
79
+ # @option opts [UniversalSymbol] :universal_symbol
80
+ # @return [ExcludedAsset]
81
+ def add_portfolio_excluded_asset_impl(portfolio_group_id, opts = {})
82
+ data, _status_code, _headers = add_portfolio_excluded_asset_with_http_info(portfolio_group_id, opts)
83
+ data
84
+ end
85
+
86
+ # Adds an asset to exclude to a portfolio group
87
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to exclude an asset.
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [UniversalSymbol] :universal_symbol
90
+ # @return [Array<(ExcludedAsset, Integer, Hash)>] ExcludedAsset data, response status code and response headers
91
+ def add_portfolio_excluded_asset_with_http_info_impl(portfolio_group_id, opts = {})
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.add_portfolio_excluded_asset ...'
94
+ end
95
+ # verify the required parameter 'portfolio_group_id' is set
96
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
97
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.add_portfolio_excluded_asset"
98
+ end
99
+ # resource path
100
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/excludedassets'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
101
+
102
+ # query parameters
103
+ query_params = opts[:query_params] || {}
104
+
105
+ # header parameters
106
+ header_params = opts[:header_params] || {}
107
+ # HTTP header 'Accept' (if needed)
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
109
+ # HTTP header 'Content-Type'
110
+ content_type = @api_client.select_header_content_type(['application/json'])
111
+ if !content_type.nil?
112
+ header_params['Content-Type'] = content_type
113
+ end
114
+
115
+ # form parameters
116
+ form_params = opts[:form_params] || {}
117
+
118
+ # http body (model)
119
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'universal_symbol'])
120
+
121
+ # return_type
122
+ return_type = opts[:debug_return_type] || 'ExcludedAsset'
123
+
124
+ # auth_names
125
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
126
+
127
+ new_options = opts.merge(
128
+ :operation => :"PortfolioManagementApi.add_portfolio_excluded_asset",
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => return_type
135
+ )
136
+
137
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#add_portfolio_excluded_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
140
+ end
141
+ return data, status_code, headers, response
142
+ end
143
+
144
+
145
+ # Create new portfolio group
146
+ # @param user_id [String]
147
+ # @param user_secret [String]
148
+ # @param id [String]
149
+ # @param name [String]
150
+ # @param body [Hash<String, Object>]
151
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
152
+ def create(user_id:, user_secret:, id: SENTINEL, name: SENTINEL, extra: {})
153
+ _body = {}
154
+ _body[:id] = id if id != SENTINEL
155
+ _body[:name] = name if name != SENTINEL
156
+ request_body = _body
157
+
158
+ data, _status_code, _headers = create_with_http_info_impl(user_id, user_secret, request_body, extra)
159
+ data
160
+ end
161
+
162
+ # Create new portfolio group
163
+ # @param user_id [String]
164
+ # @param user_secret [String]
165
+ # @param id [String]
166
+ # @param name [String]
167
+ # @param body [Hash<String, Object>]
168
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
169
+ def create_with_http_info(user_id:, user_secret:, id: SENTINEL, name: SENTINEL, extra: {})
170
+ _body = {}
171
+ _body[:id] = id if id != SENTINEL
172
+ _body[:name] = name if name != SENTINEL
173
+ request_body = _body
174
+
175
+ create_with_http_info_impl(user_id, user_secret, request_body, extra)
176
+ end
177
+
178
+ # Create new portfolio group
179
+ # @param user_id [String]
180
+ # @param user_secret [String]
181
+ # @param request_body [Hash<String, Object>]
182
+ # @param [Hash] opts the optional parameters
183
+ # @return [Array<PortfolioGroup>]
184
+ def create_impl(user_id, user_secret, request_body, opts = {})
185
+ data, _status_code, _headers = create_with_http_info(user_id, user_secret, request_body, opts)
186
+ data
187
+ end
188
+
189
+ # Create new portfolio group
190
+ # @param user_id [String]
191
+ # @param user_secret [String]
192
+ # @param request_body [Hash<String, Object>]
193
+ # @param [Hash] opts the optional parameters
194
+ # @return [Array<(Array<PortfolioGroup>, Integer, Hash)>] Array<PortfolioGroup> data, response status code and response headers
195
+ def create_with_http_info_impl(user_id, user_secret, request_body, opts = {})
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.create ...'
198
+ end
199
+ # verify the required parameter 'user_id' is set
200
+ if @api_client.config.client_side_validation && user_id.nil?
201
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling PortfolioManagementApi.create"
202
+ end
203
+ # verify the required parameter 'user_secret' is set
204
+ if @api_client.config.client_side_validation && user_secret.nil?
205
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling PortfolioManagementApi.create"
206
+ end
207
+ # verify the required parameter 'request_body' is set
208
+ if @api_client.config.client_side_validation && request_body.nil?
209
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling PortfolioManagementApi.create"
210
+ end
211
+ # resource path
212
+ local_var_path = '/portfolioGroups'
213
+
214
+ # query parameters
215
+ query_params = opts[:query_params] || {}
216
+ query_params[:'userId'] = user_id
217
+ query_params[:'userSecret'] = user_secret
218
+
219
+ # header parameters
220
+ header_params = opts[:header_params] || {}
221
+ # HTTP header 'Accept' (if needed)
222
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
223
+ # HTTP header 'Content-Type'
224
+ content_type = @api_client.select_header_content_type(['application/json'])
225
+ if !content_type.nil?
226
+ header_params['Content-Type'] = content_type
227
+ end
228
+
229
+ # form parameters
230
+ form_params = opts[:form_params] || {}
231
+
232
+ # http body (model)
233
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
234
+
235
+ # return_type
236
+ return_type = opts[:debug_return_type] || 'Array<PortfolioGroup>'
237
+
238
+ # auth_names
239
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
240
+
241
+ new_options = opts.merge(
242
+ :operation => :"PortfolioManagementApi.create",
243
+ :header_params => header_params,
244
+ :query_params => query_params,
245
+ :form_params => form_params,
246
+ :body => post_body,
247
+ :auth_names => auth_names,
248
+ :return_type => return_type
249
+ )
250
+
251
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
252
+ if @api_client.config.debugging
253
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
254
+ end
255
+ return data, status_code, headers, response
256
+ end
257
+
258
+
259
+ # Create a new model asset class
260
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
261
+ def create_asset_class(extra: {})
262
+
263
+ data, _status_code, _headers = create_asset_class_with_http_info_impl(extra)
264
+ data
265
+ end
266
+
267
+ # Create a new model asset class
268
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
269
+ def create_asset_class_with_http_info(extra: {})
270
+
271
+ create_asset_class_with_http_info_impl(extra)
272
+ end
273
+
274
+ # Create a new model asset class
275
+ # @param [Hash] opts the optional parameters
276
+ # @return [ModelAssetClassDetails]
277
+ def create_asset_class_impl(opts = {})
278
+ data, _status_code, _headers = create_asset_class_with_http_info(opts)
279
+ data
280
+ end
281
+
282
+ # Create a new model asset class
283
+ # @param [Hash] opts the optional parameters
284
+ # @return [Array<(ModelAssetClassDetails, Integer, Hash)>] ModelAssetClassDetails data, response status code and response headers
285
+ def create_asset_class_with_http_info_impl(opts = {})
286
+ if @api_client.config.debugging
287
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.create_asset_class ...'
288
+ end
289
+ # resource path
290
+ local_var_path = '/modelAssetClass'
291
+
292
+ # query parameters
293
+ query_params = opts[:query_params] || {}
294
+
295
+ # header parameters
296
+ header_params = opts[:header_params] || {}
297
+ # HTTP header 'Accept' (if needed)
298
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
299
+
300
+ # form parameters
301
+ form_params = opts[:form_params] || {}
302
+
303
+ # http body (model)
304
+ post_body = opts[:debug_body]
305
+
306
+ # return_type
307
+ return_type = opts[:debug_return_type] || 'ModelAssetClassDetails'
308
+
309
+ # auth_names
310
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
311
+
312
+ new_options = opts.merge(
313
+ :operation => :"PortfolioManagementApi.create_asset_class",
314
+ :header_params => header_params,
315
+ :query_params => query_params,
316
+ :form_params => form_params,
317
+ :body => post_body,
318
+ :auth_names => auth_names,
319
+ :return_type => return_type
320
+ )
321
+
322
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
323
+ if @api_client.config.debugging
324
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#create_asset_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
325
+ end
326
+ return data, status_code, headers, response
327
+ end
328
+
329
+
330
+ # Creates a new model portfolio
331
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
332
+ def create_model_portfolio(extra: {})
333
+
334
+ data, _status_code, _headers = create_model_portfolio_with_http_info_impl(extra)
335
+ data
336
+ end
337
+
338
+ # Creates a new model portfolio
339
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
340
+ def create_model_portfolio_with_http_info(extra: {})
341
+
342
+ create_model_portfolio_with_http_info_impl(extra)
343
+ end
344
+
345
+ # Creates a new model portfolio
346
+ # @param [Hash] opts the optional parameters
347
+ # @return [ModelPortfolioDetails]
348
+ def create_model_portfolio_impl(opts = {})
349
+ data, _status_code, _headers = create_model_portfolio_with_http_info(opts)
350
+ data
351
+ end
352
+
353
+ # Creates a new model portfolio
354
+ # @param [Hash] opts the optional parameters
355
+ # @return [Array<(ModelPortfolioDetails, Integer, Hash)>] ModelPortfolioDetails data, response status code and response headers
356
+ def create_model_portfolio_with_http_info_impl(opts = {})
357
+ if @api_client.config.debugging
358
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.create_model_portfolio ...'
359
+ end
360
+ # resource path
361
+ local_var_path = '/modelPortfolio'
362
+
363
+ # query parameters
364
+ query_params = opts[:query_params] || {}
365
+
366
+ # header parameters
367
+ header_params = opts[:header_params] || {}
368
+ # HTTP header 'Accept' (if needed)
369
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
370
+
371
+ # form parameters
372
+ form_params = opts[:form_params] || {}
373
+
374
+ # http body (model)
375
+ post_body = opts[:debug_body]
376
+
377
+ # return_type
378
+ return_type = opts[:debug_return_type] || 'ModelPortfolioDetails'
379
+
380
+ # auth_names
381
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
382
+
383
+ new_options = opts.merge(
384
+ :operation => :"PortfolioManagementApi.create_model_portfolio",
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => return_type
391
+ )
392
+
393
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#create_model_portfolio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
396
+ end
397
+ return data, status_code, headers, response
398
+ end
399
+
400
+
401
+ # Deletes a model asset class
402
+ # @param model_asset_class_id [String] The ID of the model asset class to delete.
403
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
404
+ def delete_asset_class(model_asset_class_id:, extra: {})
405
+
406
+ delete_asset_class_with_http_info_impl(model_asset_class_id, extra)
407
+ nil
408
+ end
409
+
410
+ # Deletes a model asset class
411
+ # @param model_asset_class_id [String] The ID of the model asset class to delete.
412
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
413
+ def delete_asset_class_with_http_info(model_asset_class_id:, extra: {})
414
+
415
+ delete_asset_class_with_http_info_impl(model_asset_class_id, extra)
416
+ end
417
+
418
+ # Deletes a model asset class
419
+ # @param model_asset_class_id [String] The ID of the model asset class to delete.
420
+ # @param [Hash] opts the optional parameters
421
+ # @return [nil]
422
+ def delete_asset_class_impl(model_asset_class_id, opts = {})
423
+ delete_asset_class_with_http_info(model_asset_class_id, opts)
424
+ nil
425
+ end
426
+
427
+ # Deletes a model asset class
428
+ # @param model_asset_class_id [String] The ID of the model asset class to delete.
429
+ # @param [Hash] opts the optional parameters
430
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
431
+ def delete_asset_class_with_http_info_impl(model_asset_class_id, opts = {})
432
+ if @api_client.config.debugging
433
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.delete_asset_class ...'
434
+ end
435
+ # verify the required parameter 'model_asset_class_id' is set
436
+ if @api_client.config.client_side_validation && model_asset_class_id.nil?
437
+ fail ArgumentError, "Missing the required parameter 'model_asset_class_id' when calling PortfolioManagementApi.delete_asset_class"
438
+ end
439
+ # resource path
440
+ local_var_path = '/modelAssetClass/{modelAssetClassId}'.sub('{' + 'modelAssetClassId' + '}', CGI.escape(model_asset_class_id.to_s))
441
+
442
+ # query parameters
443
+ query_params = opts[:query_params] || {}
444
+
445
+ # header parameters
446
+ header_params = opts[:header_params] || {}
447
+
448
+ # form parameters
449
+ form_params = opts[:form_params] || {}
450
+
451
+ # http body (model)
452
+ post_body = opts[:debug_body]
453
+
454
+ # return_type
455
+ return_type = opts[:debug_return_type]
456
+
457
+ # auth_names
458
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
459
+
460
+ new_options = opts.merge(
461
+ :operation => :"PortfolioManagementApi.delete_asset_class",
462
+ :header_params => header_params,
463
+ :query_params => query_params,
464
+ :form_params => form_params,
465
+ :body => post_body,
466
+ :auth_names => auth_names,
467
+ :return_type => return_type
468
+ )
469
+
470
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
471
+ if @api_client.config.debugging
472
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#delete_asset_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
473
+ end
474
+ return data, status_code, headers, response
475
+ end
476
+
477
+
478
+ # Unexclude an asset from a portfolio group
479
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to unexclude an asset.
480
+ # @param symbol_id [String] The ID of the excluded asset Symbol to delete.
481
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
482
+ def delete_excluded_asset(portfolio_group_id:, symbol_id:, extra: {})
483
+
484
+ delete_excluded_asset_with_http_info_impl(portfolio_group_id, symbol_id, extra)
485
+ nil
486
+ end
487
+
488
+ # Unexclude an asset from a portfolio group
489
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to unexclude an asset.
490
+ # @param symbol_id [String] The ID of the excluded asset Symbol to delete.
491
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
492
+ def delete_excluded_asset_with_http_info(portfolio_group_id:, symbol_id:, extra: {})
493
+
494
+ delete_excluded_asset_with_http_info_impl(portfolio_group_id, symbol_id, extra)
495
+ end
496
+
497
+ # Unexclude an asset from a portfolio group
498
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to unexclude an asset.
499
+ # @param symbol_id [String] The ID of the excluded asset Symbol to delete.
500
+ # @param [Hash] opts the optional parameters
501
+ # @return [nil]
502
+ def delete_excluded_asset_impl(portfolio_group_id, symbol_id, opts = {})
503
+ delete_excluded_asset_with_http_info(portfolio_group_id, symbol_id, opts)
504
+ nil
505
+ end
506
+
507
+ # Unexclude an asset from a portfolio group
508
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to unexclude an asset.
509
+ # @param symbol_id [String] The ID of the excluded asset Symbol to delete.
510
+ # @param [Hash] opts the optional parameters
511
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
512
+ def delete_excluded_asset_with_http_info_impl(portfolio_group_id, symbol_id, opts = {})
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.delete_excluded_asset ...'
515
+ end
516
+ # verify the required parameter 'portfolio_group_id' is set
517
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
518
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.delete_excluded_asset"
519
+ end
520
+ # verify the required parameter 'symbol_id' is set
521
+ if @api_client.config.client_side_validation && symbol_id.nil?
522
+ fail ArgumentError, "Missing the required parameter 'symbol_id' when calling PortfolioManagementApi.delete_excluded_asset"
523
+ end
524
+ # resource path
525
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'symbolId' + '}', CGI.escape(symbol_id.to_s))
526
+
527
+ # query parameters
528
+ query_params = opts[:query_params] || {}
529
+
530
+ # header parameters
531
+ header_params = opts[:header_params] || {}
532
+
533
+ # form parameters
534
+ form_params = opts[:form_params] || {}
535
+
536
+ # http body (model)
537
+ post_body = opts[:debug_body]
538
+
539
+ # return_type
540
+ return_type = opts[:debug_return_type]
541
+
542
+ # auth_names
543
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
544
+
545
+ new_options = opts.merge(
546
+ :operation => :"PortfolioManagementApi.delete_excluded_asset",
547
+ :header_params => header_params,
548
+ :query_params => query_params,
549
+ :form_params => form_params,
550
+ :body => post_body,
551
+ :auth_names => auth_names,
552
+ :return_type => return_type
553
+ )
554
+
555
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
556
+ if @api_client.config.debugging
557
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#delete_excluded_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
558
+ end
559
+ return data, status_code, headers, response
560
+ end
561
+
562
+
563
+ # Deletes a model portfolio
564
+ # @param model_portfolio_id [String] The ID of the model portfolio to delete.
565
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
566
+ def delete_model_portfolio_by_id(model_portfolio_id:, extra: {})
567
+
568
+ delete_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, extra)
569
+ nil
570
+ end
571
+
572
+ # Deletes a model portfolio
573
+ # @param model_portfolio_id [String] The ID of the model portfolio to delete.
574
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
575
+ def delete_model_portfolio_by_id_with_http_info(model_portfolio_id:, extra: {})
576
+
577
+ delete_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, extra)
578
+ end
579
+
580
+ # Deletes a model portfolio
581
+ # @param model_portfolio_id [String] The ID of the model portfolio to delete.
582
+ # @param [Hash] opts the optional parameters
583
+ # @return [nil]
584
+ def delete_model_portfolio_by_id_impl(model_portfolio_id, opts = {})
585
+ delete_model_portfolio_by_id_with_http_info(model_portfolio_id, opts)
586
+ nil
587
+ end
588
+
589
+ # Deletes a model portfolio
590
+ # @param model_portfolio_id [String] The ID of the model portfolio to delete.
591
+ # @param [Hash] opts the optional parameters
592
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
593
+ def delete_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, opts = {})
594
+ if @api_client.config.debugging
595
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.delete_model_portfolio_by_id ...'
596
+ end
597
+ # verify the required parameter 'model_portfolio_id' is set
598
+ if @api_client.config.client_side_validation && model_portfolio_id.nil?
599
+ fail ArgumentError, "Missing the required parameter 'model_portfolio_id' when calling PortfolioManagementApi.delete_model_portfolio_by_id"
600
+ end
601
+ # resource path
602
+ local_var_path = '/modelPortfolio/{modelPortfolioId}'.sub('{' + 'modelPortfolioId' + '}', CGI.escape(model_portfolio_id.to_s))
603
+
604
+ # query parameters
605
+ query_params = opts[:query_params] || {}
606
+
607
+ # header parameters
608
+ header_params = opts[:header_params] || {}
609
+
610
+ # form parameters
611
+ form_params = opts[:form_params] || {}
612
+
613
+ # http body (model)
614
+ post_body = opts[:debug_body]
615
+
616
+ # return_type
617
+ return_type = opts[:debug_return_type]
618
+
619
+ # auth_names
620
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
621
+
622
+ new_options = opts.merge(
623
+ :operation => :"PortfolioManagementApi.delete_model_portfolio_by_id",
624
+ :header_params => header_params,
625
+ :query_params => query_params,
626
+ :form_params => form_params,
627
+ :body => post_body,
628
+ :auth_names => auth_names,
629
+ :return_type => return_type
630
+ )
631
+
632
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
633
+ if @api_client.config.debugging
634
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#delete_model_portfolio_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
635
+ end
636
+ return data, status_code, headers, response
637
+ end
638
+
639
+
640
+ # Remove a target portfolio.
641
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to delete.
642
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
643
+ def delete_portfoli(portfolio_group_id:, extra: {})
644
+
645
+ data, _status_code, _headers = delete_portfoli_with_http_info_impl(portfolio_group_id, extra)
646
+ data
647
+ end
648
+
649
+ # Remove a target portfolio.
650
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to delete.
651
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
652
+ def delete_portfoli_with_http_info(portfolio_group_id:, extra: {})
653
+
654
+ delete_portfoli_with_http_info_impl(portfolio_group_id, extra)
655
+ end
656
+
657
+ # Remove a target portfolio.
658
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to delete.
659
+ # @param [Hash] opts the optional parameters
660
+ # @return [PortfolioGroup]
661
+ def delete_portfoli_impl(portfolio_group_id, opts = {})
662
+ data, _status_code, _headers = delete_portfoli_with_http_info(portfolio_group_id, opts)
663
+ data
664
+ end
665
+
666
+ # Remove a target portfolio.
667
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to delete.
668
+ # @param [Hash] opts the optional parameters
669
+ # @return [Array<(PortfolioGroup, Integer, Hash)>] PortfolioGroup data, response status code and response headers
670
+ def delete_portfoli_with_http_info_impl(portfolio_group_id, opts = {})
671
+ if @api_client.config.debugging
672
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.delete_portfoli ...'
673
+ end
674
+ # verify the required parameter 'portfolio_group_id' is set
675
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
676
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.delete_portfoli"
677
+ end
678
+ # resource path
679
+ local_var_path = '/portfolioGroups/{portfolioGroupId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
680
+
681
+ # query parameters
682
+ query_params = opts[:query_params] || {}
683
+
684
+ # header parameters
685
+ header_params = opts[:header_params] || {}
686
+ # HTTP header 'Accept' (if needed)
687
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
688
+
689
+ # form parameters
690
+ form_params = opts[:form_params] || {}
691
+
692
+ # http body (model)
693
+ post_body = opts[:debug_body]
694
+
695
+ # return_type
696
+ return_type = opts[:debug_return_type] || 'PortfolioGroup'
697
+
698
+ # auth_names
699
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
700
+
701
+ new_options = opts.merge(
702
+ :operation => :"PortfolioManagementApi.delete_portfoli",
703
+ :header_params => header_params,
704
+ :query_params => query_params,
705
+ :form_params => form_params,
706
+ :body => post_body,
707
+ :auth_names => auth_names,
708
+ :return_type => return_type
709
+ )
710
+
711
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
712
+ if @api_client.config.debugging
713
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#delete_portfoli\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
714
+ end
715
+ return data, status_code, headers, response
716
+ end
717
+
718
+
719
+ # Remove a TargetAsset.
720
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to remove the target asset.
721
+ # @param target_asset_id [String] The ID of the TargetAsset to delete.
722
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
723
+ def delete_portfolio_target_by_id(portfolio_group_id:, target_asset_id:, extra: {})
724
+
725
+ data, _status_code, _headers = delete_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, extra)
726
+ data
727
+ end
728
+
729
+ # Remove a TargetAsset.
730
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to remove the target asset.
731
+ # @param target_asset_id [String] The ID of the TargetAsset to delete.
732
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
733
+ def delete_portfolio_target_by_id_with_http_info(portfolio_group_id:, target_asset_id:, extra: {})
734
+
735
+ delete_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, extra)
736
+ end
737
+
738
+ # Remove a TargetAsset.
739
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to remove the target asset.
740
+ # @param target_asset_id [String] The ID of the TargetAsset to delete.
741
+ # @param [Hash] opts the optional parameters
742
+ # @return [TargetAsset]
743
+ def delete_portfolio_target_by_id_impl(portfolio_group_id, target_asset_id, opts = {})
744
+ data, _status_code, _headers = delete_portfolio_target_by_id_with_http_info(portfolio_group_id, target_asset_id, opts)
745
+ data
746
+ end
747
+
748
+ # Remove a TargetAsset.
749
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to remove the target asset.
750
+ # @param target_asset_id [String] The ID of the TargetAsset to delete.
751
+ # @param [Hash] opts the optional parameters
752
+ # @return [Array<(TargetAsset, Integer, Hash)>] TargetAsset data, response status code and response headers
753
+ def delete_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, opts = {})
754
+ if @api_client.config.debugging
755
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.delete_portfolio_target_by_id ...'
756
+ end
757
+ # verify the required parameter 'portfolio_group_id' is set
758
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
759
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.delete_portfolio_target_by_id"
760
+ end
761
+ # verify the required parameter 'target_asset_id' is set
762
+ if @api_client.config.client_side_validation && target_asset_id.nil?
763
+ fail ArgumentError, "Missing the required parameter 'target_asset_id' when calling PortfolioManagementApi.delete_portfolio_target_by_id"
764
+ end
765
+ # resource path
766
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'targetAssetId' + '}', CGI.escape(target_asset_id.to_s))
767
+
768
+ # query parameters
769
+ query_params = opts[:query_params] || {}
770
+
771
+ # header parameters
772
+ header_params = opts[:header_params] || {}
773
+ # HTTP header 'Accept' (if needed)
774
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
775
+
776
+ # form parameters
777
+ form_params = opts[:form_params] || {}
778
+
779
+ # http body (model)
780
+ post_body = opts[:debug_body]
781
+
782
+ # return_type
783
+ return_type = opts[:debug_return_type] || 'TargetAsset'
784
+
785
+ # auth_names
786
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
787
+
788
+ new_options = opts.merge(
789
+ :operation => :"PortfolioManagementApi.delete_portfolio_target_by_id",
790
+ :header_params => header_params,
791
+ :query_params => query_params,
792
+ :form_params => form_params,
793
+ :body => post_body,
794
+ :auth_names => auth_names,
795
+ :return_type => return_type
796
+ )
797
+
798
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
799
+ if @api_client.config.debugging
800
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#delete_portfolio_target_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
801
+ end
802
+ return data, status_code, headers, response
803
+ end
804
+
805
+
806
+ # Get details of a model asset class
807
+ # @param model_asset_class_id [String] The ID of the model asset class to get.
808
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
809
+ def detail_asset_class(model_asset_class_id:, extra: {})
810
+
811
+ data, _status_code, _headers = detail_asset_class_with_http_info_impl(model_asset_class_id, extra)
812
+ data
813
+ end
814
+
815
+ # Get details of a model asset class
816
+ # @param model_asset_class_id [String] The ID of the model asset class to get.
817
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
818
+ def detail_asset_class_with_http_info(model_asset_class_id:, extra: {})
819
+
820
+ detail_asset_class_with_http_info_impl(model_asset_class_id, extra)
821
+ end
822
+
823
+ # Get details of a model asset class
824
+ # @param model_asset_class_id [String] The ID of the model asset class to get.
825
+ # @param [Hash] opts the optional parameters
826
+ # @return [ModelAssetClassDetails]
827
+ def detail_asset_class_impl(model_asset_class_id, opts = {})
828
+ data, _status_code, _headers = detail_asset_class_with_http_info(model_asset_class_id, opts)
829
+ data
830
+ end
831
+
832
+ # Get details of a model asset class
833
+ # @param model_asset_class_id [String] The ID of the model asset class to get.
834
+ # @param [Hash] opts the optional parameters
835
+ # @return [Array<(ModelAssetClassDetails, Integer, Hash)>] ModelAssetClassDetails data, response status code and response headers
836
+ def detail_asset_class_with_http_info_impl(model_asset_class_id, opts = {})
837
+ if @api_client.config.debugging
838
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.detail_asset_class ...'
839
+ end
840
+ # verify the required parameter 'model_asset_class_id' is set
841
+ if @api_client.config.client_side_validation && model_asset_class_id.nil?
842
+ fail ArgumentError, "Missing the required parameter 'model_asset_class_id' when calling PortfolioManagementApi.detail_asset_class"
843
+ end
844
+ # resource path
845
+ local_var_path = '/modelAssetClass/{modelAssetClassId}'.sub('{' + 'modelAssetClassId' + '}', CGI.escape(model_asset_class_id.to_s))
846
+
847
+ # query parameters
848
+ query_params = opts[:query_params] || {}
849
+
850
+ # header parameters
851
+ header_params = opts[:header_params] || {}
852
+ # HTTP header 'Accept' (if needed)
853
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
854
+
855
+ # form parameters
856
+ form_params = opts[:form_params] || {}
857
+
858
+ # http body (model)
859
+ post_body = opts[:debug_body]
860
+
861
+ # return_type
862
+ return_type = opts[:debug_return_type] || 'ModelAssetClassDetails'
863
+
864
+ # auth_names
865
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
866
+
867
+ new_options = opts.merge(
868
+ :operation => :"PortfolioManagementApi.detail_asset_class",
869
+ :header_params => header_params,
870
+ :query_params => query_params,
871
+ :form_params => form_params,
872
+ :body => post_body,
873
+ :auth_names => auth_names,
874
+ :return_type => return_type
875
+ )
876
+
877
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
878
+ if @api_client.config.debugging
879
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#detail_asset_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
880
+ end
881
+ return data, status_code, headers, response
882
+ end
883
+
884
+
885
+ # Return an individual trade
886
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
887
+ # @param calculated_trade_id [String] The ID of calculated trade to get account impact
888
+ # @param trade_id [String] The ID of trade object
889
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
890
+ def get_calculated_trade_by_id(portfolio_group_id:, calculated_trade_id:, trade_id:, extra: {})
891
+
892
+ data, _status_code, _headers = get_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
893
+ data
894
+ end
895
+
896
+ # Return an individual trade
897
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
898
+ # @param calculated_trade_id [String] The ID of calculated trade to get account impact
899
+ # @param trade_id [String] The ID of trade object
900
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
901
+ def get_calculated_trade_by_id_with_http_info(portfolio_group_id:, calculated_trade_id:, trade_id:, extra: {})
902
+
903
+ get_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, extra)
904
+ end
905
+
906
+ # Return an individual trade
907
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
908
+ # @param calculated_trade_id [String] The ID of calculated trade to get account impact
909
+ # @param trade_id [String] The ID of trade object
910
+ # @param [Hash] opts the optional parameters
911
+ # @return [Array<Trade>]
912
+ def get_calculated_trade_by_id_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
913
+ data, _status_code, _headers = get_calculated_trade_by_id_with_http_info(portfolio_group_id, calculated_trade_id, trade_id, opts)
914
+ data
915
+ end
916
+
917
+ # Return an individual trade
918
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
919
+ # @param calculated_trade_id [String] The ID of calculated trade to get account impact
920
+ # @param trade_id [String] The ID of trade object
921
+ # @param [Hash] opts the optional parameters
922
+ # @return [Array<(Array<Trade>, Integer, Hash)>] Array<Trade> data, response status code and response headers
923
+ def get_calculated_trade_by_id_with_http_info_impl(portfolio_group_id, calculated_trade_id, trade_id, opts = {})
924
+ if @api_client.config.debugging
925
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_calculated_trade_by_id ...'
926
+ end
927
+ # verify the required parameter 'portfolio_group_id' is set
928
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
929
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_calculated_trade_by_id"
930
+ end
931
+ # verify the required parameter 'calculated_trade_id' is set
932
+ if @api_client.config.client_side_validation && calculated_trade_id.nil?
933
+ fail ArgumentError, "Missing the required parameter 'calculated_trade_id' when calling PortfolioManagementApi.get_calculated_trade_by_id"
934
+ end
935
+ # verify the required parameter 'trade_id' is set
936
+ if @api_client.config.client_side_validation && trade_id.nil?
937
+ fail ArgumentError, "Missing the required parameter 'trade_id' when calling PortfolioManagementApi.get_calculated_trade_by_id"
938
+ end
939
+ # resource path
940
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'calculatedTradeId' + '}', CGI.escape(calculated_trade_id.to_s)).sub('{' + 'TradeId' + '}', CGI.escape(trade_id.to_s))
941
+
942
+ # query parameters
943
+ query_params = opts[:query_params] || {}
944
+
945
+ # header parameters
946
+ header_params = opts[:header_params] || {}
947
+ # HTTP header 'Accept' (if needed)
948
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
949
+
950
+ # form parameters
951
+ form_params = opts[:form_params] || {}
952
+
953
+ # http body (model)
954
+ post_body = opts[:debug_body]
955
+
956
+ # return_type
957
+ return_type = opts[:debug_return_type] || 'Array<Trade>'
958
+
959
+ # auth_names
960
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
961
+
962
+ new_options = opts.merge(
963
+ :operation => :"PortfolioManagementApi.get_calculated_trade_by_id",
964
+ :header_params => header_params,
965
+ :query_params => query_params,
966
+ :form_params => form_params,
967
+ :body => post_body,
968
+ :auth_names => auth_names,
969
+ :return_type => return_type
970
+ )
971
+
972
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
973
+ if @api_client.config.debugging
974
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_calculated_trade_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
975
+ end
976
+ return data, status_code, headers, response
977
+ end
978
+
979
+
980
+ # Get details of a model portfolio
981
+ # @param model_portfolio_id [String] The ID of the model portfolio to get.
982
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
983
+ def get_model_details_by_id(model_portfolio_id:, extra: {})
984
+
985
+ data, _status_code, _headers = get_model_details_by_id_with_http_info_impl(model_portfolio_id, extra)
986
+ data
987
+ end
988
+
989
+ # Get details of a model portfolio
990
+ # @param model_portfolio_id [String] The ID of the model portfolio to get.
991
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
992
+ def get_model_details_by_id_with_http_info(model_portfolio_id:, extra: {})
993
+
994
+ get_model_details_by_id_with_http_info_impl(model_portfolio_id, extra)
995
+ end
996
+
997
+ # Get details of a model portfolio
998
+ # @param model_portfolio_id [String] The ID of the model portfolio to get.
999
+ # @param [Hash] opts the optional parameters
1000
+ # @return [ModelPortfolioDetails]
1001
+ def get_model_details_by_id_impl(model_portfolio_id, opts = {})
1002
+ data, _status_code, _headers = get_model_details_by_id_with_http_info(model_portfolio_id, opts)
1003
+ data
1004
+ end
1005
+
1006
+ # Get details of a model portfolio
1007
+ # @param model_portfolio_id [String] The ID of the model portfolio to get.
1008
+ # @param [Hash] opts the optional parameters
1009
+ # @return [Array<(ModelPortfolioDetails, Integer, Hash)>] ModelPortfolioDetails data, response status code and response headers
1010
+ def get_model_details_by_id_with_http_info_impl(model_portfolio_id, opts = {})
1011
+ if @api_client.config.debugging
1012
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_model_details_by_id ...'
1013
+ end
1014
+ # verify the required parameter 'model_portfolio_id' is set
1015
+ if @api_client.config.client_side_validation && model_portfolio_id.nil?
1016
+ fail ArgumentError, "Missing the required parameter 'model_portfolio_id' when calling PortfolioManagementApi.get_model_details_by_id"
1017
+ end
1018
+ # resource path
1019
+ local_var_path = '/modelPortfolio/{modelPortfolioId}'.sub('{' + 'modelPortfolioId' + '}', CGI.escape(model_portfolio_id.to_s))
1020
+
1021
+ # query parameters
1022
+ query_params = opts[:query_params] || {}
1023
+
1024
+ # header parameters
1025
+ header_params = opts[:header_params] || {}
1026
+ # HTTP header 'Accept' (if needed)
1027
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1028
+
1029
+ # form parameters
1030
+ form_params = opts[:form_params] || {}
1031
+
1032
+ # http body (model)
1033
+ post_body = opts[:debug_body]
1034
+
1035
+ # return_type
1036
+ return_type = opts[:debug_return_type] || 'ModelPortfolioDetails'
1037
+
1038
+ # auth_names
1039
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1040
+
1041
+ new_options = opts.merge(
1042
+ :operation => :"PortfolioManagementApi.get_model_details_by_id",
1043
+ :header_params => header_params,
1044
+ :query_params => query_params,
1045
+ :form_params => form_params,
1046
+ :body => post_body,
1047
+ :auth_names => auth_names,
1048
+ :return_type => return_type
1049
+ )
1050
+
1051
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1052
+ if @api_client.config.debugging
1053
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_model_details_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1054
+ end
1055
+ return data, status_code, headers, response
1056
+ end
1057
+
1058
+
1059
+ # Get sum of cash balances in portfolio group
1060
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1061
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1062
+ def get_portfolio_balances(portfolio_group_id:, extra: {})
1063
+
1064
+ data, _status_code, _headers = get_portfolio_balances_with_http_info_impl(portfolio_group_id, extra)
1065
+ data
1066
+ end
1067
+
1068
+ # Get sum of cash balances in portfolio group
1069
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1070
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1071
+ def get_portfolio_balances_with_http_info(portfolio_group_id:, extra: {})
1072
+
1073
+ get_portfolio_balances_with_http_info_impl(portfolio_group_id, extra)
1074
+ end
1075
+
1076
+ # Get sum of cash balances in portfolio group
1077
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1078
+ # @param [Hash] opts the optional parameters
1079
+ # @return [Array<Balance>]
1080
+ def get_portfolio_balances_impl(portfolio_group_id, opts = {})
1081
+ data, _status_code, _headers = get_portfolio_balances_with_http_info(portfolio_group_id, opts)
1082
+ data
1083
+ end
1084
+
1085
+ # Get sum of cash balances in portfolio group
1086
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1087
+ # @param [Hash] opts the optional parameters
1088
+ # @return [Array<(Array<Balance>, Integer, Hash)>] Array<Balance> data, response status code and response headers
1089
+ def get_portfolio_balances_with_http_info_impl(portfolio_group_id, opts = {})
1090
+ if @api_client.config.debugging
1091
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_balances ...'
1092
+ end
1093
+ # verify the required parameter 'portfolio_group_id' is set
1094
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1095
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_balances"
1096
+ end
1097
+ # resource path
1098
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/balances'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1099
+
1100
+ # query parameters
1101
+ query_params = opts[:query_params] || {}
1102
+
1103
+ # header parameters
1104
+ header_params = opts[:header_params] || {}
1105
+ # HTTP header 'Accept' (if needed)
1106
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1107
+
1108
+ # form parameters
1109
+ form_params = opts[:form_params] || {}
1110
+
1111
+ # http body (model)
1112
+ post_body = opts[:debug_body]
1113
+
1114
+ # return_type
1115
+ return_type = opts[:debug_return_type] || 'Array<Balance>'
1116
+
1117
+ # auth_names
1118
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1119
+
1120
+ new_options = opts.merge(
1121
+ :operation => :"PortfolioManagementApi.get_portfolio_balances",
1122
+ :header_params => header_params,
1123
+ :query_params => query_params,
1124
+ :form_params => form_params,
1125
+ :body => post_body,
1126
+ :auth_names => auth_names,
1127
+ :return_type => return_type
1128
+ )
1129
+
1130
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1131
+ if @api_client.config.debugging
1132
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1133
+ end
1134
+ return data, status_code, headers, response
1135
+ end
1136
+
1137
+
1138
+ # Get details of a target portfolio
1139
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to get.
1140
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1141
+ def get_portfolio_details_by_id(portfolio_group_id:, extra: {})
1142
+
1143
+ data, _status_code, _headers = get_portfolio_details_by_id_with_http_info_impl(portfolio_group_id, extra)
1144
+ data
1145
+ end
1146
+
1147
+ # Get details of a target portfolio
1148
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to get.
1149
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1150
+ def get_portfolio_details_by_id_with_http_info(portfolio_group_id:, extra: {})
1151
+
1152
+ get_portfolio_details_by_id_with_http_info_impl(portfolio_group_id, extra)
1153
+ end
1154
+
1155
+ # Get details of a target portfolio
1156
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to get.
1157
+ # @param [Hash] opts the optional parameters
1158
+ # @return [PortfolioGroup]
1159
+ def get_portfolio_details_by_id_impl(portfolio_group_id, opts = {})
1160
+ data, _status_code, _headers = get_portfolio_details_by_id_with_http_info(portfolio_group_id, opts)
1161
+ data
1162
+ end
1163
+
1164
+ # Get details of a target portfolio
1165
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to get.
1166
+ # @param [Hash] opts the optional parameters
1167
+ # @return [Array<(PortfolioGroup, Integer, Hash)>] PortfolioGroup data, response status code and response headers
1168
+ def get_portfolio_details_by_id_with_http_info_impl(portfolio_group_id, opts = {})
1169
+ if @api_client.config.debugging
1170
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_details_by_id ...'
1171
+ end
1172
+ # verify the required parameter 'portfolio_group_id' is set
1173
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1174
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_details_by_id"
1175
+ end
1176
+ # resource path
1177
+ local_var_path = '/portfolioGroups/{portfolioGroupId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1178
+
1179
+ # query parameters
1180
+ query_params = opts[:query_params] || {}
1181
+
1182
+ # header parameters
1183
+ header_params = opts[:header_params] || {}
1184
+ # HTTP header 'Accept' (if needed)
1185
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
1186
+
1187
+ # form parameters
1188
+ form_params = opts[:form_params] || {}
1189
+
1190
+ # http body (model)
1191
+ post_body = opts[:debug_body]
1192
+
1193
+ # return_type
1194
+ return_type = opts[:debug_return_type] || 'PortfolioGroup'
1195
+
1196
+ # auth_names
1197
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1198
+
1199
+ new_options = opts.merge(
1200
+ :operation => :"PortfolioManagementApi.get_portfolio_details_by_id",
1201
+ :header_params => header_params,
1202
+ :query_params => query_params,
1203
+ :form_params => form_params,
1204
+ :body => post_body,
1205
+ :auth_names => auth_names,
1206
+ :return_type => return_type
1207
+ )
1208
+
1209
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1210
+ if @api_client.config.debugging
1211
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_details_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1212
+ end
1213
+ return data, status_code, headers, response
1214
+ end
1215
+
1216
+
1217
+ # Return a whole bunch of relevant information relating to a portfolio group.
1218
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1219
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1220
+ def get_portfolio_info(portfolio_group_id:, extra: {})
1221
+
1222
+ data, _status_code, _headers = get_portfolio_info_with_http_info_impl(portfolio_group_id, extra)
1223
+ data
1224
+ end
1225
+
1226
+ # Return a whole bunch of relevant information relating to a portfolio group.
1227
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1228
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1229
+ def get_portfolio_info_with_http_info(portfolio_group_id:, extra: {})
1230
+
1231
+ get_portfolio_info_with_http_info_impl(portfolio_group_id, extra)
1232
+ end
1233
+
1234
+ # Return a whole bunch of relevant information relating to a portfolio group.
1235
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1236
+ # @param [Hash] opts the optional parameters
1237
+ # @return [PortfolioGroupInfo]
1238
+ def get_portfolio_info_impl(portfolio_group_id, opts = {})
1239
+ data, _status_code, _headers = get_portfolio_info_with_http_info(portfolio_group_id, opts)
1240
+ data
1241
+ end
1242
+
1243
+ # Return a whole bunch of relevant information relating to a portfolio group.
1244
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1245
+ # @param [Hash] opts the optional parameters
1246
+ # @return [Array<(PortfolioGroupInfo, Integer, Hash)>] PortfolioGroupInfo data, response status code and response headers
1247
+ def get_portfolio_info_with_http_info_impl(portfolio_group_id, opts = {})
1248
+ if @api_client.config.debugging
1249
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_info ...'
1250
+ end
1251
+ # verify the required parameter 'portfolio_group_id' is set
1252
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1253
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_info"
1254
+ end
1255
+ # resource path
1256
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/info'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1257
+
1258
+ # query parameters
1259
+ query_params = opts[:query_params] || {}
1260
+
1261
+ # header parameters
1262
+ header_params = opts[:header_params] || {}
1263
+ # HTTP header 'Accept' (if needed)
1264
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1265
+
1266
+ # form parameters
1267
+ form_params = opts[:form_params] || {}
1268
+
1269
+ # http body (model)
1270
+ post_body = opts[:debug_body]
1271
+
1272
+ # return_type
1273
+ return_type = opts[:debug_return_type] || 'PortfolioGroupInfo'
1274
+
1275
+ # auth_names
1276
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1277
+
1278
+ new_options = opts.merge(
1279
+ :operation => :"PortfolioManagementApi.get_portfolio_info",
1280
+ :header_params => header_params,
1281
+ :query_params => query_params,
1282
+ :form_params => form_params,
1283
+ :body => post_body,
1284
+ :auth_names => auth_names,
1285
+ :return_type => return_type
1286
+ )
1287
+
1288
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1289
+ if @api_client.config.debugging
1290
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1291
+ end
1292
+ return data, status_code, headers, response
1293
+ end
1294
+
1295
+
1296
+ # Get portfolio group settings
1297
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the settings.
1298
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1299
+ def get_portfolio_settings(portfolio_group_id:, extra: {})
1300
+
1301
+ data, _status_code, _headers = get_portfolio_settings_with_http_info_impl(portfolio_group_id, extra)
1302
+ data
1303
+ end
1304
+
1305
+ # Get portfolio group settings
1306
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the settings.
1307
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1308
+ def get_portfolio_settings_with_http_info(portfolio_group_id:, extra: {})
1309
+
1310
+ get_portfolio_settings_with_http_info_impl(portfolio_group_id, extra)
1311
+ end
1312
+
1313
+ # Get portfolio group settings
1314
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the settings.
1315
+ # @param [Hash] opts the optional parameters
1316
+ # @return [PortfolioGroupSettings]
1317
+ def get_portfolio_settings_impl(portfolio_group_id, opts = {})
1318
+ data, _status_code, _headers = get_portfolio_settings_with_http_info(portfolio_group_id, opts)
1319
+ data
1320
+ end
1321
+
1322
+ # Get portfolio group settings
1323
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the settings.
1324
+ # @param [Hash] opts the optional parameters
1325
+ # @return [Array<(PortfolioGroupSettings, Integer, Hash)>] PortfolioGroupSettings data, response status code and response headers
1326
+ def get_portfolio_settings_with_http_info_impl(portfolio_group_id, opts = {})
1327
+ if @api_client.config.debugging
1328
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_settings ...'
1329
+ end
1330
+ # verify the required parameter 'portfolio_group_id' is set
1331
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1332
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_settings"
1333
+ end
1334
+ # resource path
1335
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/settings'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1336
+
1337
+ # query parameters
1338
+ query_params = opts[:query_params] || {}
1339
+
1340
+ # header parameters
1341
+ header_params = opts[:header_params] || {}
1342
+ # HTTP header 'Accept' (if needed)
1343
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1344
+
1345
+ # form parameters
1346
+ form_params = opts[:form_params] || {}
1347
+
1348
+ # http body (model)
1349
+ post_body = opts[:debug_body]
1350
+
1351
+ # return_type
1352
+ return_type = opts[:debug_return_type] || 'PortfolioGroupSettings'
1353
+
1354
+ # auth_names
1355
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1356
+
1357
+ new_options = opts.merge(
1358
+ :operation => :"PortfolioManagementApi.get_portfolio_settings",
1359
+ :header_params => header_params,
1360
+ :query_params => query_params,
1361
+ :form_params => form_params,
1362
+ :body => post_body,
1363
+ :auth_names => auth_names,
1364
+ :return_type => return_type
1365
+ )
1366
+
1367
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1368
+ if @api_client.config.debugging
1369
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1370
+ end
1371
+ return data, status_code, headers, response
1372
+ end
1373
+
1374
+
1375
+ # Get a specific target from a portfolio group
1376
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the target asset.
1377
+ # @param target_asset_id [String] The ID of the TargetAsset to get.
1378
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1379
+ def get_portfolio_target_by_id(portfolio_group_id:, target_asset_id:, extra: {})
1380
+
1381
+ data, _status_code, _headers = get_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, extra)
1382
+ data
1383
+ end
1384
+
1385
+ # Get a specific target from a portfolio group
1386
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the target asset.
1387
+ # @param target_asset_id [String] The ID of the TargetAsset to get.
1388
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1389
+ def get_portfolio_target_by_id_with_http_info(portfolio_group_id:, target_asset_id:, extra: {})
1390
+
1391
+ get_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, extra)
1392
+ end
1393
+
1394
+ # Get a specific target from a portfolio group
1395
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the target asset.
1396
+ # @param target_asset_id [String] The ID of the TargetAsset to get.
1397
+ # @param [Hash] opts the optional parameters
1398
+ # @return [TargetAsset]
1399
+ def get_portfolio_target_by_id_impl(portfolio_group_id, target_asset_id, opts = {})
1400
+ data, _status_code, _headers = get_portfolio_target_by_id_with_http_info(portfolio_group_id, target_asset_id, opts)
1401
+ data
1402
+ end
1403
+
1404
+ # Get a specific target from a portfolio group
1405
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to get the target asset.
1406
+ # @param target_asset_id [String] The ID of the TargetAsset to get.
1407
+ # @param [Hash] opts the optional parameters
1408
+ # @return [Array<(TargetAsset, Integer, Hash)>] TargetAsset data, response status code and response headers
1409
+ def get_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, opts = {})
1410
+ if @api_client.config.debugging
1411
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_target_by_id ...'
1412
+ end
1413
+ # verify the required parameter 'portfolio_group_id' is set
1414
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1415
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_target_by_id"
1416
+ end
1417
+ # verify the required parameter 'target_asset_id' is set
1418
+ if @api_client.config.client_side_validation && target_asset_id.nil?
1419
+ fail ArgumentError, "Missing the required parameter 'target_asset_id' when calling PortfolioManagementApi.get_portfolio_target_by_id"
1420
+ end
1421
+ # resource path
1422
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'targetAssetId' + '}', CGI.escape(target_asset_id.to_s))
1423
+
1424
+ # query parameters
1425
+ query_params = opts[:query_params] || {}
1426
+
1427
+ # header parameters
1428
+ header_params = opts[:header_params] || {}
1429
+ # HTTP header 'Accept' (if needed)
1430
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
1431
+
1432
+ # form parameters
1433
+ form_params = opts[:form_params] || {}
1434
+
1435
+ # http body (model)
1436
+ post_body = opts[:debug_body]
1437
+
1438
+ # return_type
1439
+ return_type = opts[:debug_return_type] || 'TargetAsset'
1440
+
1441
+ # auth_names
1442
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1443
+
1444
+ new_options = opts.merge(
1445
+ :operation => :"PortfolioManagementApi.get_portfolio_target_by_id",
1446
+ :header_params => header_params,
1447
+ :query_params => query_params,
1448
+ :form_params => form_params,
1449
+ :body => post_body,
1450
+ :auth_names => auth_names,
1451
+ :return_type => return_type
1452
+ )
1453
+
1454
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1455
+ if @api_client.config.debugging
1456
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_target_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1457
+ end
1458
+ return data, status_code, headers, response
1459
+ end
1460
+
1461
+
1462
+ # Get all target assets under the specified PortfolioGroup.
1463
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1464
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1465
+ def get_portfolio_targets(portfolio_group_id:, extra: {})
1466
+
1467
+ data, _status_code, _headers = get_portfolio_targets_with_http_info_impl(portfolio_group_id, extra)
1468
+ data
1469
+ end
1470
+
1471
+ # Get all target assets under the specified PortfolioGroup.
1472
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1473
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1474
+ def get_portfolio_targets_with_http_info(portfolio_group_id:, extra: {})
1475
+
1476
+ get_portfolio_targets_with_http_info_impl(portfolio_group_id, extra)
1477
+ end
1478
+
1479
+ # Get all target assets under the specified PortfolioGroup.
1480
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1481
+ # @param [Hash] opts the optional parameters
1482
+ # @return [Array<TargetAsset>]
1483
+ def get_portfolio_targets_impl(portfolio_group_id, opts = {})
1484
+ data, _status_code, _headers = get_portfolio_targets_with_http_info(portfolio_group_id, opts)
1485
+ data
1486
+ end
1487
+
1488
+ # Get all target assets under the specified PortfolioGroup.
1489
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1490
+ # @param [Hash] opts the optional parameters
1491
+ # @return [Array<(Array<TargetAsset>, Integer, Hash)>] Array<TargetAsset> data, response status code and response headers
1492
+ def get_portfolio_targets_with_http_info_impl(portfolio_group_id, opts = {})
1493
+ if @api_client.config.debugging
1494
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portfolio_targets ...'
1495
+ end
1496
+ # verify the required parameter 'portfolio_group_id' is set
1497
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1498
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portfolio_targets"
1499
+ end
1500
+ # resource path
1501
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/targets'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1502
+
1503
+ # query parameters
1504
+ query_params = opts[:query_params] || {}
1505
+
1506
+ # header parameters
1507
+ header_params = opts[:header_params] || {}
1508
+ # HTTP header 'Accept' (if needed)
1509
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1510
+
1511
+ # form parameters
1512
+ form_params = opts[:form_params] || {}
1513
+
1514
+ # http body (model)
1515
+ post_body = opts[:debug_body]
1516
+
1517
+ # return_type
1518
+ return_type = opts[:debug_return_type] || 'Array<TargetAsset>'
1519
+
1520
+ # auth_names
1521
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1522
+
1523
+ new_options = opts.merge(
1524
+ :operation => :"PortfolioManagementApi.get_portfolio_targets",
1525
+ :header_params => header_params,
1526
+ :query_params => query_params,
1527
+ :form_params => form_params,
1528
+ :body => post_body,
1529
+ :auth_names => auth_names,
1530
+ :return_type => return_type
1531
+ )
1532
+
1533
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1534
+ if @api_client.config.debugging
1535
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portfolio_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1536
+ end
1537
+ return data, status_code, headers, response
1538
+ end
1539
+
1540
+
1541
+ # Get an array of excluded assets associated with a portfolio group\\
1542
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the excluded assets are linked.
1543
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1544
+ def get_portoflio_excluded_assets(portfolio_group_id:, extra: {})
1545
+
1546
+ data, _status_code, _headers = get_portoflio_excluded_assets_with_http_info_impl(portfolio_group_id, extra)
1547
+ data
1548
+ end
1549
+
1550
+ # Get an array of excluded assets associated with a portfolio group\\
1551
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the excluded assets are linked.
1552
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1553
+ def get_portoflio_excluded_assets_with_http_info(portfolio_group_id:, extra: {})
1554
+
1555
+ get_portoflio_excluded_assets_with_http_info_impl(portfolio_group_id, extra)
1556
+ end
1557
+
1558
+ # Get an array of excluded assets associated with a portfolio group\\
1559
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the excluded assets are linked.
1560
+ # @param [Hash] opts the optional parameters
1561
+ # @return [Array<ExcludedAsset>]
1562
+ def get_portoflio_excluded_assets_impl(portfolio_group_id, opts = {})
1563
+ data, _status_code, _headers = get_portoflio_excluded_assets_with_http_info(portfolio_group_id, opts)
1564
+ data
1565
+ end
1566
+
1567
+ # Get an array of excluded assets associated with a portfolio group\\
1568
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the excluded assets are linked.
1569
+ # @param [Hash] opts the optional parameters
1570
+ # @return [Array<(Array<ExcludedAsset>, Integer, Hash)>] Array<ExcludedAsset> data, response status code and response headers
1571
+ def get_portoflio_excluded_assets_with_http_info_impl(portfolio_group_id, opts = {})
1572
+ if @api_client.config.debugging
1573
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.get_portoflio_excluded_assets ...'
1574
+ end
1575
+ # verify the required parameter 'portfolio_group_id' is set
1576
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1577
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.get_portoflio_excluded_assets"
1578
+ end
1579
+ # resource path
1580
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/excludedassets'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1581
+
1582
+ # query parameters
1583
+ query_params = opts[:query_params] || {}
1584
+
1585
+ # header parameters
1586
+ header_params = opts[:header_params] || {}
1587
+ # HTTP header 'Accept' (if needed)
1588
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1589
+
1590
+ # form parameters
1591
+ form_params = opts[:form_params] || {}
1592
+
1593
+ # http body (model)
1594
+ post_body = opts[:debug_body]
1595
+
1596
+ # return_type
1597
+ return_type = opts[:debug_return_type] || 'Array<ExcludedAsset>'
1598
+
1599
+ # auth_names
1600
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1601
+
1602
+ new_options = opts.merge(
1603
+ :operation => :"PortfolioManagementApi.get_portoflio_excluded_assets",
1604
+ :header_params => header_params,
1605
+ :query_params => query_params,
1606
+ :form_params => form_params,
1607
+ :body => post_body,
1608
+ :auth_names => auth_names,
1609
+ :return_type => return_type
1610
+ )
1611
+
1612
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1613
+ if @api_client.config.debugging
1614
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#get_portoflio_excluded_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1615
+ end
1616
+ return data, status_code, headers, response
1617
+ end
1618
+
1619
+
1620
+ # Import target allocation based on portfolio group
1621
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1622
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1623
+ def import_model_portfolio(portfolio_group_id:, extra: {})
1624
+
1625
+ data, _status_code, _headers = import_model_portfolio_with_http_info_impl(portfolio_group_id, extra)
1626
+ data
1627
+ end
1628
+
1629
+ # Import target allocation based on portfolio group
1630
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1631
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1632
+ def import_model_portfolio_with_http_info(portfolio_group_id:, extra: {})
1633
+
1634
+ import_model_portfolio_with_http_info_impl(portfolio_group_id, extra)
1635
+ end
1636
+
1637
+ # Import target allocation based on portfolio group
1638
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1639
+ # @param [Hash] opts the optional parameters
1640
+ # @return [Array<TargetAsset>]
1641
+ def import_model_portfolio_impl(portfolio_group_id, opts = {})
1642
+ data, _status_code, _headers = import_model_portfolio_with_http_info(portfolio_group_id, opts)
1643
+ data
1644
+ end
1645
+
1646
+ # Import target allocation based on portfolio group
1647
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
1648
+ # @param [Hash] opts the optional parameters
1649
+ # @return [Array<(Array<TargetAsset>, Integer, Hash)>] Array<TargetAsset> data, response status code and response headers
1650
+ def import_model_portfolio_with_http_info_impl(portfolio_group_id, opts = {})
1651
+ if @api_client.config.debugging
1652
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.import_model_portfolio ...'
1653
+ end
1654
+ # verify the required parameter 'portfolio_group_id' is set
1655
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1656
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.import_model_portfolio"
1657
+ end
1658
+ # resource path
1659
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/import'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1660
+
1661
+ # query parameters
1662
+ query_params = opts[:query_params] || {}
1663
+
1664
+ # header parameters
1665
+ header_params = opts[:header_params] || {}
1666
+ # HTTP header 'Accept' (if needed)
1667
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1668
+
1669
+ # form parameters
1670
+ form_params = opts[:form_params] || {}
1671
+
1672
+ # http body (model)
1673
+ post_body = opts[:debug_body]
1674
+
1675
+ # return_type
1676
+ return_type = opts[:debug_return_type] || 'Array<TargetAsset>'
1677
+
1678
+ # auth_names
1679
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1680
+
1681
+ new_options = opts.merge(
1682
+ :operation => :"PortfolioManagementApi.import_model_portfolio",
1683
+ :header_params => header_params,
1684
+ :query_params => query_params,
1685
+ :form_params => form_params,
1686
+ :body => post_body,
1687
+ :auth_names => auth_names,
1688
+ :return_type => return_type
1689
+ )
1690
+
1691
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
1692
+ if @api_client.config.debugging
1693
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#import_model_portfolio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1694
+ end
1695
+ return data, status_code, headers, response
1696
+ end
1697
+
1698
+
1699
+ # List all portfolio groups
1700
+ # @param user_id [String]
1701
+ # @param user_secret [String]
1702
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1703
+ def list(user_id:, user_secret:, extra: {})
1704
+
1705
+ data, _status_code, _headers = list_with_http_info_impl(user_id, user_secret, extra)
1706
+ data
1707
+ end
1708
+
1709
+ # List all portfolio groups
1710
+ # @param user_id [String]
1711
+ # @param user_secret [String]
1712
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1713
+ def list_with_http_info(user_id:, user_secret:, extra: {})
1714
+
1715
+ list_with_http_info_impl(user_id, user_secret, extra)
1716
+ end
1717
+
1718
+ # List all portfolio groups
1719
+ # @param user_id [String]
1720
+ # @param user_secret [String]
1721
+ # @param [Hash] opts the optional parameters
1722
+ # @return [Array<PortfolioGroup>]
1723
+ def list_impl(user_id, user_secret, opts = {})
1724
+ data, _status_code, _headers = list_with_http_info(user_id, user_secret, opts)
1725
+ data
1726
+ end
1727
+
1728
+ # List all portfolio groups
1729
+ # @param user_id [String]
1730
+ # @param user_secret [String]
1731
+ # @param [Hash] opts the optional parameters
1732
+ # @return [Array<(Array<PortfolioGroup>, Integer, Hash)>] Array<PortfolioGroup> data, response status code and response headers
1733
+ def list_with_http_info_impl(user_id, user_secret, opts = {})
1734
+ if @api_client.config.debugging
1735
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.list ...'
1736
+ end
1737
+ # verify the required parameter 'user_id' is set
1738
+ if @api_client.config.client_side_validation && user_id.nil?
1739
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling PortfolioManagementApi.list"
1740
+ end
1741
+ # verify the required parameter 'user_secret' is set
1742
+ if @api_client.config.client_side_validation && user_secret.nil?
1743
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling PortfolioManagementApi.list"
1744
+ end
1745
+ # resource path
1746
+ local_var_path = '/portfolioGroups'
1747
+
1748
+ # query parameters
1749
+ query_params = opts[:query_params] || {}
1750
+ query_params[:'userId'] = user_id
1751
+ query_params[:'userSecret'] = user_secret
1752
+
1753
+ # header parameters
1754
+ header_params = opts[:header_params] || {}
1755
+ # HTTP header 'Accept' (if needed)
1756
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1757
+
1758
+ # form parameters
1759
+ form_params = opts[:form_params] || {}
1760
+
1761
+ # http body (model)
1762
+ post_body = opts[:debug_body]
1763
+
1764
+ # return_type
1765
+ return_type = opts[:debug_return_type] || 'Array<PortfolioGroup>'
1766
+
1767
+ # auth_names
1768
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1769
+
1770
+ new_options = opts.merge(
1771
+ :operation => :"PortfolioManagementApi.list",
1772
+ :header_params => header_params,
1773
+ :query_params => query_params,
1774
+ :form_params => form_params,
1775
+ :body => post_body,
1776
+ :auth_names => auth_names,
1777
+ :return_type => return_type
1778
+ )
1779
+
1780
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1781
+ if @api_client.config.debugging
1782
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1783
+ end
1784
+ return data, status_code, headers, response
1785
+ end
1786
+
1787
+
1788
+ # List of model asset class
1789
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1790
+ def list_asset_classes(extra: {})
1791
+
1792
+ data, _status_code, _headers = list_asset_classes_with_http_info_impl(extra)
1793
+ data
1794
+ end
1795
+
1796
+ # List of model asset class
1797
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1798
+ def list_asset_classes_with_http_info(extra: {})
1799
+
1800
+ list_asset_classes_with_http_info_impl(extra)
1801
+ end
1802
+
1803
+ # List of model asset class
1804
+ # @param [Hash] opts the optional parameters
1805
+ # @return [Array<ModelAssetClassDetails>]
1806
+ def list_asset_classes_impl(opts = {})
1807
+ data, _status_code, _headers = list_asset_classes_with_http_info(opts)
1808
+ data
1809
+ end
1810
+
1811
+ # List of model asset class
1812
+ # @param [Hash] opts the optional parameters
1813
+ # @return [Array<(Array<ModelAssetClassDetails>, Integer, Hash)>] Array<ModelAssetClassDetails> data, response status code and response headers
1814
+ def list_asset_classes_with_http_info_impl(opts = {})
1815
+ if @api_client.config.debugging
1816
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.list_asset_classes ...'
1817
+ end
1818
+ # resource path
1819
+ local_var_path = '/modelAssetClass'
1820
+
1821
+ # query parameters
1822
+ query_params = opts[:query_params] || {}
1823
+
1824
+ # header parameters
1825
+ header_params = opts[:header_params] || {}
1826
+ # HTTP header 'Accept' (if needed)
1827
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1828
+
1829
+ # form parameters
1830
+ form_params = opts[:form_params] || {}
1831
+
1832
+ # http body (model)
1833
+ post_body = opts[:debug_body]
1834
+
1835
+ # return_type
1836
+ return_type = opts[:debug_return_type] || 'Array<ModelAssetClassDetails>'
1837
+
1838
+ # auth_names
1839
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1840
+
1841
+ new_options = opts.merge(
1842
+ :operation => :"PortfolioManagementApi.list_asset_classes",
1843
+ :header_params => header_params,
1844
+ :query_params => query_params,
1845
+ :form_params => form_params,
1846
+ :body => post_body,
1847
+ :auth_names => auth_names,
1848
+ :return_type => return_type
1849
+ )
1850
+
1851
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1852
+ if @api_client.config.debugging
1853
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#list_asset_classes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1854
+ end
1855
+ return data, status_code, headers, response
1856
+ end
1857
+
1858
+
1859
+ # List of trades to make to rebalance portfolio group
1860
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
1861
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1862
+ def list_calculated_trades(portfolio_group_id:, extra: {})
1863
+
1864
+ data, _status_code, _headers = list_calculated_trades_with_http_info_impl(portfolio_group_id, extra)
1865
+ data
1866
+ end
1867
+
1868
+ # List of trades to make to rebalance portfolio group
1869
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
1870
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1871
+ def list_calculated_trades_with_http_info(portfolio_group_id:, extra: {})
1872
+
1873
+ list_calculated_trades_with_http_info_impl(portfolio_group_id, extra)
1874
+ end
1875
+
1876
+ # List of trades to make to rebalance portfolio group
1877
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
1878
+ # @param [Hash] opts the optional parameters
1879
+ # @return [CalculatedTrade]
1880
+ def list_calculated_trades_impl(portfolio_group_id, opts = {})
1881
+ data, _status_code, _headers = list_calculated_trades_with_http_info(portfolio_group_id, opts)
1882
+ data
1883
+ end
1884
+
1885
+ # List of trades to make to rebalance portfolio group
1886
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to perform rebalancing calculations
1887
+ # @param [Hash] opts the optional parameters
1888
+ # @return [Array<(CalculatedTrade, Integer, Hash)>] CalculatedTrade data, response status code and response headers
1889
+ def list_calculated_trades_with_http_info_impl(portfolio_group_id, opts = {})
1890
+ if @api_client.config.debugging
1891
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.list_calculated_trades ...'
1892
+ end
1893
+ # verify the required parameter 'portfolio_group_id' is set
1894
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
1895
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.list_calculated_trades"
1896
+ end
1897
+ # resource path
1898
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/calculatedtrades'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
1899
+
1900
+ # query parameters
1901
+ query_params = opts[:query_params] || {}
1902
+
1903
+ # header parameters
1904
+ header_params = opts[:header_params] || {}
1905
+ # HTTP header 'Accept' (if needed)
1906
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1907
+
1908
+ # form parameters
1909
+ form_params = opts[:form_params] || {}
1910
+
1911
+ # http body (model)
1912
+ post_body = opts[:debug_body]
1913
+
1914
+ # return_type
1915
+ return_type = opts[:debug_return_type] || 'CalculatedTrade'
1916
+
1917
+ # auth_names
1918
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1919
+
1920
+ new_options = opts.merge(
1921
+ :operation => :"PortfolioManagementApi.list_calculated_trades",
1922
+ :header_params => header_params,
1923
+ :query_params => query_params,
1924
+ :form_params => form_params,
1925
+ :body => post_body,
1926
+ :auth_names => auth_names,
1927
+ :return_type => return_type
1928
+ )
1929
+
1930
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1931
+ if @api_client.config.debugging
1932
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#list_calculated_trades\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1933
+ end
1934
+ return data, status_code, headers, response
1935
+ end
1936
+
1937
+
1938
+ # List of model portfolio
1939
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1940
+ def list_model_portfolio(extra: {})
1941
+
1942
+ data, _status_code, _headers = list_model_portfolio_with_http_info_impl(extra)
1943
+ data
1944
+ end
1945
+
1946
+ # List of model portfolio
1947
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1948
+ def list_model_portfolio_with_http_info(extra: {})
1949
+
1950
+ list_model_portfolio_with_http_info_impl(extra)
1951
+ end
1952
+
1953
+ # List of model portfolio
1954
+ # @param [Hash] opts the optional parameters
1955
+ # @return [Array<ModelPortfolioDetails>]
1956
+ def list_model_portfolio_impl(opts = {})
1957
+ data, _status_code, _headers = list_model_portfolio_with_http_info(opts)
1958
+ data
1959
+ end
1960
+
1961
+ # List of model portfolio
1962
+ # @param [Hash] opts the optional parameters
1963
+ # @return [Array<(Array<ModelPortfolioDetails>, Integer, Hash)>] Array<ModelPortfolioDetails> data, response status code and response headers
1964
+ def list_model_portfolio_with_http_info_impl(opts = {})
1965
+ if @api_client.config.debugging
1966
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.list_model_portfolio ...'
1967
+ end
1968
+ # resource path
1969
+ local_var_path = '/modelPortfolio'
1970
+
1971
+ # query parameters
1972
+ query_params = opts[:query_params] || {}
1973
+
1974
+ # header parameters
1975
+ header_params = opts[:header_params] || {}
1976
+ # HTTP header 'Accept' (if needed)
1977
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1978
+
1979
+ # form parameters
1980
+ form_params = opts[:form_params] || {}
1981
+
1982
+ # http body (model)
1983
+ post_body = opts[:debug_body]
1984
+
1985
+ # return_type
1986
+ return_type = opts[:debug_return_type] || 'Array<ModelPortfolioDetails>'
1987
+
1988
+ # auth_names
1989
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
1990
+
1991
+ new_options = opts.merge(
1992
+ :operation => :"PortfolioManagementApi.list_model_portfolio",
1993
+ :header_params => header_params,
1994
+ :query_params => query_params,
1995
+ :form_params => form_params,
1996
+ :body => post_body,
1997
+ :auth_names => auth_names,
1998
+ :return_type => return_type
1999
+ )
2000
+
2001
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
2002
+ if @api_client.config.debugging
2003
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#list_model_portfolio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2004
+ end
2005
+ return data, status_code, headers, response
2006
+ end
2007
+
2008
+
2009
+ # Get all accounts associated with a portfolio group
2010
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the accounts are linked.
2011
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2012
+ def list_portfolio_accounts(portfolio_group_id:, extra: {})
2013
+
2014
+ data, _status_code, _headers = list_portfolio_accounts_with_http_info_impl(portfolio_group_id, extra)
2015
+ data
2016
+ end
2017
+
2018
+ # Get all accounts associated with a portfolio group
2019
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the accounts are linked.
2020
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2021
+ def list_portfolio_accounts_with_http_info(portfolio_group_id:, extra: {})
2022
+
2023
+ list_portfolio_accounts_with_http_info_impl(portfolio_group_id, extra)
2024
+ end
2025
+
2026
+ # Get all accounts associated with a portfolio group
2027
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the accounts are linked.
2028
+ # @param [Hash] opts the optional parameters
2029
+ # @return [Array<Account>]
2030
+ def list_portfolio_accounts_impl(portfolio_group_id, opts = {})
2031
+ data, _status_code, _headers = list_portfolio_accounts_with_http_info(portfolio_group_id, opts)
2032
+ data
2033
+ end
2034
+
2035
+ # Get all accounts associated with a portfolio group
2036
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which the accounts are linked.
2037
+ # @param [Hash] opts the optional parameters
2038
+ # @return [Array<(Array<Account>, Integer, Hash)>] Array<Account> data, response status code and response headers
2039
+ def list_portfolio_accounts_with_http_info_impl(portfolio_group_id, opts = {})
2040
+ if @api_client.config.debugging
2041
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.list_portfolio_accounts ...'
2042
+ end
2043
+ # verify the required parameter 'portfolio_group_id' is set
2044
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2045
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.list_portfolio_accounts"
2046
+ end
2047
+ # resource path
2048
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/accounts'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
2049
+
2050
+ # query parameters
2051
+ query_params = opts[:query_params] || {}
2052
+
2053
+ # header parameters
2054
+ header_params = opts[:header_params] || {}
2055
+ # HTTP header 'Accept' (if needed)
2056
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2057
+
2058
+ # form parameters
2059
+ form_params = opts[:form_params] || {}
2060
+
2061
+ # http body (model)
2062
+ post_body = opts[:debug_body]
2063
+
2064
+ # return_type
2065
+ return_type = opts[:debug_return_type] || 'Array<Account>'
2066
+
2067
+ # auth_names
2068
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2069
+
2070
+ new_options = opts.merge(
2071
+ :operation => :"PortfolioManagementApi.list_portfolio_accounts",
2072
+ :header_params => header_params,
2073
+ :query_params => query_params,
2074
+ :form_params => form_params,
2075
+ :body => post_body,
2076
+ :auth_names => auth_names,
2077
+ :return_type => return_type
2078
+ )
2079
+
2080
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
2081
+ if @api_client.config.debugging
2082
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#list_portfolio_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2083
+ end
2084
+ return data, status_code, headers, response
2085
+ end
2086
+
2087
+
2088
+ # Updates model portfolio object
2089
+ # @param model_portfolio_id [String] The ID of the model portfolio to update.
2090
+ # @param model_portfolio [ModelPortfolio]
2091
+ # @param model_portfolio_security [Array<ModelPortfolioSecurity>]
2092
+ # @param model_portfolio_asset_class [Array<ModelPortfolioAssetClass>]
2093
+ # @param body [ModelPortfolioDetails] Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. &lt;br /&gt;&lt;br /&gt; * The model portfolio name and model portfolio model type is required. &lt;br /&gt; * The model portfolio model type must be either 0 or 1. [0 -&gt; Securities based, 1 -&gt; Asset Class based] &lt;br /&gt;&lt;br /&gt; * If the model portfolio type is 0, the model portfolio asset class must be an empty array. &lt;br /&gt; * If the model portfolio type is 1, the model portfolio security must be an empty array. &lt;br /&gt;&lt;br /&gt; * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object &lt;br /&gt; * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object &lt;br /&gt;&lt;br /&gt; * To remove all model portfolio securities or model portfolio asset class, set then to an empty array
2094
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2095
+ def modify_model_portfolio_by_id(model_portfolio_id:, model_portfolio: SENTINEL, model_portfolio_security: SENTINEL, model_portfolio_asset_class: SENTINEL, extra: {})
2096
+ _body = {}
2097
+ _body[:model_portfolio] = model_portfolio if model_portfolio != SENTINEL
2098
+ _body[:model_portfolio_security] = model_portfolio_security if model_portfolio_security != SENTINEL
2099
+ _body[:model_portfolio_asset_class] = model_portfolio_asset_class if model_portfolio_asset_class != SENTINEL
2100
+ model_portfolio_details = _body
2101
+
2102
+ modify_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, model_portfolio_details, extra)
2103
+ nil
2104
+ end
2105
+
2106
+ # Updates model portfolio object
2107
+ # @param model_portfolio_id [String] The ID of the model portfolio to update.
2108
+ # @param model_portfolio [ModelPortfolio]
2109
+ # @param model_portfolio_security [Array<ModelPortfolioSecurity>]
2110
+ # @param model_portfolio_asset_class [Array<ModelPortfolioAssetClass>]
2111
+ # @param body [ModelPortfolioDetails] Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. &lt;br /&gt;&lt;br /&gt; * The model portfolio name and model portfolio model type is required. &lt;br /&gt; * The model portfolio model type must be either 0 or 1. [0 -&gt; Securities based, 1 -&gt; Asset Class based] &lt;br /&gt;&lt;br /&gt; * If the model portfolio type is 0, the model portfolio asset class must be an empty array. &lt;br /&gt; * If the model portfolio type is 1, the model portfolio security must be an empty array. &lt;br /&gt;&lt;br /&gt; * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object &lt;br /&gt; * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object &lt;br /&gt;&lt;br /&gt; * To remove all model portfolio securities or model portfolio asset class, set then to an empty array
2112
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2113
+ def modify_model_portfolio_by_id_with_http_info(model_portfolio_id:, model_portfolio: SENTINEL, model_portfolio_security: SENTINEL, model_portfolio_asset_class: SENTINEL, extra: {})
2114
+ _body = {}
2115
+ _body[:model_portfolio] = model_portfolio if model_portfolio != SENTINEL
2116
+ _body[:model_portfolio_security] = model_portfolio_security if model_portfolio_security != SENTINEL
2117
+ _body[:model_portfolio_asset_class] = model_portfolio_asset_class if model_portfolio_asset_class != SENTINEL
2118
+ model_portfolio_details = _body
2119
+
2120
+ modify_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, model_portfolio_details, extra)
2121
+ end
2122
+
2123
+ # Updates model portfolio object
2124
+ # @param model_portfolio_id [String] The ID of the model portfolio to update.
2125
+ # @param model_portfolio_details [ModelPortfolioDetails] Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. &lt;br /&gt;&lt;br /&gt; * The model portfolio name and model portfolio model type is required. &lt;br /&gt; * The model portfolio model type must be either 0 or 1. [0 -&gt; Securities based, 1 -&gt; Asset Class based] &lt;br /&gt;&lt;br /&gt; * If the model portfolio type is 0, the model portfolio asset class must be an empty array. &lt;br /&gt; * If the model portfolio type is 1, the model portfolio security must be an empty array. &lt;br /&gt;&lt;br /&gt; * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object &lt;br /&gt; * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object &lt;br /&gt;&lt;br /&gt; * To remove all model portfolio securities or model portfolio asset class, set then to an empty array
2126
+ # @param [Hash] opts the optional parameters
2127
+ # @return [nil]
2128
+ def modify_model_portfolio_by_id_impl(model_portfolio_id, model_portfolio_details, opts = {})
2129
+ modify_model_portfolio_by_id_with_http_info(model_portfolio_id, model_portfolio_details, opts)
2130
+ nil
2131
+ end
2132
+
2133
+ # Updates model portfolio object
2134
+ # @param model_portfolio_id [String] The ID of the model portfolio to update.
2135
+ # @param model_portfolio_details [ModelPortfolioDetails] Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. &lt;br /&gt;&lt;br /&gt; * The model portfolio name and model portfolio model type is required. &lt;br /&gt; * The model portfolio model type must be either 0 or 1. [0 -&gt; Securities based, 1 -&gt; Asset Class based] &lt;br /&gt;&lt;br /&gt; * If the model portfolio type is 0, the model portfolio asset class must be an empty array. &lt;br /&gt; * If the model portfolio type is 1, the model portfolio security must be an empty array. &lt;br /&gt;&lt;br /&gt; * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object &lt;br /&gt; * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object &lt;br /&gt;&lt;br /&gt; * To remove all model portfolio securities or model portfolio asset class, set then to an empty array
2136
+ # @param [Hash] opts the optional parameters
2137
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2138
+ def modify_model_portfolio_by_id_with_http_info_impl(model_portfolio_id, model_portfolio_details, opts = {})
2139
+ if @api_client.config.debugging
2140
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.modify_model_portfolio_by_id ...'
2141
+ end
2142
+ # verify the required parameter 'model_portfolio_id' is set
2143
+ if @api_client.config.client_side_validation && model_portfolio_id.nil?
2144
+ fail ArgumentError, "Missing the required parameter 'model_portfolio_id' when calling PortfolioManagementApi.modify_model_portfolio_by_id"
2145
+ end
2146
+ # verify the required parameter 'model_portfolio_details' is set
2147
+ if @api_client.config.client_side_validation && model_portfolio_details.nil?
2148
+ fail ArgumentError, "Missing the required parameter 'model_portfolio_details' when calling PortfolioManagementApi.modify_model_portfolio_by_id"
2149
+ end
2150
+ # resource path
2151
+ local_var_path = '/modelPortfolio/{modelPortfolioId}'.sub('{' + 'modelPortfolioId' + '}', CGI.escape(model_portfolio_id.to_s))
2152
+
2153
+ # query parameters
2154
+ query_params = opts[:query_params] || {}
2155
+
2156
+ # header parameters
2157
+ header_params = opts[:header_params] || {}
2158
+ # HTTP header 'Content-Type'
2159
+ content_type = @api_client.select_header_content_type(['application/json'])
2160
+ if !content_type.nil?
2161
+ header_params['Content-Type'] = content_type
2162
+ end
2163
+
2164
+ # form parameters
2165
+ form_params = opts[:form_params] || {}
2166
+
2167
+ # http body (model)
2168
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(model_portfolio_details)
2169
+
2170
+ # return_type
2171
+ return_type = opts[:debug_return_type]
2172
+
2173
+ # auth_names
2174
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2175
+
2176
+ new_options = opts.merge(
2177
+ :operation => :"PortfolioManagementApi.modify_model_portfolio_by_id",
2178
+ :header_params => header_params,
2179
+ :query_params => query_params,
2180
+ :form_params => form_params,
2181
+ :body => post_body,
2182
+ :auth_names => auth_names,
2183
+ :return_type => return_type
2184
+ )
2185
+
2186
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
2187
+ if @api_client.config.debugging
2188
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#modify_model_portfolio_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2189
+ end
2190
+ return data, status_code, headers, response
2191
+ end
2192
+
2193
+
2194
+ # Update an existing target portfolio.
2195
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to update.
2196
+ # @param id [String]
2197
+ # @param name [String]
2198
+ # @param body [Hash<String, Object>]
2199
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2200
+ def save_portfolio(portfolio_group_id:, id: SENTINEL, name: SENTINEL, extra: {})
2201
+ _body = {}
2202
+ _body[:id] = id if id != SENTINEL
2203
+ _body[:name] = name if name != SENTINEL
2204
+ request_body = _body
2205
+
2206
+ data, _status_code, _headers = save_portfolio_with_http_info_impl(portfolio_group_id, request_body, extra)
2207
+ data
2208
+ end
2209
+
2210
+ # Update an existing target portfolio.
2211
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to update.
2212
+ # @param id [String]
2213
+ # @param name [String]
2214
+ # @param body [Hash<String, Object>]
2215
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2216
+ def save_portfolio_with_http_info(portfolio_group_id:, id: SENTINEL, name: SENTINEL, extra: {})
2217
+ _body = {}
2218
+ _body[:id] = id if id != SENTINEL
2219
+ _body[:name] = name if name != SENTINEL
2220
+ request_body = _body
2221
+
2222
+ save_portfolio_with_http_info_impl(portfolio_group_id, request_body, extra)
2223
+ end
2224
+
2225
+ # Update an existing target portfolio.
2226
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to update.
2227
+ # @param request_body [Hash<String, Object>]
2228
+ # @param [Hash] opts the optional parameters
2229
+ # @return [PortfolioGroup]
2230
+ def save_portfolio_impl(portfolio_group_id, request_body, opts = {})
2231
+ data, _status_code, _headers = save_portfolio_with_http_info(portfolio_group_id, request_body, opts)
2232
+ data
2233
+ end
2234
+
2235
+ # Update an existing target portfolio.
2236
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to update.
2237
+ # @param request_body [Hash<String, Object>]
2238
+ # @param [Hash] opts the optional parameters
2239
+ # @return [Array<(PortfolioGroup, Integer, Hash)>] PortfolioGroup data, response status code and response headers
2240
+ def save_portfolio_with_http_info_impl(portfolio_group_id, request_body, opts = {})
2241
+ if @api_client.config.debugging
2242
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.save_portfolio ...'
2243
+ end
2244
+ # verify the required parameter 'portfolio_group_id' is set
2245
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2246
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.save_portfolio"
2247
+ end
2248
+ # verify the required parameter 'request_body' is set
2249
+ if @api_client.config.client_side_validation && request_body.nil?
2250
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling PortfolioManagementApi.save_portfolio"
2251
+ end
2252
+ # resource path
2253
+ local_var_path = '/portfolioGroups/{portfolioGroupId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
2254
+
2255
+ # query parameters
2256
+ query_params = opts[:query_params] || {}
2257
+
2258
+ # header parameters
2259
+ header_params = opts[:header_params] || {}
2260
+ # HTTP header 'Accept' (if needed)
2261
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2262
+ # HTTP header 'Content-Type'
2263
+ content_type = @api_client.select_header_content_type(['application/json'])
2264
+ if !content_type.nil?
2265
+ header_params['Content-Type'] = content_type
2266
+ end
2267
+
2268
+ # form parameters
2269
+ form_params = opts[:form_params] || {}
2270
+
2271
+ # http body (model)
2272
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
2273
+
2274
+ # return_type
2275
+ return_type = opts[:debug_return_type] || 'PortfolioGroup'
2276
+
2277
+ # auth_names
2278
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2279
+
2280
+ new_options = opts.merge(
2281
+ :operation => :"PortfolioManagementApi.save_portfolio",
2282
+ :header_params => header_params,
2283
+ :query_params => query_params,
2284
+ :form_params => form_params,
2285
+ :body => post_body,
2286
+ :auth_names => auth_names,
2287
+ :return_type => return_type
2288
+ )
2289
+
2290
+ data, status_code, headers, response = @api_client.call_api(:PATCH, local_var_path, new_options)
2291
+ if @api_client.config.debugging
2292
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#save_portfolio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2293
+ end
2294
+ return data, status_code, headers, response
2295
+ end
2296
+
2297
+
2298
+ # Search for symbols limited to brokerages under the specified portfolio group
2299
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to search under
2300
+ # @param substring [String]
2301
+ # @param body [SymbolQuery]
2302
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2303
+ def search_portfolio_symbols(portfolio_group_id:, substring: SENTINEL, extra: {})
2304
+ _body = {}
2305
+ _body[:substring] = substring if substring != SENTINEL
2306
+ extra[:symbol_query] = _body if !_body.empty?
2307
+
2308
+ data, _status_code, _headers = search_portfolio_symbols_with_http_info_impl(portfolio_group_id, extra)
2309
+ data
2310
+ end
2311
+
2312
+ # Search for symbols limited to brokerages under the specified portfolio group
2313
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to search under
2314
+ # @param substring [String]
2315
+ # @param body [SymbolQuery]
2316
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2317
+ def search_portfolio_symbols_with_http_info(portfolio_group_id:, substring: SENTINEL, extra: {})
2318
+ _body = {}
2319
+ _body[:substring] = substring if substring != SENTINEL
2320
+ extra[:symbol_query] = _body if !_body.empty?
2321
+
2322
+ search_portfolio_symbols_with_http_info_impl(portfolio_group_id, extra)
2323
+ end
2324
+
2325
+ # Search for symbols limited to brokerages under the specified portfolio group
2326
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to search under
2327
+ # @param [Hash] opts the optional parameters
2328
+ # @option opts [SymbolQuery] :symbol_query
2329
+ # @return [Array<UniversalSymbol>]
2330
+ def search_portfolio_symbols_impl(portfolio_group_id, opts = {})
2331
+ data, _status_code, _headers = search_portfolio_symbols_with_http_info(portfolio_group_id, opts)
2332
+ data
2333
+ end
2334
+
2335
+ # Search for symbols limited to brokerages under the specified portfolio group
2336
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup to search under
2337
+ # @param [Hash] opts the optional parameters
2338
+ # @option opts [SymbolQuery] :symbol_query
2339
+ # @return [Array<(Array<UniversalSymbol>, Integer, Hash)>] Array<UniversalSymbol> data, response status code and response headers
2340
+ def search_portfolio_symbols_with_http_info_impl(portfolio_group_id, opts = {})
2341
+ if @api_client.config.debugging
2342
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.search_portfolio_symbols ...'
2343
+ end
2344
+ # verify the required parameter 'portfolio_group_id' is set
2345
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2346
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.search_portfolio_symbols"
2347
+ end
2348
+ # resource path
2349
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/symbols'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
2350
+
2351
+ # query parameters
2352
+ query_params = opts[:query_params] || {}
2353
+
2354
+ # header parameters
2355
+ header_params = opts[:header_params] || {}
2356
+ # HTTP header 'Accept' (if needed)
2357
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2358
+ # HTTP header 'Content-Type'
2359
+ content_type = @api_client.select_header_content_type(['application/json'])
2360
+ if !content_type.nil?
2361
+ header_params['Content-Type'] = content_type
2362
+ end
2363
+
2364
+ # form parameters
2365
+ form_params = opts[:form_params] || {}
2366
+
2367
+ # http body (model)
2368
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'symbol_query'])
2369
+
2370
+ # return_type
2371
+ return_type = opts[:debug_return_type] || 'Array<UniversalSymbol>'
2372
+
2373
+ # auth_names
2374
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2375
+
2376
+ new_options = opts.merge(
2377
+ :operation => :"PortfolioManagementApi.search_portfolio_symbols",
2378
+ :header_params => header_params,
2379
+ :query_params => query_params,
2380
+ :form_params => form_params,
2381
+ :body => post_body,
2382
+ :auth_names => auth_names,
2383
+ :return_type => return_type
2384
+ )
2385
+
2386
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
2387
+ if @api_client.config.debugging
2388
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#search_portfolio_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2389
+ end
2390
+ return data, status_code, headers, response
2391
+ end
2392
+
2393
+
2394
+ # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
2395
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
2396
+ # @param body [Array<TargetAsset>]
2397
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2398
+ def set_portfolio_targets(portfolio_group_id:, body: SENTINEL, extra: {})
2399
+ extra[:target_asset] = body if body != SENTINEL
2400
+
2401
+ data, _status_code, _headers = set_portfolio_targets_with_http_info_impl(portfolio_group_id, extra)
2402
+ data
2403
+ end
2404
+
2405
+ # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
2406
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
2407
+ # @param body [Array<TargetAsset>]
2408
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2409
+ def set_portfolio_targets_with_http_info(portfolio_group_id:, body: SENTINEL, extra: {})
2410
+ extra[:target_asset] = body if body != SENTINEL
2411
+
2412
+ set_portfolio_targets_with_http_info_impl(portfolio_group_id, extra)
2413
+ end
2414
+
2415
+ # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
2416
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
2417
+ # @param [Hash] opts the optional parameters
2418
+ # @option opts [Array<TargetAsset>] :target_asset
2419
+ # @return [Array<TargetAsset>]
2420
+ def set_portfolio_targets_impl(portfolio_group_id, opts = {})
2421
+ data, _status_code, _headers = set_portfolio_targets_with_http_info(portfolio_group_id, opts)
2422
+ data
2423
+ end
2424
+
2425
+ # Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
2426
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to create the target asset.
2427
+ # @param [Hash] opts the optional parameters
2428
+ # @option opts [Array<TargetAsset>] :target_asset
2429
+ # @return [Array<(Array<TargetAsset>, Integer, Hash)>] Array<TargetAsset> data, response status code and response headers
2430
+ def set_portfolio_targets_with_http_info_impl(portfolio_group_id, opts = {})
2431
+ if @api_client.config.debugging
2432
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.set_portfolio_targets ...'
2433
+ end
2434
+ # verify the required parameter 'portfolio_group_id' is set
2435
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2436
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.set_portfolio_targets"
2437
+ end
2438
+ # resource path
2439
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/targets'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
2440
+
2441
+ # query parameters
2442
+ query_params = opts[:query_params] || {}
2443
+
2444
+ # header parameters
2445
+ header_params = opts[:header_params] || {}
2446
+ # HTTP header 'Accept' (if needed)
2447
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2448
+ # HTTP header 'Content-Type'
2449
+ content_type = @api_client.select_header_content_type(['application/json'])
2450
+ if !content_type.nil?
2451
+ header_params['Content-Type'] = content_type
2452
+ end
2453
+
2454
+ # form parameters
2455
+ form_params = opts[:form_params] || {}
2456
+
2457
+ # http body (model)
2458
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'target_asset'])
2459
+
2460
+ # return_type
2461
+ return_type = opts[:debug_return_type] || 'Array<TargetAsset>'
2462
+
2463
+ # auth_names
2464
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2465
+
2466
+ new_options = opts.merge(
2467
+ :operation => :"PortfolioManagementApi.set_portfolio_targets",
2468
+ :header_params => header_params,
2469
+ :query_params => query_params,
2470
+ :form_params => form_params,
2471
+ :body => post_body,
2472
+ :auth_names => auth_names,
2473
+ :return_type => return_type
2474
+ )
2475
+
2476
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
2477
+ if @api_client.config.debugging
2478
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#set_portfolio_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2479
+ end
2480
+ return data, status_code, headers, response
2481
+ end
2482
+
2483
+
2484
+ # Updates model asset class objects
2485
+ # @param model_asset_class_id [String] The ID of the model asset class to update.
2486
+ # @param model_asset_class [ModelAssetClass]
2487
+ # @param model_asset_class_target [Array<ModelAssetClassTarget>]
2488
+ # @param body [ModelAssetClassDetails] Use this endpoint change model asset class name and to add or remove a model asset class target. &lt;br /&gt;&lt;br /&gt; * Only the model asset class name is required for the model asset class object. &lt;br /&gt; * Only the symbol id is required for the symbol object in the model asset class target object. &lt;br /&gt; * To remove all model asset class targets, set the model asset class target as an empty array
2489
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2490
+ def update_asset_class(model_asset_class_id:, model_asset_class: SENTINEL, model_asset_class_target: SENTINEL, extra: {})
2491
+ _body = {}
2492
+ _body[:model_asset_class] = model_asset_class if model_asset_class != SENTINEL
2493
+ _body[:model_asset_class_target] = model_asset_class_target if model_asset_class_target != SENTINEL
2494
+ model_asset_class_details = _body
2495
+
2496
+ update_asset_class_with_http_info_impl(model_asset_class_id, model_asset_class_details, extra)
2497
+ nil
2498
+ end
2499
+
2500
+ # Updates model asset class objects
2501
+ # @param model_asset_class_id [String] The ID of the model asset class to update.
2502
+ # @param model_asset_class [ModelAssetClass]
2503
+ # @param model_asset_class_target [Array<ModelAssetClassTarget>]
2504
+ # @param body [ModelAssetClassDetails] Use this endpoint change model asset class name and to add or remove a model asset class target. &lt;br /&gt;&lt;br /&gt; * Only the model asset class name is required for the model asset class object. &lt;br /&gt; * Only the symbol id is required for the symbol object in the model asset class target object. &lt;br /&gt; * To remove all model asset class targets, set the model asset class target as an empty array
2505
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2506
+ def update_asset_class_with_http_info(model_asset_class_id:, model_asset_class: SENTINEL, model_asset_class_target: SENTINEL, extra: {})
2507
+ _body = {}
2508
+ _body[:model_asset_class] = model_asset_class if model_asset_class != SENTINEL
2509
+ _body[:model_asset_class_target] = model_asset_class_target if model_asset_class_target != SENTINEL
2510
+ model_asset_class_details = _body
2511
+
2512
+ update_asset_class_with_http_info_impl(model_asset_class_id, model_asset_class_details, extra)
2513
+ end
2514
+
2515
+ # Updates model asset class objects
2516
+ # @param model_asset_class_id [String] The ID of the model asset class to update.
2517
+ # @param model_asset_class_details [ModelAssetClassDetails] Use this endpoint change model asset class name and to add or remove a model asset class target. &lt;br /&gt;&lt;br /&gt; * Only the model asset class name is required for the model asset class object. &lt;br /&gt; * Only the symbol id is required for the symbol object in the model asset class target object. &lt;br /&gt; * To remove all model asset class targets, set the model asset class target as an empty array
2518
+ # @param [Hash] opts the optional parameters
2519
+ # @return [nil]
2520
+ def update_asset_class_impl(model_asset_class_id, model_asset_class_details, opts = {})
2521
+ update_asset_class_with_http_info(model_asset_class_id, model_asset_class_details, opts)
2522
+ nil
2523
+ end
2524
+
2525
+ # Updates model asset class objects
2526
+ # @param model_asset_class_id [String] The ID of the model asset class to update.
2527
+ # @param model_asset_class_details [ModelAssetClassDetails] Use this endpoint change model asset class name and to add or remove a model asset class target. &lt;br /&gt;&lt;br /&gt; * Only the model asset class name is required for the model asset class object. &lt;br /&gt; * Only the symbol id is required for the symbol object in the model asset class target object. &lt;br /&gt; * To remove all model asset class targets, set the model asset class target as an empty array
2528
+ # @param [Hash] opts the optional parameters
2529
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2530
+ def update_asset_class_with_http_info_impl(model_asset_class_id, model_asset_class_details, opts = {})
2531
+ if @api_client.config.debugging
2532
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.update_asset_class ...'
2533
+ end
2534
+ # verify the required parameter 'model_asset_class_id' is set
2535
+ if @api_client.config.client_side_validation && model_asset_class_id.nil?
2536
+ fail ArgumentError, "Missing the required parameter 'model_asset_class_id' when calling PortfolioManagementApi.update_asset_class"
2537
+ end
2538
+ # verify the required parameter 'model_asset_class_details' is set
2539
+ if @api_client.config.client_side_validation && model_asset_class_details.nil?
2540
+ fail ArgumentError, "Missing the required parameter 'model_asset_class_details' when calling PortfolioManagementApi.update_asset_class"
2541
+ end
2542
+ # resource path
2543
+ local_var_path = '/modelAssetClass/{modelAssetClassId}'.sub('{' + 'modelAssetClassId' + '}', CGI.escape(model_asset_class_id.to_s))
2544
+
2545
+ # query parameters
2546
+ query_params = opts[:query_params] || {}
2547
+
2548
+ # header parameters
2549
+ header_params = opts[:header_params] || {}
2550
+ # HTTP header 'Content-Type'
2551
+ content_type = @api_client.select_header_content_type(['application/json'])
2552
+ if !content_type.nil?
2553
+ header_params['Content-Type'] = content_type
2554
+ end
2555
+
2556
+ # form parameters
2557
+ form_params = opts[:form_params] || {}
2558
+
2559
+ # http body (model)
2560
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(model_asset_class_details)
2561
+
2562
+ # return_type
2563
+ return_type = opts[:debug_return_type]
2564
+
2565
+ # auth_names
2566
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2567
+
2568
+ new_options = opts.merge(
2569
+ :operation => :"PortfolioManagementApi.update_asset_class",
2570
+ :header_params => header_params,
2571
+ :query_params => query_params,
2572
+ :form_params => form_params,
2573
+ :body => post_body,
2574
+ :auth_names => auth_names,
2575
+ :return_type => return_type
2576
+ )
2577
+
2578
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
2579
+ if @api_client.config.debugging
2580
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#update_asset_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2581
+ end
2582
+ return data, status_code, headers, response
2583
+ end
2584
+
2585
+
2586
+ # Updates portfolio group settings
2587
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the settings.
2588
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2589
+ def update_portfolio_settings(portfolio_group_id:, extra: {})
2590
+
2591
+ data, _status_code, _headers = update_portfolio_settings_with_http_info_impl(portfolio_group_id, extra)
2592
+ data
2593
+ end
2594
+
2595
+ # Updates portfolio group settings
2596
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the settings.
2597
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2598
+ def update_portfolio_settings_with_http_info(portfolio_group_id:, extra: {})
2599
+
2600
+ update_portfolio_settings_with_http_info_impl(portfolio_group_id, extra)
2601
+ end
2602
+
2603
+ # Updates portfolio group settings
2604
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the settings.
2605
+ # @param [Hash] opts the optional parameters
2606
+ # @return [PortfolioGroupSettings]
2607
+ def update_portfolio_settings_impl(portfolio_group_id, opts = {})
2608
+ data, _status_code, _headers = update_portfolio_settings_with_http_info(portfolio_group_id, opts)
2609
+ data
2610
+ end
2611
+
2612
+ # Updates portfolio group settings
2613
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the settings.
2614
+ # @param [Hash] opts the optional parameters
2615
+ # @return [Array<(PortfolioGroupSettings, Integer, Hash)>] PortfolioGroupSettings data, response status code and response headers
2616
+ def update_portfolio_settings_with_http_info_impl(portfolio_group_id, opts = {})
2617
+ if @api_client.config.debugging
2618
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.update_portfolio_settings ...'
2619
+ end
2620
+ # verify the required parameter 'portfolio_group_id' is set
2621
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2622
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.update_portfolio_settings"
2623
+ end
2624
+ # resource path
2625
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/settings'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s))
2626
+
2627
+ # query parameters
2628
+ query_params = opts[:query_params] || {}
2629
+
2630
+ # header parameters
2631
+ header_params = opts[:header_params] || {}
2632
+ # HTTP header 'Accept' (if needed)
2633
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
2634
+
2635
+ # form parameters
2636
+ form_params = opts[:form_params] || {}
2637
+
2638
+ # http body (model)
2639
+ post_body = opts[:debug_body]
2640
+
2641
+ # return_type
2642
+ return_type = opts[:debug_return_type] || 'PortfolioGroupSettings'
2643
+
2644
+ # auth_names
2645
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2646
+
2647
+ new_options = opts.merge(
2648
+ :operation => :"PortfolioManagementApi.update_portfolio_settings",
2649
+ :header_params => header_params,
2650
+ :query_params => query_params,
2651
+ :form_params => form_params,
2652
+ :body => post_body,
2653
+ :auth_names => auth_names,
2654
+ :return_type => return_type
2655
+ )
2656
+
2657
+ data, status_code, headers, response = @api_client.call_api(:PATCH, local_var_path, new_options)
2658
+ if @api_client.config.debugging
2659
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#update_portfolio_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2660
+ end
2661
+ return data, status_code, headers, response
2662
+ end
2663
+
2664
+
2665
+ # Update a TargetAsset under the specified PortfolioGroup.
2666
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the target asset.
2667
+ # @param target_asset_id [String] The ID of the TargetAsset to patch.
2668
+ # @param id [String]
2669
+ # @param symbol [UniversalSymbol]
2670
+ # @param percent [Float]
2671
+ # @param is_supported [Boolean]
2672
+ # @param is_excluded [Boolean]
2673
+ # @param body [TargetAsset]
2674
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2675
+ def update_portfolio_target_by_id(portfolio_group_id:, target_asset_id:, id: SENTINEL, symbol: SENTINEL, percent: SENTINEL, is_supported: SENTINEL, is_excluded: SENTINEL, extra: {})
2676
+ _body = {}
2677
+ _body[:id] = id if id != SENTINEL
2678
+ _body[:symbol] = symbol if symbol != SENTINEL
2679
+ _body[:percent] = percent if percent != SENTINEL
2680
+ _body[:is_supported] = is_supported if is_supported != SENTINEL
2681
+ _body[:is_excluded] = is_excluded if is_excluded != SENTINEL
2682
+ target_asset = _body
2683
+
2684
+ data, _status_code, _headers = update_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, target_asset, extra)
2685
+ data
2686
+ end
2687
+
2688
+ # Update a TargetAsset under the specified PortfolioGroup.
2689
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the target asset.
2690
+ # @param target_asset_id [String] The ID of the TargetAsset to patch.
2691
+ # @param id [String]
2692
+ # @param symbol [UniversalSymbol]
2693
+ # @param percent [Float]
2694
+ # @param is_supported [Boolean]
2695
+ # @param is_excluded [Boolean]
2696
+ # @param body [TargetAsset]
2697
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
2698
+ def update_portfolio_target_by_id_with_http_info(portfolio_group_id:, target_asset_id:, id: SENTINEL, symbol: SENTINEL, percent: SENTINEL, is_supported: SENTINEL, is_excluded: SENTINEL, extra: {})
2699
+ _body = {}
2700
+ _body[:id] = id if id != SENTINEL
2701
+ _body[:symbol] = symbol if symbol != SENTINEL
2702
+ _body[:percent] = percent if percent != SENTINEL
2703
+ _body[:is_supported] = is_supported if is_supported != SENTINEL
2704
+ _body[:is_excluded] = is_excluded if is_excluded != SENTINEL
2705
+ target_asset = _body
2706
+
2707
+ update_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, target_asset, extra)
2708
+ end
2709
+
2710
+ # Update a TargetAsset under the specified PortfolioGroup.
2711
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the target asset.
2712
+ # @param target_asset_id [String] The ID of the TargetAsset to patch.
2713
+ # @param target_asset [TargetAsset]
2714
+ # @param [Hash] opts the optional parameters
2715
+ # @return [TargetAsset]
2716
+ def update_portfolio_target_by_id_impl(portfolio_group_id, target_asset_id, target_asset, opts = {})
2717
+ data, _status_code, _headers = update_portfolio_target_by_id_with_http_info(portfolio_group_id, target_asset_id, target_asset, opts)
2718
+ data
2719
+ end
2720
+
2721
+ # Update a TargetAsset under the specified PortfolioGroup.
2722
+ # @param portfolio_group_id [String] The ID of the PortfolioGroup under which to patch the target asset.
2723
+ # @param target_asset_id [String] The ID of the TargetAsset to patch.
2724
+ # @param target_asset [TargetAsset]
2725
+ # @param [Hash] opts the optional parameters
2726
+ # @return [Array<(TargetAsset, Integer, Hash)>] TargetAsset data, response status code and response headers
2727
+ def update_portfolio_target_by_id_with_http_info_impl(portfolio_group_id, target_asset_id, target_asset, opts = {})
2728
+ if @api_client.config.debugging
2729
+ @api_client.config.logger.debug 'Calling API: PortfolioManagementApi.update_portfolio_target_by_id ...'
2730
+ end
2731
+ # verify the required parameter 'portfolio_group_id' is set
2732
+ if @api_client.config.client_side_validation && portfolio_group_id.nil?
2733
+ fail ArgumentError, "Missing the required parameter 'portfolio_group_id' when calling PortfolioManagementApi.update_portfolio_target_by_id"
2734
+ end
2735
+ # verify the required parameter 'target_asset_id' is set
2736
+ if @api_client.config.client_side_validation && target_asset_id.nil?
2737
+ fail ArgumentError, "Missing the required parameter 'target_asset_id' when calling PortfolioManagementApi.update_portfolio_target_by_id"
2738
+ end
2739
+ # verify the required parameter 'target_asset' is set
2740
+ if @api_client.config.client_side_validation && target_asset.nil?
2741
+ fail ArgumentError, "Missing the required parameter 'target_asset' when calling PortfolioManagementApi.update_portfolio_target_by_id"
2742
+ end
2743
+ # resource path
2744
+ local_var_path = '/portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}'.sub('{' + 'portfolioGroupId' + '}', CGI.escape(portfolio_group_id.to_s)).sub('{' + 'targetAssetId' + '}', CGI.escape(target_asset_id.to_s))
2745
+
2746
+ # query parameters
2747
+ query_params = opts[:query_params] || {}
2748
+
2749
+ # header parameters
2750
+ header_params = opts[:header_params] || {}
2751
+ # HTTP header 'Accept' (if needed)
2752
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2753
+ # HTTP header 'Content-Type'
2754
+ content_type = @api_client.select_header_content_type(['application/json'])
2755
+ if !content_type.nil?
2756
+ header_params['Content-Type'] = content_type
2757
+ end
2758
+
2759
+ # form parameters
2760
+ form_params = opts[:form_params] || {}
2761
+
2762
+ # http body (model)
2763
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(target_asset)
2764
+
2765
+ # return_type
2766
+ return_type = opts[:debug_return_type] || 'TargetAsset'
2767
+
2768
+ # auth_names
2769
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
2770
+
2771
+ new_options = opts.merge(
2772
+ :operation => :"PortfolioManagementApi.update_portfolio_target_by_id",
2773
+ :header_params => header_params,
2774
+ :query_params => query_params,
2775
+ :form_params => form_params,
2776
+ :body => post_body,
2777
+ :auth_names => auth_names,
2778
+ :return_type => return_type
2779
+ )
2780
+
2781
+ data, status_code, headers, response = @api_client.call_api(:PATCH, local_var_path, new_options)
2782
+ if @api_client.config.debugging
2783
+ @api_client.config.logger.debug "API called: PortfolioManagementApi#update_portfolio_target_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2784
+ end
2785
+ return data, status_code, headers, response
2786
+ end
2787
+ end
2788
+
2789
+ # top-level client access to avoid having the user to insantiate their own API instances
2790
+ PortfolioManagement = PortfolioManagementApi::new
2791
+ end