text: import API from "./api";
  import C from "../constants";
  import ENDPOINTS from "../../../configs/apiendpoints";
  export default class RunExperiment extends API {
    constructor(workspaceName, filepath, timeout = 2000) {
      console.log();
      super("POST", timeout, false);
      this.type = C.CREATEWORKSPACE;
      this.title = workspaceName;
      this.filepath = filepath;
      this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.savetool2datasource}`;
    }
  
    toString() {
      return `${super.toString()} , type: ${this.type}`;
    }
  
    processResponse(res) {
      super.processResponse(res);
      if (res) {
        this.workspace = res;
      }
    }
  
    apiEndPoint() {
      return this.endpoint;
    }
  
    getBody() {
      return {
        paragraph_workspace: {
          title: this.title,
          sentence_file: this.filepath
        }
      };
    }
  
    getHeaders() {
      this.headers = {
        headers: {
          Authorization: `Bearer ${decodeURI(localStorage.getItem("token"))}`,
          "Content-Type": "application/json"
        }
      };
      return this.headers;
    }
  
    getPayload() {
      return this.workspace;
    }
  }
  