snaptrade 2.0.37 → 2.0.39

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +115 -77
  4. data/lib/snaptrade/api/account_information_api.rb +4 -4
  5. data/lib/snaptrade/api/authentication_api.rb +4 -4
  6. data/lib/snaptrade/api/connections_api.rb +70 -52
  7. data/lib/snaptrade/api/options_api.rb +4 -4
  8. data/lib/snaptrade/api/trading_api.rb +106 -106
  9. data/lib/snaptrade/models/account.rb +2 -2
  10. data/lib/snaptrade/models/brokerage.rb +25 -40
  11. data/lib/snaptrade/models/brokerage_authorization.rb +12 -8
  12. data/lib/snaptrade/models/brokerage_authorization_disabled_confirmation.rb +1 -0
  13. data/lib/snaptrade/models/brokerage_authorization_refresh_confirmation.rb +1 -0
  14. data/lib/snaptrade/models/brokerage_type.rb +1 -1
  15. data/lib/snaptrade/models/manual_trade.rb +7 -5
  16. data/lib/snaptrade/models/manual_trade_and_impact.rb +2 -2
  17. data/lib/snaptrade/models/manual_trade_balance.rb +3 -3
  18. data/lib/snaptrade/models/manual_trade_form.rb +52 -25
  19. data/lib/snaptrade/models/manual_trade_impact.rb +260 -0
  20. data/lib/snaptrade/models/manual_trade_symbol.rb +6 -1
  21. data/lib/snaptrade/models/notional_value.rb +1 -1
  22. data/lib/snaptrade/models/options_place_option_strategy_request.rb +2 -2
  23. data/lib/snaptrade/models/symbols_quotes_inner.rb +15 -10
  24. data/lib/snaptrade/models/trading_cancel_user_account_order_request.rb +1 -0
  25. data/lib/snaptrade/models/validated_trade_body.rb +1 -2
  26. data/lib/snaptrade/version.rb +1 -1
  27. data/lib/snaptrade.rb +1 -0
  28. data/spec/api/account_information_api_spec.rb +1 -1
  29. data/spec/api/authentication_api_spec.rb +1 -1
  30. data/spec/api/connections_api_spec.rb +13 -13
  31. data/spec/api/trading_api_spec.rb +15 -15
  32. data/spec/models/brokerage_spec.rb +6 -24
  33. data/spec/models/manual_trade_form_spec.rb +6 -6
  34. data/spec/models/manual_trade_impact_spec.rb +53 -0
  35. data/spec/models/symbols_quotes_inner_spec.rb +3 -3
  36. metadata +5 -2
@@ -11,62 +11,69 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
+ # Describes a brokerage that SnapTrade supports.
14
15
  class Brokerage
16
+ # Unique identifier for the brokerage firm. This is the UUID used to reference the brokerage in SnapTrade.
15
17
  attr_accessor :id
16
18
 
19
+ # A short, unique identifier for the brokerage. It is usually the name of the brokerage in capital letters and will never change.
20
+ attr_accessor :slug
21
+
17
22
  # Full name of the brokerage.
18
23
  attr_accessor :name
19
24
 
20
25
  # A display-friendly name of the brokerage.
21
26
  attr_accessor :display_name
22
27
 
28
+ # A brief description of the brokerage.
23
29
  attr_accessor :description
24
30
 
31
+ # URL to the brokerage's logo.
25
32
  attr_accessor :aws_s3_logo_url
26
33
 
34
+ # URL to the brokerage's logo in square format.
27
35
  attr_accessor :aws_s3_square_logo_url
28
36
 
37
+ # This field is deprecated.
29
38
  attr_accessor :open_url
30
39
 
31
- # A unique identifier for that brokerage. It is usually the name of the brokerage in capital letters and will never change.
32
- attr_accessor :slug
33
-
40
+ # URL to the brokerage's website.
34
41
  attr_accessor :url
35
42
 
43
+ # Whether the brokerage is enabled in SnapTrade. A disabled brokerage will not be available for new connections.
36
44
  attr_accessor :enabled
37
45
 
46
+ # Whether the brokerage is currently in maintenance mode. A brokerage in maintenance mode will not be available for new connections.
38
47
  attr_accessor :maintenance_mode
39
48
 
49
+ # This field is deprecated. Please contact us if you have a valid use case for it.
40
50
  attr_accessor :allows_fractional_units
41
51
 
52
+ # Whether the brokerage allows trading through SnapTrade.
42
53
  attr_accessor :allows_trading
43
54
 
55
+ # This field is deprecated. Please contact us if you have a valid use case for it.
44
56
  attr_accessor :has_reporting
45
57
 
58
+ # This field is deprecated. Please contact us if you have a valid use case for it.
46
59
  attr_accessor :is_real_time_connection
47
60
 
48
- attr_accessor :allows_trading_through_snaptrade_api
49
-
50
- attr_accessor :is_scraping_integration
51
-
52
- attr_accessor :default_currency
53
-
54
61
  attr_accessor :brokerage_type
55
62
 
56
- # List of exchange ID supported by brokerage
63
+ # This field is deprecated. Please contact us if you have a valid use case for it.
57
64
  attr_accessor :exchanges
58
65
 
59
66
  # Attribute mapping from ruby-style variable name to JSON key.
60
67
  def self.attribute_map
61
68
  {
62
69
  :'id' => :'id',
70
+ :'slug' => :'slug',
63
71
  :'name' => :'name',
64
72
  :'display_name' => :'display_name',
65
73
  :'description' => :'description',
66
74
  :'aws_s3_logo_url' => :'aws_s3_logo_url',
67
75
  :'aws_s3_square_logo_url' => :'aws_s3_square_logo_url',
68
76
  :'open_url' => :'open_url',
69
- :'slug' => :'slug',
70
77
  :'url' => :'url',
71
78
  :'enabled' => :'enabled',
72
79
  :'maintenance_mode' => :'maintenance_mode',
@@ -74,9 +81,6 @@ module SnapTrade
74
81
  :'allows_trading' => :'allows_trading',
75
82
  :'has_reporting' => :'has_reporting',
76
83
  :'is_real_time_connection' => :'is_real_time_connection',
77
- :'allows_trading_through_snaptrade_api' => :'allows_trading_through_snaptrade_api',
78
- :'is_scraping_integration' => :'is_scraping_integration',
79
- :'default_currency' => :'default_currency',
80
84
  :'brokerage_type' => :'brokerage_type',
81
85
  :'exchanges' => :'exchanges'
82
86
  }
@@ -91,13 +95,13 @@ module SnapTrade
91
95
  def self.openapi_types
92
96
  {
93
97
  :'id' => :'String',
98
+ :'slug' => :'String',
94
99
  :'name' => :'String',
95
100
  :'display_name' => :'String',
96
101
  :'description' => :'String',
97
102
  :'aws_s3_logo_url' => :'String',
98
103
  :'aws_s3_square_logo_url' => :'String',
99
104
  :'open_url' => :'String',
100
- :'slug' => :'String',
101
105
  :'url' => :'String',
102
106
  :'enabled' => :'Boolean',
103
107
  :'maintenance_mode' => :'Boolean',
@@ -105,9 +109,6 @@ module SnapTrade
105
109
  :'allows_trading' => :'Boolean',
106
110
  :'has_reporting' => :'Boolean',
107
111
  :'is_real_time_connection' => :'Boolean',
108
- :'allows_trading_through_snaptrade_api' => :'Boolean',
109
- :'is_scraping_integration' => :'Boolean',
110
- :'default_currency' => :'String',
111
112
  :'brokerage_type' => :'BrokerageType',
112
113
  :'exchanges' => :'Array<Object>'
113
114
  }
@@ -121,7 +122,6 @@ module SnapTrade
121
122
  :'allows_fractional_units',
122
123
  :'allows_trading',
123
124
  :'has_reporting',
124
- :'allows_trading_through_snaptrade_api',
125
125
  ])
126
126
  end
127
127
 
@@ -144,6 +144,10 @@ module SnapTrade
144
144
  self.id = attributes[:'id']
145
145
  end
146
146
 
147
+ if attributes.key?(:'slug')
148
+ self.slug = attributes[:'slug']
149
+ end
150
+
147
151
  if attributes.key?(:'name')
148
152
  self.name = attributes[:'name']
149
153
  end
@@ -168,10 +172,6 @@ module SnapTrade
168
172
  self.open_url = attributes[:'open_url']
169
173
  end
170
174
 
171
- if attributes.key?(:'slug')
172
- self.slug = attributes[:'slug']
173
- end
174
-
175
175
  if attributes.key?(:'url')
176
176
  self.url = attributes[:'url']
177
177
  end
@@ -200,18 +200,6 @@ module SnapTrade
200
200
  self.is_real_time_connection = attributes[:'is_real_time_connection']
201
201
  end
202
202
 
203
- if attributes.key?(:'allows_trading_through_snaptrade_api')
204
- self.allows_trading_through_snaptrade_api = attributes[:'allows_trading_through_snaptrade_api']
205
- end
206
-
207
- if attributes.key?(:'is_scraping_integration')
208
- self.is_scraping_integration = attributes[:'is_scraping_integration']
209
- end
210
-
211
- if attributes.key?(:'default_currency')
212
- self.default_currency = attributes[:'default_currency']
213
- end
214
-
215
203
  if attributes.key?(:'brokerage_type')
216
204
  self.brokerage_type = attributes[:'brokerage_type']
217
205
  end
@@ -242,13 +230,13 @@ module SnapTrade
242
230
  return true if self.equal?(o)
243
231
  self.class == o.class &&
244
232
  id == o.id &&
233
+ slug == o.slug &&
245
234
  name == o.name &&
246
235
  display_name == o.display_name &&
247
236
  description == o.description &&
248
237
  aws_s3_logo_url == o.aws_s3_logo_url &&
249
238
  aws_s3_square_logo_url == o.aws_s3_square_logo_url &&
250
239
  open_url == o.open_url &&
251
- slug == o.slug &&
252
240
  url == o.url &&
253
241
  enabled == o.enabled &&
254
242
  maintenance_mode == o.maintenance_mode &&
@@ -256,9 +244,6 @@ module SnapTrade
256
244
  allows_trading == o.allows_trading &&
257
245
  has_reporting == o.has_reporting &&
258
246
  is_real_time_connection == o.is_real_time_connection &&
259
- allows_trading_through_snaptrade_api == o.allows_trading_through_snaptrade_api &&
260
- is_scraping_integration == o.is_scraping_integration &&
261
- default_currency == o.default_currency &&
262
247
  brokerage_type == o.brokerage_type &&
263
248
  exchanges == o.exchanges
264
249
  end
@@ -272,7 +257,7 @@ module SnapTrade
272
257
  # Calculates hash code according to all attributes.
273
258
  # @return [Integer] Hash code
274
259
  def hash
275
- [id, name, display_name, description, aws_s3_logo_url, aws_s3_square_logo_url, open_url, slug, url, enabled, maintenance_mode, allows_fractional_units, allows_trading, has_reporting, is_real_time_connection, allows_trading_through_snaptrade_api, is_scraping_integration, default_currency, brokerage_type, exchanges].hash
260
+ [id, slug, name, display_name, description, aws_s3_logo_url, aws_s3_square_logo_url, open_url, url, enabled, maintenance_mode, allows_fractional_units, allows_trading, has_reporting, is_real_time_connection, brokerage_type, exchanges].hash
276
261
  end
277
262
 
278
263
  # Builds the object from hash
@@ -11,28 +11,32 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
+ # A single connection with a brokerage. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
14
15
  class BrokerageAuthorization
16
+ # Unique identifier for the connection. This is the UUID used to reference the connection in SnapTrade.
15
17
  attr_accessor :id
16
18
 
17
- # Time
19
+ # Timestamp of when the connection was established in SnapTrade.
18
20
  attr_accessor :created_date
19
21
 
20
- # Time
22
+ # Timestamp of when the connection was last updated in SnapTrade. This field is deprecated. Please let us know if you have a valid use case for this field.
21
23
  attr_accessor :updated_date
22
24
 
23
25
  attr_accessor :brokerage
24
26
 
25
- # Connection Name
27
+ # A short, human-readable name for the connection.
26
28
  attr_accessor :name
27
29
 
30
+ # Whether the connection is read-only or trade-enabled. A read-only connection can only be used to fetch data, while a trade-enabled connection can be used to place trades. Valid values are `read` and `trade`.
28
31
  attr_accessor :type
29
32
 
33
+ # Whether the connection is disabled. A disabled connection can no longer access the latest data from the brokerage, but will continue to return the last cached state. A connection can become disabled for many reasons and differs by brokerage. Here are some common scenarios: - The user has changed their username or password at the brokerage. - The user has explicitly removed the access grant at the brokerage. - The session has expired at the brokerage and now requires explicit user re-authentication. Please see [this guide](https://docs.snaptrade.com/docs/fix-broken-connections) on how to fix a disabled connection.
30
34
  attr_accessor :disabled
31
35
 
32
- # Disabled date
36
+ # Timestamp of when the connection was disabled in SnapTrade.
33
37
  attr_accessor :disabled_date
34
38
 
35
- # Additional data about brokerage authorization
39
+ # Additional data about the connection. This information is specific to the brokerage and there's no standard format for this data. This field is deprecated and subject to removal in a future version.
36
40
  attr_accessor :meta
37
41
 
38
42
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -59,13 +63,13 @@ module SnapTrade
59
63
  def self.openapi_types
60
64
  {
61
65
  :'id' => :'String',
62
- :'created_date' => :'String',
63
- :'updated_date' => :'String',
66
+ :'created_date' => :'Time',
67
+ :'updated_date' => :'Time',
64
68
  :'brokerage' => :'Brokerage',
65
69
  :'name' => :'String',
66
70
  :'type' => :'String',
67
71
  :'disabled' => :'Boolean',
68
- :'disabled_date' => :'String',
72
+ :'disabled_date' => :'Time',
69
73
  :'meta' => :'Hash<String, Object>'
70
74
  }
71
75
  end
@@ -11,6 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
+ # Confirmation that the connection has been disabled.
14
15
  class BrokerageAuthorizationDisabledConfirmation
15
16
  # Connection disabled confirmation
16
17
  attr_accessor :detail
@@ -11,6 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
+ # Confirmation that the syncs have been scheduled.
14
15
  class BrokerageAuthorizationRefreshConfirmation
15
16
  # Refresh confirmation details
16
17
  attr_accessor :detail
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Type of brokerage
14
+ # Type of brokerage. Currently supports traditional brokerages and crypto exchanges.
15
15
  class BrokerageType
16
16
  attr_accessor :id
17
17
 
@@ -11,21 +11,23 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A manual trade object
14
+ # Contains the details of a submitted order.
15
15
  class ManualTrade
16
+ # Unique identifier for the submitted order through SnapTrade.
16
17
  attr_accessor :id
17
18
 
19
+ # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
18
20
  attr_accessor :account
19
21
 
20
- # Order Type
22
+ # The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
21
23
  attr_accessor :order_type
22
24
 
23
- # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date
25
+ # The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
24
26
  attr_accessor :time_in_force
25
27
 
26
28
  attr_accessor :symbol
27
29
 
28
- # Trade Action
30
+ # The action describes the intent or side of a trade. This is either `BUY` or `SELL`
29
31
  attr_accessor :action
30
32
 
31
33
  attr_accessor :units
@@ -58,7 +60,7 @@ module SnapTrade
58
60
  :'id' => :'String',
59
61
  :'account' => :'String',
60
62
  :'order_type' => :'OrderTypeStrict',
61
- :'time_in_force' => :'String',
63
+ :'time_in_force' => :'TimeInForceStrict',
62
64
  :'symbol' => :'ManualTradeSymbol',
63
65
  :'action' => :'ActionStrict',
64
66
  :'units' => :'Float',
@@ -11,10 +11,10 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Manual Trade and Impact object
15
14
  class ManualTradeAndImpact
16
15
  attr_accessor :trade
17
16
 
17
+ # List of impacts of the trade on the account. The list always contains one value at the moment.
18
18
  attr_accessor :trade_impacts
19
19
 
20
20
  attr_accessor :combined_remaining_balance
@@ -37,7 +37,7 @@ module SnapTrade
37
37
  def self.openapi_types
38
38
  {
39
39
  :'trade' => :'ManualTrade',
40
- :'trade_impacts' => :'Array<ManualTrade>',
40
+ :'trade_impacts' => :'Array<ManualTradeImpact>',
41
41
  :'combined_remaining_balance' => :'ManualTradeBalance'
42
42
  }
43
43
  end
@@ -11,13 +11,13 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Balance
14
+ # Estimated remaining balance of the account after the trade is executed.
15
15
  class ManualTradeBalance
16
16
  attr_accessor :account
17
17
 
18
18
  attr_accessor :currency
19
19
 
20
- # Cash
20
+ # Estimated amount of cash remaining in the account after the trade. At the moment this is the same as `remaining_cash` under `trade_impacts`.
21
21
  attr_accessor :cash
22
22
 
23
23
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -37,7 +37,7 @@ module SnapTrade
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
- :'account' => :'Account',
40
+ :'account' => :'AccountSimple',
41
41
  :'currency' => :'Currency',
42
42
  :'cash' => :'Float'
43
43
  }
@@ -11,29 +11,31 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Manual Trade Form
14
+ # Inputs for placing an order with the brokerage.
15
15
  class ManualTradeForm
16
+ # Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
16
17
  attr_accessor :account_id
17
18
 
18
- # Trade Action
19
+ # The action describes the intent or side of a trade. This is either `BUY` or `SELL`
19
20
  attr_accessor :action
20
21
 
21
- # Order Type
22
+ # Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
23
+ attr_accessor :universal_symbol_id
24
+
25
+ # The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
22
26
  attr_accessor :order_type
23
27
 
24
- # Trade Price if limit or stop limit order
28
+ # The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
29
+ attr_accessor :time_in_force
30
+
31
+ # The limit price for `Limit` and `StopLimit` orders.
25
32
  attr_accessor :price
26
33
 
27
- # Stop Price. If stop loss or stop limit order, the price to trigger the stop
34
+ # The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
28
35
  attr_accessor :stop
29
36
 
30
- # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled
31
- attr_accessor :time_in_force
32
-
33
37
  attr_accessor :units
34
38
 
35
- attr_accessor :universal_symbol_id
36
-
37
39
  attr_accessor :notional_value
38
40
 
39
41
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -41,12 +43,12 @@ module SnapTrade
41
43
  {
42
44
  :'account_id' => :'account_id',
43
45
  :'action' => :'action',
46
+ :'universal_symbol_id' => :'universal_symbol_id',
44
47
  :'order_type' => :'order_type',
48
+ :'time_in_force' => :'time_in_force',
45
49
  :'price' => :'price',
46
50
  :'stop' => :'stop',
47
- :'time_in_force' => :'time_in_force',
48
51
  :'units' => :'units',
49
- :'universal_symbol_id' => :'universal_symbol_id',
50
52
  :'notional_value' => :'notional_value'
51
53
  }
52
54
  end
@@ -61,12 +63,12 @@ module SnapTrade
61
63
  {
62
64
  :'account_id' => :'String',
63
65
  :'action' => :'ActionStrict',
66
+ :'universal_symbol_id' => :'String',
64
67
  :'order_type' => :'OrderTypeStrict',
68
+ :'time_in_force' => :'TimeInForceStrict',
65
69
  :'price' => :'Float',
66
70
  :'stop' => :'Float',
67
- :'time_in_force' => :'TimeInForceStrict',
68
71
  :'units' => :'Float',
69
- :'universal_symbol_id' => :'String',
70
72
  :'notional_value' => :'ManualTradeFormNotionalValue'
71
73
  }
72
74
  end
@@ -104,10 +106,18 @@ module SnapTrade
104
106
  self.action = attributes[:'action']
105
107
  end
106
108
 
109
+ if attributes.key?(:'universal_symbol_id')
110
+ self.universal_symbol_id = attributes[:'universal_symbol_id']
111
+ end
112
+
107
113
  if attributes.key?(:'order_type')
108
114
  self.order_type = attributes[:'order_type']
109
115
  end
110
116
 
117
+ if attributes.key?(:'time_in_force')
118
+ self.time_in_force = attributes[:'time_in_force']
119
+ end
120
+
111
121
  if attributes.key?(:'price')
112
122
  self.price = attributes[:'price']
113
123
  end
@@ -116,18 +126,10 @@ module SnapTrade
116
126
  self.stop = attributes[:'stop']
117
127
  end
118
128
 
119
- if attributes.key?(:'time_in_force')
120
- self.time_in_force = attributes[:'time_in_force']
121
- end
122
-
123
129
  if attributes.key?(:'units')
124
130
  self.units = attributes[:'units']
125
131
  end
126
132
 
127
- if attributes.key?(:'universal_symbol_id')
128
- self.universal_symbol_id = attributes[:'universal_symbol_id']
129
- end
130
-
131
133
  if attributes.key?(:'notional_value')
132
134
  self.notional_value = attributes[:'notional_value']
133
135
  end
@@ -137,12 +139,37 @@ module SnapTrade
137
139
  # @return Array for valid properties with the reasons
138
140
  def list_invalid_properties
139
141
  invalid_properties = Array.new
142
+ if @account_id.nil?
143
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
144
+ end
145
+
146
+ if @action.nil?
147
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
148
+ end
149
+
150
+ if @universal_symbol_id.nil?
151
+ invalid_properties.push('invalid value for "universal_symbol_id", universal_symbol_id cannot be nil.')
152
+ end
153
+
154
+ if @order_type.nil?
155
+ invalid_properties.push('invalid value for "order_type", order_type cannot be nil.')
156
+ end
157
+
158
+ if @time_in_force.nil?
159
+ invalid_properties.push('invalid value for "time_in_force", time_in_force cannot be nil.')
160
+ end
161
+
140
162
  invalid_properties
141
163
  end
142
164
 
143
165
  # Check to see if the all the properties in the model are valid
144
166
  # @return true if the model is valid
145
167
  def valid?
168
+ return false if @account_id.nil?
169
+ return false if @action.nil?
170
+ return false if @universal_symbol_id.nil?
171
+ return false if @order_type.nil?
172
+ return false if @time_in_force.nil?
146
173
  true
147
174
  end
148
175
 
@@ -153,12 +180,12 @@ module SnapTrade
153
180
  self.class == o.class &&
154
181
  account_id == o.account_id &&
155
182
  action == o.action &&
183
+ universal_symbol_id == o.universal_symbol_id &&
156
184
  order_type == o.order_type &&
185
+ time_in_force == o.time_in_force &&
157
186
  price == o.price &&
158
187
  stop == o.stop &&
159
- time_in_force == o.time_in_force &&
160
188
  units == o.units &&
161
- universal_symbol_id == o.universal_symbol_id &&
162
189
  notional_value == o.notional_value
163
190
  end
164
191
 
@@ -171,7 +198,7 @@ module SnapTrade
171
198
  # Calculates hash code according to all attributes.
172
199
  # @return [Integer] Hash code
173
200
  def hash
174
- [account_id, action, order_type, price, stop, time_in_force, units, universal_symbol_id, notional_value].hash
201
+ [account_id, action, universal_symbol_id, order_type, time_in_force, price, stop, units, notional_value].hash
175
202
  end
176
203
 
177
204
  # Builds the object from hash