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