mockserver-client-2 5.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +8 -0
  3. data/README.md +120 -0
  4. data/Rakefile +10 -0
  5. data/code-generate.md +3 -0
  6. data/code-generation-config.json +10 -0
  7. data/docs/Body.md +7 -0
  8. data/docs/BodyWithContentType.md +7 -0
  9. data/docs/ConnectionOptions.md +12 -0
  10. data/docs/ControlApi.md +269 -0
  11. data/docs/Delay.md +9 -0
  12. data/docs/Expectation.md +7 -0
  13. data/docs/ExpectationApi.md +51 -0
  14. data/docs/Expectations.md +7 -0
  15. data/docs/HttpClassCallback.md +8 -0
  16. data/docs/HttpError.md +10 -0
  17. data/docs/HttpForward.md +11 -0
  18. data/docs/HttpObjectCallback.md +8 -0
  19. data/docs/HttpOverrideForwardedRequest.md +9 -0
  20. data/docs/HttpRequest.md +15 -0
  21. data/docs/HttpResponse.md +14 -0
  22. data/docs/HttpTemplate.md +10 -0
  23. data/docs/KeyToMultiValue.md +7 -0
  24. data/docs/KeyToValue.md +7 -0
  25. data/docs/Ports.md +8 -0
  26. data/docs/TimeToLive.md +10 -0
  27. data/docs/Times.md +9 -0
  28. data/docs/Verification.md +9 -0
  29. data/docs/VerificationSequence.md +8 -0
  30. data/docs/VerificationTimes.md +9 -0
  31. data/docs/VerifyApi.md +94 -0
  32. data/lib/mockserver-client/api/control_api.rb +316 -0
  33. data/lib/mockserver-client/api/expectation_api.rb +73 -0
  34. data/lib/mockserver-client/api/verify_api.rb +127 -0
  35. data/lib/mockserver-client/api_client.rb +388 -0
  36. data/lib/mockserver-client/api_error.rb +38 -0
  37. data/lib/mockserver-client/configuration.rb +202 -0
  38. data/lib/mockserver-client/models/body.rb +174 -0
  39. data/lib/mockserver-client/models/body_with_content_type.rb +174 -0
  40. data/lib/mockserver-client/models/connection_options.rb +219 -0
  41. data/lib/mockserver-client/models/delay.rb +192 -0
  42. data/lib/mockserver-client/models/expectation.rb +174 -0
  43. data/lib/mockserver-client/models/expectations.rb +174 -0
  44. data/lib/mockserver-client/models/http_class_callback.rb +183 -0
  45. data/lib/mockserver-client/models/http_error.rb +201 -0
  46. data/lib/mockserver-client/models/http_forward.rb +244 -0
  47. data/lib/mockserver-client/models/http_object_callback.rb +183 -0
  48. data/lib/mockserver-client/models/http_override_forwarded_request.rb +192 -0
  49. data/lib/mockserver-client/models/http_request.rb +246 -0
  50. data/lib/mockserver-client/models/http_response.rb +237 -0
  51. data/lib/mockserver-client/models/http_template.rb +235 -0
  52. data/lib/mockserver-client/models/key_to_multi_value.rb +174 -0
  53. data/lib/mockserver-client/models/key_to_value.rb +174 -0
  54. data/lib/mockserver-client/models/ports.rb +185 -0
  55. data/lib/mockserver-client/models/time_to_live.rb +235 -0
  56. data/lib/mockserver-client/models/times.rb +192 -0
  57. data/lib/mockserver-client/models/verification.rb +192 -0
  58. data/lib/mockserver-client/models/verification_sequence.rb +185 -0
  59. data/lib/mockserver-client/models/verification_times.rb +192 -0
  60. data/lib/mockserver-client/version.rb +15 -0
  61. data/lib/mockserver-client.rb +64 -0
  62. data/mockserver-client.gemspec +45 -0
  63. data/spec/api/control_api_spec.rb +102 -0
  64. data/spec/api/expectation_api_spec.rb +46 -0
  65. data/spec/api/verify_api_spec.rb +57 -0
  66. data/spec/api_client_spec.rb +226 -0
  67. data/spec/configuration_spec.rb +42 -0
  68. data/spec/models/body_spec.rb +35 -0
  69. data/spec/models/body_with_content_type_spec.rb +35 -0
  70. data/spec/models/connection_options_spec.rb +65 -0
  71. data/spec/models/delay_spec.rb +47 -0
  72. data/spec/models/expectation_spec.rb +35 -0
  73. data/spec/models/expectations_spec.rb +35 -0
  74. data/spec/models/http_class_callback_spec.rb +41 -0
  75. data/spec/models/http_error_spec.rb +53 -0
  76. data/spec/models/http_forward_spec.rb +63 -0
  77. data/spec/models/http_object_callback_spec.rb +41 -0
  78. data/spec/models/http_override_forwarded_request_spec.rb +47 -0
  79. data/spec/models/http_request_spec.rb +83 -0
  80. data/spec/models/http_response_spec.rb +77 -0
  81. data/spec/models/http_template_spec.rb +57 -0
  82. data/spec/models/key_to_multi_value_spec.rb +35 -0
  83. data/spec/models/key_to_value_spec.rb +35 -0
  84. data/spec/models/ports_spec.rb +41 -0
  85. data/spec/models/time_to_live_spec.rb +57 -0
  86. data/spec/models/times_spec.rb +47 -0
  87. data/spec/models/verification_sequence_spec.rb +41 -0
  88. data/spec/models/verification_spec.rb +47 -0
  89. data/spec/models/verification_times_spec.rb +47 -0
  90. data/spec/spec_helper.rb +111 -0
  91. metadata +347 -0
data/docs/Times.md ADDED
@@ -0,0 +1,9 @@
1
+ # MockServer::Times
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **remaining_times** | **Integer** | | [optional]
7
+ **unlimited** | **BOOLEAN** | | [optional]
8
+
9
+
@@ -0,0 +1,9 @@
1
+ # MockServer::Verification
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **http_request** | [**HttpRequest**](HttpRequest.md) | | [optional]
7
+ **times** | [**VerificationTimes**](VerificationTimes.md) | | [optional]
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # MockServer::VerificationSequence
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **http_requests** | [**Array<HttpRequest>**](HttpRequest.md) | | [optional]
7
+
8
+
@@ -0,0 +1,9 @@
1
+ # MockServer::VerificationTimes
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **count** | **Integer** | | [optional]
7
+ **exact** | **BOOLEAN** | | [optional]
8
+
9
+
data/docs/VerifyApi.md ADDED
@@ -0,0 +1,94 @@
1
+ # MockServer::VerifyApi
2
+
3
+ All URIs are relative to *http://localhost:1080*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**verify_put**](VerifyApi.md#verify_put) | **PUT** /verify | verify a request has been received a specific number of times
8
+ [**verify_sequence_put**](VerifyApi.md#verify_sequence_put) | **PUT** /verifySequence | verify a sequence of request has been received in the specific order
9
+
10
+
11
+ # **verify_put**
12
+ > verify_put(verification)
13
+
14
+ verify a request has been received a specific number of times
15
+
16
+ ### Example
17
+ ```ruby
18
+ # load the gem
19
+ require 'mockserver-client'
20
+
21
+ api_instance = MockServer::VerifyApi.new
22
+ verification = MockServer::Verification.new # Verification | request matcher and the number of times to match
23
+
24
+ begin
25
+ #verify a request has been received a specific number of times
26
+ api_instance.verify_put(verification)
27
+ rescue MockServer::ApiError => e
28
+ puts "Exception when calling VerifyApi->verify_put: #{e}"
29
+ end
30
+ ```
31
+
32
+ ### Parameters
33
+
34
+ Name | Type | Description | Notes
35
+ ------------- | ------------- | ------------- | -------------
36
+ **verification** | [**Verification**](Verification.md)| request matcher and the number of times to match |
37
+
38
+ ### Return type
39
+
40
+ nil (empty response body)
41
+
42
+ ### Authorization
43
+
44
+ No authorization required
45
+
46
+ ### HTTP request headers
47
+
48
+ - **Content-Type**: application/json
49
+ - **Accept**: text/plain
50
+
51
+
52
+
53
+ # **verify_sequence_put**
54
+ > verify_sequence_put(verification_sequence)
55
+
56
+ verify a sequence of request has been received in the specific order
57
+
58
+ ### Example
59
+ ```ruby
60
+ # load the gem
61
+ require 'mockserver-client'
62
+
63
+ api_instance = MockServer::VerifyApi.new
64
+ verification_sequence = MockServer::VerificationSequence.new # VerificationSequence | the sequence of requests matchers
65
+
66
+ begin
67
+ #verify a sequence of request has been received in the specific order
68
+ api_instance.verify_sequence_put(verification_sequence)
69
+ rescue MockServer::ApiError => e
70
+ puts "Exception when calling VerifyApi->verify_sequence_put: #{e}"
71
+ end
72
+ ```
73
+
74
+ ### Parameters
75
+
76
+ Name | Type | Description | Notes
77
+ ------------- | ------------- | ------------- | -------------
78
+ **verification_sequence** | [**VerificationSequence**](VerificationSequence.md)| the sequence of requests matchers |
79
+
80
+ ### Return type
81
+
82
+ nil (empty response body)
83
+
84
+ ### Authorization
85
+
86
+ No authorization required
87
+
88
+ ### HTTP request headers
89
+
90
+ - **Content-Type**: application/json
91
+ - **Accept**: text/plain
92
+
93
+
94
+
@@ -0,0 +1,316 @@
1
+ =begin
2
+ #Mock Server API
3
+
4
+ #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
5
+
6
+ OpenAPI spec version: 5.3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.1
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module MockServer
16
+ class ControlApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # bind additional listening ports
23
+ # only supported on Netty version
24
+ # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Ports]
27
+ def bind_put(ports, opts = {})
28
+ data, _status_code, _headers = bind_put_with_http_info(ports, opts)
29
+ data
30
+ end
31
+
32
+ # bind additional listening ports
33
+ # only supported on Netty version
34
+ # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers
37
+ def bind_put_with_http_info(ports, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ControlApi.bind_put ...'
40
+ end
41
+ # verify the required parameter 'ports' is set
42
+ if @api_client.config.client_side_validation && ports.nil?
43
+ fail ArgumentError, "Missing the required parameter 'ports' when calling ControlApi.bind_put"
44
+ end
45
+ # resource path
46
+ local_var_path = 'mockserver/bind'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = @api_client.object_to_http_body(ports)
63
+ auth_names = []
64
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'Ports')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: ControlApi#bind_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+
77
+ # clears expectations and recorded requests that match the request matcher
78
+ # @param [Hash] opts the optional parameters
79
+ # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear
80
+ # @return [nil]
81
+ def clear_put(opts = {})
82
+ clear_put_with_http_info(opts)
83
+ nil
84
+ end
85
+
86
+ # clears expectations and recorded requests that match the request matcher
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear
89
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
90
+ def clear_put_with_http_info(opts = {})
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug 'Calling API: ControlApi.clear_put ...'
93
+ end
94
+ # resource path
95
+ local_var_path = 'mockserver/clear'
96
+
97
+ # query parameters
98
+ query_params = {}
99
+
100
+ # header parameters
101
+ header_params = {}
102
+ # HTTP header 'Content-Type'
103
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
104
+
105
+ # form parameters
106
+ form_params = {}
107
+
108
+ # http body (model)
109
+ post_body = @api_client.object_to_http_body(opts[:'http_request'])
110
+ auth_names = []
111
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
112
+ :header_params => header_params,
113
+ :query_params => query_params,
114
+ :form_params => form_params,
115
+ :body => post_body,
116
+ :auth_names => auth_names)
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug "API called: ControlApi#clear_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
119
+ end
120
+ return data, status_code, headers
121
+ end
122
+
123
+ # clears all expectations and recorded requests
124
+ # @param [Hash] opts the optional parameters
125
+ # @return [nil]
126
+ def reset_put(opts = {})
127
+ reset_put_with_http_info(opts)
128
+ nil
129
+ end
130
+
131
+ # clears all expectations and recorded requests
132
+ # @param [Hash] opts the optional parameters
133
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
134
+ def reset_put_with_http_info(opts = {})
135
+ if @api_client.config.debugging
136
+ @api_client.config.logger.debug 'Calling API: ControlApi.reset_put ...'
137
+ end
138
+ # resource path
139
+ local_var_path = 'mockserver/reset'
140
+
141
+ # query parameters
142
+ query_params = {}
143
+
144
+ # header parameters
145
+ header_params = {}
146
+
147
+ # form parameters
148
+ form_params = {}
149
+
150
+ # http body (model)
151
+ post_body = nil
152
+ auth_names = []
153
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
154
+ :header_params => header_params,
155
+ :query_params => query_params,
156
+ :form_params => form_params,
157
+ :body => post_body,
158
+ :auth_names => auth_names)
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug "API called: ControlApi#reset_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
161
+ end
162
+ return data, status_code, headers
163
+ end
164
+
165
+ # retrieve recorded requests, active expectations, recorded expectations or log messages
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [String] :format changes response format, default if not specificed is \&quot;json\&quot;, supported values are \&quot;java\&quot;, \&quot;json\&quot;
168
+ # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \&quot;requests\&quot;, supported values are \&quot;logs\&quot;, \&quot;requests\&quot;, \&quot;recorded_expectations\&quot;, \&quot;active_expectations\&quot;
169
+ # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages
170
+ # @return [Object]
171
+ def retrieve_put(opts = {})
172
+ data, _status_code, _headers = retrieve_put_with_http_info(opts)
173
+ data
174
+ end
175
+
176
+ # retrieve recorded requests, active expectations, recorded expectations or log messages
177
+ # @param [Hash] opts the optional parameters
178
+ # @option opts [String] :format changes response format, default if not specificed is \&quot;json\&quot;, supported values are \&quot;java\&quot;, \&quot;json\&quot;
179
+ # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \&quot;requests\&quot;, supported values are \&quot;logs\&quot;, \&quot;requests\&quot;, \&quot;recorded_expectations\&quot;, \&quot;active_expectations\&quot;
180
+ # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages
181
+ # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
182
+ def retrieve_put_with_http_info(opts = {})
183
+ if @api_client.config.debugging
184
+ @api_client.config.logger.debug 'Calling API: ControlApi.retrieve_put ...'
185
+ end
186
+ if @api_client.config.client_side_validation && opts[:'format'] && !['java', 'json'].include?(opts[:'format'])
187
+ fail ArgumentError, 'invalid value for "format", must be one of java, json'
188
+ end
189
+ if @api_client.config.client_side_validation && opts[:'type'] && !['logs', 'requests', 'recorded_expectations', 'active_expectations'].include?(opts[:'type'])
190
+ fail ArgumentError, 'invalid value for "type", must be one of logs, requests, recorded_expectations, active_expectations'
191
+ end
192
+ # resource path
193
+ local_var_path = 'mockserver/retrieve'
194
+
195
+ # query parameters
196
+ query_params = {}
197
+ query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
198
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
199
+
200
+ # header parameters
201
+ header_params = {}
202
+ # HTTP header 'Accept' (if needed)
203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/java', 'text/plain'])
204
+ # HTTP header 'Content-Type'
205
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
206
+
207
+ # form parameters
208
+ form_params = {}
209
+
210
+ # http body (model)
211
+ post_body = @api_client.object_to_http_body(opts[:'http_request'])
212
+ auth_names = []
213
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :form_params => form_params,
217
+ :body => post_body,
218
+ :auth_names => auth_names,
219
+ :return_type => 'Object')
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: ControlApi#retrieve_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
225
+
226
+ # return listening ports
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Ports]
229
+ def status_put(opts = {})
230
+ data, _status_code, _headers = status_put_with_http_info(opts)
231
+ data
232
+ end
233
+
234
+ # return listening ports
235
+ # @param [Hash] opts the optional parameters
236
+ # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers
237
+ def status_put_with_http_info(opts = {})
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug 'Calling API: ControlApi.status_put ...'
240
+ end
241
+ # resource path
242
+ local_var_path = 'mockserver/status'
243
+
244
+ # query parameters
245
+ query_params = {}
246
+
247
+ # header parameters
248
+ header_params = {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
251
+
252
+ # form parameters
253
+ form_params = {}
254
+
255
+ # http body (model)
256
+ post_body = nil
257
+ auth_names = []
258
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
259
+ :header_params => header_params,
260
+ :query_params => query_params,
261
+ :form_params => form_params,
262
+ :body => post_body,
263
+ :auth_names => auth_names,
264
+ :return_type => 'Ports')
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "API called: ControlApi#status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
267
+ end
268
+ return data, status_code, headers
269
+ end
270
+
271
+ # stop running process
272
+ # only supported on Netty version
273
+ # @param [Hash] opts the optional parameters
274
+ # @return [nil]
275
+ def stop_put(opts = {})
276
+ stop_put_with_http_info(opts)
277
+ nil
278
+ end
279
+
280
+ # stop running process
281
+ # only supported on Netty version
282
+ # @param [Hash] opts the optional parameters
283
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
284
+ def stop_put_with_http_info(opts = {})
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug 'Calling API: ControlApi.stop_put ...'
287
+ end
288
+ # resource path
289
+ local_var_path = 'mockserver/stop'
290
+
291
+ # query parameters
292
+ query_params = {}
293
+
294
+ # header parameters
295
+ header_params = {}
296
+
297
+ # form parameters
298
+ form_params = {}
299
+
300
+ # http body (model)
301
+ post_body = nil
302
+ auth_names = []
303
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
304
+ :header_params => header_params,
305
+ :query_params => query_params,
306
+ :form_params => form_params,
307
+ :body => post_body,
308
+ :auth_names => auth_names)
309
+ if @api_client.config.debugging
310
+ @api_client.config.logger.debug "API called: ControlApi#stop_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
311
+ end
312
+ return data, status_code, headers
313
+ end
314
+
315
+ end
316
+ end
@@ -0,0 +1,73 @@
1
+ =begin
2
+ #Mock Server API
3
+
4
+ #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
5
+
6
+ OpenAPI spec version: 5.3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.1
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module MockServer
16
+ class ExpectationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # create expectation
23
+ # @param expectations expectation to create
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def expectation_put(expectations, opts = {})
27
+ expectation_put_with_http_info(expectations, opts)
28
+ nil
29
+ end
30
+
31
+ # create expectation
32
+ # @param expectations expectation to create
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
35
+ def expectation_put_with_http_info(expectations, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ExpectationApi.expectation_put ...'
38
+ end
39
+ # verify the required parameter 'expectations' is set
40
+ if @api_client.config.client_side_validation && expectations.nil?
41
+ fail ArgumentError, "Missing the required parameter 'expectations' when calling ExpectationApi.expectation_put"
42
+ end
43
+ # resource path
44
+ local_var_path = '/mockserver/expectation'
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ 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 = {}
56
+
57
+ # http body (model)
58
+ post_body = @api_client.object_to_http_body(expectations)
59
+ auth_names = []
60
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
61
+ :header_params => header_params,
62
+ :query_params => query_params,
63
+ :form_params => form_params,
64
+ :body => post_body,
65
+ :auth_names => auth_names)
66
+ if @api_client.config.debugging
67
+ @api_client.config.logger.debug "API called: ExpectationApi#expectation_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
68
+ end
69
+ return data, status_code, headers
70
+ end
71
+
72
+ end
73
+ end
@@ -0,0 +1,127 @@
1
+ =begin
2
+ #Mock Server API
3
+
4
+ #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
5
+
6
+ OpenAPI spec version: 5.3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.1
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module MockServer
16
+ class VerifyApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # verify a request has been received a specific number of times
23
+ # @param verification request matcher and the number of times to match
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def verify_put(verification, opts = {})
27
+ verify_put_with_http_info(verification, opts)
28
+ nil
29
+ end
30
+
31
+ # verify a request has been received a specific number of times
32
+ # @param verification request matcher and the number of times to match
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
35
+ def verify_put_with_http_info(verification, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: VerifyApi.verify_put ...'
38
+ end
39
+ # verify the required parameter 'verification' is set
40
+ if @api_client.config.client_side_validation && verification.nil?
41
+ fail ArgumentError, "Missing the required parameter 'verification' when calling VerifyApi.verify_put"
42
+ end
43
+ # resource path
44
+ local_var_path = 'mockserver/verify'
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = @api_client.object_to_http_body(verification)
61
+ auth_names = []
62
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names)
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: VerifyApi#verify_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
70
+ end
71
+ return data, status_code, headers
72
+ end
73
+
74
+ # verify a sequence of request has been received in the specific order
75
+ # @param verification_sequence the sequence of requests matchers
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [nil]
78
+ def verify_sequence_put(verification_sequence, opts = {})
79
+ verify_sequence_put_with_http_info(verification_sequence, opts)
80
+ nil
81
+ end
82
+
83
+ # verify a sequence of request has been received in the specific order
84
+ # @param verification_sequence the sequence of requests matchers
85
+ # @param [Hash] opts the optional parameters
86
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
87
+ def verify_sequence_put_with_http_info(verification_sequence, opts = {})
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug 'Calling API: VerifyApi.verify_sequence_put ...'
90
+ end
91
+ # verify the required parameter 'verification_sequence' is set
92
+ if @api_client.config.client_side_validation && verification_sequence.nil?
93
+ fail ArgumentError, "Missing the required parameter 'verification_sequence' when calling VerifyApi.verify_sequence_put"
94
+ end
95
+ # resource path
96
+ local_var_path = 'mockserver/verifySequence'
97
+
98
+ # query parameters
99
+ query_params = {}
100
+
101
+ # header parameters
102
+ header_params = {}
103
+ # HTTP header 'Accept' (if needed)
104
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
105
+ # HTTP header 'Content-Type'
106
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
107
+
108
+ # form parameters
109
+ form_params = {}
110
+
111
+ # http body (model)
112
+ post_body = @api_client.object_to_http_body(verification_sequence)
113
+ auth_names = []
114
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
115
+ :header_params => header_params,
116
+ :query_params => query_params,
117
+ :form_params => form_params,
118
+ :body => post_body,
119
+ :auth_names => auth_names)
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: VerifyApi#verify_sequence_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+
126
+ end
127
+ end