Class: BrowserupMitmProxy::BrowserUpProxyApi

Inherits:
Object
  • Object
show all
Defined in:
lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BrowserUpProxyApi

Returns a new instance of BrowserUpProxyApi.



19
20
21
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_counter(counter, opts = {}) ⇒ nil

Add Custom Counter to the captured traffic har

Parameters:

  • 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

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


26
27
28
29
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 26

def add_counter(counter, opts = {})
  add_counter_with_http_info(counter, opts)
  nil
end

#add_counter_with_http_info(counter, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add Custom Counter to the captured traffic har

Parameters:

  • 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

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 35

def add_counter_with_http_info(counter, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.add_counter ...'
  end
  # verify the required parameter 'counter' is set
  if @api_client.config.client_side_validation && counter.nil?
    fail ArgumentError, "Missing the required parameter 'counter' when calling BrowserUpProxyApi.add_counter"
  end
  # resource path
  local_var_path = '/har/counters'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(counter)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.add_counter",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#add_counter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_error(error, opts = {}) ⇒ nil

Add Custom Error to the captured traffic har

Parameters:

  • error (Error)

    Receives an error to track. Internally, the error is stored in an array in the har under the _errors key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


87
88
89
90
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 87

def add_error(error, opts = {})
  add_error_with_http_info(error, opts)
  nil
end

#add_error_with_http_info(error, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add Custom Error to the captured traffic har

Parameters:

  • error (Error)

    Receives an error to track. Internally, the error is stored in an array in the har under the _errors key

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 96

def add_error_with_http_info(error, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.add_error ...'
  end
  # verify the required parameter 'error' is set
  if @api_client.config.client_side_validation && error.nil?
    fail ArgumentError, "Missing the required parameter 'error' when calling BrowserUpProxyApi.add_error"
  end
  # resource path
  local_var_path = '/har/errors'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(error)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.add_error",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#add_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_har_log(opts = {}) ⇒ Har

Get the current HAR.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



147
148
149
150
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 147

def get_har_log(opts = {})
  data, _status_code, _headers = get_har_log_with_http_info(opts)
  data
end

#get_har_log_with_http_info(opts = {}) ⇒ Array<(Har, Integer, Hash)>

Get the current HAR.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Har, Integer, Hash)>)

    Har data, response status code and response headers



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 155

def get_har_log_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.get_har_log ...'
  end
  # resource path
  local_var_path = '/har'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Har'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.get_har_log",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#get_har_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#healthcheck(opts = {}) ⇒ nil

Get the healthcheck

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


202
203
204
205
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 202

def healthcheck(opts = {})
  healthcheck_with_http_info(opts)
  nil
end

#healthcheck_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get the healthcheck

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 210

def healthcheck_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.healthcheck ...'
  end
  # resource path
  local_var_path = '/healthcheck'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.healthcheck",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#healthcheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#new_page(title, opts = {}) ⇒ Har

Starts a fresh HAR Page (Step) in the current active HAR to group requests.

Parameters:

  • title (String)

    The unique title for this har page/step.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



256
257
258
259
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 256

def new_page(title, opts = {})
  data, _status_code, _headers = new_page_with_http_info(title, opts)
  data
end

#new_page_with_http_info(title, opts = {}) ⇒ Array<(Har, Integer, Hash)>

Starts a fresh HAR Page (Step) in the current active HAR to group requests.

Parameters:

  • title (String)

    The unique title for this har page/step.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Har, Integer, Hash)>)

    Har data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 265

def new_page_with_http_info(title, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.new_page ...'
  end
  # verify the required parameter 'title' is set
  if @api_client.config.client_side_validation && title.nil?
    fail ArgumentError, "Missing the required parameter 'title' when calling BrowserUpProxyApi.new_page"
  end
  pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
  if @api_client.config.client_side_validation && title !~ pattern
    fail ArgumentError, "invalid value for 'title' when calling BrowserUpProxyApi.new_page, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/har/page'.sub('{' + 'title' + '}', CGI.escape(title.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Har'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.new_page",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#new_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_har_log(opts = {}) ⇒ Har

Starts a fresh HAR capture session.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



321
322
323
324
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 321

def reset_har_log(opts = {})
  data, _status_code, _headers = reset_har_log_with_http_info(opts)
  data
end

#reset_har_log_with_http_info(opts = {}) ⇒ Array<(Har, Integer, Hash)>

Starts a fresh HAR capture session.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Har, Integer, Hash)>)

    Har data, response status code and response headers



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 329

def reset_har_log_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.reset_har_log ...'
  end
  # resource path
  local_var_path = '/har'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Har'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.reset_har_log",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#reset_har_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_not_present(name, match_criteria, opts = {}) ⇒ VerifyResult

Verify no matching items are present in the captured traffic

Parameters:

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



378
379
380
381
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 378

def verify_not_present(name, match_criteria, opts = {})
  data, _status_code, _headers = verify_not_present_with_http_info(name, match_criteria, opts)
  data
end

#verify_not_present_with_http_info(name, match_criteria, opts = {}) ⇒ Array<(VerifyResult, Integer, Hash)>

Verify no matching items are present in the captured traffic

Parameters:

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VerifyResult, Integer, Hash)>)

    VerifyResult data, response status code and response headers



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 388

def verify_not_present_with_http_info(name, match_criteria, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_not_present ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_not_present"
  end
  pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
  if @api_client.config.client_side_validation && name !~ pattern
    fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_not_present, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'match_criteria' is set
  if @api_client.config.client_side_validation && match_criteria.nil?
    fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_not_present"
  end
  # resource path
  local_var_path = '/verify/not_present/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.verify_not_present",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_not_present\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_present(name, match_criteria, opts = {}) ⇒ VerifyResult

Verify at least one matching item is present in the captured traffic

Parameters:

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



452
453
454
455
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 452

def verify_present(name, match_criteria, opts = {})
  data, _status_code, _headers = verify_present_with_http_info(name, match_criteria, opts)
  data
end

#verify_present_with_http_info(name, match_criteria, opts = {}) ⇒ Array<(VerifyResult, Integer, Hash)>

Verify at least one matching item is present in the captured traffic

Parameters:

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VerifyResult, Integer, Hash)>)

    VerifyResult data, response status code and response headers



462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 462

def verify_present_with_http_info(name, match_criteria, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_present ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_present"
  end
  pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
  if @api_client.config.client_side_validation && name !~ pattern
    fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_present, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'match_criteria' is set
  if @api_client.config.client_side_validation && match_criteria.nil?
    fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_present"
  end
  # resource path
  local_var_path = '/verify/present/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.verify_present",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_present\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_size(size, name, match_criteria, opts = {}) ⇒ VerifyResult

Verify matching items in the captured traffic meet the size criteria

Parameters:

  • size (Integer)

    The size used for comparison, in kilobytes

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



527
528
529
530
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 527

def verify_size(size, name, match_criteria, opts = {})
  data, _status_code, _headers = verify_size_with_http_info(size, name, match_criteria, opts)
  data
end

#verify_size_with_http_info(size, name, match_criteria, opts = {}) ⇒ Array<(VerifyResult, Integer, Hash)>

Verify matching items in the captured traffic meet the size criteria

Parameters:

  • size (Integer)

    The size used for comparison, in kilobytes

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VerifyResult, Integer, Hash)>)

    VerifyResult data, response status code and response headers



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 538

def verify_size_with_http_info(size, name, match_criteria, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_size ...'
  end
  # verify the required parameter 'size' is set
  if @api_client.config.client_side_validation && size.nil?
    fail ArgumentError, "Missing the required parameter 'size' when calling BrowserUpProxyApi.verify_size"
  end
  if @api_client.config.client_side_validation && size < 0
    fail ArgumentError, 'invalid value for "size" when calling BrowserUpProxyApi.verify_size, must be greater than or equal to 0.'
  end

  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_size"
  end
  pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
  if @api_client.config.client_side_validation && name !~ pattern
    fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_size, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'match_criteria' is set
  if @api_client.config.client_side_validation && match_criteria.nil?
    fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_size"
  end
  # resource path
  local_var_path = '/verify/size/{size}/{name}'.sub('{' + 'size' + '}', CGI.escape(size.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.verify_size",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_size\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_sla(time, name, match_criteria, opts = {}) ⇒ VerifyResult

Verify each traffic item matching the criteria meets is below SLA time

Parameters:

  • time (Integer)

    The time used for comparison

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



611
612
613
614
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 611

def verify_sla(time, name, match_criteria, opts = {})
  data, _status_code, _headers = verify_sla_with_http_info(time, name, match_criteria, opts)
  data
end

#verify_sla_with_http_info(time, name, match_criteria, opts = {}) ⇒ Array<(VerifyResult, Integer, Hash)>

Verify each traffic item matching the criteria meets is below SLA time

Parameters:

  • time (Integer)

    The time used for comparison

  • name (String)

    The unique name for this verification operation

  • match_criteria (MatchCriteria)

    Match criteria to select requests - response pairs for size tests

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VerifyResult, Integer, Hash)>)

    VerifyResult data, response status code and response headers



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb', line 622

def verify_sla_with_http_info(time, name, match_criteria, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BrowserUpProxyApi.verify_sla ...'
  end
  # verify the required parameter 'time' is set
  if @api_client.config.client_side_validation && time.nil?
    fail ArgumentError, "Missing the required parameter 'time' when calling BrowserUpProxyApi.verify_sla"
  end
  if @api_client.config.client_side_validation && time < 0
    fail ArgumentError, 'invalid value for "time" when calling BrowserUpProxyApi.verify_sla, must be greater than or equal to 0.'
  end

  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling BrowserUpProxyApi.verify_sla"
  end
  pattern = Regexp.new(/[a-zA-Z-_]{4,25}/)
  if @api_client.config.client_side_validation && name !~ pattern
    fail ArgumentError, "invalid value for 'name' when calling BrowserUpProxyApi.verify_sla, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'match_criteria' is set
  if @api_client.config.client_side_validation && match_criteria.nil?
    fail ArgumentError, "Missing the required parameter 'match_criteria' when calling BrowserUpProxyApi.verify_sla"
  end
  # resource path
  local_var_path = '/verify/sla/{time}/{name}'.sub('{' + 'time' + '}', CGI.escape(time.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(match_criteria)

  # return_type
  return_type = opts[:debug_return_type] || 'VerifyResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"BrowserUpProxyApi.verify_sla",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BrowserUpProxyApi#verify_sla\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end