browserup_mitmproxy_client 1.1
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 +9 -0
- data/Gemfile.lock +68 -0
- data/README.md +119 -0
- data/Rakefile +10 -0
- data/browserup_mitmproxy_client.gemspec +38 -0
- data/docs/BrowserUpProxyApi.md +657 -0
- data/docs/Counter.md +20 -0
- data/docs/Entry.md +38 -0
- data/docs/EntryRequest.md +36 -0
- data/docs/EntryRequestCookies.md +32 -0
- data/docs/EntryRequestQueryString.md +22 -0
- data/docs/EntryResponse.md +36 -0
- data/docs/EntryResponseContent.md +28 -0
- data/docs/EntryTimings.md +32 -0
- data/docs/Error.md +20 -0
- data/docs/Har.md +18 -0
- data/docs/HarLog.md +28 -0
- data/docs/HarLogCreator.md +22 -0
- data/docs/Header.md +22 -0
- data/docs/MatchCriteria.md +44 -0
- data/docs/NameValuePair.md +20 -0
- data/docs/Page.md +32 -0
- data/docs/PagePageTimings.md +22 -0
- data/docs/VerifyResult.md +22 -0
- data/docs/WebSocketMessage.md +24 -0
- data/git_push.sh +58 -0
- data/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb +689 -0
- data/lib/browserup_mitmproxy_client/api_client.rb +389 -0
- data/lib/browserup_mitmproxy_client/api_error.rb +57 -0
- data/lib/browserup_mitmproxy_client/configuration.rb +279 -0
- data/lib/browserup_mitmproxy_client/models/counter.rb +239 -0
- data/lib/browserup_mitmproxy_client/models/entry.rb +359 -0
- data/lib/browserup_mitmproxy_client/models/entry_request.rb +346 -0
- data/lib/browserup_mitmproxy_client/models/entry_request_cookies.rb +291 -0
- data/lib/browserup_mitmproxy_client/models/entry_request_query_string.rb +246 -0
- data/lib/browserup_mitmproxy_client/models/entry_response.rb +348 -0
- data/lib/browserup_mitmproxy_client/models/entry_response_content.rb +273 -0
- data/lib/browserup_mitmproxy_client/models/entry_timings.rb +463 -0
- data/lib/browserup_mitmproxy_client/models/error.rb +229 -0
- data/lib/browserup_mitmproxy_client/models/har.rb +223 -0
- data/lib/browserup_mitmproxy_client/models/har_log.rb +287 -0
- data/lib/browserup_mitmproxy_client/models/har_log_creator.rb +246 -0
- data/lib/browserup_mitmproxy_client/models/header.rb +246 -0
- data/lib/browserup_mitmproxy_client/models/match_criteria.rb +346 -0
- data/lib/browserup_mitmproxy_client/models/name_value_pair.rb +229 -0
- data/lib/browserup_mitmproxy_client/models/page.rb +312 -0
- data/lib/browserup_mitmproxy_client/models/page_page_timings.rb +288 -0
- data/lib/browserup_mitmproxy_client/models/verify_result.rb +254 -0
- data/lib/browserup_mitmproxy_client/models/web_socket_message.rb +265 -0
- data/lib/browserup_mitmproxy_client/version.rb +15 -0
- data/lib/browserup_mitmproxy_client.rb +59 -0
- data/spec/api/browser_up_proxy_api_spec.rb +148 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/counter_spec.rb +40 -0
- data/spec/models/entry_request_cookies_spec.rb +76 -0
- data/spec/models/entry_request_query_string_spec.rb +46 -0
- data/spec/models/entry_request_spec.rb +88 -0
- data/spec/models/entry_response_content_spec.rb +64 -0
- data/spec/models/entry_response_spec.rb +88 -0
- data/spec/models/entry_spec.rb +94 -0
- data/spec/models/entry_timings_spec.rb +76 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/har_log_creator_spec.rb +46 -0
- data/spec/models/har_log_spec.rb +64 -0
- data/spec/models/har_spec.rb +34 -0
- data/spec/models/header_spec.rb +46 -0
- data/spec/models/match_criteria_spec.rb +112 -0
- data/spec/models/name_value_pair_spec.rb +40 -0
- data/spec/models/page_page_timings_spec.rb +46 -0
- data/spec/models/page_spec.rb +76 -0
- data/spec/models/verify_result_spec.rb +46 -0
- data/spec/models/web_socket_message_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +181 -0
@@ -0,0 +1,689 @@
|
|
1
|
+
=begin
|
2
|
+
#BrowserUp MitmProxy
|
3
|
+
|
4
|
+
#___ This is the REST API for controlling the BrowserUp MitmProxy. The BrowserUp MitmProxy is a swiss army knife for automated testing that captures HTTP traffic in HAR files. It is also useful for Selenium/Cypress tests. ___
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module BrowserupMitmProxy
|
16
|
+
class BrowserUpProxyApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Add Custom Counter to the captured traffic har
|
23
|
+
# @param counter [Counter] Receives a new counter to add. The counter is stored, under the hood, in an array in the har under the _counters key
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [nil]
|
26
|
+
def add_counter(counter, opts = {})
|
27
|
+
add_counter_with_http_info(counter, opts)
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
# Add Custom Counter to the captured traffic har
|
32
|
+
# @param counter [Counter] Receives a new counter to add. The counter is stored, under the hood, in an array in the har under the _counters key
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
35
|
+
def add_counter_with_http_info(counter, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.add_counter ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'counter' is set
|
40
|
+
if @api_client.config.client_side_validation && counter.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'counter' when calling BrowserUpProxyApi.add_counter"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/har/counters'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = opts[:query_params] || {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = opts[:header_params] || {}
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(counter)
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type]
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || []
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"BrowserUpProxyApi.add_counter",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#add_counter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Add Custom Error to the captured traffic har
|
84
|
+
# @param error [Error] Receives an error to track. Internally, the error is stored in an array in the har under the _errors key
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [nil]
|
87
|
+
def add_error(error, opts = {})
|
88
|
+
add_error_with_http_info(error, opts)
|
89
|
+
nil
|
90
|
+
end
|
91
|
+
|
92
|
+
# Add Custom Error to the captured traffic har
|
93
|
+
# @param error [Error] Receives an error to track. Internally, the error is stored in an array in the har under the _errors key
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
96
|
+
def add_error_with_http_info(error, opts = {})
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.add_error ...'
|
99
|
+
end
|
100
|
+
# verify the required parameter 'error' is set
|
101
|
+
if @api_client.config.client_side_validation && error.nil?
|
102
|
+
fail ArgumentError, "Missing the required parameter 'error' when calling BrowserUpProxyApi.add_error"
|
103
|
+
end
|
104
|
+
# resource path
|
105
|
+
local_var_path = '/har/errors'
|
106
|
+
|
107
|
+
# query parameters
|
108
|
+
query_params = opts[:query_params] || {}
|
109
|
+
|
110
|
+
# header parameters
|
111
|
+
header_params = opts[:header_params] || {}
|
112
|
+
# HTTP header 'Content-Type'
|
113
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
114
|
+
|
115
|
+
# form parameters
|
116
|
+
form_params = opts[:form_params] || {}
|
117
|
+
|
118
|
+
# http body (model)
|
119
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(error)
|
120
|
+
|
121
|
+
# return_type
|
122
|
+
return_type = opts[:debug_return_type]
|
123
|
+
|
124
|
+
# auth_names
|
125
|
+
auth_names = opts[:debug_auth_names] || []
|
126
|
+
|
127
|
+
new_options = opts.merge(
|
128
|
+
:operation => :"BrowserUpProxyApi.add_error",
|
129
|
+
:header_params => header_params,
|
130
|
+
:query_params => query_params,
|
131
|
+
:form_params => form_params,
|
132
|
+
:body => post_body,
|
133
|
+
:auth_names => auth_names,
|
134
|
+
:return_type => return_type
|
135
|
+
)
|
136
|
+
|
137
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
138
|
+
if @api_client.config.debugging
|
139
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#add_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
140
|
+
end
|
141
|
+
return data, status_code, headers
|
142
|
+
end
|
143
|
+
|
144
|
+
# Get the current HAR.
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @return [Har]
|
147
|
+
def get_har_log(opts = {})
|
148
|
+
data, _status_code, _headers = get_har_log_with_http_info(opts)
|
149
|
+
data
|
150
|
+
end
|
151
|
+
|
152
|
+
# Get the current HAR.
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @return [Array<(Har, Integer, Hash)>] Har data, response status code and response headers
|
155
|
+
def get_har_log_with_http_info(opts = {})
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.get_har_log ...'
|
158
|
+
end
|
159
|
+
# resource path
|
160
|
+
local_var_path = '/har'
|
161
|
+
|
162
|
+
# query parameters
|
163
|
+
query_params = opts[:query_params] || {}
|
164
|
+
|
165
|
+
# header parameters
|
166
|
+
header_params = opts[:header_params] || {}
|
167
|
+
# HTTP header 'Accept' (if needed)
|
168
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
169
|
+
|
170
|
+
# form parameters
|
171
|
+
form_params = opts[:form_params] || {}
|
172
|
+
|
173
|
+
# http body (model)
|
174
|
+
post_body = opts[:debug_body]
|
175
|
+
|
176
|
+
# return_type
|
177
|
+
return_type = opts[:debug_return_type] || 'Har'
|
178
|
+
|
179
|
+
# auth_names
|
180
|
+
auth_names = opts[:debug_auth_names] || []
|
181
|
+
|
182
|
+
new_options = opts.merge(
|
183
|
+
:operation => :"BrowserUpProxyApi.get_har_log",
|
184
|
+
:header_params => header_params,
|
185
|
+
:query_params => query_params,
|
186
|
+
:form_params => form_params,
|
187
|
+
:body => post_body,
|
188
|
+
:auth_names => auth_names,
|
189
|
+
:return_type => return_type
|
190
|
+
)
|
191
|
+
|
192
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
193
|
+
if @api_client.config.debugging
|
194
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#get_har_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
195
|
+
end
|
196
|
+
return data, status_code, headers
|
197
|
+
end
|
198
|
+
|
199
|
+
# Get the healthcheck
|
200
|
+
# @param [Hash] opts the optional parameters
|
201
|
+
# @return [nil]
|
202
|
+
def healthcheck(opts = {})
|
203
|
+
healthcheck_with_http_info(opts)
|
204
|
+
nil
|
205
|
+
end
|
206
|
+
|
207
|
+
# Get the healthcheck
|
208
|
+
# @param [Hash] opts the optional parameters
|
209
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
210
|
+
def healthcheck_with_http_info(opts = {})
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.healthcheck ...'
|
213
|
+
end
|
214
|
+
# resource path
|
215
|
+
local_var_path = '/healthcheck'
|
216
|
+
|
217
|
+
# query parameters
|
218
|
+
query_params = opts[:query_params] || {}
|
219
|
+
|
220
|
+
# header parameters
|
221
|
+
header_params = opts[:header_params] || {}
|
222
|
+
|
223
|
+
# form parameters
|
224
|
+
form_params = opts[:form_params] || {}
|
225
|
+
|
226
|
+
# http body (model)
|
227
|
+
post_body = opts[:debug_body]
|
228
|
+
|
229
|
+
# return_type
|
230
|
+
return_type = opts[:debug_return_type]
|
231
|
+
|
232
|
+
# auth_names
|
233
|
+
auth_names = opts[:debug_auth_names] || []
|
234
|
+
|
235
|
+
new_options = opts.merge(
|
236
|
+
:operation => :"BrowserUpProxyApi.healthcheck",
|
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(:GET, local_var_path, new_options)
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#healthcheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
248
|
+
end
|
249
|
+
return data, status_code, headers
|
250
|
+
end
|
251
|
+
|
252
|
+
# Starts a fresh HAR Page (Step) in the current active HAR to group requests.
|
253
|
+
# @param title [String] The unique title for this har page/step.
|
254
|
+
# @param [Hash] opts the optional parameters
|
255
|
+
# @return [Har]
|
256
|
+
def new_page(title, opts = {})
|
257
|
+
data, _status_code, _headers = new_page_with_http_info(title, opts)
|
258
|
+
data
|
259
|
+
end
|
260
|
+
|
261
|
+
# Starts a fresh HAR Page (Step) in the current active HAR to group requests.
|
262
|
+
# @param title [String] The unique title for this har page/step.
|
263
|
+
# @param [Hash] opts the optional parameters
|
264
|
+
# @return [Array<(Har, Integer, Hash)>] Har data, response status code and response headers
|
265
|
+
def new_page_with_http_info(title, opts = {})
|
266
|
+
if @api_client.config.debugging
|
267
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.new_page ...'
|
268
|
+
end
|
269
|
+
# verify the required parameter 'title' is set
|
270
|
+
if @api_client.config.client_side_validation && title.nil?
|
271
|
+
fail ArgumentError, "Missing the required parameter 'title' when calling BrowserUpProxyApi.new_page"
|
272
|
+
end
|
273
|
+
pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
|
274
|
+
if @api_client.config.client_side_validation && title !~ pattern
|
275
|
+
fail ArgumentError, "invalid value for 'title' when calling BrowserUpProxyApi.new_page, must conform to the pattern #{pattern}."
|
276
|
+
end
|
277
|
+
|
278
|
+
# resource path
|
279
|
+
local_var_path = '/har/page'.sub('{' + 'title' + '}', CGI.escape(title.to_s))
|
280
|
+
|
281
|
+
# query parameters
|
282
|
+
query_params = opts[:query_params] || {}
|
283
|
+
|
284
|
+
# header parameters
|
285
|
+
header_params = opts[:header_params] || {}
|
286
|
+
# HTTP header 'Accept' (if needed)
|
287
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
288
|
+
|
289
|
+
# form parameters
|
290
|
+
form_params = opts[:form_params] || {}
|
291
|
+
|
292
|
+
# http body (model)
|
293
|
+
post_body = opts[:debug_body]
|
294
|
+
|
295
|
+
# return_type
|
296
|
+
return_type = opts[:debug_return_type] || 'Har'
|
297
|
+
|
298
|
+
# auth_names
|
299
|
+
auth_names = opts[:debug_auth_names] || []
|
300
|
+
|
301
|
+
new_options = opts.merge(
|
302
|
+
:operation => :"BrowserUpProxyApi.new_page",
|
303
|
+
:header_params => header_params,
|
304
|
+
:query_params => query_params,
|
305
|
+
:form_params => form_params,
|
306
|
+
:body => post_body,
|
307
|
+
:auth_names => auth_names,
|
308
|
+
:return_type => return_type
|
309
|
+
)
|
310
|
+
|
311
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
312
|
+
if @api_client.config.debugging
|
313
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#new_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
314
|
+
end
|
315
|
+
return data, status_code, headers
|
316
|
+
end
|
317
|
+
|
318
|
+
# Starts a fresh HAR capture session.
|
319
|
+
# @param [Hash] opts the optional parameters
|
320
|
+
# @return [Har]
|
321
|
+
def reset_har_log(opts = {})
|
322
|
+
data, _status_code, _headers = reset_har_log_with_http_info(opts)
|
323
|
+
data
|
324
|
+
end
|
325
|
+
|
326
|
+
# Starts a fresh HAR capture session.
|
327
|
+
# @param [Hash] opts the optional parameters
|
328
|
+
# @return [Array<(Har, Integer, Hash)>] Har data, response status code and response headers
|
329
|
+
def reset_har_log_with_http_info(opts = {})
|
330
|
+
if @api_client.config.debugging
|
331
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.reset_har_log ...'
|
332
|
+
end
|
333
|
+
# resource path
|
334
|
+
local_var_path = '/har'
|
335
|
+
|
336
|
+
# query parameters
|
337
|
+
query_params = opts[:query_params] || {}
|
338
|
+
|
339
|
+
# header parameters
|
340
|
+
header_params = opts[:header_params] || {}
|
341
|
+
# HTTP header 'Accept' (if needed)
|
342
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
343
|
+
|
344
|
+
# form parameters
|
345
|
+
form_params = opts[:form_params] || {}
|
346
|
+
|
347
|
+
# http body (model)
|
348
|
+
post_body = opts[:debug_body]
|
349
|
+
|
350
|
+
# return_type
|
351
|
+
return_type = opts[:debug_return_type] || 'Har'
|
352
|
+
|
353
|
+
# auth_names
|
354
|
+
auth_names = opts[:debug_auth_names] || []
|
355
|
+
|
356
|
+
new_options = opts.merge(
|
357
|
+
:operation => :"BrowserUpProxyApi.reset_har_log",
|
358
|
+
:header_params => header_params,
|
359
|
+
:query_params => query_params,
|
360
|
+
:form_params => form_params,
|
361
|
+
:body => post_body,
|
362
|
+
:auth_names => auth_names,
|
363
|
+
:return_type => return_type
|
364
|
+
)
|
365
|
+
|
366
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
367
|
+
if @api_client.config.debugging
|
368
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#reset_har_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
369
|
+
end
|
370
|
+
return data, status_code, headers
|
371
|
+
end
|
372
|
+
|
373
|
+
# Verify no matching items are present in the captured traffic
|
374
|
+
# @param name [String] The unique name for this verification operation
|
375
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
376
|
+
# @param [Hash] opts the optional parameters
|
377
|
+
# @return [VerifyResult]
|
378
|
+
def verify_not_present(name, match_criteria, opts = {})
|
379
|
+
data, _status_code, _headers = verify_not_present_with_http_info(name, match_criteria, opts)
|
380
|
+
data
|
381
|
+
end
|
382
|
+
|
383
|
+
# Verify no matching items are present in the captured traffic
|
384
|
+
# @param name [String] The unique name for this verification operation
|
385
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
386
|
+
# @param [Hash] opts the optional parameters
|
387
|
+
# @return [Array<(VerifyResult, Integer, Hash)>] VerifyResult data, response status code and response headers
|
388
|
+
def verify_not_present_with_http_info(name, match_criteria, opts = {})
|
389
|
+
if @api_client.config.debugging
|
390
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_not_present ...'
|
391
|
+
end
|
392
|
+
# verify the required parameter 'name' is set
|
393
|
+
if @api_client.config.client_side_validation && name.nil?
|
394
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_not_present"
|
395
|
+
end
|
396
|
+
pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
|
397
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
398
|
+
fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_not_present, must conform to the pattern #{pattern}."
|
399
|
+
end
|
400
|
+
|
401
|
+
# verify the required parameter 'match_criteria' is set
|
402
|
+
if @api_client.config.client_side_validation && match_criteria.nil?
|
403
|
+
fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_not_present"
|
404
|
+
end
|
405
|
+
# resource path
|
406
|
+
local_var_path = '/verify/not_present/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
407
|
+
|
408
|
+
# query parameters
|
409
|
+
query_params = opts[:query_params] || {}
|
410
|
+
|
411
|
+
# header parameters
|
412
|
+
header_params = opts[:header_params] || {}
|
413
|
+
# HTTP header 'Accept' (if needed)
|
414
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
415
|
+
# HTTP header 'Content-Type'
|
416
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
417
|
+
|
418
|
+
# form parameters
|
419
|
+
form_params = opts[:form_params] || {}
|
420
|
+
|
421
|
+
# http body (model)
|
422
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)
|
423
|
+
|
424
|
+
# return_type
|
425
|
+
return_type = opts[:debug_return_type] || 'VerifyResult'
|
426
|
+
|
427
|
+
# auth_names
|
428
|
+
auth_names = opts[:debug_auth_names] || []
|
429
|
+
|
430
|
+
new_options = opts.merge(
|
431
|
+
:operation => :"BrowserUpProxyApi.verify_not_present",
|
432
|
+
:header_params => header_params,
|
433
|
+
:query_params => query_params,
|
434
|
+
:form_params => form_params,
|
435
|
+
:body => post_body,
|
436
|
+
:auth_names => auth_names,
|
437
|
+
:return_type => return_type
|
438
|
+
)
|
439
|
+
|
440
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
441
|
+
if @api_client.config.debugging
|
442
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_not_present\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
443
|
+
end
|
444
|
+
return data, status_code, headers
|
445
|
+
end
|
446
|
+
|
447
|
+
# Verify at least one matching item is present in the captured traffic
|
448
|
+
# @param name [String] The unique name for this verification operation
|
449
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
450
|
+
# @param [Hash] opts the optional parameters
|
451
|
+
# @return [VerifyResult]
|
452
|
+
def verify_present(name, match_criteria, opts = {})
|
453
|
+
data, _status_code, _headers = verify_present_with_http_info(name, match_criteria, opts)
|
454
|
+
data
|
455
|
+
end
|
456
|
+
|
457
|
+
# Verify at least one matching item is present in the captured traffic
|
458
|
+
# @param name [String] The unique name for this verification operation
|
459
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
460
|
+
# @param [Hash] opts the optional parameters
|
461
|
+
# @return [Array<(VerifyResult, Integer, Hash)>] VerifyResult data, response status code and response headers
|
462
|
+
def verify_present_with_http_info(name, match_criteria, opts = {})
|
463
|
+
if @api_client.config.debugging
|
464
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_present ...'
|
465
|
+
end
|
466
|
+
# verify the required parameter 'name' is set
|
467
|
+
if @api_client.config.client_side_validation && name.nil?
|
468
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_present"
|
469
|
+
end
|
470
|
+
pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
|
471
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
472
|
+
fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_present, must conform to the pattern #{pattern}."
|
473
|
+
end
|
474
|
+
|
475
|
+
# verify the required parameter 'match_criteria' is set
|
476
|
+
if @api_client.config.client_side_validation && match_criteria.nil?
|
477
|
+
fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_present"
|
478
|
+
end
|
479
|
+
# resource path
|
480
|
+
local_var_path = '/verify/present/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
481
|
+
|
482
|
+
# query parameters
|
483
|
+
query_params = opts[:query_params] || {}
|
484
|
+
|
485
|
+
# header parameters
|
486
|
+
header_params = opts[:header_params] || {}
|
487
|
+
# HTTP header 'Accept' (if needed)
|
488
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
489
|
+
# HTTP header 'Content-Type'
|
490
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
491
|
+
|
492
|
+
# form parameters
|
493
|
+
form_params = opts[:form_params] || {}
|
494
|
+
|
495
|
+
# http body (model)
|
496
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)
|
497
|
+
|
498
|
+
# return_type
|
499
|
+
return_type = opts[:debug_return_type] || 'VerifyResult'
|
500
|
+
|
501
|
+
# auth_names
|
502
|
+
auth_names = opts[:debug_auth_names] || []
|
503
|
+
|
504
|
+
new_options = opts.merge(
|
505
|
+
:operation => :"BrowserUpProxyApi.verify_present",
|
506
|
+
:header_params => header_params,
|
507
|
+
:query_params => query_params,
|
508
|
+
:form_params => form_params,
|
509
|
+
:body => post_body,
|
510
|
+
:auth_names => auth_names,
|
511
|
+
:return_type => return_type
|
512
|
+
)
|
513
|
+
|
514
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
515
|
+
if @api_client.config.debugging
|
516
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_present\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
517
|
+
end
|
518
|
+
return data, status_code, headers
|
519
|
+
end
|
520
|
+
|
521
|
+
# Verify matching items in the captured traffic meet the size criteria
|
522
|
+
# @param size [Integer] The size used for comparison, in kilobytes
|
523
|
+
# @param name [String] The unique name for this verification operation
|
524
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
525
|
+
# @param [Hash] opts the optional parameters
|
526
|
+
# @return [VerifyResult]
|
527
|
+
def verify_size(size, name, match_criteria, opts = {})
|
528
|
+
data, _status_code, _headers = verify_size_with_http_info(size, name, match_criteria, opts)
|
529
|
+
data
|
530
|
+
end
|
531
|
+
|
532
|
+
# Verify matching items in the captured traffic meet the size criteria
|
533
|
+
# @param size [Integer] The size used for comparison, in kilobytes
|
534
|
+
# @param name [String] The unique name for this verification operation
|
535
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
536
|
+
# @param [Hash] opts the optional parameters
|
537
|
+
# @return [Array<(VerifyResult, Integer, Hash)>] VerifyResult data, response status code and response headers
|
538
|
+
def verify_size_with_http_info(size, name, match_criteria, opts = {})
|
539
|
+
if @api_client.config.debugging
|
540
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_size ...'
|
541
|
+
end
|
542
|
+
# verify the required parameter 'size' is set
|
543
|
+
if @api_client.config.client_side_validation && size.nil?
|
544
|
+
fail ArgumentError, "Missing the required parameter 'size' when calling BrowserUpProxyApi.verify_size"
|
545
|
+
end
|
546
|
+
if @api_client.config.client_side_validation && size < 0
|
547
|
+
fail ArgumentError, 'invalid value for "size" when calling BrowserUpProxyApi.verify_size, must be greater than or equal to 0.'
|
548
|
+
end
|
549
|
+
|
550
|
+
# verify the required parameter 'name' is set
|
551
|
+
if @api_client.config.client_side_validation && name.nil?
|
552
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_size"
|
553
|
+
end
|
554
|
+
pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
|
555
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
556
|
+
fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_size, must conform to the pattern #{pattern}."
|
557
|
+
end
|
558
|
+
|
559
|
+
# verify the required parameter 'match_criteria' is set
|
560
|
+
if @api_client.config.client_side_validation && match_criteria.nil?
|
561
|
+
fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_size"
|
562
|
+
end
|
563
|
+
# resource path
|
564
|
+
local_var_path = '/verify/size/{size}/{name}'.sub('{' + 'size' + '}', CGI.escape(size.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
565
|
+
|
566
|
+
# query parameters
|
567
|
+
query_params = opts[:query_params] || {}
|
568
|
+
|
569
|
+
# header parameters
|
570
|
+
header_params = opts[:header_params] || {}
|
571
|
+
# HTTP header 'Accept' (if needed)
|
572
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
573
|
+
# HTTP header 'Content-Type'
|
574
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
575
|
+
|
576
|
+
# form parameters
|
577
|
+
form_params = opts[:form_params] || {}
|
578
|
+
|
579
|
+
# http body (model)
|
580
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)
|
581
|
+
|
582
|
+
# return_type
|
583
|
+
return_type = opts[:debug_return_type] || 'VerifyResult'
|
584
|
+
|
585
|
+
# auth_names
|
586
|
+
auth_names = opts[:debug_auth_names] || []
|
587
|
+
|
588
|
+
new_options = opts.merge(
|
589
|
+
:operation => :"BrowserUpProxyApi.verify_size",
|
590
|
+
:header_params => header_params,
|
591
|
+
:query_params => query_params,
|
592
|
+
:form_params => form_params,
|
593
|
+
:body => post_body,
|
594
|
+
:auth_names => auth_names,
|
595
|
+
:return_type => return_type
|
596
|
+
)
|
597
|
+
|
598
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
599
|
+
if @api_client.config.debugging
|
600
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_size\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
601
|
+
end
|
602
|
+
return data, status_code, headers
|
603
|
+
end
|
604
|
+
|
605
|
+
# Verify each traffic item matching the criteria meets is below SLA time
|
606
|
+
# @param time [Integer] The time used for comparison
|
607
|
+
# @param name [String] The unique name for this verification operation
|
608
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
609
|
+
# @param [Hash] opts the optional parameters
|
610
|
+
# @return [VerifyResult]
|
611
|
+
def verify_sla(time, name, match_criteria, opts = {})
|
612
|
+
data, _status_code, _headers = verify_sla_with_http_info(time, name, match_criteria, opts)
|
613
|
+
data
|
614
|
+
end
|
615
|
+
|
616
|
+
# Verify each traffic item matching the criteria meets is below SLA time
|
617
|
+
# @param time [Integer] The time used for comparison
|
618
|
+
# @param name [String] The unique name for this verification operation
|
619
|
+
# @param match_criteria [MatchCriteria] Match criteria to select requests - response pairs for size tests
|
620
|
+
# @param [Hash] opts the optional parameters
|
621
|
+
# @return [Array<(VerifyResult, Integer, Hash)>] VerifyResult data, response status code and response headers
|
622
|
+
def verify_sla_with_http_info(time, name, match_criteria, opts = {})
|
623
|
+
if @api_client.config.debugging
|
624
|
+
@api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_sla ...'
|
625
|
+
end
|
626
|
+
# verify the required parameter 'time' is set
|
627
|
+
if @api_client.config.client_side_validation && time.nil?
|
628
|
+
fail ArgumentError, "Missing the required parameter 'time' when calling BrowserUpProxyApi.verify_sla"
|
629
|
+
end
|
630
|
+
if @api_client.config.client_side_validation && time < 0
|
631
|
+
fail ArgumentError, 'invalid value for "time" when calling BrowserUpProxyApi.verify_sla, must be greater than or equal to 0.'
|
632
|
+
end
|
633
|
+
|
634
|
+
# verify the required parameter 'name' is set
|
635
|
+
if @api_client.config.client_side_validation && name.nil?
|
636
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_sla"
|
637
|
+
end
|
638
|
+
pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
|
639
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
640
|
+
fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_sla, must conform to the pattern #{pattern}."
|
641
|
+
end
|
642
|
+
|
643
|
+
# verify the required parameter 'match_criteria' is set
|
644
|
+
if @api_client.config.client_side_validation && match_criteria.nil?
|
645
|
+
fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_sla"
|
646
|
+
end
|
647
|
+
# resource path
|
648
|
+
local_var_path = '/verify/sla/{time}/{name}'.sub('{' + 'time' + '}', CGI.escape(time.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
|
649
|
+
|
650
|
+
# query parameters
|
651
|
+
query_params = opts[:query_params] || {}
|
652
|
+
|
653
|
+
# header parameters
|
654
|
+
header_params = opts[:header_params] || {}
|
655
|
+
# HTTP header 'Accept' (if needed)
|
656
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
657
|
+
# HTTP header 'Content-Type'
|
658
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
659
|
+
|
660
|
+
# form parameters
|
661
|
+
form_params = opts[:form_params] || {}
|
662
|
+
|
663
|
+
# http body (model)
|
664
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)
|
665
|
+
|
666
|
+
# return_type
|
667
|
+
return_type = opts[:debug_return_type] || 'VerifyResult'
|
668
|
+
|
669
|
+
# auth_names
|
670
|
+
auth_names = opts[:debug_auth_names] || []
|
671
|
+
|
672
|
+
new_options = opts.merge(
|
673
|
+
:operation => :"BrowserUpProxyApi.verify_sla",
|
674
|
+
:header_params => header_params,
|
675
|
+
:query_params => query_params,
|
676
|
+
:form_params => form_params,
|
677
|
+
:body => post_body,
|
678
|
+
:auth_names => auth_names,
|
679
|
+
:return_type => return_type
|
680
|
+
)
|
681
|
+
|
682
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
683
|
+
if @api_client.config.debugging
|
684
|
+
@api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_sla\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
685
|
+
end
|
686
|
+
return data, status_code, headers
|
687
|
+
end
|
688
|
+
end
|
689
|
+
end
|