From 43e398324dc2156ad4c30c34f34032dbd587ce79 Mon Sep 17 00:00:00 2001 From: aneip Date: Sun, 19 Nov 2023 18:13:54 +0800 Subject: [PATCH] Create Vehicles/Location --- src/One/Vehicles/Location.php | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/One/Vehicles/Location.php diff --git a/src/One/Vehicles/Location.php b/src/One/Vehicles/Location.php new file mode 100644 index 0000000..a1d3714 --- /dev/null +++ b/src/One/Vehicles/Location.php @@ -0,0 +1,45 @@ +requiresAccessToken(); + + return $this->send( + 'GET', "vehicles/{$vehicleId}/location", $this->getApiHeaders(), $this->buildHttpQuery($query) + ); + } + + /** + * Get vehicle location at speficied time. + * + * @param int $vehicleId + * @param string $timestamps + * @param \Katsana\Sdk\Query|null $query + * + * @return \Katsana\Sdk\Response + */ + public function at(int $vehicleId, $timestamps, ?Query $query = null): Response + { + $this->requiresAccessToken(); + + return $this->send( + 'GET', "vehicles/{$vehicleId}/location/at/{$timestamps}", $this->getApiHeaders(), $this->buildHttpQuery($query) + ); + } +}