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,543 @@
|
|
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 AlertsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete single alert by ID
|
23
|
+
# @param company_id [String]
|
24
|
+
# @param user_id [String]
|
25
|
+
# @param alert_id [String]
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [Object]
|
28
|
+
def companies_company_id_users_user_id_alerts_alert_id_delete(company_id, user_id, alert_id, opts = {})
|
29
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_alert_id_delete_with_http_info(company_id, user_id, alert_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Delete single alert by ID
|
34
|
+
# @param company_id [String]
|
35
|
+
# @param user_id [String]
|
36
|
+
# @param alert_id [String]
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
39
|
+
def companies_company_id_users_user_id_alerts_alert_id_delete_with_http_info(company_id, user_id, alert_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_alert_id_delete ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'company_id' is set
|
44
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_delete"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'user_id' is set
|
48
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_delete"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'alert_id' is set
|
52
|
+
if @api_client.config.client_side_validation && alert_id.nil?
|
53
|
+
fail ArgumentError, "Missing the required parameter 'alert_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_delete"
|
54
|
+
end
|
55
|
+
# resource path
|
56
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts/{alert_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'alert_id' + '}', CGI.escape(alert_id.to_s))
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = opts[:query_params] || {}
|
60
|
+
|
61
|
+
# header parameters
|
62
|
+
header_params = opts[:header_params] || {}
|
63
|
+
# HTTP header 'Accept' (if needed)
|
64
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
65
|
+
|
66
|
+
# form parameters
|
67
|
+
form_params = opts[:form_params] || {}
|
68
|
+
|
69
|
+
# http body (model)
|
70
|
+
post_body = opts[:debug_body]
|
71
|
+
|
72
|
+
# return_type
|
73
|
+
return_type = opts[:debug_return_type] || 'Object'
|
74
|
+
|
75
|
+
# auth_names
|
76
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
77
|
+
|
78
|
+
new_options = opts.merge(
|
79
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_alert_id_delete",
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_alert_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
91
|
+
end
|
92
|
+
return data, status_code, headers
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get single alert by ID
|
96
|
+
# @param company_id [String]
|
97
|
+
# @param user_id [String]
|
98
|
+
# @param alert_id [String]
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Object]
|
101
|
+
def companies_company_id_users_user_id_alerts_alert_id_get(company_id, user_id, alert_id, opts = {})
|
102
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_alert_id_get_with_http_info(company_id, user_id, alert_id, opts)
|
103
|
+
data
|
104
|
+
end
|
105
|
+
|
106
|
+
# Get single alert by ID
|
107
|
+
# @param company_id [String]
|
108
|
+
# @param user_id [String]
|
109
|
+
# @param alert_id [String]
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
112
|
+
def companies_company_id_users_user_id_alerts_alert_id_get_with_http_info(company_id, user_id, alert_id, opts = {})
|
113
|
+
if @api_client.config.debugging
|
114
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_alert_id_get ...'
|
115
|
+
end
|
116
|
+
# verify the required parameter 'company_id' is set
|
117
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
118
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_get"
|
119
|
+
end
|
120
|
+
# verify the required parameter 'user_id' is set
|
121
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
122
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_get"
|
123
|
+
end
|
124
|
+
# verify the required parameter 'alert_id' is set
|
125
|
+
if @api_client.config.client_side_validation && alert_id.nil?
|
126
|
+
fail ArgumentError, "Missing the required parameter 'alert_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_get"
|
127
|
+
end
|
128
|
+
# resource path
|
129
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts/{alert_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'alert_id' + '}', CGI.escape(alert_id.to_s))
|
130
|
+
|
131
|
+
# query parameters
|
132
|
+
query_params = opts[:query_params] || {}
|
133
|
+
|
134
|
+
# header parameters
|
135
|
+
header_params = opts[:header_params] || {}
|
136
|
+
# HTTP header 'Accept' (if needed)
|
137
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
138
|
+
|
139
|
+
# form parameters
|
140
|
+
form_params = opts[:form_params] || {}
|
141
|
+
|
142
|
+
# http body (model)
|
143
|
+
post_body = opts[:debug_body]
|
144
|
+
|
145
|
+
# return_type
|
146
|
+
return_type = opts[:debug_return_type] || 'Object'
|
147
|
+
|
148
|
+
# auth_names
|
149
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
150
|
+
|
151
|
+
new_options = opts.merge(
|
152
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_alert_id_get",
|
153
|
+
:header_params => header_params,
|
154
|
+
:query_params => query_params,
|
155
|
+
:form_params => form_params,
|
156
|
+
:body => post_body,
|
157
|
+
:auth_names => auth_names,
|
158
|
+
:return_type => return_type
|
159
|
+
)
|
160
|
+
|
161
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
162
|
+
if @api_client.config.debugging
|
163
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_alert_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
164
|
+
end
|
165
|
+
return data, status_code, headers
|
166
|
+
end
|
167
|
+
|
168
|
+
# Update an existing alert by ID
|
169
|
+
# @param company_id [String]
|
170
|
+
# @param user_id [String]
|
171
|
+
# @param alert_id [String]
|
172
|
+
# @param alert [Alert]
|
173
|
+
# @param [Hash] opts the optional parameters
|
174
|
+
# @return [Object]
|
175
|
+
def companies_company_id_users_user_id_alerts_alert_id_patch(company_id, user_id, alert_id, alert, opts = {})
|
176
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_alert_id_patch_with_http_info(company_id, user_id, alert_id, alert, opts)
|
177
|
+
data
|
178
|
+
end
|
179
|
+
|
180
|
+
# Update an existing alert by ID
|
181
|
+
# @param company_id [String]
|
182
|
+
# @param user_id [String]
|
183
|
+
# @param alert_id [String]
|
184
|
+
# @param alert [Alert]
|
185
|
+
# @param [Hash] opts the optional parameters
|
186
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
187
|
+
def companies_company_id_users_user_id_alerts_alert_id_patch_with_http_info(company_id, user_id, alert_id, alert, opts = {})
|
188
|
+
if @api_client.config.debugging
|
189
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch ...'
|
190
|
+
end
|
191
|
+
# verify the required parameter 'company_id' is set
|
192
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
193
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch"
|
194
|
+
end
|
195
|
+
# verify the required parameter 'user_id' is set
|
196
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
197
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch"
|
198
|
+
end
|
199
|
+
# verify the required parameter 'alert_id' is set
|
200
|
+
if @api_client.config.client_side_validation && alert_id.nil?
|
201
|
+
fail ArgumentError, "Missing the required parameter 'alert_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch"
|
202
|
+
end
|
203
|
+
# verify the required parameter 'alert' is set
|
204
|
+
if @api_client.config.client_side_validation && alert.nil?
|
205
|
+
fail ArgumentError, "Missing the required parameter 'alert' when calling AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch"
|
206
|
+
end
|
207
|
+
# resource path
|
208
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts/{alert_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'alert_id' + '}', CGI.escape(alert_id.to_s))
|
209
|
+
|
210
|
+
# query parameters
|
211
|
+
query_params = opts[:query_params] || {}
|
212
|
+
|
213
|
+
# header parameters
|
214
|
+
header_params = opts[:header_params] || {}
|
215
|
+
# HTTP header 'Accept' (if needed)
|
216
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
217
|
+
# HTTP header 'Content-Type'
|
218
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
219
|
+
if !content_type.nil?
|
220
|
+
header_params['Content-Type'] = content_type
|
221
|
+
end
|
222
|
+
|
223
|
+
# form parameters
|
224
|
+
form_params = opts[:form_params] || {}
|
225
|
+
|
226
|
+
# http body (model)
|
227
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(alert)
|
228
|
+
|
229
|
+
# return_type
|
230
|
+
return_type = opts[:debug_return_type] || 'Object'
|
231
|
+
|
232
|
+
# auth_names
|
233
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
234
|
+
|
235
|
+
new_options = opts.merge(
|
236
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_alert_id_patch",
|
237
|
+
:header_params => header_params,
|
238
|
+
:query_params => query_params,
|
239
|
+
:form_params => form_params,
|
240
|
+
:body => post_body,
|
241
|
+
:auth_names => auth_names,
|
242
|
+
:return_type => return_type
|
243
|
+
)
|
244
|
+
|
245
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_alert_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
248
|
+
end
|
249
|
+
return data, status_code, headers
|
250
|
+
end
|
251
|
+
|
252
|
+
# Get all alerts for a specific asset (from all users) This would typically be restricted to asset owners or admins
|
253
|
+
# @param company_id [String]
|
254
|
+
# @param user_id [String]
|
255
|
+
# @param asset_id [String]
|
256
|
+
# @param [Hash] opts the optional parameters
|
257
|
+
# @return [Object]
|
258
|
+
def companies_company_id_users_user_id_alerts_asset_asset_id_all_get(company_id, user_id, asset_id, opts = {})
|
259
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_asset_asset_id_all_get_with_http_info(company_id, user_id, asset_id, opts)
|
260
|
+
data
|
261
|
+
end
|
262
|
+
|
263
|
+
# Get all alerts for a specific asset (from all users) This would typically be restricted to asset owners or admins
|
264
|
+
# @param company_id [String]
|
265
|
+
# @param user_id [String]
|
266
|
+
# @param asset_id [String]
|
267
|
+
# @param [Hash] opts the optional parameters
|
268
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
269
|
+
def companies_company_id_users_user_id_alerts_asset_asset_id_all_get_with_http_info(company_id, user_id, asset_id, opts = {})
|
270
|
+
if @api_client.config.debugging
|
271
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_all_get ...'
|
272
|
+
end
|
273
|
+
# verify the required parameter 'company_id' is set
|
274
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
275
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_all_get"
|
276
|
+
end
|
277
|
+
# verify the required parameter 'user_id' is set
|
278
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
279
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_all_get"
|
280
|
+
end
|
281
|
+
# verify the required parameter 'asset_id' is set
|
282
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
283
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_all_get"
|
284
|
+
end
|
285
|
+
# resource path
|
286
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts/asset/{asset_id}/all'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
287
|
+
|
288
|
+
# query parameters
|
289
|
+
query_params = opts[:query_params] || {}
|
290
|
+
|
291
|
+
# header parameters
|
292
|
+
header_params = opts[:header_params] || {}
|
293
|
+
# HTTP header 'Accept' (if needed)
|
294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
295
|
+
|
296
|
+
# form parameters
|
297
|
+
form_params = opts[:form_params] || {}
|
298
|
+
|
299
|
+
# http body (model)
|
300
|
+
post_body = opts[:debug_body]
|
301
|
+
|
302
|
+
# return_type
|
303
|
+
return_type = opts[:debug_return_type] || 'Object'
|
304
|
+
|
305
|
+
# auth_names
|
306
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
307
|
+
|
308
|
+
new_options = opts.merge(
|
309
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_all_get",
|
310
|
+
:header_params => header_params,
|
311
|
+
:query_params => query_params,
|
312
|
+
:form_params => form_params,
|
313
|
+
:body => post_body,
|
314
|
+
:auth_names => auth_names,
|
315
|
+
:return_type => return_type
|
316
|
+
)
|
317
|
+
|
318
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
319
|
+
if @api_client.config.debugging
|
320
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_asset_asset_id_all_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
321
|
+
end
|
322
|
+
return data, status_code, headers
|
323
|
+
end
|
324
|
+
|
325
|
+
# Get all alerts for a specific asset by the specified user Useful for checking if user already has an alert set up for an asset
|
326
|
+
# @param company_id [String]
|
327
|
+
# @param user_id [String]
|
328
|
+
# @param asset_id [String]
|
329
|
+
# @param [Hash] opts the optional parameters
|
330
|
+
# @return [Object]
|
331
|
+
def companies_company_id_users_user_id_alerts_asset_asset_id_get(company_id, user_id, asset_id, opts = {})
|
332
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_asset_asset_id_get_with_http_info(company_id, user_id, asset_id, opts)
|
333
|
+
data
|
334
|
+
end
|
335
|
+
|
336
|
+
# Get all alerts for a specific asset by the specified user Useful for checking if user already has an alert set up for an asset
|
337
|
+
# @param company_id [String]
|
338
|
+
# @param user_id [String]
|
339
|
+
# @param asset_id [String]
|
340
|
+
# @param [Hash] opts the optional parameters
|
341
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
342
|
+
def companies_company_id_users_user_id_alerts_asset_asset_id_get_with_http_info(company_id, user_id, asset_id, opts = {})
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_get ...'
|
345
|
+
end
|
346
|
+
# verify the required parameter 'company_id' is set
|
347
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
348
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_get"
|
349
|
+
end
|
350
|
+
# verify the required parameter 'user_id' is set
|
351
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
352
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_get"
|
353
|
+
end
|
354
|
+
# verify the required parameter 'asset_id' is set
|
355
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
356
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_get"
|
357
|
+
end
|
358
|
+
# resource path
|
359
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts/asset/{asset_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
|
360
|
+
|
361
|
+
# query parameters
|
362
|
+
query_params = opts[:query_params] || {}
|
363
|
+
|
364
|
+
# header parameters
|
365
|
+
header_params = opts[:header_params] || {}
|
366
|
+
# HTTP header 'Accept' (if needed)
|
367
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
368
|
+
|
369
|
+
# form parameters
|
370
|
+
form_params = opts[:form_params] || {}
|
371
|
+
|
372
|
+
# http body (model)
|
373
|
+
post_body = opts[:debug_body]
|
374
|
+
|
375
|
+
# return_type
|
376
|
+
return_type = opts[:debug_return_type] || 'Object'
|
377
|
+
|
378
|
+
# auth_names
|
379
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
380
|
+
|
381
|
+
new_options = opts.merge(
|
382
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_asset_asset_id_get",
|
383
|
+
:header_params => header_params,
|
384
|
+
:query_params => query_params,
|
385
|
+
:form_params => form_params,
|
386
|
+
:body => post_body,
|
387
|
+
:auth_names => auth_names,
|
388
|
+
:return_type => return_type
|
389
|
+
)
|
390
|
+
|
391
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
392
|
+
if @api_client.config.debugging
|
393
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_asset_asset_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
394
|
+
end
|
395
|
+
return data, status_code, headers
|
396
|
+
end
|
397
|
+
|
398
|
+
# Get a list of all alerts for a specific user
|
399
|
+
# @param company_id [String]
|
400
|
+
# @param user_id [String]
|
401
|
+
# @param [Hash] opts the optional parameters
|
402
|
+
# @return [Object]
|
403
|
+
def companies_company_id_users_user_id_alerts_get(company_id, user_id, opts = {})
|
404
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_get_with_http_info(company_id, user_id, opts)
|
405
|
+
data
|
406
|
+
end
|
407
|
+
|
408
|
+
# Get a list of all alerts for a specific user
|
409
|
+
# @param company_id [String]
|
410
|
+
# @param user_id [String]
|
411
|
+
# @param [Hash] opts the optional parameters
|
412
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
413
|
+
def companies_company_id_users_user_id_alerts_get_with_http_info(company_id, user_id, opts = {})
|
414
|
+
if @api_client.config.debugging
|
415
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_get ...'
|
416
|
+
end
|
417
|
+
# verify the required parameter 'company_id' is set
|
418
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
419
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_get"
|
420
|
+
end
|
421
|
+
# verify the required parameter 'user_id' is set
|
422
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
423
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_get"
|
424
|
+
end
|
425
|
+
# resource path
|
426
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
427
|
+
|
428
|
+
# query parameters
|
429
|
+
query_params = opts[:query_params] || {}
|
430
|
+
|
431
|
+
# header parameters
|
432
|
+
header_params = opts[:header_params] || {}
|
433
|
+
# HTTP header 'Accept' (if needed)
|
434
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
435
|
+
|
436
|
+
# form parameters
|
437
|
+
form_params = opts[:form_params] || {}
|
438
|
+
|
439
|
+
# http body (model)
|
440
|
+
post_body = opts[:debug_body]
|
441
|
+
|
442
|
+
# return_type
|
443
|
+
return_type = opts[:debug_return_type] || 'Object'
|
444
|
+
|
445
|
+
# auth_names
|
446
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
447
|
+
|
448
|
+
new_options = opts.merge(
|
449
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_get",
|
450
|
+
:header_params => header_params,
|
451
|
+
:query_params => query_params,
|
452
|
+
:form_params => form_params,
|
453
|
+
:body => post_body,
|
454
|
+
:auth_names => auth_names,
|
455
|
+
:return_type => return_type
|
456
|
+
)
|
457
|
+
|
458
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
459
|
+
if @api_client.config.debugging
|
460
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
461
|
+
end
|
462
|
+
return data, status_code, headers
|
463
|
+
end
|
464
|
+
|
465
|
+
# POST /companies/{company_id}/users/{user_id}/alerts
|
466
|
+
# @param company_id [String]
|
467
|
+
# @param user_id [String]
|
468
|
+
# @param alert [Alert]
|
469
|
+
# @param [Hash] opts the optional parameters
|
470
|
+
# @return [Object]
|
471
|
+
def companies_company_id_users_user_id_alerts_post(company_id, user_id, alert, opts = {})
|
472
|
+
data, _status_code, _headers = companies_company_id_users_user_id_alerts_post_with_http_info(company_id, user_id, alert, opts)
|
473
|
+
data
|
474
|
+
end
|
475
|
+
|
476
|
+
# POST /companies/{company_id}/users/{user_id}/alerts
|
477
|
+
# @param company_id [String]
|
478
|
+
# @param user_id [String]
|
479
|
+
# @param alert [Alert]
|
480
|
+
# @param [Hash] opts the optional parameters
|
481
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
482
|
+
def companies_company_id_users_user_id_alerts_post_with_http_info(company_id, user_id, alert, opts = {})
|
483
|
+
if @api_client.config.debugging
|
484
|
+
@api_client.config.logger.debug 'Calling API: AlertsApi.companies_company_id_users_user_id_alerts_post ...'
|
485
|
+
end
|
486
|
+
# verify the required parameter 'company_id' is set
|
487
|
+
if @api_client.config.client_side_validation && company_id.nil?
|
488
|
+
fail ArgumentError, "Missing the required parameter 'company_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_post"
|
489
|
+
end
|
490
|
+
# verify the required parameter 'user_id' is set
|
491
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
492
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AlertsApi.companies_company_id_users_user_id_alerts_post"
|
493
|
+
end
|
494
|
+
# verify the required parameter 'alert' is set
|
495
|
+
if @api_client.config.client_side_validation && alert.nil?
|
496
|
+
fail ArgumentError, "Missing the required parameter 'alert' when calling AlertsApi.companies_company_id_users_user_id_alerts_post"
|
497
|
+
end
|
498
|
+
# resource path
|
499
|
+
local_var_path = '/companies/{company_id}/users/{user_id}/alerts'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
500
|
+
|
501
|
+
# query parameters
|
502
|
+
query_params = opts[:query_params] || {}
|
503
|
+
|
504
|
+
# header parameters
|
505
|
+
header_params = opts[:header_params] || {}
|
506
|
+
# HTTP header 'Accept' (if needed)
|
507
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
508
|
+
# HTTP header 'Content-Type'
|
509
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
510
|
+
if !content_type.nil?
|
511
|
+
header_params['Content-Type'] = content_type
|
512
|
+
end
|
513
|
+
|
514
|
+
# form parameters
|
515
|
+
form_params = opts[:form_params] || {}
|
516
|
+
|
517
|
+
# http body (model)
|
518
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(alert)
|
519
|
+
|
520
|
+
# return_type
|
521
|
+
return_type = opts[:debug_return_type] || 'Object'
|
522
|
+
|
523
|
+
# auth_names
|
524
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
525
|
+
|
526
|
+
new_options = opts.merge(
|
527
|
+
:operation => :"AlertsApi.companies_company_id_users_user_id_alerts_post",
|
528
|
+
:header_params => header_params,
|
529
|
+
:query_params => query_params,
|
530
|
+
:form_params => form_params,
|
531
|
+
:body => post_body,
|
532
|
+
:auth_names => auth_names,
|
533
|
+
:return_type => return_type
|
534
|
+
)
|
535
|
+
|
536
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
537
|
+
if @api_client.config.debugging
|
538
|
+
@api_client.config.logger.debug "API called: AlertsApi#companies_company_id_users_user_id_alerts_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
539
|
+
end
|
540
|
+
return data, status_code, headers
|
541
|
+
end
|
542
|
+
end
|
543
|
+
end
|