Override if handling callbacks
@param msg the HTTP message containing the API request and response
@return the API response (set in the HTTP response body)
@throws ApiException if an error occurred while handling the API callback
420872
public String handleCallBack(HttpMessage msg)  throws ApiException {
		throw new ApiException (ApiException.Type.URL_NOT_FOUND, msg.getRequestHeader().getURI().toString());
	}
1325528
public ApiResponse<DynconfigGetConfigResponse> dynconfigGetConfigWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = dynconfigGetConfigValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<DynconfigGetConfigResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
553386
public ApiSuccessResponse submitFeedback(SubmitFeedbackData submitFeedbackData) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = submitFeedbackWithHttpInfo(submitFeedbackData);
        return resp.getData();
    }
859318
public MessageIDEnvelope sendActions(Actions data) throws ApiException {
        ApiResponse<MessageIDEnvelope> resp = sendActionsWithHttpInfo(data);
        return resp.getData();
    }
644081
protected function handleException()
    {
        $this->handleNotJsonException($this->getResponse());

        if (false === $this->getInstapushClient()->isHandleException()) {
            return $this
                ->getInstapushClient()
                ->getTransformer()
                ->transform($this->getResponse(), ApiError::class);
        }

        $content = \json_decode($this->getResponse()->getBody()->__toString(), true);

        $message = true === isset($content['msg']) ? $content['msg'] : 'An unexpected error occurred : '.$content;

        throw new ApiException($message, $this->getRequest(), $this->getResponse());
    }
270411
def handle_request(self, msg):
        
        method = self.__class__.unhandled_request
        if msg.name in self._request_handlers:
            method = self._request_handlers[msg.name]

        try:
            reply = method(self, msg)
            if isinstance(reply, Message):
                # If it is a message object, assume it is a reply.
                reply.mid = msg.mid
                assert (reply.mtype == Message.REPLY)
                assert (reply.name == msg.name)
                self._logger.info("%s OK" % (msg.name,))
                self.send_message(reply)
            else:
                # Just pass on what is, potentially, a future. The implementor
                # of the request handler method must arrange for a reply to be
                # sent. Since clients have no business dealing with requests in
                # any case we don't do much to help them.
                return reply
        # We do want to catch everything that inherits from Exception
        # pylint: disable-msg = W0703
        except Exception:
            e_type, e_value, trace = sys.exc_info()
            reason = "\n".join(traceback.format_exception(
                e_type, e_value, trace, self._tb_limit))
            self._logger.error("Request %s FAIL: %s" % (msg.name, reason))
528285
public ApiResponse<ApiSuccessResponse> submitFeedbackWithHttpInfo(SubmitFeedbackData submitFeedbackData) throws ApiException {
        com.squareup.okhttp.Call call = submitFeedbackValidateBeforeCall(submitFeedbackData, null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
870651
public ApiResponse<Void> swaggerDocWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = swaggerDocValidateBeforeCall(null, null);
        return apiClient.execute(call);
    }
793089
public void sendAndReceive(HttpMessage msg, boolean isFollowRedirect) throws IOException {

		log.debug("sendAndReceive " + msg.getRequestHeader().getMethod() + " "
				+ msg.getRequestHeader().getURI() + " start");
		msg.setTimeSentMillis(System.currentTimeMillis());

		try {
			notifyRequestListeners(msg);
			if (!isFollowRedirect
					|| !(msg.getRequestHeader().getMethod().equalsIgnoreCase(HttpRequestHeader.POST) || msg
							.getRequestHeader().getMethod().equalsIgnoreCase(HttpRequestHeader.PUT))) {
				// ZAP: Reauthentication when sending a message from the perspective of a User
				sendAuthenticated(msg, isFollowRedirect);
				return;
			}

			// ZAP: Reauthentication when sending a message from the perspective of a User
			sendAuthenticated(msg, false);

			HttpMessage temp = msg.cloneAll();
			temp.setRequestingUser(getUser(msg));
			// POST/PUT method cannot be redirected by library. Need to follow by code

			// loop 1 time only because httpclient can handle redirect itself after first GET.
			for (int i = 0; i < 1
					&& (HttpStatusCode.isRedirection(temp.getResponseHeader().getStatusCode()) && temp
							.getResponseHeader().getStatusCode() != HttpStatusCode.NOT_MODIFIED); i++) {
				String location = temp.getResponseHeader().getHeader(HttpHeader.LOCATION);
				URI baseUri = temp.getRequestHeader().getURI();
				URI newLocation = new URI(baseUri, location, false);
				temp.getRequestHeader().setURI(newLocation);

				temp.getRequestHeader().setMethod(HttpRequestHeader.GET);
				temp.getRequestHeader().setHeader(HttpHeader.CONTENT_LENGTH, null);
				// ZAP: Reauthentication when sending a message from the perspective of a User
				sendAuthenticated(temp, true);
			}

			msg.setResponseHeader(temp.getResponseHeader());
			msg.setResponseBody(temp.getResponseBody());

		} finally {
			msg.setTimeElapsedMillis((int) (System.currentTimeMillis() - msg.getTimeSentMillis()));
			log.debug("sendAndReceive " + msg.getRequestHeader().getMethod() + " "
					+ msg.getRequestHeader().getURI() + " took " + msg.getTimeElapsedMillis());

			notifyResponseListeners(msg);
		}
	}
962069
public void error(String msg)
  {

    System.out.println("DOM ERROR! class: " + this.getClass().getName());

    throw new RuntimeException(XMLMessages.createXMLMessage(msg, null));
  }
940078
public ApiResponse<ModelApiResponse> pingWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = pingValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
467386
public static void makeResponse(HttpResponse response, String msg, int status) {
        response.setStatusCode(status);
        makeStringResponse(response, msg);
    }
159899
public ApiSuccessResponse mgtMoveToQueue(MgtMoveToQueue mgtMoveToQueue) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = mgtMoveToQueueWithHttpInfo(mgtMoveToQueue);
        return resp.getData();
    }
820687
public void receive(Message msg) {
        Request req=null;

        if(msg == null || msg.getLength() == 0)
            return;
        try {
            req=msg.getObject();

            String fqn=req.fqn;
            switch(req.type) {
                case Request.PUT:
                    if(req.key != null && req.value != null)
                        _put(fqn, req.key, req.value);
                    else
                        _put(fqn, req.data);
                    break;
                case Request.REMOVE:
                    if(req.key != null)
                        _remove(fqn, req.key);
                    else
                        _remove(fqn);
                    break;
                default:
                    if(log.isErrorEnabled()) log.error("type " + req.type + " unknown");
                    break;
            }
        }
        catch(Exception ex) {
            if(log.isErrorEnabled()) log.error("failed unmarshalling request: " + ex);
        }
    }
948112
public ApiResponse<SetEnabledResponse> setEnabledWithHttpInfo(Boolean saMLEnabled) throws ApiException {
        com.squareup.okhttp.Call call = setEnabledValidateBeforeCall(saMLEnabled, null, null);
        Type localVarReturnType = new TypeToken<SetEnabledResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
574370
@Override
	public void callback(final AbstractMessage msg) {

		synchronized (lock) {

			hasTimeout = false;
			message = msg;

			lock.notify();
		}
	}
222260
public <T> ApiResponse<T> execute(Call call) throws ApiException {
        return execute(call, null);
    }