snaptrade 1.17.13 → 2.0.1

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: 975d402b0d373fe2299950d7e6939d1d0a01465ec71fc60c96542394c6214d98
4
- data.tar.gz: 25f83be291930f060708ddab5753080eefe30736e701d71a06c08d0e46381761
3
+ metadata.gz: ddf91b5cd3dc44efcb6a27fc4985242103d3833229db0e4e70b937f2bb7087e8
4
+ data.tar.gz: 53699d0fa45916f7d23b14ef383e51b3a1d79841156b530b521c447d029d4e70
5
5
  SHA512:
6
- metadata.gz: b7247b98a43069a678782e0f99945607ea6ffe06f43990a1b68ab5edb70b7525b8ceca24e465701c93b8b89235c5a649980af2ed7b959f5538b7d68dc01c7907
7
- data.tar.gz: a4e2fc6e5d6296f87bbf525d01e165f1316a9fc15cf7169dd52ae976d887bf6a90f39555b494fe6e9649061df97af13ef9970cbc55b0059b36048818803d92bc
6
+ metadata.gz: 3ed890b996e52f436757c72e92a1f777174944df99eb3ecc7b0e42bf0c3b0e9ae06f6792c02bfeb2d4e5affb8909431e1394fcb1f8506907578ad7da9d08160b
7
+ data.tar.gz: d5cf7663c262fd84cf9b49f74efa8215962d05841f869cbe23dbf05f8d730aaa5a712025e033e5129e08bcba42d79d5c8e56bd340536d42f0286acddfffe876e
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.0)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -9,40 +9,47 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (2.4.2)
12
+ base64 (0.1.1)
12
13
  byebug (11.1.3)
13
14
  coderay (1.1.3)
14
15
  debug (1.8.0)
15
16
  irb (>= 1.5.0)
16
17
  reline (>= 0.3.1)
17
18
  diff-lcs (1.5.0)
18
- faraday (2.9.0)
19
- faraday-net_http (>= 2.0, < 3.2)
19
+ faraday (2.7.11)
20
+ base64
21
+ faraday-net_http (>= 2.0, < 3.1)
22
+ ruby2_keywords (>= 0.0.4)
20
23
  faraday-multipart (1.0.4)
21
24
  multipart-post (~> 2)
22
- faraday-net_http (3.1.0)
23
- net-http
25
+ faraday-net_http (3.0.2)
24
26
  io-console (0.6.0)
25
- irb (1.6.4)
26
- reline (>= 0.3.0)
27
+ irb (1.8.1)
28
+ rdoc
29
+ reline (>= 0.3.8)
27
30
  method_source (1.0.0)
28
31
  multipart-post (2.3.0)
29
- net-http (0.4.1)
30
- uri
31
32
  parallel (1.23.0)
32
- parser (3.2.2.1)
33
+ parser (3.2.2.3)
33
34
  ast (~> 2.4.1)
35
+ racc
34
36
  pry (0.14.2)
35
37
  coderay (~> 1.1)
36
38
  method_source (~> 1.0)
37
39
  pry-byebug (3.10.1)
38
40
  byebug (~> 11.0)
39
41
  pry (>= 0.13, < 0.15)
42
+ psych (5.1.0)
43
+ stringio
44
+ racc (1.7.1)
40
45
  rainbow (3.1.1)
41
46
  rake (13.0.6)
42
- regexp_parser (2.8.0)
43
- reline (0.3.4)
47
+ rdoc (6.5.0)
48
+ psych (>= 4.0.0)
49
+ regexp_parser (2.8.1)
50
+ reline (0.3.8)
44
51
  io-console (~> 0.5)
45
- rexml (3.2.5)
52
+ rexml (3.2.6)
46
53
  rspec (3.12.0)
47
54
  rspec-core (~> 3.12.0)
48
55
  rspec-expectations (~> 3.12.0)
@@ -52,10 +59,10 @@ GEM
52
59
  rspec-expectations (3.12.3)
53
60
  diff-lcs (>= 1.2.0, < 2.0)
54
61
  rspec-support (~> 3.12.0)
55
- rspec-mocks (3.12.5)
62
+ rspec-mocks (3.12.6)
56
63
  diff-lcs (>= 1.2.0, < 2.0)
57
64
  rspec-support (~> 3.12.0)
58
- rspec-support (3.12.0)
65
+ rspec-support (3.12.1)
59
66
  rubocop (1.12.1)
60
67
  parallel (~> 1.10)
61
68
  parser (>= 3.0.0.0)
@@ -65,14 +72,15 @@ GEM
65
72
  rubocop-ast (>= 1.2.0, < 2.0)
66
73
  ruby-progressbar (~> 1.7)
67
74
  unicode-display_width (>= 1.4.0, < 3.0)
68
- rubocop-ast (1.28.1)
75
+ rubocop-ast (1.29.0)
69
76
  parser (>= 3.2.1.0)
70
77
  ruby-progressbar (1.13.0)
78
+ ruby2_keywords (0.0.5)
79
+ stringio (3.0.8)
71
80
  unicode-display_width (2.4.2)
72
- uri (0.13.0)
73
81
 
74
82
  PLATFORMS
75
- arm64-darwin-21
83
+ arm64-darwin-22
76
84
 
77
85
  DEPENDENCIES
78
86
  debug (~> 1.8)
@@ -83,4 +91,4 @@ DEPENDENCIES
83
91
  snaptrade!
84
92
 
85
93
  BUNDLED WITH
86
- 2.3.7
94
+ 2.4.19
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', '~> 1.17.13'
12
+ gem 'snaptrade', '~> 2.0.1'
13
13
  ```
14
14
 
15
15
  ## Getting Started
@@ -72,7 +72,7 @@ Class | Method | HTTP request | Description
72
72
  *SnapTrade::ReferenceDataApi* | [**get_security_types**](docs/ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types
73
73
  *SnapTrade::ReferenceDataApi* | [**get_stock_exchanges**](docs/ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges
74
74
  *SnapTrade::ReferenceDataApi* | [**get_symbols**](docs/ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols
75
- *SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker
75
+ *SnapTrade::ReferenceDataApi* | [**get_symbols_by_ticker**](docs/ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{query} | Get details of a symbol by the ticker or the universal_symbol_id
76
76
  *SnapTrade::ReferenceDataApi* | [**list_all_brokerage_authorization_type**](docs/ReferenceDataApi.md#list_all_brokerage_authorization_type) | **GET** /brokerageAuthorizationTypes | List of all brokerage authorization types
77
77
  *SnapTrade::ReferenceDataApi* | [**list_all_brokerages**](docs/ReferenceDataApi.md#list_all_brokerages) | **GET** /brokerages | List brokerages
78
78
  *SnapTrade::ReferenceDataApi* | [**list_all_currencies**](docs/ReferenceDataApi.md#list_all_currencies) | **GET** /currencies | List currencies
@@ -202,7 +202,7 @@ Class | Method | HTTP request | Description
202
202
  - [SnapTrade::SymbolQuery](docs/SymbolQuery.md)
203
203
  - [SnapTrade::SymbolsQuotesInner](docs/SymbolsQuotesInner.md)
204
204
  - [SnapTrade::TargetAsset](docs/TargetAsset.md)
205
- - [SnapTrade::TimeInForce](docs/TimeInForce.md)
205
+ - [SnapTrade::TimeInForceStrict](docs/TimeInForceStrict.md)
206
206
  - [SnapTrade::Trade](docs/Trade.md)
207
207
  - [SnapTrade::TradeAction](docs/TradeAction.md)
208
208
  - [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] |
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] |
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
@@ -9,7 +9,7 @@ All URIs are relative to *https://api.snaptrade.com/api/v1*
9
9
  | [**get_security_types**](ReferenceDataApi.md#get_security_types) | **GET** /securityTypes | List of all security types |
10
10
  | [**get_stock_exchanges**](ReferenceDataApi.md#get_stock_exchanges) | **GET** /exchanges | List exchanges |
11
11
  | [**get_symbols**](ReferenceDataApi.md#get_symbols) | **POST** /symbols | Search for symbols |
12
- | [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{ticker} | Get details of a symbol by the ticker |
12
+ | [**get_symbols_by_ticker**](ReferenceDataApi.md#get_symbols_by_ticker) | **GET** /symbols/{query} | Get details of a symbol by the ticker or the universal_symbol_id |
13
13
  | [**list_all_brokerage_authorization_type**](ReferenceDataApi.md#list_all_brokerage_authorization_type) | **GET** /brokerageAuthorizationTypes | List of all brokerage authorization types |
14
14
  | [**list_all_brokerages**](ReferenceDataApi.md#list_all_brokerages) | **GET** /brokerages | List brokerages |
15
15
  | [**list_all_currencies**](ReferenceDataApi.md#list_all_currencies) | **GET** /currencies | List currencies |
@@ -271,7 +271,7 @@ end
271
271
 
272
272
  ## get_symbols_by_ticker
273
273
 
274
- Get details of a symbol by the ticker
274
+ Get details of a symbol by the ticker or the universal_symbol_id
275
275
 
276
276
  ### Example
277
277
 
@@ -281,14 +281,12 @@ require 'snaptrade'
281
281
  SnapTrade.client_id = "YOUR_CLIENT_ID"
282
282
  SnapTrade.consumer_key = "YOUR_CONSUMER_KEY"
283
283
 
284
- ticker = "ticker_example"
285
- symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
284
+ query = "query_example"
286
285
 
287
286
  begin
288
- # Get details of a symbol by the ticker
287
+ # Get details of a symbol by the ticker or the universal_symbol_id
289
288
  result = SnapTrade::ReferenceData.get_symbols_by_ticker(
290
- ticker: ticker,
291
- symbol_id: symbol_id,
289
+ query: query,
292
290
  )
293
291
  p result
294
292
  rescue SnapTrade::ApiError => e
@@ -301,14 +299,12 @@ end
301
299
  This returns an Array which contains the response data, status code and headers.
302
300
 
303
301
  ```ruby
304
- ticker = "ticker_example"
305
- symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
302
+ query = "query_example"
306
303
 
307
304
  begin
308
- # Get details of a symbol by the ticker
305
+ # Get details of a symbol by the ticker or the universal_symbol_id
309
306
  data, status_code, headers, response = SnapTrade::ReferenceData.get_symbols_by_ticker_with_http_info(
310
- ticker: ticker,
311
- symbol_id: symbol_id,
307
+ query: query,
312
308
  )
313
309
  p status_code # => 2xx
314
310
  p headers # => { ... }
@@ -322,8 +318,7 @@ end
322
318
 
323
319
  | Name | Type | Description | Notes |
324
320
  | ---- | ---- | ----------- | ----- |
325
- | **ticker** | **String** | The ticker of the UniversalSymbol to get. | |
326
- | **symbol_id** | **String** | OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get. | [optional] |
321
+ | **query** | **String** | The ticker or universal_symbol_id of the UniversalSymbol to get. | |
327
322
 
328
323
  ### Return type
329
324
 
@@ -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] |
@@ -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
@@ -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.
@@ -392,54 +392,47 @@ module SnapTrade
392
392
  end
393
393
 
394
394
 
395
- # Get details of a symbol by the ticker
396
- # @param ticker [String] The ticker of the UniversalSymbol to get.
397
- # @param symbol_id [String] OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
395
+ # Get details of a symbol by the ticker or the universal_symbol_id
396
+ # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
398
397
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
399
- def get_symbols_by_ticker(ticker:, symbol_id: SENTINEL, extra: {})
400
- extra[:symbol_id] = symbol_id if symbol_id != SENTINEL
401
- data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(ticker, extra)
398
+ def get_symbols_by_ticker(query:, extra: {})
399
+ data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(query, extra)
402
400
  data
403
401
  end
404
402
 
405
- # Get details of a symbol by the ticker
406
- # @param ticker [String] The ticker of the UniversalSymbol to get.
407
- # @param symbol_id [String] OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
403
+ # Get details of a symbol by the ticker or the universal_symbol_id
404
+ # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
408
405
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
409
- def get_symbols_by_ticker_with_http_info(ticker:, symbol_id: SENTINEL, extra: {})
410
- extra[:symbol_id] = symbol_id if symbol_id != SENTINEL
411
- get_symbols_by_ticker_with_http_info_impl(ticker, extra)
406
+ def get_symbols_by_ticker_with_http_info(query:, extra: {})
407
+ get_symbols_by_ticker_with_http_info_impl(query, extra)
412
408
  end
413
409
 
414
- # Get details of a symbol by the ticker
415
- # @param ticker [String] The ticker of the UniversalSymbol to get.
410
+ # Get details of a symbol by the ticker or the universal_symbol_id
411
+ # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
416
412
  # @param [Hash] opts the optional parameters
417
- # @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
418
413
  # @return [UniversalSymbol]
419
- def get_symbols_by_ticker_impl(ticker, opts = {})
420
- data, _status_code, _headers = get_symbols_by_ticker_with_http_info(ticker, opts)
414
+ def get_symbols_by_ticker_impl(query, opts = {})
415
+ data, _status_code, _headers = get_symbols_by_ticker_with_http_info(query, opts)
421
416
  data
422
417
  end
423
418
 
424
- # Get details of a symbol by the ticker
425
- # @param ticker [String] The ticker of the UniversalSymbol to get.
419
+ # Get details of a symbol by the ticker or the universal_symbol_id
420
+ # @param query [String] The ticker or universal_symbol_id of the UniversalSymbol to get.
426
421
  # @param [Hash] opts the optional parameters
427
- # @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
428
422
  # @return [Array<(UniversalSymbol, Integer, Hash)>] UniversalSymbol data, response status code and response headers
429
- def get_symbols_by_ticker_with_http_info_impl(ticker, opts = {})
423
+ def get_symbols_by_ticker_with_http_info_impl(query, opts = {})
430
424
  if @api_client.config.debugging
431
425
  @api_client.config.logger.debug 'Calling API: ReferenceDataApi.get_symbols_by_ticker ...'
432
426
  end
433
- # verify the required parameter 'ticker' is set
434
- if @api_client.config.client_side_validation && ticker.nil?
435
- fail ArgumentError, "Missing the required parameter 'ticker' when calling ReferenceDataApi.get_symbols_by_ticker"
427
+ # verify the required parameter 'query' is set
428
+ if @api_client.config.client_side_validation && query.nil?
429
+ fail ArgumentError, "Missing the required parameter 'query' when calling ReferenceDataApi.get_symbols_by_ticker"
436
430
  end
437
431
  # resource path
438
- local_var_path = '/symbols/{ticker}'.sub('{' + 'ticker' + '}', CGI.escape(ticker.to_s))
432
+ local_var_path = '/symbols/{query}'.sub('{' + 'query' + '}', CGI.escape(query.to_s))
439
433
 
440
434
  # query parameters
441
435
  query_params = opts[:query_params] || {}
442
- query_params[:'symbolId'] = opts[:'symbol_id'] if !opts[:'symbol_id'].nil?
443
436
 
444
437
  # header parameters
445
438
  header_params = opts[:header_params] || {}
@@ -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 = '1.17.13'
12
+ VERSION = '2.0.1'
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'
@@ -82,10 +82,9 @@ describe 'ReferenceDataApi' do
82
82
  end
83
83
 
84
84
  # unit tests for get_symbols_by_ticker
85
- # Get details of a symbol by the ticker
86
- # @param ticker The ticker of the UniversalSymbol to get.
85
+ # Get details of a symbol by the ticker or the universal_symbol_id
86
+ # @param query The ticker or universal_symbol_id of the UniversalSymbol to get.
87
87
  # @param [Hash] opts the optional parameters
88
- # @option opts [String] :symbol_id OPTIONAL IN PATH Can be used instead of the ticker ; The ID of the UniversalSymbol to get.
89
88
  # @return [UniversalSymbol]
90
89
  describe 'get_symbols_by_ticker test' do
91
90
  it 'should work' do
@@ -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: 1.17.13
4
+ version: 2.0.1
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-17 00:00:00.000000000 Z
11
+ date: 2024-01-29 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
@@ -528,7 +528,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
528
528
  - !ruby/object:Gem::Version
529
529
  version: '0'
530
530
  requirements: []
531
- rubygems_version: 3.3.7
531
+ rubygems_version: 3.4.10
532
532
  signing_key:
533
533
  specification_version: 4
534
534
  summary: SnapTrade Ruby Gem
@@ -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