snaptrade 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
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,2014 @@
1
+ # SnapTrade::PortfolioManagementApi
2
+
3
+ All URIs are relative to *https://api.snaptrade.com/api/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**add_portfolio_excluded_asset**](PortfolioManagementApi.md#add_portfolio_excluded_asset) | **POST** /portfolioGroups/{portfolioGroupId}/excludedassets | Adds an asset to exclude to a portfolio group |
8
+ | [**create**](PortfolioManagementApi.md#create) | **POST** /portfolioGroups | Create new portfolio group |
9
+ | [**create_asset_class**](PortfolioManagementApi.md#create_asset_class) | **POST** /modelAssetClass | Create a new model asset class |
10
+ | [**create_model_portfolio**](PortfolioManagementApi.md#create_model_portfolio) | **POST** /modelPortfolio | Creates a new model portfolio |
11
+ | [**delete_asset_class**](PortfolioManagementApi.md#delete_asset_class) | **DELETE** /modelAssetClass/{modelAssetClassId} | Deletes a model asset class |
12
+ | [**delete_excluded_asset**](PortfolioManagementApi.md#delete_excluded_asset) | **DELETE** /portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId} | Unexclude an asset from a portfolio group |
13
+ | [**delete_model_portfolio_by_id**](PortfolioManagementApi.md#delete_model_portfolio_by_id) | **DELETE** /modelPortfolio/{modelPortfolioId} | Deletes a model portfolio |
14
+ | [**delete_portfoli**](PortfolioManagementApi.md#delete_portfoli) | **DELETE** /portfolioGroups/{portfolioGroupId} | Remove a target portfolio. |
15
+ | [**delete_portfolio_target_by_id**](PortfolioManagementApi.md#delete_portfolio_target_by_id) | **DELETE** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Remove a TargetAsset. |
16
+ | [**detail_asset_class**](PortfolioManagementApi.md#detail_asset_class) | **GET** /modelAssetClass/{modelAssetClassId} | Get details of a model asset class |
17
+ | [**get_calculated_trade_by_id**](PortfolioManagementApi.md#get_calculated_trade_by_id) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId} | Return an individual trade |
18
+ | [**get_model_details_by_id**](PortfolioManagementApi.md#get_model_details_by_id) | **GET** /modelPortfolio/{modelPortfolioId} | Get details of a model portfolio |
19
+ | [**get_portfolio_balances**](PortfolioManagementApi.md#get_portfolio_balances) | **GET** /portfolioGroups/{portfolioGroupId}/balances | Get sum of cash balances in portfolio group |
20
+ | [**get_portfolio_details_by_id**](PortfolioManagementApi.md#get_portfolio_details_by_id) | **GET** /portfolioGroups/{portfolioGroupId} | Get details of a target portfolio |
21
+ | [**get_portfolio_info**](PortfolioManagementApi.md#get_portfolio_info) | **GET** /portfolioGroups/{portfolioGroupId}/info | Return a whole bunch of relevant information relating to a portfolio group. |
22
+ | [**get_portfolio_settings**](PortfolioManagementApi.md#get_portfolio_settings) | **GET** /portfolioGroups/{portfolioGroupId}/settings | Get portfolio group settings |
23
+ | [**get_portfolio_target_by_id**](PortfolioManagementApi.md#get_portfolio_target_by_id) | **GET** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Get a specific target from a portfolio group |
24
+ | [**get_portfolio_targets**](PortfolioManagementApi.md#get_portfolio_targets) | **GET** /portfolioGroups/{portfolioGroupId}/targets | Get all target assets under the specified PortfolioGroup. |
25
+ | [**get_portoflio_excluded_assets**](PortfolioManagementApi.md#get_portoflio_excluded_assets) | **GET** /portfolioGroups/{portfolioGroupId}/excludedassets | Get an array of excluded assets associated with a portfolio group\\ |
26
+ | [**import_model_portfolio**](PortfolioManagementApi.md#import_model_portfolio) | **POST** /portfolioGroups/{portfolioGroupId}/import | Import target allocation based on portfolio group |
27
+ | [**list**](PortfolioManagementApi.md#list) | **GET** /portfolioGroups | List all portfolio groups |
28
+ | [**list_asset_classes**](PortfolioManagementApi.md#list_asset_classes) | **GET** /modelAssetClass | List of model asset class |
29
+ | [**list_calculated_trades**](PortfolioManagementApi.md#list_calculated_trades) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades | List of trades to make to rebalance portfolio group |
30
+ | [**list_model_portfolio**](PortfolioManagementApi.md#list_model_portfolio) | **GET** /modelPortfolio | List of model portfolio |
31
+ | [**list_portfolio_accounts**](PortfolioManagementApi.md#list_portfolio_accounts) | **GET** /portfolioGroups/{portfolioGroupId}/accounts | Get all accounts associated with a portfolio group |
32
+ | [**modify_model_portfolio_by_id**](PortfolioManagementApi.md#modify_model_portfolio_by_id) | **POST** /modelPortfolio/{modelPortfolioId} | Updates model portfolio object |
33
+ | [**save_portfolio**](PortfolioManagementApi.md#save_portfolio) | **PATCH** /portfolioGroups/{portfolioGroupId} | Update an existing target portfolio. |
34
+ | [**search_portfolio_symbols**](PortfolioManagementApi.md#search_portfolio_symbols) | **POST** /portfolioGroups/{portfolioGroupId}/symbols | Search for symbols limited to brokerages under the specified portfolio group |
35
+ | [**set_portfolio_targets**](PortfolioManagementApi.md#set_portfolio_targets) | **POST** /portfolioGroups/{portfolioGroupId}/targets | 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. |
36
+ | [**update_asset_class**](PortfolioManagementApi.md#update_asset_class) | **POST** /modelAssetClass/{modelAssetClassId} | Updates model asset class objects |
37
+ | [**update_portfolio_settings**](PortfolioManagementApi.md#update_portfolio_settings) | **PATCH** /portfolioGroups/{portfolioGroupId}/settings | Updates portfolio group settings |
38
+ | [**update_portfolio_target_by_id**](PortfolioManagementApi.md#update_portfolio_target_by_id) | **PATCH** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Update a TargetAsset under the specified PortfolioGroup. |
39
+
40
+ ## add_portfolio_excluded_asset
41
+
42
+ Adds an asset to exclude to a portfolio group
43
+
44
+ ### Example
45
+
46
+ ```ruby
47
+ require 'snaptrade'
48
+
49
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
50
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
51
+
52
+ portfolio_group_id = "portfolioGroupId_example"
53
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
54
+ symbol = "VAB.TO"
55
+ raw_symbol = "VAB"
56
+ description = "VANGUARD CDN AGGREGATE BOND INDEX ETF"
57
+ currency = {
58
+ "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
59
+ "code" => "USD",
60
+ "name" => "US Dollar",
61
+ }
62
+ exchange = {
63
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
64
+ "code" => "TSX",
65
+ "mic_code" => "XTSE",
66
+ "name" => "Toronto Stock Exchange",
67
+ "timezone" => "America/New_York",
68
+ "start_time" => "09:30:00",
69
+ "close_time" => "57600",
70
+ "suffix" => ".TO",
71
+ }
72
+ type = {
73
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
74
+ "code" => "cs",
75
+ "description" => "Common Stock",
76
+ "is_supported" => True,
77
+ }
78
+ currencies = [
79
+ {
80
+ "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
81
+ "code" => "USD",
82
+ "name" => "US Dollar",
83
+ }
84
+ ]
85
+
86
+ begin
87
+ # Adds an asset to exclude to a portfolio group
88
+ result = SnapTrade::PortfolioManagement.add_portfolio_excluded_asset(
89
+ portfolio_group_id: portfolio_group_id,
90
+ id: id,
91
+ symbol: symbol,
92
+ raw_symbol: raw_symbol,
93
+ description: description,
94
+ currency: currency,
95
+ exchange: exchange,
96
+ type: type,
97
+ currencies: currencies,
98
+ )
99
+ p result
100
+ rescue SnapTrade::ApiError => e
101
+ puts "Exception when calling SnapTrade::PortfolioManagement.add_portfolio_excluded_asset: #{e}"
102
+ end
103
+ ```
104
+
105
+ #### Using the add_portfolio_excluded_asset_with_http_info variant
106
+
107
+ This returns an Array which contains the response data, status code and headers.
108
+
109
+ ```ruby
110
+ portfolio_group_id = "portfolioGroupId_example"
111
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
112
+ symbol = "VAB.TO"
113
+ raw_symbol = "VAB"
114
+ description = "VANGUARD CDN AGGREGATE BOND INDEX ETF"
115
+ currency = {
116
+ "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
117
+ "code" => "USD",
118
+ "name" => "US Dollar",
119
+ }
120
+ exchange = {
121
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
122
+ "code" => "TSX",
123
+ "mic_code" => "XTSE",
124
+ "name" => "Toronto Stock Exchange",
125
+ "timezone" => "America/New_York",
126
+ "start_time" => "09:30:00",
127
+ "close_time" => "57600",
128
+ "suffix" => ".TO",
129
+ }
130
+ type = {
131
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
132
+ "code" => "cs",
133
+ "description" => "Common Stock",
134
+ "is_supported" => True,
135
+ }
136
+ currencies = [
137
+ {
138
+ "id" => "87b24961-b51e-4db8-9226-f198f6518a89",
139
+ "code" => "USD",
140
+ "name" => "US Dollar",
141
+ }
142
+ ]
143
+
144
+ begin
145
+ # Adds an asset to exclude to a portfolio group
146
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.add_portfolio_excluded_asset_with_http_info(
147
+ portfolio_group_id: portfolio_group_id,
148
+ id: id,
149
+ symbol: symbol,
150
+ raw_symbol: raw_symbol,
151
+ description: description,
152
+ currency: currency,
153
+ exchange: exchange,
154
+ type: type,
155
+ currencies: currencies,
156
+ )
157
+ p status_code # => 2xx
158
+ p headers # => { ... }
159
+ p data # => ExcludedAsset
160
+ rescue SnapTrade::ApiError => e
161
+ puts "Exception when calling SnapTrade::PortfolioManagement.add_portfolio_excluded_asset: #{e}"
162
+ end
163
+ ```
164
+
165
+ ### Parameters
166
+
167
+ | Name | Type | Description | Notes |
168
+ | ---- | ---- | ----------- | ----- |
169
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to exclude an asset. | |
170
+ | **universal_symbol** | [**UniversalSymbol**](UniversalSymbol.md) | | [optional] |
171
+
172
+ ### Return type
173
+
174
+ [**ExcludedAsset**](ExcludedAsset.md)
175
+
176
+ ## create
177
+
178
+ Create new portfolio group
179
+
180
+ ### Example
181
+
182
+ ```ruby
183
+ require 'snaptrade'
184
+
185
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
186
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
187
+
188
+ user_id = "John.doe@snaptrade.com"
189
+ user_secret = "USERSECRET123"
190
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
191
+ name = "Combined Retirement Portfolio"
192
+
193
+ begin
194
+ # Create new portfolio group
195
+ result = SnapTrade::PortfolioManagement.create(
196
+ user_id: user_id,
197
+ user_secret: user_secret,
198
+ id: id,
199
+ name: name,
200
+ )
201
+ p result
202
+ rescue SnapTrade::ApiError => e
203
+ puts "Exception when calling SnapTrade::PortfolioManagement.create: #{e}"
204
+ end
205
+ ```
206
+
207
+ #### Using the create_with_http_info variant
208
+
209
+ This returns an Array which contains the response data, status code and headers.
210
+
211
+ ```ruby
212
+ user_id = "John.doe@snaptrade.com"
213
+ user_secret = "USERSECRET123"
214
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
215
+ name = "Combined Retirement Portfolio"
216
+
217
+ begin
218
+ # Create new portfolio group
219
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.create_with_http_info(
220
+ user_id: user_id,
221
+ user_secret: user_secret,
222
+ id: id,
223
+ name: name,
224
+ )
225
+ p status_code # => 2xx
226
+ p headers # => { ... }
227
+ p data # => Array<PortfolioGroup>
228
+ rescue SnapTrade::ApiError => e
229
+ puts "Exception when calling SnapTrade::PortfolioManagement.create: #{e}"
230
+ end
231
+ ```
232
+
233
+ ### Parameters
234
+
235
+ | Name | Type | Description | Notes |
236
+ | ---- | ---- | ----------- | ----- |
237
+ | **user_id** | **String** | | |
238
+ | **user_secret** | **String** | | |
239
+ | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | |
240
+
241
+ ### Return type
242
+
243
+ [**Array&lt;PortfolioGroup&gt;**](PortfolioGroup.md)
244
+
245
+ ## create_asset_class
246
+
247
+ Create a new model asset class
248
+
249
+ ### Example
250
+
251
+ ```ruby
252
+ require 'snaptrade'
253
+
254
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
255
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
256
+
257
+
258
+ begin
259
+ # Create a new model asset class
260
+ result = SnapTrade::PortfolioManagement.create_asset_class
261
+ p result
262
+ rescue SnapTrade::ApiError => e
263
+ puts "Exception when calling SnapTrade::PortfolioManagement.create_asset_class: #{e}"
264
+ end
265
+ ```
266
+
267
+ #### Using the create_asset_class_with_http_info variant
268
+
269
+ This returns an Array which contains the response data, status code and headers.
270
+
271
+ ```ruby
272
+
273
+ begin
274
+ # Create a new model asset class
275
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.create_asset_class_with_http_info
276
+ p status_code # => 2xx
277
+ p headers # => { ... }
278
+ p data # => ModelAssetClassDetails
279
+ rescue SnapTrade::ApiError => e
280
+ puts "Exception when calling SnapTrade::PortfolioManagement.create_asset_class: #{e}"
281
+ end
282
+ ```
283
+
284
+ ### Parameters
285
+
286
+ This endpoint does not need any parameter.
287
+
288
+ ### Return type
289
+
290
+ [**ModelAssetClassDetails**](ModelAssetClassDetails.md)
291
+
292
+ ## create_model_portfolio
293
+
294
+ Creates a new model portfolio
295
+
296
+ ### Example
297
+
298
+ ```ruby
299
+ require 'snaptrade'
300
+
301
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
302
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
303
+
304
+
305
+ begin
306
+ # Creates a new model portfolio
307
+ result = SnapTrade::PortfolioManagement.create_model_portfolio
308
+ p result
309
+ rescue SnapTrade::ApiError => e
310
+ puts "Exception when calling SnapTrade::PortfolioManagement.create_model_portfolio: #{e}"
311
+ end
312
+ ```
313
+
314
+ #### Using the create_model_portfolio_with_http_info variant
315
+
316
+ This returns an Array which contains the response data, status code and headers.
317
+
318
+ ```ruby
319
+
320
+ begin
321
+ # Creates a new model portfolio
322
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.create_model_portfolio_with_http_info
323
+ p status_code # => 2xx
324
+ p headers # => { ... }
325
+ p data # => ModelPortfolioDetails
326
+ rescue SnapTrade::ApiError => e
327
+ puts "Exception when calling SnapTrade::PortfolioManagement.create_model_portfolio: #{e}"
328
+ end
329
+ ```
330
+
331
+ ### Parameters
332
+
333
+ This endpoint does not need any parameter.
334
+
335
+ ### Return type
336
+
337
+ [**ModelPortfolioDetails**](ModelPortfolioDetails.md)
338
+
339
+ ## delete_asset_class
340
+
341
+ Deletes a model asset class
342
+
343
+ ### Example
344
+
345
+ ```ruby
346
+ require 'snaptrade'
347
+
348
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
349
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
350
+
351
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
352
+
353
+ begin
354
+ # Deletes a model asset class
355
+ SnapTrade::PortfolioManagement.delete_asset_class(
356
+ model_asset_class_id: model_asset_class_id,
357
+ )
358
+ rescue SnapTrade::ApiError => e
359
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_asset_class: #{e}"
360
+ end
361
+ ```
362
+
363
+ #### Using the delete_asset_class_with_http_info variant
364
+
365
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
366
+
367
+ ```ruby
368
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
369
+
370
+ begin
371
+ # Deletes a model asset class
372
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_asset_class_with_http_info(
373
+ model_asset_class_id: model_asset_class_id,
374
+ )
375
+ p status_code # => 2xx
376
+ p headers # => { ... }
377
+ p data # => nil
378
+ rescue SnapTrade::ApiError => e
379
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_asset_class: #{e}"
380
+ end
381
+ ```
382
+
383
+ ### Parameters
384
+
385
+ | Name | Type | Description | Notes |
386
+ | ---- | ---- | ----------- | ----- |
387
+ | **model_asset_class_id** | **String** | The ID of the model asset class to delete. | |
388
+
389
+ ### Return type
390
+
391
+ nil (empty response body)
392
+
393
+ ## delete_excluded_asset
394
+
395
+ Unexclude an asset from a portfolio group
396
+
397
+ ### Example
398
+
399
+ ```ruby
400
+ require 'snaptrade'
401
+
402
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
403
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
404
+
405
+ portfolio_group_id = "portfolioGroupId_example"
406
+ symbol_id = "symbolId_example"
407
+
408
+ begin
409
+ # Unexclude an asset from a portfolio group
410
+ SnapTrade::PortfolioManagement.delete_excluded_asset(
411
+ portfolio_group_id: portfolio_group_id,
412
+ symbol_id: symbol_id,
413
+ )
414
+ rescue SnapTrade::ApiError => e
415
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_excluded_asset: #{e}"
416
+ end
417
+ ```
418
+
419
+ #### Using the delete_excluded_asset_with_http_info variant
420
+
421
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
422
+
423
+ ```ruby
424
+ portfolio_group_id = "portfolioGroupId_example"
425
+ symbol_id = "symbolId_example"
426
+
427
+ begin
428
+ # Unexclude an asset from a portfolio group
429
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_excluded_asset_with_http_info(
430
+ portfolio_group_id: portfolio_group_id,
431
+ symbol_id: symbol_id,
432
+ )
433
+ p status_code # => 2xx
434
+ p headers # => { ... }
435
+ p data # => nil
436
+ rescue SnapTrade::ApiError => e
437
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_excluded_asset: #{e}"
438
+ end
439
+ ```
440
+
441
+ ### Parameters
442
+
443
+ | Name | Type | Description | Notes |
444
+ | ---- | ---- | ----------- | ----- |
445
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to unexclude an asset. | |
446
+ | **symbol_id** | **String** | The ID of the excluded asset Symbol to delete. | |
447
+
448
+ ### Return type
449
+
450
+ nil (empty response body)
451
+
452
+ ## delete_model_portfolio_by_id
453
+
454
+ Deletes a model portfolio
455
+
456
+ ### Example
457
+
458
+ ```ruby
459
+ require 'snaptrade'
460
+
461
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
462
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
463
+
464
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
465
+
466
+ begin
467
+ # Deletes a model portfolio
468
+ SnapTrade::PortfolioManagement.delete_model_portfolio_by_id(
469
+ model_portfolio_id: model_portfolio_id,
470
+ )
471
+ rescue SnapTrade::ApiError => e
472
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_model_portfolio_by_id: #{e}"
473
+ end
474
+ ```
475
+
476
+ #### Using the delete_model_portfolio_by_id_with_http_info variant
477
+
478
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
479
+
480
+ ```ruby
481
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
482
+
483
+ begin
484
+ # Deletes a model portfolio
485
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_model_portfolio_by_id_with_http_info(
486
+ model_portfolio_id: model_portfolio_id,
487
+ )
488
+ p status_code # => 2xx
489
+ p headers # => { ... }
490
+ p data # => nil
491
+ rescue SnapTrade::ApiError => e
492
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_model_portfolio_by_id: #{e}"
493
+ end
494
+ ```
495
+
496
+ ### Parameters
497
+
498
+ | Name | Type | Description | Notes |
499
+ | ---- | ---- | ----------- | ----- |
500
+ | **model_portfolio_id** | **String** | The ID of the model portfolio to delete. | |
501
+
502
+ ### Return type
503
+
504
+ nil (empty response body)
505
+
506
+ ## delete_portfoli
507
+
508
+ Remove a target portfolio.
509
+
510
+ ### Example
511
+
512
+ ```ruby
513
+ require 'snaptrade'
514
+
515
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
516
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
517
+
518
+ portfolio_group_id = "portfolioGroupId_example"
519
+
520
+ begin
521
+ # Remove a target portfolio.
522
+ result = SnapTrade::PortfolioManagement.delete_portfoli(
523
+ portfolio_group_id: portfolio_group_id,
524
+ )
525
+ p result
526
+ rescue SnapTrade::ApiError => e
527
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfoli: #{e}"
528
+ end
529
+ ```
530
+
531
+ #### Using the delete_portfoli_with_http_info variant
532
+
533
+ This returns an Array which contains the response data, status code and headers.
534
+
535
+ ```ruby
536
+ portfolio_group_id = "portfolioGroupId_example"
537
+
538
+ begin
539
+ # Remove a target portfolio.
540
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_portfoli_with_http_info(
541
+ portfolio_group_id: portfolio_group_id,
542
+ )
543
+ p status_code # => 2xx
544
+ p headers # => { ... }
545
+ p data # => PortfolioGroup
546
+ rescue SnapTrade::ApiError => e
547
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfoli: #{e}"
548
+ end
549
+ ```
550
+
551
+ ### Parameters
552
+
553
+ | Name | Type | Description | Notes |
554
+ | ---- | ---- | ----------- | ----- |
555
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to delete. | |
556
+
557
+ ### Return type
558
+
559
+ [**PortfolioGroup**](PortfolioGroup.md)
560
+
561
+ ## delete_portfolio_target_by_id
562
+
563
+ Remove a TargetAsset.
564
+
565
+ ### Example
566
+
567
+ ```ruby
568
+ require 'snaptrade'
569
+
570
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
571
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
572
+
573
+ portfolio_group_id = "portfolioGroupId_example"
574
+ target_asset_id = "targetAssetId_example"
575
+
576
+ begin
577
+ # Remove a TargetAsset.
578
+ result = SnapTrade::PortfolioManagement.delete_portfolio_target_by_id(
579
+ portfolio_group_id: portfolio_group_id,
580
+ target_asset_id: target_asset_id,
581
+ )
582
+ p result
583
+ rescue SnapTrade::ApiError => e
584
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfolio_target_by_id: #{e}"
585
+ end
586
+ ```
587
+
588
+ #### Using the delete_portfolio_target_by_id_with_http_info variant
589
+
590
+ This returns an Array which contains the response data, status code and headers.
591
+
592
+ ```ruby
593
+ portfolio_group_id = "portfolioGroupId_example"
594
+ target_asset_id = "targetAssetId_example"
595
+
596
+ begin
597
+ # Remove a TargetAsset.
598
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.delete_portfolio_target_by_id_with_http_info(
599
+ portfolio_group_id: portfolio_group_id,
600
+ target_asset_id: target_asset_id,
601
+ )
602
+ p status_code # => 2xx
603
+ p headers # => { ... }
604
+ p data # => TargetAsset
605
+ rescue SnapTrade::ApiError => e
606
+ puts "Exception when calling SnapTrade::PortfolioManagement.delete_portfolio_target_by_id: #{e}"
607
+ end
608
+ ```
609
+
610
+ ### Parameters
611
+
612
+ | Name | Type | Description | Notes |
613
+ | ---- | ---- | ----------- | ----- |
614
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to remove the target asset. | |
615
+ | **target_asset_id** | **String** | The ID of the TargetAsset to delete. | |
616
+
617
+ ### Return type
618
+
619
+ [**TargetAsset**](TargetAsset.md)
620
+
621
+ ## detail_asset_class
622
+
623
+ Get details of a model asset class
624
+
625
+ ### Example
626
+
627
+ ```ruby
628
+ require 'snaptrade'
629
+
630
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
631
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
632
+
633
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
634
+
635
+ begin
636
+ # Get details of a model asset class
637
+ result = SnapTrade::PortfolioManagement.detail_asset_class(
638
+ model_asset_class_id: model_asset_class_id,
639
+ )
640
+ p result
641
+ rescue SnapTrade::ApiError => e
642
+ puts "Exception when calling SnapTrade::PortfolioManagement.detail_asset_class: #{e}"
643
+ end
644
+ ```
645
+
646
+ #### Using the detail_asset_class_with_http_info variant
647
+
648
+ This returns an Array which contains the response data, status code and headers.
649
+
650
+ ```ruby
651
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
652
+
653
+ begin
654
+ # Get details of a model asset class
655
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.detail_asset_class_with_http_info(
656
+ model_asset_class_id: model_asset_class_id,
657
+ )
658
+ p status_code # => 2xx
659
+ p headers # => { ... }
660
+ p data # => ModelAssetClassDetails
661
+ rescue SnapTrade::ApiError => e
662
+ puts "Exception when calling SnapTrade::PortfolioManagement.detail_asset_class: #{e}"
663
+ end
664
+ ```
665
+
666
+ ### Parameters
667
+
668
+ | Name | Type | Description | Notes |
669
+ | ---- | ---- | ----------- | ----- |
670
+ | **model_asset_class_id** | **String** | The ID of the model asset class to get. | |
671
+
672
+ ### Return type
673
+
674
+ [**ModelAssetClassDetails**](ModelAssetClassDetails.md)
675
+
676
+ ## get_calculated_trade_by_id
677
+
678
+ Return an individual trade
679
+
680
+ ### Example
681
+
682
+ ```ruby
683
+ require 'snaptrade'
684
+
685
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
686
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
687
+
688
+ portfolio_group_id = "portfolioGroupId_example"
689
+ calculated_trade_id = "calculatedTradeId_example"
690
+ trade_id = "TradeId_example"
691
+
692
+ begin
693
+ # Return an individual trade
694
+ result = SnapTrade::PortfolioManagement.get_calculated_trade_by_id(
695
+ portfolio_group_id: portfolio_group_id,
696
+ calculated_trade_id: calculated_trade_id,
697
+ trade_id: trade_id,
698
+ )
699
+ p result
700
+ rescue SnapTrade::ApiError => e
701
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_calculated_trade_by_id: #{e}"
702
+ end
703
+ ```
704
+
705
+ #### Using the get_calculated_trade_by_id_with_http_info variant
706
+
707
+ This returns an Array which contains the response data, status code and headers.
708
+
709
+ ```ruby
710
+ portfolio_group_id = "portfolioGroupId_example"
711
+ calculated_trade_id = "calculatedTradeId_example"
712
+ trade_id = "TradeId_example"
713
+
714
+ begin
715
+ # Return an individual trade
716
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_calculated_trade_by_id_with_http_info(
717
+ portfolio_group_id: portfolio_group_id,
718
+ calculated_trade_id: calculated_trade_id,
719
+ trade_id: trade_id,
720
+ )
721
+ p status_code # => 2xx
722
+ p headers # => { ... }
723
+ p data # => Array<Trade>
724
+ rescue SnapTrade::ApiError => e
725
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_calculated_trade_by_id: #{e}"
726
+ end
727
+ ```
728
+
729
+ ### Parameters
730
+
731
+ | Name | Type | Description | Notes |
732
+ | ---- | ---- | ----------- | ----- |
733
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to perform rebalancing calculations | |
734
+ | **calculated_trade_id** | **String** | The ID of calculated trade to get account impact | |
735
+ | **trade_id** | **String** | The ID of trade object | |
736
+
737
+ ### Return type
738
+
739
+ [**Array&lt;Trade&gt;**](Trade.md)
740
+
741
+ ## get_model_details_by_id
742
+
743
+ Get details of a model portfolio
744
+
745
+ ### Example
746
+
747
+ ```ruby
748
+ require 'snaptrade'
749
+
750
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
751
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
752
+
753
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
754
+
755
+ begin
756
+ # Get details of a model portfolio
757
+ result = SnapTrade::PortfolioManagement.get_model_details_by_id(
758
+ model_portfolio_id: model_portfolio_id,
759
+ )
760
+ p result
761
+ rescue SnapTrade::ApiError => e
762
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_model_details_by_id: #{e}"
763
+ end
764
+ ```
765
+
766
+ #### Using the get_model_details_by_id_with_http_info variant
767
+
768
+ This returns an Array which contains the response data, status code and headers.
769
+
770
+ ```ruby
771
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
772
+
773
+ begin
774
+ # Get details of a model portfolio
775
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_model_details_by_id_with_http_info(
776
+ model_portfolio_id: model_portfolio_id,
777
+ )
778
+ p status_code # => 2xx
779
+ p headers # => { ... }
780
+ p data # => ModelPortfolioDetails
781
+ rescue SnapTrade::ApiError => e
782
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_model_details_by_id: #{e}"
783
+ end
784
+ ```
785
+
786
+ ### Parameters
787
+
788
+ | Name | Type | Description | Notes |
789
+ | ---- | ---- | ----------- | ----- |
790
+ | **model_portfolio_id** | **String** | The ID of the model portfolio to get. | |
791
+
792
+ ### Return type
793
+
794
+ [**ModelPortfolioDetails**](ModelPortfolioDetails.md)
795
+
796
+ ## get_portfolio_balances
797
+
798
+ Get sum of cash balances in portfolio group
799
+
800
+ ### Example
801
+
802
+ ```ruby
803
+ require 'snaptrade'
804
+
805
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
806
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
807
+
808
+ portfolio_group_id = "portfolioGroupId_example"
809
+
810
+ begin
811
+ # Get sum of cash balances in portfolio group
812
+ result = SnapTrade::PortfolioManagement.get_portfolio_balances(
813
+ portfolio_group_id: portfolio_group_id,
814
+ )
815
+ p result
816
+ rescue SnapTrade::ApiError => e
817
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_balances: #{e}"
818
+ end
819
+ ```
820
+
821
+ #### Using the get_portfolio_balances_with_http_info variant
822
+
823
+ This returns an Array which contains the response data, status code and headers.
824
+
825
+ ```ruby
826
+ portfolio_group_id = "portfolioGroupId_example"
827
+
828
+ begin
829
+ # Get sum of cash balances in portfolio group
830
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_balances_with_http_info(
831
+ portfolio_group_id: portfolio_group_id,
832
+ )
833
+ p status_code # => 2xx
834
+ p headers # => { ... }
835
+ p data # => Array<Balance>
836
+ rescue SnapTrade::ApiError => e
837
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_balances: #{e}"
838
+ end
839
+ ```
840
+
841
+ ### Parameters
842
+
843
+ | Name | Type | Description | Notes |
844
+ | ---- | ---- | ----------- | ----- |
845
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
846
+
847
+ ### Return type
848
+
849
+ [**Array&lt;Balance&gt;**](Balance.md)
850
+
851
+ ## get_portfolio_details_by_id
852
+
853
+ Get details of a target portfolio
854
+
855
+ ### Example
856
+
857
+ ```ruby
858
+ require 'snaptrade'
859
+
860
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
861
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
862
+
863
+ portfolio_group_id = "portfolioGroupId_example"
864
+
865
+ begin
866
+ # Get details of a target portfolio
867
+ result = SnapTrade::PortfolioManagement.get_portfolio_details_by_id(
868
+ portfolio_group_id: portfolio_group_id,
869
+ )
870
+ p result
871
+ rescue SnapTrade::ApiError => e
872
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_details_by_id: #{e}"
873
+ end
874
+ ```
875
+
876
+ #### Using the get_portfolio_details_by_id_with_http_info variant
877
+
878
+ This returns an Array which contains the response data, status code and headers.
879
+
880
+ ```ruby
881
+ portfolio_group_id = "portfolioGroupId_example"
882
+
883
+ begin
884
+ # Get details of a target portfolio
885
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_details_by_id_with_http_info(
886
+ portfolio_group_id: portfolio_group_id,
887
+ )
888
+ p status_code # => 2xx
889
+ p headers # => { ... }
890
+ p data # => PortfolioGroup
891
+ rescue SnapTrade::ApiError => e
892
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_details_by_id: #{e}"
893
+ end
894
+ ```
895
+
896
+ ### Parameters
897
+
898
+ | Name | Type | Description | Notes |
899
+ | ---- | ---- | ----------- | ----- |
900
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to get. | |
901
+
902
+ ### Return type
903
+
904
+ [**PortfolioGroup**](PortfolioGroup.md)
905
+
906
+ ## get_portfolio_info
907
+
908
+ Return a whole bunch of relevant information relating to a portfolio group.
909
+
910
+ ### Example
911
+
912
+ ```ruby
913
+ require 'snaptrade'
914
+
915
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
916
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
917
+
918
+ portfolio_group_id = "portfolioGroupId_example"
919
+
920
+ begin
921
+ # Return a whole bunch of relevant information relating to a portfolio group.
922
+ result = SnapTrade::PortfolioManagement.get_portfolio_info(
923
+ portfolio_group_id: portfolio_group_id,
924
+ )
925
+ p result
926
+ rescue SnapTrade::ApiError => e
927
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_info: #{e}"
928
+ end
929
+ ```
930
+
931
+ #### Using the get_portfolio_info_with_http_info variant
932
+
933
+ This returns an Array which contains the response data, status code and headers.
934
+
935
+ ```ruby
936
+ portfolio_group_id = "portfolioGroupId_example"
937
+
938
+ begin
939
+ # Return a whole bunch of relevant information relating to a portfolio group.
940
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_info_with_http_info(
941
+ portfolio_group_id: portfolio_group_id,
942
+ )
943
+ p status_code # => 2xx
944
+ p headers # => { ... }
945
+ p data # => PortfolioGroupInfo
946
+ rescue SnapTrade::ApiError => e
947
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_info: #{e}"
948
+ end
949
+ ```
950
+
951
+ ### Parameters
952
+
953
+ | Name | Type | Description | Notes |
954
+ | ---- | ---- | ----------- | ----- |
955
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
956
+
957
+ ### Return type
958
+
959
+ [**PortfolioGroupInfo**](PortfolioGroupInfo.md)
960
+
961
+ ## get_portfolio_settings
962
+
963
+ Get portfolio group settings
964
+
965
+ ### Example
966
+
967
+ ```ruby
968
+ require 'snaptrade'
969
+
970
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
971
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
972
+
973
+ portfolio_group_id = "portfolioGroupId_example"
974
+
975
+ begin
976
+ # Get portfolio group settings
977
+ result = SnapTrade::PortfolioManagement.get_portfolio_settings(
978
+ portfolio_group_id: portfolio_group_id,
979
+ )
980
+ p result
981
+ rescue SnapTrade::ApiError => e
982
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_settings: #{e}"
983
+ end
984
+ ```
985
+
986
+ #### Using the get_portfolio_settings_with_http_info variant
987
+
988
+ This returns an Array which contains the response data, status code and headers.
989
+
990
+ ```ruby
991
+ portfolio_group_id = "portfolioGroupId_example"
992
+
993
+ begin
994
+ # Get portfolio group settings
995
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_settings_with_http_info(
996
+ portfolio_group_id: portfolio_group_id,
997
+ )
998
+ p status_code # => 2xx
999
+ p headers # => { ... }
1000
+ p data # => PortfolioGroupSettings
1001
+ rescue SnapTrade::ApiError => e
1002
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_settings: #{e}"
1003
+ end
1004
+ ```
1005
+
1006
+ ### Parameters
1007
+
1008
+ | Name | Type | Description | Notes |
1009
+ | ---- | ---- | ----------- | ----- |
1010
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to get the settings. | |
1011
+
1012
+ ### Return type
1013
+
1014
+ [**PortfolioGroupSettings**](PortfolioGroupSettings.md)
1015
+
1016
+ ## get_portfolio_target_by_id
1017
+
1018
+ Get a specific target from a portfolio group
1019
+
1020
+ ### Example
1021
+
1022
+ ```ruby
1023
+ require 'snaptrade'
1024
+
1025
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1026
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1027
+
1028
+ portfolio_group_id = "portfolioGroupId_example"
1029
+ target_asset_id = "targetAssetId_example"
1030
+
1031
+ begin
1032
+ # Get a specific target from a portfolio group
1033
+ result = SnapTrade::PortfolioManagement.get_portfolio_target_by_id(
1034
+ portfolio_group_id: portfolio_group_id,
1035
+ target_asset_id: target_asset_id,
1036
+ )
1037
+ p result
1038
+ rescue SnapTrade::ApiError => e
1039
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_target_by_id: #{e}"
1040
+ end
1041
+ ```
1042
+
1043
+ #### Using the get_portfolio_target_by_id_with_http_info variant
1044
+
1045
+ This returns an Array which contains the response data, status code and headers.
1046
+
1047
+ ```ruby
1048
+ portfolio_group_id = "portfolioGroupId_example"
1049
+ target_asset_id = "targetAssetId_example"
1050
+
1051
+ begin
1052
+ # Get a specific target from a portfolio group
1053
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_target_by_id_with_http_info(
1054
+ portfolio_group_id: portfolio_group_id,
1055
+ target_asset_id: target_asset_id,
1056
+ )
1057
+ p status_code # => 2xx
1058
+ p headers # => { ... }
1059
+ p data # => TargetAsset
1060
+ rescue SnapTrade::ApiError => e
1061
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_target_by_id: #{e}"
1062
+ end
1063
+ ```
1064
+
1065
+ ### Parameters
1066
+
1067
+ | Name | Type | Description | Notes |
1068
+ | ---- | ---- | ----------- | ----- |
1069
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to get the target asset. | |
1070
+ | **target_asset_id** | **String** | The ID of the TargetAsset to get. | |
1071
+
1072
+ ### Return type
1073
+
1074
+ [**TargetAsset**](TargetAsset.md)
1075
+
1076
+ ## get_portfolio_targets
1077
+
1078
+ Get all target assets under the specified PortfolioGroup.
1079
+
1080
+ ### Example
1081
+
1082
+ ```ruby
1083
+ require 'snaptrade'
1084
+
1085
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1086
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1087
+
1088
+ portfolio_group_id = "portfolioGroupId_example"
1089
+
1090
+ begin
1091
+ # Get all target assets under the specified PortfolioGroup.
1092
+ result = SnapTrade::PortfolioManagement.get_portfolio_targets(
1093
+ portfolio_group_id: portfolio_group_id,
1094
+ )
1095
+ p result
1096
+ rescue SnapTrade::ApiError => e
1097
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_targets: #{e}"
1098
+ end
1099
+ ```
1100
+
1101
+ #### Using the get_portfolio_targets_with_http_info variant
1102
+
1103
+ This returns an Array which contains the response data, status code and headers.
1104
+
1105
+ ```ruby
1106
+ portfolio_group_id = "portfolioGroupId_example"
1107
+
1108
+ begin
1109
+ # Get all target assets under the specified PortfolioGroup.
1110
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portfolio_targets_with_http_info(
1111
+ portfolio_group_id: portfolio_group_id,
1112
+ )
1113
+ p status_code # => 2xx
1114
+ p headers # => { ... }
1115
+ p data # => Array<TargetAsset>
1116
+ rescue SnapTrade::ApiError => e
1117
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portfolio_targets: #{e}"
1118
+ end
1119
+ ```
1120
+
1121
+ ### Parameters
1122
+
1123
+ | Name | Type | Description | Notes |
1124
+ | ---- | ---- | ----------- | ----- |
1125
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1126
+
1127
+ ### Return type
1128
+
1129
+ [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1130
+
1131
+ ## get_portoflio_excluded_assets
1132
+
1133
+ Get an array of excluded assets associated with a portfolio group\\
1134
+
1135
+ ### Example
1136
+
1137
+ ```ruby
1138
+ require 'snaptrade'
1139
+
1140
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1141
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1142
+
1143
+ portfolio_group_id = "portfolioGroupId_example"
1144
+
1145
+ begin
1146
+ # Get an array of excluded assets associated with a portfolio group\\
1147
+ result = SnapTrade::PortfolioManagement.get_portoflio_excluded_assets(
1148
+ portfolio_group_id: portfolio_group_id,
1149
+ )
1150
+ p result
1151
+ rescue SnapTrade::ApiError => e
1152
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portoflio_excluded_assets: #{e}"
1153
+ end
1154
+ ```
1155
+
1156
+ #### Using the get_portoflio_excluded_assets_with_http_info variant
1157
+
1158
+ This returns an Array which contains the response data, status code and headers.
1159
+
1160
+ ```ruby
1161
+ portfolio_group_id = "portfolioGroupId_example"
1162
+
1163
+ begin
1164
+ # Get an array of excluded assets associated with a portfolio group\\
1165
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.get_portoflio_excluded_assets_with_http_info(
1166
+ portfolio_group_id: portfolio_group_id,
1167
+ )
1168
+ p status_code # => 2xx
1169
+ p headers # => { ... }
1170
+ p data # => Array<ExcludedAsset>
1171
+ rescue SnapTrade::ApiError => e
1172
+ puts "Exception when calling SnapTrade::PortfolioManagement.get_portoflio_excluded_assets: #{e}"
1173
+ end
1174
+ ```
1175
+
1176
+ ### Parameters
1177
+
1178
+ | Name | Type | Description | Notes |
1179
+ | ---- | ---- | ----------- | ----- |
1180
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which the excluded assets are linked. | |
1181
+
1182
+ ### Return type
1183
+
1184
+ [**Array&lt;ExcludedAsset&gt;**](ExcludedAsset.md)
1185
+
1186
+ ## import_model_portfolio
1187
+
1188
+ Import target allocation based on portfolio group
1189
+
1190
+ ### Example
1191
+
1192
+ ```ruby
1193
+ require 'snaptrade'
1194
+
1195
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1196
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1197
+
1198
+ portfolio_group_id = "portfolioGroupId_example"
1199
+
1200
+ begin
1201
+ # Import target allocation based on portfolio group
1202
+ result = SnapTrade::PortfolioManagement.import_model_portfolio(
1203
+ portfolio_group_id: portfolio_group_id,
1204
+ )
1205
+ p result
1206
+ rescue SnapTrade::ApiError => e
1207
+ puts "Exception when calling SnapTrade::PortfolioManagement.import_model_portfolio: #{e}"
1208
+ end
1209
+ ```
1210
+
1211
+ #### Using the import_model_portfolio_with_http_info variant
1212
+
1213
+ This returns an Array which contains the response data, status code and headers.
1214
+
1215
+ ```ruby
1216
+ portfolio_group_id = "portfolioGroupId_example"
1217
+
1218
+ begin
1219
+ # Import target allocation based on portfolio group
1220
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.import_model_portfolio_with_http_info(
1221
+ portfolio_group_id: portfolio_group_id,
1222
+ )
1223
+ p status_code # => 2xx
1224
+ p headers # => { ... }
1225
+ p data # => Array<TargetAsset>
1226
+ rescue SnapTrade::ApiError => e
1227
+ puts "Exception when calling SnapTrade::PortfolioManagement.import_model_portfolio: #{e}"
1228
+ end
1229
+ ```
1230
+
1231
+ ### Parameters
1232
+
1233
+ | Name | Type | Description | Notes |
1234
+ | ---- | ---- | ----------- | ----- |
1235
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1236
+
1237
+ ### Return type
1238
+
1239
+ [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1240
+
1241
+ ## list
1242
+
1243
+ List all portfolio groups
1244
+
1245
+ ### Example
1246
+
1247
+ ```ruby
1248
+ require 'snaptrade'
1249
+
1250
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1251
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1252
+
1253
+ user_id = "John.doe@snaptrade.com"
1254
+ user_secret = "USERSECRET123"
1255
+
1256
+ begin
1257
+ # List all portfolio groups
1258
+ result = SnapTrade::PortfolioManagement.list(
1259
+ user_id: user_id,
1260
+ user_secret: user_secret,
1261
+ )
1262
+ p result
1263
+ rescue SnapTrade::ApiError => e
1264
+ puts "Exception when calling SnapTrade::PortfolioManagement.list: #{e}"
1265
+ end
1266
+ ```
1267
+
1268
+ #### Using the list_with_http_info variant
1269
+
1270
+ This returns an Array which contains the response data, status code and headers.
1271
+
1272
+ ```ruby
1273
+ user_id = "John.doe@snaptrade.com"
1274
+ user_secret = "USERSECRET123"
1275
+
1276
+ begin
1277
+ # List all portfolio groups
1278
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.list_with_http_info(
1279
+ user_id: user_id,
1280
+ user_secret: user_secret,
1281
+ )
1282
+ p status_code # => 2xx
1283
+ p headers # => { ... }
1284
+ p data # => Array<PortfolioGroup>
1285
+ rescue SnapTrade::ApiError => e
1286
+ puts "Exception when calling SnapTrade::PortfolioManagement.list: #{e}"
1287
+ end
1288
+ ```
1289
+
1290
+ ### Parameters
1291
+
1292
+ | Name | Type | Description | Notes |
1293
+ | ---- | ---- | ----------- | ----- |
1294
+ | **user_id** | **String** | | |
1295
+ | **user_secret** | **String** | | |
1296
+
1297
+ ### Return type
1298
+
1299
+ [**Array&lt;PortfolioGroup&gt;**](PortfolioGroup.md)
1300
+
1301
+ ## list_asset_classes
1302
+
1303
+ List of model asset class
1304
+
1305
+ ### Example
1306
+
1307
+ ```ruby
1308
+ require 'snaptrade'
1309
+
1310
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1311
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1312
+
1313
+
1314
+ begin
1315
+ # List of model asset class
1316
+ result = SnapTrade::PortfolioManagement.list_asset_classes
1317
+ p result
1318
+ rescue SnapTrade::ApiError => e
1319
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_asset_classes: #{e}"
1320
+ end
1321
+ ```
1322
+
1323
+ #### Using the list_asset_classes_with_http_info variant
1324
+
1325
+ This returns an Array which contains the response data, status code and headers.
1326
+
1327
+ ```ruby
1328
+
1329
+ begin
1330
+ # List of model asset class
1331
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.list_asset_classes_with_http_info
1332
+ p status_code # => 2xx
1333
+ p headers # => { ... }
1334
+ p data # => Array<ModelAssetClassDetails>
1335
+ rescue SnapTrade::ApiError => e
1336
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_asset_classes: #{e}"
1337
+ end
1338
+ ```
1339
+
1340
+ ### Parameters
1341
+
1342
+ This endpoint does not need any parameter.
1343
+
1344
+ ### Return type
1345
+
1346
+ [**Array&lt;ModelAssetClassDetails&gt;**](ModelAssetClassDetails.md)
1347
+
1348
+ ## list_calculated_trades
1349
+
1350
+ List of trades to make to rebalance portfolio group
1351
+
1352
+ ### Example
1353
+
1354
+ ```ruby
1355
+ require 'snaptrade'
1356
+
1357
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1358
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1359
+
1360
+ portfolio_group_id = "portfolioGroupId_example"
1361
+
1362
+ begin
1363
+ # List of trades to make to rebalance portfolio group
1364
+ result = SnapTrade::PortfolioManagement.list_calculated_trades(
1365
+ portfolio_group_id: portfolio_group_id,
1366
+ )
1367
+ p result
1368
+ rescue SnapTrade::ApiError => e
1369
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_calculated_trades: #{e}"
1370
+ end
1371
+ ```
1372
+
1373
+ #### Using the list_calculated_trades_with_http_info variant
1374
+
1375
+ This returns an Array which contains the response data, status code and headers.
1376
+
1377
+ ```ruby
1378
+ portfolio_group_id = "portfolioGroupId_example"
1379
+
1380
+ begin
1381
+ # List of trades to make to rebalance portfolio group
1382
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.list_calculated_trades_with_http_info(
1383
+ portfolio_group_id: portfolio_group_id,
1384
+ )
1385
+ p status_code # => 2xx
1386
+ p headers # => { ... }
1387
+ p data # => CalculatedTrade
1388
+ rescue SnapTrade::ApiError => e
1389
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_calculated_trades: #{e}"
1390
+ end
1391
+ ```
1392
+
1393
+ ### Parameters
1394
+
1395
+ | Name | Type | Description | Notes |
1396
+ | ---- | ---- | ----------- | ----- |
1397
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to perform rebalancing calculations | |
1398
+
1399
+ ### Return type
1400
+
1401
+ [**CalculatedTrade**](CalculatedTrade.md)
1402
+
1403
+ ## list_model_portfolio
1404
+
1405
+ List of model portfolio
1406
+
1407
+ ### Example
1408
+
1409
+ ```ruby
1410
+ require 'snaptrade'
1411
+
1412
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1413
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1414
+
1415
+
1416
+ begin
1417
+ # List of model portfolio
1418
+ result = SnapTrade::PortfolioManagement.list_model_portfolio
1419
+ p result
1420
+ rescue SnapTrade::ApiError => e
1421
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_model_portfolio: #{e}"
1422
+ end
1423
+ ```
1424
+
1425
+ #### Using the list_model_portfolio_with_http_info variant
1426
+
1427
+ This returns an Array which contains the response data, status code and headers.
1428
+
1429
+ ```ruby
1430
+
1431
+ begin
1432
+ # List of model portfolio
1433
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.list_model_portfolio_with_http_info
1434
+ p status_code # => 2xx
1435
+ p headers # => { ... }
1436
+ p data # => Array<ModelPortfolioDetails>
1437
+ rescue SnapTrade::ApiError => e
1438
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_model_portfolio: #{e}"
1439
+ end
1440
+ ```
1441
+
1442
+ ### Parameters
1443
+
1444
+ This endpoint does not need any parameter.
1445
+
1446
+ ### Return type
1447
+
1448
+ [**Array&lt;ModelPortfolioDetails&gt;**](ModelPortfolioDetails.md)
1449
+
1450
+ ## list_portfolio_accounts
1451
+
1452
+ Get all accounts associated with a portfolio group
1453
+
1454
+ ### Example
1455
+
1456
+ ```ruby
1457
+ require 'snaptrade'
1458
+
1459
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1460
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1461
+
1462
+ portfolio_group_id = "portfolioGroupId_example"
1463
+
1464
+ begin
1465
+ # Get all accounts associated with a portfolio group
1466
+ result = SnapTrade::PortfolioManagement.list_portfolio_accounts(
1467
+ portfolio_group_id: portfolio_group_id,
1468
+ )
1469
+ p result
1470
+ rescue SnapTrade::ApiError => e
1471
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_portfolio_accounts: #{e}"
1472
+ end
1473
+ ```
1474
+
1475
+ #### Using the list_portfolio_accounts_with_http_info variant
1476
+
1477
+ This returns an Array which contains the response data, status code and headers.
1478
+
1479
+ ```ruby
1480
+ portfolio_group_id = "portfolioGroupId_example"
1481
+
1482
+ begin
1483
+ # Get all accounts associated with a portfolio group
1484
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.list_portfolio_accounts_with_http_info(
1485
+ portfolio_group_id: portfolio_group_id,
1486
+ )
1487
+ p status_code # => 2xx
1488
+ p headers # => { ... }
1489
+ p data # => Array<Account>
1490
+ rescue SnapTrade::ApiError => e
1491
+ puts "Exception when calling SnapTrade::PortfolioManagement.list_portfolio_accounts: #{e}"
1492
+ end
1493
+ ```
1494
+
1495
+ ### Parameters
1496
+
1497
+ | Name | Type | Description | Notes |
1498
+ | ---- | ---- | ----------- | ----- |
1499
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which the accounts are linked. | |
1500
+
1501
+ ### Return type
1502
+
1503
+ [**Array&lt;Account&gt;**](Account.md)
1504
+
1505
+ ## modify_model_portfolio_by_id
1506
+
1507
+ Updates model portfolio object
1508
+
1509
+ ### Example
1510
+
1511
+ ```ruby
1512
+ require 'snaptrade'
1513
+
1514
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1515
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1516
+
1517
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1518
+ model_portfolio = {
1519
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1520
+ "name" => "Passiv 5x Aggressive Growth Fund",
1521
+ "model_type" => -1,
1522
+ }
1523
+ model_portfolio_security = [
1524
+ {
1525
+ "percent" => 100,
1526
+ }
1527
+ ]
1528
+ model_portfolio_asset_class = [
1529
+ {
1530
+ "percent" => 100,
1531
+ }
1532
+ ]
1533
+
1534
+ begin
1535
+ # Updates model portfolio object
1536
+ SnapTrade::PortfolioManagement.modify_model_portfolio_by_id(
1537
+ model_portfolio_id: model_portfolio_id,
1538
+ model_portfolio: model_portfolio,
1539
+ model_portfolio_security: model_portfolio_security,
1540
+ model_portfolio_asset_class: model_portfolio_asset_class,
1541
+ )
1542
+ rescue SnapTrade::ApiError => e
1543
+ puts "Exception when calling SnapTrade::PortfolioManagement.modify_model_portfolio_by_id: #{e}"
1544
+ end
1545
+ ```
1546
+
1547
+ #### Using the modify_model_portfolio_by_id_with_http_info variant
1548
+
1549
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
1550
+
1551
+ ```ruby
1552
+ model_portfolio_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1553
+ model_portfolio = {
1554
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1555
+ "name" => "Passiv 5x Aggressive Growth Fund",
1556
+ "model_type" => -1,
1557
+ }
1558
+ model_portfolio_security = [
1559
+ {
1560
+ "percent" => 100,
1561
+ }
1562
+ ]
1563
+ model_portfolio_asset_class = [
1564
+ {
1565
+ "percent" => 100,
1566
+ }
1567
+ ]
1568
+
1569
+ begin
1570
+ # Updates model portfolio object
1571
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.modify_model_portfolio_by_id_with_http_info(
1572
+ model_portfolio_id: model_portfolio_id,
1573
+ model_portfolio: model_portfolio,
1574
+ model_portfolio_security: model_portfolio_security,
1575
+ model_portfolio_asset_class: model_portfolio_asset_class,
1576
+ )
1577
+ p status_code # => 2xx
1578
+ p headers # => { ... }
1579
+ p data # => nil
1580
+ rescue SnapTrade::ApiError => e
1581
+ puts "Exception when calling SnapTrade::PortfolioManagement.modify_model_portfolio_by_id: #{e}"
1582
+ end
1583
+ ```
1584
+
1585
+ ### Parameters
1586
+
1587
+ | Name | Type | Description | Notes |
1588
+ | ---- | ---- | ----------- | ----- |
1589
+ | **model_portfolio_id** | **String** | The ID of the model portfolio to update. | |
1590
+ | **model_portfolio_details** | [**ModelPortfolioDetails**](ModelPortfolioDetails.md) | 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 | |
1591
+
1592
+ ### Return type
1593
+
1594
+ nil (empty response body)
1595
+
1596
+ ## save_portfolio
1597
+
1598
+ Update an existing target portfolio.
1599
+
1600
+ ### Example
1601
+
1602
+ ```ruby
1603
+ require 'snaptrade'
1604
+
1605
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1606
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1607
+
1608
+ portfolio_group_id = "portfolioGroupId_example"
1609
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1610
+ name = "Combined Retirement Portfolio"
1611
+
1612
+ begin
1613
+ # Update an existing target portfolio.
1614
+ result = SnapTrade::PortfolioManagement.save_portfolio(
1615
+ portfolio_group_id: portfolio_group_id,
1616
+ id: id,
1617
+ name: name,
1618
+ )
1619
+ p result
1620
+ rescue SnapTrade::ApiError => e
1621
+ puts "Exception when calling SnapTrade::PortfolioManagement.save_portfolio: #{e}"
1622
+ end
1623
+ ```
1624
+
1625
+ #### Using the save_portfolio_with_http_info variant
1626
+
1627
+ This returns an Array which contains the response data, status code and headers.
1628
+
1629
+ ```ruby
1630
+ portfolio_group_id = "portfolioGroupId_example"
1631
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1632
+ name = "Combined Retirement Portfolio"
1633
+
1634
+ begin
1635
+ # Update an existing target portfolio.
1636
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.save_portfolio_with_http_info(
1637
+ portfolio_group_id: portfolio_group_id,
1638
+ id: id,
1639
+ name: name,
1640
+ )
1641
+ p status_code # => 2xx
1642
+ p headers # => { ... }
1643
+ p data # => PortfolioGroup
1644
+ rescue SnapTrade::ApiError => e
1645
+ puts "Exception when calling SnapTrade::PortfolioManagement.save_portfolio: #{e}"
1646
+ end
1647
+ ```
1648
+
1649
+ ### Parameters
1650
+
1651
+ | Name | Type | Description | Notes |
1652
+ | ---- | ---- | ----------- | ----- |
1653
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to update. | |
1654
+ | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | |
1655
+
1656
+ ### Return type
1657
+
1658
+ [**PortfolioGroup**](PortfolioGroup.md)
1659
+
1660
+ ## search_portfolio_symbols
1661
+
1662
+ Search for symbols limited to brokerages under the specified portfolio group
1663
+
1664
+ ### Example
1665
+
1666
+ ```ruby
1667
+ require 'snaptrade'
1668
+
1669
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1670
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1671
+
1672
+ portfolio_group_id = "portfolioGroupId_example"
1673
+ substring = "apple"
1674
+
1675
+ begin
1676
+ # Search for symbols limited to brokerages under the specified portfolio group
1677
+ result = SnapTrade::PortfolioManagement.search_portfolio_symbols(
1678
+ portfolio_group_id: portfolio_group_id,
1679
+ substring: substring,
1680
+ )
1681
+ p result
1682
+ rescue SnapTrade::ApiError => e
1683
+ puts "Exception when calling SnapTrade::PortfolioManagement.search_portfolio_symbols: #{e}"
1684
+ end
1685
+ ```
1686
+
1687
+ #### Using the search_portfolio_symbols_with_http_info variant
1688
+
1689
+ This returns an Array which contains the response data, status code and headers.
1690
+
1691
+ ```ruby
1692
+ portfolio_group_id = "portfolioGroupId_example"
1693
+ substring = "apple"
1694
+
1695
+ begin
1696
+ # Search for symbols limited to brokerages under the specified portfolio group
1697
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.search_portfolio_symbols_with_http_info(
1698
+ portfolio_group_id: portfolio_group_id,
1699
+ substring: substring,
1700
+ )
1701
+ p status_code # => 2xx
1702
+ p headers # => { ... }
1703
+ p data # => Array<UniversalSymbol>
1704
+ rescue SnapTrade::ApiError => e
1705
+ puts "Exception when calling SnapTrade::PortfolioManagement.search_portfolio_symbols: #{e}"
1706
+ end
1707
+ ```
1708
+
1709
+ ### Parameters
1710
+
1711
+ | Name | Type | Description | Notes |
1712
+ | ---- | ---- | ----------- | ----- |
1713
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup to search under | |
1714
+ | **symbol_query** | [**SymbolQuery**](SymbolQuery.md) | | [optional] |
1715
+
1716
+ ### Return type
1717
+
1718
+ [**Array&lt;UniversalSymbol&gt;**](UniversalSymbol.md)
1719
+
1720
+ ## set_portfolio_targets
1721
+
1722
+ 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.
1723
+
1724
+ ### Example
1725
+
1726
+ ```ruby
1727
+ require 'snaptrade'
1728
+
1729
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1730
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1731
+
1732
+ portfolio_group_id = "portfolioGroupId_example"
1733
+ body = [
1734
+ {
1735
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1736
+ "percent" => 90,
1737
+ "is_supported" => True,
1738
+ "is_excluded" => True,
1739
+ }
1740
+ ]
1741
+
1742
+ begin
1743
+ # 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.
1744
+ result = SnapTrade::PortfolioManagement.set_portfolio_targets(
1745
+ portfolio_group_id: portfolio_group_id,
1746
+ body: body,
1747
+ )
1748
+ p result
1749
+ rescue SnapTrade::ApiError => e
1750
+ puts "Exception when calling SnapTrade::PortfolioManagement.set_portfolio_targets: #{e}"
1751
+ end
1752
+ ```
1753
+
1754
+ #### Using the set_portfolio_targets_with_http_info variant
1755
+
1756
+ This returns an Array which contains the response data, status code and headers.
1757
+
1758
+ ```ruby
1759
+ portfolio_group_id = "portfolioGroupId_example"
1760
+ body = [
1761
+ {
1762
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1763
+ "percent" => 90,
1764
+ "is_supported" => True,
1765
+ "is_excluded" => True,
1766
+ }
1767
+ ]
1768
+
1769
+ begin
1770
+ # 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.
1771
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.set_portfolio_targets_with_http_info(
1772
+ portfolio_group_id: portfolio_group_id,
1773
+ body: body,
1774
+ )
1775
+ p status_code # => 2xx
1776
+ p headers # => { ... }
1777
+ p data # => Array<TargetAsset>
1778
+ rescue SnapTrade::ApiError => e
1779
+ puts "Exception when calling SnapTrade::PortfolioManagement.set_portfolio_targets: #{e}"
1780
+ end
1781
+ ```
1782
+
1783
+ ### Parameters
1784
+
1785
+ | Name | Type | Description | Notes |
1786
+ | ---- | ---- | ----------- | ----- |
1787
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to create the target asset. | |
1788
+ | **target_asset** | [**Array&lt;TargetAsset&gt;**](TargetAsset.md) | | [optional] |
1789
+
1790
+ ### Return type
1791
+
1792
+ [**Array&lt;TargetAsset&gt;**](TargetAsset.md)
1793
+
1794
+ ## update_asset_class
1795
+
1796
+ Updates model asset class objects
1797
+
1798
+ ### Example
1799
+
1800
+ ```ruby
1801
+ require 'snaptrade'
1802
+
1803
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1804
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1805
+
1806
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1807
+ model_asset_class = {
1808
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1809
+ "name" => "Bonds",
1810
+ }
1811
+ model_asset_class_target = [
1812
+ {
1813
+ }
1814
+ ]
1815
+
1816
+ begin
1817
+ # Updates model asset class objects
1818
+ SnapTrade::PortfolioManagement.update_asset_class(
1819
+ model_asset_class_id: model_asset_class_id,
1820
+ model_asset_class: model_asset_class,
1821
+ model_asset_class_target: model_asset_class_target,
1822
+ )
1823
+ rescue SnapTrade::ApiError => e
1824
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_asset_class: #{e}"
1825
+ end
1826
+ ```
1827
+
1828
+ #### Using the update_asset_class_with_http_info variant
1829
+
1830
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
1831
+
1832
+ ```ruby
1833
+ model_asset_class_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1834
+ model_asset_class = {
1835
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1836
+ "name" => "Bonds",
1837
+ }
1838
+ model_asset_class_target = [
1839
+ {
1840
+ }
1841
+ ]
1842
+
1843
+ begin
1844
+ # Updates model asset class objects
1845
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.update_asset_class_with_http_info(
1846
+ model_asset_class_id: model_asset_class_id,
1847
+ model_asset_class: model_asset_class,
1848
+ model_asset_class_target: model_asset_class_target,
1849
+ )
1850
+ p status_code # => 2xx
1851
+ p headers # => { ... }
1852
+ p data # => nil
1853
+ rescue SnapTrade::ApiError => e
1854
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_asset_class: #{e}"
1855
+ end
1856
+ ```
1857
+
1858
+ ### Parameters
1859
+
1860
+ | Name | Type | Description | Notes |
1861
+ | ---- | ---- | ----------- | ----- |
1862
+ | **model_asset_class_id** | **String** | The ID of the model asset class to update. | |
1863
+ | **model_asset_class_details** | [**ModelAssetClassDetails**](ModelAssetClassDetails.md) | 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 | |
1864
+
1865
+ ### Return type
1866
+
1867
+ nil (empty response body)
1868
+
1869
+ ## update_portfolio_settings
1870
+
1871
+ Updates portfolio group settings
1872
+
1873
+ ### Example
1874
+
1875
+ ```ruby
1876
+ require 'snaptrade'
1877
+
1878
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1879
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1880
+
1881
+ portfolio_group_id = "portfolioGroupId_example"
1882
+
1883
+ begin
1884
+ # Updates portfolio group settings
1885
+ result = SnapTrade::PortfolioManagement.update_portfolio_settings(
1886
+ portfolio_group_id: portfolio_group_id,
1887
+ )
1888
+ p result
1889
+ rescue SnapTrade::ApiError => e
1890
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_settings: #{e}"
1891
+ end
1892
+ ```
1893
+
1894
+ #### Using the update_portfolio_settings_with_http_info variant
1895
+
1896
+ This returns an Array which contains the response data, status code and headers.
1897
+
1898
+ ```ruby
1899
+ portfolio_group_id = "portfolioGroupId_example"
1900
+
1901
+ begin
1902
+ # Updates portfolio group settings
1903
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.update_portfolio_settings_with_http_info(
1904
+ portfolio_group_id: portfolio_group_id,
1905
+ )
1906
+ p status_code # => 2xx
1907
+ p headers # => { ... }
1908
+ p data # => PortfolioGroupSettings
1909
+ rescue SnapTrade::ApiError => e
1910
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_settings: #{e}"
1911
+ end
1912
+ ```
1913
+
1914
+ ### Parameters
1915
+
1916
+ | Name | Type | Description | Notes |
1917
+ | ---- | ---- | ----------- | ----- |
1918
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to patch the settings. | |
1919
+
1920
+ ### Return type
1921
+
1922
+ [**PortfolioGroupSettings**](PortfolioGroupSettings.md)
1923
+
1924
+ ## update_portfolio_target_by_id
1925
+
1926
+ Update a TargetAsset under the specified PortfolioGroup.
1927
+
1928
+ ### Example
1929
+
1930
+ ```ruby
1931
+ require 'snaptrade'
1932
+
1933
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
1934
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
1935
+
1936
+ portfolio_group_id = "portfolioGroupId_example"
1937
+ target_asset_id = "targetAssetId_example"
1938
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1939
+ symbol = {
1940
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1941
+ "symbol" => "VAB.TO",
1942
+ "raw_symbol" => "VAB",
1943
+ "description" => "VANGUARD CDN AGGREGATE BOND INDEX ETF",
1944
+ }
1945
+ percent = 90
1946
+ is_supported = True
1947
+ is_excluded = True
1948
+
1949
+ begin
1950
+ # Update a TargetAsset under the specified PortfolioGroup.
1951
+ result = SnapTrade::PortfolioManagement.update_portfolio_target_by_id(
1952
+ portfolio_group_id: portfolio_group_id,
1953
+ target_asset_id: target_asset_id,
1954
+ id: id,
1955
+ symbol: symbol,
1956
+ percent: percent,
1957
+ is_supported: is_supported,
1958
+ is_excluded: is_excluded,
1959
+ )
1960
+ p result
1961
+ rescue SnapTrade::ApiError => e
1962
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_target_by_id: #{e}"
1963
+ end
1964
+ ```
1965
+
1966
+ #### Using the update_portfolio_target_by_id_with_http_info variant
1967
+
1968
+ This returns an Array which contains the response data, status code and headers.
1969
+
1970
+ ```ruby
1971
+ portfolio_group_id = "portfolioGroupId_example"
1972
+ target_asset_id = "targetAssetId_example"
1973
+ id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
1974
+ symbol = {
1975
+ "id" => "2bcd7cc3-e922-4976-bce1-9858296801c3",
1976
+ "symbol" => "VAB.TO",
1977
+ "raw_symbol" => "VAB",
1978
+ "description" => "VANGUARD CDN AGGREGATE BOND INDEX ETF",
1979
+ }
1980
+ percent = 90
1981
+ is_supported = True
1982
+ is_excluded = True
1983
+
1984
+ begin
1985
+ # Update a TargetAsset under the specified PortfolioGroup.
1986
+ data, status_code, headers, response = SnapTrade::PortfolioManagement.update_portfolio_target_by_id_with_http_info(
1987
+ portfolio_group_id: portfolio_group_id,
1988
+ target_asset_id: target_asset_id,
1989
+ id: id,
1990
+ symbol: symbol,
1991
+ percent: percent,
1992
+ is_supported: is_supported,
1993
+ is_excluded: is_excluded,
1994
+ )
1995
+ p status_code # => 2xx
1996
+ p headers # => { ... }
1997
+ p data # => TargetAsset
1998
+ rescue SnapTrade::ApiError => e
1999
+ puts "Exception when calling SnapTrade::PortfolioManagement.update_portfolio_target_by_id: #{e}"
2000
+ end
2001
+ ```
2002
+
2003
+ ### Parameters
2004
+
2005
+ | Name | Type | Description | Notes |
2006
+ | ---- | ---- | ----------- | ----- |
2007
+ | **portfolio_group_id** | **String** | The ID of the PortfolioGroup under which to patch the target asset. | |
2008
+ | **target_asset_id** | **String** | The ID of the TargetAsset to patch. | |
2009
+ | **target_asset** | [**TargetAsset**](TargetAsset.md) | | |
2010
+
2011
+ ### Return type
2012
+
2013
+ [**TargetAsset**](TargetAsset.md)
2014
+