snaptrade 2.0.164 → 2.0.166

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: 6aee2776cc7b4ec7d0cbac4053f65dab85369751532b9f393b2b4c789d53d24f
4
- data.tar.gz: 40443d9b818a57d31157d5787d1b0165f9947d269c7fcf054a0c3ed99a88fe19
3
+ metadata.gz: 8aa143629fa26cbb52541f1cd1a31499067e0e6fedae392961eacee812eb08ef
4
+ data.tar.gz: b25bc59d48c3d7792c9dcd05056ba29d1446c305d99ec20935ae497418cb174b
5
5
  SHA512:
6
- metadata.gz: ca2eb20e98539f3d56878d33f5de544b30d9583cb8b75e487633314dae0388768719bcb2a9f01d752a42dc246f02499c26d5acaf50871385311889a438d1dda7
7
- data.tar.gz: dab02c2aef92ac040d17cd48ca4fc1013a2e75f5c5e0710b976e92eb4176a090bbcd17ec24003311c3eedd2b2125022e02aec0ddbaed66306347f166e9417752
6
+ metadata.gz: 45bb7b21ad3c1406712b949aad0908d2948d64703f6c27559e15ac189daafbed8b622260969962fc5793617304362d221d211cc875f84816048eae319a863b54
7
+ data.tar.gz: 1bd606a59657cdf5e6b0a5c6d6693c94fa66805c4bb3d33e948dfa90d6178151daaf99ca594c58d2d285158cb060ecd62498c4c42edcab8facb297f2c72c3278
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.164)
4
+ snaptrade (2.0.166)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -55,7 +55,7 @@ GEM
55
55
  rspec-expectations (3.13.5)
56
56
  diff-lcs (>= 1.2.0, < 2.0)
57
57
  rspec-support (~> 3.13.0)
58
- rspec-mocks (3.13.7)
58
+ rspec-mocks (3.13.8)
59
59
  diff-lcs (>= 1.2.0, < 2.0)
60
60
  rspec-support (~> 3.13.0)
61
61
  rspec-support (3.13.7)
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v2.0.164-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.164)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.166-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.166)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -37,6 +37,7 @@ Connect brokerage accounts to your app for live positions and trading
37
37
  * [`snaptrade.authentication.login_snap_trade_user`](#snaptradeauthenticationlogin_snap_trade_user)
38
38
  * [`snaptrade.authentication.register_snap_trade_user`](#snaptradeauthenticationregister_snap_trade_user)
39
39
  * [`snaptrade.authentication.reset_snap_trade_user_secret`](#snaptradeauthenticationreset_snap_trade_user_secret)
40
+ * [`snaptrade.connections.delete_connection`](#snaptradeconnectionsdelete_connection)
40
41
  * [`snaptrade.connections.detail_brokerage_authorization`](#snaptradeconnectionsdetail_brokerage_authorization)
41
42
  * [`snaptrade.connections.disable_brokerage_authorization`](#snaptradeconnectionsdisable_brokerage_authorization)
42
43
  * [`snaptrade.connections.list_brokerage_authorizations`](#snaptradeconnectionslist_brokerage_authorizations)
@@ -86,7 +87,7 @@ Connect brokerage accounts to your app for live positions and trading
86
87
  Add to Gemfile:
87
88
 
88
89
  ```ruby
89
- gem 'snaptrade', '~> 2.0.164'
90
+ gem 'snaptrade', '~> 2.0.166'
90
91
  ```
91
92
 
92
93
  ## Getting Started<a id="getting-started"></a>
@@ -588,9 +589,11 @@ p result
588
589
 
589
590
  Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
590
591
 
592
+ Please note that this data is cached and only refreshed once a day.
593
+
591
594
  Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
592
- - If you do, this endpoint returns real-time data.
593
- - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
595
+ - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
596
+ - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
594
597
 
595
598
 
596
599
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -887,6 +890,39 @@ endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
887
890
  ---
888
891
 
889
892
 
893
+ ### `snaptrade.connections.delete_connection`<a id="snaptradeconnectionsdelete_connection"></a>
894
+
895
+ Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
896
+
897
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
898
+
899
+ ```ruby
900
+ result = snaptrade.connections.delete_connection(
901
+ connection_id: "87b24961-b51e-4db8-9226-f198f6518a89",
902
+ user_id: "snaptrade-user-123",
903
+ user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
904
+ )
905
+ p result
906
+ ```
907
+
908
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
909
+
910
+ ##### connection_id: `String`<a id="connection_id-string"></a>
911
+ ##### user_id: `String`<a id="user_id-string"></a>
912
+ ##### user_secret: `String`<a id="user_secret-string"></a>
913
+ #### 🔄 Return<a id="🔄-return"></a>
914
+
915
+ [DeleteConnectionConfirmation](./lib/snaptrade/models/delete_connection_confirmation.rb)
916
+
917
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
918
+
919
+ `/connection/{connectionId}` `DELETE`
920
+
921
+ [🔙 **Back to Table of Contents**](#table-of-contents)
922
+
923
+ ---
924
+
925
+
890
926
  ### `snaptrade.connections.detail_brokerage_authorization`<a id="snaptradeconnectionsdetail_brokerage_authorization"></a>
891
927
 
892
928
  Returns a single connection for the specified ID.
@@ -1243,9 +1243,11 @@ module SnapTrade
1243
1243
  #
1244
1244
  # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
1245
1245
  #
1246
+ # Please note that this data is cached and only refreshed once a day.
1247
+ #
1246
1248
  # Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
1247
- # - If you do, this endpoint returns real-time data.
1248
- # - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
1249
+ # - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
1250
+ # - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
1249
1251
  #
1250
1252
  # @param user_id [String]
1251
1253
  # @param user_secret [String]
@@ -1259,9 +1261,11 @@ module SnapTrade
1259
1261
  #
1260
1262
  # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
1261
1263
  #
1264
+ # Please note that this data is cached and only refreshed once a day.
1265
+ #
1262
1266
  # Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
1263
- # - If you do, this endpoint returns real-time data.
1264
- # - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
1267
+ # - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
1268
+ # - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
1265
1269
  #
1266
1270
  # @param user_id [String]
1267
1271
  # @param user_secret [String]
@@ -1271,7 +1275,7 @@ module SnapTrade
1271
1275
  end
1272
1276
 
1273
1277
  # List accounts
1274
- # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
1278
+ # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
1275
1279
  # @param user_id [String]
1276
1280
  # @param user_secret [String]
1277
1281
  # @param [Hash] opts the optional parameters
@@ -1282,7 +1286,7 @@ module SnapTrade
1282
1286
  end
1283
1287
 
1284
1288
  # List accounts
1285
- # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don&#39;t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
1289
+ # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don&#39;t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
1286
1290
  # @param user_id [String]
1287
1291
  # @param user_secret [String]
1288
1292
  # @param [Hash] opts the optional parameters
@@ -17,6 +17,109 @@ module SnapTrade
17
17
  @api_client = api_client
18
18
  end
19
19
 
20
+ # Delete connection
21
+ #
22
+ # Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
23
+ #
24
+ # @param connection_id [String]
25
+ # @param user_id [String]
26
+ # @param user_secret [String]
27
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
28
+ def delete_connection(connection_id:, user_id:, user_secret:, extra: {})
29
+ data, _status_code, _headers = delete_connection_with_http_info_impl(connection_id, user_id, user_secret, extra)
30
+ data
31
+ end
32
+
33
+ # Delete connection
34
+ #
35
+ # Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
36
+ #
37
+ # @param connection_id [String]
38
+ # @param user_id [String]
39
+ # @param user_secret [String]
40
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
41
+ def delete_connection_with_http_info(connection_id:, user_id:, user_secret:, extra: {})
42
+ delete_connection_with_http_info_impl(connection_id, user_id, user_secret, extra)
43
+ end
44
+
45
+ # Delete connection
46
+ # Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
47
+ # @param connection_id [String]
48
+ # @param user_id [String]
49
+ # @param user_secret [String]
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [DeleteConnectionConfirmation]
52
+ private def delete_connection_impl(connection_id, user_id, user_secret, opts = {})
53
+ data, _status_code, _headers = delete_connection_with_http_info(connection_id, user_id, user_secret, opts)
54
+ data
55
+ end
56
+
57
+ # Delete connection
58
+ # Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [&#x60;CONNECTION_DELETED&#x60; webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
59
+ # @param connection_id [String]
60
+ # @param user_id [String]
61
+ # @param user_secret [String]
62
+ # @param [Hash] opts the optional parameters
63
+ # @return [Array<(DeleteConnectionConfirmation, Integer, Hash)>] DeleteConnectionConfirmation data, response status code and response headers
64
+ private def delete_connection_with_http_info_impl(connection_id, user_id, user_secret, opts = {})
65
+ if @api_client.config.debugging
66
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.delete_connection ...'
67
+ end
68
+ # verify the required parameter 'connection_id' is set
69
+ if @api_client.config.client_side_validation && connection_id.nil?
70
+ fail ArgumentError, "Missing the required parameter 'connection_id' when calling ConnectionsApi.delete_connection"
71
+ end
72
+ # verify the required parameter 'user_id' is set
73
+ if @api_client.config.client_side_validation && user_id.nil?
74
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConnectionsApi.delete_connection"
75
+ end
76
+ # verify the required parameter 'user_secret' is set
77
+ if @api_client.config.client_side_validation && user_secret.nil?
78
+ fail ArgumentError, "Missing the required parameter 'user_secret' when calling ConnectionsApi.delete_connection"
79
+ end
80
+ # resource path
81
+ local_var_path = '/connection/{connectionId}'.sub('{' + 'connectionId' + '}', CGI.escape(connection_id.to_s))
82
+
83
+ # query parameters
84
+ query_params = opts[:query_params] || {}
85
+ query_params[:'userId'] = user_id
86
+ query_params[:'userSecret'] = user_secret
87
+
88
+ # header parameters
89
+ header_params = opts[:header_params] || {}
90
+ # HTTP header 'Accept' (if needed)
91
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
92
+
93
+ # form parameters
94
+ form_params = opts[:form_params] || {}
95
+
96
+ # http body (model)
97
+ post_body = opts[:debug_body]
98
+
99
+ # return_type
100
+ return_type = opts[:debug_return_type] || 'DeleteConnectionConfirmation'
101
+
102
+ # auth_names
103
+ auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
104
+
105
+ new_options = opts.merge(
106
+ :operation => :"ConnectionsApi.delete_connection",
107
+ :header_params => header_params,
108
+ :query_params => query_params,
109
+ :form_params => form_params,
110
+ :body => post_body,
111
+ :auth_names => auth_names,
112
+ :return_type => return_type
113
+ )
114
+
115
+ data, status_code, headers, response = @api_client.call_api(:DELETE, local_var_path, new_options)
116
+ if @api_client.config.debugging
117
+ @api_client.config.logger.debug "API called: ConnectionsApi#delete_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
118
+ end
119
+ return data, status_code, headers, response
120
+ end
121
+
122
+
20
123
  # Get connection detail
21
124
  #
22
125
  # Returns a single connection for the specified ID.
@@ -25,6 +25,9 @@ module SnapTrade
25
25
  # The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons.
26
26
  attr_accessor :number
27
27
 
28
+ # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same brokerage account across multiple connections.
29
+ attr_accessor :institution_account_id
30
+
28
31
  # The name of the brokerage that holds the account.
29
32
  attr_accessor :institution_name
30
33
 
@@ -66,6 +69,7 @@ module SnapTrade
66
69
  :'brokerage_authorization' => :'brokerage_authorization',
67
70
  :'name' => :'name',
68
71
  :'number' => :'number',
72
+ :'institution_account_id' => :'institution_account_id',
69
73
  :'institution_name' => :'institution_name',
70
74
  :'created_date' => :'created_date',
71
75
  :'funding_date' => :'funding_date',
@@ -93,6 +97,7 @@ module SnapTrade
93
97
  :'brokerage_authorization' => :'String',
94
98
  :'name' => :'String',
95
99
  :'number' => :'String',
100
+ :'institution_account_id' => :'String',
96
101
  :'institution_name' => :'String',
97
102
  :'created_date' => :'Time',
98
103
  :'funding_date' => :'Time',
@@ -112,6 +117,7 @@ module SnapTrade
112
117
  def self.openapi_nullable
113
118
  Set.new([
114
119
  :'name',
120
+ :'institution_account_id',
115
121
  :'funding_date',
116
122
  :'opening_date',
117
123
  :'status',
@@ -150,6 +156,10 @@ module SnapTrade
150
156
  self.number = attributes[:'number']
151
157
  end
152
158
 
159
+ if attributes.key?(:'institution_account_id')
160
+ self.institution_account_id = attributes[:'institution_account_id']
161
+ end
162
+
153
163
  if attributes.key?(:'institution_name')
154
164
  self.institution_name = attributes[:'institution_name']
155
165
  end
@@ -265,6 +275,7 @@ module SnapTrade
265
275
  brokerage_authorization == o.brokerage_authorization &&
266
276
  name == o.name &&
267
277
  number == o.number &&
278
+ institution_account_id == o.institution_account_id &&
268
279
  institution_name == o.institution_name &&
269
280
  created_date == o.created_date &&
270
281
  funding_date == o.funding_date &&
@@ -288,7 +299,7 @@ module SnapTrade
288
299
  # Calculates hash code according to all attributes.
289
300
  # @return [Integer] Hash code
290
301
  def hash
291
- [id, brokerage_authorization, name, number, institution_name, created_date, funding_date, opening_date, sync_status, balance, status, raw_type, meta, portfolio_group, cash_restrictions, is_paper].hash
302
+ [id, brokerage_authorization, name, number, institution_account_id, institution_name, created_date, funding_date, opening_date, sync_status, balance, status, raw_type, meta, portfolio_group, cash_restrictions, is_paper].hash
292
303
  end
293
304
 
294
305
  # Builds the object from hash
@@ -22,6 +22,9 @@ module SnapTrade
22
22
  # The account number assigned by the brokerage. For some brokerages, this field may be masked for security reasons.
23
23
  attr_accessor :number
24
24
 
25
+ # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same brokerage account across multiple connections.
26
+ attr_accessor :institution_account_id
27
+
25
28
  attr_accessor :sync_status
26
29
 
27
30
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -30,6 +33,7 @@ module SnapTrade
30
33
  :'id' => :'id',
31
34
  :'name' => :'name',
32
35
  :'number' => :'number',
36
+ :'institution_account_id' => :'institution_account_id',
33
37
  :'sync_status' => :'sync_status'
34
38
  }
35
39
  end
@@ -45,6 +49,7 @@ module SnapTrade
45
49
  :'id' => :'String',
46
50
  :'name' => :'String',
47
51
  :'number' => :'String',
52
+ :'institution_account_id' => :'String',
48
53
  :'sync_status' => :'AccountSyncStatus'
49
54
  }
50
55
  end
@@ -52,6 +57,7 @@ module SnapTrade
52
57
  # List of attributes with nullable: true
53
58
  def self.openapi_nullable
54
59
  Set.new([
60
+ :'institution_account_id',
55
61
  ])
56
62
  end
57
63
 
@@ -82,6 +88,10 @@ module SnapTrade
82
88
  self.number = attributes[:'number']
83
89
  end
84
90
 
91
+ if attributes.key?(:'institution_account_id')
92
+ self.institution_account_id = attributes[:'institution_account_id']
93
+ end
94
+
85
95
  if attributes.key?(:'sync_status')
86
96
  self.sync_status = attributes[:'sync_status']
87
97
  end
@@ -108,6 +118,7 @@ module SnapTrade
108
118
  id == o.id &&
109
119
  name == o.name &&
110
120
  number == o.number &&
121
+ institution_account_id == o.institution_account_id &&
111
122
  sync_status == o.sync_status
112
123
  end
113
124
 
@@ -120,7 +131,7 @@ module SnapTrade
120
131
  # Calculates hash code according to all attributes.
121
132
  # @return [Integer] Hash code
122
133
  def hash
123
- [id, name, number, sync_status].hash
134
+ [id, name, number, institution_account_id, sync_status].hash
124
135
  end
125
136
 
126
137
  # Builds the object from hash
@@ -0,0 +1,228 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ # Confirmation that a task has been scheduled to delete the connection.
15
+ class DeleteConnectionConfirmation
16
+ # Connection queued for deletion; please wait for webhook for confirmation.
17
+ attr_accessor :detail
18
+
19
+ # The ID of the connection (brokerage authorization) that was scheduled for deletion.
20
+ attr_accessor :connection_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'detail' => :'detail',
26
+ :'connection_id' => :'connection_id'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'detail' => :'String',
39
+ :'connection_id' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::DeleteConnectionConfirmation` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::DeleteConnectionConfirmation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'detail')
65
+ self.detail = attributes[:'detail']
66
+ end
67
+
68
+ if attributes.key?(:'connection_id')
69
+ self.connection_id = attributes[:'connection_id']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ detail == o.detail &&
92
+ connection_id == o.connection_id
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [detail, connection_id].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = SnapTrade.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -8,5 +8,5 @@ Contact: api@snaptrade.com
8
8
  =end
9
9
 
10
10
  module SnapTrade
11
- VERSION = '2.0.164'
11
+ VERSION = '2.0.166'
12
12
  end
data/lib/snaptrade.rb CHANGED
@@ -71,6 +71,7 @@ require 'snaptrade/models/crypto_trading_instrument_type'
71
71
  require 'snaptrade/models/cryptocurrency_pair'
72
72
  require 'snaptrade/models/cryptocurrency_pair_quote'
73
73
  require 'snaptrade/models/currency'
74
+ require 'snaptrade/models/delete_connection_confirmation'
74
75
  require 'snaptrade/models/delete_user_response'
75
76
  require 'snaptrade/models/dividend_at_date'
76
77
  require 'snaptrade/models/encrypted_response'
@@ -178,7 +178,7 @@ describe 'AccountInformationApi' do
178
178
 
179
179
  # unit tests for list_user_accounts
180
180
  # List accounts
181
- # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don&#39;t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
181
+ # Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don&#39;t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
182
182
  # @param user_id
183
183
  # @param user_secret
184
184
  # @param [Hash] opts the optional parameters
@@ -27,6 +27,20 @@ describe 'ConnectionsApi' do
27
27
  end
28
28
  end
29
29
 
30
+ # unit tests for delete_connection
31
+ # Delete connection
32
+ # Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [&#x60;CONNECTION_DELETED&#x60; webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
33
+ # @param connection_id
34
+ # @param user_id
35
+ # @param user_secret
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [DeleteConnectionConfirmation]
38
+ describe 'delete_connection test' do
39
+ it 'should work' do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
30
44
  # unit tests for detail_brokerage_authorization
31
45
  # Get connection detail
32
46
  # Returns a single connection for the specified ID.
@@ -38,6 +38,12 @@ describe SnapTrade::AccountSimple do
38
38
  end
39
39
  end
40
40
 
41
+ describe 'test attribute "institution_account_id"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
41
47
  describe 'test attribute "sync_status"' do
42
48
  it 'should work' do
43
49
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -44,6 +44,12 @@ describe SnapTrade::Account do
44
44
  end
45
45
  end
46
46
 
47
+ describe 'test attribute "institution_account_id"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
47
53
  describe 'test attribute "institution_name"' do
48
54
  it 'should work' do
49
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -0,0 +1,35 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'spec_helper'
11
+ require 'json'
12
+ require 'date'
13
+
14
+ # Unit tests for SnapTrade::DeleteConnectionConfirmation
15
+ describe SnapTrade::DeleteConnectionConfirmation do
16
+ let(:instance) { SnapTrade::DeleteConnectionConfirmation.new }
17
+
18
+ describe 'test an instance of DeleteConnectionConfirmation' do
19
+ it 'should create an instance of DeleteConnectionConfirmation' do
20
+ expect(instance).to be_instance_of(SnapTrade::DeleteConnectionConfirmation)
21
+ end
22
+ end
23
+ describe 'test attribute "detail"' do
24
+ it 'should work' do
25
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
26
+ end
27
+ end
28
+
29
+ describe 'test attribute "connection_id"' do
30
+ it 'should work' do
31
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
32
+ end
33
+ end
34
+
35
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.164
4
+ version: 2.0.166
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-25 00:00:00.000000000 Z
11
+ date: 2026-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -151,6 +151,7 @@ files:
151
151
  - lib/snaptrade/models/cryptocurrency_pair.rb
152
152
  - lib/snaptrade/models/cryptocurrency_pair_quote.rb
153
153
  - lib/snaptrade/models/currency.rb
154
+ - lib/snaptrade/models/delete_connection_confirmation.rb
154
155
  - lib/snaptrade/models/delete_user_response.rb
155
156
  - lib/snaptrade/models/dividend_at_date.rb
156
157
  - lib/snaptrade/models/encrypted_response.rb
@@ -329,6 +330,7 @@ files:
329
330
  - spec/models/cryptocurrency_pair_quote_spec.rb
330
331
  - spec/models/cryptocurrency_pair_spec.rb
331
332
  - spec/models/currency_spec.rb
333
+ - spec/models/delete_connection_confirmation_spec.rb
332
334
  - spec/models/delete_user_response_spec.rb
333
335
  - spec/models/dividend_at_date_spec.rb
334
336
  - spec/models/encrypted_response_encrypted_message_data_spec.rb
@@ -630,6 +632,7 @@ test_files:
630
632
  - spec/models/crypto_trading_instrument_spec.rb
631
633
  - spec/models/symbol_query_spec.rb
632
634
  - spec/models/account_order_record_status_spec.rb
635
+ - spec/models/delete_connection_confirmation_spec.rb
633
636
  - spec/models/account_spec.rb
634
637
  - spec/models/crypto_trading_instrument_type_spec.rb
635
638
  - spec/models/session_event_type_spec.rb