@geoapify/route-planner-sdk
Version:
TypeScript SDK for the Geoapify Route Planner API. Supports route optimization, delivery planning, and timeline visualization in browser and Node.js
29 lines (28 loc) • 703 B
JavaScript
import { RouteAction } from "./route-action";
import { AgentSolution } from "./agent-solution";
import { Shipment } from "../input/shipment";
export class ShipmentSolution {
constructor(raw) {
if (raw) {
this.raw = raw;
}
else {
throw new Error("ShipmentSolutionData is undefined");
}
}
getRaw() {
return this.raw;
}
getAgentId() {
return this.raw.agentId;
}
getActions() {
return this.raw.actions.map((action) => new RouteAction(action));
}
getAgent() {
return new AgentSolution(this.raw.agent);
}
getShipment() {
return new Shipment(this.raw.shipment);
}
}