snaptrade 3.0.13 → 3.0.14

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +5 -5
  4. data/lib/snaptrade/api/account_information_api.rb +6 -6
  5. data/lib/snaptrade/api/connections_api.rb +4 -4
  6. data/lib/snaptrade/models/account_position.rb +1 -1
  7. data/lib/snaptrade/models/brokerage_authorization.rb +1 -2
  8. data/lib/snaptrade/models/{line_of_credit_account_credit_details.rb → brokerage_authorization_data_freshness_mode.rb} +30 -12
  9. data/lib/snaptrade/models/deposit_account.rb +10 -10
  10. data/lib/snaptrade/models/institution.rb +37 -0
  11. data/lib/snaptrade/models/instrument.rb +1 -0
  12. data/lib/snaptrade/models/investment_account.rb +10 -10
  13. data/lib/snaptrade/models/line_of_credit_account.rb +17 -17
  14. data/lib/snaptrade/models/{line_of_credit_account_credit_details_minimum_payment_amount.rb → line_of_credit_account_minimum_payment_amount.rb} +4 -4
  15. data/lib/snaptrade/models/other_instrument.rb +1 -1
  16. data/lib/snaptrade/models/other_instrument_kind.rb +2 -1
  17. data/lib/snaptrade/models/snaptrade.rb +37 -0
  18. data/lib/snaptrade/models/underlying_cfd_instrument.rb +1 -0
  19. data/lib/snaptrade/models/underlying_option_instrument.rb +1 -0
  20. data/lib/snaptrade/version.rb +1 -1
  21. data/lib/snaptrade.rb +4 -2
  22. data/spec/api/account_information_api_spec.rb +1 -1
  23. data/spec/api/connections_api_spec.rb +1 -1
  24. data/spec/models/brokerage_authorization_data_freshness_mode_spec.rb +35 -0
  25. data/spec/models/deposit_account_spec.rb +1 -1
  26. data/spec/models/institution_spec.rb +23 -0
  27. data/spec/models/instrument_spec.rb +1 -1
  28. data/spec/models/investment_account_spec.rb +1 -1
  29. data/spec/models/{line_of_credit_account_credit_details_minimum_payment_amount_spec.rb → line_of_credit_account_minimum_payment_amount_spec.rb} +6 -6
  30. data/spec/models/line_of_credit_account_spec.rb +2 -2
  31. data/spec/models/snaptrade_spec.rb +23 -0
  32. data/spec/models/underlying_cfd_instrument_spec.rb +1 -1
  33. data/spec/models/underlying_option_instrument_spec.rb +1 -1
  34. metadata +224 -218
  35. data/spec/models/line_of_credit_account_credit_details_spec.rb +0 -29
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Security instrument metadata for other mapped security positions.
14
+ # Security instrument metadata for bonds and other mapped security positions.
15
15
  class OtherInstrument
16
16
  # Type of security instrument.
17
17
  attr_accessor :kind
@@ -12,10 +12,11 @@ require 'time'
12
12
 
13
13
  module SnapTrade
14
14
  class OtherInstrumentKind
15
+ BOND = "bond".freeze
15
16
  OTHER = "other".freeze
16
17
 
17
18
  def self.all_vars
18
- @all_vars ||= [OTHER].freeze
19
+ @all_vars ||= [BOND, OTHER].freeze
19
20
  end
20
21
 
21
22
  # Builds the enum from string
@@ -0,0 +1,37 @@
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 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ class Snaptrade
15
+ REALTIME = "realtime".freeze
16
+ DELAYED = "delayed".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [REALTIME, DELAYED].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if Snaptrade.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #Snaptrade"
35
+ end
36
+ end
37
+ end
@@ -36,6 +36,7 @@ module SnapTrade
36
36
  def openapi_discriminator_mapping
37
37
  {
38
38
  :'adr' => :'AdrInstrument',
39
+ :'bond' => :'OtherInstrument',
39
40
  :'cef' => :'CefInstrument',
40
41
  :'crypto' => :'CryptoInstrument',
41
42
  :'etf' => :'EtfInstrument',
@@ -36,6 +36,7 @@ module SnapTrade
36
36
  def openapi_discriminator_mapping
37
37
  {
38
38
  :'adr' => :'AdrInstrument',
39
+ :'bond' => :'OtherInstrument',
39
40
  :'cef' => :'CefInstrument',
40
41
  :'crypto' => :'CryptoInstrument',
41
42
  :'etf' => :'EtfInstrument',
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '3.0.13'
11
+ VERSION = '3.0.14'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -60,6 +60,7 @@ require 'snaptrade/models/balance'
60
60
  require 'snaptrade/models/balance_currency'
61
61
  require 'snaptrade/models/brokerage'
62
62
  require 'snaptrade/models/brokerage_authorization'
63
+ require 'snaptrade/models/brokerage_authorization_data_freshness_mode'
63
64
  require 'snaptrade/models/brokerage_authorization_disabled_confirmation'
64
65
  require 'snaptrade/models/brokerage_authorization_refresh_confirmation'
65
66
  require 'snaptrade/models/brokerage_authorization_transactions_sync_confirmation'
@@ -113,14 +114,14 @@ require 'snaptrade/models/figi_instrument'
113
114
  require 'snaptrade/models/future_instrument'
114
115
  require 'snaptrade/models/future_instrument_kind'
115
116
  require 'snaptrade/models/holdings_status'
117
+ require 'snaptrade/models/institution'
116
118
  require 'snaptrade/models/instrument'
117
119
  require 'snaptrade/models/investment_account'
118
120
  require 'snaptrade/models/investment_account_net_value'
119
121
  require 'snaptrade/models/kind'
120
122
  require 'snaptrade/models/line_of_credit_account'
121
- require 'snaptrade/models/line_of_credit_account_credit_details'
122
- require 'snaptrade/models/line_of_credit_account_credit_details_minimum_payment_amount'
123
123
  require 'snaptrade/models/line_of_credit_account_kind'
124
+ require 'snaptrade/models/line_of_credit_account_minimum_payment_amount'
124
125
  require 'snaptrade/models/line_of_credit_account_net_value'
125
126
  require 'snaptrade/models/line_of_credit_account_sync_status'
126
127
  require 'snaptrade/models/login_redirect_uri'
@@ -211,6 +212,7 @@ require 'snaptrade/models/snap_trade_holdings_account'
211
212
  require 'snaptrade/models/snap_trade_holdings_total_value'
212
213
  require 'snaptrade/models/snap_trade_login_user_request_body'
213
214
  require 'snaptrade/models/snap_trade_register_user_request_body'
215
+ require 'snaptrade/models/snaptrade'
214
216
  require 'snaptrade/models/status'
215
217
  require 'snaptrade/models/stock_instrument'
216
218
  require 'snaptrade/models/stock_instrument_figi_instrument'
@@ -62,7 +62,7 @@ describe 'AccountInformationApi' do
62
62
 
63
63
  # unit tests for get_all_account_positions
64
64
  # List all account positions
65
- # Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
65
+ # Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`. Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
66
66
  # @param user_id
67
67
  # @param user_secret
68
68
  # @param account_id
@@ -98,7 +98,7 @@ describe 'ConnectionsApi' do
98
98
 
99
99
  # unit tests for refresh_brokerage_authorization
100
100
  # Refresh holdings for a connection
101
- # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
101
+ # Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
102
102
  # @param authorization_id
103
103
  # @param user_id
104
104
  # @param user_secret
@@ -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::BrokerageAuthorizationDataFreshnessMode
15
+ describe SnapTrade::BrokerageAuthorizationDataFreshnessMode do
16
+ let(:instance) { SnapTrade::BrokerageAuthorizationDataFreshnessMode.new }
17
+
18
+ describe 'test an instance of BrokerageAuthorizationDataFreshnessMode' do
19
+ it 'should create an instance of BrokerageAuthorizationDataFreshnessMode' do
20
+ expect(instance).to be_instance_of(SnapTrade::BrokerageAuthorizationDataFreshnessMode)
21
+ end
22
+ end
23
+ describe 'test attribute "institution"' 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 "snaptrade"' 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
@@ -44,7 +44,7 @@ describe SnapTrade::DepositAccount do
44
44
  end
45
45
  end
46
46
 
47
- describe 'test attribute "number"' do
47
+ describe 'test attribute "masked_account_number"' do
48
48
  it 'should work' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  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::Institution
15
+ describe SnapTrade::Institution do
16
+ let(:instance) { SnapTrade::Institution.new }
17
+
18
+ describe 'test an instance of Institution' do
19
+ it 'should create an instance of Institution' do
20
+ expect(instance).to be_instance_of(SnapTrade::Institution)
21
+ end
22
+ end
23
+ end
@@ -27,7 +27,7 @@ describe SnapTrade::Instrument do
27
27
 
28
28
  describe '.openapi_discriminator_mapping' do
29
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)
30
+ expect(described_class.openapi_discriminator_mapping.values.uniq.sort).to eq(described_class.openapi_one_of.sort)
31
31
  end
32
32
  end
33
33
 
@@ -44,7 +44,7 @@ describe SnapTrade::InvestmentAccount do
44
44
  end
45
45
  end
46
46
 
47
- describe 'test attribute "number"' do
47
+ describe 'test attribute "masked_account_number"' do
48
48
  it 'should work' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
@@ -11,13 +11,13 @@ require 'spec_helper'
11
11
  require 'json'
12
12
  require 'date'
13
13
 
14
- # Unit tests for SnapTrade::LineOfCreditAccountCreditDetailsMinimumPaymentAmount
15
- describe SnapTrade::LineOfCreditAccountCreditDetailsMinimumPaymentAmount do
16
- let(:instance) { SnapTrade::LineOfCreditAccountCreditDetailsMinimumPaymentAmount.new }
14
+ # Unit tests for SnapTrade::LineOfCreditAccountMinimumPaymentAmount
15
+ describe SnapTrade::LineOfCreditAccountMinimumPaymentAmount do
16
+ let(:instance) { SnapTrade::LineOfCreditAccountMinimumPaymentAmount.new }
17
17
 
18
- describe 'test an instance of LineOfCreditAccountCreditDetailsMinimumPaymentAmount' do
19
- it 'should create an instance of LineOfCreditAccountCreditDetailsMinimumPaymentAmount' do
20
- expect(instance).to be_instance_of(SnapTrade::LineOfCreditAccountCreditDetailsMinimumPaymentAmount)
18
+ describe 'test an instance of LineOfCreditAccountMinimumPaymentAmount' do
19
+ it 'should create an instance of LineOfCreditAccountMinimumPaymentAmount' do
20
+ expect(instance).to be_instance_of(SnapTrade::LineOfCreditAccountMinimumPaymentAmount)
21
21
  end
22
22
  end
23
23
  describe 'test attribute "amount"' do
@@ -44,7 +44,7 @@ describe SnapTrade::LineOfCreditAccount do
44
44
  end
45
45
  end
46
46
 
47
- describe 'test attribute "number"' do
47
+ describe 'test attribute "masked_account_number"' do
48
48
  it 'should work' do
49
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
50
  end
@@ -86,7 +86,7 @@ describe SnapTrade::LineOfCreditAccount do
86
86
  end
87
87
  end
88
88
 
89
- describe 'test attribute "credit_details"' do
89
+ describe 'test attribute "minimum_payment_amount"' do
90
90
  it 'should work' do
91
91
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
92
  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::Snaptrade
15
+ describe SnapTrade::Snaptrade do
16
+ let(:instance) { SnapTrade::Snaptrade.new }
17
+
18
+ describe 'test an instance of Snaptrade' do
19
+ it 'should create an instance of Snaptrade' do
20
+ expect(instance).to be_instance_of(SnapTrade::Snaptrade)
21
+ end
22
+ end
23
+ end
@@ -27,7 +27,7 @@ describe SnapTrade::UnderlyingCfdInstrument do
27
27
 
28
28
  describe '.openapi_discriminator_mapping' do
29
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)
30
+ expect(described_class.openapi_discriminator_mapping.values.uniq.sort).to eq(described_class.openapi_one_of.sort)
31
31
  end
32
32
  end
33
33
 
@@ -27,7 +27,7 @@ describe SnapTrade::UnderlyingOptionInstrument do
27
27
 
28
28
  describe '.openapi_discriminator_mapping' do
29
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)
30
+ expect(described_class.openapi_discriminator_mapping.values.uniq.sort).to eq(described_class.openapi_one_of.sort)
31
31
  end
32
32
  end
33
33