snaptrade 2.0.0 → 2.0.2

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: 54248537533cc85b7e2a236fd171c32f6e4893f8c1e99af4a1d7edd14129c450
4
- data.tar.gz: 913138150b71863d9a70fcb08fe78fc18717c565e0145026e4333b410b6d300f
3
+ metadata.gz: ec9e0dbe7d3e7c69d00269f23444db2c9208b10a53688128a5f1e68ce19b1783
4
+ data.tar.gz: 7780d0e966a7189727812916c9b79c945d608cd0671a1554a6e9ef0e42c4ec20
5
5
  SHA512:
6
- metadata.gz: 2edd6fe7cdb16b1c4605f9dacba0c0f488c11758ebfb1efe75b008957919b57c271337b3e6c6a4ed67b077f66a2388eed232a219d78c0aa05f1aae2b690bc4bb
7
- data.tar.gz: a674e881bb6caf2179f55e203616049f3faf4d8309666c771e24946f75c71fd1576a6ae487ae1421d6e33bcc80f33b40a235c42106144578fbb4bcda21e570d1
6
+ metadata.gz: b9cad2244d5f0107d326608e94fe7908a101be05a0e63ec3af539e941dc9c5ab76be1beb09ccd3409c836acc30be2056ef1d6095fc4be40fe43f579c21bf905b
7
+ data.tar.gz: 3cfafe1b77b9553ef62ca93f326d0b221b00b594ccc372c4abe8474f24b012612e52c4ebde558c2fb2a667460683c6547ca740695f6289e3a0aba294683cd30d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (1.17.13)
4
+ snaptrade (2.0.1)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ For more information, please visit [https://snaptrade.com/](https://snaptrade.co
9
9
  Add to Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'snaptrade', '~> 2.0.0'
12
+ gem 'snaptrade', '~> 2.0.2'
13
13
  ```
14
14
 
15
15
  ## Getting Started
@@ -57,6 +57,7 @@ Class | Method | HTTP request | Description
57
57
  *SnapTrade::AuthenticationApi* | [**list_snap_trade_users**](docs/AuthenticationApi.md#list_snap_trade_users) | **GET** /snapTrade/listUsers | List SnapTrade users
58
58
  *SnapTrade::AuthenticationApi* | [**login_snap_trade_user**](docs/AuthenticationApi.md#login_snap_trade_user) | **POST** /snapTrade/login | Login user & generate connection link
59
59
  *SnapTrade::AuthenticationApi* | [**register_snap_trade_user**](docs/AuthenticationApi.md#register_snap_trade_user) | **POST** /snapTrade/registerUser | Create SnapTrade user
60
+ *SnapTrade::AuthenticationApi* | [**reset_snap_trade_user_secret**](docs/AuthenticationApi.md#reset_snap_trade_user_secret) | **POST** /snapTrade/resetUserSecret | Obtain a new user secret for a user
60
61
  *SnapTrade::ConnectionsApi* | [**detail_brokerage_authorization**](docs/ConnectionsApi.md#detail_brokerage_authorization) | **GET** /authorizations/{authorizationId} | Get brokerage authorization details
61
62
  *SnapTrade::ConnectionsApi* | [**list_brokerage_authorizations**](docs/ConnectionsApi.md#list_brokerage_authorizations) | **GET** /authorizations | List all brokerage authorizations for the user
62
63
  *SnapTrade::ConnectionsApi* | [**remove_brokerage_authorization**](docs/ConnectionsApi.md#remove_brokerage_authorization) | **DELETE** /authorizations/{authorizationId} | Delete brokerage authorization
@@ -202,7 +203,7 @@ Class | Method | HTTP request | Description
202
203
  - [SnapTrade::SymbolQuery](docs/SymbolQuery.md)
203
204
  - [SnapTrade::SymbolsQuotesInner](docs/SymbolsQuotesInner.md)
204
205
  - [SnapTrade::TargetAsset](docs/TargetAsset.md)
205
- - [SnapTrade::TimeInForce](docs/TimeInForce.md)
206
+ - [SnapTrade::TimeInForceStrict](docs/TimeInForceStrict.md)
206
207
  - [SnapTrade::Trade](docs/Trade.md)
207
208
  - [SnapTrade::TradeAction](docs/TradeAction.md)
208
209
  - [SnapTrade::TradeExecutionStatus](docs/TradeExecutionStatus.md)
@@ -18,7 +18,7 @@
18
18
  | **limit_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
19
19
  | **stop_price** | **Float** | Stop Price. If stop loss or stop limit order, the price to trigger the stop | [optional] |
20
20
  | **order_type** | [**OrderType**](OrderType.md) | | [optional] |
21
- | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
21
+ | **time_in_force** | **String** | Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date | [optional] |
22
22
  | **time_placed** | **String** | Time | [optional] |
23
23
  | **time_updated** | **String** | Time | [optional] |
24
24
  | **expiry_date** | **String** | Time | [optional] |
@@ -9,6 +9,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
9
9
  | [**list_snap_trade_users**](AuthenticationApi.md#list_snap_trade_users) | **GET** /snapTrade/listUsers | List SnapTrade users |
10
10
  | [**login_snap_trade_user**](AuthenticationApi.md#login_snap_trade_user) | **POST** /snapTrade/login | Login user &amp; generate connection link |
11
11
  | [**register_snap_trade_user**](AuthenticationApi.md#register_snap_trade_user) | **POST** /snapTrade/registerUser | Create SnapTrade user |
12
+ | [**reset_snap_trade_user_secret**](AuthenticationApi.md#reset_snap_trade_user_secret) | **POST** /snapTrade/resetUserSecret | Obtain a new user secret for a user |
12
13
 
13
14
  ## delete_snap_trade_user
14
15
 
@@ -318,3 +319,62 @@ end
318
319
 
319
320
  [**UserIDandSecret**](UserIDandSecret.md)
320
321
 
322
+ ## reset_snap_trade_user_secret
323
+
324
+ Obtain a new user secret for a user
325
+
326
+ ### Example
327
+
328
+ ```ruby
329
+ require 'snaptrade'
330
+
331
+ SnapTrade.client_id = "YOUR_CLIENT_ID"
332
+ SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
333
+
334
+ user_id = "snaptrade-user-123"
335
+ user_secret = "h81@cx1lkalablakwjaltkejraj11="
336
+
337
+ begin
338
+ # Obtain a new user secret for a user
339
+ result = SnapTrade::Authentication.reset_snap_trade_user_secret(
340
+ user_id: user_id,
341
+ user_secret: user_secret,
342
+ )
343
+ p result
344
+ rescue SnapTrade::ApiError => e
345
+ puts "Exception when calling SnapTrade::Authentication.reset_snap_trade_user_secret: #{e}"
346
+ end
347
+ ```
348
+
349
+ #### Using the reset_snap_trade_user_secret_with_http_info variant
350
+
351
+ This returns an Array which contains the response data, status code and headers.
352
+
353
+ ```ruby
354
+ user_id = "snaptrade-user-123"
355
+ user_secret = "h81@cx1lkalablakwjaltkejraj11="
356
+
357
+ begin
358
+ # Obtain a new user secret for a user
359
+ data, status_code, headers, response = SnapTrade::Authentication.reset_snap_trade_user_secret_with_http_info(
360
+ user_id: user_id,
361
+ user_secret: user_secret,
362
+ )
363
+ p status_code # => 2xx
364
+ p headers # => { ... }
365
+ p data # => UserIDandSecret
366
+ rescue SnapTrade::ApiError => e
367
+ puts "Exception when calling SnapTrade::Authentication.reset_snap_trade_user_secret: #{e}"
368
+ end
369
+ ```
370
+
371
+ ### Parameters
372
+
373
+ | Name | Type | Description | Notes |
374
+ | ---- | ---- | ----------- | ----- |
375
+ | **user_i_dand_secret** | [**UserIDandSecret**](UserIDandSecret.md) | | |
376
+
377
+ ### Return type
378
+
379
+ [**UserIDandSecret**](UserIDandSecret.md)
380
+
data/docs/ManualTrade.md CHANGED
@@ -7,7 +7,7 @@
7
7
  | **id** | **String** | | [optional] |
8
8
  | **account** | **String** | | [optional] |
9
9
  | **order_type** | [**OrderType**](OrderType.md) | | [optional] |
10
- | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
10
+ | **time_in_force** | **String** | Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date | [optional] |
11
11
  | **symbol** | [**ManualTradeSymbol**](ManualTradeSymbol.md) | | [optional] |
12
12
  | **action** | [**Action**](Action.md) | | [optional] |
13
13
  | **units** | **Float** | Trade Units. Cannot work with notional value. | [optional] |
@@ -9,7 +9,7 @@
9
9
  | **order_type** | [**OrderType**](OrderType.md) | | [optional] |
10
10
  | **price** | **Float** | Trade Price if limit or stop limit order | [optional] |
11
11
  | **stop** | **Float** | Stop Price. If stop loss or stop limit order, the price to trigger the stop | [optional] |
12
- | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
12
+ | **time_in_force** | [**TimeInForceStrict**](TimeInForceStrict.md) | | [optional] |
13
13
  | **units** | **Float** | | [optional] |
14
14
  | **universal_symbol_id** | **String** | | [optional] |
15
15
  | **notional_value** | **Float** | | [optional] |
@@ -13,7 +13,7 @@
13
13
  require 'snaptrade'
14
14
 
15
15
  instance = SnapTrade::MonthlyDividends.new(
16
- date: Sun Jan 23 16:00:00 PST 2022,
16
+ date: Mon Jan 24 00:00:00 UTC 2022,
17
17
  dividends: null
18
18
  )
19
19
  ```
@@ -14,7 +14,7 @@
14
14
  require 'snaptrade'
15
15
 
16
16
  instance = SnapTrade::NetContributions.new(
17
- date: Sun Jan 23 16:00:00 PST 2022,
17
+ date: Mon Jan 24 00:00:00 UTC 2022,
18
18
  contributions: 524.74,
19
19
  currency: CAD
20
20
  )
data/docs/OptionsApi.md CHANGED
@@ -318,7 +318,7 @@ SnapTrade.client_id = "YOUR_CLIENT_ID"
318
318
  SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
319
319
 
320
320
  order_type = "Limit"
321
- time_in_force = "Day"
321
+ time_in_force = "FOK"
322
322
  user_id = "John.doe@snaptrade.com"
323
323
  user_secret = "USERSECRET123"
324
324
  account_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
@@ -348,7 +348,7 @@ This returns an Array which contains the response data, status code and headers.
348
348
 
349
349
  ```ruby
350
350
  order_type = "Limit"
351
- time_in_force = "Day"
351
+ time_in_force = "FOK"
352
352
  user_id = "John.doe@snaptrade.com"
353
353
  user_secret = "USERSECRET123"
354
354
  account_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **order_type** | [**OrderType**](OrderType.md) | | |
8
- | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | |
8
+ | **time_in_force** | [**TimeInForceStrict**](TimeInForceStrict.md) | | |
9
9
  | **price** | **Float** | Trade Price if limit or stop limit order | [optional] |
10
10
 
11
11
  ## Example
data/docs/PastValue.md CHANGED
@@ -14,7 +14,7 @@
14
14
  require 'snaptrade'
15
15
 
16
16
  instance = SnapTrade::PastValue.new(
17
- date: Sun Jan 23 16:00:00 PST 2022,
17
+ date: Mon Jan 24 00:00:00 UTC 2022,
18
18
  value: 52.74,
19
19
  currency: CAD
20
20
  )
@@ -10,7 +10,7 @@
10
10
  | **open_quantity** | **Float** | | [optional] |
11
11
  | **closed_quantity** | **Float** | | [optional] |
12
12
  | **order_type** | [**OrderType**](OrderType.md) | | [optional] |
13
- | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
13
+ | **time_in_force** | **String** | Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date | [optional] |
14
14
  | **limit_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
15
15
  | **execution_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
16
16
  | **time_placed** | **String** | Time | [optional] |
@@ -14,8 +14,8 @@
14
14
  require 'snaptrade'
15
15
 
16
16
  instance = SnapTrade::SubPeriodReturnRate.new(
17
- period_start: Sun Jan 23 16:00:00 PST 2022,
18
- period_end: Sun Jan 23 16:00:00 PST 2022,
17
+ period_start: Mon Jan 24 00:00:00 UTC 2022,
18
+ period_end: Mon Jan 24 00:00:00 UTC 2022,
19
19
  rate_of_return: 0.012312367452
20
20
  )
21
21
  ```
@@ -1,4 +1,4 @@
1
- # SnapTrade::TimeInForce
1
+ # SnapTrade::TimeInForceStrict
2
2
 
3
3
  ## Properties
4
4
 
@@ -10,6 +10,6 @@
10
10
  ```ruby
11
11
  require 'snaptrade'
12
12
 
13
- instance = SnapTrade::TimeInForce.new()
13
+ instance = SnapTrade::TimeInForceStrict.new()
14
14
  ```
15
15
 
data/docs/TradingApi.md CHANGED
@@ -100,7 +100,7 @@ action = "BUY"
100
100
  order_type = "Limit"
101
101
  price = 31.33
102
102
  stop = 31.33
103
- time_in_force = "Day"
103
+ time_in_force = "FOK"
104
104
  units = 3.14
105
105
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
106
106
  notional_value = 3.14
@@ -138,7 +138,7 @@ action = "BUY"
138
138
  order_type = "Limit"
139
139
  price = 31.33
140
140
  stop = 31.33
141
- time_in_force = "Day"
141
+ time_in_force = "FOK"
142
142
  units = 3.14
143
143
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
144
144
  notional_value = 3.14
@@ -272,7 +272,7 @@ action = "BUY"
272
272
  order_type = "Limit"
273
273
  price = 31.33
274
274
  stop = 31.33
275
- time_in_force = "Day"
275
+ time_in_force = "FOK"
276
276
  units = 3.14
277
277
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
278
278
  notional_value = 3.14
@@ -310,7 +310,7 @@ action = "BUY"
310
310
  order_type = "Limit"
311
311
  price = 31.33
312
312
  stop = 31.33
313
- time_in_force = "Day"
313
+ time_in_force = "FOK"
314
314
  units = 3.14
315
315
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
316
316
  notional_value = 3.14
@@ -14,7 +14,7 @@ require 'snaptrade'
14
14
 
15
15
  instance = SnapTrade::TransactionsStatus.new(
16
16
  initial_sync_completed: null,
17
- last_successful_sync: Sun Jan 23 16:00:00 PST 2022
17
+ last_successful_sync: Mon Jan 24 00:00:00 UTC 2022
18
18
  )
19
19
  ```
20
20
 
@@ -476,6 +476,100 @@ module SnapTrade
476
476
  end
477
477
  return data, status_code, headers, response
478
478
  end
479
+
480
+
481
+ # Obtain a new user secret for a user
482
+ # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it&#39;s unique to a user
483
+ # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user.
484
+ # @param body [UserIDandSecret]
485
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
486
+ def reset_snap_trade_user_secret(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
487
+ _body = {}
488
+ _body[:userId] = user_id if user_id != SENTINEL
489
+ _body[:userSecret] = user_secret if user_secret != SENTINEL
490
+ user_i_dand_secret = _body
491
+ data, _status_code, _headers = reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, extra)
492
+ data
493
+ end
494
+
495
+ # Obtain a new user secret for a user
496
+ # @param user_id [String] SnapTrade User ID. Provided by SnapTrade Partner. Can be any string, as long as it&#39;s unique to a user
497
+ # @param user_secret [String] SnapTrade User Secret randomly generated by SnapTrade. This should be considered priviledged information and if compromised, you should delete and re-create this SnapTrade user.
498
+ # @param body [UserIDandSecret]
499
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
500
+ def reset_snap_trade_user_secret_with_http_info(user_id: SENTINEL, user_secret: SENTINEL, extra: {})
501
+ _body = {}
502
+ _body[:userId] = user_id if user_id != SENTINEL
503
+ _body[:userSecret] = user_secret if user_secret != SENTINEL
504
+ user_i_dand_secret = _body
505
+ reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, extra)
506
+ end
507
+
508
+ # Obtain a new user secret for a user
509
+ # @param user_i_dand_secret [UserIDandSecret]
510
+ # @param [Hash] opts the optional parameters
511
+ # @return [UserIDandSecret]
512
+ def reset_snap_trade_user_secret_impl(user_i_dand_secret, opts = {})
513
+ data, _status_code, _headers = reset_snap_trade_user_secret_with_http_info(user_i_dand_secret, opts)
514
+ data
515
+ end
516
+
517
+ # Obtain a new user secret for a user
518
+ # @param user_i_dand_secret [UserIDandSecret]
519
+ # @param [Hash] opts the optional parameters
520
+ # @return [Array<(UserIDandSecret, Integer, Hash)>] UserIDandSecret data, response status code and response headers
521
+ def reset_snap_trade_user_secret_with_http_info_impl(user_i_dand_secret, opts = {})
522
+ if @api_client.config.debugging
523
+ @api_client.config.logger.debug 'Calling API: AuthenticationApi.reset_snap_trade_user_secret ...'
524
+ end
525
+ # verify the required parameter 'user_i_dand_secret' is set
526
+ if @api_client.config.client_side_validation && user_i_dand_secret.nil?
527
+ fail ArgumentError, "Missing the required parameter 'user_i_dand_secret' when calling AuthenticationApi.reset_snap_trade_user_secret"
528
+ end
529
+ # resource path
530
+ local_var_path = '/snapTrade/resetUserSecret'
531
+
532
+ # query parameters
533
+ query_params = opts[:query_params] || {}
534
+
535
+ # header parameters
536
+ header_params = opts[:header_params] || {}
537
+ # HTTP header 'Accept' (if needed)
538
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
539
+ # HTTP header 'Content-Type'
540
+ content_type = @api_client.select_header_content_type(['application/json'])
541
+ if !content_type.nil?
542
+ header_params['Content-Type'] = content_type
543
+ end
544
+
545
+ # form parameters
546
+ form_params = opts[:form_params] || {}
547
+
548
+ # http body (model)
549
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_i_dand_secret)
550
+
551
+ # return_type
552
+ return_type = opts[:debug_return_type] || 'UserIDandSecret'
553
+
554
+ # auth_names
555
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
556
+
557
+ new_options = opts.merge(
558
+ :operation => :"AuthenticationApi.reset_snap_trade_user_secret",
559
+ :header_params => header_params,
560
+ :query_params => query_params,
561
+ :form_params => form_params,
562
+ :body => post_body,
563
+ :auth_names => auth_names,
564
+ :return_type => return_type
565
+ )
566
+
567
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
568
+ if @api_client.config.debugging
569
+ @api_client.config.logger.debug "API called: AuthenticationApi#reset_snap_trade_user_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
570
+ end
571
+ return data, status_code, headers, response
572
+ end
479
573
  end
480
574
 
481
575
  # top-level client access to avoid having the user to insantiate their own API instances
@@ -446,7 +446,7 @@ module SnapTrade
446
446
 
447
447
  # Place an option strategy order on the brokerage
448
448
  # @param order_type [OrderType]
449
- # @param time_in_force [TimeInForce]
449
+ # @param time_in_force [TimeInForceStrict]
450
450
  # @param user_id [String]
451
451
  # @param user_secret [String]
452
452
  # @param account_id [String] The ID of the account to execute the strategy in.
@@ -466,7 +466,7 @@ module SnapTrade
466
466
 
467
467
  # Place an option strategy order on the brokerage
468
468
  # @param order_type [OrderType]
469
- # @param time_in_force [TimeInForce]
469
+ # @param time_in_force [TimeInForceStrict]
470
470
  # @param user_id [String]
471
471
  # @param user_secret [String]
472
472
  # @param account_id [String] The ID of the account to execute the strategy in.
@@ -142,7 +142,7 @@ module SnapTrade
142
142
  # @param order_type [OrderType]
143
143
  # @param price [Float] Trade Price if limit or stop limit order
144
144
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
145
- # @param time_in_force [TimeInForce]
145
+ # @param time_in_force [TimeInForceStrict]
146
146
  # @param units [Float]
147
147
  # @param universal_symbol_id [String]
148
148
  # @param notional_value [Float]
@@ -172,7 +172,7 @@ module SnapTrade
172
172
  # @param order_type [OrderType]
173
173
  # @param price [Float] Trade Price if limit or stop limit order
174
174
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
175
- # @param time_in_force [TimeInForce]
175
+ # @param time_in_force [TimeInForceStrict]
176
176
  # @param units [Float]
177
177
  # @param universal_symbol_id [String]
178
178
  # @param notional_value [Float]
@@ -393,7 +393,7 @@ module SnapTrade
393
393
  # @param order_type [OrderType]
394
394
  # @param price [Float] Trade Price if limit or stop limit order
395
395
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
396
- # @param time_in_force [TimeInForce]
396
+ # @param time_in_force [TimeInForceStrict]
397
397
  # @param units [Float]
398
398
  # @param universal_symbol_id [String]
399
399
  # @param notional_value [Float]
@@ -423,7 +423,7 @@ module SnapTrade
423
423
  # @param order_type [OrderType]
424
424
  # @param price [Float] Trade Price if limit or stop limit order
425
425
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
426
- # @param time_in_force [TimeInForce]
426
+ # @param time_in_force [TimeInForceStrict]
427
427
  # @param units [Float]
428
428
  # @param universal_symbol_id [String]
429
429
  # @param notional_value [Float]
@@ -50,6 +50,7 @@ module SnapTrade
50
50
 
51
51
  attr_accessor :order_type
52
52
 
53
+ # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date
53
54
  attr_accessor :time_in_force
54
55
 
55
56
  # Time
@@ -107,7 +108,7 @@ module SnapTrade
107
108
  :'limit_price' => :'Float',
108
109
  :'stop_price' => :'Float',
109
110
  :'order_type' => :'OrderType',
110
- :'time_in_force' => :'TimeInForce',
111
+ :'time_in_force' => :'String',
111
112
  :'time_placed' => :'String',
112
113
  :'time_updated' => :'String',
113
114
  :'expiry_date' => :'String'
@@ -20,6 +20,7 @@ module SnapTrade
20
20
 
21
21
  attr_accessor :order_type
22
22
 
23
+ # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date
23
24
  attr_accessor :time_in_force
24
25
 
25
26
  attr_accessor :symbol
@@ -57,7 +58,7 @@ module SnapTrade
57
58
  :'id' => :'String',
58
59
  :'account' => :'String',
59
60
  :'order_type' => :'OrderType',
60
- :'time_in_force' => :'TimeInForce',
61
+ :'time_in_force' => :'String',
61
62
  :'symbol' => :'ManualTradeSymbol',
62
63
  :'action' => :'Action',
63
64
  :'units' => :'Float',
@@ -62,7 +62,7 @@ module SnapTrade
62
62
  :'order_type' => :'OrderType',
63
63
  :'price' => :'Float',
64
64
  :'stop' => :'Float',
65
- :'time_in_force' => :'TimeInForce',
65
+ :'time_in_force' => :'TimeInForceStrict',
66
66
  :'units' => :'Float',
67
67
  :'universal_symbol_id' => :'String',
68
68
  :'notional_value' => :'Float'
@@ -38,7 +38,7 @@ module SnapTrade
38
38
  def self.openapi_types
39
39
  {
40
40
  :'order_type' => :'OrderType',
41
- :'time_in_force' => :'TimeInForce',
41
+ :'time_in_force' => :'TimeInForceStrict',
42
42
  :'price' => :'Float'
43
43
  }
44
44
  end
@@ -26,6 +26,7 @@ module SnapTrade
26
26
 
27
27
  attr_accessor :order_type
28
28
 
29
+ # Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Good Til Canceled * GTD - Good Til Date
29
30
  attr_accessor :time_in_force
30
31
 
31
32
  # Trade Price if limit or stop limit order
@@ -71,7 +72,7 @@ module SnapTrade
71
72
  :'open_quantity' => :'Float',
72
73
  :'closed_quantity' => :'Float',
73
74
  :'order_type' => :'OrderType',
74
- :'time_in_force' => :'TimeInForce',
75
+ :'time_in_force' => :'String',
75
76
  :'limit_price' => :'Float',
76
77
  :'execution_price' => :'Float',
77
78
  :'time_placed' => :'String',
@@ -12,13 +12,13 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module SnapTrade
15
- class TimeInForce
16
- DAY = "Day".freeze
15
+ class TimeInForceStrict
17
16
  FOK = "FOK".freeze
17
+ DAY = "Day".freeze
18
18
  GTC = "GTC".freeze
19
19
 
20
20
  def self.all_vars
21
- @all_vars ||= [DAY, FOK, GTC].freeze
21
+ @all_vars ||= [FOK, DAY, GTC].freeze
22
22
  end
23
23
 
24
24
  # Builds the enum from string
@@ -32,8 +32,8 @@ module SnapTrade
32
32
  # @param [String] The enum value in the form of the string
33
33
  # @return [String] The enum value
34
34
  def build_from_hash(value)
35
- return value if TimeInForce.all_vars.include?(value)
36
- raise "Invalid ENUM value #{value} for class #TimeInForce"
35
+ return value if TimeInForceStrict.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #TimeInForceStrict"
37
37
  end
38
38
  end
39
39
  end
@@ -9,5 +9,5 @@ Contact: api@snaptrade.com
9
9
  =end
10
10
 
11
11
  module SnapTrade
12
- VERSION = '2.0.0'
12
+ VERSION = '2.0.2'
13
13
  end
data/lib/snaptrade.rb CHANGED
@@ -129,7 +129,7 @@ require 'snaptrade/models/symbol'
129
129
  require 'snaptrade/models/symbol_query'
130
130
  require 'snaptrade/models/symbols_quotes_inner'
131
131
  require 'snaptrade/models/target_asset'
132
- require 'snaptrade/models/time_in_force'
132
+ require 'snaptrade/models/time_in_force_strict'
133
133
  require 'snaptrade/models/trade'
134
134
  require 'snaptrade/models/trade_action'
135
135
  require 'snaptrade/models/trade_execution_status'
@@ -88,4 +88,15 @@ describe 'AuthenticationApi' do
88
88
  end
89
89
  end
90
90
 
91
+ # unit tests for reset_snap_trade_user_secret
92
+ # Obtain a new user secret for a user
93
+ # @param user_i_dand_secret
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [UserIDandSecret]
96
+ describe 'reset_snap_trade_user_secret test' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
99
+ end
100
+ end
101
+
91
102
  end
@@ -0,0 +1,24 @@
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
+
9
+ =end
10
+
11
+ require 'spec_helper'
12
+ require 'json'
13
+ require 'date'
14
+
15
+ # Unit tests for SnapTrade::TimeInForceStrict
16
+ describe SnapTrade::TimeInForceStrict do
17
+ let(:instance) { SnapTrade::TimeInForceStrict.new }
18
+
19
+ describe 'test an instance of TimeInForceStrict' do
20
+ it 'should create an instance of TimeInForceStrict' do
21
+ expect(instance).to be_instance_of(SnapTrade::TimeInForceStrict)
22
+ end
23
+ end
24
+ 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.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-24 00:00:00.000000000 Z
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -200,7 +200,7 @@ files:
200
200
  - docs/SymbolQuery.md
201
201
  - docs/SymbolsQuotesInner.md
202
202
  - docs/TargetAsset.md
203
- - docs/TimeInForce.md
203
+ - docs/TimeInForceStrict.md
204
204
  - docs/Trade.md
205
205
  - docs/TradeAction.md
206
206
  - docs/TradeExecutionStatus.md
@@ -346,7 +346,7 @@ files:
346
346
  - lib/snaptrade/models/symbol_query.rb
347
347
  - lib/snaptrade/models/symbols_quotes_inner.rb
348
348
  - lib/snaptrade/models/target_asset.rb
349
- - lib/snaptrade/models/time_in_force.rb
349
+ - lib/snaptrade/models/time_in_force_strict.rb
350
350
  - lib/snaptrade/models/trade.rb
351
351
  - lib/snaptrade/models/trade_action.rb
352
352
  - lib/snaptrade/models/trade_execution_status.rb
@@ -489,7 +489,7 @@ files:
489
489
  - spec/models/symbol_spec.rb
490
490
  - spec/models/symbols_quotes_inner_spec.rb
491
491
  - spec/models/target_asset_spec.rb
492
- - spec/models/time_in_force_spec.rb
492
+ - spec/models/time_in_force_strict_spec.rb
493
493
  - spec/models/trade_action_spec.rb
494
494
  - spec/models/trade_execution_status_action_spec.rb
495
495
  - spec/models/trade_execution_status_spec.rb
@@ -597,6 +597,7 @@ test_files:
597
597
  - spec/models/portfolio_group_settings_spec.rb
598
598
  - spec/models/encrypted_response_spec.rb
599
599
  - spec/models/order_type_spec.rb
600
+ - spec/models/time_in_force_strict_spec.rb
600
601
  - spec/models/account_simple_spec.rb
601
602
  - spec/models/manual_trade_balance_spec.rb
602
603
  - spec/models/session_event_spec.rb
@@ -658,7 +659,6 @@ test_files:
658
659
  - spec/models/underlying_symbol_spec.rb
659
660
  - spec/models/symbol_spec.rb
660
661
  - spec/models/option_strategy_legs_inner_spec.rb
661
- - spec/models/time_in_force_spec.rb
662
662
  - spec/models/cash_restriction_spec.rb
663
663
  - spec/models/model404_failed_request_response_spec.rb
664
664
  - spec/models/universal_activity_spec.rb
@@ -1,24 +0,0 @@
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
-
9
- =end
10
-
11
- require 'spec_helper'
12
- require 'json'
13
- require 'date'
14
-
15
- # Unit tests for SnapTrade::TimeInForce
16
- describe SnapTrade::TimeInForce do
17
- let(:instance) { SnapTrade::TimeInForce.new }
18
-
19
- describe 'test an instance of TimeInForce' do
20
- it 'should create an instance of TimeInForce' do
21
- expect(instance).to be_instance_of(SnapTrade::TimeInForce)
22
- end
23
- end
24
- end