=begin
#Daytona Toolbox API

#Daytona Toolbox API

The version of the OpenAPI document: v0.0.0-dev

Generated by: https://openapi-generator.tech
Generator version: 7.21.0

=end

require 'cgi'

module DaytonaToolboxApiClient
  class ProcessApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Execute code
    # Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts
    # @param request [CodeRunRequest] Code execution request
    # @param [Hash] opts the optional parameters
    # @return [CodeRunResponse]
    def code_run(request, opts = {})
      data, _status_code, _headers = code_run_with_http_info(request, opts)
      data
    end

    # Execute code
    # Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts
    # @param request [CodeRunRequest] Code execution request
    # @param [Hash] opts the optional parameters
    # @return [Array<(CodeRunResponse, Integer, Hash)>] CodeRunResponse data, response status code and response headers
    def code_run_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.code_run ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.code_run"
      end
      # resource path
      local_var_path = '/process/code-run'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type] || 'CodeRunResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.code_run",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#code_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Connect to PTY session via WebSocket
    # Establish a WebSocket connection to interact with a pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def connect_pty_session(session_id, opts = {})
      connect_pty_session_with_http_info(session_id, opts)
      nil
    end

    # Connect to PTY session via WebSocket
    # Establish a WebSocket connection to interact with a pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def connect_pty_session_with_http_info(session_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.connect_pty_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.connect_pty_session"
      end
      # resource path
      local_var_path = '/process/pty/{sessionId}/connect'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.connect_pty_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#connect_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create a new PTY session
    # Create a new pseudo-terminal session with specified configuration
    # @param request [PtyCreateRequest] PTY session creation request
    # @param [Hash] opts the optional parameters
    # @return [PtyCreateResponse]
    def create_pty_session(request, opts = {})
      data, _status_code, _headers = create_pty_session_with_http_info(request, opts)
      data
    end

    # Create a new PTY session
    # Create a new pseudo-terminal session with specified configuration
    # @param request [PtyCreateRequest] PTY session creation request
    # @param [Hash] opts the optional parameters
    # @return [Array<(PtyCreateResponse, Integer, Hash)>] PtyCreateResponse data, response status code and response headers
    def create_pty_session_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.create_pty_session ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.create_pty_session"
      end
      # resource path
      local_var_path = '/process/pty'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type] || 'PtyCreateResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.create_pty_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#create_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Create a new session
    # Create a new shell session for command execution
    # @param request [CreateSessionRequest] Session creation request
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def create_session(request, opts = {})
      create_session_with_http_info(request, opts)
      nil
    end

    # Create a new session
    # Create a new shell session for command execution
    # @param request [CreateSessionRequest] Session creation request
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def create_session_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.create_session ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.create_session"
      end
      # resource path
      local_var_path = '/process/session'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.create_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete a PTY session
    # Delete a pseudo-terminal session and terminate its process
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [Hash<String, Object>]
    def delete_pty_session(session_id, opts = {})
      data, _status_code, _headers = delete_pty_session_with_http_info(session_id, opts)
      data
    end

    # Delete a PTY session
    # Delete a pseudo-terminal session and terminate its process
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
    def delete_pty_session_with_http_info(session_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.delete_pty_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.delete_pty_session"
      end
      # resource path
      local_var_path = '/process/pty/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Hash<String, Object>'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.delete_pty_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#delete_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete a session
    # Delete an existing shell session
    # @param session_id [String] Session ID
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_session(session_id, opts = {})
      delete_session_with_http_info(session_id, opts)
      nil
    end

    # Delete a session
    # Delete an existing shell session
    # @param session_id [String] Session ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_session_with_http_info(session_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.delete_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.delete_session"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.delete_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Execute a command
    # Execute a shell command and return the output and exit code
    # @param request [ExecuteRequest] Command execution request
    # @param [Hash] opts the optional parameters
    # @return [ExecuteResponse]
    def execute_command(request, opts = {})
      data, _status_code, _headers = execute_command_with_http_info(request, opts)
      data
    end

    # Execute a command
    # Execute a shell command and return the output and exit code
    # @param request [ExecuteRequest] Command execution request
    # @param [Hash] opts the optional parameters
    # @return [Array<(ExecuteResponse, Integer, Hash)>] ExecuteResponse data, response status code and response headers
    def execute_command_with_http_info(request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.execute_command ...'
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.execute_command"
      end
      # resource path
      local_var_path = '/process/execute'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type] || 'ExecuteResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.execute_command",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#execute_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get entrypoint logs
    # Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK >= 0.161.0, plain text otherwise. Supports WebSocket streaming.
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :follow Follow logs in real-time (WebSocket only)
    # @return [SessionCommandLogsResponse]
    def get_entrypoint_logs(opts = {})
      data, _status_code, _headers = get_entrypoint_logs_with_http_info(opts)
      data
    end

    # 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 [Hash] opts the optional parameters
    # @option opts [Boolean] :follow Follow logs in real-time (WebSocket only)
    # @return [Array<(SessionCommandLogsResponse, Integer, Hash)>] SessionCommandLogsResponse data, response status code and response headers
    def get_entrypoint_logs_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_entrypoint_logs ...'
      end
      # resource path
      local_var_path = '/process/session/entrypoint/logs'

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'SessionCommandLogsResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_entrypoint_logs",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_entrypoint_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get entrypoint session details
    # Get details of an entrypoint session including its commands
    # @param [Hash] opts the optional parameters
    # @return [Session]
    def get_entrypoint_session(opts = {})
      data, _status_code, _headers = get_entrypoint_session_with_http_info(opts)
      data
    end

    # Get entrypoint session details
    # Get details of an entrypoint session including its commands
    # @param [Hash] opts the optional parameters
    # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers
    def get_entrypoint_session_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_entrypoint_session ...'
      end
      # resource path
      local_var_path = '/process/session/entrypoint'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Session'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_entrypoint_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_entrypoint_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get PTY session information
    # Get detailed information about a specific pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [PtySessionInfo]
    def get_pty_session(session_id, opts = {})
      data, _status_code, _headers = get_pty_session_with_http_info(session_id, opts)
      data
    end

    # Get PTY session information
    # Get detailed information about a specific pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(PtySessionInfo, Integer, Hash)>] PtySessionInfo data, response status code and response headers
    def get_pty_session_with_http_info(session_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_pty_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_pty_session"
      end
      # resource path
      local_var_path = '/process/pty/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'PtySessionInfo'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_pty_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get session details
    # Get details of a specific session including its commands
    # @param session_id [String] Session ID
    # @param [Hash] opts the optional parameters
    # @return [Session]
    def get_session(session_id, opts = {})
      data, _status_code, _headers = get_session_with_http_info(session_id, opts)
      data
    end

    # Get session details
    # Get details of a specific session including its commands
    # @param session_id [String] Session ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers
    def get_session_with_http_info(session_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Session'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get session command details
    # Get details of a specific command within a session
    # @param session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param [Hash] opts the optional parameters
    # @return [Command]
    def get_session_command(session_id, command_id, opts = {})
      data, _status_code, _headers = get_session_command_with_http_info(session_id, command_id, opts)
      data
    end

    # Get session command details
    # Get details of a specific command within a session
    # @param session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param [Hash] opts the optional parameters
    # @return [Array<(Command, Integer, Hash)>] Command data, response status code and response headers
    def get_session_command_with_http_info(session_id, command_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_session_command ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session_command"
      end
      # verify the required parameter 'command_id' is set
      if @api_client.config.client_side_validation && command_id.nil?
        fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.get_session_command"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}/command/{commandId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Command'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_session_command",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_session_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get session command logs
    # Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK >= 0.167.0, plain text otherwise. Supports WebSocket streaming.
    # @param session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :follow Follow logs in real-time (WebSocket only)
    # @return [SessionCommandLogsResponse]
    def get_session_command_logs(session_id, command_id, opts = {})
      data, _status_code, _headers = get_session_command_logs_with_http_info(session_id, command_id, opts)
      data
    end

    # 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 session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param [Hash] opts the optional parameters
    # @option opts [Boolean] :follow Follow logs in real-time (WebSocket only)
    # @return [Array<(SessionCommandLogsResponse, Integer, Hash)>] SessionCommandLogsResponse data, response status code and response headers
    def get_session_command_logs_with_http_info(session_id, command_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.get_session_command_logs ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session_command_logs"
      end
      # verify the required parameter 'command_id' is set
      if @api_client.config.client_side_validation && command_id.nil?
        fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.get_session_command_logs"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}/command/{commandId}/logs'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}
      query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'SessionCommandLogsResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.get_session_command_logs",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#get_session_command_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List all PTY sessions
    # Get a list of all active pseudo-terminal sessions
    # @param [Hash] opts the optional parameters
    # @return [PtyListResponse]
    def list_pty_sessions(opts = {})
      data, _status_code, _headers = list_pty_sessions_with_http_info(opts)
      data
    end

    # List all PTY sessions
    # Get a list of all active pseudo-terminal sessions
    # @param [Hash] opts the optional parameters
    # @return [Array<(PtyListResponse, Integer, Hash)>] PtyListResponse data, response status code and response headers
    def list_pty_sessions_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.list_pty_sessions ...'
      end
      # resource path
      local_var_path = '/process/pty'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'PtyListResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.list_pty_sessions",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#list_pty_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # List all sessions
    # Get a list of all active shell sessions
    # @param [Hash] opts the optional parameters
    # @return [Array<Session>]
    def list_sessions(opts = {})
      data, _status_code, _headers = list_sessions_with_http_info(opts)
      data
    end

    # List all sessions
    # Get a list of all active shell sessions
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<Session>, Integer, Hash)>] Array<Session> data, response status code and response headers
    def list_sessions_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.list_sessions ...'
      end
      # resource path
      local_var_path = '/process/session'

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body]

      # return_type
      return_type = opts[:debug_return_type] || 'Array<Session>'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.list_sessions",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Resize a PTY session
    # Resize the terminal dimensions of a pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param request [PtyResizeRequest] Resize request with new dimensions
    # @param [Hash] opts the optional parameters
    # @return [PtySessionInfo]
    def resize_pty_session(session_id, request, opts = {})
      data, _status_code, _headers = resize_pty_session_with_http_info(session_id, request, opts)
      data
    end

    # Resize a PTY session
    # Resize the terminal dimensions of a pseudo-terminal session
    # @param session_id [String] PTY session ID
    # @param request [PtyResizeRequest] Resize request with new dimensions
    # @param [Hash] opts the optional parameters
    # @return [Array<(PtySessionInfo, Integer, Hash)>] PtySessionInfo data, response status code and response headers
    def resize_pty_session_with_http_info(session_id, request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.resize_pty_session ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.resize_pty_session"
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.resize_pty_session"
      end
      # resource path
      local_var_path = '/process/pty/{sessionId}/resize'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type] || 'PtySessionInfo'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.resize_pty_session",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#resize_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Send input to command
    # Send input data to a running command in a session for interactive execution
    # @param session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param request [SessionSendInputRequest] Input send request
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def send_input(session_id, command_id, request, opts = {})
      send_input_with_http_info(session_id, command_id, request, opts)
      nil
    end

    # Send input to command
    # Send input data to a running command in a session for interactive execution
    # @param session_id [String] Session ID
    # @param command_id [String] Command ID
    # @param request [SessionSendInputRequest] Input send request
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def send_input_with_http_info(session_id, command_id, request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.send_input ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.send_input"
      end
      # verify the required parameter 'command_id' is set
      if @api_client.config.client_side_validation && command_id.nil?
        fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.send_input"
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.send_input"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}/command/{commandId}/input'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type]

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.send_input",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#send_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Execute command in session
    # Execute a command within an existing shell session
    # @param session_id [String] Session ID
    # @param request [SessionExecuteRequest] Command execution request
    # @param [Hash] opts the optional parameters
    # @return [SessionExecuteResponse]
    def session_execute_command(session_id, request, opts = {})
      data, _status_code, _headers = session_execute_command_with_http_info(session_id, request, opts)
      data
    end

    # Execute command in session
    # Execute a command within an existing shell session
    # @param session_id [String] Session ID
    # @param request [SessionExecuteRequest] Command execution request
    # @param [Hash] opts the optional parameters
    # @return [Array<(SessionExecuteResponse, Integer, Hash)>] SessionExecuteResponse data, response status code and response headers
    def session_execute_command_with_http_info(session_id, request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: ProcessApi.session_execute_command ...'
      end
      # verify the required parameter 'session_id' is set
      if @api_client.config.client_side_validation && session_id.nil?
        fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.session_execute_command"
      end
      # verify the required parameter 'request' is set
      if @api_client.config.client_side_validation && request.nil?
        fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.session_execute_command"
      end
      # resource path
      local_var_path = '/process/session/{sessionId}/exec'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
      # HTTP header 'Content-Type'
      content_type = @api_client.select_header_content_type(['application/json'])
      if !content_type.nil?
          header_params['Content-Type'] = content_type
      end

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

      # return_type
      return_type = opts[:debug_return_type] || 'SessionExecuteResponse'

      # auth_names
      auth_names = opts[:debug_auth_names] || []

      new_options = opts.merge(
        :operation => :"ProcessApi.session_execute_command",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )

      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: ProcessApi#session_execute_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
