Mercedes.Agency.Orchestration.API

<back to all web services

UpdateBackOrderRequest

BackOrder
Requires Authentication
The following routes are available for this service:
PUT/v1/backorder/{Guid}Update Back Order by Guid
<?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 UpdateBackOrderResponse implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

class JsonVersion implements IJsonVersion, JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Version=0
    ) {
    }

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

class CriteriaModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Description='',
        /** @var int */
        public int $Id=0
    ) {
    }

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

class CriteriaDifference implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Model=null,
        /** @var bool|null */
        public ?bool $Transmission=null,
        /** @var bool|null */
        public ?bool $Fuel=null,
        /** @var bool|null */
        public ?bool $Upholstery=null,
        /** @var bool|null */
        public ?bool $Equipment=null,
        /** @var bool|null */
        public ?bool $Line=null,
        /** @var bool|null */
        public ?bool $BodyStyle=null,
        /** @var bool|null */
        public ?bool $ColourGroup=null,
        /** @var bool|null */
        public ?bool $Packages=null,
        /** @var bool|null */
        public ?bool $Engine=null,
        /** @var bool|null */
        public ?bool $AdditionalInformation=null,
        /** @var bool|null */
        public ?bool $UrlReferrer=null,
        /** @var bool|null */
        public ?bool $PreferredDeliveryDate=null,
        /** @var bool|null */
        public ?bool $IsSmart=null,
        /** @var bool|null */
        public ?bool $IsSpecialised=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Model'])) $this->Model = $o['Model'];
        if (isset($o['Transmission'])) $this->Transmission = $o['Transmission'];
        if (isset($o['Fuel'])) $this->Fuel = $o['Fuel'];
        if (isset($o['Upholstery'])) $this->Upholstery = $o['Upholstery'];
        if (isset($o['Equipment'])) $this->Equipment = $o['Equipment'];
        if (isset($o['Line'])) $this->Line = $o['Line'];
        if (isset($o['BodyStyle'])) $this->BodyStyle = $o['BodyStyle'];
        if (isset($o['ColourGroup'])) $this->ColourGroup = $o['ColourGroup'];
        if (isset($o['Packages'])) $this->Packages = $o['Packages'];
        if (isset($o['Engine'])) $this->Engine = $o['Engine'];
        if (isset($o['AdditionalInformation'])) $this->AdditionalInformation = $o['AdditionalInformation'];
        if (isset($o['UrlReferrer'])) $this->UrlReferrer = $o['UrlReferrer'];
        if (isset($o['PreferredDeliveryDate'])) $this->PreferredDeliveryDate = $o['PreferredDeliveryDate'];
        if (isset($o['IsSmart'])) $this->IsSmart = $o['IsSmart'];
        if (isset($o['IsSpecialised'])) $this->IsSpecialised = $o['IsSpecialised'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Model)) $o['Model'] = $this->Model;
        if (isset($this->Transmission)) $o['Transmission'] = $this->Transmission;
        if (isset($this->Fuel)) $o['Fuel'] = $this->Fuel;
        if (isset($this->Upholstery)) $o['Upholstery'] = $this->Upholstery;
        if (isset($this->Equipment)) $o['Equipment'] = $this->Equipment;
        if (isset($this->Line)) $o['Line'] = $this->Line;
        if (isset($this->BodyStyle)) $o['BodyStyle'] = $this->BodyStyle;
        if (isset($this->ColourGroup)) $o['ColourGroup'] = $this->ColourGroup;
        if (isset($this->Packages)) $o['Packages'] = $this->Packages;
        if (isset($this->Engine)) $o['Engine'] = $this->Engine;
        if (isset($this->AdditionalInformation)) $o['AdditionalInformation'] = $this->AdditionalInformation;
        if (isset($this->UrlReferrer)) $o['UrlReferrer'] = $this->UrlReferrer;
        if (isset($this->PreferredDeliveryDate)) $o['PreferredDeliveryDate'] = $this->PreferredDeliveryDate;
        if (isset($this->IsSmart)) $o['IsSmart'] = $this->IsSmart;
        if (isset($this->IsSpecialised)) $o['IsSpecialised'] = $this->IsSpecialised;
        return empty($o) ? new class(){} : $o;
    }
}

class CriteriaBase extends JsonVersion implements JsonSerializable
{
    /**
     * @param int $Version
     */
    public function __construct(
        int $Version=0,
        /** @var string[] */
        public array $Transmission=[],
        /** @var string[] */
        public array $Fuel=[],
        /** @var string[] */
        public array $Upholstery=[],
        /** @var string[] */
        public array $Equipment=[],
        /** @var string[] */
        public array $Line=[],
        /** @var string[] */
        public array $BodyStyle=[],
        /** @var string[] */
        public array $ColourGroup=[],
        /** @var string[] */
        public array $Packages=[],
        /** @var array<CriteriaModel>|null */
        public ?array $Model=null,
        /** @var string */
        public string $UrlReferrer='',
        /** @var string */
        public string $PreferredDeliveryDate='',
        // @ApiMember(ExcludeInSchema=true)
        /** @var bool|null */
        public ?bool $IsNewModel=null,

        // @ApiMember(ExcludeInSchema=true)
        /** @var bool|null */
        public ?bool $IsSmart=null,

        // @ApiMember(ExcludeInSchema=true)
        /** @var bool|null */
        public ?bool $IsSpecialised=null,

        // @ApiMember(ExcludeInSchema=true)
        /** @var CriteriaDifference|null */
        public ?CriteriaDifference $CriteriaDifference=null
    ) {
        parent::__construct($Version);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Transmission'])) $this->Transmission = JsonConverters::fromArray('string', $o['Transmission']);
        if (isset($o['Fuel'])) $this->Fuel = JsonConverters::fromArray('string', $o['Fuel']);
        if (isset($o['Upholstery'])) $this->Upholstery = JsonConverters::fromArray('string', $o['Upholstery']);
        if (isset($o['Equipment'])) $this->Equipment = JsonConverters::fromArray('string', $o['Equipment']);
        if (isset($o['Line'])) $this->Line = JsonConverters::fromArray('string', $o['Line']);
        if (isset($o['BodyStyle'])) $this->BodyStyle = JsonConverters::fromArray('string', $o['BodyStyle']);
        if (isset($o['ColourGroup'])) $this->ColourGroup = JsonConverters::fromArray('string', $o['ColourGroup']);
        if (isset($o['Packages'])) $this->Packages = JsonConverters::fromArray('string', $o['Packages']);
        if (isset($o['Model'])) $this->Model = JsonConverters::fromArray('CriteriaModel', $o['Model']);
        if (isset($o['UrlReferrer'])) $this->UrlReferrer = $o['UrlReferrer'];
        if (isset($o['PreferredDeliveryDate'])) $this->PreferredDeliveryDate = $o['PreferredDeliveryDate'];
        if (isset($o['IsNewModel'])) $this->IsNewModel = $o['IsNewModel'];
        if (isset($o['IsSmart'])) $this->IsSmart = $o['IsSmart'];
        if (isset($o['IsSpecialised'])) $this->IsSpecialised = $o['IsSpecialised'];
        if (isset($o['CriteriaDifference'])) $this->CriteriaDifference = JsonConverters::from('CriteriaDifference', $o['CriteriaDifference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Transmission)) $o['Transmission'] = JsonConverters::toArray('string', $this->Transmission);
        if (isset($this->Fuel)) $o['Fuel'] = JsonConverters::toArray('string', $this->Fuel);
        if (isset($this->Upholstery)) $o['Upholstery'] = JsonConverters::toArray('string', $this->Upholstery);
        if (isset($this->Equipment)) $o['Equipment'] = JsonConverters::toArray('string', $this->Equipment);
        if (isset($this->Line)) $o['Line'] = JsonConverters::toArray('string', $this->Line);
        if (isset($this->BodyStyle)) $o['BodyStyle'] = JsonConverters::toArray('string', $this->BodyStyle);
        if (isset($this->ColourGroup)) $o['ColourGroup'] = JsonConverters::toArray('string', $this->ColourGroup);
        if (isset($this->Packages)) $o['Packages'] = JsonConverters::toArray('string', $this->Packages);
        if (isset($this->Model)) $o['Model'] = JsonConverters::toArray('CriteriaModel', $this->Model);
        if (isset($this->UrlReferrer)) $o['UrlReferrer'] = $this->UrlReferrer;
        if (isset($this->PreferredDeliveryDate)) $o['PreferredDeliveryDate'] = $this->PreferredDeliveryDate;
        if (isset($this->IsNewModel)) $o['IsNewModel'] = $this->IsNewModel;
        if (isset($this->IsSmart)) $o['IsSmart'] = $this->IsSmart;
        if (isset($this->IsSpecialised)) $o['IsSpecialised'] = $this->IsSpecialised;
        if (isset($this->CriteriaDifference)) $o['CriteriaDifference'] = JsonConverters::to('CriteriaDifference', $this->CriteriaDifference);
        return empty($o) ? new class(){} : $o;
    }
}

class V2EngineCriteria implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Badge='',
        /** @var string */
        public string $Brand=''
    ) {
    }

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

class V2Criteria extends CriteriaBase implements JsonSerializable
{
    /**
     * @param int $Version
     * @param string[] $Transmission
     * @param string[] $Fuel
     * @param string[] $Upholstery
     * @param string[] $Equipment
     * @param string[] $Line
     * @param string[] $BodyStyle
     * @param string[] $ColourGroup
     * @param string[] $Packages
     * @param array<CriteriaModel>|null $Model
     * @param string $UrlReferrer
     * @param string $PreferredDeliveryDate
     * @param bool|null $IsNewModel
     * @param bool|null $IsSmart
     * @param bool|null $IsSpecialised
     * @param CriteriaDifference|null $CriteriaDifference
     */
    public function __construct(
        int $Version=0,
        array $Transmission=[],
        array $Fuel=[],
        array $Upholstery=[],
        array $Equipment=[],
        array $Line=[],
        array $BodyStyle=[],
        array $ColourGroup=[],
        array $Packages=[],
        ?array $Model=null,
        string $UrlReferrer='',
        string $PreferredDeliveryDate='',
        ?bool $IsNewModel=null,
        ?bool $IsSmart=null,
        ?bool $IsSpecialised=null,
        ?CriteriaDifference $CriteriaDifference=null,
        /** @var array<V2EngineCriteria>|null */
        public ?array $Engine=null
    ) {
        parent::__construct($Version,$Transmission,$Fuel,$Upholstery,$Equipment,$Line,$BodyStyle,$ColourGroup,$Packages,$Model,$UrlReferrer,$PreferredDeliveryDate,$IsNewModel,$IsSmart,$IsSpecialised,$CriteriaDifference);
    }

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

class UpdateBackOrderRequest implements IPut, JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Guid='',
        /** @var V2Criteria|null */
        public ?V2Criteria $AgentCriteria=null,
        /** @var string */
        public string $AdditionalInformation='',
        /** @var string */
        public string $ConfigCode='',
        /** @var int|null */
        public ?int $MotabilityPricingId=null,
        /** @var int|null */
        public ?int $AssistanceProviderId=null,
        /** @var string|null */
        public ?string $AssistanceDetail=null,
        /** @var bool|null */
        public ?bool $IsCOPConverter=null,
        /** @var string|null */
        public ?string $ConfiguratorCode=null,
        /** @var bool|null */
        public ?bool $IsOneAdminUpdate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['AgentCriteria'])) $this->AgentCriteria = JsonConverters::from('V2Criteria', $o['AgentCriteria']);
        if (isset($o['AdditionalInformation'])) $this->AdditionalInformation = $o['AdditionalInformation'];
        if (isset($o['ConfigCode'])) $this->ConfigCode = $o['ConfigCode'];
        if (isset($o['MotabilityPricingId'])) $this->MotabilityPricingId = $o['MotabilityPricingId'];
        if (isset($o['AssistanceProviderId'])) $this->AssistanceProviderId = $o['AssistanceProviderId'];
        if (isset($o['AssistanceDetail'])) $this->AssistanceDetail = $o['AssistanceDetail'];
        if (isset($o['IsCOPConverter'])) $this->IsCOPConverter = $o['IsCOPConverter'];
        if (isset($o['ConfiguratorCode'])) $this->ConfiguratorCode = $o['ConfiguratorCode'];
        if (isset($o['IsOneAdminUpdate'])) $this->IsOneAdminUpdate = $o['IsOneAdminUpdate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->AgentCriteria)) $o['AgentCriteria'] = JsonConverters::to('V2Criteria', $this->AgentCriteria);
        if (isset($this->AdditionalInformation)) $o['AdditionalInformation'] = $this->AdditionalInformation;
        if (isset($this->ConfigCode)) $o['ConfigCode'] = $this->ConfigCode;
        if (isset($this->MotabilityPricingId)) $o['MotabilityPricingId'] = $this->MotabilityPricingId;
        if (isset($this->AssistanceProviderId)) $o['AssistanceProviderId'] = $this->AssistanceProviderId;
        if (isset($this->AssistanceDetail)) $o['AssistanceDetail'] = $this->AssistanceDetail;
        if (isset($this->IsCOPConverter)) $o['IsCOPConverter'] = $this->IsCOPConverter;
        if (isset($this->ConfiguratorCode)) $o['ConfiguratorCode'] = $this->ConfiguratorCode;
        if (isset($this->IsOneAdminUpdate)) $o['IsOneAdminUpdate'] = $this->IsOneAdminUpdate;
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateBackOrderRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

PUT /v1/backorder/{Guid} HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Guid":"00000000000000000000000000000000","AgentCriteria":{"Engine":[{"Badge":"String","Brand":"String"}],"Transmission":["String"],"Fuel":["String"],"Upholstery":["String"],"Equipment":["String"],"Line":["String"],"BodyStyle":["String"],"ColourGroup":["String"],"Packages":["String"],"Model":[{"Description":"String","Id":0}],"UrlReferrer":"String","PreferredDeliveryDate":"String","IsNewModel":false,"IsSmart":false,"IsSpecialised":false,"CriteriaDifference":{"Model":false,"Transmission":false,"Fuel":false,"Upholstery":false,"Equipment":false,"Line":false,"BodyStyle":false,"ColourGroup":false,"Packages":false,"Engine":false,"AdditionalInformation":false,"UrlReferrer":false,"PreferredDeliveryDate":false,"IsSmart":false,"IsSpecialised":false},"Version":0},"AdditionalInformation":"String","ConfigCode":"String","MotabilityPricingId":0,"AssistanceProviderId":0,"AssistanceDetail":"String","IsCOPConverter":false,"ConfiguratorCode":"String","IsOneAdminUpdate":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}