job_id ?? null; if (isset($job_id)) { return "/_ml/anomaly_detectors/$job_id/results/records"; } throw new RuntimeException('Missing parameter for the endpoint ml.get_records'); } public function getParamWhitelist(): array { return [ 'exclude_interim', 'from', 'size', 'start', 'end', 'record_score', 'sort', 'desc' ]; } public function getMethod(): string { return isset($this->body) ? 'POST' : 'GET'; } public function setBody($body): GetRecords { if (isset($body) !== true) { return $this; } $this->body = $body; return $this; } public function setJobId($job_id): GetRecords { if (isset($job_id) !== true) { return $this; } $this->job_id = $job_id; return $this; } }