snaptrade 3.0.49 → 3.0.51

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cf1c5cd9720d2998c3ef566646cb84d0fc6ee27083a23228b8cf683c0fa71b1
4
- data.tar.gz: 82c22150600ca354d7f316ff1507385770cfe39a02a3900fb5c10089d6ba4f53
3
+ metadata.gz: 69565bf47e77e4f8b29e3a3839cc5a3d3f2d7f19a43a7d6cc0f52c74e4bb7a1f
4
+ data.tar.gz: e91336425c43d4095a111209c986e6134889b5101c890c3670215625a1133eb8
5
5
  SHA512:
6
- metadata.gz: 3c70ac43ef7c59fa7534e8e16f759c7188040627ab6a3bc8deca4561719f0bd622583b09ff9267801a59f62218bc81c1d77a1f74b0f5a8d8731121cabc4e951b
7
- data.tar.gz: 466ba74a671c09acb991741cb43f7828c4c0b26924a2b11aaaf41cd47a7804a635655490b0f1e998d9e659c0f3b25345d2cbfb12201dfe72559c2e8f021cb5b5
6
+ metadata.gz: 7c6b34f06b8a89607c91f6e97ed957e15398fdf5c813a4b536f79356e61d8045f7c4858036b3bf421897b9ab3c304b02b6b2311ca144c60d777eb5ef9f45d32f
7
+ data.tar.gz: 7dfdff31d74540aa166e1f3a39933be85a4f523904bf58176ce252428c54b9e1bec0d5dccfad79e076f096464c2a43abf879be0bc442f0b47e1d6f9ce2e87fc4
data/README.md CHANGED
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
63
63
  See https://docs.snaptrade.com/docs/ratelimiting.
64
64
 
65
65
 
66
- [![npm](https://img.shields.io/badge/gem-v3.0.49-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.49)
66
+ [![npm](https://img.shields.io/badge/gem-v3.0.51-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.51)
67
67
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
68
68
 
69
69
  </div>
@@ -147,7 +147,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
147
147
  Add to Gemfile:
148
148
 
149
149
  ```ruby
150
- gem 'snaptrade', '~> 3.0.49'
150
+ gem 'snaptrade', '~> 3.0.51'
151
151
  ```
152
152
 
153
153
  ## Getting Started<a id="getting-started"></a>
@@ -22,6 +22,9 @@ module SnapTrade
22
22
  # Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
23
23
  attr_accessor :connection_id
24
24
 
25
+ # The current status of the account. Omitted when the status is unknown or not provided by the institution. - `open`: The account is open. - `closed`: The account is closed. - `archived`: The account is archived. - `unavailable`: The account is no longer available through the institution's API. Accounts with this status are excluded from account list responses.
26
+ attr_accessor :status
27
+
25
28
  # A display name for the account. Either assigned by the user or by the institution itself.
26
29
  attr_accessor :display_name
27
30
 
@@ -50,6 +53,7 @@ module SnapTrade
50
53
  :'kind' => :'kind',
51
54
  :'id' => :'id',
52
55
  :'connection_id' => :'connection_id',
56
+ :'status' => :'status',
53
57
  :'display_name' => :'display_name',
54
58
  :'masked_account_number' => :'masked_account_number',
55
59
  :'institution_account_id' => :'institution_account_id',
@@ -72,6 +76,7 @@ module SnapTrade
72
76
  :'kind' => :'AnnuityAccountKind',
73
77
  :'id' => :'String',
74
78
  :'connection_id' => :'String',
79
+ :'status' => :'ConnectionAccountStatus',
75
80
  :'display_name' => :'String',
76
81
  :'masked_account_number' => :'String',
77
82
  :'institution_account_id' => :'String',
@@ -121,6 +126,10 @@ module SnapTrade
121
126
  self.connection_id = attributes[:'connection_id']
122
127
  end
123
128
 
129
+ if attributes.key?(:'status')
130
+ self.status = attributes[:'status']
131
+ end
132
+
124
133
  if attributes.key?(:'display_name')
125
134
  self.display_name = attributes[:'display_name']
126
135
  end
@@ -200,6 +209,7 @@ module SnapTrade
200
209
  kind == o.kind &&
201
210
  id == o.id &&
202
211
  connection_id == o.connection_id &&
212
+ status == o.status &&
203
213
  display_name == o.display_name &&
204
214
  masked_account_number == o.masked_account_number &&
205
215
  institution_account_id == o.institution_account_id &&
@@ -219,7 +229,7 @@ module SnapTrade
219
229
  # Calculates hash code according to all attributes.
220
230
  # @return [Integer] Hash code
221
231
  def hash
222
- [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
232
+ [kind, id, connection_id, status, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
223
233
  end
224
234
 
225
235
  # Builds the object from hash
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
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
+ # A currency traded as the instrument itself, such as the currency bought or sold by a forex order. Quantities on the leg are amounts of this currency; the order's `price_currency` is the currency it was priced in.
15
+ class CashInstrument
16
+ # Type of security instrument.
17
+ attr_accessor :kind
18
+
19
+ # ISO-4217 code of the currency.
20
+ attr_accessor :code
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'kind' => :'kind',
26
+ :'code' => :'code'
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
+ :'kind' => :'CashInstrumentKind',
39
+ :'code' => :'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::CashInstrument` 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::CashInstrument`. 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?(:'kind')
65
+ self.kind = attributes[:'kind']
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
+ if @kind.nil?
78
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
79
+ end
80
+
81
+ if @code.nil?
82
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @kind.nil?
92
+ return false if @code.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ kind == o.kind &&
102
+ code == o.code
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [kind, code].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = SnapTrade.const_get(type)
186
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
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 CashInstrumentKind
15
+ CASH = "cash".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [CASH].freeze
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ return value if CashInstrumentKind.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #CashInstrumentKind"
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,39 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
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 ConnectionAccountStatus
15
+ OPEN = "open".freeze
16
+ CLOSED = "closed".freeze
17
+ ARCHIVED = "archived".freeze
18
+ UNAVAILABLE = "unavailable".freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [OPEN, CLOSED, ARCHIVED, UNAVAILABLE].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if ConnectionAccountStatus.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #ConnectionAccountStatus"
37
+ end
38
+ end
39
+ end
@@ -22,6 +22,9 @@ module SnapTrade
22
22
  # Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
23
23
  attr_accessor :connection_id
24
24
 
25
+ # The current status of the account. Omitted when the status is unknown or not provided by the institution. - `open`: The account is open. - `closed`: The account is closed. - `archived`: The account is archived. - `unavailable`: The account is no longer available through the institution's API. Accounts with this status are excluded from account list responses.
26
+ attr_accessor :status
27
+
25
28
  # A display name for the account. Either assigned by the user or by the institution itself.
26
29
  attr_accessor :display_name
27
30
 
@@ -50,6 +53,7 @@ module SnapTrade
50
53
  :'kind' => :'kind',
51
54
  :'id' => :'id',
52
55
  :'connection_id' => :'connection_id',
56
+ :'status' => :'status',
53
57
  :'display_name' => :'display_name',
54
58
  :'masked_account_number' => :'masked_account_number',
55
59
  :'institution_account_id' => :'institution_account_id',
@@ -72,6 +76,7 @@ module SnapTrade
72
76
  :'kind' => :'DepositAccountKind',
73
77
  :'id' => :'String',
74
78
  :'connection_id' => :'String',
79
+ :'status' => :'ConnectionAccountStatus',
75
80
  :'display_name' => :'String',
76
81
  :'masked_account_number' => :'String',
77
82
  :'institution_account_id' => :'String',
@@ -121,6 +126,10 @@ module SnapTrade
121
126
  self.connection_id = attributes[:'connection_id']
122
127
  end
123
128
 
129
+ if attributes.key?(:'status')
130
+ self.status = attributes[:'status']
131
+ end
132
+
124
133
  if attributes.key?(:'display_name')
125
134
  self.display_name = attributes[:'display_name']
126
135
  end
@@ -200,6 +209,7 @@ module SnapTrade
200
209
  kind == o.kind &&
201
210
  id == o.id &&
202
211
  connection_id == o.connection_id &&
212
+ status == o.status &&
203
213
  display_name == o.display_name &&
204
214
  masked_account_number == o.masked_account_number &&
205
215
  institution_account_id == o.institution_account_id &&
@@ -219,7 +229,7 @@ module SnapTrade
219
229
  # Calculates hash code according to all attributes.
220
230
  # @return [Integer] Hash code
221
231
  def hash
222
- [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
232
+ [kind, id, connection_id, status, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
223
233
  end
224
234
 
225
235
  # Builds the object from hash
@@ -18,6 +18,7 @@ module SnapTrade
18
18
  def openapi_one_of
19
19
  [
20
20
  :'AdrInstrument',
21
+ :'CashInstrument',
21
22
  :'CefInstrument',
22
23
  :'CfdInstrument',
23
24
  :'CryptoInstrument',
@@ -42,6 +43,7 @@ module SnapTrade
42
43
  {
43
44
  :'adr' => :'AdrInstrument',
44
45
  :'bond' => :'OtherInstrument',
46
+ :'cash' => :'CashInstrument',
45
47
  :'cef' => :'CefInstrument',
46
48
  :'cfd' => :'CfdInstrument',
47
49
  :'crypto' => :'CryptoInstrument',
@@ -22,6 +22,9 @@ module SnapTrade
22
22
  # Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
23
23
  attr_accessor :connection_id
24
24
 
25
+ # The current status of the account. Omitted when the status is unknown or not provided by the institution. - `open`: The account is open. - `closed`: The account is closed. - `archived`: The account is archived. - `unavailable`: The account is no longer available through the institution's API. Accounts with this status are excluded from account list responses.
26
+ attr_accessor :status
27
+
25
28
  # A display name for the account. Either assigned by the user or by the institution itself.
26
29
  attr_accessor :display_name
27
30
 
@@ -59,6 +62,7 @@ module SnapTrade
59
62
  :'kind' => :'kind',
60
63
  :'id' => :'id',
61
64
  :'connection_id' => :'connection_id',
65
+ :'status' => :'status',
62
66
  :'display_name' => :'display_name',
63
67
  :'masked_account_number' => :'masked_account_number',
64
68
  :'institution_account_id' => :'institution_account_id',
@@ -84,6 +88,7 @@ module SnapTrade
84
88
  :'kind' => :'Kind',
85
89
  :'id' => :'String',
86
90
  :'connection_id' => :'String',
91
+ :'status' => :'ConnectionAccountStatus',
87
92
  :'display_name' => :'String',
88
93
  :'masked_account_number' => :'String',
89
94
  :'institution_account_id' => :'String',
@@ -137,6 +142,10 @@ module SnapTrade
137
142
  self.connection_id = attributes[:'connection_id']
138
143
  end
139
144
 
145
+ if attributes.key?(:'status')
146
+ self.status = attributes[:'status']
147
+ end
148
+
140
149
  if attributes.key?(:'display_name')
141
150
  self.display_name = attributes[:'display_name']
142
151
  end
@@ -233,6 +242,7 @@ module SnapTrade
233
242
  kind == o.kind &&
234
243
  id == o.id &&
235
244
  connection_id == o.connection_id &&
245
+ status == o.status &&
236
246
  display_name == o.display_name &&
237
247
  masked_account_number == o.masked_account_number &&
238
248
  institution_account_id == o.institution_account_id &&
@@ -255,7 +265,7 @@ module SnapTrade
255
265
  # Calculates hash code according to all attributes.
256
266
  # @return [Integer] Hash code
257
267
  def hash
258
- [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, funding_date, sync_status, raw_type, cash_or_margin, is_paper, net_value].hash
268
+ [kind, id, connection_id, status, display_name, masked_account_number, institution_account_id, institution_id, opening_date, funding_date, sync_status, raw_type, cash_or_margin, is_paper, net_value].hash
259
269
  end
260
270
 
261
271
  # Builds the object from hash
@@ -22,6 +22,9 @@ module SnapTrade
22
22
  # Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
23
23
  attr_accessor :connection_id
24
24
 
25
+ # The current status of the account. Omitted when the status is unknown or not provided by the institution. - `open`: The account is open. - `closed`: The account is closed. - `archived`: The account is archived. - `unavailable`: The account is no longer available through the institution's API. Accounts with this status are excluded from account list responses.
26
+ attr_accessor :status
27
+
25
28
  # A display name for the account. Either assigned by the user or by the institution itself.
26
29
  attr_accessor :display_name
27
30
 
@@ -57,6 +60,7 @@ module SnapTrade
57
60
  :'kind' => :'kind',
58
61
  :'id' => :'id',
59
62
  :'connection_id' => :'connection_id',
63
+ :'status' => :'status',
60
64
  :'display_name' => :'display_name',
61
65
  :'masked_account_number' => :'masked_account_number',
62
66
  :'institution_account_id' => :'institution_account_id',
@@ -82,6 +86,7 @@ module SnapTrade
82
86
  :'kind' => :'LineOfCreditAccountKind',
83
87
  :'id' => :'String',
84
88
  :'connection_id' => :'String',
89
+ :'status' => :'ConnectionAccountStatus',
85
90
  :'display_name' => :'String',
86
91
  :'masked_account_number' => :'String',
87
92
  :'institution_account_id' => :'String',
@@ -137,6 +142,10 @@ module SnapTrade
137
142
  self.connection_id = attributes[:'connection_id']
138
143
  end
139
144
 
145
+ if attributes.key?(:'status')
146
+ self.status = attributes[:'status']
147
+ end
148
+
140
149
  if attributes.key?(:'display_name')
141
150
  self.display_name = attributes[:'display_name']
142
151
  end
@@ -228,6 +237,7 @@ module SnapTrade
228
237
  kind == o.kind &&
229
238
  id == o.id &&
230
239
  connection_id == o.connection_id &&
240
+ status == o.status &&
231
241
  display_name == o.display_name &&
232
242
  masked_account_number == o.masked_account_number &&
233
243
  institution_account_id == o.institution_account_id &&
@@ -250,7 +260,7 @@ module SnapTrade
250
260
  # Calculates hash code according to all attributes.
251
261
  # @return [Integer] Hash code
252
262
  def hash
253
- [kind, id, connection_id, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value, minimum_payment_amount, available_credit, next_payment_date].hash
263
+ [kind, id, connection_id, status, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value, minimum_payment_amount, available_credit, next_payment_date].hash
254
264
  end
255
265
 
256
266
  # Builds the object from hash
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '3.0.49'
11
+ VERSION = '3.0.51'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -94,6 +94,8 @@ require 'snaptrade/models/brokerage_instruments_response'
94
94
  require 'snaptrade/models/brokerage_type'
95
95
  require 'snaptrade/models/cancel_order_response'
96
96
  require 'snaptrade/models/cash_change_direction'
97
+ require 'snaptrade/models/cash_instrument'
98
+ require 'snaptrade/models/cash_instrument_kind'
97
99
  require 'snaptrade/models/cash_or_margin'
98
100
  require 'snaptrade/models/cef_instrument'
99
101
  require 'snaptrade/models/cef_instrument_kind'
@@ -106,6 +108,7 @@ require 'snaptrade/models/complex_order_response'
106
108
  require 'snaptrade/models/complex_order_response_type'
107
109
  require 'snaptrade/models/connected_asset_partner_stats'
108
110
  require 'snaptrade/models/connection_account'
111
+ require 'snaptrade/models/connection_account_status'
109
112
  require 'snaptrade/models/connection_account_sync_status'
110
113
  require 'snaptrade/models/connection_accounts_response'
111
114
  require 'snaptrade/models/connection_portal_version'
@@ -38,6 +38,12 @@ describe SnapTrade::AnnuityAccount do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "status"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
41
47
  describe 'test attribute "display_name"' do
42
48
  it 'should work' do
43
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,23 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
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::CashInstrumentKind
15
+ describe SnapTrade::CashInstrumentKind do
16
+ let(:instance) { SnapTrade::CashInstrumentKind.new }
17
+
18
+ describe 'test an instance of CashInstrumentKind' do
19
+ it 'should create an instance of CashInstrumentKind' do
20
+ expect(instance).to be_instance_of(SnapTrade::CashInstrumentKind)
21
+ end
22
+ end
23
+ end