snaptrade 2.0.51 → 2.0.53

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: 25060249e8a32cb8f3e96e385a11a8fc57cee85c281e2b02ece2e17a5d929086
4
- data.tar.gz: bdcee308e27ccbf995aa2dcc14c129e555394a03b6b01e0896ce2d0483b0cb2f
3
+ metadata.gz: 5f2b6f28443318f6630cb47b889f4f213f5a3ed250554ba76cd8d498dc62ebf0
4
+ data.tar.gz: 3494ecf4f0414d8d21608cf68a6842f8f6030ff6f99ab4c7e71f4bc37013812c
5
5
  SHA512:
6
- metadata.gz: e380e7834b5d087216034ee1b44733b8b096b46a3f14435346aae2129b7ace1a52d2c00d32e4d09174925d82f0b530162918047de8eb4302d022a34d53fd9a6c
7
- data.tar.gz: 660cab97610bff7ab1c771dda10a1e27392ce31b998e12c65f145f7c1422068be09ebf8827baf268eba0e00adeb8e995f8f990e055bb739e5e91c1f3b365b6f8
6
+ metadata.gz: 4d79fcbf6f8a981fe2919af40b67424665d34a7862f90bcc57cce8a89dc36ee4346e2e46e4f40f90db04ea24f947d7c09d5085446421b7a8a3af21569c7bf9aa
7
+ data.tar.gz: f0a03abe0fc85fb4e3a37cea04efa5f8d9c634d8b135f185adaf33e3d49a39688aa322276ece7a24a1dec7d91b8d700254653414938268f23e09954119a2f159
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.51)
4
+ snaptrade (2.0.53)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -29,7 +29,7 @@ GEM
29
29
  method_source (1.1.0)
30
30
  multipart-post (2.4.1)
31
31
  parallel (1.26.3)
32
- parser (3.3.5.0)
32
+ parser (3.3.6.0)
33
33
  ast (~> 2.4.1)
34
34
  racc
35
35
  pry (0.14.2)
@@ -67,7 +67,7 @@ GEM
67
67
  rubocop-ast (>= 1.2.0, < 2.0)
68
68
  ruby-progressbar (~> 1.7)
69
69
  unicode-display_width (>= 1.4.0, < 3.0)
70
- rubocop-ast (1.33.0)
70
+ rubocop-ast (1.34.1)
71
71
  parser (>= 3.3.1.0)
72
72
  ruby-progressbar (1.13.0)
73
73
  ruby2_keywords (0.0.5)
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.51-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.51)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.53-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.53)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
70
70
  Add to Gemfile:
71
71
 
72
72
  ```ruby
73
- gem 'snaptrade', '~> 2.0.51'
73
+ gem 'snaptrade', '~> 2.0.53'
74
74
  ```
75
75
 
76
76
  ## Getting Started<a id="getting-started"></a>
@@ -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
+ # Example for failed request response
15
+ class Model425FailedRequestResponse
16
+ attr_accessor :detail
17
+
18
+ attr_accessor :code
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'detail' => :'detail',
24
+ :'code' => :'code'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'detail' => :'Object',
37
+ :'code' => :'Object'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ :'detail',
45
+ :'code'
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::Model425FailedRequestResponse` 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::Model425FailedRequestResponse`. 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?(:'detail')
65
+ self.detail = attributes[:'detail']
66
+ end
67
+
68
+ if attributes.key?(:'code')
69
+ self.code = attributes[:'code']
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
+ detail == o.detail &&
92
+ code == o.code
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
+ [detail, code].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
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # The total market value of the account. Note that this field is calculated based on the sum of the values of account positions and cash balances known to SnapTrade. It may not be accurate if the brokerage account has holdings that SnapTrade is not aware of. For example, if the brokerage account holds assets that SnapTrade does not support, the total value may be underreported. To get the brokerage reported total market value of the account, refer to `account.balance.total`.
14
+ # This field is deprecated. To get the brokerage reported total market value of the account, please refer to `account.balance.total`. The total market value of the account. Note that this field is calculated based on the sum of the values of account positions and cash balances known to SnapTrade. It may not be accurate if the brokerage account has holdings that SnapTrade is not aware of. For example, if the brokerage account holds assets that SnapTrade does not support, the total value may be underreported. In certain cases, this value may also be double-counting cash-equivalent assets if those assets are represented as both cash and positions in the account.
15
15
  class SnapTradeHoldingsTotalValue
16
16
  # Total value denominated in the currency of the `currency` field.
17
17
  attr_accessor :value
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.51'
11
+ VERSION = '2.0.53'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -68,6 +68,7 @@ require 'snaptrade/models/model402_brokerage_auth_disabled_response'
68
68
  require 'snaptrade/models/model403_failed_request_response'
69
69
  require 'snaptrade/models/model403_feature_not_enabled_response'
70
70
  require 'snaptrade/models/model404_failed_request_response'
71
+ require 'snaptrade/models/model425_failed_request_response'
71
72
  require 'snaptrade/models/model500_unexpected_exception_response'
72
73
  require 'snaptrade/models/monthly_dividends'
73
74
  require 'snaptrade/models/net_contributions'
@@ -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::Model425FailedRequestResponse
15
+ describe SnapTrade::Model425FailedRequestResponse do
16
+ let(:instance) { SnapTrade::Model425FailedRequestResponse.new }
17
+
18
+ describe 'test an instance of Model425FailedRequestResponse' do
19
+ it 'should create an instance of Model425FailedRequestResponse' do
20
+ expect(instance).to be_instance_of(SnapTrade::Model425FailedRequestResponse)
21
+ end
22
+ end
23
+ describe 'test attribute "detail"' 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
+ 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.51
4
+ version: 2.0.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-30 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -147,6 +147,7 @@ files:
147
147
  - lib/snaptrade/models/model403_failed_request_response.rb
148
148
  - lib/snaptrade/models/model403_feature_not_enabled_response.rb
149
149
  - lib/snaptrade/models/model404_failed_request_response.rb
150
+ - lib/snaptrade/models/model425_failed_request_response.rb
150
151
  - lib/snaptrade/models/model500_unexpected_exception_response.rb
151
152
  - lib/snaptrade/models/monthly_dividends.rb
152
153
  - lib/snaptrade/models/net_contributions.rb
@@ -272,6 +273,7 @@ files:
272
273
  - spec/models/model403_failed_request_response_spec.rb
273
274
  - spec/models/model403_feature_not_enabled_response_spec.rb
274
275
  - spec/models/model404_failed_request_response_spec.rb
276
+ - spec/models/model425_failed_request_response_spec.rb
275
277
  - spec/models/model500_unexpected_exception_response_spec.rb
276
278
  - spec/models/monthly_dividends_spec.rb
277
279
  - spec/models/net_contributions_spec.rb
@@ -402,6 +404,7 @@ test_files:
402
404
  - spec/models/model403_failed_request_response_spec.rb
403
405
  - spec/models/type_spec.rb
404
406
  - spec/models/account_order_record_status_spec.rb
407
+ - spec/models/model425_failed_request_response_spec.rb
405
408
  - spec/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner_spec.rb
406
409
  - spec/models/model404_failed_request_response_spec.rb
407
410
  - spec/models/option_leg_action_spec.rb