snaptrade 3.0.24 → 3.0.26

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: 9df4e76cb3da6b488147d7745b180d4d75cab1948235e4ac334ce88965de8e4e
4
- data.tar.gz: 7aa57bc8082a53ed75116518580ea3eeff31230e84ab1514b3c0682d6d0569a3
3
+ metadata.gz: e6d90e855f96cbd008caa69f70d3080bed33318902839e5cc89897ae74bf3fe1
4
+ data.tar.gz: c4fcc81059b739ad7b7fc3693541cf055f0e50a5e642b58bc8536c23ea198cd4
5
5
  SHA512:
6
- metadata.gz: 847a600ec41e79537cd2fbeca6a3cd4306679c5164ff2db7b57dcf819cb0fc647ed148ae68abf39649858bc5f0f51f47a91d5fc26ad1d5fbf9637bec5df91328
7
- data.tar.gz: dac7c94d335aeaace43faa9cd4f229fa7bd5ff667417df5f5f9ec21b8cf0b948d24d5393ba80e471968857e71000fa28684e3427149cdbc6f7030076e0f96411
6
+ metadata.gz: 2a7d3d5d00874bdd136950039c86f10b9cafdd8816093ffe40eabdde50e25b3d846c0b8b01931057e4fc1a7352401b69addb917b93a9fc9eb1dd1de2184bba92
7
+ data.tar.gz: e0490b47de01ce9730a5f8db15ff11f0dac2ca9ace18c27ca356df48aa2a96b4b72507dc42e2bb8a0dc7e872bca4a7f6456b2615c5a91ce87f6f73299fdad36a
data/README.md CHANGED
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
63
63
  See https://docs.snaptrade.com/docs/ratelimiting.
64
64
 
65
65
 
66
- [![npm](https://img.shields.io/badge/gem-v3.0.24-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.24)
66
+ [![npm](https://img.shields.io/badge/gem-v3.0.26-blue)](https://rubygems.org/gems/snaptrade/versions/3.0.26)
67
67
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
68
68
 
69
69
  </div>
@@ -116,6 +116,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
116
116
  * [`snaptrade.reference_data.list_all_brokerage_authorization_type`](#snaptradereference_datalist_all_brokerage_authorization_type)
117
117
  * [`snaptrade.reference_data.list_all_brokerage_instruments`](#snaptradereference_datalist_all_brokerage_instruments)
118
118
  * [`snaptrade.reference_data.list_all_brokerages`](#snaptradereference_datalist_all_brokerages)
119
+ * [`snaptrade.reference_data.list_institutions`](#snaptradereference_datalist_institutions)
119
120
  * [`snaptrade.reference_data.symbol_search_user_account`](#snaptradereference_datasymbol_search_user_account)
120
121
  * [`snaptrade.trading.cancel_order`](#snaptradetradingcancel_order)
121
122
  * [`snaptrade.trading.get_cryptocurrency_pair_quote`](#snaptradetradingget_cryptocurrency_pair_quote)
@@ -139,7 +140,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
139
140
  Add to Gemfile:
140
141
 
141
142
  ```ruby
142
- gem 'snaptrade', '~> 3.0.24'
143
+ gem 'snaptrade', '~> 3.0.26'
143
144
  ```
144
145
 
145
146
  ## Getting Started<a id="getting-started"></a>
@@ -271,7 +272,7 @@ one account to another. - `SPLIT` - A stock share split.
271
272
 
272
273
  ### `snaptrade.account_information.get_account_balance_history`<a id="snaptradeaccount_informationget_account_balance_history"></a>
273
274
 
274
- An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
275
+ An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
275
276
 
276
277
 
277
278
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -563,7 +564,7 @@ false to retrieve non executed orders as well
563
564
 
564
565
  ### `snaptrade.account_information.get_user_account_return_rates`<a id="snaptradeaccount_informationget_user_account_return_rates"></a>
565
566
 
566
- Returns a list of rate of return percents for a given account.
567
+ DEPRECATED. Returns a list of rate of return percents for a given account.
567
568
 
568
569
 
569
570
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -1219,7 +1220,7 @@ p result
1219
1220
 
1220
1221
  ### `snaptrade.connections.return_rates`<a id="snaptradeconnectionsreturn_rates"></a>
1221
1222
 
1222
- Returns a list of rate of return percents for a given connection.
1223
+ DEPRECATED. Returns a list of rate of return percents for a given connection.
1223
1224
 
1224
1225
 
1225
1226
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -1724,6 +1725,33 @@ p result
1724
1725
  ---
1725
1726
 
1726
1727
 
1728
+ ### `snaptrade.reference_data.list_institutions`<a id="snaptradereference_datalist_institutions"></a>
1729
+
1730
+ Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use `GET /brokerages` instead.
1731
+
1732
+ A `null` field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don't recognize.
1733
+
1734
+
1735
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1736
+
1737
+ ```ruby
1738
+ result = snaptrade.reference_data.list_institutions
1739
+ p result
1740
+ ```
1741
+
1742
+ #### 🔄 Return<a id="🔄-return"></a>
1743
+
1744
+ [Institution](./lib/snaptrade/models/institution.rb)
1745
+
1746
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1747
+
1748
+ `/institutions` `GET`
1749
+
1750
+ [🔙 **Back to Table of Contents**](#table-of-contents)
1751
+
1752
+ ---
1753
+
1754
+
1727
1755
  ### `snaptrade.reference_data.symbol_search_user_account`<a id="snaptradereference_datasymbol_search_user_account"></a>
1728
1756
 
1729
1757
  Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
@@ -185,7 +185,7 @@ module SnapTrade
185
185
 
186
186
  # List historical account total value
187
187
  #
188
- # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
188
+ # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
189
189
  #
190
190
  # @param user_id [String]
191
191
  # @param user_secret [String]
@@ -198,7 +198,7 @@ module SnapTrade
198
198
 
199
199
  # List historical account total value
200
200
  #
201
- # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
201
+ # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
202
202
  #
203
203
  # @param user_id [String]
204
204
  # @param user_secret [String]
@@ -209,7 +209,7 @@ module SnapTrade
209
209
  end
210
210
 
211
211
  # List historical account total value
212
- # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
212
+ # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
213
213
  # @param user_id [String]
214
214
  # @param user_secret [String]
215
215
  # @param account_id [String]
@@ -221,7 +221,7 @@ module SnapTrade
221
221
  end
222
222
 
223
223
  # List historical account total value
224
- # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
224
+ # An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
225
225
  # @param user_id [String]
226
226
  # @param user_secret [String]
227
227
  # @param account_id [String]
@@ -1030,7 +1030,7 @@ module SnapTrade
1030
1030
 
1031
1031
  # List account rate of returns
1032
1032
  #
1033
- # Returns a list of rate of return percents for a given account.
1033
+ # DEPRECATED. Returns a list of rate of return percents for a given account.
1034
1034
  #
1035
1035
  # @param user_id [String]
1036
1036
  # @param user_secret [String]
@@ -1045,7 +1045,7 @@ module SnapTrade
1045
1045
 
1046
1046
  # List account rate of returns
1047
1047
  #
1048
- # Returns a list of rate of return percents for a given account.
1048
+ # DEPRECATED. Returns a list of rate of return percents for a given account.
1049
1049
  #
1050
1050
  # @param user_id [String]
1051
1051
  # @param user_secret [String]
@@ -1058,7 +1058,7 @@ module SnapTrade
1058
1058
  end
1059
1059
 
1060
1060
  # List account rate of returns
1061
- # Returns a list of rate of return percents for a given account.
1061
+ # DEPRECATED. Returns a list of rate of return percents for a given account.
1062
1062
  # @param user_id [String]
1063
1063
  # @param user_secret [String]
1064
1064
  # @param account_id [String]
@@ -1071,7 +1071,7 @@ module SnapTrade
1071
1071
  end
1072
1072
 
1073
1073
  # List account rate of returns
1074
- # Returns a list of rate of return percents for a given account.
1074
+ # DEPRECATED. Returns a list of rate of return percents for a given account.
1075
1075
  # @param user_id [String]
1076
1076
  # @param user_secret [String]
1077
1077
  # @param account_id [String]
@@ -782,7 +782,7 @@ module SnapTrade
782
782
 
783
783
  # List connection rate of returns
784
784
  #
785
- # Returns a list of rate of return percents for a given connection.
785
+ # DEPRECATED. Returns a list of rate of return percents for a given connection.
786
786
  #
787
787
  # @param user_id [String]
788
788
  # @param user_secret [String]
@@ -797,7 +797,7 @@ module SnapTrade
797
797
 
798
798
  # List connection rate of returns
799
799
  #
800
- # Returns a list of rate of return percents for a given connection.
800
+ # DEPRECATED. Returns a list of rate of return percents for a given connection.
801
801
  #
802
802
  # @param user_id [String]
803
803
  # @param user_secret [String]
@@ -810,7 +810,7 @@ module SnapTrade
810
810
  end
811
811
 
812
812
  # List connection rate of returns
813
- # Returns a list of rate of return percents for a given connection.
813
+ # DEPRECATED. Returns a list of rate of return percents for a given connection.
814
814
  # @param user_id [String]
815
815
  # @param user_secret [String]
816
816
  # @param authorization_id [String]
@@ -823,7 +823,7 @@ module SnapTrade
823
823
  end
824
824
 
825
825
  # List connection rate of returns
826
- # Returns a list of rate of return percents for a given connection.
826
+ # DEPRECATED. Returns a list of rate of return percents for a given connection.
827
827
  # @param user_id [String]
828
828
  # @param user_secret [String]
829
829
  # @param authorization_id [String]
@@ -596,6 +596,87 @@ module SnapTrade
596
596
  end
597
597
 
598
598
 
599
+ # List institutions
600
+ #
601
+ # Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use `GET /brokerages` instead.
602
+ #
603
+ # A `null` field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don't recognize.
604
+ #
605
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
606
+ def list_institutions(extra: {})
607
+ data, _status_code, _headers = list_institutions_with_http_info_impl(extra)
608
+ data
609
+ end
610
+
611
+ # List institutions
612
+ #
613
+ # Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use `GET /brokerages` instead.
614
+ #
615
+ # A `null` field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don't recognize.
616
+ #
617
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
618
+ def list_institutions_with_http_info(extra: {})
619
+ list_institutions_with_http_info_impl(extra)
620
+ end
621
+
622
+ # List institutions
623
+ # Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use `GET /brokerages` instead. A `null` field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don't recognize.
624
+ # @param [Hash] opts the optional parameters
625
+ # @return [Array<Institution>]
626
+ private def list_institutions_impl(opts = {})
627
+ data, _status_code, _headers = list_institutions_with_http_info(opts)
628
+ data
629
+ end
630
+
631
+ # List institutions
632
+ # Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use &#x60;GET /brokerages&#x60; instead. A &#x60;null&#x60; field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don&#39;t recognize.
633
+ # @param [Hash] opts the optional parameters
634
+ # @return [Array<(Array<Institution>, Integer, Hash)>] Array<Institution> data, response status code and response headers
635
+ private def list_institutions_with_http_info_impl(opts = {})
636
+ if @api_client.config.debugging
637
+ @api_client.config.logger.debug 'Calling API: ReferenceDataApi.list_institutions ...'
638
+ end
639
+ # resource path
640
+ local_var_path = '/institutions'
641
+
642
+ # query parameters
643
+ query_params = opts[:query_params] || {}
644
+
645
+ # header parameters
646
+ header_params = opts[:header_params] || {}
647
+ # HTTP header 'Accept' (if needed)
648
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
649
+
650
+ # form parameters
651
+ form_params = opts[:form_params] || {}
652
+
653
+ # http body (model)
654
+ post_body = opts[:debug_body]
655
+
656
+ # return_type
657
+ return_type = opts[:debug_return_type] || 'Array<Institution>'
658
+
659
+ # auth_names
660
+ auth_names = opts[:debug_auth_names] || []
661
+
662
+ new_options = opts.merge(
663
+ :operation => :"ReferenceDataApi.list_institutions",
664
+ :header_params => header_params,
665
+ :query_params => query_params,
666
+ :form_params => form_params,
667
+ :body => post_body,
668
+ :auth_names => auth_names,
669
+ :return_type => return_type
670
+ )
671
+
672
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
673
+ if @api_client.config.debugging
674
+ @api_client.config.logger.debug "API called: ReferenceDataApi#list_institutions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
675
+ end
676
+ return data, status_code, headers, response
677
+ end
678
+
679
+
599
680
  # Search account symbols
600
681
  #
601
682
  # Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
@@ -35,7 +35,7 @@ module SnapTrade
35
35
  # Attribute type mapping.
36
36
  def self.openapi_types
37
37
  {
38
- :'institution' => :'Institution',
38
+ :'institution' => :'BrokerageAuthorizationInstitution',
39
39
  :'snaptrade' => :'Snaptrade'
40
40
  }
41
41
  end
@@ -0,0 +1,37 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ class BrokerageAuthorizationInstitution
15
+ REALTIME = "realtime".freeze
16
+ DELAYED = "delayed".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [REALTIME, DELAYED].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if BrokerageAuthorizationInstitution.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #BrokerageAuthorizationInstitution"
35
+ end
36
+ end
37
+ end