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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 143c65194a989509dca6fbaefb72ef590def90cef5841b279ce00d5775e721f2
4
+ data.tar.gz: e5c646a68d94066676990c637da6463a7b6668c74bf3678aa723f7ac49f80a4b
5
+ SHA512:
6
+ metadata.gz: 4c08f399d24850cea2f5adaaadf394d34a8f02afe1b2b023f049703b4105deaf26caa34feaf16a859120f9baea9ce5f60c4423a66f99329e8ece228a534e1e9e
7
+ data.tar.gz: 2bf18d05a97baf876ce653f7669187ccb73f3e194dfcad1332b8b59ac7b2f7d5f3a188c89ae662c9ac5e0f0e561b963762a6453d136fd468604c97593aea1ec7
@@ -0,0 +1,411 @@
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 ContactGroupsApi
35
+ attr_accessor :api_client
36
+
37
+ def initialize(api_client = ApiClient.default)
38
+ @api_client = api_client
39
+ end
40
+
41
+ # Create a contact group
42
+ # Creates a contact group with the given parameters.
43
+ # @param name [String] Name of the contact group
44
+ # @param [Hash] opts the optional parameters
45
+ # @option opts [Array<String>] :email_addresses List of email addresses
46
+ # @option opts [Array<String>] :integrations List of integration IDs
47
+ # @option opts [Array<String>] :mobile_numbers List of international format mobile phone numbers
48
+ # @option opts [String] :ping_url URL or IP address of an endpoint to push uptime events. Currently this only supports HTTP GET endpoints
49
+ # @return [APIResponse]
50
+ def create_contact_group(name, opts = {})
51
+ data, _status_code, _headers = create_contact_group_with_http_info(name, opts)
52
+ data
53
+ end
54
+
55
+ # Create a contact group
56
+ # Creates a contact group with the given parameters.
57
+ # @param name [String] Name of the contact group
58
+ # @param [Hash] opts the optional parameters
59
+ # @option opts [Array<String>] :email_addresses List of email addresses
60
+ # @option opts [Array<String>] :integrations List of integration IDs
61
+ # @option opts [Array<String>] :mobile_numbers List of international format mobile phone numbers
62
+ # @option opts [String] :ping_url URL or IP address of an endpoint to push uptime events. Currently this only supports HTTP GET endpoints
63
+ # @return [Array<(APIResponse, Integer, Hash)>] APIResponse data, response status code and response headers
64
+ def create_contact_group_with_http_info(name, opts = {})
65
+ if @api_client.config.debugging
66
+ @api_client.config.logger.debug 'Calling API: ContactGroupsApi.create_contact_group ...'
67
+ end
68
+ # verify the required parameter 'name' is set
69
+ if @api_client.config.client_side_validation && name.nil?
70
+ raise ArgumentError, "Missing the required parameter 'name' when calling ContactGroupsApi.create_contact_group"
71
+ end
72
+ # resource path
73
+ local_var_path = '/contact-groups'
74
+
75
+ # query parameters
76
+ query_params = opts[:query_params] || {}
77
+
78
+ # header parameters
79
+ header_params = opts[:header_params] || {}
80
+ # HTTP header 'Accept' (if needed)
81
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
82
+ # HTTP header 'Content-Type'
83
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
84
+ unless content_type.nil?
85
+ header_params['Content-Type'] = content_type
86
+ end
87
+
88
+ # form parameters
89
+ form_params = opts[:form_params] || {}
90
+ form_params['name'] = name
91
+ form_params['email_addresses'] = @api_client.build_collection_param(opts[:'email_addresses'], :csv) unless opts[:'email_addresses'].nil?
92
+ form_params['integrations'] = @api_client.build_collection_param(opts[:'integrations'], :csv) unless opts[:'integrations'].nil?
93
+ form_params['mobile_numbers'] = @api_client.build_collection_param(opts[:'mobile_numbers'], :csv) unless opts[:'mobile_numbers'].nil?
94
+ form_params['ping_url'] = opts[:'ping_url'] unless opts[:'ping_url'].nil?
95
+
96
+ # http body (model)
97
+ post_body = opts[:debug_body]
98
+
99
+ # return_type
100
+ return_type = opts[:debug_return_type] || 'APIResponse'
101
+
102
+ # auth_names
103
+ auth_names = opts[:debug_auth_names] || []
104
+
105
+ new_options = opts.merge(
106
+ :operation => :'ContactGroupsApi.create_contact_group',
107
+ :header_params => header_params,
108
+ :query_params => query_params,
109
+ :form_params => form_params,
110
+ :body => post_body,
111
+ :auth_names => auth_names,
112
+ :return_type => return_type,
113
+ )
114
+
115
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
116
+ if @api_client.config.debugging
117
+ @api_client.config.logger.debug "API called: ContactGroupsApi#create_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
118
+ end
119
+
120
+ [data, status_code, headers]
121
+ end
122
+
123
+ # Delete a contact group
124
+ # Deletes a contact group with the given id.
125
+ # @param group_id [String] Contact group ID
126
+ # @param [Hash] opts the optional parameters
127
+ # @return [nil]
128
+ def delete_contact_group(group_id, opts = {})
129
+ delete_contact_group_with_http_info(group_id, opts)
130
+ nil
131
+ end
132
+
133
+ # Delete a contact group
134
+ # Deletes a contact group with the given id.
135
+ # @param group_id [String] Contact group ID
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
138
+ def delete_contact_group_with_http_info(group_id, opts = {})
139
+ if @api_client.config.debugging
140
+ @api_client.config.logger.debug 'Calling API: ContactGroupsApi.delete_contact_group ...'
141
+ end
142
+ # verify the required parameter 'group_id' is set
143
+ if @api_client.config.client_side_validation && group_id.nil?
144
+ raise ArgumentError, "Missing the required parameter 'group_id' when calling ContactGroupsApi.delete_contact_group"
145
+ end
146
+ # resource path
147
+ local_var_path = '/contact-groups/{group_id}'.sub('{' + 'group_id' + '}', CGI.escape(group_id.to_s))
148
+
149
+ # query parameters
150
+ query_params = opts[:query_params] || {}
151
+
152
+ # header parameters
153
+ header_params = opts[:header_params] || {}
154
+ # HTTP header 'Accept' (if needed)
155
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
156
+
157
+ # form parameters
158
+ form_params = opts[:form_params] || {}
159
+
160
+ # http body (model)
161
+ post_body = opts[:debug_body]
162
+
163
+ # return_type
164
+ return_type = opts[:debug_return_type]
165
+
166
+ # auth_names
167
+ auth_names = opts[:debug_auth_names] || []
168
+
169
+ new_options = opts.merge(
170
+ :operation => :'ContactGroupsApi.delete_contact_group',
171
+ :header_params => header_params,
172
+ :query_params => query_params,
173
+ :form_params => form_params,
174
+ :body => post_body,
175
+ :auth_names => auth_names,
176
+ :return_type => return_type,
177
+ )
178
+
179
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug "API called: ContactGroupsApi#delete_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
182
+ end
183
+
184
+ [data, status_code, headers]
185
+ end
186
+
187
+ # Retrieve a contact group
188
+ # Returns a contact group with the given id.
189
+ # @param group_id [String] Contact group ID
190
+ # @param [Hash] opts the optional parameters
191
+ # @return [ContactGroupResponse]
192
+ def get_contact_group(group_id, opts = {})
193
+ data, _status_code, _headers = get_contact_group_with_http_info(group_id, opts)
194
+ data
195
+ end
196
+
197
+ # Retrieve a contact group
198
+ # Returns a contact group with the given id.
199
+ # @param group_id [String] Contact group ID
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(ContactGroupResponse, Integer, Hash)>] ContactGroupResponse data, response status code and response headers
202
+ def get_contact_group_with_http_info(group_id, opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: ContactGroupsApi.get_contact_group ...'
205
+ end
206
+ # verify the required parameter 'group_id' is set
207
+ if @api_client.config.client_side_validation && group_id.nil?
208
+ raise ArgumentError, "Missing the required parameter 'group_id' when calling ContactGroupsApi.get_contact_group"
209
+ end
210
+ # resource path
211
+ local_var_path = '/contact-groups/{group_id}'.sub('{' + 'group_id' + '}', CGI.escape(group_id.to_s))
212
+
213
+ # query parameters
214
+ query_params = opts[:query_params] || {}
215
+
216
+ # header parameters
217
+ header_params = opts[:header_params] || {}
218
+ # HTTP header 'Accept' (if needed)
219
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
220
+
221
+ # form parameters
222
+ form_params = opts[:form_params] || {}
223
+
224
+ # http body (model)
225
+ post_body = opts[:debug_body]
226
+
227
+ # return_type
228
+ return_type = opts[:debug_return_type] || 'ContactGroupResponse'
229
+
230
+ # auth_names
231
+ auth_names = opts[:debug_auth_names] || []
232
+
233
+ new_options = opts.merge(
234
+ :operation => :'ContactGroupsApi.get_contact_group',
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => return_type,
241
+ )
242
+
243
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: ContactGroupsApi#get_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+
248
+ [data, status_code, headers]
249
+ end
250
+
251
+ # Get all contact groups
252
+ # Returns a list of contact groups for an account.
253
+ # @param [Hash] opts the optional parameters
254
+ # @option opts [Integer] :page Page of results (default to 1)
255
+ # @option opts [Integer] :limit The number of contact groups to return per page (default to 25)
256
+ # @return [ContactGroups]
257
+ def list_contact_groups(opts = {})
258
+ data, _status_code, _headers = list_contact_groups_with_http_info(opts)
259
+ data
260
+ end
261
+
262
+ # Get all contact groups
263
+ # Returns a list of contact groups for an account.
264
+ # @param [Hash] opts the optional parameters
265
+ # @option opts [Integer] :page Page of results (default to 1)
266
+ # @option opts [Integer] :limit The number of contact groups to return per page (default to 25)
267
+ # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers
268
+ def list_contact_groups_with_http_info(opts = {})
269
+ if @api_client.config.debugging
270
+ @api_client.config.logger.debug 'Calling API: ContactGroupsApi.list_contact_groups ...'
271
+ end
272
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
273
+ raise ArgumentError, 'invalid value for "opts[:"page"]" when calling ContactGroupsApi.list_contact_groups, must be greater than or equal to 1.'
274
+ end
275
+
276
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
277
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactGroupsApi.list_contact_groups, must be smaller than or equal to 100.'
278
+ end
279
+
280
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
281
+ raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactGroupsApi.list_contact_groups, must be greater than or equal to 1.'
282
+ end
283
+
284
+ # resource path
285
+ local_var_path = '/contact-groups'
286
+
287
+ # query parameters
288
+ query_params = opts[:query_params] || {}
289
+ query_params[:'page'] = opts[:'page'] unless opts[:'page'].nil?
290
+ query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
291
+
292
+ # header parameters
293
+ header_params = opts[:header_params] || {}
294
+ # HTTP header 'Accept' (if needed)
295
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
296
+
297
+ # form parameters
298
+ form_params = opts[:form_params] || {}
299
+
300
+ # http body (model)
301
+ post_body = opts[:debug_body]
302
+
303
+ # return_type
304
+ return_type = opts[:debug_return_type] || 'ContactGroups'
305
+
306
+ # auth_names
307
+ auth_names = opts[:debug_auth_names] || []
308
+
309
+ new_options = opts.merge(
310
+ :operation => :'ContactGroupsApi.list_contact_groups',
311
+ :header_params => header_params,
312
+ :query_params => query_params,
313
+ :form_params => form_params,
314
+ :body => post_body,
315
+ :auth_names => auth_names,
316
+ :return_type => return_type,
317
+ )
318
+
319
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
320
+ if @api_client.config.debugging
321
+ @api_client.config.logger.debug "API called: ContactGroupsApi#list_contact_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
322
+ end
323
+
324
+ [data, status_code, headers]
325
+ end
326
+
327
+ # Update a contact group
328
+ # Updates a contact group with the given parameters.
329
+ # @param group_id [String] Contact group ID
330
+ # @param [Hash] opts the optional parameters
331
+ # @option opts [String] :name Name of the contact group
332
+ # @option opts [Array<String>] :email_addresses List of email addresses
333
+ # @option opts [Array<String>] :integrations List of integration IDs
334
+ # @option opts [Array<String>] :mobile_numbers List of international format mobile phone numbers
335
+ # @option opts [String] :ping_url URL or IP address of an endpoint to push uptime events. Currently this only supports HTTP GET endpoints
336
+ # @return [nil]
337
+ def update_contact_group(group_id, opts = {})
338
+ update_contact_group_with_http_info(group_id, opts)
339
+ nil
340
+ end
341
+
342
+ # Update a contact group
343
+ # Updates a contact group with the given parameters.
344
+ # @param group_id [String] Contact group ID
345
+ # @param [Hash] opts the optional parameters
346
+ # @option opts [String] :name Name of the contact group
347
+ # @option opts [Array<String>] :email_addresses List of email addresses
348
+ # @option opts [Array<String>] :integrations List of integration IDs
349
+ # @option opts [Array<String>] :mobile_numbers List of international format mobile phone numbers
350
+ # @option opts [String] :ping_url URL or IP address of an endpoint to push uptime events. Currently this only supports HTTP GET endpoints
351
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
352
+ def update_contact_group_with_http_info(group_id, opts = {})
353
+ if @api_client.config.debugging
354
+ @api_client.config.logger.debug 'Calling API: ContactGroupsApi.update_contact_group ...'
355
+ end
356
+ # verify the required parameter 'group_id' is set
357
+ if @api_client.config.client_side_validation && group_id.nil?
358
+ raise ArgumentError, "Missing the required parameter 'group_id' when calling ContactGroupsApi.update_contact_group"
359
+ end
360
+ # resource path
361
+ local_var_path = '/contact-groups/{group_id}'.sub('{' + 'group_id' + '}', CGI.escape(group_id.to_s))
362
+
363
+ # query parameters
364
+ query_params = opts[:query_params] || {}
365
+
366
+ # header parameters
367
+ header_params = opts[:header_params] || {}
368
+ # HTTP header 'Accept' (if needed)
369
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
370
+ # HTTP header 'Content-Type'
371
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
372
+ unless content_type.nil?
373
+ header_params['Content-Type'] = content_type
374
+ end
375
+
376
+ # form parameters
377
+ form_params = opts[:form_params] || {}
378
+ form_params['name'] = opts[:'name'] unless opts[:'name'].nil?
379
+ form_params['email_addresses'] = @api_client.build_collection_param(opts[:'email_addresses'], :csv) unless opts[:'email_addresses'].nil?
380
+ form_params['integrations'] = @api_client.build_collection_param(opts[:'integrations'], :csv) unless opts[:'integrations'].nil?
381
+ form_params['mobile_numbers'] = @api_client.build_collection_param(opts[:'mobile_numbers'], :csv) unless opts[:'mobile_numbers'].nil?
382
+ form_params['ping_url'] = opts[:'ping_url'] unless opts[:'ping_url'].nil?
383
+
384
+ # http body (model)
385
+ post_body = opts[:debug_body]
386
+
387
+ # return_type
388
+ return_type = opts[:debug_return_type]
389
+
390
+ # auth_names
391
+ auth_names = opts[:debug_auth_names] || []
392
+
393
+ new_options = opts.merge(
394
+ :operation => :'ContactGroupsApi.update_contact_group',
395
+ :header_params => header_params,
396
+ :query_params => query_params,
397
+ :form_params => form_params,
398
+ :body => post_body,
399
+ :auth_names => auth_names,
400
+ :return_type => return_type,
401
+ )
402
+
403
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
404
+ if @api_client.config.debugging
405
+ @api_client.config.logger.debug "API called: ContactGroupsApi#update_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
406
+ end
407
+
408
+ [data, status_code, headers]
409
+ end
410
+ end
411
+ end
@@ -0,0 +1,166 @@
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 LocationsApi
35
+ attr_accessor :api_client
36
+
37
+ def initialize(api_client = ApiClient.default)
38
+ @api_client = api_client
39
+ end
40
+
41
+ # Get all pagespeed monitoring locations
42
+ # Returns a list of locations detailing server information for pagespeed monitoring servers. This information can be used to create further checks using the API.
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [String] :location Alpha-2 ISO 3166-1 country code
45
+ # @return [MonitoringLocations]
46
+ def list_pagespeed_monitoring_locations(opts = {})
47
+ data, _status_code, _headers = list_pagespeed_monitoring_locations_with_http_info(opts)
48
+ data
49
+ end
50
+
51
+ # Get all pagespeed monitoring locations
52
+ # Returns a list of locations detailing server information for pagespeed monitoring servers. This information can be used to create further checks using the API.
53
+ # @param [Hash] opts the optional parameters
54
+ # @option opts [String] :location Alpha-2 ISO 3166-1 country code
55
+ # @return [Array<(MonitoringLocations, Integer, Hash)>] MonitoringLocations data, response status code and response headers
56
+ def list_pagespeed_monitoring_locations_with_http_info(opts = {})
57
+ if @api_client.config.debugging
58
+ @api_client.config.logger.debug 'Calling API: LocationsApi.list_pagespeed_monitoring_locations ...'
59
+ end
60
+ # resource path
61
+ local_var_path = '/pagespeed-locations'
62
+
63
+ # query parameters
64
+ query_params = opts[:query_params] || {}
65
+ query_params[:'location'] = opts[:'location'] unless opts[:'location'].nil?
66
+
67
+ # header parameters
68
+ header_params = opts[:header_params] || {}
69
+ # HTTP header 'Accept' (if needed)
70
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
71
+
72
+ # form parameters
73
+ form_params = opts[:form_params] || {}
74
+
75
+ # http body (model)
76
+ post_body = opts[:debug_body]
77
+
78
+ # return_type
79
+ return_type = opts[:debug_return_type] || 'MonitoringLocations'
80
+
81
+ # auth_names
82
+ auth_names = opts[:debug_auth_names] || []
83
+
84
+ new_options = opts.merge(
85
+ :operation => :'LocationsApi.list_pagespeed_monitoring_locations',
86
+ :header_params => header_params,
87
+ :query_params => query_params,
88
+ :form_params => form_params,
89
+ :body => post_body,
90
+ :auth_names => auth_names,
91
+ :return_type => return_type,
92
+ )
93
+
94
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug "API called: LocationsApi#list_pagespeed_monitoring_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97
+ end
98
+
99
+ [data, status_code, headers]
100
+ end
101
+
102
+ # Get all uptime monitoring locations
103
+ # Returns a list of locations detailing server information for uptime monitoring servers. This information can be used to create further checks using the API.
104
+ # @param [Hash] opts the optional parameters
105
+ # @option opts [String] :location Alpha-3 ISO 3166-1 country code
106
+ # @option opts [String] :region_code Server region code
107
+ # @return [MonitoringLocations]
108
+ def list_uptime_monitoring_locations(opts = {})
109
+ data, _status_code, _headers = list_uptime_monitoring_locations_with_http_info(opts)
110
+ data
111
+ end
112
+
113
+ # Get all uptime monitoring locations
114
+ # Returns a list of locations detailing server information for uptime monitoring servers. This information can be used to create further checks using the API.
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [String] :location Alpha-3 ISO 3166-1 country code
117
+ # @option opts [String] :region_code Server region code
118
+ # @return [Array<(MonitoringLocations, Integer, Hash)>] MonitoringLocations data, response status code and response headers
119
+ def list_uptime_monitoring_locations_with_http_info(opts = {})
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug 'Calling API: LocationsApi.list_uptime_monitoring_locations ...'
122
+ end
123
+ # resource path
124
+ local_var_path = '/uptime-locations'
125
+
126
+ # query parameters
127
+ query_params = opts[:query_params] || {}
128
+ query_params[:'location'] = opts[:'location'] unless opts[:'location'].nil?
129
+ query_params[:'region_code'] = opts[:'region_code'] unless opts[:'region_code'].nil?
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
135
+
136
+ # form parameters
137
+ form_params = opts[:form_params] || {}
138
+
139
+ # http body (model)
140
+ post_body = opts[:debug_body]
141
+
142
+ # return_type
143
+ return_type = opts[:debug_return_type] || 'MonitoringLocations'
144
+
145
+ # auth_names
146
+ auth_names = opts[:debug_auth_names] || []
147
+
148
+ new_options = opts.merge(
149
+ :operation => :'LocationsApi.list_uptime_monitoring_locations',
150
+ :header_params => header_params,
151
+ :query_params => query_params,
152
+ :form_params => form_params,
153
+ :body => post_body,
154
+ :auth_names => auth_names,
155
+ :return_type => return_type,
156
+ )
157
+
158
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug "API called: LocationsApi#list_uptime_monitoring_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
+ end
162
+
163
+ [data, status_code, headers]
164
+ end
165
+ end
166
+ end