snaptrade 2.0.165 → 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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +36 -2
- data/lib/snaptrade/api/connections_api.rb +103 -0
- data/lib/snaptrade/models/delete_connection_confirmation.rb +228 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/connections_api_spec.rb +14 -0
- data/spec/models/delete_connection_confirmation_spec.rb +35 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8aa143629fa26cbb52541f1cd1a31499067e0e6fedae392961eacee812eb08ef
|
|
4
|
+
data.tar.gz: b25bc59d48c3d7792c9dcd05056ba29d1446c305d99ec20935ae497418cb174b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.166)
|
|
10
10
|
[](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.
|
|
90
|
+
gem 'snaptrade', '~> 2.0.166'
|
|
90
91
|
```
|
|
91
92
|
|
|
92
93
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -889,6 +890,39 @@ endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
|
889
890
|
---
|
|
890
891
|
|
|
891
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
|
+
|
|
892
926
|
### `snaptrade.connections.detail_brokerage_authorization`<a id="snaptradeconnectionsdetail_brokerage_authorization"></a>
|
|
893
927
|
|
|
894
928
|
Returns a single connection for the specified ID.
|
|
@@ -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 [`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.
|
|
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.
|
|
@@ -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
|
data/lib/snaptrade/version.rb
CHANGED
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'
|
|
@@ -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 [`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.
|
|
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.
|
|
@@ -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.
|
|
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-
|
|
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
|