snaptrade 2.0.32 → 2.0.34
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +26 -21
- data/lib/snaptrade/api/account_information_api.rb +70 -52
- data/lib/snaptrade/api/options_api.rb +16 -12
- data/lib/snaptrade/models/account.rb +13 -3
- data/lib/snaptrade/models/account_balance_total.rb +1 -8
- data/lib/snaptrade/models/account_holdings_account.rb +2 -2
- data/lib/snaptrade/models/account_order_record.rb +22 -18
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id_balance.rb → account_order_record_option_symbol.rb} +102 -12
- data/lib/snaptrade/models/{snap_trade_holdings_account_account_id.rb → account_order_record_universal_symbol.rb} +106 -73
- data/lib/snaptrade/models/account_sync_status.rb +1 -1
- data/lib/snaptrade/models/balance.rb +1 -1
- data/lib/snaptrade/models/{cash_restriction.rb → balance_currency.rb} +27 -35
- data/lib/snaptrade/models/brokerage_authorization_type_read_only.rb +1 -1
- data/lib/snaptrade/models/holdings_status.rb +4 -4
- data/lib/snaptrade/models/monthly_dividends.rb +1 -1
- data/lib/snaptrade/models/net_contributions.rb +1 -1
- data/lib/snaptrade/models/order_type_strict.rb +2 -2
- data/lib/snaptrade/models/past_value.rb +1 -1
- data/lib/snaptrade/models/strategy_order_record.rb +1 -1
- data/lib/snaptrade/models/sub_period_return_rate.rb +2 -2
- data/lib/snaptrade/models/transactions_status.rb +4 -5
- data/lib/snaptrade/models/type.rb +3 -3
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +3 -5
- data/spec/api/account_information_api_spec.rb +12 -12
- data/spec/api/options_api_spec.rb +3 -3
- data/spec/models/{cash_restriction_spec.rb → account_order_record_option_symbol_spec.rb} +22 -10
- data/spec/models/{snap_trade_holdings_account_account_id_spec.rb → account_order_record_universal_symbol_spec.rb} +15 -15
- data/spec/models/balance_currency_spec.rb +41 -0
- metadata +11 -17
- data/lib/snaptrade/models/amount.rb +0 -228
- data/lib/snaptrade/models/brokerage_authorization_type_read_only_type.rb +0 -37
- data/spec/models/amount_spec.rb +0 -35
- data/spec/models/brokerage_authorization_type_read_only_type_spec.rb +0 -23
- data/spec/models/snap_trade_holdings_account_account_id_balance_spec.rb +0 -29
|
@@ -43,10 +43,10 @@ describe 'AccountInformationApi' do
|
|
|
43
43
|
|
|
44
44
|
# unit tests for get_user_account_balance
|
|
45
45
|
# List account balances
|
|
46
|
-
#
|
|
46
|
+
# Returns a 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). 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**.
|
|
47
47
|
# @param user_id
|
|
48
48
|
# @param user_secret
|
|
49
|
-
# @param account_id
|
|
49
|
+
# @param account_id
|
|
50
50
|
# @param [Hash] opts the optional parameters
|
|
51
51
|
# @return [Array<Balance>]
|
|
52
52
|
describe 'get_user_account_balance test' do
|
|
@@ -56,11 +56,11 @@ describe 'AccountInformationApi' do
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# unit tests for get_user_account_details
|
|
59
|
-
#
|
|
60
|
-
# Returns
|
|
59
|
+
# Get account detail
|
|
60
|
+
# Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
61
61
|
# @param user_id
|
|
62
62
|
# @param user_secret
|
|
63
|
-
# @param account_id
|
|
63
|
+
# @param account_id
|
|
64
64
|
# @param [Hash] opts the optional parameters
|
|
65
65
|
# @return [Account]
|
|
66
66
|
describe 'get_user_account_details test' do
|
|
@@ -70,11 +70,11 @@ describe 'AccountInformationApi' do
|
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
# unit tests for get_user_account_orders
|
|
73
|
-
# List account orders
|
|
74
|
-
#
|
|
73
|
+
# List account recent orders
|
|
74
|
+
# Returns a list of recent orders in the specified account. 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**.
|
|
75
75
|
# @param user_id
|
|
76
76
|
# @param user_secret
|
|
77
|
-
# @param account_id
|
|
77
|
+
# @param account_id
|
|
78
78
|
# @param [Hash] opts the optional parameters
|
|
79
79
|
# @option opts [String] :state defaults value is set to \"all\"
|
|
80
80
|
# @option opts [Integer] :days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in.
|
|
@@ -87,10 +87,10 @@ describe 'AccountInformationApi' do
|
|
|
87
87
|
|
|
88
88
|
# unit tests for get_user_account_positions
|
|
89
89
|
# List account positions
|
|
90
|
-
# Returns a list of positions in the specified account.
|
|
90
|
+
# Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). 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**.
|
|
91
91
|
# @param user_id
|
|
92
92
|
# @param user_secret
|
|
93
|
-
# @param account_id
|
|
93
|
+
# @param account_id
|
|
94
94
|
# @param [Hash] opts the optional parameters
|
|
95
95
|
# @return [Array<Position>]
|
|
96
96
|
describe 'get_user_account_positions test' do
|
|
@@ -101,7 +101,7 @@ describe 'AccountInformationApi' do
|
|
|
101
101
|
|
|
102
102
|
# unit tests for get_user_holdings
|
|
103
103
|
# List account holdings
|
|
104
|
-
#
|
|
104
|
+
# Returns a list of balances, 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**.
|
|
105
105
|
# @param account_id
|
|
106
106
|
# @param user_id
|
|
107
107
|
# @param user_secret
|
|
@@ -115,7 +115,7 @@ describe 'AccountInformationApi' do
|
|
|
115
115
|
|
|
116
116
|
# unit tests for list_user_accounts
|
|
117
117
|
# List accounts
|
|
118
|
-
#
|
|
118
|
+
# Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
119
119
|
# @param user_id
|
|
120
120
|
# @param user_secret
|
|
121
121
|
# @param [Hash] opts the optional parameters
|
|
@@ -73,11 +73,11 @@ describe 'OptionsApi' do
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
# unit tests for list_option_holdings
|
|
76
|
-
#
|
|
77
|
-
# Returns a list of
|
|
76
|
+
# List account option positions
|
|
77
|
+
# Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). 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**.
|
|
78
78
|
# @param user_id
|
|
79
79
|
# @param user_secret
|
|
80
|
-
# @param account_id
|
|
80
|
+
# @param account_id
|
|
81
81
|
# @param [Hash] opts the optional parameters
|
|
82
82
|
# @return [Array<OptionsPosition>]
|
|
83
83
|
describe 'list_option_holdings test' do
|
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
|
11
11
|
require 'json'
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
# Unit tests for SnapTrade::
|
|
15
|
-
describe SnapTrade::
|
|
16
|
-
let(:instance) { SnapTrade::
|
|
14
|
+
# Unit tests for SnapTrade::AccountOrderRecordOptionSymbol
|
|
15
|
+
describe SnapTrade::AccountOrderRecordOptionSymbol do
|
|
16
|
+
let(:instance) { SnapTrade::AccountOrderRecordOptionSymbol.new }
|
|
17
17
|
|
|
18
|
-
describe 'test an instance of
|
|
19
|
-
it 'should create an instance of
|
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
|
18
|
+
describe 'test an instance of AccountOrderRecordOptionSymbol' do
|
|
19
|
+
it 'should create an instance of AccountOrderRecordOptionSymbol' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::AccountOrderRecordOptionSymbol)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
describe 'test attribute "id"' do
|
|
@@ -26,25 +26,37 @@ describe SnapTrade::CashRestriction do
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
describe 'test attribute "
|
|
29
|
+
describe 'test attribute "ticker"' do
|
|
30
30
|
it 'should work' do
|
|
31
31
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
describe 'test attribute "
|
|
35
|
+
describe 'test attribute "option_type"' do
|
|
36
36
|
it 'should work' do
|
|
37
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
describe 'test attribute "
|
|
41
|
+
describe 'test attribute "strike_price"' do
|
|
42
42
|
it 'should work' do
|
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
describe 'test attribute "
|
|
47
|
+
describe 'test attribute "expiration_date"' 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 "is_mini_option"' 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 "underlying_symbol"' do
|
|
48
60
|
it 'should work' do
|
|
49
61
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
62
|
end
|
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
|
11
11
|
require 'json'
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
|
-
# Unit tests for SnapTrade::
|
|
15
|
-
describe SnapTrade::
|
|
16
|
-
let(:instance) { SnapTrade::
|
|
14
|
+
# Unit tests for SnapTrade::AccountOrderRecordUniversalSymbol
|
|
15
|
+
describe SnapTrade::AccountOrderRecordUniversalSymbol do
|
|
16
|
+
let(:instance) { SnapTrade::AccountOrderRecordUniversalSymbol.new }
|
|
17
17
|
|
|
18
|
-
describe 'test an instance of
|
|
19
|
-
it 'should create an instance of
|
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
|
18
|
+
describe 'test an instance of AccountOrderRecordUniversalSymbol' do
|
|
19
|
+
it 'should create an instance of AccountOrderRecordUniversalSymbol' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::AccountOrderRecordUniversalSymbol)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
describe 'test attribute "id"' do
|
|
@@ -26,55 +26,55 @@ describe SnapTrade::SnapTradeHoldingsAccountAccountId do
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
describe 'test attribute "
|
|
29
|
+
describe 'test attribute "symbol"' do
|
|
30
30
|
it 'should work' do
|
|
31
31
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
describe 'test attribute "
|
|
35
|
+
describe 'test attribute "raw_symbol"' do
|
|
36
36
|
it 'should work' do
|
|
37
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
describe 'test attribute "
|
|
41
|
+
describe 'test attribute "description"' do
|
|
42
42
|
it 'should work' do
|
|
43
43
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
describe 'test attribute "
|
|
47
|
+
describe 'test attribute "currency"' 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
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
describe 'test attribute "
|
|
53
|
+
describe 'test attribute "exchange"' do
|
|
54
54
|
it 'should work' do
|
|
55
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
describe 'test attribute "
|
|
59
|
+
describe 'test attribute "type"' do
|
|
60
60
|
it 'should work' do
|
|
61
61
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
describe 'test attribute "
|
|
65
|
+
describe 'test attribute "currencies"' do
|
|
66
66
|
it 'should work' do
|
|
67
67
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
describe 'test attribute "
|
|
71
|
+
describe 'test attribute "figi_code"' do
|
|
72
72
|
it 'should work' do
|
|
73
73
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
74
74
|
end
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
describe 'test attribute "
|
|
77
|
+
describe 'test attribute "figi_instrument"' do
|
|
78
78
|
it 'should work' do
|
|
79
79
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
80
80
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
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::BalanceCurrency
|
|
15
|
+
describe SnapTrade::BalanceCurrency do
|
|
16
|
+
let(:instance) { SnapTrade::BalanceCurrency.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of BalanceCurrency' do
|
|
19
|
+
it 'should create an instance of BalanceCurrency' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::BalanceCurrency)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "id"' 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 "code"' 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 "name"' 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
|
+
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.
|
|
4
|
+
version: 2.0.34
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-08-
|
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -101,23 +101,23 @@ files:
|
|
|
101
101
|
- lib/snaptrade/models/account_holdings.rb
|
|
102
102
|
- lib/snaptrade/models/account_holdings_account.rb
|
|
103
103
|
- lib/snaptrade/models/account_order_record.rb
|
|
104
|
+
- lib/snaptrade/models/account_order_record_option_symbol.rb
|
|
104
105
|
- lib/snaptrade/models/account_order_record_status.rb
|
|
106
|
+
- lib/snaptrade/models/account_order_record_universal_symbol.rb
|
|
105
107
|
- lib/snaptrade/models/account_simple.rb
|
|
106
108
|
- lib/snaptrade/models/account_sync_status.rb
|
|
107
109
|
- lib/snaptrade/models/action_strict.rb
|
|
108
|
-
- lib/snaptrade/models/amount.rb
|
|
109
110
|
- lib/snaptrade/models/auth_type.rb
|
|
110
111
|
- lib/snaptrade/models/authentication_login_snap_trade_user200_response.rb
|
|
111
112
|
- lib/snaptrade/models/balance.rb
|
|
113
|
+
- lib/snaptrade/models/balance_currency.rb
|
|
112
114
|
- lib/snaptrade/models/brokerage.rb
|
|
113
115
|
- lib/snaptrade/models/brokerage_authorization.rb
|
|
114
116
|
- lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb
|
|
115
117
|
- lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb
|
|
116
118
|
- lib/snaptrade/models/brokerage_authorization_type_read_only.rb
|
|
117
119
|
- lib/snaptrade/models/brokerage_authorization_type_read_only_brokerage.rb
|
|
118
|
-
- lib/snaptrade/models/brokerage_authorization_type_read_only_type.rb
|
|
119
120
|
- lib/snaptrade/models/brokerage_type.rb
|
|
120
|
-
- lib/snaptrade/models/cash_restriction.rb
|
|
121
121
|
- lib/snaptrade/models/connection_portal_version.rb
|
|
122
122
|
- lib/snaptrade/models/connection_type.rb
|
|
123
123
|
- lib/snaptrade/models/connections_session_events200_response_inner.rb
|
|
@@ -173,8 +173,6 @@ files:
|
|
|
173
173
|
- lib/snaptrade/models/session_event.rb
|
|
174
174
|
- lib/snaptrade/models/session_event_type.rb
|
|
175
175
|
- lib/snaptrade/models/snap_trade_holdings_account.rb
|
|
176
|
-
- lib/snaptrade/models/snap_trade_holdings_account_account_id.rb
|
|
177
|
-
- lib/snaptrade/models/snap_trade_holdings_account_account_id_balance.rb
|
|
178
176
|
- lib/snaptrade/models/snap_trade_holdings_total_value.rb
|
|
179
177
|
- lib/snaptrade/models/snap_trade_login_user_request_body.rb
|
|
180
178
|
- lib/snaptrade/models/snap_trade_register_user_request_body.rb
|
|
@@ -220,25 +218,25 @@ files:
|
|
|
220
218
|
- spec/models/account_balance_total_spec.rb
|
|
221
219
|
- spec/models/account_holdings_account_spec.rb
|
|
222
220
|
- spec/models/account_holdings_spec.rb
|
|
221
|
+
- spec/models/account_order_record_option_symbol_spec.rb
|
|
223
222
|
- spec/models/account_order_record_spec.rb
|
|
224
223
|
- spec/models/account_order_record_status_spec.rb
|
|
224
|
+
- spec/models/account_order_record_universal_symbol_spec.rb
|
|
225
225
|
- spec/models/account_simple_spec.rb
|
|
226
226
|
- spec/models/account_spec.rb
|
|
227
227
|
- spec/models/account_sync_status_spec.rb
|
|
228
228
|
- spec/models/action_strict_spec.rb
|
|
229
|
-
- spec/models/amount_spec.rb
|
|
230
229
|
- spec/models/auth_type_spec.rb
|
|
231
230
|
- spec/models/authentication_login_snap_trade_user200_response_spec.rb
|
|
231
|
+
- spec/models/balance_currency_spec.rb
|
|
232
232
|
- spec/models/balance_spec.rb
|
|
233
233
|
- spec/models/brokerage_authorization_disabled_confirmation_spec.rb
|
|
234
234
|
- spec/models/brokerage_authorization_refresh_confirmation_spec.rb
|
|
235
235
|
- spec/models/brokerage_authorization_spec.rb
|
|
236
236
|
- spec/models/brokerage_authorization_type_read_only_brokerage_spec.rb
|
|
237
237
|
- spec/models/brokerage_authorization_type_read_only_spec.rb
|
|
238
|
-
- spec/models/brokerage_authorization_type_read_only_type_spec.rb
|
|
239
238
|
- spec/models/brokerage_spec.rb
|
|
240
239
|
- spec/models/brokerage_type_spec.rb
|
|
241
|
-
- spec/models/cash_restriction_spec.rb
|
|
242
240
|
- spec/models/connection_portal_version_spec.rb
|
|
243
241
|
- spec/models/connection_type_spec.rb
|
|
244
242
|
- spec/models/connections_session_events200_response_inner_spec.rb
|
|
@@ -293,8 +291,6 @@ files:
|
|
|
293
291
|
- spec/models/security_type_spec.rb
|
|
294
292
|
- spec/models/session_event_spec.rb
|
|
295
293
|
- spec/models/session_event_type_spec.rb
|
|
296
|
-
- spec/models/snap_trade_holdings_account_account_id_balance_spec.rb
|
|
297
|
-
- spec/models/snap_trade_holdings_account_account_id_spec.rb
|
|
298
294
|
- spec/models/snap_trade_holdings_account_spec.rb
|
|
299
295
|
- spec/models/snap_trade_holdings_total_value_spec.rb
|
|
300
296
|
- spec/models/snap_trade_login_user_request_body_spec.rb
|
|
@@ -363,7 +359,6 @@ test_files:
|
|
|
363
359
|
- spec/configuration_spec.rb
|
|
364
360
|
- spec/getting_started_spec.rb
|
|
365
361
|
- spec/models/universal_symbol_spec.rb
|
|
366
|
-
- spec/models/snap_trade_holdings_account_account_id_spec.rb
|
|
367
362
|
- spec/models/monthly_dividends_spec.rb
|
|
368
363
|
- spec/models/symbol_query_spec.rb
|
|
369
364
|
- spec/models/connection_portal_version_spec.rb
|
|
@@ -371,13 +366,11 @@ test_files:
|
|
|
371
366
|
- spec/models/type_spec.rb
|
|
372
367
|
- spec/models/sub_period_return_rate_spec.rb
|
|
373
368
|
- spec/models/brokerage_spec.rb
|
|
374
|
-
- spec/models/snap_trade_holdings_account_account_id_balance_spec.rb
|
|
375
369
|
- spec/models/underlying_symbol_spec.rb
|
|
376
370
|
- spec/models/model404_failed_request_response_spec.rb
|
|
377
371
|
- spec/models/snap_trade_login_user_request_body_spec.rb
|
|
378
372
|
- spec/models/manual_trade_form_spec.rb
|
|
379
373
|
- spec/models/option_strategy_legs_inner_spec.rb
|
|
380
|
-
- spec/models/brokerage_authorization_type_read_only_type_spec.rb
|
|
381
374
|
- spec/models/session_event_type_spec.rb
|
|
382
375
|
- spec/models/account_holdings_spec.rb
|
|
383
376
|
- spec/models/exchange_spec.rb
|
|
@@ -417,8 +410,7 @@ test_files:
|
|
|
417
410
|
- spec/models/symbol_spec.rb
|
|
418
411
|
- spec/models/underlying_symbol_type_spec.rb
|
|
419
412
|
- spec/models/security_type_spec.rb
|
|
420
|
-
- spec/models/
|
|
421
|
-
- spec/models/cash_restriction_spec.rb
|
|
413
|
+
- spec/models/account_order_record_option_symbol_spec.rb
|
|
422
414
|
- spec/models/account_simple_spec.rb
|
|
423
415
|
- spec/models/symbols_quotes_inner_spec.rb
|
|
424
416
|
- spec/models/account_balance_spec.rb
|
|
@@ -452,7 +444,9 @@ test_files:
|
|
|
452
444
|
- spec/models/brokerage_authorization_type_read_only_brokerage_spec.rb
|
|
453
445
|
- spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb
|
|
454
446
|
- spec/models/option_chain_inner_spec.rb
|
|
447
|
+
- spec/models/account_order_record_universal_symbol_spec.rb
|
|
455
448
|
- spec/models/connections_session_events200_response_inner_spec.rb
|
|
449
|
+
- spec/models/balance_currency_spec.rb
|
|
456
450
|
- spec/models/figi_instrument_spec.rb
|
|
457
451
|
- spec/models/encrypted_response_encrypted_message_data_spec.rb
|
|
458
452
|
- spec/models/performance_custom_spec.rb
|
|
@@ -1,228 +0,0 @@
|
|
|
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
|
-
# Total value of the account, as reported by the brokerage
|
|
15
|
-
class Amount
|
|
16
|
-
# Total value denominated in the currency of the `currency` field.
|
|
17
|
-
attr_accessor :amount
|
|
18
|
-
|
|
19
|
-
# The ISO-4217 currency code for the amount.
|
|
20
|
-
attr_accessor :currency
|
|
21
|
-
|
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
-
def self.attribute_map
|
|
24
|
-
{
|
|
25
|
-
:'amount' => :'amount',
|
|
26
|
-
:'currency' => :'currency'
|
|
27
|
-
}
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Returns all the JSON keys this model knows about
|
|
31
|
-
def self.acceptable_attributes
|
|
32
|
-
attribute_map.values
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Attribute type mapping.
|
|
36
|
-
def self.openapi_types
|
|
37
|
-
{
|
|
38
|
-
:'amount' => :'Float',
|
|
39
|
-
:'currency' => :'String'
|
|
40
|
-
}
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# List of attributes with nullable: true
|
|
44
|
-
def self.openapi_nullable
|
|
45
|
-
Set.new([
|
|
46
|
-
])
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# Initializes the object
|
|
50
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
-
def initialize(attributes = {})
|
|
52
|
-
if (!attributes.is_a?(Hash))
|
|
53
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::Amount` initialize method"
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
57
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
58
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
59
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::Amount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
60
|
-
end
|
|
61
|
-
h[k.to_sym] = v
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if attributes.key?(:'amount')
|
|
65
|
-
self.amount = attributes[:'amount']
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
if attributes.key?(:'currency')
|
|
69
|
-
self.currency = attributes[:'currency']
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
-
# @return Array for valid properties with the reasons
|
|
75
|
-
def list_invalid_properties
|
|
76
|
-
invalid_properties = Array.new
|
|
77
|
-
invalid_properties
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Check to see if the all the properties in the model are valid
|
|
81
|
-
# @return true if the model is valid
|
|
82
|
-
def valid?
|
|
83
|
-
true
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Checks equality by comparing each attribute.
|
|
87
|
-
# @param [Object] Object to be compared
|
|
88
|
-
def ==(o)
|
|
89
|
-
return true if self.equal?(o)
|
|
90
|
-
self.class == o.class &&
|
|
91
|
-
amount == o.amount &&
|
|
92
|
-
currency == o.currency
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# @see the `==` method
|
|
96
|
-
# @param [Object] Object to be compared
|
|
97
|
-
def eql?(o)
|
|
98
|
-
self == o
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
# Calculates hash code according to all attributes.
|
|
102
|
-
# @return [Integer] Hash code
|
|
103
|
-
def hash
|
|
104
|
-
[amount, currency].hash
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Builds the object from hash
|
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
-
# @return [Object] Returns the model itself
|
|
110
|
-
def self.build_from_hash(attributes)
|
|
111
|
-
new.build_from_hash(attributes)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# Builds the object from hash
|
|
115
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
|
-
# @return [Object] Returns the model itself
|
|
117
|
-
def build_from_hash(attributes)
|
|
118
|
-
return nil unless attributes.is_a?(Hash)
|
|
119
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
120
|
-
self.class.openapi_types.each_pair do |key, type|
|
|
121
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
122
|
-
self.send("#{key}=", nil)
|
|
123
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
124
|
-
# check to ensure the input is an array given that the attribute
|
|
125
|
-
# is documented as an array but the input is not
|
|
126
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
127
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
128
|
-
end
|
|
129
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
130
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
self
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
# Deserializes the data based on type
|
|
138
|
-
# @param string type Data type
|
|
139
|
-
# @param string value Value to be deserialized
|
|
140
|
-
# @return [Object] Deserialized data
|
|
141
|
-
def _deserialize(type, value)
|
|
142
|
-
case type.to_sym
|
|
143
|
-
when :Time
|
|
144
|
-
Time.parse(value)
|
|
145
|
-
when :Date
|
|
146
|
-
Date.parse(value)
|
|
147
|
-
when :String
|
|
148
|
-
value.to_s
|
|
149
|
-
when :Integer
|
|
150
|
-
value.to_i
|
|
151
|
-
when :Float
|
|
152
|
-
value.to_f
|
|
153
|
-
when :Boolean
|
|
154
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
155
|
-
true
|
|
156
|
-
else
|
|
157
|
-
false
|
|
158
|
-
end
|
|
159
|
-
when :Object
|
|
160
|
-
# generic object (usually a Hash), return directly
|
|
161
|
-
value
|
|
162
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
163
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
164
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
165
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
166
|
-
k_type = Regexp.last_match[:k_type]
|
|
167
|
-
v_type = Regexp.last_match[:v_type]
|
|
168
|
-
{}.tap do |hash|
|
|
169
|
-
value.each do |k, v|
|
|
170
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
else # model
|
|
174
|
-
# models (e.g. Pet) or oneOf
|
|
175
|
-
klass = SnapTrade.const_get(type)
|
|
176
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
177
|
-
end
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
# Returns the string representation of the object
|
|
181
|
-
# @return [String] String presentation of the object
|
|
182
|
-
def to_s
|
|
183
|
-
to_hash.to_s
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
187
|
-
# @return [Hash] Returns the object in the form of hash
|
|
188
|
-
def to_body
|
|
189
|
-
to_hash
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# Returns the object in the form of hash
|
|
193
|
-
# @return [Hash] Returns the object in the form of hash
|
|
194
|
-
def to_hash
|
|
195
|
-
hash = {}
|
|
196
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
-
value = self.send(attr)
|
|
198
|
-
if value.nil?
|
|
199
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
hash[param] = _to_hash(value)
|
|
204
|
-
end
|
|
205
|
-
hash
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
# Outputs non-array value in the form of hash
|
|
209
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
210
|
-
# @param [Object] value Any valid value
|
|
211
|
-
# @return [Hash] Returns the value in the form of hash
|
|
212
|
-
def _to_hash(value)
|
|
213
|
-
if value.is_a?(Array)
|
|
214
|
-
value.compact.map { |v| _to_hash(v) }
|
|
215
|
-
elsif value.is_a?(Hash)
|
|
216
|
-
{}.tap do |hash|
|
|
217
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
218
|
-
end
|
|
219
|
-
elsif value.respond_to? :to_hash
|
|
220
|
-
value.to_hash
|
|
221
|
-
else
|
|
222
|
-
value
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
end
|