mindee
Version:
Mindee Client Library for Node.js
33 lines (32 loc) • 1.43 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Execution = void 0;
const generatedV1Document_1 = require("../../product/generated/generatedV1Document");
/**
* Representation of an execution for a workflow.
* @category Workflow
*/
class Execution {
constructor(inferenceClass, jsonResponse) {
this.batchName = jsonResponse["batch_name"];
this.createdAt = jsonResponse["created_at"] ? this.parseDate(jsonResponse["created_at"]) : null;
this.file = jsonResponse["file"];
this.id = jsonResponse["id"];
this.inference = jsonResponse["inference"] ? new inferenceClass(jsonResponse["inference"]) : null;
this.priority = jsonResponse["priority"];
this.reviewedAt = this.parseDate(jsonResponse["reviewed_at"]);
this.availableAt = this.parseDate(jsonResponse["available_at"]);
this.reviewedPrediction = jsonResponse["reviewed_prediction"] ?
new generatedV1Document_1.GeneratedV1Document(jsonResponse["reviewed_prediction"]) : null;
this.status = jsonResponse["status"];
this.type = jsonResponse["type"];
this.uploadedAt = this.parseDate(jsonResponse["uploaded_at"]);
this.workflowId = jsonResponse["workflow_id"];
}
parseDate(dateString) {
if (!dateString)
return null;
return new Date(dateString);
}
}
exports.Execution = Execution;