import {SpatialExtent} from "./SpatialExtent"; import {TemporalExtent} from "./TemporalExtent"; import {validateRequiredFields} from "./Helpers"; export class Extent { spatial!: SpatialExtent; temporal?: TemporalExtent; static fromJson(jsonObj: any): Extent { validateRequiredFields(jsonObj, ["spatial"], Extent.name); const extent = new Extent(); extent.spatial = SpatialExtent.fromJson(jsonObj["spatial"]); if (jsonObj.hasOwnProperty("temporal")) extent.temporal = TemporalExtent.fromJson(jsonObj["temporal"]); return extent; } }