snaptrade 2.0.30 → 2.0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +31 -29
  3. data/README.md +5 -7
  4. data/lib/snaptrade/api/account_information_api.rb +16 -16
  5. data/lib/snaptrade/models/account_balance.rb +1 -1
  6. data/lib/snaptrade/models/account_balance_total.rb +2 -0
  7. data/lib/snaptrade/models/account_holdings_account.rb +5 -1
  8. data/lib/snaptrade/models/account_order_record.rb +4 -2
  9. data/lib/snaptrade/models/amount.rb +2 -0
  10. data/lib/snaptrade/models/balance.rb +3 -1
  11. data/lib/snaptrade/models/currency.rb +4 -1
  12. data/lib/snaptrade/models/exchange.rb +9 -1
  13. data/lib/snaptrade/models/figi_instrument.rb +3 -1
  14. data/lib/snaptrade/models/option_brokerage_symbol.rb +3 -1
  15. data/lib/snaptrade/models/options_position.rb +4 -3
  16. data/lib/snaptrade/models/options_position_currency.rb +4 -0
  17. data/lib/snaptrade/models/options_symbol.rb +12 -24
  18. data/lib/snaptrade/models/position.rb +6 -4
  19. data/lib/snaptrade/models/position_symbol.rb +6 -1
  20. data/lib/snaptrade/models/security_type.rb +5 -1
  21. data/lib/snaptrade/models/snap_trade_holdings_account_account_id.rb +11 -3
  22. data/lib/snaptrade/models/snap_trade_holdings_total_value.rb +3 -1
  23. data/lib/snaptrade/models/symbol_figi_instrument.rb +2 -0
  24. data/lib/snaptrade/models/underlying_symbol.rb +20 -5
  25. data/lib/snaptrade/models/{model_portfolio.rb → underlying_symbol_exchange.rb} +73 -12
  26. data/lib/snaptrade/models/{brokerage_symbol.rb → underlying_symbol_type.rb} +28 -38
  27. data/lib/snaptrade/models/universal_symbol.rb +9 -3
  28. data/lib/snaptrade/models/{model_asset_class.rb → universal_symbol_currency.rb} +24 -4
  29. data/lib/snaptrade/models/{portfolio_group.rb → universal_symbol_exchange.rb} +78 -7
  30. data/lib/snaptrade/version.rb +1 -1
  31. data/lib/snaptrade.rb +4 -37
  32. data/spec/api/account_information_api_spec.rb +3 -3
  33. data/spec/models/options_symbol_spec.rb +0 -12
  34. data/spec/models/{brokerage_symbol_option_symbol_spec.rb → underlying_symbol_exchange_spec.rb} +14 -14
  35. data/spec/models/underlying_symbol_spec.rb +6 -0
  36. data/spec/models/{trade_impact_spec.rb → underlying_symbol_type_spec.rb} +10 -16
  37. data/spec/models/{model_portfolio_spec.rb → universal_symbol_currency_spec.rb} +8 -8
  38. data/spec/models/{trade_spec.rb → universal_symbol_exchange_spec.rb} +13 -13
  39. metadata +113 -212
  40. data/lib/snaptrade/models/brokerage_authorization_type.rb +0 -216
  41. data/lib/snaptrade/models/brokerage_authorization_type_type.rb +0 -37
  42. data/lib/snaptrade/models/brokerage_symbol_option_symbol.rb +0 -325
  43. data/lib/snaptrade/models/brokerage_symbol_symbol.rb +0 -339
  44. data/lib/snaptrade/models/calculated_trade.rb +0 -228
  45. data/lib/snaptrade/models/excluded_asset.rb +0 -217
  46. data/lib/snaptrade/models/jwt.rb +0 -217
  47. data/lib/snaptrade/models/model_asset_class_details.rb +0 -227
  48. data/lib/snaptrade/models/model_asset_class_target.rb +0 -216
  49. data/lib/snaptrade/models/model_portfolio_asset_class.rb +0 -249
  50. data/lib/snaptrade/models/model_portfolio_details.rb +0 -238
  51. data/lib/snaptrade/models/model_portfolio_security.rb +0 -249
  52. data/lib/snaptrade/models/model_type.rb +0 -38
  53. data/lib/snaptrade/models/options_holdings.rb +0 -267
  54. data/lib/snaptrade/models/portfolio_group_info.rb +0 -325
  55. data/lib/snaptrade/models/portfolio_group_position.rb +0 -237
  56. data/lib/snaptrade/models/portfolio_group_settings.rb +0 -276
  57. data/lib/snaptrade/models/redirect_tokenand_pin.rb +0 -226
  58. data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +0 -226
  59. data/lib/snaptrade/models/state.rb +0 -40
  60. data/lib/snaptrade/models/strategy_impact.rb +0 -309
  61. data/lib/snaptrade/models/strategy_impact_legs_inner.rb +0 -270
  62. data/lib/snaptrade/models/strategy_order_place.rb +0 -228
  63. data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +0 -596
  64. data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +0 -270
  65. data/lib/snaptrade/models/target_asset.rb +0 -289
  66. data/lib/snaptrade/models/trade.rb +0 -280
  67. data/lib/snaptrade/models/trade_action.rb +0 -37
  68. data/lib/snaptrade/models/trade_execution_status.rb +0 -297
  69. data/lib/snaptrade/models/trade_execution_status_action.rb +0 -37
  70. data/lib/snaptrade/models/trade_impact.rb +0 -256
  71. data/lib/snaptrade/models/user_error_log.rb +0 -262
  72. data/lib/snaptrade/models/user_settings.rb +0 -298
  73. data/spec/models/brokerage_authorization_type_spec.rb +0 -29
  74. data/spec/models/brokerage_authorization_type_type_spec.rb +0 -23
  75. data/spec/models/brokerage_symbol_spec.rb +0 -59
  76. data/spec/models/brokerage_symbol_symbol_spec.rb +0 -83
  77. data/spec/models/calculated_trade_spec.rb +0 -35
  78. data/spec/models/excluded_asset_spec.rb +0 -29
  79. data/spec/models/jwt_spec.rb +0 -29
  80. data/spec/models/model_asset_class_details_spec.rb +0 -35
  81. data/spec/models/model_asset_class_spec.rb +0 -35
  82. data/spec/models/model_asset_class_target_spec.rb +0 -29
  83. data/spec/models/model_portfolio_asset_class_spec.rb +0 -35
  84. data/spec/models/model_portfolio_details_spec.rb +0 -41
  85. data/spec/models/model_portfolio_security_spec.rb +0 -35
  86. data/spec/models/model_type_spec.rb +0 -23
  87. data/spec/models/options_holdings_spec.rb +0 -59
  88. data/spec/models/portfolio_group_info_spec.rb +0 -89
  89. data/spec/models/portfolio_group_position_spec.rb +0 -41
  90. data/spec/models/portfolio_group_settings_spec.rb +0 -53
  91. data/spec/models/portfolio_group_spec.rb +0 -35
  92. data/spec/models/redirect_tokenand_pin_spec.rb +0 -35
  93. data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +0 -35
  94. data/spec/models/state_spec.rb +0 -23
  95. data/spec/models/strategy_impact_legs_inner_spec.rb +0 -65
  96. data/spec/models/strategy_impact_spec.rb +0 -89
  97. data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +0 -65
  98. data/spec/models/strategy_order_place_orders_inner_spec.rb +0 -281
  99. data/spec/models/strategy_order_place_spec.rb +0 -35
  100. data/spec/models/target_asset_spec.rb +0 -59
  101. data/spec/models/trade_action_spec.rb +0 -23
  102. data/spec/models/trade_execution_status_action_spec.rb +0 -23
  103. data/spec/models/trade_execution_status_spec.rb +0 -77
  104. data/spec/models/user_error_log_spec.rb +0 -59
  105. data/spec/models/user_settings_spec.rb +0 -83
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90d2830fdcb3a1406af0db439f7cdec6d02b895b715c4a90093dca06c4a5e787
4
- data.tar.gz: 67b0d298c28363d224e26a59cd559de0a0330498da7877e81cc3d95f03660460
3
+ metadata.gz: 887242914b86d8378fc839b462051ccc0489d1e2a1ba0b37bc6bff2ad458003a
4
+ data.tar.gz: bd3892448dcca278db8625b0df2f88bc81cd53011ee7b93db4823909f2d273c7
5
5
  SHA512:
6
- metadata.gz: 6a5af9e47b615b7eee91ec656eda1acb7a8006066df7519c2e7947371fbc09e085f1ed31e8644318033664a64d09e91eab57d468987730b9f9e28a7f6393c05d
7
- data.tar.gz: 3a282337bbcad359000d485fb143dbcf9598e8a3a10fcc5b6d4844893f8aeb8d2ac57e69df4504e5d2f982252554aa2ee5ddf54f402bb1511a19c6f3b0e63f94
6
+ metadata.gz: 9f9941bbba13715288cfe8a284dd215fb0d43a89760285651ff7f7f114def7ab938cc79dbdbcd554134017fd448be5944236098aa0831c05304397509dc57cd1
7
+ data.tar.gz: a1f13e4ff3b7d3faf8702b6f4c8fda8f82ce5ca4bd78811b2180011f31f8f88d21362a19685c3e245acdfe2c8818a07e1d1ae31e414a1c03b6e38dd81edf98a9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.29)
4
+ snaptrade (2.0.32)
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.30-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.30)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.32-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.32)
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.30'
73
+ gem 'snaptrade', '~> 2.0.32'
74
74
  ```
75
75
 
76
76
  ## Getting Started<a id="getting-started"></a>
@@ -303,9 +303,9 @@ The ID of the account to get positions.
303
303
 
304
304
  ### `snaptrade.account_information.get_user_holdings`<a id="snaptradeaccount_informationget_user_holdings"></a>
305
305
 
306
- Lists balances, positions and orders for the specified account as well as
307
- option_positions and account metadata. The data returned is similar to the
308
- data returned over the more fine-grained **positions**, **orders** and **balances** endpoints.
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
+
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
309
 
310
310
 
311
311
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -322,8 +322,6 @@ p result
322
322
  #### ⚙️ Parameters<a id="⚙️-parameters"></a>
323
323
 
324
324
  ##### account_id: `String`<a id="account_id-string"></a>
325
- The ID of the account to fetch holdings for.
326
-
327
325
  ##### user_id: `String`<a id="user_id-string"></a>
328
326
  ##### user_secret: `String`<a id="user_secret-string"></a>
329
327
  #### 🔄 Return<a id="🔄-return"></a>
@@ -561,13 +561,13 @@ module SnapTrade
561
561
  end
562
562
 
563
563
 
564
- # List balances, positions and orders for the specified account
564
+ # List account holdings
565
565
  #
566
- # Lists balances, positions and orders for the specified account as well as
567
- # option_positions and account metadata. The data returned is similar to the
568
- # data returned over the more fine-grained **positions**, **orders** and **balances** endpoints.
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**.
569
569
  #
570
- # @param account_id [String] The ID of the account to fetch holdings for.
570
+ # @param account_id [String]
571
571
  # @param user_id [String]
572
572
  # @param user_secret [String]
573
573
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -576,13 +576,13 @@ module SnapTrade
576
576
  data
577
577
  end
578
578
 
579
- # List balances, positions and orders for the specified account
579
+ # List account holdings
580
580
  #
581
- # Lists balances, positions and orders for the specified account as well as
582
- # option_positions and account metadata. The data returned is similar to the
583
- # data returned over the more fine-grained **positions**, **orders** and **balances** endpoints.
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**.
584
584
  #
585
- # @param account_id [String] The ID of the account to fetch holdings for.
585
+ # @param account_id [String]
586
586
  # @param user_id [String]
587
587
  # @param user_secret [String]
588
588
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -590,9 +590,9 @@ module SnapTrade
590
590
  get_user_holdings_with_http_info_impl(account_id, user_id, user_secret, extra)
591
591
  end
592
592
 
593
- # List balances, positions and orders for the specified account
594
- # Lists balances, positions and orders for the specified account as well as option_positions and account metadata. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints.
595
- # @param account_id [String] The ID of the account to fetch holdings for.
593
+ # List account holdings
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**.
595
+ # @param account_id [String]
596
596
  # @param user_id [String]
597
597
  # @param user_secret [String]
598
598
  # @param [Hash] opts the optional parameters
@@ -602,9 +602,9 @@ module SnapTrade
602
602
  data
603
603
  end
604
604
 
605
- # List balances, positions and orders for the specified account
606
- # Lists balances, positions and orders for the specified account as well as option_positions and account metadata. The data returned is similar to the data returned over the more fine-grained **positions**, **orders** and **balances** endpoints.
607
- # @param account_id [String] The ID of the account to fetch holdings for.
605
+ # List account holdings
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**.
607
+ # @param account_id [String]
608
608
  # @param user_id [String]
609
609
  # @param user_secret [String]
610
610
  # @param [Hash] opts the optional parameters
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Balance of the account
14
+ # Contains balance related information for the account.
15
15
  class AccountBalance
16
16
  attr_accessor :total
17
17
 
@@ -13,8 +13,10 @@ require 'time'
13
13
  module SnapTrade
14
14
  # Total value of this account (includes cash, equity, fixed income, etc)
15
15
  class AccountBalanceTotal
16
+ # Total value denominated in the currency of the `currency` field.
16
17
  attr_accessor :amount
17
18
 
19
+ # The ISO-4217 currency code for the amount.
18
20
  attr_accessor :currency
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,16 +11,20 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Account Holdings with Account ID
14
+ # A wrapper object containing holdings information for a single account.
15
15
  class AccountHoldingsAccount
16
16
  attr_accessor :account
17
17
 
18
+ # List of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).
18
19
  attr_accessor :balances
19
20
 
21
+ # List of stock/ETF/crypto/mutual fund positions in the account.
20
22
  attr_accessor :positions
21
23
 
24
+ # List of option positions in the account.
22
25
  attr_accessor :option_positions
23
26
 
27
+ # List of recent orders in the account, including both pending and executed orders.
24
28
  attr_accessor :orders
25
29
 
26
30
  attr_accessor :total_value
@@ -11,13 +11,15 @@ 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.
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
@@ -13,8 +13,10 @@ require 'time'
13
13
  module SnapTrade
14
14
  # Total value of the account, as reported by the brokerage
15
15
  class Amount
16
+ # Total value denominated in the currency of the `currency` field.
16
17
  attr_accessor :amount
17
18
 
19
+ # The ISO-4217 currency code for the amount.
18
20
  attr_accessor :currency
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,12 +11,14 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Account Balance
14
+ # Holds balance information for a single currency in an account.
15
15
  class Balance
16
16
  attr_accessor :currency
17
17
 
18
+ # The amount of available cash in the account denominated in the currency of the `currency` field.
18
19
  attr_accessor :cash
19
20
 
21
+ # Buying power only applies to margin accounts. For non-margin accounts, buying power should be the same as cash. Please note that this field is not always available for all brokerages.
20
22
  attr_accessor :buying_power
21
23
 
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,12 +11,15 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Currency
14
+ # Describes a currency object.
15
15
  class Currency
16
+ # Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
16
17
  attr_accessor :id
17
18
 
19
+ # The ISO-4217 currency code for the currency.
18
20
  attr_accessor :code
19
21
 
22
+ # A human-friendly name of the currency.
20
23
  attr_accessor :name
21
24
 
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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.
@@ -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
@@ -11,18 +11,19 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Option Holdings
14
+ # Describes a single option position in an account.
15
15
  class OptionsPosition
16
16
  attr_accessor :symbol
17
17
 
18
- # Trade Price if limit or stop limit order
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. A positive number indicates a long position, while a negative number indicates a short position.
21
22
  attr_accessor :units
22
23
 
23
24
  attr_accessor :currency
24
25
 
25
- # Average purchase price for this position
26
+ # Cost basis _per contract_ of this option position. To get the cost basis _per share_, divide this value by the number of shares per contract (usually 100).
26
27
  attr_accessor :average_purchase_price
27
28
 
28
29
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,11 +11,15 @@ 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
16
+ # Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
15
17
  attr_accessor :id
16
18
 
19
+ # The ISO-4217 currency code for the currency.
17
20
  attr_accessor :code
18
21
 
22
+ # A human-friendly name of the currency.
19
23
  attr_accessor :name
20
24
 
21
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,26 +11,28 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Options Symbol
14
+ # Uniquely describes an option security + exchange combination across all brokerages.
15
15
  class OptionsSymbol
16
+ # Unique identifier for the option symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
16
17
  attr_accessor :id
17
18
 
19
+ # The [OCC symbol](https://en.wikipedia.org/wiki/Option_symbol) for the option.
18
20
  attr_accessor :ticker
19
21
 
22
+ # The type of option. Either \"CALL\" or \"PUT\".
20
23
  attr_accessor :option_type
21
24
 
25
+ # The option strike price.
22
26
  attr_accessor :strike_price
23
27
 
28
+ # The option expiration date.
24
29
  attr_accessor :expiration_date
25
30
 
31
+ # Whether the option is a mini option. Mini options have 10 underlying shares per contract instead of the standard 100.
26
32
  attr_accessor :is_mini_option
27
33
 
28
34
  attr_accessor :underlying_symbol
29
35
 
30
- attr_accessor :local_id
31
-
32
- attr_accessor :exchange_id
33
-
34
36
  # Attribute mapping from ruby-style variable name to JSON key.
35
37
  def self.attribute_map
36
38
  {
@@ -40,9 +42,7 @@ module SnapTrade
40
42
  :'strike_price' => :'strike_price',
41
43
  :'expiration_date' => :'expiration_date',
42
44
  :'is_mini_option' => :'is_mini_option',
43
- :'underlying_symbol' => :'underlying_symbol',
44
- :'local_id' => :'local_id',
45
- :'exchange_id' => :'exchange_id'
45
+ :'underlying_symbol' => :'underlying_symbol'
46
46
  }
47
47
  end
48
48
 
@@ -58,11 +58,9 @@ module SnapTrade
58
58
  :'ticker' => :'String',
59
59
  :'option_type' => :'OptionType',
60
60
  :'strike_price' => :'Float',
61
- :'expiration_date' => :'String',
61
+ :'expiration_date' => :'Date',
62
62
  :'is_mini_option' => :'Boolean',
63
- :'underlying_symbol' => :'UnderlyingSymbol',
64
- :'local_id' => :'String',
65
- :'exchange_id' => :'String'
63
+ :'underlying_symbol' => :'UnderlyingSymbol'
66
64
  }
67
65
  end
68
66
 
@@ -114,14 +112,6 @@ module SnapTrade
114
112
  if attributes.key?(:'underlying_symbol')
115
113
  self.underlying_symbol = attributes[:'underlying_symbol']
116
114
  end
117
-
118
- if attributes.key?(:'local_id')
119
- self.local_id = attributes[:'local_id']
120
- end
121
-
122
- if attributes.key?(:'exchange_id')
123
- self.exchange_id = attributes[:'exchange_id']
124
- end
125
115
  end
126
116
 
127
117
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -178,9 +168,7 @@ module SnapTrade
178
168
  strike_price == o.strike_price &&
179
169
  expiration_date == o.expiration_date &&
180
170
  is_mini_option == o.is_mini_option &&
181
- underlying_symbol == o.underlying_symbol &&
182
- local_id == o.local_id &&
183
- exchange_id == o.exchange_id
171
+ underlying_symbol == o.underlying_symbol
184
172
  end
185
173
 
186
174
  # @see the `==` method
@@ -192,7 +180,7 @@ module SnapTrade
192
180
  # Calculates hash code according to all attributes.
193
181
  # @return [Integer] Hash code
194
182
  def hash
195
- [id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol, local_id, exchange_id].hash
183
+ [id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol].hash
196
184
  end
197
185
 
198
186
  # Builds the object from hash
@@ -11,21 +11,23 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Account Position
14
+ # Describes a single stock/ETF/crypto/mutual fund position in an account.
15
15
  class Position
16
16
  attr_accessor :symbol
17
17
 
18
+ # The number of shares of the position. This can be fractional or integer units.
18
19
  attr_accessor :units
19
20
 
20
- # Last known market price for the symbol
21
+ # Last known market price for the symbol. 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.
21
22
  attr_accessor :price
22
23
 
24
+ # The profit or loss on the position since it was opened. This is calculated as the difference between the current market value of the position and the total cost of the position. It is recommended to calculate this value using the average purchase price and the current market price yourself, instead of relying on this field.
23
25
  attr_accessor :open_pnl
24
26
 
25
- # Deprecated, use the units field for both fractional and integer units going forward
27
+ # Deprecated, use the `units` field for both fractional and integer units going forward
26
28
  attr_accessor :fractional_units
27
29
 
28
- # Average purchase price for this position. Either returned by the underlying broker or calculated using historical transactions.
30
+ # Cost basis _per share_ of this position.
29
31
  attr_accessor :average_purchase_price
30
32
 
31
33
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,18 +11,23 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Symbol returned in position object
14
+ # Uniquely describes a security for the position within an account. The distinction between this and the `symbol` child property is that this object is specific to a position within an account, while the `symbol` child property is universal across all brokerage accounts. The caller should rely on the `symbol` child property for most use cases.
15
15
  class PositionSymbol
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 `symbol` child property's `description` instead.
18
20
  attr_accessor :description
19
21
 
20
22
  attr_accessor :symbol
21
23
 
24
+ # This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
22
25
  attr_accessor :local_id
23
26
 
27
+ # This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
24
28
  attr_accessor :is_quotable
25
29
 
30
+ # This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
26
31
  attr_accessor :is_tradable
27
32
 
28
33
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -11,14 +11,18 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Security Type
14
+ # The type of security. For example, \"Common Stock\" or \"ETF\".
15
15
  class SecurityType
16
+ # Unique identifier for the security type within SnapTrade. This is the ID used to reference the security type in SnapTrade API calls.
16
17
  attr_accessor :id
17
18
 
19
+ # A short code representing the security type. For example, \"cs\" for Common Stock. Here are some common values: ad - ADR bnd - Bond cs - Common Stock cef - Closed End Fund et - ETF oef - Open Ended Fund ps - Preferred Stock rt - Right struct - Structured Product ut - Unit wi - When Issued wt - Warrant
18
20
  attr_accessor :code
19
21
 
22
+ # A human-readable description of the security type. For example, \"Common Stock\" or \"ETF\".
20
23
  attr_accessor :description
21
24
 
25
+ # This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
22
26
  attr_accessor :is_supported
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.