Skip to content

Commit

Permalink
Create Vehicles/Location
Browse files Browse the repository at this point in the history
  • Loading branch information
aneip authored Nov 19, 2023
1 parent 5dc69a0 commit 43e3983
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/One/Vehicles/Location.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace Katsana\Sdk\One\Vehicles;

use Katsana\Sdk\One\Request;
use Katsana\Sdk\Query;
use Laravie\Codex\Contracts\Response;

class Location extends Request
{
/**
* Get vehicle current location.
*
* @param int $vehicleId
* @param \Katsana\Sdk\Query|null $query
*
* @return \Katsana\Sdk\Response
*/
public function current(int $vehicleId, ?Query $query = null): Response
{
$this->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)
);
}
}

0 comments on commit 43e3983

Please sign in to comment.