Mercedes.VehicleManagement.API

<back to all web services

SecuredVehicleAuditRequest

SecuredAudit
Requires Authentication
The following routes are available for this service:
GET/v1/SecuredAudit/{identifier}Gets vehicle secured audits for supplied identifierGets vehicle secured audits for supplied identifier
<?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 VehicleAuditDetails implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $userId=null,
        /** @var bool|null */
        public ?bool $status=null,
        /** @var string|null */
        public ?string $notes=null,
        /** @var string|null */
        public ?string $creationDate=null
    ) {
    }

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

class VehicleSecuredAuditDetails extends VehicleAuditDetails implements JsonSerializable
{
    /**
     * @param string|null $userId
     * @param bool|null $status
     * @param string|null $notes
     * @param string|null $creationDate
     */
    public function __construct(
        ?string $userId=null,
        ?bool $status=null,
        ?string $notes=null,
        ?string $creationDate=null,
        /** @var string|null */
        public ?string $vin=null,
        /** @var string|null */
        public ?string $commissionNumber=null,
        /** @var bool|null */
        public ?bool $isBulkUpdate=null
    ) {
        parent::__construct($userId,$status,$notes,$creationDate);
    }

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

class SecuredVehicleAuditResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<VehicleSecuredAuditDetails>|null */
        public ?array $vehicleSecuredAudits=null
    ) {
    }

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

class SecuredVehicleAuditRequest implements IGet, JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $identifier=null
    ) {
    }

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

PHP SecuredVehicleAuditRequest 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.

GET /v1/SecuredAudit/{identifier} HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"vehicleSecuredAudits":[{"vin":"String","commissionNumber":"String","isBulkUpdate":false,"userId":"String","status":false,"notes":"String","creationDate":"String"}]}