Mercedes.Agency.Orchestration.API

<back to all web services

VehicleSwapAgentEnabledAuditRequest

VehicleSwapAgentEnabledAudit
Requires Authentication
The following routes are available for this service:
GET/v1/VehicleSwapAgentEnabledAuditGets Vehicle Swap Agent Enabled Audit entriesThis endpoint is calls same name endpoint in Agency API to get Vehicle Swap Agent Enabled Audit entries.
<?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 VehicleSwapAgentEnabledAuditDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var bool|null */
        public ?bool $IsEnabled=null,
        /** @var string */
        public string $GasUserId='',
        /** @var DateTime */
        public DateTime $CreationDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['IsEnabled'])) $this->IsEnabled = $o['IsEnabled'];
        if (isset($o['GasUserId'])) $this->GasUserId = $o['GasUserId'];
        if (isset($o['CreationDate'])) $this->CreationDate = JsonConverters::from('DateTime', $o['CreationDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->IsEnabled)) $o['IsEnabled'] = $this->IsEnabled;
        if (isset($this->GasUserId)) $o['GasUserId'] = $this->GasUserId;
        if (isset($this->CreationDate)) $o['CreationDate'] = JsonConverters::to('DateTime', $this->CreationDate);
        return empty($o) ? new class(){} : $o;
    }
}

class VehicleSwapAgentEnabledAuditResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<VehicleSwapAgentEnabledAuditDto>|null */
        public ?array $VehicleSwapAgentEnabledAudits=null
    ) {
    }

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

class VehicleSwapAgentEnabledAuditRequest implements IGet, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP VehicleSwapAgentEnabledAuditRequest DTOs

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

HTTP + JSV

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

GET /v1/VehicleSwapAgentEnabledAudit HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	VehicleSwapAgentEnabledAudits: 
	[
		{
			Id: 0,
			Reason: String,
			IsEnabled: False,
			GasUserId: String,
			CreationDate: 0001-01-01
		}
	]
}