statuscake-rb 1.0.0.pre.beta.4

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.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/lib/statuscake/api/contact_groups_api.rb +411 -0
  3. data/lib/statuscake/api/locations_api.rb +166 -0
  4. data/lib/statuscake/api/maintenance_windows_api.rb +444 -0
  5. data/lib/statuscake/api/pagespeed_api.rb +550 -0
  6. data/lib/statuscake/api/ssl_api.rb +458 -0
  7. data/lib/statuscake/api/uptime_api.rb +881 -0
  8. data/lib/statuscake/api_client.rb +407 -0
  9. data/lib/statuscake/api_error.rb +75 -0
  10. data/lib/statuscake/configuration.rb +296 -0
  11. data/lib/statuscake/models/api_error.rb +249 -0
  12. data/lib/statuscake/models/api_response.rb +241 -0
  13. data/lib/statuscake/models/api_response_data.rb +243 -0
  14. data/lib/statuscake/models/contact_group.rb +318 -0
  15. data/lib/statuscake/models/contact_group_response.rb +241 -0
  16. data/lib/statuscake/models/contact_groups.rb +258 -0
  17. data/lib/statuscake/models/links.rb +242 -0
  18. data/lib/statuscake/models/maintenance_window.rb +364 -0
  19. data/lib/statuscake/models/maintenance_window_repeat_interval.rb +59 -0
  20. data/lib/statuscake/models/maintenance_window_response.rb +241 -0
  21. data/lib/statuscake/models/maintenance_window_state.rb +57 -0
  22. data/lib/statuscake/models/maintenance_windows.rb +258 -0
  23. data/lib/statuscake/models/monitoring_location.rb +306 -0
  24. data/lib/statuscake/models/monitoring_location_status.rb +56 -0
  25. data/lib/statuscake/models/monitoring_locations.rb +244 -0
  26. data/lib/statuscake/models/pagespeed_test.rb +444 -0
  27. data/lib/statuscake/models/pagespeed_test_check_rate.rb +61 -0
  28. data/lib/statuscake/models/pagespeed_test_history.rb +269 -0
  29. data/lib/statuscake/models/pagespeed_test_history_result.rb +373 -0
  30. data/lib/statuscake/models/pagespeed_test_region.rb +64 -0
  31. data/lib/statuscake/models/pagespeed_test_response.rb +241 -0
  32. data/lib/statuscake/models/pagespeed_test_stats.rb +354 -0
  33. data/lib/statuscake/models/pagespeed_test_throttling.rb +60 -0
  34. data/lib/statuscake/models/pagespeed_tests.rb +258 -0
  35. data/lib/statuscake/models/pagination.rb +363 -0
  36. data/lib/statuscake/models/ssl_test.rb +594 -0
  37. data/lib/statuscake/models/ssl_test_check_rate.rb +60 -0
  38. data/lib/statuscake/models/ssl_test_flags.rb +347 -0
  39. data/lib/statuscake/models/ssl_test_mixed_content.rb +257 -0
  40. data/lib/statuscake/models/ssl_test_response.rb +241 -0
  41. data/lib/statuscake/models/ssl_tests.rb +258 -0
  42. data/lib/statuscake/models/uptime_test.rb +811 -0
  43. data/lib/statuscake/models/uptime_test_alert.rb +300 -0
  44. data/lib/statuscake/models/uptime_test_alerts.rb +269 -0
  45. data/lib/statuscake/models/uptime_test_check_rate.rb +62 -0
  46. data/lib/statuscake/models/uptime_test_history.rb +269 -0
  47. data/lib/statuscake/models/uptime_test_history_result.rb +302 -0
  48. data/lib/statuscake/models/uptime_test_overview.rb +388 -0
  49. data/lib/statuscake/models/uptime_test_period.rb +291 -0
  50. data/lib/statuscake/models/uptime_test_periods.rb +269 -0
  51. data/lib/statuscake/models/uptime_test_processing_state.rb +58 -0
  52. data/lib/statuscake/models/uptime_test_response.rb +241 -0
  53. data/lib/statuscake/models/uptime_test_status.rb +56 -0
  54. data/lib/statuscake/models/uptime_test_type.rb +61 -0
  55. data/lib/statuscake/models/uptime_tests.rb +258 -0
  56. data/lib/statuscake/version.rb +32 -0
  57. data/lib/statuscake.rb +107 -0
  58. metadata +221 -0
@@ -0,0 +1,881 @@
1
+ # frozen_string_literal: true
2
+
3
+ # StatusCake API
4
+ #
5
+ # Copyright (c) 2022
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to
9
+ # deal in the Software without restriction, including without limitation the
10
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11
+ # sell copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23
+ # IN THE SOFTWARE.
24
+ #
25
+ # API version: 1.0.0
26
+ # Contact: support@statuscake.com
27
+ #
28
+ # Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
29
+
30
+ require 'cgi'
31
+
32
+ module StatusCake
33
+ # :nodoc
34
+ class UptimeApi
35
+ attr_accessor :api_client
36
+
37
+ def initialize(api_client = ApiClient.default)
38
+ @api_client = api_client
39
+ end
40
+
41
+ # Create an uptime check
42
+ # Creates an uptime check with the given parameters.
43
+ # @param name [String] Name of the check
44
+ # @param test_type [UptimeTestType]
45
+ # @param website_url [String] URL or IP address of the server under test
46
+ # @param check_rate [UptimeTestCheckRate]
47
+ # @param [Hash] opts the optional parameters
48
+ # @option opts [String] :basic_username Basic authentication username
49
+ # @option opts [String] :basic_password Basic authentication password
50
+ # @option opts [Integer] :confirmation Number of confirmation servers to confirm downtime before an alert is triggered (default to 2)
51
+ # @option opts [Array<String>] :contact_groups List of contact group IDs
52
+ # @option opts [String] :custom_header JSON object. Represents headers to be sent when making requests
53
+ # @option opts [Boolean] :do_not_find Whether to consider the check as down if the content is present within the response (default to false)
54
+ # @option opts [Array<String>] :dns_ips List of IP addresses to compare against returned DNS records
55
+ # @option opts [String] :dns_server FQDN or IP address of the nameserver to query
56
+ # @option opts [Boolean] :enable_ssl_alert Whether to send an alert if the SSL certificate is soon to expire (default to false)
57
+ # @option opts [String] :final_endpoint Specify where the redirect chain should end
58
+ # @option opts [String] :find_string String to look for within the response. Considered down if not found
59
+ # @option opts [Boolean] :follow_redirects Whether to follow redirects when testing. Disabled by default (default to false)
60
+ # @option opts [String] :host Name of the hosting provider
61
+ # @option opts [Boolean] :include_header Include header content in string match search (default to false)
62
+ # @option opts [Boolean] :paused Whether the check should be run (default to false)
63
+ # @option opts [Integer] :port Destination port for TCP checks
64
+ # @option opts [String] :_post_body JSON object. Payload submitted with the request. Setting this updates the check to use the HTTP POST verb
65
+ # @option opts [String] :post_raw Raw HTTP POST string to send to the server
66
+ # @option opts [Array<String>] :regions List of regions on which to run checks. The values required for this parameter can be retrieved from the `GET /v1/uptime-locations` endpoint.
67
+ # @option opts [String] :status_codes_csv Comma separated list of status codes that trigger an alert
68
+ # @option opts [Array<String>] :tags List of tags
69
+ # @option opts [Integer] :timeout The number of seconds to wait to receive the first byte (default to 15)
70
+ # @option opts [Integer] :trigger_rate The number of minutes to wait before sending an alert (default to 0)
71
+ # @option opts [Boolean] :use_jar Whether to enable cookie storage (default to false)
72
+ # @option opts [String] :user_agent Custom user agent string set when testing
73
+ # @return [APIResponse]
74
+ def create_uptime_test(name, test_type, website_url, check_rate, opts = {})
75
+ data, _status_code, _headers = create_uptime_test_with_http_info(name, test_type, website_url, check_rate, opts)
76
+ data
77
+ end
78
+
79
+ # Create an uptime check
80
+ # Creates an uptime check with the given parameters.
81
+ # @param name [String] Name of the check
82
+ # @param test_type [UptimeTestType]
83
+ # @param website_url [String] URL or IP address of the server under test
84
+ # @param check_rate [UptimeTestCheckRate]
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [String] :basic_username Basic authentication username
87
+ # @option opts [String] :basic_password Basic authentication password
88
+ # @option opts [Integer] :confirmation Number of confirmation servers to confirm downtime before an alert is triggered (default to 2)
89
+ # @option opts [Array<String>] :contact_groups List of contact group IDs
90
+ # @option opts [String] :custom_header JSON object. Represents headers to be sent when making requests
91
+ # @option opts [Boolean] :do_not_find Whether to consider the check as down if the content is present within the response (default to false)
92
+ # @option opts [Array<String>] :dns_ips List of IP addresses to compare against returned DNS records
93
+ # @option opts [String] :dns_server FQDN or IP address of the nameserver to query
94
+ # @option opts [Boolean] :enable_ssl_alert Whether to send an alert if the SSL certificate is soon to expire (default to false)
95
+ # @option opts [String] :final_endpoint Specify where the redirect chain should end
96
+ # @option opts [String] :find_string String to look for within the response. Considered down if not found
97
+ # @option opts [Boolean] :follow_redirects Whether to follow redirects when testing. Disabled by default (default to false)
98
+ # @option opts [String] :host Name of the hosting provider
99
+ # @option opts [Boolean] :include_header Include header content in string match search (default to false)
100
+ # @option opts [Boolean] :paused Whether the check should be run (default to false)
101
+ # @option opts [Integer] :port Destination port for TCP checks
102
+ # @option opts [String] :_post_body JSON object. Payload submitted with the request. Setting this updates the check to use the HTTP POST verb
103
+ # @option opts [String] :post_raw Raw HTTP POST string to send to the server
104
+ # @option opts [Array<String>] :regions List of regions on which to run checks. The values required for this parameter can be retrieved from the `GET /v1/uptime-locations` endpoint.
105
+ # @option opts [String] :status_codes_csv Comma separated list of status codes that trigger an alert
106
+ # @option opts [Array<String>] :tags List of tags
107
+ # @option opts [Integer] :timeout The number of seconds to wait to receive the first byte (default to 15)
108
+ # @option opts [Integer] :trigger_rate The number of minutes to wait before sending an alert (default to 0)
109
+ # @option opts [Boolean] :use_jar Whether to enable cookie storage (default to false)
110
+ # @option opts [String] :user_agent Custom user agent string set when testing
111
+ # @return [Array<(APIResponse, Integer, Hash)>] APIResponse data, response status code and response headers
112
+ def create_uptime_test_with_http_info(name, test_type, website_url, check_rate, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: UptimeApi.create_uptime_test ...'
115
+ end
116
+ # verify the required parameter 'name' is set
117
+ if @api_client.config.client_side_validation && name.nil?
118
+ raise ArgumentError, "Missing the required parameter 'name' when calling UptimeApi.create_uptime_test"
119
+ end
120
+ # verify the required parameter 'test_type' is set
121
+ if @api_client.config.client_side_validation && test_type.nil?
122
+ raise ArgumentError, "Missing the required parameter 'test_type' when calling UptimeApi.create_uptime_test"
123
+ end
124
+ # verify the required parameter 'website_url' is set
125
+ if @api_client.config.client_side_validation && website_url.nil?
126
+ raise ArgumentError, "Missing the required parameter 'website_url' when calling UptimeApi.create_uptime_test"
127
+ end
128
+ # verify the required parameter 'check_rate' is set
129
+ if @api_client.config.client_side_validation && check_rate.nil?
130
+ raise ArgumentError, "Missing the required parameter 'check_rate' when calling UptimeApi.create_uptime_test"
131
+ end
132
+ if @api_client.config.client_side_validation && !opts[:'confirmation'].nil? && opts[:'confirmation'] > 3
133
+ raise ArgumentError, 'invalid value for "opts[:"confirmation"]" when calling UptimeApi.create_uptime_test, must be smaller than or equal to 3.'
134
+ end
135
+
136
+ if @api_client.config.client_side_validation && !opts[:'confirmation'].nil? && opts[:'confirmation'] < 0
137
+ raise ArgumentError, 'invalid value for "opts[:"confirmation"]" when calling UptimeApi.create_uptime_test, must be greater than or equal to 0.'
138
+ end
139
+
140
+ if @api_client.config.client_side_validation && !opts[:'port'].nil? && opts[:'port'] < 0
141
+ raise ArgumentError, 'invalid value for "opts[:"port"]" when calling UptimeApi.create_uptime_test, must be greater than or equal to 0.'
142
+ end
143
+
144
+ if @api_client.config.client_side_validation && !opts[:'timeout'].nil? && opts[:'timeout'] > 75
145
+ raise ArgumentError, 'invalid value for "opts[:"timeout"]" when calling UptimeApi.create_uptime_test, must be smaller than or equal to 75.'
146
+ end
147
+
148
+ if @api_client.config.client_side_validation && !opts[:'timeout'].nil? && opts[:'timeout'] < 5
149
+ raise ArgumentError, 'invalid value for "opts[:"timeout"]" when calling UptimeApi.create_uptime_test, must be greater than or equal to 5.'
150
+ end
151
+
152
+ if @api_client.config.client_side_validation && !opts[:'trigger_rate'].nil? && opts[:'trigger_rate'] > 60
153
+ raise ArgumentError, 'invalid value for "opts[:"trigger_rate"]" when calling UptimeApi.create_uptime_test, must be smaller than or equal to 60.'
154
+ end
155
+
156
+ if @api_client.config.client_side_validation && !opts[:'trigger_rate'].nil? && opts[:'trigger_rate'] < 0
157
+ raise ArgumentError, 'invalid value for "opts[:"trigger_rate"]" when calling UptimeApi.create_uptime_test, must be greater than or equal to 0.'
158
+ end
159
+
160
+ # resource path
161
+ local_var_path = '/uptime'
162
+
163
+ # query parameters
164
+ query_params = opts[:query_params] || {}
165
+
166
+ # header parameters
167
+ header_params = opts[:header_params] || {}
168
+ # HTTP header 'Accept' (if needed)
169
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
170
+ # HTTP header 'Content-Type'
171
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
172
+ unless content_type.nil?
173
+ header_params['Content-Type'] = content_type
174
+ end
175
+
176
+ # form parameters
177
+ form_params = opts[:form_params] || {}
178
+ form_params['name'] = name
179
+ form_params['test_type'] = test_type
180
+ form_params['website_url'] = website_url
181
+ form_params['check_rate'] = check_rate
182
+ form_params['basic_username'] = opts[:'basic_username'] unless opts[:'basic_username'].nil?
183
+ form_params['basic_password'] = opts[:'basic_password'] unless opts[:'basic_password'].nil?
184
+ form_params['confirmation'] = opts[:'confirmation'] unless opts[:'confirmation'].nil?
185
+ form_params['contact_groups'] = @api_client.build_collection_param(opts[:'contact_groups'], :csv) unless opts[:'contact_groups'].nil?
186
+ form_params['custom_header'] = opts[:'custom_header'] unless opts[:'custom_header'].nil?
187
+ form_params['do_not_find'] = opts[:'do_not_find'] unless opts[:'do_not_find'].nil?
188
+ form_params['dns_ips'] = @api_client.build_collection_param(opts[:'dns_ips'], :csv) unless opts[:'dns_ips'].nil?
189
+ form_params['dns_server'] = opts[:'dns_server'] unless opts[:'dns_server'].nil?
190
+ form_params['enable_ssl_alert'] = opts[:'enable_ssl_alert'] unless opts[:'enable_ssl_alert'].nil?
191
+ form_params['final_endpoint'] = opts[:'final_endpoint'] unless opts[:'final_endpoint'].nil?
192
+ form_params['find_string'] = opts[:'find_string'] unless opts[:'find_string'].nil?
193
+ form_params['follow_redirects'] = opts[:'follow_redirects'] unless opts[:'follow_redirects'].nil?
194
+ form_params['host'] = opts[:'host'] unless opts[:'host'].nil?
195
+ form_params['include_header'] = opts[:'include_header'] unless opts[:'include_header'].nil?
196
+ form_params['paused'] = opts[:'paused'] unless opts[:'paused'].nil?
197
+ form_params['port'] = opts[:'port'] unless opts[:'port'].nil?
198
+ form_params['post_body'] = opts[:'_post_body'] unless opts[:'_post_body'].nil?
199
+ form_params['post_raw'] = opts[:'post_raw'] unless opts[:'post_raw'].nil?
200
+ form_params['regions'] = @api_client.build_collection_param(opts[:'regions'], :csv) unless opts[:'regions'].nil?
201
+ form_params['status_codes_csv'] = opts[:'status_codes_csv'] unless opts[:'status_codes_csv'].nil?
202
+ form_params['tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) unless opts[:'tags'].nil?
203
+ form_params['timeout'] = opts[:'timeout'] unless opts[:'timeout'].nil?
204
+ form_params['trigger_rate'] = opts[:'trigger_rate'] unless opts[:'trigger_rate'].nil?
205
+ form_params['use_jar'] = opts[:'use_jar'] unless opts[:'use_jar'].nil?
206
+ form_params['user_agent'] = opts[:'user_agent'] unless opts[:'user_agent'].nil?
207
+
208
+ # http body (model)
209
+ post_body = opts[:debug_body]
210
+
211
+ # return_type
212
+ return_type = opts[:debug_return_type] || 'APIResponse'
213
+
214
+ # auth_names
215
+ auth_names = opts[:debug_auth_names] || []
216
+
217
+ new_options = opts.merge(
218
+ :operation => :'UptimeApi.create_uptime_test',
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type,
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "API called: UptimeApi#create_uptime_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
+ end
231
+
232
+ [data, status_code, headers]
233
+ end
234
+
235
+ # Delete an uptime check
236
+ # Deletes an uptime check with the given id.
237
+ # @param test_id [String] Uptime check ID
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [nil]
240
+ def delete_uptime_test(test_id, opts = {})
241
+ delete_uptime_test_with_http_info(test_id, opts)
242
+ nil
243
+ end
244
+
245
+ # Delete an uptime check
246
+ # Deletes an uptime check with the given id.
247
+ # @param test_id [String] Uptime check ID
248
+ # @param [Hash] opts the optional parameters
249
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
250
+ def delete_uptime_test_with_http_info(test_id, opts = {})
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug 'Calling API: UptimeApi.delete_uptime_test ...'
253
+ end
254
+ # verify the required parameter 'test_id' is set
255
+ if @api_client.config.client_side_validation && test_id.nil?
256
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.delete_uptime_test"
257
+ end
258
+ # resource path
259
+ local_var_path = '/uptime/{test_id}'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
260
+
261
+ # query parameters
262
+ query_params = opts[:query_params] || {}
263
+
264
+ # header parameters
265
+ header_params = opts[:header_params] || {}
266
+ # HTTP header 'Accept' (if needed)
267
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
268
+
269
+ # form parameters
270
+ form_params = opts[:form_params] || {}
271
+
272
+ # http body (model)
273
+ post_body = opts[:debug_body]
274
+
275
+ # return_type
276
+ return_type = opts[:debug_return_type]
277
+
278
+ # auth_names
279
+ auth_names = opts[:debug_auth_names] || []
280
+
281
+ new_options = opts.merge(
282
+ :operation => :'UptimeApi.delete_uptime_test',
283
+ :header_params => header_params,
284
+ :query_params => query_params,
285
+ :form_params => form_params,
286
+ :body => post_body,
287
+ :auth_names => auth_names,
288
+ :return_type => return_type,
289
+ )
290
+
291
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
292
+ if @api_client.config.debugging
293
+ @api_client.config.logger.debug "API called: UptimeApi#delete_uptime_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
294
+ end
295
+
296
+ [data, status_code, headers]
297
+ end
298
+
299
+ # Retrieve an uptime check
300
+ # Returns an uptime check with the given id.
301
+ # @param test_id [String] Uptime check ID
302
+ # @param [Hash] opts the optional parameters
303
+ # @return [UptimeTestResponse]
304
+ def get_uptime_test(test_id, opts = {})
305
+ data, _status_code, _headers = get_uptime_test_with_http_info(test_id, opts)
306
+ data
307
+ end
308
+
309
+ # Retrieve an uptime check
310
+ # Returns an uptime check with the given id.
311
+ # @param test_id [String] Uptime check ID
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [Array<(UptimeTestResponse, Integer, Hash)>] UptimeTestResponse data, response status code and response headers
314
+ def get_uptime_test_with_http_info(test_id, opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: UptimeApi.get_uptime_test ...'
317
+ end
318
+ # verify the required parameter 'test_id' is set
319
+ if @api_client.config.client_side_validation && test_id.nil?
320
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.get_uptime_test"
321
+ end
322
+ # resource path
323
+ local_var_path = '/uptime/{test_id}'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
324
+
325
+ # query parameters
326
+ query_params = opts[:query_params] || {}
327
+
328
+ # header parameters
329
+ header_params = opts[:header_params] || {}
330
+ # HTTP header 'Accept' (if needed)
331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
332
+
333
+ # form parameters
334
+ form_params = opts[:form_params] || {}
335
+
336
+ # http body (model)
337
+ post_body = opts[:debug_body]
338
+
339
+ # return_type
340
+ return_type = opts[:debug_return_type] || 'UptimeTestResponse'
341
+
342
+ # auth_names
343
+ auth_names = opts[:debug_auth_names] || []
344
+
345
+ new_options = opts.merge(
346
+ :operation => :'UptimeApi.get_uptime_test',
347
+ :header_params => header_params,
348
+ :query_params => query_params,
349
+ :form_params => form_params,
350
+ :body => post_body,
351
+ :auth_names => auth_names,
352
+ :return_type => return_type,
353
+ )
354
+
355
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug "API called: UptimeApi#get_uptime_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
358
+ end
359
+
360
+ [data, status_code, headers]
361
+ end
362
+
363
+ # Get all uptime check alerts
364
+ # Returns a list of uptime check alerts for a given id. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
365
+ # @param test_id [String] Uptime check ID
366
+ # @param [Hash] opts the optional parameters
367
+ # @option opts [Integer] :limit The number of uptime alerts to return per page (default to 25)
368
+ # @option opts [Integer] :before Only alerts triggered before this UNIX timestamp will be returned
369
+ # @return [UptimeTestAlerts]
370
+ def list_uptime_test_alerts(test_id, opts = {})
371
+ data, _status_code, _headers = list_uptime_test_alerts_with_http_info(test_id, opts)
372
+ data
373
+ end
374
+
375
+ # Get all uptime check alerts
376
+ # Returns a list of uptime check alerts for a given id. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
377
+ # @param test_id [String] Uptime check ID
378
+ # @param [Hash] opts the optional parameters
379
+ # @option opts [Integer] :limit The number of uptime alerts to return per page (default to 25)
380
+ # @option opts [Integer] :before Only alerts triggered before this UNIX timestamp will be returned
381
+ # @return [Array<(UptimeTestAlerts, Integer, Hash)>] UptimeTestAlerts data, response status code and response headers
382
+ def list_uptime_test_alerts_with_http_info(test_id, opts = {})
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug 'Calling API: UptimeApi.list_uptime_test_alerts ...'
385
+ end
386
+ # verify the required parameter 'test_id' is set
387
+ if @api_client.config.client_side_validation && test_id.nil?
388
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.list_uptime_test_alerts"
389
+ end
390
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
391
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_alerts, must be smaller than or equal to 100.'
392
+ end
393
+
394
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
395
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_alerts, must be greater than or equal to 1.'
396
+ end
397
+
398
+ if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 0
399
+ raise ArgumentError, 'invalid value for "opts[:"before"]" when calling UptimeApi.list_uptime_test_alerts, must be greater than or equal to 0.'
400
+ end
401
+
402
+ # resource path
403
+ local_var_path = '/uptime/{test_id}/alerts'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
404
+
405
+ # query parameters
406
+ query_params = opts[:query_params] || {}
407
+ query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
408
+ query_params[:'before'] = opts[:'before'] unless opts[:'before'].nil?
409
+
410
+ # header parameters
411
+ header_params = opts[:header_params] || {}
412
+ # HTTP header 'Accept' (if needed)
413
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
414
+
415
+ # form parameters
416
+ form_params = opts[:form_params] || {}
417
+
418
+ # http body (model)
419
+ post_body = opts[:debug_body]
420
+
421
+ # return_type
422
+ return_type = opts[:debug_return_type] || 'UptimeTestAlerts'
423
+
424
+ # auth_names
425
+ auth_names = opts[:debug_auth_names] || []
426
+
427
+ new_options = opts.merge(
428
+ :operation => :'UptimeApi.list_uptime_test_alerts',
429
+ :header_params => header_params,
430
+ :query_params => query_params,
431
+ :form_params => form_params,
432
+ :body => post_body,
433
+ :auth_names => auth_names,
434
+ :return_type => return_type,
435
+ )
436
+
437
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
438
+ if @api_client.config.debugging
439
+ @api_client.config.logger.debug "API called: UptimeApi#list_uptime_test_alerts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
440
+ end
441
+
442
+ [data, status_code, headers]
443
+ end
444
+
445
+ # Get all uptime check history
446
+ # Returns a list of uptime check history results for a given id, detailing the runs performed on the StatusCake testing infrastruture. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
447
+ # @param test_id [String] Uptime check ID
448
+ # @param [Hash] opts the optional parameters
449
+ # @option opts [Integer] :limit The number of results to return per page (default to 25)
450
+ # @option opts [Integer] :before Only results created before this UNIX timestamp will be returned
451
+ # @return [UptimeTestHistory]
452
+ def list_uptime_test_history(test_id, opts = {})
453
+ data, _status_code, _headers = list_uptime_test_history_with_http_info(test_id, opts)
454
+ data
455
+ end
456
+
457
+ # Get all uptime check history
458
+ # Returns a list of uptime check history results for a given id, detailing the runs performed on the StatusCake testing infrastruture. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
459
+ # @param test_id [String] Uptime check ID
460
+ # @param [Hash] opts the optional parameters
461
+ # @option opts [Integer] :limit The number of results to return per page (default to 25)
462
+ # @option opts [Integer] :before Only results created before this UNIX timestamp will be returned
463
+ # @return [Array<(UptimeTestHistory, Integer, Hash)>] UptimeTestHistory data, response status code and response headers
464
+ def list_uptime_test_history_with_http_info(test_id, opts = {})
465
+ if @api_client.config.debugging
466
+ @api_client.config.logger.debug 'Calling API: UptimeApi.list_uptime_test_history ...'
467
+ end
468
+ # verify the required parameter 'test_id' is set
469
+ if @api_client.config.client_side_validation && test_id.nil?
470
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.list_uptime_test_history"
471
+ end
472
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
473
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_history, must be smaller than or equal to 100.'
474
+ end
475
+
476
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
477
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_history, must be greater than or equal to 1.'
478
+ end
479
+
480
+ if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 0
481
+ raise ArgumentError, 'invalid value for "opts[:"before"]" when calling UptimeApi.list_uptime_test_history, must be greater than or equal to 0.'
482
+ end
483
+
484
+ # resource path
485
+ local_var_path = '/uptime/{test_id}/history'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
486
+
487
+ # query parameters
488
+ query_params = opts[:query_params] || {}
489
+ query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
490
+ query_params[:'before'] = opts[:'before'] unless opts[:'before'].nil?
491
+
492
+ # header parameters
493
+ header_params = opts[:header_params] || {}
494
+ # HTTP header 'Accept' (if needed)
495
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
496
+
497
+ # form parameters
498
+ form_params = opts[:form_params] || {}
499
+
500
+ # http body (model)
501
+ post_body = opts[:debug_body]
502
+
503
+ # return_type
504
+ return_type = opts[:debug_return_type] || 'UptimeTestHistory'
505
+
506
+ # auth_names
507
+ auth_names = opts[:debug_auth_names] || []
508
+
509
+ new_options = opts.merge(
510
+ :operation => :'UptimeApi.list_uptime_test_history',
511
+ :header_params => header_params,
512
+ :query_params => query_params,
513
+ :form_params => form_params,
514
+ :body => post_body,
515
+ :auth_names => auth_names,
516
+ :return_type => return_type,
517
+ )
518
+
519
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
520
+ if @api_client.config.debugging
521
+ @api_client.config.logger.debug "API called: UptimeApi#list_uptime_test_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
522
+ end
523
+
524
+ [data, status_code, headers]
525
+ end
526
+
527
+ # Get all uptime check periods
528
+ # Returns a list of uptime check periods for a given id, detailing the creation time of the period, when it ended and the duration. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
529
+ # @param test_id [String] Uptime check ID
530
+ # @param [Hash] opts the optional parameters
531
+ # @option opts [Integer] :limit The number of uptime check periods to return per page (default to 25)
532
+ # @option opts [Integer] :before Only check periods created before this UNIX timestamp will be returned
533
+ # @return [UptimeTestPeriods]
534
+ def list_uptime_test_periods(test_id, opts = {})
535
+ data, _status_code, _headers = list_uptime_test_periods_with_http_info(test_id, opts)
536
+ data
537
+ end
538
+
539
+ # Get all uptime check periods
540
+ # Returns a list of uptime check periods for a given id, detailing the creation time of the period, when it ended and the duration. The returned results are a paginated series. Alongside the response data is a `links` object referencing the current response document, `self`, and the next page in the series, `next`.
541
+ # @param test_id [String] Uptime check ID
542
+ # @param [Hash] opts the optional parameters
543
+ # @option opts [Integer] :limit The number of uptime check periods to return per page (default to 25)
544
+ # @option opts [Integer] :before Only check periods created before this UNIX timestamp will be returned
545
+ # @return [Array<(UptimeTestPeriods, Integer, Hash)>] UptimeTestPeriods data, response status code and response headers
546
+ def list_uptime_test_periods_with_http_info(test_id, opts = {})
547
+ if @api_client.config.debugging
548
+ @api_client.config.logger.debug 'Calling API: UptimeApi.list_uptime_test_periods ...'
549
+ end
550
+ # verify the required parameter 'test_id' is set
551
+ if @api_client.config.client_side_validation && test_id.nil?
552
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.list_uptime_test_periods"
553
+ end
554
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
555
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_periods, must be smaller than or equal to 100.'
556
+ end
557
+
558
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
559
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_test_periods, must be greater than or equal to 1.'
560
+ end
561
+
562
+ if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 0
563
+ raise ArgumentError, 'invalid value for "opts[:"before"]" when calling UptimeApi.list_uptime_test_periods, must be greater than or equal to 0.'
564
+ end
565
+
566
+ # resource path
567
+ local_var_path = '/uptime/{test_id}/periods'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
568
+
569
+ # query parameters
570
+ query_params = opts[:query_params] || {}
571
+ query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
572
+ query_params[:'before'] = opts[:'before'] unless opts[:'before'].nil?
573
+
574
+ # header parameters
575
+ header_params = opts[:header_params] || {}
576
+ # HTTP header 'Accept' (if needed)
577
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
578
+
579
+ # form parameters
580
+ form_params = opts[:form_params] || {}
581
+
582
+ # http body (model)
583
+ post_body = opts[:debug_body]
584
+
585
+ # return_type
586
+ return_type = opts[:debug_return_type] || 'UptimeTestPeriods'
587
+
588
+ # auth_names
589
+ auth_names = opts[:debug_auth_names] || []
590
+
591
+ new_options = opts.merge(
592
+ :operation => :'UptimeApi.list_uptime_test_periods',
593
+ :header_params => header_params,
594
+ :query_params => query_params,
595
+ :form_params => form_params,
596
+ :body => post_body,
597
+ :auth_names => auth_names,
598
+ :return_type => return_type,
599
+ )
600
+
601
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug "API called: UptimeApi#list_uptime_test_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
604
+ end
605
+
606
+ [data, status_code, headers]
607
+ end
608
+
609
+ # Get all uptime checks
610
+ # Returns a list of uptime checks for an account.
611
+ # @param [Hash] opts the optional parameters
612
+ # @option opts [String] :status Uptime check status
613
+ # @option opts [Integer] :page Page of results (default to 1)
614
+ # @option opts [Integer] :limit The number of uptime checks to return per page (default to 25)
615
+ # @option opts [String] :tags Comma separated list of tags assocaited with a check
616
+ # @option opts [Boolean] :matchany Include uptime checks in response that match any specified tag or all tags (default to false)
617
+ # @option opts [Boolean] :nouptime Do not calculate uptime percentages for results (default to false)
618
+ # @return [UptimeTests]
619
+ def list_uptime_tests(opts = {})
620
+ data, _status_code, _headers = list_uptime_tests_with_http_info(opts)
621
+ data
622
+ end
623
+
624
+ # Get all uptime checks
625
+ # Returns a list of uptime checks for an account.
626
+ # @param [Hash] opts the optional parameters
627
+ # @option opts [String] :status Uptime check status
628
+ # @option opts [Integer] :page Page of results (default to 1)
629
+ # @option opts [Integer] :limit The number of uptime checks to return per page (default to 25)
630
+ # @option opts [String] :tags Comma separated list of tags assocaited with a check
631
+ # @option opts [Boolean] :matchany Include uptime checks in response that match any specified tag or all tags (default to false)
632
+ # @option opts [Boolean] :nouptime Do not calculate uptime percentages for results (default to false)
633
+ # @return [Array<(UptimeTests, Integer, Hash)>] UptimeTests data, response status code and response headers
634
+ def list_uptime_tests_with_http_info(opts = {})
635
+ if @api_client.config.debugging
636
+ @api_client.config.logger.debug 'Calling API: UptimeApi.list_uptime_tests ...'
637
+ end
638
+ # rubocop:disable Style/WordArray
639
+ allowable_values = ["down", "up"]
640
+ # rubocop:enable Style/WordArray
641
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
642
+ raise ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
643
+ end
644
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
645
+ raise ArgumentError, 'invalid value for "opts[:"page"]" when calling UptimeApi.list_uptime_tests, must be greater than or equal to 1.'
646
+ end
647
+
648
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
649
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_tests, must be smaller than or equal to 100.'
650
+ end
651
+
652
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
653
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling UptimeApi.list_uptime_tests, must be greater than or equal to 1.'
654
+ end
655
+
656
+ # resource path
657
+ local_var_path = '/uptime'
658
+
659
+ # query parameters
660
+ query_params = opts[:query_params] || {}
661
+ query_params[:'status'] = opts[:'status'] unless opts[:'status'].nil?
662
+ query_params[:'page'] = opts[:'page'] unless opts[:'page'].nil?
663
+ query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
664
+ query_params[:'tags'] = opts[:'tags'] unless opts[:'tags'].nil?
665
+ query_params[:'matchany'] = opts[:'matchany'] unless opts[:'matchany'].nil?
666
+ query_params[:'nouptime'] = opts[:'nouptime'] unless opts[:'nouptime'].nil?
667
+
668
+ # header parameters
669
+ header_params = opts[:header_params] || {}
670
+ # HTTP header 'Accept' (if needed)
671
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
672
+
673
+ # form parameters
674
+ form_params = opts[:form_params] || {}
675
+
676
+ # http body (model)
677
+ post_body = opts[:debug_body]
678
+
679
+ # return_type
680
+ return_type = opts[:debug_return_type] || 'UptimeTests'
681
+
682
+ # auth_names
683
+ auth_names = opts[:debug_auth_names] || []
684
+
685
+ new_options = opts.merge(
686
+ :operation => :'UptimeApi.list_uptime_tests',
687
+ :header_params => header_params,
688
+ :query_params => query_params,
689
+ :form_params => form_params,
690
+ :body => post_body,
691
+ :auth_names => auth_names,
692
+ :return_type => return_type,
693
+ )
694
+
695
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
696
+ if @api_client.config.debugging
697
+ @api_client.config.logger.debug "API called: UptimeApi#list_uptime_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
698
+ end
699
+
700
+ [data, status_code, headers]
701
+ end
702
+
703
+ # Update an uptime check
704
+ # Updates an uptime check with the given parameters.
705
+ # @param test_id [String] Uptime check ID
706
+ # @param [Hash] opts the optional parameters
707
+ # @option opts [String] :name Name of the check
708
+ # @option opts [UptimeTestCheckRate] :check_rate
709
+ # @option opts [String] :basic_username Basic authentication username
710
+ # @option opts [String] :basic_password Basic authentication password
711
+ # @option opts [Integer] :confirmation Number of confirmation servers to confirm downtime before an alert is triggered
712
+ # @option opts [Array<String>] :contact_groups List of contact group IDs
713
+ # @option opts [String] :custom_header JSON object. Represents headers to be sent when making requests
714
+ # @option opts [Boolean] :do_not_find Whether to consider the check as down if the content is present within the response
715
+ # @option opts [Array<String>] :dns_ips List of IP addresses to compare against returned DNS records
716
+ # @option opts [String] :dns_server FQDN or IP address of the nameserver to query
717
+ # @option opts [Boolean] :enable_ssl_alert Whether to send an alert if the SSL certificate is soon to expire
718
+ # @option opts [String] :final_endpoint Specify where the redirect chain should end
719
+ # @option opts [String] :find_string String to look for within the response. Considered down if not found
720
+ # @option opts [Boolean] :follow_redirects Whether to follow redirects when testing. Disabled by default
721
+ # @option opts [String] :host Name of the hosting provider
722
+ # @option opts [Boolean] :include_header Include header content in string match search
723
+ # @option opts [Boolean] :paused Whether the check should be run
724
+ # @option opts [Integer] :port Destination port for TCP checks
725
+ # @option opts [String] :_post_body JSON object. Payload submitted with the request. Setting this updates the check to use the HTTP POST verb
726
+ # @option opts [String] :post_raw Raw HTTP POST string to send to the server
727
+ # @option opts [Array<String>] :regions List of regions on which to run checks. The values required for this parameter can be retrieved from the `GET /v1/uptime-locations` endpoint.
728
+ # @option opts [String] :status_codes_csv Comma separated list of status codes that trigger an alert
729
+ # @option opts [Array<String>] :tags List of tags
730
+ # @option opts [Integer] :timeout The number of seconds to wait to receive the first byte
731
+ # @option opts [Integer] :trigger_rate The number of minutes to wait before sending an alert
732
+ # @option opts [Boolean] :use_jar Whether to enable cookie storage
733
+ # @option opts [String] :user_agent Custom user agent string set when testing
734
+ # @return [nil]
735
+ def update_uptime_test(test_id, opts = {})
736
+ update_uptime_test_with_http_info(test_id, opts)
737
+ nil
738
+ end
739
+
740
+ # Update an uptime check
741
+ # Updates an uptime check with the given parameters.
742
+ # @param test_id [String] Uptime check ID
743
+ # @param [Hash] opts the optional parameters
744
+ # @option opts [String] :name Name of the check
745
+ # @option opts [UptimeTestCheckRate] :check_rate
746
+ # @option opts [String] :basic_username Basic authentication username
747
+ # @option opts [String] :basic_password Basic authentication password
748
+ # @option opts [Integer] :confirmation Number of confirmation servers to confirm downtime before an alert is triggered
749
+ # @option opts [Array<String>] :contact_groups List of contact group IDs
750
+ # @option opts [String] :custom_header JSON object. Represents headers to be sent when making requests
751
+ # @option opts [Boolean] :do_not_find Whether to consider the check as down if the content is present within the response
752
+ # @option opts [Array<String>] :dns_ips List of IP addresses to compare against returned DNS records
753
+ # @option opts [String] :dns_server FQDN or IP address of the nameserver to query
754
+ # @option opts [Boolean] :enable_ssl_alert Whether to send an alert if the SSL certificate is soon to expire
755
+ # @option opts [String] :final_endpoint Specify where the redirect chain should end
756
+ # @option opts [String] :find_string String to look for within the response. Considered down if not found
757
+ # @option opts [Boolean] :follow_redirects Whether to follow redirects when testing. Disabled by default
758
+ # @option opts [String] :host Name of the hosting provider
759
+ # @option opts [Boolean] :include_header Include header content in string match search
760
+ # @option opts [Boolean] :paused Whether the check should be run
761
+ # @option opts [Integer] :port Destination port for TCP checks
762
+ # @option opts [String] :_post_body JSON object. Payload submitted with the request. Setting this updates the check to use the HTTP POST verb
763
+ # @option opts [String] :post_raw Raw HTTP POST string to send to the server
764
+ # @option opts [Array<String>] :regions List of regions on which to run checks. The values required for this parameter can be retrieved from the `GET /v1/uptime-locations` endpoint.
765
+ # @option opts [String] :status_codes_csv Comma separated list of status codes that trigger an alert
766
+ # @option opts [Array<String>] :tags List of tags
767
+ # @option opts [Integer] :timeout The number of seconds to wait to receive the first byte
768
+ # @option opts [Integer] :trigger_rate The number of minutes to wait before sending an alert
769
+ # @option opts [Boolean] :use_jar Whether to enable cookie storage
770
+ # @option opts [String] :user_agent Custom user agent string set when testing
771
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
772
+ def update_uptime_test_with_http_info(test_id, opts = {})
773
+ if @api_client.config.debugging
774
+ @api_client.config.logger.debug 'Calling API: UptimeApi.update_uptime_test ...'
775
+ end
776
+ # verify the required parameter 'test_id' is set
777
+ if @api_client.config.client_side_validation && test_id.nil?
778
+ raise ArgumentError, "Missing the required parameter 'test_id' when calling UptimeApi.update_uptime_test"
779
+ end
780
+ if @api_client.config.client_side_validation && !opts[:'confirmation'].nil? && opts[:'confirmation'] > 3
781
+ raise ArgumentError, 'invalid value for "opts[:"confirmation"]" when calling UptimeApi.update_uptime_test, must be smaller than or equal to 3.'
782
+ end
783
+
784
+ if @api_client.config.client_side_validation && !opts[:'confirmation'].nil? && opts[:'confirmation'] < 0
785
+ raise ArgumentError, 'invalid value for "opts[:"confirmation"]" when calling UptimeApi.update_uptime_test, must be greater than or equal to 0.'
786
+ end
787
+
788
+ if @api_client.config.client_side_validation && !opts[:'port'].nil? && opts[:'port'] < 0
789
+ raise ArgumentError, 'invalid value for "opts[:"port"]" when calling UptimeApi.update_uptime_test, must be greater than or equal to 0.'
790
+ end
791
+
792
+ if @api_client.config.client_side_validation && !opts[:'timeout'].nil? && opts[:'timeout'] > 75
793
+ raise ArgumentError, 'invalid value for "opts[:"timeout"]" when calling UptimeApi.update_uptime_test, must be smaller than or equal to 75.'
794
+ end
795
+
796
+ if @api_client.config.client_side_validation && !opts[:'timeout'].nil? && opts[:'timeout'] < 5
797
+ raise ArgumentError, 'invalid value for "opts[:"timeout"]" when calling UptimeApi.update_uptime_test, must be greater than or equal to 5.'
798
+ end
799
+
800
+ if @api_client.config.client_side_validation && !opts[:'trigger_rate'].nil? && opts[:'trigger_rate'] > 60
801
+ raise ArgumentError, 'invalid value for "opts[:"trigger_rate"]" when calling UptimeApi.update_uptime_test, must be smaller than or equal to 60.'
802
+ end
803
+
804
+ if @api_client.config.client_side_validation && !opts[:'trigger_rate'].nil? && opts[:'trigger_rate'] < 0
805
+ raise ArgumentError, 'invalid value for "opts[:"trigger_rate"]" when calling UptimeApi.update_uptime_test, must be greater than or equal to 0.'
806
+ end
807
+
808
+ # resource path
809
+ local_var_path = '/uptime/{test_id}'.sub('{' + 'test_id' + '}', CGI.escape(test_id.to_s))
810
+
811
+ # query parameters
812
+ query_params = opts[:query_params] || {}
813
+
814
+ # header parameters
815
+ header_params = opts[:header_params] || {}
816
+ # HTTP header 'Accept' (if needed)
817
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
818
+ # HTTP header 'Content-Type'
819
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
820
+ unless content_type.nil?
821
+ header_params['Content-Type'] = content_type
822
+ end
823
+
824
+ # form parameters
825
+ form_params = opts[:form_params] || {}
826
+ form_params['name'] = opts[:'name'] unless opts[:'name'].nil?
827
+ form_params['check_rate'] = opts[:'check_rate'] unless opts[:'check_rate'].nil?
828
+ form_params['basic_username'] = opts[:'basic_username'] unless opts[:'basic_username'].nil?
829
+ form_params['basic_password'] = opts[:'basic_password'] unless opts[:'basic_password'].nil?
830
+ form_params['confirmation'] = opts[:'confirmation'] unless opts[:'confirmation'].nil?
831
+ form_params['contact_groups'] = @api_client.build_collection_param(opts[:'contact_groups'], :csv) unless opts[:'contact_groups'].nil?
832
+ form_params['custom_header'] = opts[:'custom_header'] unless opts[:'custom_header'].nil?
833
+ form_params['do_not_find'] = opts[:'do_not_find'] unless opts[:'do_not_find'].nil?
834
+ form_params['dns_ips'] = @api_client.build_collection_param(opts[:'dns_ips'], :csv) unless opts[:'dns_ips'].nil?
835
+ form_params['dns_server'] = opts[:'dns_server'] unless opts[:'dns_server'].nil?
836
+ form_params['enable_ssl_alert'] = opts[:'enable_ssl_alert'] unless opts[:'enable_ssl_alert'].nil?
837
+ form_params['final_endpoint'] = opts[:'final_endpoint'] unless opts[:'final_endpoint'].nil?
838
+ form_params['find_string'] = opts[:'find_string'] unless opts[:'find_string'].nil?
839
+ form_params['follow_redirects'] = opts[:'follow_redirects'] unless opts[:'follow_redirects'].nil?
840
+ form_params['host'] = opts[:'host'] unless opts[:'host'].nil?
841
+ form_params['include_header'] = opts[:'include_header'] unless opts[:'include_header'].nil?
842
+ form_params['paused'] = opts[:'paused'] unless opts[:'paused'].nil?
843
+ form_params['port'] = opts[:'port'] unless opts[:'port'].nil?
844
+ form_params['post_body'] = opts[:'_post_body'] unless opts[:'_post_body'].nil?
845
+ form_params['post_raw'] = opts[:'post_raw'] unless opts[:'post_raw'].nil?
846
+ form_params['regions'] = @api_client.build_collection_param(opts[:'regions'], :csv) unless opts[:'regions'].nil?
847
+ form_params['status_codes_csv'] = opts[:'status_codes_csv'] unless opts[:'status_codes_csv'].nil?
848
+ form_params['tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) unless opts[:'tags'].nil?
849
+ form_params['timeout'] = opts[:'timeout'] unless opts[:'timeout'].nil?
850
+ form_params['trigger_rate'] = opts[:'trigger_rate'] unless opts[:'trigger_rate'].nil?
851
+ form_params['use_jar'] = opts[:'use_jar'] unless opts[:'use_jar'].nil?
852
+ form_params['user_agent'] = opts[:'user_agent'] unless opts[:'user_agent'].nil?
853
+
854
+ # http body (model)
855
+ post_body = opts[:debug_body]
856
+
857
+ # return_type
858
+ return_type = opts[:debug_return_type]
859
+
860
+ # auth_names
861
+ auth_names = opts[:debug_auth_names] || []
862
+
863
+ new_options = opts.merge(
864
+ :operation => :'UptimeApi.update_uptime_test',
865
+ :header_params => header_params,
866
+ :query_params => query_params,
867
+ :form_params => form_params,
868
+ :body => post_body,
869
+ :auth_names => auth_names,
870
+ :return_type => return_type,
871
+ )
872
+
873
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
874
+ if @api_client.config.debugging
875
+ @api_client.config.logger.debug "API called: UptimeApi#update_uptime_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
876
+ end
877
+
878
+ [data, status_code, headers]
879
+ end
880
+ end
881
+ end