=begin #Mock Server API #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. OpenAPI spec version: 5.3.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 3.3.1 =end require 'uri' module MockServer class ControlApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # bind additional listening ports # only supported on Netty version # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port # @param [Hash] opts the optional parameters # @return [Ports] def bind_put(ports, opts = {}) data, _status_code, _headers = bind_put_with_http_info(ports, opts) data end # bind additional listening ports # only supported on Netty version # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port # @param [Hash] opts the optional parameters # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers def bind_put_with_http_info(ports, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.bind_put ...' end # verify the required parameter 'ports' is set if @api_client.config.client_side_validation && ports.nil? fail ArgumentError, "Missing the required parameter 'ports' when calling ControlApi.bind_put" end # resource path local_var_path = 'mockserver/bind' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(ports) auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Ports') if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#bind_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # clears expectations and recorded requests that match the request matcher # @param [Hash] opts the optional parameters # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear # @return [nil] def clear_put(opts = {}) clear_put_with_http_info(opts) nil end # clears expectations and recorded requests that match the request matcher # @param [Hash] opts the optional parameters # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def clear_put_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.clear_put ...' end # resource path local_var_path = 'mockserver/clear' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'http_request']) auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#clear_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # clears all expectations and recorded requests # @param [Hash] opts the optional parameters # @return [nil] def reset_put(opts = {}) reset_put_with_http_info(opts) nil end # clears all expectations and recorded requests # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def reset_put_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.reset_put ...' end # resource path local_var_path = 'mockserver/reset' # query parameters query_params = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#reset_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # retrieve recorded requests, active expectations, recorded expectations or log messages # @param [Hash] opts the optional parameters # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages # @return [Object] def retrieve_put(opts = {}) data, _status_code, _headers = retrieve_put_with_http_info(opts) data end # retrieve recorded requests, active expectations, recorded expectations or log messages # @param [Hash] opts the optional parameters # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers def retrieve_put_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.retrieve_put ...' end if @api_client.config.client_side_validation && opts[:'format'] && !['java', 'json'].include?(opts[:'format']) fail ArgumentError, 'invalid value for "format", must be one of java, json' end if @api_client.config.client_side_validation && opts[:'type'] && !['logs', 'requests', 'recorded_expectations', 'active_expectations'].include?(opts[:'type']) fail ArgumentError, 'invalid value for "type", must be one of logs, requests, recorded_expectations, active_expectations' end # resource path local_var_path = 'mockserver/retrieve' # query parameters query_params = {} query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/java', 'text/plain']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'http_request']) auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Object') if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#retrieve_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # return listening ports # @param [Hash] opts the optional parameters # @return [Ports] def status_put(opts = {}) data, _status_code, _headers = status_put_with_http_info(opts) data end # return listening ports # @param [Hash] opts the optional parameters # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers def status_put_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.status_put ...' end # resource path local_var_path = 'mockserver/status' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Ports') if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # stop running process # only supported on Netty version # @param [Hash] opts the optional parameters # @return [nil] def stop_put(opts = {}) stop_put_with_http_info(opts) nil end # stop running process # only supported on Netty version # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def stop_put_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ControlApi.stop_put ...' end # resource path local_var_path = 'mockserver/stop' # query parameters query_params = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ControlApi#stop_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end