snaptrade 2.0.31 → 2.0.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +31 -29
  3. data/README.md +4 -2
  4. data/lib/snaptrade/api/account_information_api.rb +6 -2
  5. data/lib/snaptrade/models/account.rb +2 -1
  6. data/lib/snaptrade/models/account_holdings_account.rb +2 -2
  7. data/lib/snaptrade/models/account_order_record.rb +25 -19
  8. data/lib/snaptrade/models/{brokerage_symbol_option_symbol.rb → account_order_record_option_symbol.rb} +15 -26
  9. data/lib/snaptrade/models/{brokerage_symbol_symbol.rb → account_order_record_universal_symbol.rb} +12 -5
  10. data/lib/snaptrade/models/brokerage_authorization_type_read_only.rb +1 -1
  11. data/lib/snaptrade/models/exchange.rb +9 -1
  12. data/lib/snaptrade/models/figi_instrument.rb +3 -1
  13. data/lib/snaptrade/models/monthly_dividends.rb +1 -1
  14. data/lib/snaptrade/models/net_contributions.rb +1 -1
  15. data/lib/snaptrade/models/option_brokerage_symbol.rb +3 -1
  16. data/lib/snaptrade/models/options_position.rb +1 -1
  17. data/lib/snaptrade/models/options_position_currency.rb +1 -0
  18. data/lib/snaptrade/models/options_symbol.rb +12 -24
  19. data/lib/snaptrade/models/order_type_strict.rb +2 -2
  20. data/lib/snaptrade/models/past_value.rb +1 -1
  21. data/lib/snaptrade/models/position_symbol.rb +6 -1
  22. data/lib/snaptrade/models/security_type.rb +5 -1
  23. data/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb +1 -1
  24. data/lib/snaptrade/models/strategy_order_record.rb +1 -1
  25. data/lib/snaptrade/models/sub_period_return_rate.rb +2 -2
  26. data/lib/snaptrade/models/symbol_figi_instrument.rb +2 -0
  27. data/lib/snaptrade/models/type.rb +3 -3
  28. data/lib/snaptrade/models/underlying_symbol.rb +20 -5
  29. data/lib/snaptrade/models/{model_portfolio.rb → underlying_symbol_exchange.rb} +73 -12
  30. data/lib/snaptrade/models/{brokerage_symbol.rb → underlying_symbol_type.rb} +28 -38
  31. data/lib/snaptrade/models/universal_symbol.rb +9 -3
  32. data/lib/snaptrade/models/{portfolio_group.rb → universal_symbol_currency.rb} +24 -4
  33. data/lib/snaptrade/models/{model_asset_class.rb → universal_symbol_exchange.rb} +78 -7
  34. data/lib/snaptrade/version.rb +1 -1
  35. data/lib/snaptrade.rb +6 -38
  36. data/spec/api/account_information_api_spec.rb +1 -1
  37. data/spec/models/{strategy_impact_legs_inner_spec.rb → account_order_record_option_symbol_spec.rb} +13 -13
  38. data/spec/models/{brokerage_symbol_symbol_spec.rb → account_order_record_universal_symbol_spec.rb} +6 -6
  39. data/spec/models/options_symbol_spec.rb +0 -12
  40. data/spec/models/{brokerage_symbol_option_symbol_spec.rb → underlying_symbol_exchange_spec.rb} +14 -14
  41. data/spec/models/underlying_symbol_spec.rb +6 -0
  42. data/spec/models/{cash_restriction_spec.rb → underlying_symbol_type_spec.rb} +9 -15
  43. data/spec/models/{model_portfolio_spec.rb → universal_symbol_currency_spec.rb} +8 -8
  44. data/spec/models/{trade_spec.rb → universal_symbol_exchange_spec.rb} +13 -13
  45. metadata +117 -213
  46. data/lib/snaptrade/models/brokerage_authorization_type.rb +0 -216
  47. data/lib/snaptrade/models/brokerage_authorization_type_read_only_type.rb +0 -37
  48. data/lib/snaptrade/models/brokerage_authorization_type_type.rb +0 -37
  49. data/lib/snaptrade/models/calculated_trade.rb +0 -228
  50. data/lib/snaptrade/models/cash_restriction.rb +0 -253
  51. data/lib/snaptrade/models/excluded_asset.rb +0 -217
  52. data/lib/snaptrade/models/jwt.rb +0 -217
  53. data/lib/snaptrade/models/model_asset_class_details.rb +0 -227
  54. data/lib/snaptrade/models/model_asset_class_target.rb +0 -216
  55. data/lib/snaptrade/models/model_portfolio_asset_class.rb +0 -249
  56. data/lib/snaptrade/models/model_portfolio_details.rb +0 -238
  57. data/lib/snaptrade/models/model_portfolio_security.rb +0 -249
  58. data/lib/snaptrade/models/model_type.rb +0 -38
  59. data/lib/snaptrade/models/portfolio_group_info.rb +0 -325
  60. data/lib/snaptrade/models/portfolio_group_position.rb +0 -237
  61. data/lib/snaptrade/models/portfolio_group_settings.rb +0 -276
  62. data/lib/snaptrade/models/redirect_tokenand_pin.rb +0 -226
  63. data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +0 -226
  64. data/lib/snaptrade/models/state.rb +0 -40
  65. data/lib/snaptrade/models/strategy_impact.rb +0 -309
  66. data/lib/snaptrade/models/strategy_impact_legs_inner.rb +0 -270
  67. data/lib/snaptrade/models/strategy_order_place.rb +0 -228
  68. data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +0 -596
  69. data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +0 -270
  70. data/lib/snaptrade/models/target_asset.rb +0 -289
  71. data/lib/snaptrade/models/trade.rb +0 -280
  72. data/lib/snaptrade/models/trade_action.rb +0 -37
  73. data/lib/snaptrade/models/trade_execution_status.rb +0 -297
  74. data/lib/snaptrade/models/trade_execution_status_action.rb +0 -37
  75. data/lib/snaptrade/models/trade_impact.rb +0 -256
  76. data/lib/snaptrade/models/user_error_log.rb +0 -262
  77. data/lib/snaptrade/models/user_settings.rb +0 -298
  78. data/spec/models/brokerage_authorization_type_read_only_type_spec.rb +0 -23
  79. data/spec/models/brokerage_authorization_type_spec.rb +0 -29
  80. data/spec/models/brokerage_authorization_type_type_spec.rb +0 -23
  81. data/spec/models/brokerage_symbol_spec.rb +0 -59
  82. data/spec/models/calculated_trade_spec.rb +0 -35
  83. data/spec/models/excluded_asset_spec.rb +0 -29
  84. data/spec/models/jwt_spec.rb +0 -29
  85. data/spec/models/model_asset_class_details_spec.rb +0 -35
  86. data/spec/models/model_asset_class_spec.rb +0 -35
  87. data/spec/models/model_asset_class_target_spec.rb +0 -29
  88. data/spec/models/model_portfolio_asset_class_spec.rb +0 -35
  89. data/spec/models/model_portfolio_details_spec.rb +0 -41
  90. data/spec/models/model_portfolio_security_spec.rb +0 -35
  91. data/spec/models/model_type_spec.rb +0 -23
  92. data/spec/models/portfolio_group_info_spec.rb +0 -89
  93. data/spec/models/portfolio_group_position_spec.rb +0 -41
  94. data/spec/models/portfolio_group_settings_spec.rb +0 -53
  95. data/spec/models/portfolio_group_spec.rb +0 -35
  96. data/spec/models/redirect_tokenand_pin_spec.rb +0 -35
  97. data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +0 -35
  98. data/spec/models/state_spec.rb +0 -23
  99. data/spec/models/strategy_impact_spec.rb +0 -89
  100. data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +0 -65
  101. data/spec/models/strategy_order_place_orders_inner_spec.rb +0 -281
  102. data/spec/models/strategy_order_place_spec.rb +0 -35
  103. data/spec/models/target_asset_spec.rb +0 -59
  104. data/spec/models/trade_action_spec.rb +0 -23
  105. data/spec/models/trade_execution_status_action_spec.rb +0 -23
  106. data/spec/models/trade_execution_status_spec.rb +0 -77
  107. data/spec/models/trade_impact_spec.rb +0 -53
  108. data/spec/models/user_error_log_spec.rb +0 -59
  109. data/spec/models/user_settings_spec.rb +0 -83
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4473f0d7f5cc9ca2466287af5c01b2d7eb3a32f20bb08407b5192c4f43d1bde5
4
- data.tar.gz: 95e42f51f88e79ccc23e880f96075ff27904bacaf355b31ab2ed656d7a3c11b7
3
+ metadata.gz: 5850595b939dd6002902054531b756f0355f067082c8f22428ef8d2ed0fe8cca
4
+ data.tar.gz: 1558b337647677cc79abda65377e9bdca6a70caae86ec26742d37eb4d33d578f
5
5
  SHA512:
6
- metadata.gz: 4a9684055202d8e628a2411cb281e854e54ee10a129b382eccccce0319357b8df46240646466406d57a2e9d0704406f177b453e85f2d416b3a63c1ee84b76fbe
7
- data.tar.gz: a8f50d47809964ba63c21f15ce16f5265495973ceced0c85fb1fae94a85c8b6605ed7b86f5df5b370e76f7b77a57c54606e354e53058a21a9293d0ff227eb55c
6
+ metadata.gz: 7db59e62afd2e024cf15723d2385a7374ac2660561eea3e30fa46ca0acdabc7bc563060776e44e9291b6b5f0755f50764b44f24151e023c5f4f216b757a163de
7
+ data.tar.gz: 8d373f45a9e72438a8de270fa118c399b8e8dbce9d63e11136c22eccf0d0226f7c2b739325be1d3ed4c8803a3a0efaeb47d0e9af6b76c588f39cf9dfdfe62e08
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.30)
4
+ snaptrade (2.0.33)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -9,27 +9,27 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
- base64 (0.1.1)
12
+ base64 (0.2.0)
13
13
  byebug (11.1.3)
14
14
  coderay (1.1.3)
15
15
  debug (1.8.0)
16
16
  irb (>= 1.5.0)
17
17
  reline (>= 0.3.1)
18
- diff-lcs (1.5.0)
19
- faraday (2.7.11)
18
+ diff-lcs (1.5.1)
19
+ faraday (2.8.1)
20
20
  base64
21
21
  faraday-net_http (>= 2.0, < 3.1)
22
22
  ruby2_keywords (>= 0.0.4)
23
23
  faraday-multipart (1.0.4)
24
24
  multipart-post (~> 2)
25
25
  faraday-net_http (3.0.2)
26
- io-console (0.6.0)
26
+ io-console (0.7.2)
27
27
  irb (1.6.4)
28
28
  reline (>= 0.3.0)
29
- method_source (1.0.0)
30
- multipart-post (2.3.0)
31
- parallel (1.23.0)
32
- parser (3.2.2.3)
29
+ method_source (1.1.0)
30
+ multipart-post (2.4.1)
31
+ parallel (1.26.2)
32
+ parser (3.3.4.2)
33
33
  ast (~> 2.4.1)
34
34
  racc
35
35
  pry (0.14.2)
@@ -38,26 +38,27 @@ GEM
38
38
  pry-byebug (3.10.1)
39
39
  byebug (~> 11.0)
40
40
  pry (>= 0.13, < 0.15)
41
- racc (1.7.1)
41
+ racc (1.8.1)
42
42
  rainbow (3.1.1)
43
43
  rake (13.0.6)
44
- regexp_parser (2.8.1)
45
- reline (0.3.8)
44
+ regexp_parser (2.9.2)
45
+ reline (0.5.9)
46
46
  io-console (~> 0.5)
47
- rexml (3.2.6)
48
- rspec (3.12.0)
49
- rspec-core (~> 3.12.0)
50
- rspec-expectations (~> 3.12.0)
51
- rspec-mocks (~> 3.12.0)
52
- rspec-core (3.12.2)
53
- rspec-support (~> 3.12.0)
54
- rspec-expectations (3.12.3)
47
+ rexml (3.3.5)
48
+ strscan
49
+ rspec (3.13.0)
50
+ rspec-core (~> 3.13.0)
51
+ rspec-expectations (~> 3.13.0)
52
+ rspec-mocks (~> 3.13.0)
53
+ rspec-core (3.13.0)
54
+ rspec-support (~> 3.13.0)
55
+ rspec-expectations (3.13.1)
55
56
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.12.0)
57
- rspec-mocks (3.12.6)
57
+ rspec-support (~> 3.13.0)
58
+ rspec-mocks (3.13.1)
58
59
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.12.0)
60
- rspec-support (3.12.1)
60
+ rspec-support (~> 3.13.0)
61
+ rspec-support (3.13.1)
61
62
  rubocop (1.12.1)
62
63
  parallel (~> 1.10)
63
64
  parser (>= 3.0.0.0)
@@ -67,14 +68,15 @@ GEM
67
68
  rubocop-ast (>= 1.2.0, < 2.0)
68
69
  ruby-progressbar (~> 1.7)
69
70
  unicode-display_width (>= 1.4.0, < 3.0)
70
- rubocop-ast (1.29.0)
71
- parser (>= 3.2.1.0)
71
+ rubocop-ast (1.32.0)
72
+ parser (>= 3.3.1.0)
72
73
  ruby-progressbar (1.13.0)
73
74
  ruby2_keywords (0.0.5)
74
- unicode-display_width (2.4.2)
75
+ strscan (3.1.0)
76
+ unicode-display_width (2.5.0)
75
77
 
76
78
  PLATFORMS
77
- arm64-darwin-22
79
+ x86_64-linux
78
80
 
79
81
  DEPENDENCIES
80
82
  debug (~> 1.8)
@@ -86,4 +88,4 @@ DEPENDENCIES
86
88
  snaptrade!
87
89
 
88
90
  BUNDLED WITH
89
- 2.4.19
91
+ 2.4.22
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v2.0.31-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.31)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.33-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.33)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
70
70
  Add to Gemfile:
71
71
 
72
72
  ```ruby
73
- gem 'snaptrade', '~> 2.0.31'
73
+ gem 'snaptrade', '~> 2.0.33'
74
74
  ```
75
75
 
76
76
  ## Getting Started<a id="getting-started"></a>
@@ -305,6 +305,8 @@ The ID of the account to get positions.
305
305
 
306
306
  Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
307
307
 
308
+ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
309
+
308
310
 
309
311
  #### 🛠️ Usage<a id="🛠️-usage"></a>
310
312
 
@@ -564,6 +564,8 @@ module SnapTrade
564
564
  # List account holdings
565
565
  #
566
566
  # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
567
+ #
568
+ # The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
567
569
  #
568
570
  # @param account_id [String]
569
571
  # @param user_id [String]
@@ -577,6 +579,8 @@ module SnapTrade
577
579
  # List account holdings
578
580
  #
579
581
  # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
582
+ #
583
+ # The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
580
584
  #
581
585
  # @param account_id [String]
582
586
  # @param user_id [String]
@@ -587,7 +591,7 @@ module SnapTrade
587
591
  end
588
592
 
589
593
  # List account holdings
590
- # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
594
+ # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
591
595
  # @param account_id [String]
592
596
  # @param user_id [String]
593
597
  # @param user_secret [String]
@@ -599,7 +603,7 @@ module SnapTrade
599
603
  end
600
604
 
601
605
  # List account holdings
602
- # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
606
+ # Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v&#x3D;d16c4c97b8d5438bbb2d8581ac53b11e) and look for \&quot;Cache Expiry Time\&quot; to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
603
607
  # @param account_id [String]
604
608
  # @param user_id [String]
605
609
  # @param user_secret [String]
@@ -29,6 +29,7 @@ module SnapTrade
29
29
 
30
30
  attr_accessor :meta
31
31
 
32
+ # This field is deprecated.
32
33
  attr_accessor :cash_restrictions
33
34
 
34
35
  attr_accessor :sync_status
@@ -68,7 +69,7 @@ module SnapTrade
68
69
  :'institution_name' => :'String',
69
70
  :'created_date' => :'String',
70
71
  :'meta' => :'Hash<String, Object>',
71
- :'cash_restrictions' => :'Array<CashRestriction>',
72
+ :'cash_restrictions' => :'Array<String>',
72
73
  :'sync_status' => :'AccountSyncStatus',
73
74
  :'balance' => :'AccountBalance'
74
75
  }
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A wrapper object containing holdings information for a single account
14
+ # A wrapper object containing holdings information for a single account.
15
15
  class AccountHoldingsAccount
16
16
  attr_accessor :account
17
17
 
@@ -24,7 +24,7 @@ module SnapTrade
24
24
  # List of option positions in the account.
25
25
  attr_accessor :option_positions
26
26
 
27
- # List of recent orders in the account, including both pending and executed orders.
27
+ # List of recent orders in the account, including both pending and executed orders. Note that option orders are included in this list. Option orders will have a null `universal_symbol` field and a non-null `option_symbol` field.
28
28
  attr_accessor :orders
29
29
 
30
30
  attr_accessor :total_value
@@ -11,56 +11,61 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Record of order in brokerageaccount
14
+ # Describes a single recent order in an account. Each record here represents a single order leg. For multi-leg orders, there will be multiple records.
15
15
  class AccountOrderRecord
16
- # Order id returned by brokerage
16
+ # Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
17
17
  attr_accessor :brokerage_order_id
18
18
 
19
+ # Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum.
19
20
  attr_accessor :status
20
21
 
22
+ # A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
21
23
  attr_accessor :symbol
22
24
 
23
25
  attr_accessor :universal_symbol
24
26
 
25
27
  attr_accessor :option_symbol
26
28
 
27
- # Trade Action potential values include (but are not limited to) - BUY - SELL - BUY_COVER - SELL_SHORT - BUY_OPEN - BUY_CLOSE - SELL_OPEN - SELL_CLOSE
29
+ # The action describes the intent or side of a trade. This is usually `BUY` or `SELL` but can include other potential values like the following depending on the specific brokerage. - BUY - SELL - BUY_COVER - SELL_SHORT - BUY_OPEN - BUY_CLOSE - SELL_OPEN - SELL_CLOSE
28
30
  attr_accessor :action
29
31
 
32
+ # The total number of shares or contracts of the order. This should be the sum of the filled, canceled, and open quantities. Can be a decimal number for fractional shares.
30
33
  attr_accessor :total_quantity
31
34
 
32
- # Trade Units
35
+ # The number of shares or contracts that are still open (waiting for execution). Can be a decimal number for fractional shares.
33
36
  attr_accessor :open_quantity
34
37
 
35
- # Trade Units
38
+ # The number of shares or contracts that have been canceled. Can be a decimal number for fractional shares.
36
39
  attr_accessor :canceled_quantity
37
40
 
38
- # Trade Units
41
+ # The number of shares or contracts that have been filled. Can be a decimal number for fractional shares.
39
42
  attr_accessor :filled_quantity
40
43
 
41
- # Trade Price if limit or stop limit order
44
+ # The price at which the order was executed.
42
45
  attr_accessor :execution_price
43
46
 
44
- # Trade Price if limit or stop limit order
47
+ # The limit price is maximum price one is willing to pay for a buy order or the minimum price one is willing to accept for a sell order. Should only apply to `Limit` and `StopLimit` orders.
45
48
  attr_accessor :limit_price
46
49
 
47
- # Stop Price. If stop loss or stop limit order, the price to trigger the stop
50
+ # The stop price is the price at which a stop order is triggered. Should only apply to `Stop` and `StopLimit` orders.
48
51
  attr_accessor :stop_price
49
52
 
50
- # Order Type potential values include (but are not limited to) - Limit - Market - StopLimit - StopLoss
53
+ # The type of order placed. The most common values are `Market`, `Limit`, `Stop`, and `StopLimit`. We try our best to map brokerage order types to these values. When mapping fails, we will return the brokerage's order type value.
51
54
  attr_accessor :order_type
52
55
 
53
- # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date
56
+ # The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage's time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date.
54
57
  attr_accessor :time_in_force
55
58
 
56
- # Time
59
+ # The time the order was placed. This is the time the order was submitted to the brokerage.
57
60
  attr_accessor :time_placed
58
61
 
62
+ # The time the order was last updated in the brokerage system. This value is not always available from the brokerage.
59
63
  attr_accessor :time_updated
60
64
 
65
+ # The time the order was executed in the brokerage system. This value is not always available from the brokerage.
61
66
  attr_accessor :time_executed
62
67
 
63
- # Time
68
+ # The time the order expires. This value is not always available from the brokerage.
64
69
  attr_accessor :expiry_date
65
70
 
66
71
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -99,8 +104,8 @@ module SnapTrade
99
104
  :'brokerage_order_id' => :'String',
100
105
  :'status' => :'AccountOrderRecordStatus',
101
106
  :'symbol' => :'String',
102
- :'universal_symbol' => :'UniversalSymbol',
103
- :'option_symbol' => :'OptionsSymbol',
107
+ :'universal_symbol' => :'AccountOrderRecordUniversalSymbol',
108
+ :'option_symbol' => :'AccountOrderRecordOptionSymbol',
104
109
  :'action' => :'String',
105
110
  :'total_quantity' => :'Float',
106
111
  :'open_quantity' => :'Float',
@@ -111,10 +116,10 @@ module SnapTrade
111
116
  :'stop_price' => :'Float',
112
117
  :'order_type' => :'String',
113
118
  :'time_in_force' => :'String',
114
- :'time_placed' => :'String',
115
- :'time_updated' => :'String',
116
- :'time_executed' => :'String',
117
- :'expiry_date' => :'String'
119
+ :'time_placed' => :'Time',
120
+ :'time_updated' => :'Time',
121
+ :'time_executed' => :'Time',
122
+ :'expiry_date' => :'Time'
118
123
  }
119
124
  end
120
125
 
@@ -131,6 +136,7 @@ module SnapTrade
131
136
  :'order_type',
132
137
  :'time_updated',
133
138
  :'time_executed',
139
+ :'expiry_date'
134
140
  ])
135
141
  end
136
142
 
@@ -11,25 +11,28 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- class BrokerageSymbolOptionSymbol
14
+ # Contains information about the option contract that the order is for. This field is only present for option orders. For stock/ETF/crypto/mutual fund orders, this field will be null and the `universal_symbol` field will be populated.
15
+ class AccountOrderRecordOptionSymbol
16
+ # Unique identifier for the option symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
15
17
  attr_accessor :id
16
18
 
19
+ # The [OCC symbol](https://en.wikipedia.org/wiki/Option_symbol) for the option.
17
20
  attr_accessor :ticker
18
21
 
22
+ # The type of option. Either \"CALL\" or \"PUT\".
19
23
  attr_accessor :option_type
20
24
 
25
+ # The option strike price.
21
26
  attr_accessor :strike_price
22
27
 
28
+ # The option expiration date.
23
29
  attr_accessor :expiration_date
24
30
 
31
+ # Whether the option is a mini option. Mini options have 10 underlying shares per contract instead of the standard 100.
25
32
  attr_accessor :is_mini_option
26
33
 
27
34
  attr_accessor :underlying_symbol
28
35
 
29
- attr_accessor :local_id
30
-
31
- attr_accessor :exchange_id
32
-
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
@@ -39,9 +42,7 @@ module SnapTrade
39
42
  :'strike_price' => :'strike_price',
40
43
  :'expiration_date' => :'expiration_date',
41
44
  :'is_mini_option' => :'is_mini_option',
42
- :'underlying_symbol' => :'underlying_symbol',
43
- :'local_id' => :'local_id',
44
- :'exchange_id' => :'exchange_id'
45
+ :'underlying_symbol' => :'underlying_symbol'
45
46
  }
46
47
  end
47
48
 
@@ -57,11 +58,9 @@ module SnapTrade
57
58
  :'ticker' => :'String',
58
59
  :'option_type' => :'OptionType',
59
60
  :'strike_price' => :'Float',
60
- :'expiration_date' => :'String',
61
+ :'expiration_date' => :'Date',
61
62
  :'is_mini_option' => :'Boolean',
62
- :'underlying_symbol' => :'UnderlyingSymbol',
63
- :'local_id' => :'String',
64
- :'exchange_id' => :'String'
63
+ :'underlying_symbol' => :'UnderlyingSymbol'
65
64
  }
66
65
  end
67
66
 
@@ -82,13 +81,13 @@ module SnapTrade
82
81
  # @param [Hash] attributes Model attributes in the form of hash
83
82
  def initialize(attributes = {})
84
83
  if (!attributes.is_a?(Hash))
85
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BrokerageSymbolOptionSymbol` initialize method"
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::AccountOrderRecordOptionSymbol` initialize method"
86
85
  end
87
86
 
88
87
  # check to see if the attribute exists and convert string to symbol for hash key
89
88
  attributes = attributes.each_with_object({}) { |(k, v), h|
90
89
  if (!self.class.attribute_map.key?(k.to_sym))
91
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BrokerageSymbolOptionSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::AccountOrderRecordOptionSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
92
91
  end
93
92
  h[k.to_sym] = v
94
93
  }
@@ -120,14 +119,6 @@ module SnapTrade
120
119
  if attributes.key?(:'underlying_symbol')
121
120
  self.underlying_symbol = attributes[:'underlying_symbol']
122
121
  end
123
-
124
- if attributes.key?(:'local_id')
125
- self.local_id = attributes[:'local_id']
126
- end
127
-
128
- if attributes.key?(:'exchange_id')
129
- self.exchange_id = attributes[:'exchange_id']
130
- end
131
122
  end
132
123
 
133
124
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -184,9 +175,7 @@ module SnapTrade
184
175
  strike_price == o.strike_price &&
185
176
  expiration_date == o.expiration_date &&
186
177
  is_mini_option == o.is_mini_option &&
187
- underlying_symbol == o.underlying_symbol &&
188
- local_id == o.local_id &&
189
- exchange_id == o.exchange_id
178
+ underlying_symbol == o.underlying_symbol
190
179
  end
191
180
 
192
181
  # @see the `==` method
@@ -198,7 +187,7 @@ module SnapTrade
198
187
  # Calculates hash code according to all attributes.
199
188
  # @return [Integer] Hash code
200
189
  def hash
201
- [id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol, local_id, exchange_id].hash
190
+ [id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol].hash
202
191
  end
203
192
 
204
193
  # Builds the object from hash
@@ -11,13 +11,18 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- class BrokerageSymbolSymbol
14
+ # Contains information about the security that the order is for. This field is only present for stock/ETF/crypto/mutual fund orders. For option orders, this field will be null and the `option_symbol` field will be populated.
15
+ class AccountOrderRecordUniversalSymbol
16
+ # Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
15
17
  attr_accessor :id
16
18
 
19
+ # The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
17
20
  attr_accessor :symbol
18
21
 
22
+ # The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
19
23
  attr_accessor :raw_symbol
20
24
 
25
+ # A human-readable description of the security. This is usually the company name or ETF name.
21
26
  attr_accessor :description
22
27
 
23
28
  attr_accessor :currency
@@ -26,8 +31,10 @@ module SnapTrade
26
31
 
27
32
  attr_accessor :type
28
33
 
34
+ # This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
29
35
  attr_accessor :currencies
30
36
 
37
+ # This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
31
38
  attr_accessor :figi_code
32
39
 
33
40
  attr_accessor :figi_instrument
@@ -60,8 +67,8 @@ module SnapTrade
60
67
  :'symbol' => :'String',
61
68
  :'raw_symbol' => :'String',
62
69
  :'description' => :'String',
63
- :'currency' => :'Currency',
64
- :'exchange' => :'Exchange',
70
+ :'currency' => :'UniversalSymbolCurrency',
71
+ :'exchange' => :'UniversalSymbolExchange',
65
72
  :'type' => :'SecurityType',
66
73
  :'currencies' => :'Array<Currency>',
67
74
  :'figi_code' => :'String',
@@ -89,13 +96,13 @@ module SnapTrade
89
96
  # @param [Hash] attributes Model attributes in the form of hash
90
97
  def initialize(attributes = {})
91
98
  if (!attributes.is_a?(Hash))
92
- fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::BrokerageSymbolSymbol` initialize method"
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::AccountOrderRecordUniversalSymbol` initialize method"
93
100
  end
94
101
 
95
102
  # check to see if the attribute exists and convert string to symbol for hash key
96
103
  attributes = attributes.each_with_object({}) { |(k, v), h|
97
104
  if (!self.class.attribute_map.key?(k.to_sym))
98
- fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::BrokerageSymbolSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::AccountOrderRecordUniversalSymbol`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
106
  end
100
107
  h[k.to_sym] = v
101
108
  }
@@ -39,7 +39,7 @@ module SnapTrade
39
39
  def self.openapi_types
40
40
  {
41
41
  :'id' => :'String',
42
- :'type' => :'BrokerageAuthorizationTypeReadOnlyType',
42
+ :'type' => :'Type',
43
43
  :'auth_type' => :'AuthType',
44
44
  :'brokerage' => :'BrokerageAuthorizationTypeReadOnlyBrokerage'
45
45
  }
@@ -11,22 +11,30 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Stock Exchange
14
+ # Describes a single stock or crypto exchange.
15
15
  class Exchange
16
+ # Unique ID for the exchange in SnapTrade.
16
17
  attr_accessor :id
17
18
 
19
+ # A short name for the exchange. For standardized exchange code, please us the `mic_code` field.
18
20
  attr_accessor :code
19
21
 
22
+ # The [Market Identifier Code](https://en.wikipedia.org/wiki/Market_Identifier_Code) (MIC) for the exchange.
20
23
  attr_accessor :mic_code
21
24
 
25
+ # The full name of the exchange.
22
26
  attr_accessor :name
23
27
 
28
+ # The timezone for the trading hours (`start_time` and `close_time`) of the exchange.
24
29
  attr_accessor :timezone
25
30
 
31
+ # The time when the exchange opens for trading.
26
32
  attr_accessor :start_time
27
33
 
34
+ # The time when the exchange closes for trading.
28
35
  attr_accessor :close_time
29
36
 
37
+ # The suffix to be appended to the symbol when trading on this exchange. For example, the suffix for the Toronto Stock Exchange is `.TO`. See `UniversalSymbol->symbol` and `UniversalSymbol->raw_symbol` for more detail.
30
38
  attr_accessor :suffix
31
39
 
32
40
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,10 +11,12 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Open FIGI Identifiers
14
+ # Financial Instrument Global Identifier (FIGI) information for the security. See [OpenFIGI](https://www.openfigi.com/) for more information.
15
15
  class FigiInstrument
16
+ # This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
16
17
  attr_accessor :figi_code
17
18
 
19
+ # This enables users to link multiple FIGIs for the same security in order to obtain an aggregated view across all countries and all exchanges. For example, `AAPL` has a different FIGI for each exchange/trading venue it is traded on. The `figi_share_class` is the same for all of these FIGIs. See section 1.4.3 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
18
20
  attr_accessor :figi_share_class
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -12,7 +12,7 @@ require 'time'
12
12
 
13
13
  module SnapTrade
14
14
  class MonthlyDividends
15
- # Date used to specify timeframe for a reporting call (in YYYY-MM-DD format)
15
+ # Date used to specify timeframe for a reporting call (in YYYY-MM-DD format). These dates are inclusive.
16
16
  attr_accessor :date
17
17
 
18
18
  attr_accessor :dividends
@@ -12,7 +12,7 @@ require 'time'
12
12
 
13
13
  module SnapTrade
14
14
  class NetContributions
15
- # Date used to specify timeframe for a reporting call (in YYYY-MM-DD format)
15
+ # Date used to specify timeframe for a reporting call (in YYYY-MM-DD format). These dates are inclusive.
16
16
  attr_accessor :date
17
17
 
18
18
  attr_accessor :contributions
@@ -11,10 +11,12 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Option Brokerage symbol
14
+ # Uniquely describes a security for the option position within an account. The distinction between this and the `option_symbol` child property is that this object is specific to a position within an account, while the `option_symbol` child property is universal across all brokerage accounts. The caller should rely on the `option_symbol` child property for most use cases.
15
15
  class OptionBrokerageSymbol
16
+ # A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
16
17
  attr_accessor :id
17
18
 
19
+ # This field is deprecated and the caller should use the `option_symbol` child property's `description` instead.
18
20
  attr_accessor :description
19
21
 
20
22
  attr_accessor :option_symbol
@@ -18,7 +18,7 @@ module SnapTrade
18
18
  # Last known market price for the option contract. The freshness of this price depends on the brokerage. Some brokerages provide real-time prices, while others provide delayed prices. It is recommended that you rely on your own third-party market data provider for most up to date prices.
19
19
  attr_accessor :price
20
20
 
21
- # The number of contracts for this option position.
21
+ # The number of contracts for this option position. A positive number indicates a long position, while a negative number indicates a short position.
22
22
  attr_accessor :units
23
23
 
24
24
  attr_accessor :currency
@@ -11,6 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
+ # The currency of the price. This field is deprecated and will be removed in a future version. The currency of the price is determined by the currency of the underlying security.
14
15
  class OptionsPositionCurrency
15
16
  # Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
16
17
  attr_accessor :id