mockserver-client 1.0.8.pre → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +79 -0
  4. data/README.md +89 -229
  5. data/Rakefile +8 -8
  6. data/docs/Body.md +7 -0
  7. data/docs/BodyWithContentType.md +7 -0
  8. data/docs/ConnectionOptions.md +12 -0
  9. data/docs/ControlApi.md +269 -0
  10. data/docs/Delay.md +9 -0
  11. data/docs/Expectation.md +7 -0
  12. data/docs/ExpectationApi.md +51 -0
  13. data/docs/Expectations.md +7 -0
  14. data/docs/HttpClassCallback.md +8 -0
  15. data/docs/HttpError.md +10 -0
  16. data/docs/HttpForward.md +11 -0
  17. data/docs/HttpObjectCallback.md +8 -0
  18. data/docs/HttpOverrideForwardedRequest.md +9 -0
  19. data/docs/HttpRequest.md +15 -0
  20. data/docs/HttpResponse.md +14 -0
  21. data/docs/HttpTemplate.md +10 -0
  22. data/docs/KeyToMultiValue.md +7 -0
  23. data/docs/KeyToValue.md +7 -0
  24. data/docs/Ports.md +8 -0
  25. data/docs/TimeToLive.md +10 -0
  26. data/docs/Times.md +9 -0
  27. data/docs/Verification.md +9 -0
  28. data/docs/VerificationSequence.md +8 -0
  29. data/docs/VerificationTimes.md +9 -0
  30. data/docs/VerifyApi.md +94 -0
  31. data/lib/mockserver-client.rb +62 -15
  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/mockserver-client.gemspec +44 -36
  62. data/spec/api/control_api_spec.rb +102 -0
  63. data/spec/api/expectation_api_spec.rb +46 -0
  64. data/spec/api/verify_api_spec.rb +57 -0
  65. data/spec/api_client_spec.rb +226 -0
  66. data/spec/configuration_spec.rb +42 -0
  67. data/spec/models/body_spec.rb +35 -0
  68. data/spec/models/body_with_content_type_spec.rb +35 -0
  69. data/spec/models/connection_options_spec.rb +65 -0
  70. data/spec/models/delay_spec.rb +47 -0
  71. data/spec/models/expectation_spec.rb +35 -0
  72. data/spec/models/expectations_spec.rb +35 -0
  73. data/spec/models/http_class_callback_spec.rb +41 -0
  74. data/spec/models/http_error_spec.rb +53 -0
  75. data/spec/models/http_forward_spec.rb +63 -0
  76. data/spec/models/http_object_callback_spec.rb +41 -0
  77. data/spec/models/http_override_forwarded_request_spec.rb +47 -0
  78. data/spec/models/http_request_spec.rb +83 -0
  79. data/spec/models/http_response_spec.rb +77 -0
  80. data/spec/models/http_template_spec.rb +57 -0
  81. data/spec/models/key_to_multi_value_spec.rb +35 -0
  82. data/spec/models/key_to_value_spec.rb +35 -0
  83. data/spec/models/ports_spec.rb +41 -0
  84. data/spec/models/time_to_live_spec.rb +57 -0
  85. data/spec/models/times_spec.rb +47 -0
  86. data/spec/models/verification_sequence_spec.rb +41 -0
  87. data/spec/models/verification_spec.rb +47 -0
  88. data/spec/models/verification_times_spec.rb +47 -0
  89. data/spec/spec_helper.rb +103 -53
  90. metadata +225 -158
  91. data/.gitignore +0 -21
  92. data/.rubocop.yml +0 -7
  93. data/bin/mockserver +0 -9
  94. data/lib/cli.rb +0 -146
  95. data/lib/mockserver/abstract_client.rb +0 -111
  96. data/lib/mockserver/mock_server_client.rb +0 -46
  97. data/lib/mockserver/model/array_of.rb +0 -85
  98. data/lib/mockserver/model/body.rb +0 -56
  99. data/lib/mockserver/model/cookie.rb +0 -36
  100. data/lib/mockserver/model/delay.rb +0 -34
  101. data/lib/mockserver/model/enum.rb +0 -47
  102. data/lib/mockserver/model/expectation.rb +0 -139
  103. data/lib/mockserver/model/forward.rb +0 -41
  104. data/lib/mockserver/model/header.rb +0 -43
  105. data/lib/mockserver/model/parameter.rb +0 -43
  106. data/lib/mockserver/model/request.rb +0 -81
  107. data/lib/mockserver/model/response.rb +0 -45
  108. data/lib/mockserver/model/times.rb +0 -61
  109. data/lib/mockserver/proxy_client.rb +0 -9
  110. data/lib/mockserver/utility_methods.rb +0 -59
  111. data/lib/mockserver/version.rb +0 -5
  112. data/pom.xml +0 -118
  113. data/spec/fixtures/forward_mockserver.json +0 -7
  114. data/spec/fixtures/incorrect_login_response.json +0 -20
  115. data/spec/fixtures/post_login_request.json +0 -22
  116. data/spec/fixtures/register_expectation.json +0 -50
  117. data/spec/fixtures/retrieved_request.json +0 -22
  118. data/spec/fixtures/search_request.json +0 -6
  119. data/spec/fixtures/times_once.json +0 -6
  120. data/spec/integration/mock_client_integration_spec.rb +0 -82
  121. data/spec/mockserver/builder_spec.rb +0 -90
  122. data/spec/mockserver/mock_client_spec.rb +0 -80
  123. data/spec/mockserver/proxy_client_spec.rb +0 -38
@@ -0,0 +1,15 @@
1
+ # MockServer::HttpRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **body** | [**Body**](Body.md) | | [optional]
7
+ **headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional]
8
+ **cookies** | [**KeyToValue**](KeyToValue.md) | | [optional]
9
+ **query_string_parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional]
10
+ **path** | **String** | | [optional]
11
+ **method** | **String** | | [optional]
12
+ **secure** | **BOOLEAN** | | [optional]
13
+ **keep_alive** | **BOOLEAN** | | [optional]
14
+
15
+
@@ -0,0 +1,14 @@
1
+ # MockServer::HttpResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **body** | [**BodyWithContentType**](BodyWithContentType.md) | | [optional]
7
+ **delay** | [**Delay**](Delay.md) | | [optional]
8
+ **cookies** | [**KeyToValue**](KeyToValue.md) | | [optional]
9
+ **connection_options** | [**ConnectionOptions**](ConnectionOptions.md) | | [optional]
10
+ **headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional]
11
+ **status_code** | **Integer** | | [optional]
12
+ **reason_phrase** | **String** | | [optional]
13
+
14
+
@@ -0,0 +1,10 @@
1
+ # MockServer::HttpTemplate
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **template_type** | **String** | | [optional]
7
+ **template** | **String** | | [optional]
8
+ **delay** | [**Delay**](Delay.md) | | [optional]
9
+
10
+
@@ -0,0 +1,7 @@
1
+ # MockServer::KeyToMultiValue
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,7 @@
1
+ # MockServer::KeyToValue
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,8 @@
1
+ # MockServer::Ports
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **ports** | **Array<Float>** | | [optional]
7
+
8
+
@@ -0,0 +1,10 @@
1
+ # MockServer::TimeToLive
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **time_unit** | **String** | | [optional]
7
+ **time_to_live** | **Integer** | | [optional]
8
+ **unlimited** | **BOOLEAN** | | [optional]
9
+
10
+
@@ -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
+
@@ -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
+
@@ -1,17 +1,64 @@
1
- # encoding: UTF-8
2
- require_relative './mockserver/version'
3
- require_relative './mockserver/mock_server_client'
4
- require_relative './mockserver/proxy_client'
5
-
6
- # Setup serialization correctly with multi_json
7
- require 'json/pure'
8
-
9
- # To fix serialization bugs. See: http://prettystatemachine.blogspot.com/2010/09/typeerrors-in-tojson-make-me-briefly.html
10
- class Fixnum
11
- def to_json(_)
12
- to_s
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
+ # Common files
14
+ require 'mockserver-client/api_client'
15
+ require 'mockserver-client/api_error'
16
+ require 'mockserver-client/version'
17
+ require 'mockserver-client/configuration'
18
+
19
+ # Models
20
+ require 'mockserver-client/models/body'
21
+ require 'mockserver-client/models/body_with_content_type'
22
+ require 'mockserver-client/models/connection_options'
23
+ require 'mockserver-client/models/delay'
24
+ require 'mockserver-client/models/expectation'
25
+ require 'mockserver-client/models/expectations'
26
+ require 'mockserver-client/models/http_class_callback'
27
+ require 'mockserver-client/models/http_error'
28
+ require 'mockserver-client/models/http_forward'
29
+ require 'mockserver-client/models/http_object_callback'
30
+ require 'mockserver-client/models/http_override_forwarded_request'
31
+ require 'mockserver-client/models/http_request'
32
+ require 'mockserver-client/models/http_response'
33
+ require 'mockserver-client/models/http_template'
34
+ require 'mockserver-client/models/key_to_multi_value'
35
+ require 'mockserver-client/models/key_to_value'
36
+ require 'mockserver-client/models/ports'
37
+ require 'mockserver-client/models/time_to_live'
38
+ require 'mockserver-client/models/times'
39
+ require 'mockserver-client/models/verification'
40
+ require 'mockserver-client/models/verification_sequence'
41
+ require 'mockserver-client/models/verification_times'
42
+
43
+ # APIs
44
+ require 'mockserver-client/api/control_api'
45
+ require 'mockserver-client/api/expectation_api'
46
+ require 'mockserver-client/api/verify_api'
47
+
48
+ module MockServer
49
+ class << self
50
+ # Customize default settings for the SDK using block.
51
+ # MockServer.configure do |config|
52
+ # config.username = "xxx"
53
+ # config.password = "xxx"
54
+ # end
55
+ # If no block given, return the default Configuration object.
56
+ def configure
57
+ if block_given?
58
+ yield(Configuration.default)
59
+ else
60
+ Configuration.default
61
+ end
62
+ end
13
63
  end
14
64
  end
15
-
16
- require 'multi_json'
17
- MultiJson.use(:json_pure)
@@ -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 = '/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 = '/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 = '/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 = '/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 = '/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 = '/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