snaptrade 2.0.50 → 2.0.52

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: 1ff6c1a7698aa9d2a38ecf15145b5a353d4487bb1a93f2fbf417cce7156736c9
4
- data.tar.gz: b1fa817078cf578d2f0c8b32115417a1c87fab22da9d1cc63d6207743a8ef445
3
+ metadata.gz: 29212830cd3f2c0673695b88e228218c24628151e628e2f9f1e8ff4f252b61df
4
+ data.tar.gz: 75161d36c61f0d7313cbdae405dd2d507a77007f95d5e738652c42b44b2def3f
5
5
  SHA512:
6
- metadata.gz: 045c5ebf77f76b5db69fed2ea16965f4d041df50c532e7254897d6273f31bcc1bf4d209adee9151b24f79e9bac3346eea50d88df2e7a93bf97ad9efed020472c
7
- data.tar.gz: 366092be6800bec45b8f58da67f330ad872c6be44fa1c8f05e2e12add9d526bbe9ec41fa9cc5a9b43063998033fa1c78bf8e1bc18524113f88c1e2c3e08f84bc
6
+ metadata.gz: c98c37ab4a7a31ddb8bd8b9da1ad7bac6672261e504cdbf5b4fefd5ba689fe28695fe81d56cb9a244fab3d3d7bafe1692bb9fb7efa116ad328d493c40cf4dd77
7
+ data.tar.gz: 6758dcdfb42b78ac299f6a61417d138dd887c89c1534fb845172315e1cf79165eb28c9ba99d6e45e1ae67feffbddd2eb6ec44768d2188a2942ac69016483badf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.50)
4
+ snaptrade (2.0.52)
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.32.3)
70
+ rubocop-ast (1.34.0)
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.50-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.50)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.52-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.52)
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.50'
73
+ gem 'snaptrade', '~> 2.0.52'
74
74
  ```
75
75
 
76
76
  ## Getting Started<a id="getting-started"></a>
@@ -499,7 +499,7 @@ result = snaptrade.authentication.login_snap_trade_user(
499
499
  custom_redirect: "https://snaptrade.com",
500
500
  reconnect: "8b5f262d-4bb9-365d-888a-202bd3b15fa1",
501
501
  connection_type: "read",
502
- connection_portal_version: "v3",
502
+ connection_portal_version: "v4",
503
503
  )
504
504
  p result
505
505
  ```
@@ -535,7 +535,9 @@ Sets whether the connection should be read-only or trade-enabled. Defaults to
535
535
  read-only if not specified.
536
536
 
537
537
  ##### connectionPortalVersion: [`ConnectionPortalVersion`](./lib/snaptrade/models/connection_portal_version.rb)<a id="connectionportalversion-connectionportalversionlibsnaptrademodelsconnection_portal_versionrb"></a>
538
- Sets the version of the connection portal to render.
538
+ Sets the connection portal version to render. Currently only v4 is supported and
539
+ is the default. All other versions are deprecated and will automatically be set
540
+ to v4.
539
541
 
540
542
  #### 🔄 Return<a id="🔄-return"></a>
541
543
 
@@ -193,10 +193,10 @@ module SnapTrade
193
193
  # @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
194
194
  # @param reconnect [String] The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
195
195
  # @param connection_type [ConnectionType] Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
196
- # @param connection_portal_version [ConnectionPortalVersion] Sets the version of the connection portal to render.
196
+ # @param connection_portal_version [ConnectionPortalVersion] Sets the connection portal version to render. Currently only v4 is supported and is the default. All other versions are deprecated and will automatically be set to v4.
197
197
  # @param body [SnapTradeLoginUserRequestBody]
198
198
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
199
- def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v3', extra: {})
199
+ def login_snap_trade_user(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})
200
200
  _body = {}
201
201
  _body[:broker] = broker if broker != SENTINEL
202
202
  _body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
@@ -222,10 +222,10 @@ module SnapTrade
222
222
  # @param custom_redirect [String] URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the [guide on ways to integrate the connection portal](/docs/implement-connection-portal) for more information.
223
223
  # @param reconnect [String] The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the [guide on fixing broken connections](/docs/fix-broken-connections) for more information.
224
224
  # @param connection_type [ConnectionType] Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
225
- # @param connection_portal_version [ConnectionPortalVersion] Sets the version of the connection portal to render.
225
+ # @param connection_portal_version [ConnectionPortalVersion] Sets the connection portal version to render. Currently only v4 is supported and is the default. All other versions are deprecated and will automatically be set to v4.
226
226
  # @param body [SnapTradeLoginUserRequestBody]
227
227
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
228
- def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v3', extra: {})
228
+ def login_snap_trade_user_with_http_info(user_id:, user_secret:, broker: SENTINEL, immediate_redirect: SENTINEL, custom_redirect: SENTINEL, reconnect: SENTINEL, connection_type: 'read', connection_portal_version: 'v4', extra: {})
229
229
  _body = {}
230
230
  _body[:broker] = broker if broker != SENTINEL
231
231
  _body[:immediateRedirect] = immediate_redirect if immediate_redirect != SENTINEL
@@ -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
@@ -28,7 +28,7 @@ module SnapTrade
28
28
  # Sets whether the connection should be read-only or trade-enabled. Defaults to read-only if not specified.
29
29
  attr_accessor :connection_type
30
30
 
31
- # Sets the version of the connection portal to render.
31
+ # Sets the connection portal version to render. Currently only v4 is supported and is the default. All other versions are deprecated and will automatically be set to v4.
32
32
  attr_accessor :connection_portal_version
33
33
 
34
34
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -106,7 +106,7 @@ module SnapTrade
106
106
  if attributes.key?(:'connection_portal_version')
107
107
  self.connection_portal_version = attributes[:'connection_portal_version']
108
108
  else
109
- self.connection_portal_version = 'v3'
109
+ self.connection_portal_version = 'v4'
110
110
  end
111
111
  end
112
112
 
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.50'
11
+ VERSION = '2.0.52'
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.50
4
+ version: 2.0.52
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-29 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