snaptrade 2.0.217 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,6 +99,20 @@ describe 'ExperimentalEndpointsApi' do
99
99
  end
100
100
  end
101
101
 
102
+ # unit tests for list_connection_accounts
103
+ # List accounts for a connection (discriminated union)
104
+ # Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account's opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
105
+ # @param authorization_id
106
+ # @param user_id
107
+ # @param user_secret
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [Array<ConnectionAccount>]
110
+ describe 'list_connection_accounts test' do
111
+ it 'should work' do
112
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
113
+ end
114
+ end
115
+
102
116
  # unit tests for list_subscriptions
103
117
  # List active Trade Detection subscriptions
104
118
  # Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
@@ -63,9 +63,9 @@ describe 'GettingStarted' do
63
63
  redirect_uri = SnapTrade::Authentication.login_snap_trade_user(user_id: user_id, user_secret: response.user_secret)
64
64
  puts redirect_uri
65
65
 
66
- # 5) Obtaining account holdings data
67
- holdings = SnapTrade::AccountInformation.get_all_user_holdings(user_id: user_id, user_secret: response.user_secret)
68
- puts holdings
66
+ # 5) List the user's accounts
67
+ accounts = SnapTrade::AccountInformation.list_user_accounts(user_id: user_id, user_secret: response.user_secret)
68
+ puts accounts
69
69
 
70
70
  # 6) Deleting a user
71
71
  deleted_response = SnapTrade::Authentication.delete_snap_trade_user(user_id: user_id)
@@ -95,9 +95,9 @@ describe 'GettingStarted' do
95
95
  redirect_uri = snaptrade.authentication.login_snap_trade_user(user_id: user_id, user_secret: response.user_secret)
96
96
  puts redirect_uri
97
97
 
98
- # 5) Obtaining account holdings data
99
- holdings = snaptrade.account_information.get_all_user_holdings(user_id: user_id, user_secret: response.user_secret)
100
- puts holdings
98
+ # 5) List the user's accounts
99
+ accounts = snaptrade.account_information.list_user_accounts(user_id: user_id, user_secret: response.user_secret)
100
+ puts accounts
101
101
 
102
102
  # 6) Deleting a user
103
103
  deleted_response = snaptrade.authentication.delete_snap_trade_user(user_id: user_id)
@@ -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
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::ConnectionAccount
15
+ describe SnapTrade::ConnectionAccount do
16
+ describe '.openapi_one_of' do
17
+ it 'lists the items referenced in the oneOf array' do
18
+ expect(described_class.openapi_one_of).to_not be_empty
19
+ end
20
+ end
21
+
22
+ describe '.openapi_discriminator_name' do
23
+ it 'returns the value of the "discriminator" property' do
24
+ expect(described_class.openapi_discriminator_name).to_not be_empty
25
+ end
26
+ end
27
+
28
+ describe '.openapi_discriminator_mapping' do
29
+ it 'returns the key/values of the "mapping" property' do
30
+ expect(described_class.openapi_discriminator_mapping.values.sort).to eq(described_class.openapi_one_of.sort)
31
+ end
32
+ end
33
+
34
+ describe '.build' do
35
+ it 'returns the correct model' do
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,47 @@
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
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::ConnectionAccountSyncStatus
15
+ describe SnapTrade::ConnectionAccountSyncStatus do
16
+ let(:instance) { SnapTrade::ConnectionAccountSyncStatus.new }
17
+
18
+ describe 'test an instance of ConnectionAccountSyncStatus' do
19
+ it 'should create an instance of ConnectionAccountSyncStatus' do
20
+ expect(instance).to be_instance_of(SnapTrade::ConnectionAccountSyncStatus)
21
+ end
22
+ end
23
+ describe 'test attribute "transactions"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "orders"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "positions"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "balances"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,35 @@
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
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::InvestmentAccountMarketValue
15
+ describe SnapTrade::InvestmentAccountMarketValue do
16
+ let(:instance) { SnapTrade::InvestmentAccountMarketValue.new }
17
+
18
+ describe 'test an instance of InvestmentAccountMarketValue' do
19
+ it 'should create an instance of InvestmentAccountMarketValue' do
20
+ expect(instance).to be_instance_of(SnapTrade::InvestmentAccountMarketValue)
21
+ end
22
+ end
23
+ describe 'test attribute "amount"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "currency"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,101 @@
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
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::InvestmentAccount
15
+ describe SnapTrade::InvestmentAccount do
16
+ let(:instance) { SnapTrade::InvestmentAccount.new }
17
+
18
+ describe 'test an instance of InvestmentAccount' do
19
+ it 'should create an instance of InvestmentAccount' do
20
+ expect(instance).to be_instance_of(SnapTrade::InvestmentAccount)
21
+ end
22
+ end
23
+ describe 'test attribute "kind"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "id"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ describe 'test attribute "connection_id"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "display_name"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "number"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "institution_account_id"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "institution_id"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "opening_date"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ describe 'test attribute "sync_status"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ describe 'test attribute "raw_type"' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ describe 'test attribute "funding_date"' do
84
+ it 'should work' do
85
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
+ end
87
+ end
88
+
89
+ describe 'test attribute "is_paper"' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ end
93
+ end
94
+
95
+ describe 'test attribute "market_value"' do
96
+ it 'should work' do
97
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
98
+ end
99
+ end
100
+
101
+ end
@@ -0,0 +1,23 @@
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
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::StockInstrumentKind
15
+ describe SnapTrade::StockInstrumentKind do
16
+ let(:instance) { SnapTrade::StockInstrumentKind.new }
17
+
18
+ describe 'test an instance of StockInstrumentKind' do
19
+ it 'should create an instance of StockInstrumentKind' do
20
+ expect(instance).to be_instance_of(SnapTrade::StockInstrumentKind)
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.217
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-27 00:00:00.000000000 Z
11
+ date: 2026-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -159,6 +159,8 @@ files:
159
159
  - lib/snaptrade/models/complex_order_leg_order_role.rb
160
160
  - lib/snaptrade/models/complex_order_response.rb
161
161
  - lib/snaptrade/models/complex_order_response_type.rb
162
+ - lib/snaptrade/models/connection_account.rb
163
+ - lib/snaptrade/models/connection_account_sync_status.rb
162
164
  - lib/snaptrade/models/connection_portal_version.rb
163
165
  - lib/snaptrade/models/connection_type.rb
164
166
  - lib/snaptrade/models/connections_session_events200_response_inner.rb
@@ -188,6 +190,8 @@ files:
188
190
  - lib/snaptrade/models/future_instrument_kind.rb
189
191
  - lib/snaptrade/models/holdings_status.rb
190
192
  - lib/snaptrade/models/instrument.rb
193
+ - lib/snaptrade/models/investment_account.rb
194
+ - lib/snaptrade/models/investment_account_market_value.rb
191
195
  - lib/snaptrade/models/kind.rb
192
196
  - lib/snaptrade/models/login_redirect_uri.rb
193
197
  - lib/snaptrade/models/manual_trade.rb
@@ -277,6 +281,7 @@ files:
277
281
  - lib/snaptrade/models/status.rb
278
282
  - lib/snaptrade/models/stock_instrument.rb
279
283
  - lib/snaptrade/models/stock_instrument_figi_instrument.rb
284
+ - lib/snaptrade/models/stock_instrument_kind.rb
280
285
  - lib/snaptrade/models/stop_loss.rb
281
286
  - lib/snaptrade/models/strategy_order_record.rb
282
287
  - lib/snaptrade/models/strategy_order_record_status.rb
@@ -391,6 +396,8 @@ files:
391
396
  - spec/models/complex_order_leg_spec.rb
392
397
  - spec/models/complex_order_response_spec.rb
393
398
  - spec/models/complex_order_response_type_spec.rb
399
+ - spec/models/connection_account_spec.rb
400
+ - spec/models/connection_account_sync_status_spec.rb
394
401
  - spec/models/connection_portal_version_spec.rb
395
402
  - spec/models/connection_type_spec.rb
396
403
  - spec/models/connections_session_events200_response_inner_spec.rb
@@ -420,6 +427,8 @@ files:
420
427
  - spec/models/future_instrument_spec.rb
421
428
  - spec/models/holdings_status_spec.rb
422
429
  - spec/models/instrument_spec.rb
430
+ - spec/models/investment_account_market_value_spec.rb
431
+ - spec/models/investment_account_spec.rb
423
432
  - spec/models/kind_spec.rb
424
433
  - spec/models/login_redirect_uri_spec.rb
425
434
  - spec/models/manual_trade_and_impact_spec.rb
@@ -508,6 +517,7 @@ files:
508
517
  - spec/models/snap_trade_register_user_request_body_spec.rb
509
518
  - spec/models/status_spec.rb
510
519
  - spec/models/stock_instrument_figi_instrument_spec.rb
520
+ - spec/models/stock_instrument_kind_spec.rb
511
521
  - spec/models/stock_instrument_spec.rb
512
522
  - spec/models/stop_loss_spec.rb
513
523
  - spec/models/strategy_order_record_spec.rb
@@ -637,7 +647,9 @@ test_files:
637
647
  - spec/models/account_order_record_leg_spec.rb
638
648
  - spec/models/account_simple_spec.rb
639
649
  - spec/models/brokerage_spec.rb
650
+ - spec/models/connection_account_sync_status_spec.rb
640
651
  - spec/models/order_updated_response_order_spec.rb
652
+ - spec/models/connection_account_spec.rb
641
653
  - spec/models/brokerage_authorization_refresh_confirmation_spec.rb
642
654
  - spec/models/account_order_record_leg_instrument_spec.rb
643
655
  - spec/models/brokerage_instrument_spec.rb
@@ -746,6 +758,7 @@ test_files:
746
758
  - spec/models/manual_trade_spec.rb
747
759
  - spec/models/all_account_positions_response_data_freshness_spec.rb
748
760
  - spec/models/crypto_trading_instrument_spec.rb
761
+ - spec/models/investment_account_spec.rb
749
762
  - spec/models/option_leg_action_spec.rb
750
763
  - spec/models/account_balance_spec.rb
751
764
  - spec/models/account_universal_activity_currency_spec.rb
@@ -763,6 +776,7 @@ test_files:
763
776
  - spec/models/symbol_query_spec.rb
764
777
  - spec/models/exchange_spec.rb
765
778
  - spec/models/strategy_order_record_spec.rb
779
+ - spec/models/stock_instrument_kind_spec.rb
766
780
  - spec/models/model429_too_many_requests_response_spec.rb
767
781
  - spec/models/snap_trade_holdings_account_spec.rb
768
782
  - spec/models/brokerage_authorization_type_read_only_spec.rb
@@ -778,6 +792,7 @@ test_files:
778
792
  - spec/models/kind_spec.rb
779
793
  - spec/models/manual_trade_balance_spec.rb
780
794
  - spec/models/order_role_spec.rb
795
+ - spec/models/investment_account_market_value_spec.rb
781
796
  - spec/models/mutual_fund_instrument_spec.rb
782
797
  - spec/models/auth_type_spec.rb
783
798
  - spec/models/account_category_spec.rb