UNPKG

mindee

Version:

Mindee Client Library for Node.js

29 lines (28 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Execution = void 0; const generatedV1Document_1 = require("../../product/generated/generatedV1Document"); const dateParser_1 = require("./dateParser"); /** * Representation of an execution for a workflow. * @category Workflow */ class Execution { constructor(inferenceClass, jsonResponse) { this.batchName = jsonResponse["batch_name"]; this.createdAt = (0, dateParser_1.parseDate)(jsonResponse["created_at"]); this.file = jsonResponse["file"]; this.id = jsonResponse["id"]; this.inference = jsonResponse["inference"] ? new inferenceClass(jsonResponse["inference"]) : null; this.priority = jsonResponse["priority"]; this.reviewedAt = (0, dateParser_1.parseDate)(jsonResponse["reviewed_at"]); this.availableAt = (0, dateParser_1.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 = (0, dateParser_1.parseDate)(jsonResponse["uploaded_at"]); this.workflowId = jsonResponse["workflow_id"]; } } exports.Execution = Execution;