snaptrade 2.0.26 → 2.0.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f02b2217951a3d74e760540092af444a44f291d8318004701f0c6599b8035c9
4
- data.tar.gz: d3d184ef83654c23e494d33f5a9e4117a8894acc3d169221917beee56e418305
3
+ metadata.gz: 6042448247c24c9ffbf7656391e3ae3c3027e5acffec97f3de615faf5d15dd57
4
+ data.tar.gz: bcb2d19068587ca7f97bf4f7ece5c722deb5f3a4bf29dcbb97cd9bc30dc549d2
5
5
  SHA512:
6
- metadata.gz: 79bf35d54c567ac3d10cc5976fb1e59d446ea9e7c589f3a613abdb486605544feca1d22ab769cd9253eac9cde711f20d3943ba007ad5b0582e8515f49499fe67
7
- data.tar.gz: d2d863e7c308480c36c0dfe5b1801c85e39a6a967ed1f0221fd2e485fdc52a94bb1dbc8705e03fa921ebe417035ff8d77a9288cc5a636908687e83342db28045
6
+ metadata.gz: 768abac024f9c9e18035f16aa8af729f2034e32ee3792d9770c9a695a7eda05ea1a2f2dcfefb70ab707d5992da8a2258df7e599be14e918b209f1c0ef3b2dcbf
7
+ data.tar.gz: 3605ff7b1215aa6b8f8ec1e1eaec5a17ee2f19d37e3db41496143b0baf6009332426de796227c5e3733d8b531fc4fdc9ab4da8d61c346a57416f04057f9db8f3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.25)
4
+ snaptrade (2.0.26)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
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.26-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.26)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.27-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.27)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -71,7 +71,7 @@ Connect brokerage accounts to your app for live positions and trading
71
71
  Add to Gemfile:
72
72
 
73
73
  ```ruby
74
- gem 'snaptrade', '~> 2.0.26'
74
+ gem 'snaptrade', '~> 2.0.27'
75
75
  ```
76
76
 
77
77
  ## Getting Started<a id="getting-started"></a>
@@ -15,10 +15,13 @@ module SnapTrade
15
15
  class AccountSyncStatus
16
16
  attr_accessor :transactions
17
17
 
18
+ attr_accessor :holdings
19
+
18
20
  # Attribute mapping from ruby-style variable name to JSON key.
19
21
  def self.attribute_map
20
22
  {
21
- :'transactions' => :'transactions'
23
+ :'transactions' => :'transactions',
24
+ :'holdings' => :'holdings'
22
25
  }
23
26
  end
24
27
 
@@ -30,7 +33,8 @@ module SnapTrade
30
33
  # Attribute type mapping.
31
34
  def self.openapi_types
32
35
  {
33
- :'transactions' => :'TransactionsStatus'
36
+ :'transactions' => :'TransactionsStatus',
37
+ :'holdings' => :'HoldingsStatus'
34
38
  }
35
39
  end
36
40
 
@@ -58,6 +62,10 @@ module SnapTrade
58
62
  if attributes.key?(:'transactions')
59
63
  self.transactions = attributes[:'transactions']
60
64
  end
65
+
66
+ if attributes.key?(:'holdings')
67
+ self.holdings = attributes[:'holdings']
68
+ end
61
69
  end
62
70
 
63
71
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -78,7 +86,8 @@ module SnapTrade
78
86
  def ==(o)
79
87
  return true if self.equal?(o)
80
88
  self.class == o.class &&
81
- transactions == o.transactions
89
+ transactions == o.transactions &&
90
+ holdings == o.holdings
82
91
  end
83
92
 
84
93
  # @see the `==` method
@@ -90,7 +99,7 @@ module SnapTrade
90
99
  # Calculates hash code according to all attributes.
91
100
  # @return [Integer] Hash code
92
101
  def hash
93
- [transactions].hash
102
+ [transactions, holdings].hash
94
103
  end
95
104
 
96
105
  # Builds the object from hash
@@ -0,0 +1,228 @@
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
+ # Status of account holdings sync
15
+ class HoldingsStatus
16
+ attr_accessor :initial_sync_completed
17
+
18
+ # Date in ISO 8601 format or null (YYYY-MM-DD HH:MM:SS.mmmmmmTZ)
19
+ attr_accessor :last_successful_sync
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'initial_sync_completed' => :'initial_sync_completed',
25
+ :'last_successful_sync' => :'last_successful_sync'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'initial_sync_completed' => :'Boolean',
38
+ :'last_successful_sync' => :'String'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ :'last_successful_sync'
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::HoldingsStatus` 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::HoldingsStatus`. 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?(:'initial_sync_completed')
65
+ self.initial_sync_completed = attributes[:'initial_sync_completed']
66
+ end
67
+
68
+ if attributes.key?(:'last_successful_sync')
69
+ self.last_successful_sync = attributes[:'last_successful_sync']
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
+ initial_sync_completed == o.initial_sync_completed &&
92
+ last_successful_sync == o.last_successful_sync
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
+ [initial_sync_completed, last_successful_sync].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
@@ -18,11 +18,15 @@ module SnapTrade
18
18
  # Date in YYYY-MM-DD format or null
19
19
  attr_accessor :last_successful_sync
20
20
 
21
+ # Date in YYYY-MM-DD format or null
22
+ attr_accessor :first_transaction_date
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
27
  :'initial_sync_completed' => :'initial_sync_completed',
25
- :'last_successful_sync' => :'last_successful_sync'
28
+ :'last_successful_sync' => :'last_successful_sync',
29
+ :'first_transaction_date' => :'first_transaction_date'
26
30
  }
27
31
  end
28
32
 
@@ -35,14 +39,16 @@ module SnapTrade
35
39
  def self.openapi_types
36
40
  {
37
41
  :'initial_sync_completed' => :'Boolean',
38
- :'last_successful_sync' => :'Date'
42
+ :'last_successful_sync' => :'Date',
43
+ :'first_transaction_date' => :'Date'
39
44
  }
40
45
  end
41
46
 
42
47
  # List of attributes with nullable: true
43
48
  def self.openapi_nullable
44
49
  Set.new([
45
- :'last_successful_sync'
50
+ :'last_successful_sync',
51
+ :'first_transaction_date'
46
52
  ])
47
53
  end
48
54
 
@@ -68,6 +74,10 @@ module SnapTrade
68
74
  if attributes.key?(:'last_successful_sync')
69
75
  self.last_successful_sync = attributes[:'last_successful_sync']
70
76
  end
77
+
78
+ if attributes.key?(:'first_transaction_date')
79
+ self.first_transaction_date = attributes[:'first_transaction_date']
80
+ end
71
81
  end
72
82
 
73
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,7 +99,8 @@ module SnapTrade
89
99
  return true if self.equal?(o)
90
100
  self.class == o.class &&
91
101
  initial_sync_completed == o.initial_sync_completed &&
92
- last_successful_sync == o.last_successful_sync
102
+ last_successful_sync == o.last_successful_sync &&
103
+ first_transaction_date == o.first_transaction_date
93
104
  end
94
105
 
95
106
  # @see the `==` method
@@ -101,7 +112,7 @@ module SnapTrade
101
112
  # Calculates hash code according to all attributes.
102
113
  # @return [Integer] Hash code
103
114
  def hash
104
- [initial_sync_completed, last_successful_sync].hash
115
+ [initial_sync_completed, last_successful_sync, first_transaction_date].hash
105
116
  end
106
117
 
107
118
  # Builds the object from hash
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.26'
11
+ VERSION = '2.0.27'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -57,6 +57,7 @@ require 'snaptrade/models/exchange'
57
57
  require 'snaptrade/models/exchange_rate_pairs'
58
58
  require 'snaptrade/models/excluded_asset'
59
59
  require 'snaptrade/models/figi_instrument'
60
+ require 'snaptrade/models/holdings_status'
60
61
  require 'snaptrade/models/jwt'
61
62
  require 'snaptrade/models/login_redirect_uri'
62
63
  require 'snaptrade/models/manual_trade'
@@ -26,4 +26,10 @@ describe SnapTrade::AccountSyncStatus do
26
26
  end
27
27
  end
28
28
 
29
+ describe 'test attribute "holdings"' 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
+
29
35
  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::HoldingsStatus
15
+ describe SnapTrade::HoldingsStatus do
16
+ let(:instance) { SnapTrade::HoldingsStatus.new }
17
+
18
+ describe 'test an instance of HoldingsStatus' do
19
+ it 'should create an instance of HoldingsStatus' do
20
+ expect(instance).to be_instance_of(SnapTrade::HoldingsStatus)
21
+ end
22
+ end
23
+ describe 'test attribute "initial_sync_completed"' 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 "last_successful_sync"' 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
@@ -32,4 +32,10 @@ describe SnapTrade::TransactionsStatus do
32
32
  end
33
33
  end
34
34
 
35
+ describe 'test attribute "first_transaction_date"' 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
+
35
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.26
4
+ version: 2.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-27 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -136,6 +136,7 @@ files:
136
136
  - lib/snaptrade/models/exchange_rate_pairs.rb
137
137
  - lib/snaptrade/models/excluded_asset.rb
138
138
  - lib/snaptrade/models/figi_instrument.rb
139
+ - lib/snaptrade/models/holdings_status.rb
139
140
  - lib/snaptrade/models/jwt.rb
140
141
  - lib/snaptrade/models/login_redirect_uri.rb
141
142
  - lib/snaptrade/models/manual_trade.rb
@@ -289,6 +290,7 @@ files:
289
290
  - spec/models/exchange_spec.rb
290
291
  - spec/models/excluded_asset_spec.rb
291
292
  - spec/models/figi_instrument_spec.rb
293
+ - spec/models/holdings_status_spec.rb
292
294
  - spec/models/jwt_spec.rb
293
295
  - spec/models/login_redirect_uri_spec.rb
294
296
  - spec/models/manual_trade_and_impact_spec.rb
@@ -464,6 +466,7 @@ test_files:
464
466
  - spec/models/model500_unexpected_exception_response_spec.rb
465
467
  - spec/models/brokerage_authorization_type_read_only_type_spec.rb
466
468
  - spec/models/manual_trade_symbol_spec.rb
469
+ - spec/models/holdings_status_spec.rb
467
470
  - spec/models/position_spec.rb
468
471
  - spec/models/notional_value_spec.rb
469
472
  - spec/models/trade_action_spec.rb