=begin
#Daytona

#Daytona AI platform API Docs

The version of the OpenAPI document: 1.0
Contact: support@daytona.com
Generated by: https://openapi-generator.tech
Generator version: 7.21.0

=end

require 'cgi'

module DaytonaApiClient
  class WorkspaceApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # [DEPRECATED] Archive workspace
    # @param workspace_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def archive_workspace_deprecated(workspace_id, opts = {})
      archive_workspace_deprecated_with_http_info(workspace_id, opts)
      nil
    end

    # [DEPRECATED] Archive workspace
    # @param workspace_id [String] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def archive_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.archive_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.archive_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/archive'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.archive_workspace_deprecated",
        :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: WorkspaceApi#archive_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Create workspace backup
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Workspace]
    def create_backup_workspace_deprecated(workspace_id, opts = {})
      data, _status_code, _headers = create_backup_workspace_deprecated_with_http_info(workspace_id, opts)
      data
    end

    # [DEPRECATED] Create workspace backup
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(Workspace, Integer, Hash)>] Workspace data, response status code and response headers
    def create_backup_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.create_backup_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.create_backup_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/backup'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_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']
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.create_backup_workspace_deprecated",
        :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: WorkspaceApi#create_backup_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Create a new workspace
    # @param create_workspace [CreateWorkspace] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Workspace]
    def create_workspace_deprecated(create_workspace, opts = {})
      data, _status_code, _headers = create_workspace_deprecated_with_http_info(create_workspace, opts)
      data
    end

    # [DEPRECATED] Create a new workspace
    # @param create_workspace [CreateWorkspace] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(Workspace, Integer, Hash)>] Workspace data, response status code and response headers
    def create_workspace_deprecated_with_http_info(create_workspace, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.create_workspace_deprecated ...'
      end
      # verify the required parameter 'create_workspace' is set
      if @api_client.config.client_side_validation && create_workspace.nil?
        fail ArgumentError, "Missing the required parameter 'create_workspace' when calling WorkspaceApi.create_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace'

      # 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
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.create_workspace_deprecated",
        :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: WorkspaceApi#create_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Delete workspace
    # @param workspace_id [String] ID of the workspace
    # @param force [Boolean] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def delete_workspace_deprecated(workspace_id, force, opts = {})
      delete_workspace_deprecated_with_http_info(workspace_id, force, opts)
      nil
    end

    # [DEPRECATED] Delete workspace
    # @param workspace_id [String] ID of the workspace
    # @param force [Boolean] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def delete_workspace_deprecated_with_http_info(workspace_id, force, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.delete_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.delete_workspace_deprecated"
      end
      # verify the required parameter 'force' is set
      if @api_client.config.client_side_validation && force.nil?
        fail ArgumentError, "Missing the required parameter 'force' when calling WorkspaceApi.delete_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.delete_workspace_deprecated",
        :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: WorkspaceApi#delete_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Get build logs
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :follow Whether to follow the logs stream
    # @return [nil]
    def get_build_logs_workspace_deprecated(workspace_id, opts = {})
      get_build_logs_workspace_deprecated_with_http_info(workspace_id, opts)
      nil
    end

    # [DEPRECATED] Get build logs
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :follow Whether to follow the logs stream
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def get_build_logs_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_build_logs_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_build_logs_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/build-logs'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_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] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.get_build_logs_workspace_deprecated",
        :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: WorkspaceApi#get_build_logs_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Get preview URL for a workspace port
    # @param workspace_id [String] ID of the workspace
    # @param port [Float] Port number to get preview URL for
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [WorkspacePortPreviewUrl]
    def get_port_preview_url_workspace_deprecated(workspace_id, port, opts = {})
      data, _status_code, _headers = get_port_preview_url_workspace_deprecated_with_http_info(workspace_id, port, opts)
      data
    end

    # [DEPRECATED] Get preview URL for a workspace port
    # @param workspace_id [String] ID of the workspace
    # @param port [Float] Port number to get preview URL for
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(WorkspacePortPreviewUrl, Integer, Hash)>] WorkspacePortPreviewUrl data, response status code and response headers
    def get_port_preview_url_workspace_deprecated_with_http_info(workspace_id, port, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_port_preview_url_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_port_preview_url_workspace_deprecated"
      end
      # verify the required parameter 'port' is set
      if @api_client.config.client_side_validation && port.nil?
        fail ArgumentError, "Missing the required parameter 'port' when calling WorkspaceApi.get_port_preview_url_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/ports/{port}/preview-url'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'port' + '}', CGI.escape(port.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']
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.get_port_preview_url_workspace_deprecated",
        :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: WorkspaceApi#get_port_preview_url_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Get workspace details
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :verbose Include verbose output
    # @return [Workspace]
    def get_workspace_deprecated(workspace_id, opts = {})
      data, _status_code, _headers = get_workspace_deprecated_with_http_info(workspace_id, opts)
      data
    end

    # [DEPRECATED] Get workspace details
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :verbose Include verbose output
    # @return [Array<(Workspace, Integer, Hash)>] Workspace data, response status code and response headers
    def get_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))

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

      # 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']
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.get_workspace_deprecated",
        :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: WorkspaceApi#get_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] List all workspaces
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :verbose Include verbose output
    # @option opts [String] :labels JSON encoded labels to filter by
    # @return [Array<Workspace>]
    def list_workspaces_deprecated(opts = {})
      data, _status_code, _headers = list_workspaces_deprecated_with_http_info(opts)
      data
    end

    # [DEPRECATED] List all workspaces
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @option opts [Boolean] :verbose Include verbose output
    # @option opts [String] :labels JSON encoded labels to filter by
    # @return [Array<(Array<Workspace>, Integer, Hash)>] Array<Workspace> data, response status code and response headers
    def list_workspaces_deprecated_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.list_workspaces_deprecated ...'
      end
      # resource path
      local_var_path = '/workspace'

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

      # 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']
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.list_workspaces_deprecated",
        :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: WorkspaceApi#list_workspaces_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Replace workspace labels
    # @param workspace_id [String] ID of the workspace
    # @param sandbox_labels [SandboxLabels] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [SandboxLabels]
    def replace_labels_workspace_deprecated(workspace_id, sandbox_labels, opts = {})
      data, _status_code, _headers = replace_labels_workspace_deprecated_with_http_info(workspace_id, sandbox_labels, opts)
      data
    end

    # [DEPRECATED] Replace workspace labels
    # @param workspace_id [String] ID of the workspace
    # @param sandbox_labels [SandboxLabels] 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(SandboxLabels, Integer, Hash)>] SandboxLabels data, response status code and response headers
    def replace_labels_workspace_deprecated_with_http_info(workspace_id, sandbox_labels, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.replace_labels_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.replace_labels_workspace_deprecated"
      end
      # verify the required parameter 'sandbox_labels' is set
      if @api_client.config.client_side_validation && sandbox_labels.nil?
        fail ArgumentError, "Missing the required parameter 'sandbox_labels' when calling WorkspaceApi.replace_labels_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/labels'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_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
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

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

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

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

      # auth_names
      auth_names = opts[:debug_auth_names] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.replace_labels_workspace_deprecated",
        :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(:PUT, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: WorkspaceApi#replace_labels_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Set workspace auto-archive interval
    # @param workspace_id [String] ID of the workspace
    # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def set_auto_archive_interval_workspace_deprecated(workspace_id, interval, opts = {})
      set_auto_archive_interval_workspace_deprecated_with_http_info(workspace_id, interval, opts)
      nil
    end

    # [DEPRECATED] Set workspace auto-archive interval
    # @param workspace_id [String] ID of the workspace
    # @param interval [Float] Auto-archive interval in minutes (0 means the maximum interval will be used)
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def set_auto_archive_interval_workspace_deprecated_with_http_info(workspace_id, interval, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.set_auto_archive_interval_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.set_auto_archive_interval_workspace_deprecated"
      end
      # verify the required parameter 'interval' is set
      if @api_client.config.client_side_validation && interval.nil?
        fail ArgumentError, "Missing the required parameter 'interval' when calling WorkspaceApi.set_auto_archive_interval_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/autoarchive/{interval}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.set_auto_archive_interval_workspace_deprecated",
        :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: WorkspaceApi#set_auto_archive_interval_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Set workspace auto-stop interval
    # @param workspace_id [String] ID of the workspace
    # @param interval [Float] Auto-stop interval in minutes (0 to disable)
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def set_autostop_interval_workspace_deprecated(workspace_id, interval, opts = {})
      set_autostop_interval_workspace_deprecated_with_http_info(workspace_id, interval, opts)
      nil
    end

    # [DEPRECATED] Set workspace auto-stop interval
    # @param workspace_id [String] ID of the workspace
    # @param interval [Float] Auto-stop interval in minutes (0 to disable)
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def set_autostop_interval_workspace_deprecated_with_http_info(workspace_id, interval, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.set_autostop_interval_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.set_autostop_interval_workspace_deprecated"
      end
      # verify the required parameter 'interval' is set
      if @api_client.config.client_side_validation && interval.nil?
        fail ArgumentError, "Missing the required parameter 'interval' when calling WorkspaceApi.set_autostop_interval_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/autostop/{interval}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'interval' + '}', CGI.escape(interval.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.set_autostop_interval_workspace_deprecated",
        :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: WorkspaceApi#set_autostop_interval_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Start workspace
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def start_workspace_deprecated(workspace_id, opts = {})
      start_workspace_deprecated_with_http_info(workspace_id, opts)
      nil
    end

    # [DEPRECATED] Start workspace
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def start_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.start_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.start_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/start'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.start_workspace_deprecated",
        :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: WorkspaceApi#start_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Stop workspace
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def stop_workspace_deprecated(workspace_id, opts = {})
      stop_workspace_deprecated_with_http_info(workspace_id, opts)
      nil
    end

    # [DEPRECATED] Stop workspace
    # @param workspace_id [String] ID of the workspace
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def stop_workspace_deprecated_with_http_info(workspace_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.stop_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.stop_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/stop'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.stop_workspace_deprecated",
        :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: WorkspaceApi#stop_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # [DEPRECATED] Update public status
    # @param workspace_id [String] ID of the workspace
    # @param is_public [Boolean] Public status to set
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [nil]
    def update_public_status_workspace_deprecated(workspace_id, is_public, opts = {})
      update_public_status_workspace_deprecated_with_http_info(workspace_id, is_public, opts)
      nil
    end

    # [DEPRECATED] Update public status
    # @param workspace_id [String] ID of the workspace
    # @param is_public [Boolean] Public status to set
    # @param [Hash] opts the optional parameters
    # @option opts [String] :x_daytona_organization_id Use with JWT to specify the organization ID
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def update_public_status_workspace_deprecated_with_http_info(workspace_id, is_public, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: WorkspaceApi.update_public_status_workspace_deprecated ...'
      end
      # verify the required parameter 'workspace_id' is set
      if @api_client.config.client_side_validation && workspace_id.nil?
        fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.update_public_status_workspace_deprecated"
      end
      # verify the required parameter 'is_public' is set
      if @api_client.config.client_side_validation && is_public.nil?
        fail ArgumentError, "Missing the required parameter 'is_public' when calling WorkspaceApi.update_public_status_workspace_deprecated"
      end
      # resource path
      local_var_path = '/workspace/{workspaceId}/public/{isPublic}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'isPublic' + '}', CGI.escape(is_public.to_s))

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

      # header parameters
      header_params = opts[:header_params] || {}
      header_params[:'X-Daytona-Organization-ID'] = opts[:'x_daytona_organization_id'] if !opts[:'x_daytona_organization_id'].nil?

      # 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] || ['bearer', 'oauth2']

      new_options = opts.merge(
        :operation => :"WorkspaceApi.update_public_status_workspace_deprecated",
        :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: WorkspaceApi#update_public_status_workspace_deprecated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
