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,285 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module SnapTrade
15
+ # Manual Trade Form
16
+ class ManualTradeForm
17
+ attr_accessor :account_id
18
+
19
+ attr_accessor :action
20
+
21
+ attr_accessor :order_type
22
+
23
+ # Trade Price if limit or stop limit order
24
+ attr_accessor :price
25
+
26
+ # Stop Price. If stop loss or stop limit order, the price to trigger the stop
27
+ attr_accessor :stop
28
+
29
+ attr_accessor :time_in_force
30
+
31
+ # Trade Units
32
+ attr_accessor :units
33
+
34
+ attr_accessor :universal_symbol_id
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'account_id' => :'account_id',
40
+ :'action' => :'action',
41
+ :'order_type' => :'order_type',
42
+ :'price' => :'price',
43
+ :'stop' => :'stop',
44
+ :'time_in_force' => :'time_in_force',
45
+ :'units' => :'units',
46
+ :'universal_symbol_id' => :'universal_symbol_id'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'account_id' => :'String',
59
+ :'action' => :'Action',
60
+ :'order_type' => :'OrderType',
61
+ :'price' => :'Float',
62
+ :'stop' => :'Float',
63
+ :'time_in_force' => :'TimeInForce',
64
+ :'units' => :'Float',
65
+ :'universal_symbol_id' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'stop',
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ManualTradeForm` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ManualTradeForm`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'account_id')
92
+ self.account_id = attributes[:'account_id']
93
+ end
94
+
95
+ if attributes.key?(:'action')
96
+ self.action = attributes[:'action']
97
+ end
98
+
99
+ if attributes.key?(:'order_type')
100
+ self.order_type = attributes[:'order_type']
101
+ end
102
+
103
+ if attributes.key?(:'price')
104
+ self.price = attributes[:'price']
105
+ end
106
+
107
+ if attributes.key?(:'stop')
108
+ self.stop = attributes[:'stop']
109
+ end
110
+
111
+ if attributes.key?(:'time_in_force')
112
+ self.time_in_force = attributes[:'time_in_force']
113
+ end
114
+
115
+ if attributes.key?(:'units')
116
+ self.units = attributes[:'units']
117
+ end
118
+
119
+ if attributes.key?(:'universal_symbol_id')
120
+ self.universal_symbol_id = attributes[:'universal_symbol_id']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ account_id == o.account_id &&
143
+ action == o.action &&
144
+ order_type == o.order_type &&
145
+ price == o.price &&
146
+ stop == o.stop &&
147
+ time_in_force == o.time_in_force &&
148
+ units == o.units &&
149
+ universal_symbol_id == o.universal_symbol_id
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [account_id, action, order_type, price, stop, time_in_force, units, universal_symbol_id].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ new.build_from_hash(attributes)
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
179
+ self.send("#{key}=", nil)
180
+ elsif type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = SnapTrade.const_get(type)
233
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module SnapTrade
15
+ # Manual trade symbol object
16
+ class ManualTradeSymbol
17
+ attr_accessor :brokerage_symbol_id
18
+
19
+ attr_accessor :universal_symbol_id
20
+
21
+ attr_accessor :currency
22
+
23
+ attr_accessor :local_id
24
+
25
+ attr_accessor :description
26
+
27
+ attr_accessor :symbol
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'brokerage_symbol_id' => :'brokerage_symbol_id',
33
+ :'universal_symbol_id' => :'universal_symbol_id',
34
+ :'currency' => :'currency',
35
+ :'local_id' => :'local_id',
36
+ :'description' => :'description',
37
+ :'symbol' => :'symbol'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'brokerage_symbol_id' => :'String',
50
+ :'universal_symbol_id' => :'String',
51
+ :'currency' => :'Currency',
52
+ :'local_id' => :'String',
53
+ :'description' => :'String',
54
+ :'symbol' => :'String'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ :'description',
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::ManualTradeSymbol` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::ManualTradeSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'brokerage_symbol_id')
81
+ self.brokerage_symbol_id = attributes[:'brokerage_symbol_id']
82
+ end
83
+
84
+ if attributes.key?(:'universal_symbol_id')
85
+ self.universal_symbol_id = attributes[:'universal_symbol_id']
86
+ end
87
+
88
+ if attributes.key?(:'currency')
89
+ self.currency = attributes[:'currency']
90
+ end
91
+
92
+ if attributes.key?(:'local_id')
93
+ self.local_id = attributes[:'local_id']
94
+ end
95
+
96
+ if attributes.key?(:'description')
97
+ self.description = attributes[:'description']
98
+ end
99
+
100
+ if attributes.key?(:'symbol')
101
+ self.symbol = attributes[:'symbol']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ brokerage_symbol_id == o.brokerage_symbol_id &&
124
+ universal_symbol_id == o.universal_symbol_id &&
125
+ currency == o.currency &&
126
+ local_id == o.local_id &&
127
+ description == o.description &&
128
+ symbol == o.symbol
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [brokerage_symbol_id, universal_symbol_id, currency, local_id, description, symbol].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ new.build_from_hash(attributes)
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ self.class.openapi_types.each_pair do |key, type|
157
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
158
+ self.send("#{key}=", nil)
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
+ end
165
+ elsif !attributes[self.class.attribute_map[key]].nil?
166
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ end
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :Time
180
+ Time.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ # models (e.g. Pet) or oneOf
211
+ klass = SnapTrade.const_get(type)
212
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ is_nullable = self.class.openapi_nullable.include?(attr)
236
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
+ end
238
+
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end