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