Mercedes.VehicleManagement.API

<back to all web services

SecuredStatusRequest

Vehicle
Requires Authentication
The following routes are available for this service:
POST/v1/Vehicle/SecuredStatusSet secured status for vehicle
<?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 ValidateVehicleResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $comm='',
        /** @var string|null */
        public ?string $failureReason=null,
        /** @var int|null */
        public ?int $failureReasonId=null
    ) {
    }

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

class ValidateSecuredStatusResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<ValidateVehicleResponse>|null */
        public ?array $validateVehicleResponses=null
    ) {
    }

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

class SecuredStatusRequest implements IPost, JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $commissionNumber='',
        /** @var string */
        public string $vehicleType='',
        /** @var string */
        public string $reason='',
        /** @var bool|null */
        public ?bool $secured=null
    ) {
    }

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

PHP SecuredStatusRequest 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/Vehicle/SecuredStatus HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"commissionNumber":"String","vehicleType":"String","reason":"String","secured":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'ValidateSecuredStatusResponse' using the custom 'other' filter}Cannot dynamically create an instance of type 'Mercedes.DataProcess.Shared.ValidateSecuredStatusResponse'. Reason: No parameterless constructor defined.