snaptrade 1.7.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,6 +50,8 @@ module SnapTrade
50
50
  # List of attributes with nullable: true
51
51
  def self.openapi_nullable
52
52
  Set.new([
53
+ :'balances',
54
+ :'positions',
53
55
  ])
54
56
  end
55
57
 
@@ -54,6 +54,9 @@ module SnapTrade
54
54
  # List of attributes with nullable: true
55
55
  def self.openapi_nullable
56
56
  Set.new([
57
+ :'balances',
58
+ :'positions',
59
+ :'orders',
57
60
  ])
58
61
  end
59
62
 
@@ -9,5 +9,5 @@ Contact: api@snaptrade.com
9
9
  =end
10
10
 
11
11
  module SnapTrade
12
- VERSION = '1.7.0'
12
+ VERSION = '1.12.0'
13
13
  end
data/lib/snaptrade.rb CHANGED
@@ -150,7 +150,6 @@ require 'snaptrade/api/authentication_api'
150
150
  require 'snaptrade/api/connections_api'
151
151
  require 'snaptrade/api/error_logs_api'
152
152
  require 'snaptrade/api/options_api'
153
- require 'snaptrade/api/portfolio_management_api'
154
153
  require 'snaptrade/api/reference_data_api'
155
154
  require 'snaptrade/api/trading_api'
156
155
  require 'snaptrade/api/transactions_and_reporting_api'
@@ -192,7 +191,6 @@ module SnapTrade
192
191
  attr_accessor :connections
193
192
  attr_accessor :error_logs
194
193
  attr_accessor :options
195
- attr_accessor :portfolio_management
196
194
  attr_accessor :reference_data
197
195
  attr_accessor :trading
198
196
  attr_accessor :transactions_and_reporting
@@ -205,7 +203,6 @@ module SnapTrade
205
203
  @connections = SnapTrade::ConnectionsApi.new(@api_client)
206
204
  @error_logs = SnapTrade::ErrorLogsApi.new(@api_client)
207
205
  @options = SnapTrade::OptionsApi.new(@api_client)
208
- @portfolio_management = SnapTrade::PortfolioManagementApi.new(@api_client)
209
206
  @reference_data = SnapTrade::ReferenceDataApi.new(@api_client)
210
207
  @trading = SnapTrade::TradingApi.new(@api_client)
211
208
  @transactions_and_reporting = SnapTrade::TransactionsAndReportingApi.new(@api_client)
@@ -29,7 +29,7 @@ describe 'AccountInformationApi' do
29
29
  end
30
30
 
31
31
  # unit tests for get_all_user_holdings
32
- # List all accounts for the user, plus balances and positions for each account.
32
+ # List all accounts for the user, plus balances, positions, and orders for each account.
33
33
  # @param user_id
34
34
  # @param user_secret
35
35
  # @param [Hash] opts the optional parameters
@@ -42,7 +42,7 @@ describe 'AccountInformationApi' do
42
42
  end
43
43
 
44
44
  # unit tests for get_user_account_balance
45
- # Get all cash balances of an investment account
45
+ # List account balances
46
46
  # @param user_id
47
47
  # @param user_secret
48
48
  # @param account_id The ID of the account get positions.
@@ -60,7 +60,7 @@ describe 'AccountInformationApi' do
60
60
  # @param user_secret
61
61
  # @param account_id The ID of the account to get detail of.
62
62
  # @param [Hash] opts the optional parameters
63
- # @return [Array<Account>]
63
+ # @return [Account]
64
64
  describe 'get_user_account_details test' do
65
65
  it 'should work' do
66
66
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -82,7 +82,7 @@ describe 'AccountInformationApi' do
82
82
  end
83
83
 
84
84
  # unit tests for get_user_account_positions
85
- # Get all positions of an investment account
85
+ # List account positions
86
86
  # @param user_id
87
87
  # @param user_secret
88
88
  # @param account_id The ID of the account get positions.
@@ -108,7 +108,7 @@ describe 'AccountInformationApi' do
108
108
  end
109
109
 
110
110
  # unit tests for list_user_accounts
111
- # List all investment accounts for the user
111
+ # List accounts
112
112
  # @param user_id
113
113
  # @param user_secret
114
114
  # @param [Hash] opts the optional parameters
@@ -29,7 +29,7 @@ describe 'AuthenticationApi' do
29
29
  end
30
30
 
31
31
  # unit tests for delete_snap_trade_user
32
- # Delete user from SnapTrade, disabling all brokerage authorizations and permanently deleting all data associated with the user
32
+ # Delete SnapTrade user
33
33
  # @param user_id
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @return [DeleteUserResponse]
@@ -40,7 +40,7 @@ describe 'AuthenticationApi' do
40
40
  end
41
41
 
42
42
  # unit tests for get_user_jwt
43
- # Obtains an encrypted JWT tokens that should be decrypted on a user&#39;s local device
43
+ # Generate encrypted JWT token
44
44
  # @param user_id
45
45
  # @param user_secret
46
46
  # @param [Hash] opts the optional parameters
@@ -52,7 +52,7 @@ describe 'AuthenticationApi' do
52
52
  end
53
53
 
54
54
  # unit tests for list_snap_trade_users
55
- # Get a list of all SnapTrade users you&#39;ve registered on our platform
55
+ # List SnapTrade users
56
56
  # @param [Hash] opts the optional parameters
57
57
  # @return [Array<String>]
58
58
  describe 'list_snap_trade_users test' do
@@ -62,7 +62,7 @@ describe 'AuthenticationApi' do
62
62
  end
63
63
 
64
64
  # unit tests for login_snap_trade_user
65
- # Generate a redirect URI to securely login a user to the SnapTrade Connection Portal
65
+ # Login user &amp; generate connection link
66
66
  # @param user_id
67
67
  # @param user_secret
68
68
  # @param [Hash] opts the optional parameters
@@ -75,7 +75,7 @@ describe 'AuthenticationApi' do
75
75
  end
76
76
 
77
77
  # unit tests for register_snap_trade_user
78
- # Register user with SnapTrade in order to create secure brokerage authorizations
78
+ # Create SnapTrade user
79
79
  # @param snap_trade_register_user_request_body
80
80
  # @param [Hash] opts the optional parameters
81
81
  # @return [UserIDandSecret]
@@ -76,7 +76,7 @@ describe 'OptionsApi' do
76
76
  # @param user_secret
77
77
  # @param account_id The ID of the account get positions.
78
78
  # @param [Hash] opts the optional parameters
79
- # @return [OptionsHoldings]
79
+ # @return [Array<OptionsPosition>]
80
80
  describe 'list_option_holdings test' do
81
81
  it 'should work' do
82
82
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -60,7 +60,7 @@ describe 'ReferenceDataApi' do
60
60
  end
61
61
 
62
62
  # unit tests for get_stock_exchanges
63
- # Return list of stock exchanges on Passiv and their suffixes
63
+ # List exchanges
64
64
  # @param [Hash] opts the optional parameters
65
65
  # @return [Array<Exchange>]
66
66
  describe 'get_stock_exchanges test' do
@@ -104,7 +104,7 @@ describe 'ReferenceDataApi' do
104
104
  end
105
105
 
106
106
  # unit tests for list_all_brokerages
107
- # List of all brokerages.
107
+ # List brokerages
108
108
  # @param [Hash] opts the optional parameters
109
109
  # @return [Array<Brokerage>]
110
110
  describe 'list_all_brokerages test' do
@@ -114,7 +114,7 @@ describe 'ReferenceDataApi' do
114
114
  end
115
115
 
116
116
  # unit tests for list_all_currencies
117
- # List of all supported currencies
117
+ # List currencies
118
118
  # @param [Hash] opts the optional parameters
119
119
  # @return [Array<Currency>]
120
120
  describe 'list_all_currencies test' do
@@ -124,7 +124,7 @@ describe 'ReferenceDataApi' do
124
124
  end
125
125
 
126
126
  # unit tests for list_all_currencies_rates
127
- # Return the exchange rates of all supported currencies
127
+ # List currency exchange rates
128
128
  # @param [Hash] opts the optional parameters
129
129
  # @return [Array<ExchangeRatePairs>]
130
130
  describe 'list_all_currencies_rates test' do
@@ -134,7 +134,7 @@ describe 'ReferenceDataApi' do
134
134
  end
135
135
 
136
136
  # unit tests for symbol_search_user_account
137
- # Search for symbols that are supported by a brokerage account using a substring
137
+ # Search for symbols available in an account
138
138
  # @param user_id
139
139
  # @param user_secret
140
140
  # @param account_id The ID of the account get positions.
@@ -42,31 +42,6 @@ describe 'TradingApi' do
42
42
  end
43
43
  end
44
44
 
45
- # unit tests for get_calculated_trade_impact_by_id
46
- # Return details of a specific trade before it&#39;s placed
47
- # @param portfolio_group_id The ID of the PortfolioGroup to perform rebalancing calculations
48
- # @param calculated_trade_id The ID of calculated trade to get account impact
49
- # @param trade_id The ID of trade object
50
- # @param [Hash] opts the optional parameters
51
- # @return [Trade]
52
- describe 'get_calculated_trade_impact_by_id test' do
53
- it 'should work' do
54
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
- end
56
- end
57
-
58
- # unit tests for get_calculated_trades_impact
59
- # Return the impact of placing a series of trades on the portfolio
60
- # @param portfolio_group_id The ID of the PortfolioGroup to perform rebalancing calculations
61
- # @param calculated_trade_id The ID of calculated trade to get account impact
62
- # @param [Hash] opts the optional parameters
63
- # @return [Array<TradeImpact>]
64
- describe 'get_calculated_trades_impact test' do
65
- it 'should work' do
66
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
- end
68
- end
69
-
70
45
  # unit tests for get_order_impact
71
46
  # Check impact of trades on account.
72
47
  # @param user_id
@@ -95,32 +70,6 @@ describe 'TradingApi' do
95
70
  end
96
71
  end
97
72
 
98
- # unit tests for modify_calculated_trade_by_id
99
- # Modify units of a trade before it is placed
100
- # @param portfolio_group_id The ID of the PortfolioGroup to perform rebalancing calculations
101
- # @param calculated_trade_id The ID of calculated trade to get account impact
102
- # @param trade_id The ID of trade object
103
- # @param [Hash] opts the optional parameters
104
- # @option opts [Trade] :trade
105
- # @return [Trade]
106
- describe 'modify_calculated_trade_by_id test' do
107
- it 'should work' do
108
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
- end
110
- end
111
-
112
- # unit tests for place_calculated_trades
113
- # Place orders for the CalculatedTrades in series
114
- # @param portfolio_group_id The ID of the PortfolioGroup to perform rebalancing calculations
115
- # @param calculated_trade_id The ID of calculated trade to get account impact
116
- # @param [Hash] opts the optional parameters
117
- # @return [Array<TradeExecutionStatus>]
118
- describe 'place_calculated_trades test' do
119
- it 'should work' do
120
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
121
- end
122
- end
123
-
124
73
  # unit tests for place_force_order
125
74
  # Place a trade with NO validation.
126
75
  # @param user_id
@@ -38,7 +38,7 @@ describe 'TransactionsAndReportingApi' do
38
38
  # @option opts [Date] :end_date
39
39
  # @option opts [String] :accounts Optional comma seperated list of account IDs used to filter the request on specific accounts
40
40
  # @option opts [String] :brokerage_authorizations Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
41
- # @option opts [String] :type Optional comma seperated list of types to filter activities by. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
41
+ # @option opts [String] :type Optional comma seperated list of types to filter activities by. This is not an exhaustive list, if we fail to match to these types, we will return the raw description from the brokerage. Potential values include - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT
42
42
  # @return [Array<UniversalActivity>]
43
43
  describe 'get_activities test' do
44
44
  it 'should work' do
@@ -22,29 +22,6 @@ describe 'GettingStarted' do
22
22
  # run after each test
23
23
  end
24
24
 
25
- describe 'non object body parameter' do
26
- it 'should work' do
27
- configuration = SnapTrade::Configuration.new
28
- configuration.client_id = ENV["SNAPTRADE_CLIENT_ID"]
29
- configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"]
30
- configuration.host = "http://127.0.0.1:4010"
31
- snaptrade = SnapTrade::Client.new(configuration)
32
-
33
- data = snaptrade.portfolio_management.set_portfolio_targets(
34
- portfolio_group_id: SecureRandom.uuid,
35
- body: [{
36
- "id" => SecureRandom.uuid,
37
- "symbol" => {
38
- "id" => SecureRandom.uuid,
39
- "symbol" => "VOO"
40
- }
41
- }]
42
- )
43
- puts data
44
- expect(data).not_to be_nil
45
- end
46
- end
47
-
48
25
  describe 'optional non body parameters should be passed' do
49
26
  it 'should pass' do
50
27
  configuration = SnapTrade::Configuration.new
@@ -86,15 +63,6 @@ describe 'GettingStarted' do
86
63
  redirect_uri = SnapTrade::Authentication.login_snap_trade_user(user_id: user_id, user_secret: response.user_secret)
87
64
  puts redirect_uri
88
65
 
89
- SnapTrade::PortfolioManagement.create(
90
- user_id: user_id,
91
- user_secret: response.user_secret,
92
- id: SecureRandom.uuid,
93
- name: "MyPortfolio"
94
- )
95
- portfolios = SnapTrade::PortfolioManagement.list(user_id: user_id, user_secret: response.user_secret)
96
- puts portfolios
97
-
98
66
  # 5) Obtaining account holdings data
99
67
  holdings = SnapTrade::AccountInformation.get_all_user_holdings(user_id: user_id, user_secret: response.user_secret)
100
68
  puts holdings
@@ -127,10 +95,6 @@ describe 'GettingStarted' do
127
95
  redirect_uri = snaptrade.authentication.login_snap_trade_user(user_id: user_id, user_secret: response.user_secret)
128
96
  puts redirect_uri
129
97
 
130
- snaptrade.portfolio_management.create(user_id: user_id, user_secret: response.user_secret, id: SecureRandom.uuid, name: "MyPortfolio")
131
- portfolios = snaptrade.portfolio_management.list(user_id: user_id, user_secret: response.user_secret)
132
- puts portfolios
133
-
134
98
  # 5) Obtaining account holdings data
135
99
  holdings = snaptrade.account_information.get_all_user_holdings(user_id: user_id, user_secret: response.user_secret)
136
100
  puts holdings
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: 1.7.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-22 00:00:00.000000000 Z
11
+ date: 2023-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -163,7 +163,6 @@ files:
163
163
  - docs/PortfolioGroupInfo.md
164
164
  - docs/PortfolioGroupPosition.md
165
165
  - docs/PortfolioGroupSettings.md
166
- - docs/PortfolioManagementApi.md
167
166
  - docs/Position.md
168
167
  - docs/PositionSymbol.md
169
168
  - docs/RedirectTokenandPin.md
@@ -223,7 +222,6 @@ files:
223
222
  - lib/snaptrade/api/connections_api.rb
224
223
  - lib/snaptrade/api/error_logs_api.rb
225
224
  - lib/snaptrade/api/options_api.rb
226
- - lib/snaptrade/api/portfolio_management_api.rb
227
225
  - lib/snaptrade/api/reference_data_api.rb
228
226
  - lib/snaptrade/api/trading_api.rb
229
227
  - lib/snaptrade/api/transactions_and_reporting_api.rb
@@ -364,7 +362,6 @@ files:
364
362
  - spec/api/connections_api_spec.rb
365
363
  - spec/api/error_logs_api_spec.rb
366
364
  - spec/api/options_api_spec.rb
367
- - spec/api/portfolio_management_api_spec.rb
368
365
  - spec/api/reference_data_api_spec.rb
369
366
  - spec/api/trading_api_spec.rb
370
367
  - spec/api/transactions_and_reporting_api_spec.rb
@@ -524,7 +521,6 @@ specification_version: 4
524
521
  summary: SnapTrade Ruby Gem
525
522
  test_files:
526
523
  - spec/api/transactions_and_reporting_api_spec.rb
527
- - spec/api/portfolio_management_api_spec.rb
528
524
  - spec/api/options_api_spec.rb
529
525
  - spec/api/authentication_api_spec.rb
530
526
  - spec/api/error_logs_api_spec.rb