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.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +68 -0
  4. data/README.md +119 -0
  5. data/Rakefile +10 -0
  6. data/browserup_mitmproxy_client.gemspec +38 -0
  7. data/docs/BrowserUpProxyApi.md +657 -0
  8. data/docs/Counter.md +20 -0
  9. data/docs/Entry.md +38 -0
  10. data/docs/EntryRequest.md +36 -0
  11. data/docs/EntryRequestCookies.md +32 -0
  12. data/docs/EntryRequestQueryString.md +22 -0
  13. data/docs/EntryResponse.md +36 -0
  14. data/docs/EntryResponseContent.md +28 -0
  15. data/docs/EntryTimings.md +32 -0
  16. data/docs/Error.md +20 -0
  17. data/docs/Har.md +18 -0
  18. data/docs/HarLog.md +28 -0
  19. data/docs/HarLogCreator.md +22 -0
  20. data/docs/Header.md +22 -0
  21. data/docs/MatchCriteria.md +44 -0
  22. data/docs/NameValuePair.md +20 -0
  23. data/docs/Page.md +32 -0
  24. data/docs/PagePageTimings.md +22 -0
  25. data/docs/VerifyResult.md +22 -0
  26. data/docs/WebSocketMessage.md +24 -0
  27. data/git_push.sh +58 -0
  28. data/lib/browserup_mitmproxy_client/api/browser_up_proxy_api.rb +689 -0
  29. data/lib/browserup_mitmproxy_client/api_client.rb +389 -0
  30. data/lib/browserup_mitmproxy_client/api_error.rb +57 -0
  31. data/lib/browserup_mitmproxy_client/configuration.rb +279 -0
  32. data/lib/browserup_mitmproxy_client/models/counter.rb +239 -0
  33. data/lib/browserup_mitmproxy_client/models/entry.rb +359 -0
  34. data/lib/browserup_mitmproxy_client/models/entry_request.rb +346 -0
  35. data/lib/browserup_mitmproxy_client/models/entry_request_cookies.rb +291 -0
  36. data/lib/browserup_mitmproxy_client/models/entry_request_query_string.rb +246 -0
  37. data/lib/browserup_mitmproxy_client/models/entry_response.rb +348 -0
  38. data/lib/browserup_mitmproxy_client/models/entry_response_content.rb +273 -0
  39. data/lib/browserup_mitmproxy_client/models/entry_timings.rb +463 -0
  40. data/lib/browserup_mitmproxy_client/models/error.rb +229 -0
  41. data/lib/browserup_mitmproxy_client/models/har.rb +223 -0
  42. data/lib/browserup_mitmproxy_client/models/har_log.rb +287 -0
  43. data/lib/browserup_mitmproxy_client/models/har_log_creator.rb +246 -0
  44. data/lib/browserup_mitmproxy_client/models/header.rb +246 -0
  45. data/lib/browserup_mitmproxy_client/models/match_criteria.rb +346 -0
  46. data/lib/browserup_mitmproxy_client/models/name_value_pair.rb +229 -0
  47. data/lib/browserup_mitmproxy_client/models/page.rb +312 -0
  48. data/lib/browserup_mitmproxy_client/models/page_page_timings.rb +288 -0
  49. data/lib/browserup_mitmproxy_client/models/verify_result.rb +254 -0
  50. data/lib/browserup_mitmproxy_client/models/web_socket_message.rb +265 -0
  51. data/lib/browserup_mitmproxy_client/version.rb +15 -0
  52. data/lib/browserup_mitmproxy_client.rb +59 -0
  53. data/spec/api/browser_up_proxy_api_spec.rb +148 -0
  54. data/spec/api_client_spec.rb +226 -0
  55. data/spec/configuration_spec.rb +42 -0
  56. data/spec/models/counter_spec.rb +40 -0
  57. data/spec/models/entry_request_cookies_spec.rb +76 -0
  58. data/spec/models/entry_request_query_string_spec.rb +46 -0
  59. data/spec/models/entry_request_spec.rb +88 -0
  60. data/spec/models/entry_response_content_spec.rb +64 -0
  61. data/spec/models/entry_response_spec.rb +88 -0
  62. data/spec/models/entry_spec.rb +94 -0
  63. data/spec/models/entry_timings_spec.rb +76 -0
  64. data/spec/models/error_spec.rb +40 -0
  65. data/spec/models/har_log_creator_spec.rb +46 -0
  66. data/spec/models/har_log_spec.rb +64 -0
  67. data/spec/models/har_spec.rb +34 -0
  68. data/spec/models/header_spec.rb +46 -0
  69. data/spec/models/match_criteria_spec.rb +112 -0
  70. data/spec/models/name_value_pair_spec.rb +40 -0
  71. data/spec/models/page_page_timings_spec.rb +46 -0
  72. data/spec/models/page_spec.rb +76 -0
  73. data/spec/models/verify_result_spec.rb +46 -0
  74. data/spec/models/web_socket_message_spec.rb +52 -0
  75. data/spec/spec_helper.rb +111 -0
  76. metadata +181 -0
@@ -0,0 +1,291 @@
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 'date'
14
+ require 'time'
15
+
16
+ module BrowserupMitmProxy
17
+ class EntryRequestCookies
18
+ attr_accessor :name
19
+
20
+ attr_accessor :value
21
+
22
+ attr_accessor :path
23
+
24
+ attr_accessor :domain
25
+
26
+ attr_accessor :expires
27
+
28
+ attr_accessor :http_only
29
+
30
+ attr_accessor :secure
31
+
32
+ attr_accessor :comment
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'name' => :'name',
38
+ :'value' => :'value',
39
+ :'path' => :'path',
40
+ :'domain' => :'domain',
41
+ :'expires' => :'expires',
42
+ :'http_only' => :'httpOnly',
43
+ :'secure' => :'secure',
44
+ :'comment' => :'comment'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'name' => :'String',
57
+ :'value' => :'String',
58
+ :'path' => :'String',
59
+ :'domain' => :'String',
60
+ :'expires' => :'String',
61
+ :'http_only' => :'Boolean',
62
+ :'secure' => :'Boolean',
63
+ :'comment' => :'String'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BrowserupMitmProxy::EntryRequestCookies` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::EntryRequestCookies`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'name')
89
+ self.name = attributes[:'name']
90
+ end
91
+
92
+ if attributes.key?(:'value')
93
+ self.value = attributes[:'value']
94
+ end
95
+
96
+ if attributes.key?(:'path')
97
+ self.path = attributes[:'path']
98
+ end
99
+
100
+ if attributes.key?(:'domain')
101
+ self.domain = attributes[:'domain']
102
+ end
103
+
104
+ if attributes.key?(:'expires')
105
+ self.expires = attributes[:'expires']
106
+ end
107
+
108
+ if attributes.key?(:'http_only')
109
+ self.http_only = attributes[:'http_only']
110
+ end
111
+
112
+ if attributes.key?(:'secure')
113
+ self.secure = attributes[:'secure']
114
+ end
115
+
116
+ if attributes.key?(:'comment')
117
+ self.comment = attributes[:'comment']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ if @name.nil?
126
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
127
+ end
128
+
129
+ if @value.nil?
130
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ return false if @name.nil?
140
+ return false if @value.nil?
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ name == o.name &&
150
+ value == o.value &&
151
+ path == o.path &&
152
+ domain == o.domain &&
153
+ expires == o.expires &&
154
+ http_only == o.http_only &&
155
+ secure == o.secure &&
156
+ comment == o.comment
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [name, value, path, domain, expires, http_only, secure, comment].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
185
+ self.send("#{key}=", nil)
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :Time
207
+ Time.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ # models (e.g. Pet) or oneOf
238
+ klass = BrowserupMitmProxy.const_get(type)
239
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -0,0 +1,246 @@
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 'date'
14
+ require 'time'
15
+
16
+ module BrowserupMitmProxy
17
+ class EntryRequestQueryString
18
+ attr_accessor :name
19
+
20
+ attr_accessor :value
21
+
22
+ attr_accessor :comment
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'value' => :'value',
29
+ :'comment' => :'comment'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'name' => :'String',
42
+ :'value' => :'String',
43
+ :'comment' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BrowserupMitmProxy::EntryRequestQueryString` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BrowserupMitmProxy::EntryRequestQueryString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'name')
69
+ self.name = attributes[:'name']
70
+ end
71
+
72
+ if attributes.key?(:'value')
73
+ self.value = attributes[:'value']
74
+ end
75
+
76
+ if attributes.key?(:'comment')
77
+ self.comment = attributes[:'comment']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @name.nil?
86
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
87
+ end
88
+
89
+ if @value.nil?
90
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @name.nil?
100
+ return false if @value.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ name == o.name &&
110
+ value == o.value &&
111
+ comment == o.comment
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [name, value, comment].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = BrowserupMitmProxy.const_get(type)
194
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end