/*
 * Daytona Toolbox API
 * Daytona Toolbox API
 *
 * The version of the OpenAPI document: v0.0.0-dev
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.daytona.toolbox.client.api;

import io.daytona.toolbox.client.ApiCallback;
import io.daytona.toolbox.client.ApiClient;
import io.daytona.toolbox.client.ApiException;
import io.daytona.toolbox.client.ApiResponse;
import io.daytona.toolbox.client.Configuration;
import io.daytona.toolbox.client.Pair;
import io.daytona.toolbox.client.ProgressRequestBody;
import io.daytona.toolbox.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.daytona.toolbox.client.model.CodeRunRequest;
import io.daytona.toolbox.client.model.CodeRunResponse;
import io.daytona.toolbox.client.model.Command;
import io.daytona.toolbox.client.model.CreateSessionRequest;
import io.daytona.toolbox.client.model.ExecuteRequest;
import io.daytona.toolbox.client.model.ExecuteResponse;
import io.daytona.toolbox.client.model.PtyCreateRequest;
import io.daytona.toolbox.client.model.PtyCreateResponse;
import io.daytona.toolbox.client.model.PtyListResponse;
import io.daytona.toolbox.client.model.PtyResizeRequest;
import io.daytona.toolbox.client.model.PtySessionInfo;
import io.daytona.toolbox.client.model.Session;
import io.daytona.toolbox.client.model.SessionCommandLogsResponse;
import io.daytona.toolbox.client.model.SessionExecuteRequest;
import io.daytona.toolbox.client.model.SessionExecuteResponse;
import io.daytona.toolbox.client.model.SessionSendInputRequest;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ProcessApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public ProcessApi() {
        this(Configuration.getDefaultApiClient());
    }

    public ProcessApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    /**
     * Build call for codeRun
     * @param request Code execution request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call codeRunCall(@javax.annotation.Nonnull CodeRunRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/code-run";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call codeRunValidateBeforeCall(@javax.annotation.Nonnull CodeRunRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling codeRun(Async)");
        }

        return codeRunCall(request, _callback);

    }

    /**
     * Execute code
     * Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts
     * @param request Code execution request (required)
     * @return CodeRunResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public CodeRunResponse codeRun(@javax.annotation.Nonnull CodeRunRequest request) throws ApiException {
        ApiResponse<CodeRunResponse> localVarResp = codeRunWithHttpInfo(request);
        return localVarResp.getData();
    }

    /**
     * Execute code
     * Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts
     * @param request Code execution request (required)
     * @return ApiResponse&lt;CodeRunResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<CodeRunResponse> codeRunWithHttpInfo(@javax.annotation.Nonnull CodeRunRequest request) throws ApiException {
        okhttp3.Call localVarCall = codeRunValidateBeforeCall(request, null);
        Type localVarReturnType = new TypeToken<CodeRunResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Execute code (asynchronously)
     * Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts
     * @param request Code execution request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call codeRunAsync(@javax.annotation.Nonnull CodeRunRequest request, final ApiCallback<CodeRunResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = codeRunValidateBeforeCall(request, _callback);
        Type localVarReturnType = new TypeToken<CodeRunResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for connectPtySession
     * @param sessionId PTY session ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 101 </td><td> Switching Protocols - WebSocket connection established </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call connectPtySessionCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/pty/{sessionId}/connect"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call connectPtySessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling connectPtySession(Async)");
        }

        return connectPtySessionCall(sessionId, _callback);

    }

    /**
     * Connect to PTY session via WebSocket
     * Establish a WebSocket connection to interact with a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 101 </td><td> Switching Protocols - WebSocket connection established </td><td>  -  </td></tr>
     </table>
     */
    public void connectPtySession(@javax.annotation.Nonnull String sessionId) throws ApiException {
        connectPtySessionWithHttpInfo(sessionId);
    }

    /**
     * Connect to PTY session via WebSocket
     * Establish a WebSocket connection to interact with a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 101 </td><td> Switching Protocols - WebSocket connection established </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> connectPtySessionWithHttpInfo(@javax.annotation.Nonnull String sessionId) throws ApiException {
        okhttp3.Call localVarCall = connectPtySessionValidateBeforeCall(sessionId, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Connect to PTY session via WebSocket (asynchronously)
     * Establish a WebSocket connection to interact with a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 101 </td><td> Switching Protocols - WebSocket connection established </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call connectPtySessionAsync(@javax.annotation.Nonnull String sessionId, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = connectPtySessionValidateBeforeCall(sessionId, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for createPtySession
     * @param request PTY session creation request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createPtySessionCall(@javax.annotation.Nonnull PtyCreateRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/pty";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createPtySessionValidateBeforeCall(@javax.annotation.Nonnull PtyCreateRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling createPtySession(Async)");
        }

        return createPtySessionCall(request, _callback);

    }

    /**
     * Create a new PTY session
     * Create a new pseudo-terminal session with specified configuration
     * @param request PTY session creation request (required)
     * @return PtyCreateResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public PtyCreateResponse createPtySession(@javax.annotation.Nonnull PtyCreateRequest request) throws ApiException {
        ApiResponse<PtyCreateResponse> localVarResp = createPtySessionWithHttpInfo(request);
        return localVarResp.getData();
    }

    /**
     * Create a new PTY session
     * Create a new pseudo-terminal session with specified configuration
     * @param request PTY session creation request (required)
     * @return ApiResponse&lt;PtyCreateResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<PtyCreateResponse> createPtySessionWithHttpInfo(@javax.annotation.Nonnull PtyCreateRequest request) throws ApiException {
        okhttp3.Call localVarCall = createPtySessionValidateBeforeCall(request, null);
        Type localVarReturnType = new TypeToken<PtyCreateResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Create a new PTY session (asynchronously)
     * Create a new pseudo-terminal session with specified configuration
     * @param request PTY session creation request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createPtySessionAsync(@javax.annotation.Nonnull PtyCreateRequest request, final ApiCallback<PtyCreateResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = createPtySessionValidateBeforeCall(request, _callback);
        Type localVarReturnType = new TypeToken<PtyCreateResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for createSession
     * @param request Session creation request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createSessionCall(@javax.annotation.Nonnull CreateSessionRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/session";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createSessionValidateBeforeCall(@javax.annotation.Nonnull CreateSessionRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling createSession(Async)");
        }

        return createSessionCall(request, _callback);

    }

    /**
     * Create a new session
     * Create a new shell session for command execution
     * @param request Session creation request (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public void createSession(@javax.annotation.Nonnull CreateSessionRequest request) throws ApiException {
        createSessionWithHttpInfo(request);
    }

    /**
     * Create a new session
     * Create a new shell session for command execution
     * @param request Session creation request (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> createSessionWithHttpInfo(@javax.annotation.Nonnull CreateSessionRequest request) throws ApiException {
        okhttp3.Call localVarCall = createSessionValidateBeforeCall(request, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Create a new session (asynchronously)
     * Create a new shell session for command execution
     * @param request Session creation request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 201 </td><td> Created </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createSessionAsync(@javax.annotation.Nonnull CreateSessionRequest request, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = createSessionValidateBeforeCall(request, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for deletePtySession
     * @param sessionId PTY session ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deletePtySessionCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/pty/{sessionId}"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deletePtySessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling deletePtySession(Async)");
        }

        return deletePtySessionCall(sessionId, _callback);

    }

    /**
     * Delete a PTY session
     * Delete a pseudo-terminal session and terminate its process
     * @param sessionId PTY session ID (required)
     * @return Map&lt;String, Object&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public Map<String, Object> deletePtySession(@javax.annotation.Nonnull String sessionId) throws ApiException {
        ApiResponse<Map<String, Object>> localVarResp = deletePtySessionWithHttpInfo(sessionId);
        return localVarResp.getData();
    }

    /**
     * Delete a PTY session
     * Delete a pseudo-terminal session and terminate its process
     * @param sessionId PTY session ID (required)
     * @return ApiResponse&lt;Map&lt;String, Object&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Map<String, Object>> deletePtySessionWithHttpInfo(@javax.annotation.Nonnull String sessionId) throws ApiException {
        okhttp3.Call localVarCall = deletePtySessionValidateBeforeCall(sessionId, null);
        Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Delete a PTY session (asynchronously)
     * Delete a pseudo-terminal session and terminate its process
     * @param sessionId PTY session ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deletePtySessionAsync(@javax.annotation.Nonnull String sessionId, final ApiCallback<Map<String, Object>> _callback) throws ApiException {

        okhttp3.Call localVarCall = deletePtySessionValidateBeforeCall(sessionId, _callback);
        Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for deleteSession
     * @param sessionId Session ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteSessionCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteSessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling deleteSession(Async)");
        }

        return deleteSessionCall(sessionId, _callback);

    }

    /**
     * Delete a session
     * Delete an existing shell session
     * @param sessionId Session ID (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public void deleteSession(@javax.annotation.Nonnull String sessionId) throws ApiException {
        deleteSessionWithHttpInfo(sessionId);
    }

    /**
     * Delete a session
     * Delete an existing shell session
     * @param sessionId Session ID (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> deleteSessionWithHttpInfo(@javax.annotation.Nonnull String sessionId) throws ApiException {
        okhttp3.Call localVarCall = deleteSessionValidateBeforeCall(sessionId, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Delete a session (asynchronously)
     * Delete an existing shell session
     * @param sessionId Session ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteSessionAsync(@javax.annotation.Nonnull String sessionId, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteSessionValidateBeforeCall(sessionId, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for executeCommand
     * @param request Command execution request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call executeCommandCall(@javax.annotation.Nonnull ExecuteRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/execute";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call executeCommandValidateBeforeCall(@javax.annotation.Nonnull ExecuteRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling executeCommand(Async)");
        }

        return executeCommandCall(request, _callback);

    }

    /**
     * Execute a command
     * Execute a shell command and return the output and exit code
     * @param request Command execution request (required)
     * @return ExecuteResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ExecuteResponse executeCommand(@javax.annotation.Nonnull ExecuteRequest request) throws ApiException {
        ApiResponse<ExecuteResponse> localVarResp = executeCommandWithHttpInfo(request);
        return localVarResp.getData();
    }

    /**
     * Execute a command
     * Execute a shell command and return the output and exit code
     * @param request Command execution request (required)
     * @return ApiResponse&lt;ExecuteResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<ExecuteResponse> executeCommandWithHttpInfo(@javax.annotation.Nonnull ExecuteRequest request) throws ApiException {
        okhttp3.Call localVarCall = executeCommandValidateBeforeCall(request, null);
        Type localVarReturnType = new TypeToken<ExecuteResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Execute a command (asynchronously)
     * Execute a shell command and return the output and exit code
     * @param request Command execution request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call executeCommandAsync(@javax.annotation.Nonnull ExecuteRequest request, final ApiCallback<ExecuteResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = executeCommandValidateBeforeCall(request, _callback);
        Type localVarReturnType = new TypeToken<ExecuteResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getEntrypointLogs
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Entrypoint log content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getEntrypointLogsCall(@javax.annotation.Nullable Boolean follow, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/entrypoint/logs";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (follow != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("follow", follow));
        }

        final String[] localVarAccepts = {
            "application/json",
            "text/plain"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getEntrypointLogsValidateBeforeCall(@javax.annotation.Nullable Boolean follow, final ApiCallback _callback) throws ApiException {
        return getEntrypointLogsCall(follow, _callback);

    }

    /**
     * Get entrypoint logs
     * Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.161.0, plain text otherwise. Supports WebSocket streaming.
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @return SessionCommandLogsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Entrypoint log content </td><td>  -  </td></tr>
     </table>
     */
    public SessionCommandLogsResponse getEntrypointLogs(@javax.annotation.Nullable Boolean follow) throws ApiException {
        ApiResponse<SessionCommandLogsResponse> localVarResp = getEntrypointLogsWithHttpInfo(follow);
        return localVarResp.getData();
    }

    /**
     * Get entrypoint logs
     * Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.161.0, plain text otherwise. Supports WebSocket streaming.
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @return ApiResponse&lt;SessionCommandLogsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Entrypoint log content </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<SessionCommandLogsResponse> getEntrypointLogsWithHttpInfo(@javax.annotation.Nullable Boolean follow) throws ApiException {
        okhttp3.Call localVarCall = getEntrypointLogsValidateBeforeCall(follow, null);
        Type localVarReturnType = new TypeToken<SessionCommandLogsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get entrypoint logs (asynchronously)
     * Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.161.0, plain text otherwise. Supports WebSocket streaming.
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Entrypoint log content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getEntrypointLogsAsync(@javax.annotation.Nullable Boolean follow, final ApiCallback<SessionCommandLogsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getEntrypointLogsValidateBeforeCall(follow, _callback);
        Type localVarReturnType = new TypeToken<SessionCommandLogsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getEntrypointSession
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getEntrypointSessionCall(final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/entrypoint";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getEntrypointSessionValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return getEntrypointSessionCall(_callback);

    }

    /**
     * Get entrypoint session details
     * Get details of an entrypoint session including its commands
     * @return Session
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public Session getEntrypointSession() throws ApiException {
        ApiResponse<Session> localVarResp = getEntrypointSessionWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * Get entrypoint session details
     * Get details of an entrypoint session including its commands
     * @return ApiResponse&lt;Session&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Session> getEntrypointSessionWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = getEntrypointSessionValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<Session>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get entrypoint session details (asynchronously)
     * Get details of an entrypoint session including its commands
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getEntrypointSessionAsync(final ApiCallback<Session> _callback) throws ApiException {

        okhttp3.Call localVarCall = getEntrypointSessionValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<Session>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getPtySession
     * @param sessionId PTY session ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getPtySessionCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/pty/{sessionId}"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getPtySessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling getPtySession(Async)");
        }

        return getPtySessionCall(sessionId, _callback);

    }

    /**
     * Get PTY session information
     * Get detailed information about a specific pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @return PtySessionInfo
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public PtySessionInfo getPtySession(@javax.annotation.Nonnull String sessionId) throws ApiException {
        ApiResponse<PtySessionInfo> localVarResp = getPtySessionWithHttpInfo(sessionId);
        return localVarResp.getData();
    }

    /**
     * Get PTY session information
     * Get detailed information about a specific pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @return ApiResponse&lt;PtySessionInfo&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<PtySessionInfo> getPtySessionWithHttpInfo(@javax.annotation.Nonnull String sessionId) throws ApiException {
        okhttp3.Call localVarCall = getPtySessionValidateBeforeCall(sessionId, null);
        Type localVarReturnType = new TypeToken<PtySessionInfo>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get PTY session information (asynchronously)
     * Get detailed information about a specific pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getPtySessionAsync(@javax.annotation.Nonnull String sessionId, final ApiCallback<PtySessionInfo> _callback) throws ApiException {

        okhttp3.Call localVarCall = getPtySessionValidateBeforeCall(sessionId, _callback);
        Type localVarReturnType = new TypeToken<PtySessionInfo>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getSession
     * @param sessionId Session ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getSessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling getSession(Async)");
        }

        return getSessionCall(sessionId, _callback);

    }

    /**
     * Get session details
     * Get details of a specific session including its commands
     * @param sessionId Session ID (required)
     * @return Session
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public Session getSession(@javax.annotation.Nonnull String sessionId) throws ApiException {
        ApiResponse<Session> localVarResp = getSessionWithHttpInfo(sessionId);
        return localVarResp.getData();
    }

    /**
     * Get session details
     * Get details of a specific session including its commands
     * @param sessionId Session ID (required)
     * @return ApiResponse&lt;Session&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Session> getSessionWithHttpInfo(@javax.annotation.Nonnull String sessionId) throws ApiException {
        okhttp3.Call localVarCall = getSessionValidateBeforeCall(sessionId, null);
        Type localVarReturnType = new TypeToken<Session>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get session details (asynchronously)
     * Get details of a specific session including its commands
     * @param sessionId Session ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionAsync(@javax.annotation.Nonnull String sessionId, final ApiCallback<Session> _callback) throws ApiException {

        okhttp3.Call localVarCall = getSessionValidateBeforeCall(sessionId, _callback);
        Type localVarReturnType = new TypeToken<Session>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getSessionCommand
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionCommandCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}/command/{commandId}"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()))
            .replace("{" + "commandId" + "}", localVarApiClient.escapeString(commandId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getSessionCommandValidateBeforeCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling getSessionCommand(Async)");
        }

        // verify the required parameter 'commandId' is set
        if (commandId == null) {
            throw new ApiException("Missing the required parameter 'commandId' when calling getSessionCommand(Async)");
        }

        return getSessionCommandCall(sessionId, commandId, _callback);

    }

    /**
     * Get session command details
     * Get details of a specific command within a session
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @return Command
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public Command getSessionCommand(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId) throws ApiException {
        ApiResponse<Command> localVarResp = getSessionCommandWithHttpInfo(sessionId, commandId);
        return localVarResp.getData();
    }

    /**
     * Get session command details
     * Get details of a specific command within a session
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @return ApiResponse&lt;Command&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Command> getSessionCommandWithHttpInfo(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId) throws ApiException {
        okhttp3.Call localVarCall = getSessionCommandValidateBeforeCall(sessionId, commandId, null);
        Type localVarReturnType = new TypeToken<Command>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get session command details (asynchronously)
     * Get details of a specific command within a session
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionCommandAsync(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, final ApiCallback<Command> _callback) throws ApiException {

        okhttp3.Call localVarCall = getSessionCommandValidateBeforeCall(sessionId, commandId, _callback);
        Type localVarReturnType = new TypeToken<Command>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getSessionCommandLogs
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Log content (JSON for new SDKs, plain text for old SDKs) </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionCommandLogsCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nullable Boolean follow, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}/command/{commandId}/logs"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()))
            .replace("{" + "commandId" + "}", localVarApiClient.escapeString(commandId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (follow != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("follow", follow));
        }

        final String[] localVarAccepts = {
            "application/json",
            "text/plain"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getSessionCommandLogsValidateBeforeCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nullable Boolean follow, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling getSessionCommandLogs(Async)");
        }

        // verify the required parameter 'commandId' is set
        if (commandId == null) {
            throw new ApiException("Missing the required parameter 'commandId' when calling getSessionCommandLogs(Async)");
        }

        return getSessionCommandLogsCall(sessionId, commandId, follow, _callback);

    }

    /**
     * Get session command logs
     * Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.167.0, plain text otherwise. Supports WebSocket streaming.
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @return SessionCommandLogsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Log content (JSON for new SDKs, plain text for old SDKs) </td><td>  -  </td></tr>
     </table>
     */
    public SessionCommandLogsResponse getSessionCommandLogs(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nullable Boolean follow) throws ApiException {
        ApiResponse<SessionCommandLogsResponse> localVarResp = getSessionCommandLogsWithHttpInfo(sessionId, commandId, follow);
        return localVarResp.getData();
    }

    /**
     * Get session command logs
     * Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.167.0, plain text otherwise. Supports WebSocket streaming.
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @return ApiResponse&lt;SessionCommandLogsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Log content (JSON for new SDKs, plain text for old SDKs) </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<SessionCommandLogsResponse> getSessionCommandLogsWithHttpInfo(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nullable Boolean follow) throws ApiException {
        okhttp3.Call localVarCall = getSessionCommandLogsValidateBeforeCall(sessionId, commandId, follow, null);
        Type localVarReturnType = new TypeToken<SessionCommandLogsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get session command logs (asynchronously)
     * Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.167.0, plain text otherwise. Supports WebSocket streaming.
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param follow Follow logs in real-time (WebSocket only) (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Log content (JSON for new SDKs, plain text for old SDKs) </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSessionCommandLogsAsync(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nullable Boolean follow, final ApiCallback<SessionCommandLogsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getSessionCommandLogsValidateBeforeCall(sessionId, commandId, follow, _callback);
        Type localVarReturnType = new TypeToken<SessionCommandLogsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listPtySessions
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listPtySessionsCall(final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/pty";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listPtySessionsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return listPtySessionsCall(_callback);

    }

    /**
     * List all PTY sessions
     * Get a list of all active pseudo-terminal sessions
     * @return PtyListResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public PtyListResponse listPtySessions() throws ApiException {
        ApiResponse<PtyListResponse> localVarResp = listPtySessionsWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * List all PTY sessions
     * Get a list of all active pseudo-terminal sessions
     * @return ApiResponse&lt;PtyListResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<PtyListResponse> listPtySessionsWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = listPtySessionsValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<PtyListResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List all PTY sessions (asynchronously)
     * Get a list of all active pseudo-terminal sessions
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listPtySessionsAsync(final ApiCallback<PtyListResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listPtySessionsValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<PtyListResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listSessions
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listSessionsCall(final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/process/session";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listSessionsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return listSessionsCall(_callback);

    }

    /**
     * List all sessions
     * Get a list of all active shell sessions
     * @return List&lt;Session&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public List<Session> listSessions() throws ApiException {
        ApiResponse<List<Session>> localVarResp = listSessionsWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * List all sessions
     * Get a list of all active shell sessions
     * @return ApiResponse&lt;List&lt;Session&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<Session>> listSessionsWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = listSessionsValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<List<Session>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List all sessions (asynchronously)
     * Get a list of all active shell sessions
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listSessionsAsync(final ApiCallback<List<Session>> _callback) throws ApiException {

        okhttp3.Call localVarCall = listSessionsValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<List<Session>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for resizePtySession
     * @param sessionId PTY session ID (required)
     * @param request Resize request with new dimensions (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call resizePtySessionCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull PtyResizeRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/pty/{sessionId}/resize"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call resizePtySessionValidateBeforeCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull PtyResizeRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling resizePtySession(Async)");
        }

        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling resizePtySession(Async)");
        }

        return resizePtySessionCall(sessionId, request, _callback);

    }

    /**
     * Resize a PTY session
     * Resize the terminal dimensions of a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @param request Resize request with new dimensions (required)
     * @return PtySessionInfo
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public PtySessionInfo resizePtySession(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull PtyResizeRequest request) throws ApiException {
        ApiResponse<PtySessionInfo> localVarResp = resizePtySessionWithHttpInfo(sessionId, request);
        return localVarResp.getData();
    }

    /**
     * Resize a PTY session
     * Resize the terminal dimensions of a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @param request Resize request with new dimensions (required)
     * @return ApiResponse&lt;PtySessionInfo&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<PtySessionInfo> resizePtySessionWithHttpInfo(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull PtyResizeRequest request) throws ApiException {
        okhttp3.Call localVarCall = resizePtySessionValidateBeforeCall(sessionId, request, null);
        Type localVarReturnType = new TypeToken<PtySessionInfo>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Resize a PTY session (asynchronously)
     * Resize the terminal dimensions of a pseudo-terminal session
     * @param sessionId PTY session ID (required)
     * @param request Resize request with new dimensions (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call resizePtySessionAsync(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull PtyResizeRequest request, final ApiCallback<PtySessionInfo> _callback) throws ApiException {

        okhttp3.Call localVarCall = resizePtySessionValidateBeforeCall(sessionId, request, _callback);
        Type localVarReturnType = new TypeToken<PtySessionInfo>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for sendInput
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param request Input send request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call sendInputCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nonnull SessionSendInputRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}/command/{commandId}/input"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()))
            .replace("{" + "commandId" + "}", localVarApiClient.escapeString(commandId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call sendInputValidateBeforeCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nonnull SessionSendInputRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling sendInput(Async)");
        }

        // verify the required parameter 'commandId' is set
        if (commandId == null) {
            throw new ApiException("Missing the required parameter 'commandId' when calling sendInput(Async)");
        }

        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling sendInput(Async)");
        }

        return sendInputCall(sessionId, commandId, request, _callback);

    }

    /**
     * Send input to command
     * Send input data to a running command in a session for interactive execution
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param request Input send request (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public void sendInput(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nonnull SessionSendInputRequest request) throws ApiException {
        sendInputWithHttpInfo(sessionId, commandId, request);
    }

    /**
     * Send input to command
     * Send input data to a running command in a session for interactive execution
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param request Input send request (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> sendInputWithHttpInfo(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nonnull SessionSendInputRequest request) throws ApiException {
        okhttp3.Call localVarCall = sendInputValidateBeforeCall(sessionId, commandId, request, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Send input to command (asynchronously)
     * Send input data to a running command in a session for interactive execution
     * @param sessionId Session ID (required)
     * @param commandId Command ID (required)
     * @param request Input send request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> No Content </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call sendInputAsync(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull String commandId, @javax.annotation.Nonnull SessionSendInputRequest request, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = sendInputValidateBeforeCall(sessionId, commandId, request, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for sessionExecuteCommand
     * @param sessionId Session ID (required)
     * @param request Command execution request (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
        <tr><td> 202 </td><td> Accepted </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call sessionExecuteCommandCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull SessionExecuteRequest request, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = request;

        // create path and map variables
        String localVarPath = "/process/session/{sessionId}/exec"
            .replace("{" + "sessionId" + "}", localVarApiClient.escapeString(sessionId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call sessionExecuteCommandValidateBeforeCall(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull SessionExecuteRequest request, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'sessionId' is set
        if (sessionId == null) {
            throw new ApiException("Missing the required parameter 'sessionId' when calling sessionExecuteCommand(Async)");
        }

        // verify the required parameter 'request' is set
        if (request == null) {
            throw new ApiException("Missing the required parameter 'request' when calling sessionExecuteCommand(Async)");
        }

        return sessionExecuteCommandCall(sessionId, request, _callback);

    }

    /**
     * Execute command in session
     * Execute a command within an existing shell session
     * @param sessionId Session ID (required)
     * @param request Command execution request (required)
     * @return SessionExecuteResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
        <tr><td> 202 </td><td> Accepted </td><td>  -  </td></tr>
     </table>
     */
    public SessionExecuteResponse sessionExecuteCommand(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull SessionExecuteRequest request) throws ApiException {
        ApiResponse<SessionExecuteResponse> localVarResp = sessionExecuteCommandWithHttpInfo(sessionId, request);
        return localVarResp.getData();
    }

    /**
     * Execute command in session
     * Execute a command within an existing shell session
     * @param sessionId Session ID (required)
     * @param request Command execution request (required)
     * @return ApiResponse&lt;SessionExecuteResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
        <tr><td> 202 </td><td> Accepted </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<SessionExecuteResponse> sessionExecuteCommandWithHttpInfo(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull SessionExecuteRequest request) throws ApiException {
        okhttp3.Call localVarCall = sessionExecuteCommandValidateBeforeCall(sessionId, request, null);
        Type localVarReturnType = new TypeToken<SessionExecuteResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Execute command in session (asynchronously)
     * Execute a command within an existing shell session
     * @param sessionId Session ID (required)
     * @param request Command execution request (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> OK </td><td>  -  </td></tr>
        <tr><td> 202 </td><td> Accepted </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call sessionExecuteCommandAsync(@javax.annotation.Nonnull String sessionId, @javax.annotation.Nonnull SessionExecuteRequest request, final ApiCallback<SessionExecuteResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = sessionExecuteCommandValidateBeforeCall(sessionId, request, _callback);
        Type localVarReturnType = new TypeToken<SessionExecuteResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
