├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator └── VERSION ├── .travis.yml ├── README.md ├── code-generate.md ├── code-generation-config.json ├── docs ├── Body.md ├── BodyWithContentType.md ├── ConnectionOptions.md ├── ControlApi.md ├── Delay.md ├── Expectation.md ├── ExpectationApi.md ├── Expectations.md ├── HttpClassCallback.md ├── HttpError.md ├── HttpForward.md ├── HttpObjectCallback.md ├── HttpOverrideForwardedRequest.md ├── HttpRequest.md ├── HttpResponse.md ├── HttpTemplate.md ├── KeyToMultiValue.md ├── KeyToValue.md ├── Ports.md ├── TimeToLive.md ├── Times.md ├── Verification.md ├── VerificationSequence.md ├── VerificationTimes.md └── VerifyApi.md ├── git_push.sh ├── mockserver ├── __init__.py ├── api │ ├── __init__.py │ ├── control_api.py │ ├── expectation_api.py │ └── verify_api.py ├── api_client.py ├── configuration.py ├── models │ ├── __init__.py │ ├── body.py │ ├── body_with_content_type.py │ ├── connection_options.py │ ├── delay.py │ ├── expectation.py │ ├── expectations.py │ ├── http_class_callback.py │ ├── http_error.py │ ├── http_forward.py │ ├── http_object_callback.py │ ├── http_override_forwarded_request.py │ ├── http_request.py │ ├── http_response.py │ ├── http_template.py │ ├── key_to_multi_value.py │ ├── key_to_value.py │ ├── ports.py │ ├── time_to_live.py │ ├── times.py │ ├── verification.py │ ├── verification_sequence.py │ └── verification_times.py └── rest.py ├── requirements.txt ├── setup.py ├── test-requirements.txt ├── test ├── __init__.py ├── test_body.py ├── test_body_with_content_type.py ├── test_connection_options.py ├── test_control_api.py ├── test_delay.py ├── test_expectation.py ├── test_expectation_api.py ├── test_expectations.py ├── test_http_class_callback.py ├── test_http_error.py ├── test_http_forward.py ├── test_http_object_callback.py ├── test_http_override_forwarded_request.py ├── test_http_request.py ├── test_http_response.py ├── test_http_template.py ├── test_key_to_multi_value.py ├── test_key_to_value.py ├── test_ports.py ├── test_time_to_live.py ├── test_times.py ├── test_verification.py ├── test_verification_sequence.py ├── test_verification_times.py └── test_verify_api.py └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .python-version 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | 57 | # Sphinx documentation 58 | docs/_build/ 59 | 60 | # PyBuilder 61 | target/ 62 | 63 | #Ipython Notebook 64 | .ipynb_checkpoints 65 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 3.3.1 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.travis-ci.com/user/languages/python 2 | language: python 3 | python: 4 | - "2.7" 5 | - "3.2" 6 | - "3.3" 7 | - "3.4" 8 | - "3.5" 9 | #- "3.5-dev" # 3.5 development branch 10 | #- "nightly" # points to the latest development branch e.g. 3.6-dev 11 | # command to install dependencies 12 | install: "pip install -r requirements.txt" 13 | # command to run tests 14 | script: nosetests 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mockserver-client 2 | 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. 3 | 4 | This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: 5 | 6 | - API version: 5.3.0 7 | - Package version: 5.3.0 8 | - Build package: org.openapitools.codegen.languages.PythonClientCodegen 9 | 10 | ## Requirements. 11 | 12 | Python 2.7 and 3.4+ 13 | 14 | ## Installation & Usage 15 | ### pip install 16 | 17 | If the python package is hosted on Github, you can install directly from Github 18 | 19 | ```sh 20 | pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git 21 | ``` 22 | (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) 23 | 24 | Then import the package: 25 | ```python 26 | import mockserver 27 | ``` 28 | 29 | ### Setuptools 30 | 31 | Install via [Setuptools](http://pypi.python.org/pypi/setuptools). 32 | 33 | ```sh 34 | python setup.py install --user 35 | ``` 36 | (or `sudo python setup.py install` to install the package for all users) 37 | 38 | Then import the package: 39 | ```python 40 | import mockserver 41 | ``` 42 | 43 | ## Getting Started 44 | 45 | Please follow the [installation procedure](#installation--usage) and then run the following: 46 | 47 | ```python 48 | from __future__ import print_function 49 | import time 50 | import mockserver 51 | from mockserver.rest import ApiException 52 | from pprint import pprint 53 | 54 | # create an instance of the API class 55 | api_instance = mockserver.ControlApi(mockserver.ApiClient(configuration)) 56 | ports = mockserver.Ports() # Ports | list of ports to bind to, where 0 indicates dynamically bind to any available port 57 | 58 | try: 59 | # bind additional listening ports 60 | api_response = api_instance.bind_put(ports) 61 | pprint(api_response) 62 | except ApiException as e: 63 | print("Exception when calling ControlApi->bind_put: %s\n" % e) 64 | 65 | ``` 66 | 67 | ## Documentation for API Endpoints 68 | 69 | All URIs are relative to *http://localhost:1080* 70 | 71 | Class | Method | HTTP request | Description 72 | ------------ | ------------- | ------------- | ------------- 73 | *ControlApi* | [**bind_put**](docs/ControlApi.md#bind_put) | **PUT** /bind | bind additional listening ports 74 | *ControlApi* | [**clear_put**](docs/ControlApi.md#clear_put) | **PUT** /clear | clears expectations and recorded requests that match the request matcher 75 | *ControlApi* | [**reset_put**](docs/ControlApi.md#reset_put) | **PUT** /reset | clears all expectations and recorded requests 76 | *ControlApi* | [**retrieve_put**](docs/ControlApi.md#retrieve_put) | **PUT** /retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages 77 | *ControlApi* | [**status_put**](docs/ControlApi.md#status_put) | **PUT** /status | return listening ports 78 | *ControlApi* | [**stop_put**](docs/ControlApi.md#stop_put) | **PUT** /stop | stop running process 79 | *ExpectationApi* | [**expectation_put**](docs/ExpectationApi.md#expectation_put) | **PUT** /expectation | create expectation 80 | *VerifyApi* | [**verify_put**](docs/VerifyApi.md#verify_put) | **PUT** /verify | verify a request has been received a specific number of times 81 | *VerifyApi* | [**verify_sequence_put**](docs/VerifyApi.md#verify_sequence_put) | **PUT** /verifySequence | verify a sequence of request has been received in the specific order 82 | 83 | 84 | ## Documentation For Models 85 | 86 | - [Body](docs/Body.md) 87 | - [BodyWithContentType](docs/BodyWithContentType.md) 88 | - [ConnectionOptions](docs/ConnectionOptions.md) 89 | - [Delay](docs/Delay.md) 90 | - [Expectation](docs/Expectation.md) 91 | - [Expectations](docs/Expectations.md) 92 | - [HttpClassCallback](docs/HttpClassCallback.md) 93 | - [HttpError](docs/HttpError.md) 94 | - [HttpForward](docs/HttpForward.md) 95 | - [HttpObjectCallback](docs/HttpObjectCallback.md) 96 | - [HttpOverrideForwardedRequest](docs/HttpOverrideForwardedRequest.md) 97 | - [HttpRequest](docs/HttpRequest.md) 98 | - [HttpResponse](docs/HttpResponse.md) 99 | - [HttpTemplate](docs/HttpTemplate.md) 100 | - [KeyToMultiValue](docs/KeyToMultiValue.md) 101 | - [KeyToValue](docs/KeyToValue.md) 102 | - [Ports](docs/Ports.md) 103 | - [TimeToLive](docs/TimeToLive.md) 104 | - [Times](docs/Times.md) 105 | - [Verification](docs/Verification.md) 106 | - [VerificationSequence](docs/VerificationSequence.md) 107 | - [VerificationTimes](docs/VerificationTimes.md) 108 | 109 | 110 | ## Documentation For Authorization 111 | 112 | All endpoints do not require authorization. 113 | 114 | 115 | ## Author 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /code-generate.md: -------------------------------------------------------------------------------- 1 | brew install openapi-generator 2 | 3 | openapi-generator generate -i https://raw.githubusercontent.com/jamesdbloom/mockserver/master/mockserver-core/src/main/resources/org/mockserver/openapi/mock-server-openapi-embedded-model.yaml --config code-generation-config.json -g python -o . 4 | 5 | https://packaging.python.org/tutorials/packaging-projects/ -------------------------------------------------------------------------------- /code-generation-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "mockserver-client", 3 | "packageName": "mockserver", 4 | "pythonPackageName": "mockserver", 5 | "packageVersion": "5.3.0" 6 | } 7 | -------------------------------------------------------------------------------- /docs/Body.md: -------------------------------------------------------------------------------- 1 | # Body 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/BodyWithContentType.md: -------------------------------------------------------------------------------- 1 | # BodyWithContentType 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/ConnectionOptions.md: -------------------------------------------------------------------------------- 1 | # ConnectionOptions 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **close_socket** | **bool** | | [optional] 7 | **content_length_header_override** | **int** | | [optional] 8 | **suppress_content_length_header** | **bool** | | [optional] 9 | **suppress_connection_header** | **bool** | | [optional] 10 | **keep_alive_override** | **bool** | | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/ControlApi.md: -------------------------------------------------------------------------------- 1 | # mockserver.ControlApi 2 | 3 | All URIs are relative to *http://localhost:1080* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**bind_put**](ControlApi.md#bind_put) | **PUT** /bind | bind additional listening ports 8 | [**clear_put**](ControlApi.md#clear_put) | **PUT** /clear | clears expectations and recorded requests that match the request matcher 9 | [**reset_put**](ControlApi.md#reset_put) | **PUT** /reset | clears all expectations and recorded requests 10 | [**retrieve_put**](ControlApi.md#retrieve_put) | **PUT** /retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages 11 | [**status_put**](ControlApi.md#status_put) | **PUT** /status | return listening ports 12 | [**stop_put**](ControlApi.md#stop_put) | **PUT** /stop | stop running process 13 | 14 | 15 | # **bind_put** 16 | > Ports bind_put(ports) 17 | 18 | bind additional listening ports 19 | 20 | only supported on Netty version 21 | 22 | ### Example 23 | ```python 24 | from __future__ import print_function 25 | import time 26 | import mockserver 27 | from mockserver.rest import ApiException 28 | from pprint import pprint 29 | 30 | # create an instance of the API class 31 | api_instance = mockserver.ControlApi() 32 | ports = mockserver.Ports() # Ports | list of ports to bind to, where 0 indicates dynamically bind to any available port 33 | 34 | try: 35 | # bind additional listening ports 36 | api_response = api_instance.bind_put(ports) 37 | pprint(api_response) 38 | except ApiException as e: 39 | print("Exception when calling ControlApi->bind_put: %s\n" % e) 40 | ``` 41 | 42 | ### Parameters 43 | 44 | Name | Type | Description | Notes 45 | ------------- | ------------- | ------------- | ------------- 46 | **ports** | [**Ports**](Ports.md)| list of ports to bind to, where 0 indicates dynamically bind to any available port | 47 | 48 | ### Return type 49 | 50 | [**Ports**](Ports.md) 51 | 52 | ### Authorization 53 | 54 | No authorization required 55 | 56 | ### HTTP request headers 57 | 58 | - **Content-Type**: application/json 59 | - **Accept**: application/json 60 | 61 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 62 | 63 | # **clear_put** 64 | > clear_put(http_request=http_request) 65 | 66 | clears expectations and recorded requests that match the request matcher 67 | 68 | ### Example 69 | ```python 70 | from __future__ import print_function 71 | import time 72 | import mockserver 73 | from mockserver.rest import ApiException 74 | from pprint import pprint 75 | 76 | # create an instance of the API class 77 | api_instance = mockserver.ControlApi() 78 | http_request = mockserver.HttpRequest() # HttpRequest | request used to match expectations and recored requests to clear (optional) 79 | 80 | try: 81 | # clears expectations and recorded requests that match the request matcher 82 | api_instance.clear_put(http_request=http_request) 83 | except ApiException as e: 84 | print("Exception when calling ControlApi->clear_put: %s\n" % e) 85 | ``` 86 | 87 | ### Parameters 88 | 89 | Name | Type | Description | Notes 90 | ------------- | ------------- | ------------- | ------------- 91 | **http_request** | [**HttpRequest**](HttpRequest.md)| request used to match expectations and recored requests to clear | [optional] 92 | 93 | ### Return type 94 | 95 | void (empty response body) 96 | 97 | ### Authorization 98 | 99 | No authorization required 100 | 101 | ### HTTP request headers 102 | 103 | - **Content-Type**: application/json 104 | - **Accept**: Not defined 105 | 106 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 107 | 108 | # **reset_put** 109 | > reset_put() 110 | 111 | clears all expectations and recorded requests 112 | 113 | ### Example 114 | ```python 115 | from __future__ import print_function 116 | import time 117 | import mockserver 118 | from mockserver.rest import ApiException 119 | from pprint import pprint 120 | 121 | # create an instance of the API class 122 | api_instance = mockserver.ControlApi() 123 | 124 | try: 125 | # clears all expectations and recorded requests 126 | api_instance.reset_put() 127 | except ApiException as e: 128 | print("Exception when calling ControlApi->reset_put: %s\n" % e) 129 | ``` 130 | 131 | ### Parameters 132 | This endpoint does not need any parameter. 133 | 134 | ### Return type 135 | 136 | void (empty response body) 137 | 138 | ### Authorization 139 | 140 | No authorization required 141 | 142 | ### HTTP request headers 143 | 144 | - **Content-Type**: Not defined 145 | - **Accept**: Not defined 146 | 147 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 148 | 149 | # **retrieve_put** 150 | > object retrieve_put(format=format, type=type, http_request=http_request) 151 | 152 | retrieve recorded requests, active expectations, recorded expectations or log messages 153 | 154 | ### Example 155 | ```python 156 | from __future__ import print_function 157 | import time 158 | import mockserver 159 | from mockserver.rest import ApiException 160 | from pprint import pprint 161 | 162 | # create an instance of the API class 163 | api_instance = mockserver.ControlApi() 164 | format = 'format_example' # str | changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" (optional) 165 | type = 'type_example' # str | specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" (optional) 166 | http_request = mockserver.HttpRequest() # HttpRequest | request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages (optional) 167 | 168 | try: 169 | # retrieve recorded requests, active expectations, recorded expectations or log messages 170 | api_response = api_instance.retrieve_put(format=format, type=type, http_request=http_request) 171 | pprint(api_response) 172 | except ApiException as e: 173 | print("Exception when calling ControlApi->retrieve_put: %s\n" % e) 174 | ``` 175 | 176 | ### Parameters 177 | 178 | Name | Type | Description | Notes 179 | ------------- | ------------- | ------------- | ------------- 180 | **format** | **str**| changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" | [optional] 181 | **type** | **str**| specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" | [optional] 182 | **http_request** | [**HttpRequest**](HttpRequest.md)| request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages | [optional] 183 | 184 | ### Return type 185 | 186 | **object** 187 | 188 | ### Authorization 189 | 190 | No authorization required 191 | 192 | ### HTTP request headers 193 | 194 | - **Content-Type**: application/json 195 | - **Accept**: application/json, application/java, text/plain 196 | 197 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 198 | 199 | # **status_put** 200 | > Ports status_put() 201 | 202 | return listening ports 203 | 204 | ### Example 205 | ```python 206 | from __future__ import print_function 207 | import time 208 | import mockserver 209 | from mockserver.rest import ApiException 210 | from pprint import pprint 211 | 212 | # create an instance of the API class 213 | api_instance = mockserver.ControlApi() 214 | 215 | try: 216 | # return listening ports 217 | api_response = api_instance.status_put() 218 | pprint(api_response) 219 | except ApiException as e: 220 | print("Exception when calling ControlApi->status_put: %s\n" % e) 221 | ``` 222 | 223 | ### Parameters 224 | This endpoint does not need any parameter. 225 | 226 | ### Return type 227 | 228 | [**Ports**](Ports.md) 229 | 230 | ### Authorization 231 | 232 | No authorization required 233 | 234 | ### HTTP request headers 235 | 236 | - **Content-Type**: Not defined 237 | - **Accept**: application/json 238 | 239 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 240 | 241 | # **stop_put** 242 | > stop_put() 243 | 244 | stop running process 245 | 246 | only supported on Netty version 247 | 248 | ### Example 249 | ```python 250 | from __future__ import print_function 251 | import time 252 | import mockserver 253 | from mockserver.rest import ApiException 254 | from pprint import pprint 255 | 256 | # create an instance of the API class 257 | api_instance = mockserver.ControlApi() 258 | 259 | try: 260 | # stop running process 261 | api_instance.stop_put() 262 | except ApiException as e: 263 | print("Exception when calling ControlApi->stop_put: %s\n" % e) 264 | ``` 265 | 266 | ### Parameters 267 | This endpoint does not need any parameter. 268 | 269 | ### Return type 270 | 271 | void (empty response body) 272 | 273 | ### Authorization 274 | 275 | No authorization required 276 | 277 | ### HTTP request headers 278 | 279 | - **Content-Type**: Not defined 280 | - **Accept**: Not defined 281 | 282 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 283 | 284 | -------------------------------------------------------------------------------- /docs/Delay.md: -------------------------------------------------------------------------------- 1 | # Delay 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time_unit** | **str** | | [optional] 7 | **value** | **int** | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Expectation.md: -------------------------------------------------------------------------------- 1 | # Expectation 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/ExpectationApi.md: -------------------------------------------------------------------------------- 1 | # mockserver.ExpectationApi 2 | 3 | All URIs are relative to *http://localhost:1080* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**expectation_put**](ExpectationApi.md#expectation_put) | **PUT** /expectation | create expectation 8 | 9 | 10 | # **expectation_put** 11 | > expectation_put(expectations) 12 | 13 | create expectation 14 | 15 | ### Example 16 | ```python 17 | from __future__ import print_function 18 | import time 19 | import mockserver 20 | from mockserver.rest import ApiException 21 | from pprint import pprint 22 | 23 | # create an instance of the API class 24 | api_instance = mockserver.ExpectationApi() 25 | expectations = NULL # list[Expectations] | expectation to create 26 | 27 | try: 28 | # create expectation 29 | api_instance.expectation_put(expectations) 30 | except ApiException as e: 31 | print("Exception when calling ExpectationApi->expectation_put: %s\n" % e) 32 | ``` 33 | 34 | ### Parameters 35 | 36 | Name | Type | Description | Notes 37 | ------------- | ------------- | ------------- | ------------- 38 | **expectations** | [**list[Expectations]**](list.md)| expectation to create | 39 | 40 | ### Return type 41 | 42 | void (empty response body) 43 | 44 | ### Authorization 45 | 46 | No authorization required 47 | 48 | ### HTTP request headers 49 | 50 | - **Content-Type**: application/json 51 | - **Accept**: Not defined 52 | 53 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 54 | 55 | -------------------------------------------------------------------------------- /docs/Expectations.md: -------------------------------------------------------------------------------- 1 | # Expectations 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/HttpClassCallback.md: -------------------------------------------------------------------------------- 1 | # HttpClassCallback 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **callback_class** | **str** | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/HttpError.md: -------------------------------------------------------------------------------- 1 | # HttpError 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **delay** | [**Delay**](Delay.md) | | [optional] 7 | **drop_connection** | **bool** | | [optional] 8 | **response_bytes** | **str** | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/HttpForward.md: -------------------------------------------------------------------------------- 1 | # HttpForward 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **host** | **str** | | [optional] 7 | **port** | **int** | | [optional] 8 | **scheme** | **str** | | [optional] 9 | **delay** | [**Delay**](Delay.md) | | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/HttpObjectCallback.md: -------------------------------------------------------------------------------- 1 | # HttpObjectCallback 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **client_id** | **str** | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/HttpOverrideForwardedRequest.md: -------------------------------------------------------------------------------- 1 | # HttpOverrideForwardedRequest 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **http_request** | [**HttpRequest**](HttpRequest.md) | | [optional] 7 | **delay** | [**Delay**](Delay.md) | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/HttpRequest.md: -------------------------------------------------------------------------------- 1 | # 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** | **str** | | [optional] 11 | **method** | **str** | | [optional] 12 | **secure** | **bool** | | [optional] 13 | **keep_alive** | **bool** | | [optional] 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/HttpResponse.md: -------------------------------------------------------------------------------- 1 | # 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** | **int** | | [optional] 12 | **reason_phrase** | **str** | | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/HttpTemplate.md: -------------------------------------------------------------------------------- 1 | # HttpTemplate 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **template_type** | **str** | | [optional] 7 | **template** | **str** | | [optional] 8 | **delay** | [**Delay**](Delay.md) | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/KeyToMultiValue.md: -------------------------------------------------------------------------------- 1 | # KeyToMultiValue 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/KeyToValue.md: -------------------------------------------------------------------------------- 1 | # KeyToValue 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | 7 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/Ports.md: -------------------------------------------------------------------------------- 1 | # Ports 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **ports** | **list[float]** | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/TimeToLive.md: -------------------------------------------------------------------------------- 1 | # TimeToLive 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **time_unit** | **str** | | [optional] 7 | **time_to_live** | **int** | | [optional] 8 | **unlimited** | **bool** | | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/Times.md: -------------------------------------------------------------------------------- 1 | # Times 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **remaining_times** | **int** | | [optional] 7 | **unlimited** | **bool** | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/Verification.md: -------------------------------------------------------------------------------- 1 | # 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 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/VerificationSequence.md: -------------------------------------------------------------------------------- 1 | # VerificationSequence 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **http_requests** | [**list[HttpRequest]**](HttpRequest.md) | | [optional] 7 | 8 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/VerificationTimes.md: -------------------------------------------------------------------------------- 1 | # VerificationTimes 2 | 3 | ## Properties 4 | Name | Type | Description | Notes 5 | ------------ | ------------- | ------------- | ------------- 6 | **count** | **int** | | [optional] 7 | **exact** | **bool** | | [optional] 8 | 9 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/VerifyApi.md: -------------------------------------------------------------------------------- 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 | ```python 18 | from __future__ import print_function 19 | import time 20 | import mockserver 21 | from mockserver.rest import ApiException 22 | from pprint import pprint 23 | 24 | # create an instance of the API class 25 | api_instance = mockserver.VerifyApi() 26 | verification = mockserver.Verification() # Verification | request matcher and the number of times to match 27 | 28 | try: 29 | # verify a request has been received a specific number of times 30 | api_instance.verify_put(verification) 31 | except ApiException as e: 32 | print("Exception when calling VerifyApi->verify_put: %s\n" % e) 33 | ``` 34 | 35 | ### Parameters 36 | 37 | Name | Type | Description | Notes 38 | ------------- | ------------- | ------------- | ------------- 39 | **verification** | [**Verification**](Verification.md)| request matcher and the number of times to match | 40 | 41 | ### Return type 42 | 43 | void (empty response body) 44 | 45 | ### Authorization 46 | 47 | No authorization required 48 | 49 | ### HTTP request headers 50 | 51 | - **Content-Type**: application/json 52 | - **Accept**: text/plain 53 | 54 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 55 | 56 | # **verify_sequence_put** 57 | > verify_sequence_put(verification_sequence) 58 | 59 | verify a sequence of request has been received in the specific order 60 | 61 | ### Example 62 | ```python 63 | from __future__ import print_function 64 | import time 65 | import mockserver 66 | from mockserver.rest import ApiException 67 | from pprint import pprint 68 | 69 | # create an instance of the API class 70 | api_instance = mockserver.VerifyApi() 71 | verification_sequence = mockserver.VerificationSequence() # VerificationSequence | the sequence of requests matchers 72 | 73 | try: 74 | # verify a sequence of request has been received in the specific order 75 | api_instance.verify_sequence_put(verification_sequence) 76 | except ApiException as e: 77 | print("Exception when calling VerifyApi->verify_sequence_put: %s\n" % e) 78 | ``` 79 | 80 | ### Parameters 81 | 82 | Name | Type | Description | Notes 83 | ------------- | ------------- | ------------- | ------------- 84 | **verification_sequence** | [**VerificationSequence**](VerificationSequence.md)| the sequence of requests matchers | 85 | 86 | ### Return type 87 | 88 | void (empty response body) 89 | 90 | ### Authorization 91 | 92 | No authorization required 93 | 94 | ### HTTP request headers 95 | 96 | - **Content-Type**: application/json 97 | - **Accept**: text/plain 98 | 99 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 100 | 101 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | 10 | if [ "$git_user_id" = "" ]; then 11 | git_user_id="GIT_USER_ID" 12 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 13 | fi 14 | 15 | if [ "$git_repo_id" = "" ]; then 16 | git_repo_id="GIT_REPO_ID" 17 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 18 | fi 19 | 20 | if [ "$release_note" = "" ]; then 21 | release_note="Minor update" 22 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 23 | fi 24 | 25 | # Initialize the local directory as a Git repository 26 | git init 27 | 28 | # Adds the files in the local repository and stages them for commit. 29 | git add . 30 | 31 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 32 | git commit -m "$release_note" 33 | 34 | # Sets the new remote 35 | git_remote=`git remote` 36 | if [ "$git_remote" = "" ]; then # git remote not defined 37 | 38 | if [ "$GIT_TOKEN" = "" ]; then 39 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 40 | git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git 41 | else 42 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 43 | fi 44 | 45 | fi 46 | 47 | git pull origin master 48 | 49 | # Pushes (Forces) the changes in the local repository up to the remote repository 50 | echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" 51 | git push origin master 2>&1 | grep -v 'To https' 52 | 53 | -------------------------------------------------------------------------------- /mockserver/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | Mock Server API 7 | 8 | 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. # noqa: E501 9 | 10 | OpenAPI spec version: 5.3.0 11 | Generated by: https://openapi-generator.tech 12 | """ 13 | 14 | 15 | from __future__ import absolute_import 16 | 17 | __version__ = "5.3.0" 18 | 19 | # import apis into sdk package 20 | from mockserver.api.control_api import ControlApi 21 | from mockserver.api.expectation_api import ExpectationApi 22 | from mockserver.api.verify_api import VerifyApi 23 | 24 | # import ApiClient 25 | from mockserver.api_client import ApiClient 26 | from mockserver.configuration import Configuration 27 | # import models into sdk package 28 | from mockserver.models.body import Body 29 | from mockserver.models.body_with_content_type import BodyWithContentType 30 | from mockserver.models.connection_options import ConnectionOptions 31 | from mockserver.models.delay import Delay 32 | from mockserver.models.expectation import Expectation 33 | from mockserver.models.expectations import Expectations 34 | from mockserver.models.http_class_callback import HttpClassCallback 35 | from mockserver.models.http_error import HttpError 36 | from mockserver.models.http_forward import HttpForward 37 | from mockserver.models.http_object_callback import HttpObjectCallback 38 | from mockserver.models.http_override_forwarded_request import HttpOverrideForwardedRequest 39 | from mockserver.models.http_request import HttpRequest 40 | from mockserver.models.http_response import HttpResponse 41 | from mockserver.models.http_template import HttpTemplate 42 | from mockserver.models.key_to_multi_value import KeyToMultiValue 43 | from mockserver.models.key_to_value import KeyToValue 44 | from mockserver.models.ports import Ports 45 | from mockserver.models.time_to_live import TimeToLive 46 | from mockserver.models.times import Times 47 | from mockserver.models.verification import Verification 48 | from mockserver.models.verification_sequence import VerificationSequence 49 | from mockserver.models.verification_times import VerificationTimes 50 | -------------------------------------------------------------------------------- /mockserver/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from mockserver.api.control_api import ControlApi 7 | from mockserver.api.expectation_api import ExpectationApi 8 | from mockserver.api.verify_api import VerifyApi 9 | -------------------------------------------------------------------------------- /mockserver/api/expectation_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import re # noqa: F401 16 | 17 | # python 2 and python 3 compatibility library 18 | import six 19 | 20 | from mockserver.api_client import ApiClient 21 | 22 | 23 | class ExpectationApi(object): 24 | """NOTE: This class is auto generated by OpenAPI Generator 25 | Ref: https://openapi-generator.tech 26 | 27 | Do not edit the class manually. 28 | """ 29 | 30 | def __init__(self, api_client=None): 31 | if api_client is None: 32 | api_client = ApiClient() 33 | self.api_client = api_client 34 | 35 | def expectation_put(self, expectations, **kwargs): # noqa: E501 36 | """create expectation # noqa: E501 37 | 38 | This method makes a synchronous HTTP request by default. To make an 39 | asynchronous HTTP request, please pass async_req=True 40 | >>> thread = api.expectation_put(expectations, async_req=True) 41 | >>> result = thread.get() 42 | 43 | :param async_req bool 44 | :param list[Expectations] expectations: expectation to create (required) 45 | :return: None 46 | If the method is called asynchronously, 47 | returns the request thread. 48 | """ 49 | kwargs['_return_http_data_only'] = True 50 | if kwargs.get('async_req'): 51 | return self.expectation_put_with_http_info(expectations, **kwargs) # noqa: E501 52 | else: 53 | (data) = self.expectation_put_with_http_info(expectations, **kwargs) # noqa: E501 54 | return data 55 | 56 | def expectation_put_with_http_info(self, expectations, **kwargs): # noqa: E501 57 | """create expectation # noqa: E501 58 | 59 | This method makes a synchronous HTTP request by default. To make an 60 | asynchronous HTTP request, please pass async_req=True 61 | >>> thread = api.expectation_put_with_http_info(expectations, async_req=True) 62 | >>> result = thread.get() 63 | 64 | :param async_req bool 65 | :param list[Expectations] expectations: expectation to create (required) 66 | :return: None 67 | If the method is called asynchronously, 68 | returns the request thread. 69 | """ 70 | 71 | local_var_params = locals() 72 | 73 | all_params = ['expectations'] # noqa: E501 74 | all_params.append('async_req') 75 | all_params.append('_return_http_data_only') 76 | all_params.append('_preload_content') 77 | all_params.append('_request_timeout') 78 | 79 | for key, val in six.iteritems(local_var_params['kwargs']): 80 | if key not in all_params: 81 | raise TypeError( 82 | "Got an unexpected keyword argument '%s'" 83 | " to method expectation_put" % key 84 | ) 85 | local_var_params[key] = val 86 | del local_var_params['kwargs'] 87 | # verify the required parameter 'expectations' is set 88 | if ('expectations' not in local_var_params or 89 | local_var_params['expectations'] is None): 90 | raise ValueError("Missing the required parameter `expectations` when calling `expectation_put`") # noqa: E501 91 | 92 | collection_formats = {} 93 | 94 | path_params = {} 95 | 96 | query_params = [] 97 | 98 | header_params = {} 99 | 100 | form_params = [] 101 | local_var_files = {} 102 | 103 | body_params = None 104 | if 'expectations' in local_var_params: 105 | body_params = local_var_params['expectations'] 106 | # HTTP header `Content-Type` 107 | header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 108 | ['application/json']) # noqa: E501 109 | 110 | # Authentication setting 111 | auth_settings = [] # noqa: E501 112 | 113 | return self.api_client.call_api( 114 | '/expectation', 'PUT', 115 | path_params, 116 | query_params, 117 | header_params, 118 | body=body_params, 119 | post_params=form_params, 120 | files=local_var_files, 121 | response_type=None, # noqa: E501 122 | auth_settings=auth_settings, 123 | async_req=local_var_params.get('async_req'), 124 | _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 125 | _preload_content=local_var_params.get('_preload_content', True), 126 | _request_timeout=local_var_params.get('_request_timeout'), 127 | collection_formats=collection_formats) 128 | -------------------------------------------------------------------------------- /mockserver/api/verify_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import re # noqa: F401 16 | 17 | # python 2 and python 3 compatibility library 18 | import six 19 | 20 | from mockserver.api_client import ApiClient 21 | 22 | 23 | class VerifyApi(object): 24 | """NOTE: This class is auto generated by OpenAPI Generator 25 | Ref: https://openapi-generator.tech 26 | 27 | Do not edit the class manually. 28 | """ 29 | 30 | def __init__(self, api_client=None): 31 | if api_client is None: 32 | api_client = ApiClient() 33 | self.api_client = api_client 34 | 35 | def verify_put(self, verification, **kwargs): # noqa: E501 36 | """verify a request has been received a specific number of times # noqa: E501 37 | 38 | This method makes a synchronous HTTP request by default. To make an 39 | asynchronous HTTP request, please pass async_req=True 40 | >>> thread = api.verify_put(verification, async_req=True) 41 | >>> result = thread.get() 42 | 43 | :param async_req bool 44 | :param Verification verification: request matcher and the number of times to match (required) 45 | :return: None 46 | If the method is called asynchronously, 47 | returns the request thread. 48 | """ 49 | kwargs['_return_http_data_only'] = True 50 | if kwargs.get('async_req'): 51 | return self.verify_put_with_http_info(verification, **kwargs) # noqa: E501 52 | else: 53 | (data) = self.verify_put_with_http_info(verification, **kwargs) # noqa: E501 54 | return data 55 | 56 | def verify_put_with_http_info(self, verification, **kwargs): # noqa: E501 57 | """verify a request has been received a specific number of times # noqa: E501 58 | 59 | This method makes a synchronous HTTP request by default. To make an 60 | asynchronous HTTP request, please pass async_req=True 61 | >>> thread = api.verify_put_with_http_info(verification, async_req=True) 62 | >>> result = thread.get() 63 | 64 | :param async_req bool 65 | :param Verification verification: request matcher and the number of times to match (required) 66 | :return: None 67 | If the method is called asynchronously, 68 | returns the request thread. 69 | """ 70 | 71 | local_var_params = locals() 72 | 73 | all_params = ['verification'] # noqa: E501 74 | all_params.append('async_req') 75 | all_params.append('_return_http_data_only') 76 | all_params.append('_preload_content') 77 | all_params.append('_request_timeout') 78 | 79 | for key, val in six.iteritems(local_var_params['kwargs']): 80 | if key not in all_params: 81 | raise TypeError( 82 | "Got an unexpected keyword argument '%s'" 83 | " to method verify_put" % key 84 | ) 85 | local_var_params[key] = val 86 | del local_var_params['kwargs'] 87 | # verify the required parameter 'verification' is set 88 | if ('verification' not in local_var_params or 89 | local_var_params['verification'] is None): 90 | raise ValueError("Missing the required parameter `verification` when calling `verify_put`") # noqa: E501 91 | 92 | collection_formats = {} 93 | 94 | path_params = {} 95 | 96 | query_params = [] 97 | 98 | header_params = {} 99 | 100 | form_params = [] 101 | local_var_files = {} 102 | 103 | body_params = None 104 | if 'verification' in local_var_params: 105 | body_params = local_var_params['verification'] 106 | # HTTP header `Accept` 107 | header_params['Accept'] = self.api_client.select_header_accept( 108 | ['text/plain']) # noqa: E501 109 | 110 | # HTTP header `Content-Type` 111 | header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 112 | ['application/json']) # noqa: E501 113 | 114 | # Authentication setting 115 | auth_settings = [] # noqa: E501 116 | 117 | return self.api_client.call_api( 118 | '/verify', 'PUT', 119 | path_params, 120 | query_params, 121 | header_params, 122 | body=body_params, 123 | post_params=form_params, 124 | files=local_var_files, 125 | response_type=None, # noqa: E501 126 | auth_settings=auth_settings, 127 | async_req=local_var_params.get('async_req'), 128 | _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 129 | _preload_content=local_var_params.get('_preload_content', True), 130 | _request_timeout=local_var_params.get('_request_timeout'), 131 | collection_formats=collection_formats) 132 | 133 | def verify_sequence_put(self, verification_sequence, **kwargs): # noqa: E501 134 | """verify a sequence of request has been received in the specific order # noqa: E501 135 | 136 | This method makes a synchronous HTTP request by default. To make an 137 | asynchronous HTTP request, please pass async_req=True 138 | >>> thread = api.verify_sequence_put(verification_sequence, async_req=True) 139 | >>> result = thread.get() 140 | 141 | :param async_req bool 142 | :param VerificationSequence verification_sequence: the sequence of requests matchers (required) 143 | :return: None 144 | If the method is called asynchronously, 145 | returns the request thread. 146 | """ 147 | kwargs['_return_http_data_only'] = True 148 | if kwargs.get('async_req'): 149 | return self.verify_sequence_put_with_http_info(verification_sequence, **kwargs) # noqa: E501 150 | else: 151 | (data) = self.verify_sequence_put_with_http_info(verification_sequence, **kwargs) # noqa: E501 152 | return data 153 | 154 | def verify_sequence_put_with_http_info(self, verification_sequence, **kwargs): # noqa: E501 155 | """verify a sequence of request has been received in the specific order # noqa: E501 156 | 157 | This method makes a synchronous HTTP request by default. To make an 158 | asynchronous HTTP request, please pass async_req=True 159 | >>> thread = api.verify_sequence_put_with_http_info(verification_sequence, async_req=True) 160 | >>> result = thread.get() 161 | 162 | :param async_req bool 163 | :param VerificationSequence verification_sequence: the sequence of requests matchers (required) 164 | :return: None 165 | If the method is called asynchronously, 166 | returns the request thread. 167 | """ 168 | 169 | local_var_params = locals() 170 | 171 | all_params = ['verification_sequence'] # noqa: E501 172 | all_params.append('async_req') 173 | all_params.append('_return_http_data_only') 174 | all_params.append('_preload_content') 175 | all_params.append('_request_timeout') 176 | 177 | for key, val in six.iteritems(local_var_params['kwargs']): 178 | if key not in all_params: 179 | raise TypeError( 180 | "Got an unexpected keyword argument '%s'" 181 | " to method verify_sequence_put" % key 182 | ) 183 | local_var_params[key] = val 184 | del local_var_params['kwargs'] 185 | # verify the required parameter 'verification_sequence' is set 186 | if ('verification_sequence' not in local_var_params or 187 | local_var_params['verification_sequence'] is None): 188 | raise ValueError("Missing the required parameter `verification_sequence` when calling `verify_sequence_put`") # noqa: E501 189 | 190 | collection_formats = {} 191 | 192 | path_params = {} 193 | 194 | query_params = [] 195 | 196 | header_params = {} 197 | 198 | form_params = [] 199 | local_var_files = {} 200 | 201 | body_params = None 202 | if 'verification_sequence' in local_var_params: 203 | body_params = local_var_params['verification_sequence'] 204 | # HTTP header `Accept` 205 | header_params['Accept'] = self.api_client.select_header_accept( 206 | ['text/plain']) # noqa: E501 207 | 208 | # HTTP header `Content-Type` 209 | header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 210 | ['application/json']) # noqa: E501 211 | 212 | # Authentication setting 213 | auth_settings = [] # noqa: E501 214 | 215 | return self.api_client.call_api( 216 | '/verifySequence', 'PUT', 217 | path_params, 218 | query_params, 219 | header_params, 220 | body=body_params, 221 | post_params=form_params, 222 | files=local_var_files, 223 | response_type=None, # noqa: E501 224 | auth_settings=auth_settings, 225 | async_req=local_var_params.get('async_req'), 226 | _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 227 | _preload_content=local_var_params.get('_preload_content', True), 228 | _request_timeout=local_var_params.get('_request_timeout'), 229 | collection_formats=collection_formats) 230 | -------------------------------------------------------------------------------- /mockserver/configuration.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import copy 16 | import logging 17 | import multiprocessing 18 | import sys 19 | import urllib3 20 | 21 | import six 22 | from six.moves import http_client as httplib 23 | 24 | 25 | class TypeWithDefault(type): 26 | def __init__(cls, name, bases, dct): 27 | super(TypeWithDefault, cls).__init__(name, bases, dct) 28 | cls._default = None 29 | 30 | def __call__(cls): 31 | if cls._default is None: 32 | cls._default = type.__call__(cls) 33 | return copy.copy(cls._default) 34 | 35 | def set_default(cls, default): 36 | cls._default = copy.copy(default) 37 | 38 | 39 | class Configuration(six.with_metaclass(TypeWithDefault, object)): 40 | """NOTE: This class is auto generated by OpenAPI Generator 41 | 42 | Ref: https://openapi-generator.tech 43 | Do not edit the class manually. 44 | """ 45 | 46 | def __init__(self): 47 | """Constructor""" 48 | # Default Base url 49 | self.host = "http://localhost:1080" 50 | # Temp file folder for downloading files 51 | self.temp_folder_path = None 52 | 53 | # Authentication Settings 54 | # dict to store API key(s) 55 | self.api_key = {} 56 | # dict to store API prefix (e.g. Bearer) 57 | self.api_key_prefix = {} 58 | # Username for HTTP basic authentication 59 | self.username = "" 60 | # Password for HTTP basic authentication 61 | self.password = "" 62 | 63 | # Logging Settings 64 | self.logger = {} 65 | self.logger["package_logger"] = logging.getLogger("mockserver") 66 | self.logger["urllib3_logger"] = logging.getLogger("urllib3") 67 | # Log format 68 | self.logger_format = '%(asctime)s %(levelname)s %(message)s' 69 | # Log stream handler 70 | self.logger_stream_handler = None 71 | # Log file handler 72 | self.logger_file_handler = None 73 | # Debug file location 74 | self.logger_file = None 75 | # Debug switch 76 | self.debug = False 77 | 78 | # SSL/TLS verification 79 | # Set this to false to skip verifying SSL certificate when calling API 80 | # from https server. 81 | self.verify_ssl = True 82 | # Set this to customize the certificate file to verify the peer. 83 | self.ssl_ca_cert = None 84 | # client certificate file 85 | self.cert_file = None 86 | # client key file 87 | self.key_file = None 88 | # Set this to True/False to enable/disable SSL hostname verification. 89 | self.assert_hostname = None 90 | 91 | # urllib3 connection pool's maximum number of connections saved 92 | # per pool. urllib3 uses 1 connection as default value, but this is 93 | # not the best value when you are making a lot of possibly parallel 94 | # requests to the same host, which is often the case here. 95 | # cpu_count * 5 is used as default value to increase performance. 96 | self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 97 | 98 | # Proxy URL 99 | self.proxy = None 100 | # Safe chars for path_param 101 | self.safe_chars_for_path_param = '' 102 | 103 | @property 104 | def logger_file(self): 105 | """The logger file. 106 | 107 | If the logger_file is None, then add stream handler and remove file 108 | handler. Otherwise, add file handler and remove stream handler. 109 | 110 | :param value: The logger_file path. 111 | :type: str 112 | """ 113 | return self.__logger_file 114 | 115 | @logger_file.setter 116 | def logger_file(self, value): 117 | """The logger file. 118 | 119 | If the logger_file is None, then add stream handler and remove file 120 | handler. Otherwise, add file handler and remove stream handler. 121 | 122 | :param value: The logger_file path. 123 | :type: str 124 | """ 125 | self.__logger_file = value 126 | if self.__logger_file: 127 | # If set logging file, 128 | # then add file handler and remove stream handler. 129 | self.logger_file_handler = logging.FileHandler(self.__logger_file) 130 | self.logger_file_handler.setFormatter(self.logger_formatter) 131 | for _, logger in six.iteritems(self.logger): 132 | logger.addHandler(self.logger_file_handler) 133 | 134 | @property 135 | def debug(self): 136 | """Debug status 137 | 138 | :param value: The debug status, True or False. 139 | :type: bool 140 | """ 141 | return self.__debug 142 | 143 | @debug.setter 144 | def debug(self, value): 145 | """Debug status 146 | 147 | :param value: The debug status, True or False. 148 | :type: bool 149 | """ 150 | self.__debug = value 151 | if self.__debug: 152 | # if debug status is True, turn on debug logging 153 | for _, logger in six.iteritems(self.logger): 154 | logger.setLevel(logging.DEBUG) 155 | # turn on httplib debug 156 | httplib.HTTPConnection.debuglevel = 1 157 | else: 158 | # if debug status is False, turn off debug logging, 159 | # setting log level to default `logging.WARNING` 160 | for _, logger in six.iteritems(self.logger): 161 | logger.setLevel(logging.WARNING) 162 | # turn off httplib debug 163 | httplib.HTTPConnection.debuglevel = 0 164 | 165 | @property 166 | def logger_format(self): 167 | """The logger format. 168 | 169 | The logger_formatter will be updated when sets logger_format. 170 | 171 | :param value: The format string. 172 | :type: str 173 | """ 174 | return self.__logger_format 175 | 176 | @logger_format.setter 177 | def logger_format(self, value): 178 | """The logger format. 179 | 180 | The logger_formatter will be updated when sets logger_format. 181 | 182 | :param value: The format string. 183 | :type: str 184 | """ 185 | self.__logger_format = value 186 | self.logger_formatter = logging.Formatter(self.__logger_format) 187 | 188 | def get_api_key_with_prefix(self, identifier): 189 | """Gets API key (with prefix if set). 190 | 191 | :param identifier: The identifier of apiKey. 192 | :return: The token for api key authentication. 193 | """ 194 | if (self.api_key.get(identifier) and 195 | self.api_key_prefix.get(identifier)): 196 | return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 197 | elif self.api_key.get(identifier): 198 | return self.api_key[identifier] 199 | 200 | def get_basic_auth_token(self): 201 | """Gets HTTP basic authentication header (string). 202 | 203 | :return: The token for basic HTTP authentication. 204 | """ 205 | return urllib3.util.make_headers( 206 | basic_auth=self.username + ':' + self.password 207 | ).get('authorization') 208 | 209 | def auth_settings(self): 210 | """Gets Auth Settings dict for api client. 211 | 212 | :return: The Auth Settings information dict. 213 | """ 214 | return { 215 | 216 | } 217 | 218 | def to_debug_report(self): 219 | """Gets the essential information for debugging. 220 | 221 | :return: The report for debugging. 222 | """ 223 | return "Python SDK Debug Report:\n"\ 224 | "OS: {env}\n"\ 225 | "Python Version: {pyversion}\n"\ 226 | "Version of the API: 5.3.0\n"\ 227 | "SDK Package Version: 5.3.0".\ 228 | format(env=sys.platform, pyversion=sys.version) 229 | -------------------------------------------------------------------------------- /mockserver/models/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | """ 5 | Mock Server API 6 | 7 | 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. # noqa: E501 8 | 9 | OpenAPI spec version: 5.3.0 10 | Generated by: https://openapi-generator.tech 11 | """ 12 | 13 | 14 | from __future__ import absolute_import 15 | 16 | # import models into model package 17 | from mockserver.models.body import Body 18 | from mockserver.models.body_with_content_type import BodyWithContentType 19 | from mockserver.models.connection_options import ConnectionOptions 20 | from mockserver.models.delay import Delay 21 | from mockserver.models.expectation import Expectation 22 | from mockserver.models.expectations import Expectations 23 | from mockserver.models.http_class_callback import HttpClassCallback 24 | from mockserver.models.http_error import HttpError 25 | from mockserver.models.http_forward import HttpForward 26 | from mockserver.models.http_object_callback import HttpObjectCallback 27 | from mockserver.models.http_override_forwarded_request import HttpOverrideForwardedRequest 28 | from mockserver.models.http_request import HttpRequest 29 | from mockserver.models.http_response import HttpResponse 30 | from mockserver.models.http_template import HttpTemplate 31 | from mockserver.models.key_to_multi_value import KeyToMultiValue 32 | from mockserver.models.key_to_value import KeyToValue 33 | from mockserver.models.ports import Ports 34 | from mockserver.models.time_to_live import TimeToLive 35 | from mockserver.models.times import Times 36 | from mockserver.models.verification import Verification 37 | from mockserver.models.verification_sequence import VerificationSequence 38 | from mockserver.models.verification_times import VerificationTimes 39 | -------------------------------------------------------------------------------- /mockserver/models/body.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Body(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """Body - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, Body): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/body_with_content_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class BodyWithContentType(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """BodyWithContentType - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, BodyWithContentType): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/connection_options.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class ConnectionOptions(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'close_socket': 'bool', 35 | 'content_length_header_override': 'int', 36 | 'suppress_content_length_header': 'bool', 37 | 'suppress_connection_header': 'bool', 38 | 'keep_alive_override': 'bool' 39 | } 40 | 41 | attribute_map = { 42 | 'close_socket': 'closeSocket', 43 | 'content_length_header_override': 'contentLengthHeaderOverride', 44 | 'suppress_content_length_header': 'suppressContentLengthHeader', 45 | 'suppress_connection_header': 'suppressConnectionHeader', 46 | 'keep_alive_override': 'keepAliveOverride' 47 | } 48 | 49 | def __init__(self, close_socket=None, content_length_header_override=None, suppress_content_length_header=None, suppress_connection_header=None, keep_alive_override=None): # noqa: E501 50 | """ConnectionOptions - a model defined in OpenAPI""" # noqa: E501 51 | 52 | self._close_socket = None 53 | self._content_length_header_override = None 54 | self._suppress_content_length_header = None 55 | self._suppress_connection_header = None 56 | self._keep_alive_override = None 57 | self.discriminator = None 58 | 59 | if close_socket is not None: 60 | self.close_socket = close_socket 61 | if content_length_header_override is not None: 62 | self.content_length_header_override = content_length_header_override 63 | if suppress_content_length_header is not None: 64 | self.suppress_content_length_header = suppress_content_length_header 65 | if suppress_connection_header is not None: 66 | self.suppress_connection_header = suppress_connection_header 67 | if keep_alive_override is not None: 68 | self.keep_alive_override = keep_alive_override 69 | 70 | @property 71 | def close_socket(self): 72 | """Gets the close_socket of this ConnectionOptions. # noqa: E501 73 | 74 | 75 | :return: The close_socket of this ConnectionOptions. # noqa: E501 76 | :rtype: bool 77 | """ 78 | return self._close_socket 79 | 80 | @close_socket.setter 81 | def close_socket(self, close_socket): 82 | """Sets the close_socket of this ConnectionOptions. 83 | 84 | 85 | :param close_socket: The close_socket of this ConnectionOptions. # noqa: E501 86 | :type: bool 87 | """ 88 | 89 | self._close_socket = close_socket 90 | 91 | @property 92 | def content_length_header_override(self): 93 | """Gets the content_length_header_override of this ConnectionOptions. # noqa: E501 94 | 95 | 96 | :return: The content_length_header_override of this ConnectionOptions. # noqa: E501 97 | :rtype: int 98 | """ 99 | return self._content_length_header_override 100 | 101 | @content_length_header_override.setter 102 | def content_length_header_override(self, content_length_header_override): 103 | """Sets the content_length_header_override of this ConnectionOptions. 104 | 105 | 106 | :param content_length_header_override: The content_length_header_override of this ConnectionOptions. # noqa: E501 107 | :type: int 108 | """ 109 | 110 | self._content_length_header_override = content_length_header_override 111 | 112 | @property 113 | def suppress_content_length_header(self): 114 | """Gets the suppress_content_length_header of this ConnectionOptions. # noqa: E501 115 | 116 | 117 | :return: The suppress_content_length_header of this ConnectionOptions. # noqa: E501 118 | :rtype: bool 119 | """ 120 | return self._suppress_content_length_header 121 | 122 | @suppress_content_length_header.setter 123 | def suppress_content_length_header(self, suppress_content_length_header): 124 | """Sets the suppress_content_length_header of this ConnectionOptions. 125 | 126 | 127 | :param suppress_content_length_header: The suppress_content_length_header of this ConnectionOptions. # noqa: E501 128 | :type: bool 129 | """ 130 | 131 | self._suppress_content_length_header = suppress_content_length_header 132 | 133 | @property 134 | def suppress_connection_header(self): 135 | """Gets the suppress_connection_header of this ConnectionOptions. # noqa: E501 136 | 137 | 138 | :return: The suppress_connection_header of this ConnectionOptions. # noqa: E501 139 | :rtype: bool 140 | """ 141 | return self._suppress_connection_header 142 | 143 | @suppress_connection_header.setter 144 | def suppress_connection_header(self, suppress_connection_header): 145 | """Sets the suppress_connection_header of this ConnectionOptions. 146 | 147 | 148 | :param suppress_connection_header: The suppress_connection_header of this ConnectionOptions. # noqa: E501 149 | :type: bool 150 | """ 151 | 152 | self._suppress_connection_header = suppress_connection_header 153 | 154 | @property 155 | def keep_alive_override(self): 156 | """Gets the keep_alive_override of this ConnectionOptions. # noqa: E501 157 | 158 | 159 | :return: The keep_alive_override of this ConnectionOptions. # noqa: E501 160 | :rtype: bool 161 | """ 162 | return self._keep_alive_override 163 | 164 | @keep_alive_override.setter 165 | def keep_alive_override(self, keep_alive_override): 166 | """Sets the keep_alive_override of this ConnectionOptions. 167 | 168 | 169 | :param keep_alive_override: The keep_alive_override of this ConnectionOptions. # noqa: E501 170 | :type: bool 171 | """ 172 | 173 | self._keep_alive_override = keep_alive_override 174 | 175 | def to_dict(self): 176 | """Returns the model properties as a dict""" 177 | result = {} 178 | 179 | for attr, _ in six.iteritems(self.openapi_types): 180 | value = getattr(self, attr) 181 | if isinstance(value, list): 182 | result[attr] = list(map( 183 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 184 | value 185 | )) 186 | elif hasattr(value, "to_dict"): 187 | result[attr] = value.to_dict() 188 | elif isinstance(value, dict): 189 | result[attr] = dict(map( 190 | lambda item: (item[0], item[1].to_dict()) 191 | if hasattr(item[1], "to_dict") else item, 192 | value.items() 193 | )) 194 | else: 195 | result[attr] = value 196 | 197 | return result 198 | 199 | def to_str(self): 200 | """Returns the string representation of the model""" 201 | return pprint.pformat(self.to_dict()) 202 | 203 | def __repr__(self): 204 | """For `print` and `pprint`""" 205 | return self.to_str() 206 | 207 | def __eq__(self, other): 208 | """Returns true if both objects are equal""" 209 | if not isinstance(other, ConnectionOptions): 210 | return False 211 | 212 | return self.__dict__ == other.__dict__ 213 | 214 | def __ne__(self, other): 215 | """Returns true if both objects are not equal""" 216 | return not self == other 217 | -------------------------------------------------------------------------------- /mockserver/models/delay.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Delay(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'time_unit': 'str', 35 | 'value': 'int' 36 | } 37 | 38 | attribute_map = { 39 | 'time_unit': 'timeUnit', 40 | 'value': 'value' 41 | } 42 | 43 | def __init__(self, time_unit=None, value=None): # noqa: E501 44 | """Delay - a model defined in OpenAPI""" # noqa: E501 45 | 46 | self._time_unit = None 47 | self._value = None 48 | self.discriminator = None 49 | 50 | if time_unit is not None: 51 | self.time_unit = time_unit 52 | if value is not None: 53 | self.value = value 54 | 55 | @property 56 | def time_unit(self): 57 | """Gets the time_unit of this Delay. # noqa: E501 58 | 59 | 60 | :return: The time_unit of this Delay. # noqa: E501 61 | :rtype: str 62 | """ 63 | return self._time_unit 64 | 65 | @time_unit.setter 66 | def time_unit(self, time_unit): 67 | """Sets the time_unit of this Delay. 68 | 69 | 70 | :param time_unit: The time_unit of this Delay. # noqa: E501 71 | :type: str 72 | """ 73 | 74 | self._time_unit = time_unit 75 | 76 | @property 77 | def value(self): 78 | """Gets the value of this Delay. # noqa: E501 79 | 80 | 81 | :return: The value of this Delay. # noqa: E501 82 | :rtype: int 83 | """ 84 | return self._value 85 | 86 | @value.setter 87 | def value(self, value): 88 | """Sets the value of this Delay. 89 | 90 | 91 | :param value: The value of this Delay. # noqa: E501 92 | :type: int 93 | """ 94 | 95 | self._value = value 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.openapi_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, Delay): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /mockserver/models/expectation.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Expectation(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """Expectation - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, Expectation): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/expectations.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Expectations(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """Expectations - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, Expectations): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/http_class_callback.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpClassCallback(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'callback_class': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'callback_class': 'callbackClass' 39 | } 40 | 41 | def __init__(self, callback_class=None): # noqa: E501 42 | """HttpClassCallback - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._callback_class = None 45 | self.discriminator = None 46 | 47 | if callback_class is not None: 48 | self.callback_class = callback_class 49 | 50 | @property 51 | def callback_class(self): 52 | """Gets the callback_class of this HttpClassCallback. # noqa: E501 53 | 54 | 55 | :return: The callback_class of this HttpClassCallback. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._callback_class 59 | 60 | @callback_class.setter 61 | def callback_class(self, callback_class): 62 | """Sets the callback_class of this HttpClassCallback. 63 | 64 | 65 | :param callback_class: The callback_class of this HttpClassCallback. # noqa: E501 66 | :type: str 67 | """ 68 | 69 | self._callback_class = callback_class 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, HttpClassCallback): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /mockserver/models/http_error.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpError(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'delay': 'Delay', 35 | 'drop_connection': 'bool', 36 | 'response_bytes': 'str' 37 | } 38 | 39 | attribute_map = { 40 | 'delay': 'delay', 41 | 'drop_connection': 'dropConnection', 42 | 'response_bytes': 'responseBytes' 43 | } 44 | 45 | def __init__(self, delay=None, drop_connection=None, response_bytes=None): # noqa: E501 46 | """HttpError - a model defined in OpenAPI""" # noqa: E501 47 | 48 | self._delay = None 49 | self._drop_connection = None 50 | self._response_bytes = None 51 | self.discriminator = None 52 | 53 | if delay is not None: 54 | self.delay = delay 55 | if drop_connection is not None: 56 | self.drop_connection = drop_connection 57 | if response_bytes is not None: 58 | self.response_bytes = response_bytes 59 | 60 | @property 61 | def delay(self): 62 | """Gets the delay of this HttpError. # noqa: E501 63 | 64 | 65 | :return: The delay of this HttpError. # noqa: E501 66 | :rtype: Delay 67 | """ 68 | return self._delay 69 | 70 | @delay.setter 71 | def delay(self, delay): 72 | """Sets the delay of this HttpError. 73 | 74 | 75 | :param delay: The delay of this HttpError. # noqa: E501 76 | :type: Delay 77 | """ 78 | 79 | self._delay = delay 80 | 81 | @property 82 | def drop_connection(self): 83 | """Gets the drop_connection of this HttpError. # noqa: E501 84 | 85 | 86 | :return: The drop_connection of this HttpError. # noqa: E501 87 | :rtype: bool 88 | """ 89 | return self._drop_connection 90 | 91 | @drop_connection.setter 92 | def drop_connection(self, drop_connection): 93 | """Sets the drop_connection of this HttpError. 94 | 95 | 96 | :param drop_connection: The drop_connection of this HttpError. # noqa: E501 97 | :type: bool 98 | """ 99 | 100 | self._drop_connection = drop_connection 101 | 102 | @property 103 | def response_bytes(self): 104 | """Gets the response_bytes of this HttpError. # noqa: E501 105 | 106 | 107 | :return: The response_bytes of this HttpError. # noqa: E501 108 | :rtype: str 109 | """ 110 | return self._response_bytes 111 | 112 | @response_bytes.setter 113 | def response_bytes(self, response_bytes): 114 | """Sets the response_bytes of this HttpError. 115 | 116 | 117 | :param response_bytes: The response_bytes of this HttpError. # noqa: E501 118 | :type: str 119 | """ 120 | 121 | self._response_bytes = response_bytes 122 | 123 | def to_dict(self): 124 | """Returns the model properties as a dict""" 125 | result = {} 126 | 127 | for attr, _ in six.iteritems(self.openapi_types): 128 | value = getattr(self, attr) 129 | if isinstance(value, list): 130 | result[attr] = list(map( 131 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 132 | value 133 | )) 134 | elif hasattr(value, "to_dict"): 135 | result[attr] = value.to_dict() 136 | elif isinstance(value, dict): 137 | result[attr] = dict(map( 138 | lambda item: (item[0], item[1].to_dict()) 139 | if hasattr(item[1], "to_dict") else item, 140 | value.items() 141 | )) 142 | else: 143 | result[attr] = value 144 | 145 | return result 146 | 147 | def to_str(self): 148 | """Returns the string representation of the model""" 149 | return pprint.pformat(self.to_dict()) 150 | 151 | def __repr__(self): 152 | """For `print` and `pprint`""" 153 | return self.to_str() 154 | 155 | def __eq__(self, other): 156 | """Returns true if both objects are equal""" 157 | if not isinstance(other, HttpError): 158 | return False 159 | 160 | return self.__dict__ == other.__dict__ 161 | 162 | def __ne__(self, other): 163 | """Returns true if both objects are not equal""" 164 | return not self == other 165 | -------------------------------------------------------------------------------- /mockserver/models/http_forward.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpForward(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'host': 'str', 35 | 'port': 'int', 36 | 'scheme': 'str', 37 | 'delay': 'Delay' 38 | } 39 | 40 | attribute_map = { 41 | 'host': 'host', 42 | 'port': 'port', 43 | 'scheme': 'scheme', 44 | 'delay': 'delay' 45 | } 46 | 47 | def __init__(self, host=None, port=None, scheme=None, delay=None): # noqa: E501 48 | """HttpForward - a model defined in OpenAPI""" # noqa: E501 49 | 50 | self._host = None 51 | self._port = None 52 | self._scheme = None 53 | self._delay = None 54 | self.discriminator = None 55 | 56 | if host is not None: 57 | self.host = host 58 | if port is not None: 59 | self.port = port 60 | if scheme is not None: 61 | self.scheme = scheme 62 | if delay is not None: 63 | self.delay = delay 64 | 65 | @property 66 | def host(self): 67 | """Gets the host of this HttpForward. # noqa: E501 68 | 69 | 70 | :return: The host of this HttpForward. # noqa: E501 71 | :rtype: str 72 | """ 73 | return self._host 74 | 75 | @host.setter 76 | def host(self, host): 77 | """Sets the host of this HttpForward. 78 | 79 | 80 | :param host: The host of this HttpForward. # noqa: E501 81 | :type: str 82 | """ 83 | 84 | self._host = host 85 | 86 | @property 87 | def port(self): 88 | """Gets the port of this HttpForward. # noqa: E501 89 | 90 | 91 | :return: The port of this HttpForward. # noqa: E501 92 | :rtype: int 93 | """ 94 | return self._port 95 | 96 | @port.setter 97 | def port(self, port): 98 | """Sets the port of this HttpForward. 99 | 100 | 101 | :param port: The port of this HttpForward. # noqa: E501 102 | :type: int 103 | """ 104 | 105 | self._port = port 106 | 107 | @property 108 | def scheme(self): 109 | """Gets the scheme of this HttpForward. # noqa: E501 110 | 111 | 112 | :return: The scheme of this HttpForward. # noqa: E501 113 | :rtype: str 114 | """ 115 | return self._scheme 116 | 117 | @scheme.setter 118 | def scheme(self, scheme): 119 | """Sets the scheme of this HttpForward. 120 | 121 | 122 | :param scheme: The scheme of this HttpForward. # noqa: E501 123 | :type: str 124 | """ 125 | allowed_values = ["HTTP", "HTTPS"] # noqa: E501 126 | if scheme not in allowed_values: 127 | raise ValueError( 128 | "Invalid value for `scheme` ({0}), must be one of {1}" # noqa: E501 129 | .format(scheme, allowed_values) 130 | ) 131 | 132 | self._scheme = scheme 133 | 134 | @property 135 | def delay(self): 136 | """Gets the delay of this HttpForward. # noqa: E501 137 | 138 | 139 | :return: The delay of this HttpForward. # noqa: E501 140 | :rtype: Delay 141 | """ 142 | return self._delay 143 | 144 | @delay.setter 145 | def delay(self, delay): 146 | """Sets the delay of this HttpForward. 147 | 148 | 149 | :param delay: The delay of this HttpForward. # noqa: E501 150 | :type: Delay 151 | """ 152 | 153 | self._delay = delay 154 | 155 | def to_dict(self): 156 | """Returns the model properties as a dict""" 157 | result = {} 158 | 159 | for attr, _ in six.iteritems(self.openapi_types): 160 | value = getattr(self, attr) 161 | if isinstance(value, list): 162 | result[attr] = list(map( 163 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 164 | value 165 | )) 166 | elif hasattr(value, "to_dict"): 167 | result[attr] = value.to_dict() 168 | elif isinstance(value, dict): 169 | result[attr] = dict(map( 170 | lambda item: (item[0], item[1].to_dict()) 171 | if hasattr(item[1], "to_dict") else item, 172 | value.items() 173 | )) 174 | else: 175 | result[attr] = value 176 | 177 | return result 178 | 179 | def to_str(self): 180 | """Returns the string representation of the model""" 181 | return pprint.pformat(self.to_dict()) 182 | 183 | def __repr__(self): 184 | """For `print` and `pprint`""" 185 | return self.to_str() 186 | 187 | def __eq__(self, other): 188 | """Returns true if both objects are equal""" 189 | if not isinstance(other, HttpForward): 190 | return False 191 | 192 | return self.__dict__ == other.__dict__ 193 | 194 | def __ne__(self, other): 195 | """Returns true if both objects are not equal""" 196 | return not self == other 197 | -------------------------------------------------------------------------------- /mockserver/models/http_object_callback.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpObjectCallback(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'client_id': 'str' 35 | } 36 | 37 | attribute_map = { 38 | 'client_id': 'clientId' 39 | } 40 | 41 | def __init__(self, client_id=None): # noqa: E501 42 | """HttpObjectCallback - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._client_id = None 45 | self.discriminator = None 46 | 47 | if client_id is not None: 48 | self.client_id = client_id 49 | 50 | @property 51 | def client_id(self): 52 | """Gets the client_id of this HttpObjectCallback. # noqa: E501 53 | 54 | 55 | :return: The client_id of this HttpObjectCallback. # noqa: E501 56 | :rtype: str 57 | """ 58 | return self._client_id 59 | 60 | @client_id.setter 61 | def client_id(self, client_id): 62 | """Sets the client_id of this HttpObjectCallback. 63 | 64 | 65 | :param client_id: The client_id of this HttpObjectCallback. # noqa: E501 66 | :type: str 67 | """ 68 | 69 | self._client_id = client_id 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, HttpObjectCallback): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /mockserver/models/http_override_forwarded_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpOverrideForwardedRequest(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'http_request': 'HttpRequest', 35 | 'delay': 'Delay' 36 | } 37 | 38 | attribute_map = { 39 | 'http_request': 'httpRequest', 40 | 'delay': 'delay' 41 | } 42 | 43 | def __init__(self, http_request=None, delay=None): # noqa: E501 44 | """HttpOverrideForwardedRequest - a model defined in OpenAPI""" # noqa: E501 45 | 46 | self._http_request = None 47 | self._delay = None 48 | self.discriminator = None 49 | 50 | if http_request is not None: 51 | self.http_request = http_request 52 | if delay is not None: 53 | self.delay = delay 54 | 55 | @property 56 | def http_request(self): 57 | """Gets the http_request of this HttpOverrideForwardedRequest. # noqa: E501 58 | 59 | 60 | :return: The http_request of this HttpOverrideForwardedRequest. # noqa: E501 61 | :rtype: HttpRequest 62 | """ 63 | return self._http_request 64 | 65 | @http_request.setter 66 | def http_request(self, http_request): 67 | """Sets the http_request of this HttpOverrideForwardedRequest. 68 | 69 | 70 | :param http_request: The http_request of this HttpOverrideForwardedRequest. # noqa: E501 71 | :type: HttpRequest 72 | """ 73 | 74 | self._http_request = http_request 75 | 76 | @property 77 | def delay(self): 78 | """Gets the delay of this HttpOverrideForwardedRequest. # noqa: E501 79 | 80 | 81 | :return: The delay of this HttpOverrideForwardedRequest. # noqa: E501 82 | :rtype: Delay 83 | """ 84 | return self._delay 85 | 86 | @delay.setter 87 | def delay(self, delay): 88 | """Sets the delay of this HttpOverrideForwardedRequest. 89 | 90 | 91 | :param delay: The delay of this HttpOverrideForwardedRequest. # noqa: E501 92 | :type: Delay 93 | """ 94 | 95 | self._delay = delay 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.openapi_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, HttpOverrideForwardedRequest): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /mockserver/models/http_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpRequest(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'body': 'Body', 35 | 'headers': 'KeyToMultiValue', 36 | 'cookies': 'KeyToValue', 37 | 'query_string_parameters': 'KeyToMultiValue', 38 | 'path': 'str', 39 | 'method': 'str', 40 | 'secure': 'bool', 41 | 'keep_alive': 'bool' 42 | } 43 | 44 | attribute_map = { 45 | 'body': 'body', 46 | 'headers': 'headers', 47 | 'cookies': 'cookies', 48 | 'query_string_parameters': 'queryStringParameters', 49 | 'path': 'path', 50 | 'method': 'method', 51 | 'secure': 'secure', 52 | 'keep_alive': 'keepAlive' 53 | } 54 | 55 | def __init__(self, body=None, headers=None, cookies=None, query_string_parameters=None, path=None, method=None, secure=None, keep_alive=None): # noqa: E501 56 | """HttpRequest - a model defined in OpenAPI""" # noqa: E501 57 | 58 | self._body = None 59 | self._headers = None 60 | self._cookies = None 61 | self._query_string_parameters = None 62 | self._path = None 63 | self._method = None 64 | self._secure = None 65 | self._keep_alive = None 66 | self.discriminator = None 67 | 68 | if body is not None: 69 | self.body = body 70 | if headers is not None: 71 | self.headers = headers 72 | if cookies is not None: 73 | self.cookies = cookies 74 | if query_string_parameters is not None: 75 | self.query_string_parameters = query_string_parameters 76 | if path is not None: 77 | self.path = path 78 | if method is not None: 79 | self.method = method 80 | if secure is not None: 81 | self.secure = secure 82 | if keep_alive is not None: 83 | self.keep_alive = keep_alive 84 | 85 | @property 86 | def body(self): 87 | """Gets the body of this HttpRequest. # noqa: E501 88 | 89 | 90 | :return: The body of this HttpRequest. # noqa: E501 91 | :rtype: Body 92 | """ 93 | return self._body 94 | 95 | @body.setter 96 | def body(self, body): 97 | """Sets the body of this HttpRequest. 98 | 99 | 100 | :param body: The body of this HttpRequest. # noqa: E501 101 | :type: Body 102 | """ 103 | 104 | self._body = body 105 | 106 | @property 107 | def headers(self): 108 | """Gets the headers of this HttpRequest. # noqa: E501 109 | 110 | 111 | :return: The headers of this HttpRequest. # noqa: E501 112 | :rtype: KeyToMultiValue 113 | """ 114 | return self._headers 115 | 116 | @headers.setter 117 | def headers(self, headers): 118 | """Sets the headers of this HttpRequest. 119 | 120 | 121 | :param headers: The headers of this HttpRequest. # noqa: E501 122 | :type: KeyToMultiValue 123 | """ 124 | 125 | self._headers = headers 126 | 127 | @property 128 | def cookies(self): 129 | """Gets the cookies of this HttpRequest. # noqa: E501 130 | 131 | 132 | :return: The cookies of this HttpRequest. # noqa: E501 133 | :rtype: KeyToValue 134 | """ 135 | return self._cookies 136 | 137 | @cookies.setter 138 | def cookies(self, cookies): 139 | """Sets the cookies of this HttpRequest. 140 | 141 | 142 | :param cookies: The cookies of this HttpRequest. # noqa: E501 143 | :type: KeyToValue 144 | """ 145 | 146 | self._cookies = cookies 147 | 148 | @property 149 | def query_string_parameters(self): 150 | """Gets the query_string_parameters of this HttpRequest. # noqa: E501 151 | 152 | 153 | :return: The query_string_parameters of this HttpRequest. # noqa: E501 154 | :rtype: KeyToMultiValue 155 | """ 156 | return self._query_string_parameters 157 | 158 | @query_string_parameters.setter 159 | def query_string_parameters(self, query_string_parameters): 160 | """Sets the query_string_parameters of this HttpRequest. 161 | 162 | 163 | :param query_string_parameters: The query_string_parameters of this HttpRequest. # noqa: E501 164 | :type: KeyToMultiValue 165 | """ 166 | 167 | self._query_string_parameters = query_string_parameters 168 | 169 | @property 170 | def path(self): 171 | """Gets the path of this HttpRequest. # noqa: E501 172 | 173 | 174 | :return: The path of this HttpRequest. # noqa: E501 175 | :rtype: str 176 | """ 177 | return self._path 178 | 179 | @path.setter 180 | def path(self, path): 181 | """Sets the path of this HttpRequest. 182 | 183 | 184 | :param path: The path of this HttpRequest. # noqa: E501 185 | :type: str 186 | """ 187 | 188 | self._path = path 189 | 190 | @property 191 | def method(self): 192 | """Gets the method of this HttpRequest. # noqa: E501 193 | 194 | 195 | :return: The method of this HttpRequest. # noqa: E501 196 | :rtype: str 197 | """ 198 | return self._method 199 | 200 | @method.setter 201 | def method(self, method): 202 | """Sets the method of this HttpRequest. 203 | 204 | 205 | :param method: The method of this HttpRequest. # noqa: E501 206 | :type: str 207 | """ 208 | 209 | self._method = method 210 | 211 | @property 212 | def secure(self): 213 | """Gets the secure of this HttpRequest. # noqa: E501 214 | 215 | 216 | :return: The secure of this HttpRequest. # noqa: E501 217 | :rtype: bool 218 | """ 219 | return self._secure 220 | 221 | @secure.setter 222 | def secure(self, secure): 223 | """Sets the secure of this HttpRequest. 224 | 225 | 226 | :param secure: The secure of this HttpRequest. # noqa: E501 227 | :type: bool 228 | """ 229 | 230 | self._secure = secure 231 | 232 | @property 233 | def keep_alive(self): 234 | """Gets the keep_alive of this HttpRequest. # noqa: E501 235 | 236 | 237 | :return: The keep_alive of this HttpRequest. # noqa: E501 238 | :rtype: bool 239 | """ 240 | return self._keep_alive 241 | 242 | @keep_alive.setter 243 | def keep_alive(self, keep_alive): 244 | """Sets the keep_alive of this HttpRequest. 245 | 246 | 247 | :param keep_alive: The keep_alive of this HttpRequest. # noqa: E501 248 | :type: bool 249 | """ 250 | 251 | self._keep_alive = keep_alive 252 | 253 | def to_dict(self): 254 | """Returns the model properties as a dict""" 255 | result = {} 256 | 257 | for attr, _ in six.iteritems(self.openapi_types): 258 | value = getattr(self, attr) 259 | if isinstance(value, list): 260 | result[attr] = list(map( 261 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 262 | value 263 | )) 264 | elif hasattr(value, "to_dict"): 265 | result[attr] = value.to_dict() 266 | elif isinstance(value, dict): 267 | result[attr] = dict(map( 268 | lambda item: (item[0], item[1].to_dict()) 269 | if hasattr(item[1], "to_dict") else item, 270 | value.items() 271 | )) 272 | else: 273 | result[attr] = value 274 | 275 | return result 276 | 277 | def to_str(self): 278 | """Returns the string representation of the model""" 279 | return pprint.pformat(self.to_dict()) 280 | 281 | def __repr__(self): 282 | """For `print` and `pprint`""" 283 | return self.to_str() 284 | 285 | def __eq__(self, other): 286 | """Returns true if both objects are equal""" 287 | if not isinstance(other, HttpRequest): 288 | return False 289 | 290 | return self.__dict__ == other.__dict__ 291 | 292 | def __ne__(self, other): 293 | """Returns true if both objects are not equal""" 294 | return not self == other 295 | -------------------------------------------------------------------------------- /mockserver/models/http_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpResponse(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'body': 'BodyWithContentType', 35 | 'delay': 'Delay', 36 | 'cookies': 'KeyToValue', 37 | 'connection_options': 'ConnectionOptions', 38 | 'headers': 'KeyToMultiValue', 39 | 'status_code': 'int', 40 | 'reason_phrase': 'str' 41 | } 42 | 43 | attribute_map = { 44 | 'body': 'body', 45 | 'delay': 'delay', 46 | 'cookies': 'cookies', 47 | 'connection_options': 'connectionOptions', 48 | 'headers': 'headers', 49 | 'status_code': 'statusCode', 50 | 'reason_phrase': 'reasonPhrase' 51 | } 52 | 53 | def __init__(self, body=None, delay=None, cookies=None, connection_options=None, headers=None, status_code=None, reason_phrase=None): # noqa: E501 54 | """HttpResponse - a model defined in OpenAPI""" # noqa: E501 55 | 56 | self._body = None 57 | self._delay = None 58 | self._cookies = None 59 | self._connection_options = None 60 | self._headers = None 61 | self._status_code = None 62 | self._reason_phrase = None 63 | self.discriminator = None 64 | 65 | if body is not None: 66 | self.body = body 67 | if delay is not None: 68 | self.delay = delay 69 | if cookies is not None: 70 | self.cookies = cookies 71 | if connection_options is not None: 72 | self.connection_options = connection_options 73 | if headers is not None: 74 | self.headers = headers 75 | if status_code is not None: 76 | self.status_code = status_code 77 | if reason_phrase is not None: 78 | self.reason_phrase = reason_phrase 79 | 80 | @property 81 | def body(self): 82 | """Gets the body of this HttpResponse. # noqa: E501 83 | 84 | 85 | :return: The body of this HttpResponse. # noqa: E501 86 | :rtype: BodyWithContentType 87 | """ 88 | return self._body 89 | 90 | @body.setter 91 | def body(self, body): 92 | """Sets the body of this HttpResponse. 93 | 94 | 95 | :param body: The body of this HttpResponse. # noqa: E501 96 | :type: BodyWithContentType 97 | """ 98 | 99 | self._body = body 100 | 101 | @property 102 | def delay(self): 103 | """Gets the delay of this HttpResponse. # noqa: E501 104 | 105 | 106 | :return: The delay of this HttpResponse. # noqa: E501 107 | :rtype: Delay 108 | """ 109 | return self._delay 110 | 111 | @delay.setter 112 | def delay(self, delay): 113 | """Sets the delay of this HttpResponse. 114 | 115 | 116 | :param delay: The delay of this HttpResponse. # noqa: E501 117 | :type: Delay 118 | """ 119 | 120 | self._delay = delay 121 | 122 | @property 123 | def cookies(self): 124 | """Gets the cookies of this HttpResponse. # noqa: E501 125 | 126 | 127 | :return: The cookies of this HttpResponse. # noqa: E501 128 | :rtype: KeyToValue 129 | """ 130 | return self._cookies 131 | 132 | @cookies.setter 133 | def cookies(self, cookies): 134 | """Sets the cookies of this HttpResponse. 135 | 136 | 137 | :param cookies: The cookies of this HttpResponse. # noqa: E501 138 | :type: KeyToValue 139 | """ 140 | 141 | self._cookies = cookies 142 | 143 | @property 144 | def connection_options(self): 145 | """Gets the connection_options of this HttpResponse. # noqa: E501 146 | 147 | 148 | :return: The connection_options of this HttpResponse. # noqa: E501 149 | :rtype: ConnectionOptions 150 | """ 151 | return self._connection_options 152 | 153 | @connection_options.setter 154 | def connection_options(self, connection_options): 155 | """Sets the connection_options of this HttpResponse. 156 | 157 | 158 | :param connection_options: The connection_options of this HttpResponse. # noqa: E501 159 | :type: ConnectionOptions 160 | """ 161 | 162 | self._connection_options = connection_options 163 | 164 | @property 165 | def headers(self): 166 | """Gets the headers of this HttpResponse. # noqa: E501 167 | 168 | 169 | :return: The headers of this HttpResponse. # noqa: E501 170 | :rtype: KeyToMultiValue 171 | """ 172 | return self._headers 173 | 174 | @headers.setter 175 | def headers(self, headers): 176 | """Sets the headers of this HttpResponse. 177 | 178 | 179 | :param headers: The headers of this HttpResponse. # noqa: E501 180 | :type: KeyToMultiValue 181 | """ 182 | 183 | self._headers = headers 184 | 185 | @property 186 | def status_code(self): 187 | """Gets the status_code of this HttpResponse. # noqa: E501 188 | 189 | 190 | :return: The status_code of this HttpResponse. # noqa: E501 191 | :rtype: int 192 | """ 193 | return self._status_code 194 | 195 | @status_code.setter 196 | def status_code(self, status_code): 197 | """Sets the status_code of this HttpResponse. 198 | 199 | 200 | :param status_code: The status_code of this HttpResponse. # noqa: E501 201 | :type: int 202 | """ 203 | 204 | self._status_code = status_code 205 | 206 | @property 207 | def reason_phrase(self): 208 | """Gets the reason_phrase of this HttpResponse. # noqa: E501 209 | 210 | 211 | :return: The reason_phrase of this HttpResponse. # noqa: E501 212 | :rtype: str 213 | """ 214 | return self._reason_phrase 215 | 216 | @reason_phrase.setter 217 | def reason_phrase(self, reason_phrase): 218 | """Sets the reason_phrase of this HttpResponse. 219 | 220 | 221 | :param reason_phrase: The reason_phrase of this HttpResponse. # noqa: E501 222 | :type: str 223 | """ 224 | 225 | self._reason_phrase = reason_phrase 226 | 227 | def to_dict(self): 228 | """Returns the model properties as a dict""" 229 | result = {} 230 | 231 | for attr, _ in six.iteritems(self.openapi_types): 232 | value = getattr(self, attr) 233 | if isinstance(value, list): 234 | result[attr] = list(map( 235 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 236 | value 237 | )) 238 | elif hasattr(value, "to_dict"): 239 | result[attr] = value.to_dict() 240 | elif isinstance(value, dict): 241 | result[attr] = dict(map( 242 | lambda item: (item[0], item[1].to_dict()) 243 | if hasattr(item[1], "to_dict") else item, 244 | value.items() 245 | )) 246 | else: 247 | result[attr] = value 248 | 249 | return result 250 | 251 | def to_str(self): 252 | """Returns the string representation of the model""" 253 | return pprint.pformat(self.to_dict()) 254 | 255 | def __repr__(self): 256 | """For `print` and `pprint`""" 257 | return self.to_str() 258 | 259 | def __eq__(self, other): 260 | """Returns true if both objects are equal""" 261 | if not isinstance(other, HttpResponse): 262 | return False 263 | 264 | return self.__dict__ == other.__dict__ 265 | 266 | def __ne__(self, other): 267 | """Returns true if both objects are not equal""" 268 | return not self == other 269 | -------------------------------------------------------------------------------- /mockserver/models/http_template.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class HttpTemplate(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'template_type': 'str', 35 | 'template': 'str', 36 | 'delay': 'Delay' 37 | } 38 | 39 | attribute_map = { 40 | 'template_type': 'templateType', 41 | 'template': 'template', 42 | 'delay': 'delay' 43 | } 44 | 45 | def __init__(self, template_type=None, template=None, delay=None): # noqa: E501 46 | """HttpTemplate - a model defined in OpenAPI""" # noqa: E501 47 | 48 | self._template_type = None 49 | self._template = None 50 | self._delay = None 51 | self.discriminator = None 52 | 53 | if template_type is not None: 54 | self.template_type = template_type 55 | if template is not None: 56 | self.template = template 57 | if delay is not None: 58 | self.delay = delay 59 | 60 | @property 61 | def template_type(self): 62 | """Gets the template_type of this HttpTemplate. # noqa: E501 63 | 64 | 65 | :return: The template_type of this HttpTemplate. # noqa: E501 66 | :rtype: str 67 | """ 68 | return self._template_type 69 | 70 | @template_type.setter 71 | def template_type(self, template_type): 72 | """Sets the template_type of this HttpTemplate. 73 | 74 | 75 | :param template_type: The template_type of this HttpTemplate. # noqa: E501 76 | :type: str 77 | """ 78 | allowed_values = ["JAVASCRIPT", "VELOCITY"] # noqa: E501 79 | if template_type not in allowed_values: 80 | raise ValueError( 81 | "Invalid value for `template_type` ({0}), must be one of {1}" # noqa: E501 82 | .format(template_type, allowed_values) 83 | ) 84 | 85 | self._template_type = template_type 86 | 87 | @property 88 | def template(self): 89 | """Gets the template of this HttpTemplate. # noqa: E501 90 | 91 | 92 | :return: The template of this HttpTemplate. # noqa: E501 93 | :rtype: str 94 | """ 95 | return self._template 96 | 97 | @template.setter 98 | def template(self, template): 99 | """Sets the template of this HttpTemplate. 100 | 101 | 102 | :param template: The template of this HttpTemplate. # noqa: E501 103 | :type: str 104 | """ 105 | 106 | self._template = template 107 | 108 | @property 109 | def delay(self): 110 | """Gets the delay of this HttpTemplate. # noqa: E501 111 | 112 | 113 | :return: The delay of this HttpTemplate. # noqa: E501 114 | :rtype: Delay 115 | """ 116 | return self._delay 117 | 118 | @delay.setter 119 | def delay(self, delay): 120 | """Sets the delay of this HttpTemplate. 121 | 122 | 123 | :param delay: The delay of this HttpTemplate. # noqa: E501 124 | :type: Delay 125 | """ 126 | 127 | self._delay = delay 128 | 129 | def to_dict(self): 130 | """Returns the model properties as a dict""" 131 | result = {} 132 | 133 | for attr, _ in six.iteritems(self.openapi_types): 134 | value = getattr(self, attr) 135 | if isinstance(value, list): 136 | result[attr] = list(map( 137 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 138 | value 139 | )) 140 | elif hasattr(value, "to_dict"): 141 | result[attr] = value.to_dict() 142 | elif isinstance(value, dict): 143 | result[attr] = dict(map( 144 | lambda item: (item[0], item[1].to_dict()) 145 | if hasattr(item[1], "to_dict") else item, 146 | value.items() 147 | )) 148 | else: 149 | result[attr] = value 150 | 151 | return result 152 | 153 | def to_str(self): 154 | """Returns the string representation of the model""" 155 | return pprint.pformat(self.to_dict()) 156 | 157 | def __repr__(self): 158 | """For `print` and `pprint`""" 159 | return self.to_str() 160 | 161 | def __eq__(self, other): 162 | """Returns true if both objects are equal""" 163 | if not isinstance(other, HttpTemplate): 164 | return False 165 | 166 | return self.__dict__ == other.__dict__ 167 | 168 | def __ne__(self, other): 169 | """Returns true if both objects are not equal""" 170 | return not self == other 171 | -------------------------------------------------------------------------------- /mockserver/models/key_to_multi_value.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class KeyToMultiValue(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """KeyToMultiValue - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, KeyToMultiValue): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/key_to_value.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class KeyToValue(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | } 35 | 36 | attribute_map = { 37 | } 38 | 39 | def __init__(self): # noqa: E501 40 | """KeyToValue - a model defined in OpenAPI""" # noqa: E501 41 | self.discriminator = None 42 | 43 | def to_dict(self): 44 | """Returns the model properties as a dict""" 45 | result = {} 46 | 47 | for attr, _ in six.iteritems(self.openapi_types): 48 | value = getattr(self, attr) 49 | if isinstance(value, list): 50 | result[attr] = list(map( 51 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 52 | value 53 | )) 54 | elif hasattr(value, "to_dict"): 55 | result[attr] = value.to_dict() 56 | elif isinstance(value, dict): 57 | result[attr] = dict(map( 58 | lambda item: (item[0], item[1].to_dict()) 59 | if hasattr(item[1], "to_dict") else item, 60 | value.items() 61 | )) 62 | else: 63 | result[attr] = value 64 | 65 | return result 66 | 67 | def to_str(self): 68 | """Returns the string representation of the model""" 69 | return pprint.pformat(self.to_dict()) 70 | 71 | def __repr__(self): 72 | """For `print` and `pprint`""" 73 | return self.to_str() 74 | 75 | def __eq__(self, other): 76 | """Returns true if both objects are equal""" 77 | if not isinstance(other, KeyToValue): 78 | return False 79 | 80 | return self.__dict__ == other.__dict__ 81 | 82 | def __ne__(self, other): 83 | """Returns true if both objects are not equal""" 84 | return not self == other 85 | -------------------------------------------------------------------------------- /mockserver/models/ports.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Ports(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'ports': 'list[float]' 35 | } 36 | 37 | attribute_map = { 38 | 'ports': 'ports' 39 | } 40 | 41 | def __init__(self, ports=None): # noqa: E501 42 | """Ports - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._ports = None 45 | self.discriminator = None 46 | 47 | if ports is not None: 48 | self.ports = ports 49 | 50 | @property 51 | def ports(self): 52 | """Gets the ports of this Ports. # noqa: E501 53 | 54 | 55 | :return: The ports of this Ports. # noqa: E501 56 | :rtype: list[float] 57 | """ 58 | return self._ports 59 | 60 | @ports.setter 61 | def ports(self, ports): 62 | """Sets the ports of this Ports. 63 | 64 | 65 | :param ports: The ports of this Ports. # noqa: E501 66 | :type: list[float] 67 | """ 68 | 69 | self._ports = ports 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, Ports): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /mockserver/models/time_to_live.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class TimeToLive(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'time_unit': 'str', 35 | 'time_to_live': 'int', 36 | 'unlimited': 'bool' 37 | } 38 | 39 | attribute_map = { 40 | 'time_unit': 'timeUnit', 41 | 'time_to_live': 'timeToLive', 42 | 'unlimited': 'unlimited' 43 | } 44 | 45 | def __init__(self, time_unit=None, time_to_live=None, unlimited=None): # noqa: E501 46 | """TimeToLive - a model defined in OpenAPI""" # noqa: E501 47 | 48 | self._time_unit = None 49 | self._time_to_live = None 50 | self._unlimited = None 51 | self.discriminator = None 52 | 53 | if time_unit is not None: 54 | self.time_unit = time_unit 55 | if time_to_live is not None: 56 | self.time_to_live = time_to_live 57 | if unlimited is not None: 58 | self.unlimited = unlimited 59 | 60 | @property 61 | def time_unit(self): 62 | """Gets the time_unit of this TimeToLive. # noqa: E501 63 | 64 | 65 | :return: The time_unit of this TimeToLive. # noqa: E501 66 | :rtype: str 67 | """ 68 | return self._time_unit 69 | 70 | @time_unit.setter 71 | def time_unit(self, time_unit): 72 | """Sets the time_unit of this TimeToLive. 73 | 74 | 75 | :param time_unit: The time_unit of this TimeToLive. # noqa: E501 76 | :type: str 77 | """ 78 | allowed_values = ["HOURS", "MINUTES", "SECONDS", "MILLISECONDS", "MICROSECONDS", "NANOSECONDS"] # noqa: E501 79 | if time_unit not in allowed_values: 80 | raise ValueError( 81 | "Invalid value for `time_unit` ({0}), must be one of {1}" # noqa: E501 82 | .format(time_unit, allowed_values) 83 | ) 84 | 85 | self._time_unit = time_unit 86 | 87 | @property 88 | def time_to_live(self): 89 | """Gets the time_to_live of this TimeToLive. # noqa: E501 90 | 91 | 92 | :return: The time_to_live of this TimeToLive. # noqa: E501 93 | :rtype: int 94 | """ 95 | return self._time_to_live 96 | 97 | @time_to_live.setter 98 | def time_to_live(self, time_to_live): 99 | """Sets the time_to_live of this TimeToLive. 100 | 101 | 102 | :param time_to_live: The time_to_live of this TimeToLive. # noqa: E501 103 | :type: int 104 | """ 105 | 106 | self._time_to_live = time_to_live 107 | 108 | @property 109 | def unlimited(self): 110 | """Gets the unlimited of this TimeToLive. # noqa: E501 111 | 112 | 113 | :return: The unlimited of this TimeToLive. # noqa: E501 114 | :rtype: bool 115 | """ 116 | return self._unlimited 117 | 118 | @unlimited.setter 119 | def unlimited(self, unlimited): 120 | """Sets the unlimited of this TimeToLive. 121 | 122 | 123 | :param unlimited: The unlimited of this TimeToLive. # noqa: E501 124 | :type: bool 125 | """ 126 | 127 | self._unlimited = unlimited 128 | 129 | def to_dict(self): 130 | """Returns the model properties as a dict""" 131 | result = {} 132 | 133 | for attr, _ in six.iteritems(self.openapi_types): 134 | value = getattr(self, attr) 135 | if isinstance(value, list): 136 | result[attr] = list(map( 137 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 138 | value 139 | )) 140 | elif hasattr(value, "to_dict"): 141 | result[attr] = value.to_dict() 142 | elif isinstance(value, dict): 143 | result[attr] = dict(map( 144 | lambda item: (item[0], item[1].to_dict()) 145 | if hasattr(item[1], "to_dict") else item, 146 | value.items() 147 | )) 148 | else: 149 | result[attr] = value 150 | 151 | return result 152 | 153 | def to_str(self): 154 | """Returns the string representation of the model""" 155 | return pprint.pformat(self.to_dict()) 156 | 157 | def __repr__(self): 158 | """For `print` and `pprint`""" 159 | return self.to_str() 160 | 161 | def __eq__(self, other): 162 | """Returns true if both objects are equal""" 163 | if not isinstance(other, TimeToLive): 164 | return False 165 | 166 | return self.__dict__ == other.__dict__ 167 | 168 | def __ne__(self, other): 169 | """Returns true if both objects are not equal""" 170 | return not self == other 171 | -------------------------------------------------------------------------------- /mockserver/models/times.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Times(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'remaining_times': 'int', 35 | 'unlimited': 'bool' 36 | } 37 | 38 | attribute_map = { 39 | 'remaining_times': 'remainingTimes', 40 | 'unlimited': 'unlimited' 41 | } 42 | 43 | def __init__(self, remaining_times=None, unlimited=None): # noqa: E501 44 | """Times - a model defined in OpenAPI""" # noqa: E501 45 | 46 | self._remaining_times = None 47 | self._unlimited = None 48 | self.discriminator = None 49 | 50 | if remaining_times is not None: 51 | self.remaining_times = remaining_times 52 | if unlimited is not None: 53 | self.unlimited = unlimited 54 | 55 | @property 56 | def remaining_times(self): 57 | """Gets the remaining_times of this Times. # noqa: E501 58 | 59 | 60 | :return: The remaining_times of this Times. # noqa: E501 61 | :rtype: int 62 | """ 63 | return self._remaining_times 64 | 65 | @remaining_times.setter 66 | def remaining_times(self, remaining_times): 67 | """Sets the remaining_times of this Times. 68 | 69 | 70 | :param remaining_times: The remaining_times of this Times. # noqa: E501 71 | :type: int 72 | """ 73 | 74 | self._remaining_times = remaining_times 75 | 76 | @property 77 | def unlimited(self): 78 | """Gets the unlimited of this Times. # noqa: E501 79 | 80 | 81 | :return: The unlimited of this Times. # noqa: E501 82 | :rtype: bool 83 | """ 84 | return self._unlimited 85 | 86 | @unlimited.setter 87 | def unlimited(self, unlimited): 88 | """Sets the unlimited of this Times. 89 | 90 | 91 | :param unlimited: The unlimited of this Times. # noqa: E501 92 | :type: bool 93 | """ 94 | 95 | self._unlimited = unlimited 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.openapi_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, Times): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /mockserver/models/verification.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class Verification(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'http_request': 'HttpRequest', 35 | 'times': 'VerificationTimes' 36 | } 37 | 38 | attribute_map = { 39 | 'http_request': 'httpRequest', 40 | 'times': 'times' 41 | } 42 | 43 | def __init__(self, http_request=None, times=None): # noqa: E501 44 | """Verification - a model defined in OpenAPI""" # noqa: E501 45 | 46 | self._http_request = None 47 | self._times = None 48 | self.discriminator = None 49 | 50 | if http_request is not None: 51 | self.http_request = http_request 52 | if times is not None: 53 | self.times = times 54 | 55 | @property 56 | def http_request(self): 57 | """Gets the http_request of this Verification. # noqa: E501 58 | 59 | 60 | :return: The http_request of this Verification. # noqa: E501 61 | :rtype: HttpRequest 62 | """ 63 | return self._http_request 64 | 65 | @http_request.setter 66 | def http_request(self, http_request): 67 | """Sets the http_request of this Verification. 68 | 69 | 70 | :param http_request: The http_request of this Verification. # noqa: E501 71 | :type: HttpRequest 72 | """ 73 | 74 | self._http_request = http_request 75 | 76 | @property 77 | def times(self): 78 | """Gets the times of this Verification. # noqa: E501 79 | 80 | 81 | :return: The times of this Verification. # noqa: E501 82 | :rtype: VerificationTimes 83 | """ 84 | return self._times 85 | 86 | @times.setter 87 | def times(self, times): 88 | """Sets the times of this Verification. 89 | 90 | 91 | :param times: The times of this Verification. # noqa: E501 92 | :type: VerificationTimes 93 | """ 94 | 95 | self._times = times 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.openapi_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, Verification): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /mockserver/models/verification_sequence.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class VerificationSequence(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'http_requests': 'list[HttpRequest]' 35 | } 36 | 37 | attribute_map = { 38 | 'http_requests': 'httpRequests' 39 | } 40 | 41 | def __init__(self, http_requests=None): # noqa: E501 42 | """VerificationSequence - a model defined in OpenAPI""" # noqa: E501 43 | 44 | self._http_requests = None 45 | self.discriminator = None 46 | 47 | if http_requests is not None: 48 | self.http_requests = http_requests 49 | 50 | @property 51 | def http_requests(self): 52 | """Gets the http_requests of this VerificationSequence. # noqa: E501 53 | 54 | 55 | :return: The http_requests of this VerificationSequence. # noqa: E501 56 | :rtype: list[HttpRequest] 57 | """ 58 | return self._http_requests 59 | 60 | @http_requests.setter 61 | def http_requests(self, http_requests): 62 | """Sets the http_requests of this VerificationSequence. 63 | 64 | 65 | :param http_requests: The http_requests of this VerificationSequence. # noqa: E501 66 | :type: list[HttpRequest] 67 | """ 68 | 69 | self._http_requests = http_requests 70 | 71 | def to_dict(self): 72 | """Returns the model properties as a dict""" 73 | result = {} 74 | 75 | for attr, _ in six.iteritems(self.openapi_types): 76 | value = getattr(self, attr) 77 | if isinstance(value, list): 78 | result[attr] = list(map( 79 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 80 | value 81 | )) 82 | elif hasattr(value, "to_dict"): 83 | result[attr] = value.to_dict() 84 | elif isinstance(value, dict): 85 | result[attr] = dict(map( 86 | lambda item: (item[0], item[1].to_dict()) 87 | if hasattr(item[1], "to_dict") else item, 88 | value.items() 89 | )) 90 | else: 91 | result[attr] = value 92 | 93 | return result 94 | 95 | def to_str(self): 96 | """Returns the string representation of the model""" 97 | return pprint.pformat(self.to_dict()) 98 | 99 | def __repr__(self): 100 | """For `print` and `pprint`""" 101 | return self.to_str() 102 | 103 | def __eq__(self, other): 104 | """Returns true if both objects are equal""" 105 | if not isinstance(other, VerificationSequence): 106 | return False 107 | 108 | return self.__dict__ == other.__dict__ 109 | 110 | def __ne__(self, other): 111 | """Returns true if both objects are not equal""" 112 | return not self == other 113 | -------------------------------------------------------------------------------- /mockserver/models/verification_times.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | import pprint 14 | import re # noqa: F401 15 | 16 | import six 17 | 18 | 19 | class VerificationTimes(object): 20 | """NOTE: This class is auto generated by OpenAPI Generator. 21 | Ref: https://openapi-generator.tech 22 | 23 | Do not edit the class manually. 24 | """ 25 | 26 | """ 27 | Attributes: 28 | openapi_types (dict): The key is attribute name 29 | and the value is attribute type. 30 | attribute_map (dict): The key is attribute name 31 | and the value is json key in definition. 32 | """ 33 | openapi_types = { 34 | 'count': 'int', 35 | 'exact': 'bool' 36 | } 37 | 38 | attribute_map = { 39 | 'count': 'count', 40 | 'exact': 'exact' 41 | } 42 | 43 | def __init__(self, count=None, exact=None): # noqa: E501 44 | """VerificationTimes - a model defined in OpenAPI""" # noqa: E501 45 | 46 | self._count = None 47 | self._exact = None 48 | self.discriminator = None 49 | 50 | if count is not None: 51 | self.count = count 52 | if exact is not None: 53 | self.exact = exact 54 | 55 | @property 56 | def count(self): 57 | """Gets the count of this VerificationTimes. # noqa: E501 58 | 59 | 60 | :return: The count of this VerificationTimes. # noqa: E501 61 | :rtype: int 62 | """ 63 | return self._count 64 | 65 | @count.setter 66 | def count(self, count): 67 | """Sets the count of this VerificationTimes. 68 | 69 | 70 | :param count: The count of this VerificationTimes. # noqa: E501 71 | :type: int 72 | """ 73 | 74 | self._count = count 75 | 76 | @property 77 | def exact(self): 78 | """Gets the exact of this VerificationTimes. # noqa: E501 79 | 80 | 81 | :return: The exact of this VerificationTimes. # noqa: E501 82 | :rtype: bool 83 | """ 84 | return self._exact 85 | 86 | @exact.setter 87 | def exact(self, exact): 88 | """Sets the exact of this VerificationTimes. 89 | 90 | 91 | :param exact: The exact of this VerificationTimes. # noqa: E501 92 | :type: bool 93 | """ 94 | 95 | self._exact = exact 96 | 97 | def to_dict(self): 98 | """Returns the model properties as a dict""" 99 | result = {} 100 | 101 | for attr, _ in six.iteritems(self.openapi_types): 102 | value = getattr(self, attr) 103 | if isinstance(value, list): 104 | result[attr] = list(map( 105 | lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 106 | value 107 | )) 108 | elif hasattr(value, "to_dict"): 109 | result[attr] = value.to_dict() 110 | elif isinstance(value, dict): 111 | result[attr] = dict(map( 112 | lambda item: (item[0], item[1].to_dict()) 113 | if hasattr(item[1], "to_dict") else item, 114 | value.items() 115 | )) 116 | else: 117 | result[attr] = value 118 | 119 | return result 120 | 121 | def to_str(self): 122 | """Returns the string representation of the model""" 123 | return pprint.pformat(self.to_dict()) 124 | 125 | def __repr__(self): 126 | """For `print` and `pprint`""" 127 | return self.to_str() 128 | 129 | def __eq__(self, other): 130 | """Returns true if both objects are equal""" 131 | if not isinstance(other, VerificationTimes): 132 | return False 133 | 134 | return self.__dict__ == other.__dict__ 135 | 136 | def __ne__(self, other): 137 | """Returns true if both objects are not equal""" 138 | return not self == other 139 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | six >= 1.10 3 | python_dateutil >= 2.5.3 4 | setuptools >= 21.0.0 5 | urllib3 >= 1.15.1 6 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from setuptools import setup, find_packages # noqa: H301 14 | 15 | NAME = "mockserver-client" 16 | VERSION = "5.3.0" 17 | # To install the library, run the following 18 | # 19 | # python setup.py install 20 | # 21 | # prerequisite: setuptools 22 | # http://pypi.python.org/pypi/setuptools 23 | 24 | REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] 25 | 26 | setup( 27 | name=NAME, 28 | version=VERSION, 29 | description="Mock Server API", 30 | author_email="jamesdbloom@gmail.com", 31 | url="https://mock-server.com/", 32 | keywords=["Mock Server API", "Mock Server", "HTTP Mock", "Proxy"], 33 | install_requires=REQUIRES, 34 | packages=find_packages(), 35 | include_package_data=True, 36 | long_description="""\ 37 | 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. # noqa: E501 38 | """ 39 | ) 40 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | coverage>=4.0.3 2 | nose>=1.3.7 3 | pluggy>=0.3.1 4 | py>=1.4.31 5 | randomize>=0.13 6 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mock-server/mockserver-client-python/58890dd99ffaaffe1004340abc8729b9edba2544/test/__init__.py -------------------------------------------------------------------------------- /test/test_body.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.body import Body # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestBody(unittest.TestCase): 23 | """Body unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testBody(self): 32 | """Test Body""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.body.Body() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_body_with_content_type.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.body_with_content_type import BodyWithContentType # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestBodyWithContentType(unittest.TestCase): 23 | """BodyWithContentType unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testBodyWithContentType(self): 32 | """Test BodyWithContentType""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.body_with_content_type.BodyWithContentType() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_connection_options.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.connection_options import ConnectionOptions # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestConnectionOptions(unittest.TestCase): 23 | """ConnectionOptions unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testConnectionOptions(self): 32 | """Test ConnectionOptions""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.connection_options.ConnectionOptions() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_control_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.api.control_api import ControlApi # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestControlApi(unittest.TestCase): 23 | """ControlApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = mockserver.api.control_api.ControlApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_bind_put(self): 32 | """Test case for bind_put 33 | 34 | bind additional listening ports # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_clear_put(self): 39 | """Test case for clear_put 40 | 41 | clears expectations and recorded requests that match the request matcher # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_reset_put(self): 46 | """Test case for reset_put 47 | 48 | clears all expectations and recorded requests # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_retrieve_put(self): 53 | """Test case for retrieve_put 54 | 55 | retrieve recorded requests, active expectations, recorded expectations or log messages # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_status_put(self): 60 | """Test case for status_put 61 | 62 | return listening ports # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_stop_put(self): 67 | """Test case for stop_put 68 | 69 | stop running process # noqa: E501 70 | """ 71 | pass 72 | 73 | 74 | if __name__ == '__main__': 75 | unittest.main() 76 | -------------------------------------------------------------------------------- /test/test_delay.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.delay import Delay # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestDelay(unittest.TestCase): 23 | """Delay unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testDelay(self): 32 | """Test Delay""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.delay.Delay() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_expectation.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.expectation import Expectation # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestExpectation(unittest.TestCase): 23 | """Expectation unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testExpectation(self): 32 | """Test Expectation""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.expectation.Expectation() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_expectation_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.api.expectation_api import ExpectationApi # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestExpectationApi(unittest.TestCase): 23 | """ExpectationApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = mockserver.api.expectation_api.ExpectationApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_expectation_put(self): 32 | """Test case for expectation_put 33 | 34 | create expectation # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_expectations.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.expectations import Expectations # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestExpectations(unittest.TestCase): 23 | """Expectations unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testExpectations(self): 32 | """Test Expectations""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.expectations.Expectations() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_class_callback.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_class_callback import HttpClassCallback # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpClassCallback(unittest.TestCase): 23 | """HttpClassCallback unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpClassCallback(self): 32 | """Test HttpClassCallback""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_class_callback.HttpClassCallback() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_error.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_error import HttpError # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpError(unittest.TestCase): 23 | """HttpError unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpError(self): 32 | """Test HttpError""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_error.HttpError() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_forward.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_forward import HttpForward # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpForward(unittest.TestCase): 23 | """HttpForward unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpForward(self): 32 | """Test HttpForward""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_forward.HttpForward() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_object_callback.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_object_callback import HttpObjectCallback # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpObjectCallback(unittest.TestCase): 23 | """HttpObjectCallback unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpObjectCallback(self): 32 | """Test HttpObjectCallback""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_object_callback.HttpObjectCallback() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_override_forwarded_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_override_forwarded_request import HttpOverrideForwardedRequest # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpOverrideForwardedRequest(unittest.TestCase): 23 | """HttpOverrideForwardedRequest unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpOverrideForwardedRequest(self): 32 | """Test HttpOverrideForwardedRequest""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_override_forwarded_request.HttpOverrideForwardedRequest() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_request.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_request import HttpRequest # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpRequest(unittest.TestCase): 23 | """HttpRequest unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpRequest(self): 32 | """Test HttpRequest""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_request.HttpRequest() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_response.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_response import HttpResponse # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpResponse(unittest.TestCase): 23 | """HttpResponse unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpResponse(self): 32 | """Test HttpResponse""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_response.HttpResponse() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_http_template.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.http_template import HttpTemplate # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestHttpTemplate(unittest.TestCase): 23 | """HttpTemplate unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testHttpTemplate(self): 32 | """Test HttpTemplate""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.http_template.HttpTemplate() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_key_to_multi_value.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.key_to_multi_value import KeyToMultiValue # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestKeyToMultiValue(unittest.TestCase): 23 | """KeyToMultiValue unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testKeyToMultiValue(self): 32 | """Test KeyToMultiValue""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.key_to_multi_value.KeyToMultiValue() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_key_to_value.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.key_to_value import KeyToValue # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestKeyToValue(unittest.TestCase): 23 | """KeyToValue unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testKeyToValue(self): 32 | """Test KeyToValue""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.key_to_value.KeyToValue() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_ports.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.ports import Ports # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestPorts(unittest.TestCase): 23 | """Ports unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testPorts(self): 32 | """Test Ports""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.ports.Ports() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_time_to_live.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.time_to_live import TimeToLive # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestTimeToLive(unittest.TestCase): 23 | """TimeToLive unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testTimeToLive(self): 32 | """Test TimeToLive""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.time_to_live.TimeToLive() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_times.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.times import Times # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestTimes(unittest.TestCase): 23 | """Times unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testTimes(self): 32 | """Test Times""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.times.Times() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_verification.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.verification import Verification # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestVerification(unittest.TestCase): 23 | """Verification unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testVerification(self): 32 | """Test Verification""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.verification.Verification() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_verification_sequence.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.verification_sequence import VerificationSequence # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestVerificationSequence(unittest.TestCase): 23 | """VerificationSequence unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testVerificationSequence(self): 32 | """Test VerificationSequence""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.verification_sequence.VerificationSequence() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_verification_times.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.models.verification_times import VerificationTimes # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestVerificationTimes(unittest.TestCase): 23 | """VerificationTimes unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testVerificationTimes(self): 32 | """Test VerificationTimes""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = mockserver.models.verification_times.VerificationTimes() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == '__main__': 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /test/test_verify_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Mock Server API 5 | 6 | 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. # noqa: E501 7 | 8 | OpenAPI spec version: 5.3.0 9 | Generated by: https://openapi-generator.tech 10 | """ 11 | 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import mockserver 18 | from mockserver.api.verify_api import VerifyApi # noqa: E501 19 | from mockserver.rest import ApiException 20 | 21 | 22 | class TestVerifyApi(unittest.TestCase): 23 | """VerifyApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = mockserver.api.verify_api.VerifyApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_verify_put(self): 32 | """Test case for verify_put 33 | 34 | verify a request has been received a specific number of times # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_verify_sequence_put(self): 39 | """Test case for verify_sequence_put 40 | 41 | verify a sequence of request has been received in the specific order # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27, py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | nosetests \ 10 | [] 11 | --------------------------------------------------------------------------------