spartera_api_sdk 1.0.58
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 +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +69 -0
- data/LICENSE +21 -0
- data/README.md +360 -0
- data/Rakefile +10 -0
- data/config.json +10 -0
- data/docs/APIKeysApi.md +353 -0
- data/docs/Alert.md +36 -0
- data/docs/AlertsApi.md +511 -0
- data/docs/Apikey.md +36 -0
- data/docs/Asset.md +110 -0
- data/docs/AssetPriceHistoryApi.md +573 -0
- data/docs/Assetpricehistory.md +38 -0
- data/docs/AssetsApi.md +1131 -0
- data/docs/CloudProvidersApi.md +341 -0
- data/docs/Cloudprovider.md +30 -0
- data/docs/CompaniesApi.md +619 -0
- data/docs/Company.md +44 -0
- data/docs/Connection.md +54 -0
- data/docs/ConnectionsApi.md +497 -0
- data/docs/Error.md +24 -0
- data/docs/Favorite.md +36 -0
- data/docs/FavoritesApi.md +581 -0
- data/docs/InlineObject.md +22 -0
- data/docs/InlineObject1.md +20 -0
- data/docs/InlineObject2.md +20 -0
- data/docs/InlineObject3.md +20 -0
- data/docs/User.md +34 -0
- data/docs/UsersApi.md +357 -0
- data/example.rb +51 -0
- data/git_push.sh +57 -0
- data/lib/spartera_api_sdk/api/alerts_api.rb +543 -0
- data/lib/spartera_api_sdk/api/api_keys_api.rb +345 -0
- data/lib/spartera_api_sdk/api/asset_price_history_api.rb +576 -0
- data/lib/spartera_api_sdk/api/assets_api.rb +1106 -0
- data/lib/spartera_api_sdk/api/cloud_providers_api.rb +315 -0
- data/lib/spartera_api_sdk/api/companies_api.rb +571 -0
- data/lib/spartera_api_sdk/api/connections_api.rb +501 -0
- data/lib/spartera_api_sdk/api/favorites_api.rb +610 -0
- data/lib/spartera_api_sdk/api/users_api.rb +367 -0
- data/lib/spartera_api_sdk/api_client.rb +393 -0
- data/lib/spartera_api_sdk/api_error.rb +58 -0
- data/lib/spartera_api_sdk/configuration.rb +320 -0
- data/lib/spartera_api_sdk/models/alert.rb +353 -0
- data/lib/spartera_api_sdk/models/apikey.rb +370 -0
- data/lib/spartera_api_sdk/models/asset.rb +686 -0
- data/lib/spartera_api_sdk/models/assetpricehistory.rb +345 -0
- data/lib/spartera_api_sdk/models/cloudprovider.rb +292 -0
- data/lib/spartera_api_sdk/models/company.rb +389 -0
- data/lib/spartera_api_sdk/models/connection.rb +434 -0
- data/lib/spartera_api_sdk/models/error.rb +285 -0
- data/lib/spartera_api_sdk/models/favorite.rb +353 -0
- data/lib/spartera_api_sdk/models/inline_object.rb +240 -0
- data/lib/spartera_api_sdk/models/inline_object1.rb +229 -0
- data/lib/spartera_api_sdk/models/inline_object2.rb +229 -0
- data/lib/spartera_api_sdk/models/inline_object3.rb +229 -0
- data/lib/spartera_api_sdk/models/user.rb +327 -0
- data/lib/spartera_api_sdk/version.rb +15 -0
- data/lib/spartera_api_sdk.rb +62 -0
- data/spartera_api_sdk.gemspec +28 -0
- data/spec/api/alerts_api_spec.rb +126 -0
- data/spec/api/api_keys_api_spec.rb +93 -0
- data/spec/api/asset_price_history_api_spec.rb +134 -0
- data/spec/api/assets_api_spec.rb +228 -0
- data/spec/api/cloud_providers_api_spec.rb +88 -0
- data/spec/api/companies_api_spec.rb +134 -0
- data/spec/api/connections_api_spec.rb +119 -0
- data/spec/api/favorites_api_spec.rb +138 -0
- data/spec/api/users_api_spec.rb +95 -0
- data/spec/models/alert_spec.rb +90 -0
- data/spec/models/apikey_spec.rb +90 -0
- data/spec/models/asset_spec.rb +312 -0
- data/spec/models/assetpricehistory_spec.rb +96 -0
- data/spec/models/cloudprovider_spec.rb +72 -0
- data/spec/models/company_spec.rb +114 -0
- data/spec/models/connection_spec.rb +144 -0
- data/spec/models/error_spec.rb +54 -0
- data/spec/models/favorite_spec.rb +90 -0
- data/spec/models/inline_object1_spec.rb +42 -0
- data/spec/models/inline_object2_spec.rb +42 -0
- data/spec/models/inline_object3_spec.rb +42 -0
- data/spec/models/inline_object_spec.rb +48 -0
- data/spec/models/user_spec.rb +84 -0
- data/spec/spec_helper.rb +111 -0
- data/test.sh +42 -0
- metadata +204 -0
@@ -0,0 +1,576 @@
|
|
1
|
+
=begin
|
2
|
+
#Spartera API Documentation
|
3
|
+
|
4
|
+
#Auto-generated API documentation for REST services of the Spartera platform
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.0.0
|
7
|
+
Contact: support@spartera.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.13.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module SparteraApiSdk
|
16
|
+
class AssetPriceHistoryApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get the currently active price for an asset
|
23
|
+
# @param company_id [String]
|
24
|
+
# @param asset_id [String]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Object]
|
27
|
+
def companies_company_id_assets_asset_id_prices_active_get(company_id, asset_id, opts = {})
|
28
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_active_get_with_http_info(company_id, asset_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get the currently active price for an asset
|
33
|
+
# @param company_id [String]
|
34
|
+
# @param asset_id [String]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
37
|
+
def companies_company_id_assets_asset_id_prices_active_get_with_http_info(company_id, asset_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_active_get ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'company_id' is set
|
42
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_active_get"
|
44
|
+
end
|
45
|
+
# verify the required parameter 'asset_id' is set
|
46
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_active_get"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/active'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
|
55
|
+
# header parameters
|
56
|
+
header_params = opts[:header_params] || {}
|
57
|
+
# HTTP header 'Accept' (if needed)
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
59
|
+
|
60
|
+
# form parameters
|
61
|
+
form_params = opts[:form_params] || {}
|
62
|
+
|
63
|
+
# http body (model)
|
64
|
+
post_body = opts[:debug_body]
|
65
|
+
|
66
|
+
# return_type
|
67
|
+
return_type = opts[:debug_return_type] || 'Object'
|
68
|
+
|
69
|
+
# auth_names
|
70
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
71
|
+
|
72
|
+
new_options = opts.merge(
|
73
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_active_get",
|
74
|
+
:header_params => header_params,
|
75
|
+
:query_params => query_params,
|
76
|
+
:form_params => form_params,
|
77
|
+
:body => post_body,
|
78
|
+
:auth_names => auth_names,
|
79
|
+
:return_type => return_type
|
80
|
+
)
|
81
|
+
|
82
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
83
|
+
if @api_client.config.debugging
|
84
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_active_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
85
|
+
end
|
86
|
+
return data, status_code, headers
|
87
|
+
end
|
88
|
+
|
89
|
+
# Delete single price history record by ID
|
90
|
+
# @param company_id [String]
|
91
|
+
# @param asset_id [String]
|
92
|
+
# @param aph_id [String]
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [Object]
|
95
|
+
def companies_company_id_assets_asset_id_prices_aph_id_delete(company_id, asset_id, aph_id, opts = {})
|
96
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_aph_id_delete_with_http_info(company_id, asset_id, aph_id, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Delete single price history record by ID
|
101
|
+
# @param company_id [String]
|
102
|
+
# @param asset_id [String]
|
103
|
+
# @param aph_id [String]
|
104
|
+
# @param [Hash] opts the optional parameters
|
105
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
106
|
+
def companies_company_id_assets_asset_id_prices_aph_id_delete_with_http_info(company_id, asset_id, aph_id, opts = {})
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_delete ...'
|
109
|
+
end
|
110
|
+
# verify the required parameter 'company_id' is set
|
111
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
112
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_delete"
|
113
|
+
end
|
114
|
+
# verify the required parameter 'asset_id' is set
|
115
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_delete"
|
117
|
+
end
|
118
|
+
# verify the required parameter 'aph_id' is set
|
119
|
+
if @api_client.config.client_side_validation && aph_id.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'aph_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_delete"
|
121
|
+
end
|
122
|
+
# resource path
|
123
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/{aph_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'aph_id' + '}', CGI.escape(aph_id.to_s))
|
124
|
+
|
125
|
+
# query parameters
|
126
|
+
query_params = opts[:query_params] || {}
|
127
|
+
|
128
|
+
# header parameters
|
129
|
+
header_params = opts[:header_params] || {}
|
130
|
+
# HTTP header 'Accept' (if needed)
|
131
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
132
|
+
|
133
|
+
# form parameters
|
134
|
+
form_params = opts[:form_params] || {}
|
135
|
+
|
136
|
+
# http body (model)
|
137
|
+
post_body = opts[:debug_body]
|
138
|
+
|
139
|
+
# return_type
|
140
|
+
return_type = opts[:debug_return_type] || 'Object'
|
141
|
+
|
142
|
+
# auth_names
|
143
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
144
|
+
|
145
|
+
new_options = opts.merge(
|
146
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_delete",
|
147
|
+
:header_params => header_params,
|
148
|
+
:query_params => query_params,
|
149
|
+
:form_params => form_params,
|
150
|
+
:body => post_body,
|
151
|
+
:auth_names => auth_names,
|
152
|
+
:return_type => return_type
|
153
|
+
)
|
154
|
+
|
155
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_aph_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
158
|
+
end
|
159
|
+
return data, status_code, headers
|
160
|
+
end
|
161
|
+
|
162
|
+
# Get single price history record by ID
|
163
|
+
# @param company_id [String]
|
164
|
+
# @param asset_id [String]
|
165
|
+
# @param aph_id [String]
|
166
|
+
# @param [Hash] opts the optional parameters
|
167
|
+
# @return [Object]
|
168
|
+
def companies_company_id_assets_asset_id_prices_aph_id_get(company_id, asset_id, aph_id, opts = {})
|
169
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_aph_id_get_with_http_info(company_id, asset_id, aph_id, opts)
|
170
|
+
data
|
171
|
+
end
|
172
|
+
|
173
|
+
# Get single price history record by ID
|
174
|
+
# @param company_id [String]
|
175
|
+
# @param asset_id [String]
|
176
|
+
# @param aph_id [String]
|
177
|
+
# @param [Hash] opts the optional parameters
|
178
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
179
|
+
def companies_company_id_assets_asset_id_prices_aph_id_get_with_http_info(company_id, asset_id, aph_id, opts = {})
|
180
|
+
if @api_client.config.debugging
|
181
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_get ...'
|
182
|
+
end
|
183
|
+
# verify the required parameter 'company_id' is set
|
184
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_get"
|
186
|
+
end
|
187
|
+
# verify the required parameter 'asset_id' is set
|
188
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
189
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_get"
|
190
|
+
end
|
191
|
+
# verify the required parameter 'aph_id' is set
|
192
|
+
if @api_client.config.client_side_validation && aph_id.nil?
|
193
|
+
fail ArgumentError, "Missing the required parameter 'aph_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_get"
|
194
|
+
end
|
195
|
+
# resource path
|
196
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/{aph_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'aph_id' + '}', CGI.escape(aph_id.to_s))
|
197
|
+
|
198
|
+
# query parameters
|
199
|
+
query_params = opts[:query_params] || {}
|
200
|
+
|
201
|
+
# header parameters
|
202
|
+
header_params = opts[:header_params] || {}
|
203
|
+
# HTTP header 'Accept' (if needed)
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
205
|
+
|
206
|
+
# form parameters
|
207
|
+
form_params = opts[:form_params] || {}
|
208
|
+
|
209
|
+
# http body (model)
|
210
|
+
post_body = opts[:debug_body]
|
211
|
+
|
212
|
+
# return_type
|
213
|
+
return_type = opts[:debug_return_type] || 'Object'
|
214
|
+
|
215
|
+
# auth_names
|
216
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
217
|
+
|
218
|
+
new_options = opts.merge(
|
219
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_get",
|
220
|
+
:header_params => header_params,
|
221
|
+
:query_params => query_params,
|
222
|
+
:form_params => form_params,
|
223
|
+
:body => post_body,
|
224
|
+
:auth_names => auth_names,
|
225
|
+
:return_type => return_type
|
226
|
+
)
|
227
|
+
|
228
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
229
|
+
if @api_client.config.debugging
|
230
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_aph_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
231
|
+
end
|
232
|
+
return data, status_code, headers
|
233
|
+
end
|
234
|
+
|
235
|
+
# Update an existing price history record by ID
|
236
|
+
# @param company_id [String]
|
237
|
+
# @param asset_id [String]
|
238
|
+
# @param aph_id [String]
|
239
|
+
# @param [Hash] opts the optional parameters
|
240
|
+
# @return [Object]
|
241
|
+
def companies_company_id_assets_asset_id_prices_aph_id_patch(company_id, asset_id, aph_id, opts = {})
|
242
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_aph_id_patch_with_http_info(company_id, asset_id, aph_id, opts)
|
243
|
+
data
|
244
|
+
end
|
245
|
+
|
246
|
+
# Update an existing price history record by ID
|
247
|
+
# @param company_id [String]
|
248
|
+
# @param asset_id [String]
|
249
|
+
# @param aph_id [String]
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
252
|
+
def companies_company_id_assets_asset_id_prices_aph_id_patch_with_http_info(company_id, asset_id, aph_id, opts = {})
|
253
|
+
if @api_client.config.debugging
|
254
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_patch ...'
|
255
|
+
end
|
256
|
+
# verify the required parameter 'company_id' is set
|
257
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
258
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_patch"
|
259
|
+
end
|
260
|
+
# verify the required parameter 'asset_id' is set
|
261
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
262
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_patch"
|
263
|
+
end
|
264
|
+
# verify the required parameter 'aph_id' is set
|
265
|
+
if @api_client.config.client_side_validation && aph_id.nil?
|
266
|
+
fail ArgumentError, "Missing the required parameter 'aph_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_patch"
|
267
|
+
end
|
268
|
+
# resource path
|
269
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/{aph_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'aph_id' + '}', CGI.escape(aph_id.to_s))
|
270
|
+
|
271
|
+
# query parameters
|
272
|
+
query_params = opts[:query_params] || {}
|
273
|
+
|
274
|
+
# header parameters
|
275
|
+
header_params = opts[:header_params] || {}
|
276
|
+
# HTTP header 'Accept' (if needed)
|
277
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
278
|
+
|
279
|
+
# form parameters
|
280
|
+
form_params = opts[:form_params] || {}
|
281
|
+
|
282
|
+
# http body (model)
|
283
|
+
post_body = opts[:debug_body]
|
284
|
+
|
285
|
+
# return_type
|
286
|
+
return_type = opts[:debug_return_type] || 'Object'
|
287
|
+
|
288
|
+
# auth_names
|
289
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
290
|
+
|
291
|
+
new_options = opts.merge(
|
292
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_aph_id_patch",
|
293
|
+
:header_params => header_params,
|
294
|
+
:query_params => query_params,
|
295
|
+
:form_params => form_params,
|
296
|
+
:body => post_body,
|
297
|
+
:auth_names => auth_names,
|
298
|
+
:return_type => return_type
|
299
|
+
)
|
300
|
+
|
301
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
302
|
+
if @api_client.config.debugging
|
303
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_aph_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
304
|
+
end
|
305
|
+
return data, status_code, headers
|
306
|
+
end
|
307
|
+
|
308
|
+
# Calculate the credit equivalent for a given USD price without saving
|
309
|
+
# @param company_id [String]
|
310
|
+
# @param asset_id [String]
|
311
|
+
# @param [Hash] opts the optional parameters
|
312
|
+
# @return [Object]
|
313
|
+
def companies_company_id_assets_asset_id_prices_calculate_credits_post(company_id, asset_id, opts = {})
|
314
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_calculate_credits_post_with_http_info(company_id, asset_id, opts)
|
315
|
+
data
|
316
|
+
end
|
317
|
+
|
318
|
+
# Calculate the credit equivalent for a given USD price without saving
|
319
|
+
# @param company_id [String]
|
320
|
+
# @param asset_id [String]
|
321
|
+
# @param [Hash] opts the optional parameters
|
322
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
323
|
+
def companies_company_id_assets_asset_id_prices_calculate_credits_post_with_http_info(company_id, asset_id, opts = {})
|
324
|
+
if @api_client.config.debugging
|
325
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_calculate_credits_post ...'
|
326
|
+
end
|
327
|
+
# verify the required parameter 'company_id' is set
|
328
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
329
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_calculate_credits_post"
|
330
|
+
end
|
331
|
+
# verify the required parameter 'asset_id' is set
|
332
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
333
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_calculate_credits_post"
|
334
|
+
end
|
335
|
+
# resource path
|
336
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/calculate_credits'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
337
|
+
|
338
|
+
# query parameters
|
339
|
+
query_params = opts[:query_params] || {}
|
340
|
+
|
341
|
+
# header parameters
|
342
|
+
header_params = opts[:header_params] || {}
|
343
|
+
# HTTP header 'Accept' (if needed)
|
344
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
345
|
+
|
346
|
+
# form parameters
|
347
|
+
form_params = opts[:form_params] || {}
|
348
|
+
|
349
|
+
# http body (model)
|
350
|
+
post_body = opts[:debug_body]
|
351
|
+
|
352
|
+
# return_type
|
353
|
+
return_type = opts[:debug_return_type] || 'Object'
|
354
|
+
|
355
|
+
# auth_names
|
356
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
357
|
+
|
358
|
+
new_options = opts.merge(
|
359
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_calculate_credits_post",
|
360
|
+
:header_params => header_params,
|
361
|
+
:query_params => query_params,
|
362
|
+
:form_params => form_params,
|
363
|
+
:body => post_body,
|
364
|
+
:auth_names => auth_names,
|
365
|
+
:return_type => return_type
|
366
|
+
)
|
367
|
+
|
368
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
369
|
+
if @api_client.config.debugging
|
370
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_calculate_credits_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
371
|
+
end
|
372
|
+
return data, status_code, headers
|
373
|
+
end
|
374
|
+
|
375
|
+
# Apply a discount to the active price for an asset
|
376
|
+
# @param company_id [String]
|
377
|
+
# @param asset_id [String]
|
378
|
+
# @param [Hash] opts the optional parameters
|
379
|
+
# @return [Object]
|
380
|
+
def companies_company_id_assets_asset_id_prices_discount_post(company_id, asset_id, opts = {})
|
381
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_discount_post_with_http_info(company_id, asset_id, opts)
|
382
|
+
data
|
383
|
+
end
|
384
|
+
|
385
|
+
# Apply a discount to the active price for an asset
|
386
|
+
# @param company_id [String]
|
387
|
+
# @param asset_id [String]
|
388
|
+
# @param [Hash] opts the optional parameters
|
389
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
390
|
+
def companies_company_id_assets_asset_id_prices_discount_post_with_http_info(company_id, asset_id, opts = {})
|
391
|
+
if @api_client.config.debugging
|
392
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_discount_post ...'
|
393
|
+
end
|
394
|
+
# verify the required parameter 'company_id' is set
|
395
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
396
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_discount_post"
|
397
|
+
end
|
398
|
+
# verify the required parameter 'asset_id' is set
|
399
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
400
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_discount_post"
|
401
|
+
end
|
402
|
+
# resource path
|
403
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices/discount'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
404
|
+
|
405
|
+
# query parameters
|
406
|
+
query_params = opts[:query_params] || {}
|
407
|
+
|
408
|
+
# header parameters
|
409
|
+
header_params = opts[:header_params] || {}
|
410
|
+
# HTTP header 'Accept' (if needed)
|
411
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
412
|
+
|
413
|
+
# form parameters
|
414
|
+
form_params = opts[:form_params] || {}
|
415
|
+
|
416
|
+
# http body (model)
|
417
|
+
post_body = opts[:debug_body]
|
418
|
+
|
419
|
+
# return_type
|
420
|
+
return_type = opts[:debug_return_type] || 'Object'
|
421
|
+
|
422
|
+
# auth_names
|
423
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
424
|
+
|
425
|
+
new_options = opts.merge(
|
426
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_discount_post",
|
427
|
+
:header_params => header_params,
|
428
|
+
:query_params => query_params,
|
429
|
+
:form_params => form_params,
|
430
|
+
:body => post_body,
|
431
|
+
:auth_names => auth_names,
|
432
|
+
:return_type => return_type
|
433
|
+
)
|
434
|
+
|
435
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
436
|
+
if @api_client.config.debugging
|
437
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_discount_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
438
|
+
end
|
439
|
+
return data, status_code, headers
|
440
|
+
end
|
441
|
+
|
442
|
+
# Get all price history records for a specific asset
|
443
|
+
# @param company_id [String]
|
444
|
+
# @param asset_id [String]
|
445
|
+
# @param [Hash] opts the optional parameters
|
446
|
+
# @return [Object]
|
447
|
+
def companies_company_id_assets_asset_id_prices_get(company_id, asset_id, opts = {})
|
448
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_get_with_http_info(company_id, asset_id, opts)
|
449
|
+
data
|
450
|
+
end
|
451
|
+
|
452
|
+
# Get all price history records for a specific asset
|
453
|
+
# @param company_id [String]
|
454
|
+
# @param asset_id [String]
|
455
|
+
# @param [Hash] opts the optional parameters
|
456
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
457
|
+
def companies_company_id_assets_asset_id_prices_get_with_http_info(company_id, asset_id, opts = {})
|
458
|
+
if @api_client.config.debugging
|
459
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_get ...'
|
460
|
+
end
|
461
|
+
# verify the required parameter 'company_id' is set
|
462
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
463
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_get"
|
464
|
+
end
|
465
|
+
# verify the required parameter 'asset_id' is set
|
466
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
467
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_get"
|
468
|
+
end
|
469
|
+
# resource path
|
470
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
471
|
+
|
472
|
+
# query parameters
|
473
|
+
query_params = opts[:query_params] || {}
|
474
|
+
|
475
|
+
# header parameters
|
476
|
+
header_params = opts[:header_params] || {}
|
477
|
+
# HTTP header 'Accept' (if needed)
|
478
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
479
|
+
|
480
|
+
# form parameters
|
481
|
+
form_params = opts[:form_params] || {}
|
482
|
+
|
483
|
+
# http body (model)
|
484
|
+
post_body = opts[:debug_body]
|
485
|
+
|
486
|
+
# return_type
|
487
|
+
return_type = opts[:debug_return_type] || 'Object'
|
488
|
+
|
489
|
+
# auth_names
|
490
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
491
|
+
|
492
|
+
new_options = opts.merge(
|
493
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_get",
|
494
|
+
:header_params => header_params,
|
495
|
+
:query_params => query_params,
|
496
|
+
:form_params => form_params,
|
497
|
+
:body => post_body,
|
498
|
+
:auth_names => auth_names,
|
499
|
+
:return_type => return_type
|
500
|
+
)
|
501
|
+
|
502
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
503
|
+
if @api_client.config.debugging
|
504
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
505
|
+
end
|
506
|
+
return data, status_code, headers
|
507
|
+
end
|
508
|
+
|
509
|
+
# Create a new price history record for an asset
|
510
|
+
# @param company_id [String]
|
511
|
+
# @param asset_id [String]
|
512
|
+
# @param [Hash] opts the optional parameters
|
513
|
+
# @return [Object]
|
514
|
+
def companies_company_id_assets_asset_id_prices_post(company_id, asset_id, opts = {})
|
515
|
+
data, _status_code, _headers = companies_company_id_assets_asset_id_prices_post_with_http_info(company_id, asset_id, opts)
|
516
|
+
data
|
517
|
+
end
|
518
|
+
|
519
|
+
# Create a new price history record for an asset
|
520
|
+
# @param company_id [String]
|
521
|
+
# @param asset_id [String]
|
522
|
+
# @param [Hash] opts the optional parameters
|
523
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
524
|
+
def companies_company_id_assets_asset_id_prices_post_with_http_info(company_id, asset_id, opts = {})
|
525
|
+
if @api_client.config.debugging
|
526
|
+
@api_client.config.logger.debug 'Calling API: AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_post ...'
|
527
|
+
end
|
528
|
+
# verify the required parameter 'company_id' is set
|
529
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
530
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_post"
|
531
|
+
end
|
532
|
+
# verify the required parameter 'asset_id' is set
|
533
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
534
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_post"
|
535
|
+
end
|
536
|
+
# resource path
|
537
|
+
local_var_path = '/companies/{company_id}/assets/{asset_id}/prices'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
538
|
+
|
539
|
+
# query parameters
|
540
|
+
query_params = opts[:query_params] || {}
|
541
|
+
|
542
|
+
# header parameters
|
543
|
+
header_params = opts[:header_params] || {}
|
544
|
+
# HTTP header 'Accept' (if needed)
|
545
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
546
|
+
|
547
|
+
# form parameters
|
548
|
+
form_params = opts[:form_params] || {}
|
549
|
+
|
550
|
+
# http body (model)
|
551
|
+
post_body = opts[:debug_body]
|
552
|
+
|
553
|
+
# return_type
|
554
|
+
return_type = opts[:debug_return_type] || 'Object'
|
555
|
+
|
556
|
+
# auth_names
|
557
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
558
|
+
|
559
|
+
new_options = opts.merge(
|
560
|
+
:operation => :"AssetPriceHistoryApi.companies_company_id_assets_asset_id_prices_post",
|
561
|
+
:header_params => header_params,
|
562
|
+
:query_params => query_params,
|
563
|
+
:form_params => form_params,
|
564
|
+
:body => post_body,
|
565
|
+
:auth_names => auth_names,
|
566
|
+
:return_type => return_type
|
567
|
+
)
|
568
|
+
|
569
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
570
|
+
if @api_client.config.debugging
|
571
|
+
@api_client.config.logger.debug "API called: AssetPriceHistoryApi#companies_company_id_assets_asset_id_prices_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
572
|
+
end
|
573
|
+
return data, status_code, headers
|
574
|
+
end
|
575
|
+
end
|
576
|
+
end
|