Trendsic Platform Service

<back to all web services

EquipmentVehicleStatusRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/Equipment/{EquipmentID}/vehicle/status
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class EquipmentVehicle implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $EquipmentVehicleID=0,
        /** @var int */
        public int $EquipmentID=0,
        /** @var string|null */
        public ?string $UnitNumber=null,
        /** @var string|null */
        public ?string $VehicleType=null,
        /** @var string|null */
        public ?string $CapacityText=null,
        /** @var float|null */
        public ?float $CapacityTons=null,
        /** @var float|null */
        public ?float $DeckFeet=null,
        /** @var string|null */
        public ?string $Plate=null,
        /** @var string|null */
        public ?string $VIN=null,
        /** @var string|null */
        public ?string $GpsUnit=null,
        /** @var DateTime|null */
        public ?DateTime $InsuranceExpires=null,
        /** @var DateTime|null */
        public ?DateTime $InspectionDue=null,
        /** @var string|null */
        public ?string $Capabilities=null,
        /** @var string|null */
        public ?string $VehicleStatus=null,
        /** @var int|null */
        public ?int $VendorID=null,
        /** @var string|null */
        public ?string $EquipmentName=null,
        /** @var string|null */
        public ?string $Ownership=null,
        /** @var string|null */
        public ?string $RentalVendor=null,
        /** @var string|null */
        public ?string $TruckCode=null,
        /** @var string|null */
        public ?string $RigCode=null,
        /** @var string|null */
        public ?string $BoardModule=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EquipmentVehicleID'])) $this->EquipmentVehicleID = $o['EquipmentVehicleID'];
        if (isset($o['EquipmentID'])) $this->EquipmentID = $o['EquipmentID'];
        if (isset($o['UnitNumber'])) $this->UnitNumber = $o['UnitNumber'];
        if (isset($o['VehicleType'])) $this->VehicleType = $o['VehicleType'];
        if (isset($o['CapacityText'])) $this->CapacityText = $o['CapacityText'];
        if (isset($o['CapacityTons'])) $this->CapacityTons = $o['CapacityTons'];
        if (isset($o['DeckFeet'])) $this->DeckFeet = $o['DeckFeet'];
        if (isset($o['Plate'])) $this->Plate = $o['Plate'];
        if (isset($o['VIN'])) $this->VIN = $o['VIN'];
        if (isset($o['GpsUnit'])) $this->GpsUnit = $o['GpsUnit'];
        if (isset($o['InsuranceExpires'])) $this->InsuranceExpires = JsonConverters::from('DateTime', $o['InsuranceExpires']);
        if (isset($o['InspectionDue'])) $this->InspectionDue = JsonConverters::from('DateTime', $o['InspectionDue']);
        if (isset($o['Capabilities'])) $this->Capabilities = $o['Capabilities'];
        if (isset($o['VehicleStatus'])) $this->VehicleStatus = $o['VehicleStatus'];
        if (isset($o['VendorID'])) $this->VendorID = $o['VendorID'];
        if (isset($o['EquipmentName'])) $this->EquipmentName = $o['EquipmentName'];
        if (isset($o['Ownership'])) $this->Ownership = $o['Ownership'];
        if (isset($o['RentalVendor'])) $this->RentalVendor = $o['RentalVendor'];
        if (isset($o['TruckCode'])) $this->TruckCode = $o['TruckCode'];
        if (isset($o['RigCode'])) $this->RigCode = $o['RigCode'];
        if (isset($o['BoardModule'])) $this->BoardModule = $o['BoardModule'];
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EquipmentVehicleID)) $o['EquipmentVehicleID'] = $this->EquipmentVehicleID;
        if (isset($this->EquipmentID)) $o['EquipmentID'] = $this->EquipmentID;
        if (isset($this->UnitNumber)) $o['UnitNumber'] = $this->UnitNumber;
        if (isset($this->VehicleType)) $o['VehicleType'] = $this->VehicleType;
        if (isset($this->CapacityText)) $o['CapacityText'] = $this->CapacityText;
        if (isset($this->CapacityTons)) $o['CapacityTons'] = $this->CapacityTons;
        if (isset($this->DeckFeet)) $o['DeckFeet'] = $this->DeckFeet;
        if (isset($this->Plate)) $o['Plate'] = $this->Plate;
        if (isset($this->VIN)) $o['VIN'] = $this->VIN;
        if (isset($this->GpsUnit)) $o['GpsUnit'] = $this->GpsUnit;
        if (isset($this->InsuranceExpires)) $o['InsuranceExpires'] = JsonConverters::to('DateTime', $this->InsuranceExpires);
        if (isset($this->InspectionDue)) $o['InspectionDue'] = JsonConverters::to('DateTime', $this->InspectionDue);
        if (isset($this->Capabilities)) $o['Capabilities'] = $this->Capabilities;
        if (isset($this->VehicleStatus)) $o['VehicleStatus'] = $this->VehicleStatus;
        if (isset($this->VendorID)) $o['VendorID'] = $this->VendorID;
        if (isset($this->EquipmentName)) $o['EquipmentName'] = $this->EquipmentName;
        if (isset($this->Ownership)) $o['Ownership'] = $this->Ownership;
        if (isset($this->RentalVendor)) $o['RentalVendor'] = $this->RentalVendor;
        if (isset($this->TruckCode)) $o['TruckCode'] = $this->TruckCode;
        if (isset($this->RigCode)) $o['RigCode'] = $this->RigCode;
        if (isset($this->BoardModule)) $o['BoardModule'] = $this->BoardModule;
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentVehicleResponse implements JsonSerializable
{
    public function __construct(
        /** @var EquipmentVehicle|null */
        public ?EquipmentVehicle $Vehicle=null,
        /** @var array<EquipmentVehicle>|null */
        public ?array $Fleet=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Vehicle'])) $this->Vehicle = JsonConverters::from('EquipmentVehicle', $o['Vehicle']);
        if (isset($o['Fleet'])) $this->Fleet = JsonConverters::fromArray('EquipmentVehicle', $o['Fleet']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Vehicle)) $o['Vehicle'] = JsonConverters::to('EquipmentVehicle', $this->Vehicle);
        if (isset($this->Fleet)) $o['Fleet'] = JsonConverters::toArray('EquipmentVehicle', $this->Fleet);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class EquipmentVehicleStatusRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $EquipmentID=0,
        /** @var string|null */
        public ?string $VehicleStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['EquipmentID'])) $this->EquipmentID = $o['EquipmentID'];
        if (isset($o['VehicleStatus'])) $this->VehicleStatus = $o['VehicleStatus'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->EquipmentID)) $o['EquipmentID'] = $this->EquipmentID;
        if (isset($this->VehicleStatus)) $o['VehicleStatus'] = $this->VehicleStatus;
        return empty($o) ? new class(){} : $o;
    }
}

PHP EquipmentVehicleStatusRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/Equipment/{EquipmentID}/vehicle/status HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"EquipmentID":0,"VehicleStatus":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Vehicle":{"EquipmentVehicleID":0,"EquipmentID":0,"UnitNumber":"String","VehicleType":"String","CapacityText":"String","CapacityTons":0,"DeckFeet":0,"Plate":"String","VIN":"String","GpsUnit":"String","InsuranceExpires":"0001-01-01T00:00:00.0000000","InspectionDue":"0001-01-01T00:00:00.0000000","Capabilities":"String","VehicleStatus":"String","VendorID":0,"EquipmentName":"String","Ownership":"String","RentalVendor":"String","TruckCode":"String","RigCode":"String","BoardModule":"String","UpdatedAt":"0001-01-01T00:00:00.0000000"},"Fleet":[{"EquipmentVehicleID":0,"EquipmentID":0,"UnitNumber":"String","VehicleType":"String","CapacityText":"String","CapacityTons":0,"DeckFeet":0,"Plate":"String","VIN":"String","GpsUnit":"String","InsuranceExpires":"0001-01-01T00:00:00.0000000","InspectionDue":"0001-01-01T00:00:00.0000000","Capabilities":"String","VehicleStatus":"String","VendorID":0,"EquipmentName":"String","Ownership":"String","RentalVendor":"String","TruckCode":"String","RigCode":"String","BoardModule":"String","UpdatedAt":"0001-01-01T00:00:00.0000000"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}