Skip to content

Commit

Permalink
Trip functional tests (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymitr committed Apr 11, 2017
1 parent 0a0716a commit 0828bc9
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 6 deletions.
34 changes: 34 additions & 0 deletions lib/Models/AmbientAirTemperature.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

/**
* AmbientAirTemperature Model
*
* @method float getTemperatureInCelsius()
* @method \DateTime getRecordTimeStamp()
*
* @method AmbientAirTemperature setTemperatureInCelsius(float $rpm)
*/
class AmbientAirTemperature extends ModelAbstract
{
Expand All @@ -13,4 +18,33 @@ class AmbientAirTemperature extends ModelAbstract
"RecordTimeStamp"
];

/**
* @param string|\DateTime $date
* @return AmbientAirTemperature
*/
public function setRecordTimeStamp($date)
{
if (!$date instanceof \DateTime) {
$date = new \DateTime($date, new \DateTimeZone('UTC'));
}
$this->_properties['RecordTimeStamp'] = $date;

return $this;
}

/**
* convert the model to an array
* @return array
*/
public function toArray()
{
$values = parent::toArray();

if (!empty($values['RecordTimeStamp'])) {
$values['RecordTimeStamp'] = $values['RecordTimeStamp']->format('c');
}

return $values;
}

}
75 changes: 75 additions & 0 deletions lib/Models/Trip.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,86 @@

namespace Automile\Sdk\Models;

use Automile\Sdk\Types\TripType;

/**
* Trip Model
*
* @see TripType
*
* @method int getTripId()
* @method string getIMEI()
* @method string getTripStartDateTime()
* @method int getTripStartTimeZone()
* @method int getTripStartODOMeter()
* @method int getTripNumber()
* @method string getNumberOfSupportedPIDs()
* @method string getVehicleIdentificationNumber()
* @method string getVechicleProtocol()
* @method string getTripEndDateTime()
* @method int getTripEndTimeZone()
* @method int getTripEndODOMeter()
* @method string getTripStartFormattedAddress()
* @method string getTripEndFormattedAddress()
* @method string getTripStartCustomAddress()
* @method string getTripEndCustomAddress()
* @method int getTripType()
* @method string|array getTripTags()
* @method int getVehicleId()
* @method float getFuelInLiters()
* @method float getTripLengthInKilometers()
* @method int getTripLengthInMinutes()
* @method int getIdleTimeInSecondsAllTrip()
* @method int getIdleTimeInSecondsFromStart()
* @method int getIdleRPMMax()
* @method string getMaxSpeed()
* @method int getMaxRPM()
* @method float getCO2EmissionInGrams()
* @method float getOdometerInKilometersAfterTripEnded()
* @method float getAverageSpeedInKilometersPerHour()
* @method float getTripStartOutsideTemperatureInCelsius()
* @method int getDriverContactId()
* @method bool getHasDrivingEvents()
* @method string getCustomCategory()
* @method bool getHideStartRoute()
* @method bool getHideEndRoute()
*
* @method int setTripId(int $tripId)
* @method string setIMEI(string $imei)
* @method string setTripStartDateTime(string $dateTime)
* @method int setTripStartTimeZone(int $timeZone)
* @method int setTripStartODOMeter(int $odometer)
* @method int setTripNumber(int $tripNumber)
* @method string setNumberOfSupportedPIDs(string $pid)
* @method string setVehicleIdentificationNumber(string $vin)
* @method string setVechicleProtocol(string $protocol)
* @method string setTripEndDateTime(string $dateTime)
* @method int setTripEndTimeZone(int $timeZone)
* @method int setTripEndODOMeter(int $odometer)
* @method string setTripStartFormattedAddress(string $address)
* @method string setTripEndFormattedAddress(string $address)
* @method string setTripStartCustomAddress(string $address)
* @method string setTripEndCustomAddress(string $address)
* @method int setTripType(int $tripType)
* @method string|array setTripTags(string $tags)
* @method int setVehicleId(int $vehicleId)
* @method float setFuelInLiters(float $liters)
* @method float setTripLengthInKilometers(float $kilometers)
* @method int setTripLengthInMinutes(int $minutes)
* @method int setIdleTimeInSecondsAllTrip(int $seconds)
* @method int setIdleTimeInSecondsFromStart(int $seconds)
* @method int setIdleRPMMax(int $rpm)
* @method string setMaxSpeed(string $speed)
* @method int setMaxRPM(int $rpm)
* @method float setCO2EmissionInGrams(float $grams)
* @method float setOdometerInKilometersAfterTripEnded(float $kilometers)
* @method float setAverageSpeedInKilometersPerHour(float $kilometers)
* @method float setTripStartOutsideTemperatureInCelsius(float $temperature)
* @method int setDriverContactId(int $contactId)
* @method bool setHasDrivingEvents(bool $events)
* @method string setCustomCategory(string $category)
* @method bool setHideStartRoute(bool $hide)
* @method bool setHideEndRoute(bool $hide)
*/
class Trip extends ModelAbstract
{
Expand Down
42 changes: 42 additions & 0 deletions lib/Models/TripGeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@

/**
* TripGeo Model
*
* @method \DateTime getRecordTimeStamp()
* @method float getLatitude()
* @method float getLongitude()
* @method int getHeadingDegrees()
* @method int getNumberOfSatellites()
* @method int getHDOP()
*
* @method TripGeo setLatitude(float $lat)
* @method TripGeo setLongitude(float $lng)
* @method TripGeo setHeadingDegrees(int $degrees)
* @method TripGeo setNumberOfSatellites(int $satellites)
* @method TripGeo setHDOP(int $hdop)
*/
class TripGeo extends ModelAbstract
{
Expand All @@ -17,4 +30,33 @@ class TripGeo extends ModelAbstract
"HDOP"
];

/**
* @param string|\DateTime $date
* @return TripGeo
*/
public function setRecordTimeStamp($date)
{
if (!$date instanceof \DateTime) {
$date = new \DateTime($date, new \DateTimeZone('UTC'));
}
$this->_properties['RecordTimeStamp'] = $date;

return $this;
}

/**
* convert the model to an array
* @return array
*/
public function toArray()
{
$values = parent::toArray();

if (!empty($values['RecordTimeStamp'])) {
$values['RecordTimeStamp'] = $values['RecordTimeStamp']->format('c');
}

return $values;
}

}
32 changes: 30 additions & 2 deletions lib/Models/Vehicle/EngineCoolantTemperature.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
* VehicleEngineCoolantTemperature Model
*
* @method float getTemperatureInCelsius()
* @method string getRecordTimeStamp()
* @method \DateTime getRecordTimeStamp()
*
* @method EngineCoolantTemperature setTemperatureInCelsius(float $temperature)
* @method EngineCoolantTemperature setRecordTimeStamp(string $timeStamp)
*/
class EngineCoolantTemperature extends ModelAbstract
{
Expand All @@ -21,4 +20,33 @@ class EngineCoolantTemperature extends ModelAbstract
"RecordTimeStamp"
];

/**
* @param string|\DateTime $date
* @return EngineCoolantTemperature
*/
public function setRecordTimeStamp($date)
{
if (!$date instanceof \DateTime) {
$date = new \DateTime($date, new \DateTimeZone('UTC'));
}
$this->_properties['RecordTimeStamp'] = $date;

return $this;
}

/**
* convert the model to an array
* @return array
*/
public function toArray()
{
$values = parent::toArray();

if (!empty($values['RecordTimeStamp'])) {
$values['RecordTimeStamp'] = $values['RecordTimeStamp']->format('c');
}

return $values;
}

}
32 changes: 30 additions & 2 deletions lib/Models/Vehicle/FuelLevelInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
* VehicleFuelLevelInput Model
*
* @method float getFuelLevelInPercentage()
* @method string getRecordTimeStamp()
* @method \DateTime getRecordTimeStamp()
*
* @method FuelLevelInput setFuelLevelInPercentage(float $fuelLevel)
* @method FuelLevelInput setRecordTimeStamp(string $timeStamp)
*/
class FuelLevelInput extends ModelAbstract
{
Expand All @@ -21,4 +20,33 @@ class FuelLevelInput extends ModelAbstract
"RecordTimeStamp"
];

/**
* @param string|\DateTime $date
* @return FuelLevelInput
*/
public function setRecordTimeStamp($date)
{
if (!$date instanceof \DateTime) {
$date = new \DateTime($date, new \DateTimeZone('UTC'));
}
$this->_properties['RecordTimeStamp'] = $date;

return $this;
}

/**
* convert the model to an array
* @return array
*/
public function toArray()
{
$values = parent::toArray();

if (!empty($values['RecordTimeStamp'])) {
$values['RecordTimeStamp'] = $values['RecordTimeStamp']->format('c');
}

return $values;
}

}
Loading

0 comments on commit 0828bc9

Please sign in to comment.