POST | /v1/backorder | Create Back Order (Online Showroom) |
---|
<?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};
enum Source : int
{
case OnlineShowroom = 1;
case OneAdmin = 2;
}
class Address implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Property='',
/** @var string */
public string $Street='',
/** @var string */
public string $Town='',
/** @var string */
public string $County='',
/** @var string */
public string $Locality='',
/** @var string */
public string $Postcode=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Property'])) $this->Property = $o['Property'];
if (isset($o['Street'])) $this->Street = $o['Street'];
if (isset($o['Town'])) $this->Town = $o['Town'];
if (isset($o['County'])) $this->County = $o['County'];
if (isset($o['Locality'])) $this->Locality = $o['Locality'];
if (isset($o['Postcode'])) $this->Postcode = $o['Postcode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Property)) $o['Property'] = $this->Property;
if (isset($this->Street)) $o['Street'] = $this->Street;
if (isset($this->Town)) $o['Town'] = $this->Town;
if (isset($this->County)) $o['County'] = $this->County;
if (isset($this->Locality)) $o['Locality'] = $this->Locality;
if (isset($this->Postcode)) $o['Postcode'] = $this->Postcode;
return empty($o) ? new class(){} : $o;
}
}
enum CustomerMode : int
{
case Private = 1;
case Business = 2;
case Motability = 3;
}
class SalesforceCustomer implements ICustomer, JsonSerializable
{
public function __construct(
/** @var string */
public string $CustomerId='',
/** @var bool|null */
public ?bool $IsCiam=null,
/** @var string */
public string $CompanyName='',
/** @var string */
public string $Title='',
/** @var string */
public string $Firstname='',
/** @var string */
public string $Surname='',
/** @var string */
public string $EmailAddress='',
/** @var string */
public string $Telephone='',
/** @var Address|null */
public ?Address $Address=null,
/** @var CustomerMode|null */
public ?CustomerMode $Mode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
if (isset($o['IsCiam'])) $this->IsCiam = $o['IsCiam'];
if (isset($o['CompanyName'])) $this->CompanyName = $o['CompanyName'];
if (isset($o['Title'])) $this->Title = $o['Title'];
if (isset($o['Firstname'])) $this->Firstname = $o['Firstname'];
if (isset($o['Surname'])) $this->Surname = $o['Surname'];
if (isset($o['EmailAddress'])) $this->EmailAddress = $o['EmailAddress'];
if (isset($o['Telephone'])) $this->Telephone = $o['Telephone'];
if (isset($o['Address'])) $this->Address = JsonConverters::from('Address', $o['Address']);
if (isset($o['Mode'])) $this->Mode = JsonConverters::from('CustomerMode', $o['Mode']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
if (isset($this->IsCiam)) $o['IsCiam'] = $this->IsCiam;
if (isset($this->CompanyName)) $o['CompanyName'] = $this->CompanyName;
if (isset($this->Title)) $o['Title'] = $this->Title;
if (isset($this->Firstname)) $o['Firstname'] = $this->Firstname;
if (isset($this->Surname)) $o['Surname'] = $this->Surname;
if (isset($this->EmailAddress)) $o['EmailAddress'] = $this->EmailAddress;
if (isset($this->Telephone)) $o['Telephone'] = $this->Telephone;
if (isset($this->Address)) $o['Address'] = JsonConverters::to('Address', $this->Address);
if (isset($this->Mode)) $o['Mode'] = JsonConverters::to('CustomerMode', $this->Mode);
return empty($o) ? new class(){} : $o;
}
}
class Preferences implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $OptinEmail=null,
/** @var bool|null */
public ?bool $OptinPost=null,
/** @var bool|null */
public ?bool $OptinSMS=null,
/** @var bool|null */
public ?bool $OptinTelephone=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['OptinEmail'])) $this->OptinEmail = $o['OptinEmail'];
if (isset($o['OptinPost'])) $this->OptinPost = $o['OptinPost'];
if (isset($o['OptinSMS'])) $this->OptinSMS = $o['OptinSMS'];
if (isset($o['OptinTelephone'])) $this->OptinTelephone = $o['OptinTelephone'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->OptinEmail)) $o['OptinEmail'] = $this->OptinEmail;
if (isset($this->OptinPost)) $o['OptinPost'] = $this->OptinPost;
if (isset($this->OptinSMS)) $o['OptinSMS'] = $this->OptinSMS;
if (isset($this->OptinTelephone)) $o['OptinTelephone'] = $this->OptinTelephone;
return empty($o) ? new class(){} : $o;
}
}
class Customer extends SalesforceCustomer implements JsonSerializable
{
/**
* @param string $CustomerId
* @param bool|null $IsCiam
* @param string $CompanyName
* @param string $Title
* @param string $Firstname
* @param string $Surname
* @param string $EmailAddress
* @param string $Telephone
* @param Address|null $Address
* @param CustomerMode|null $Mode
*/
public function __construct(
string $CustomerId='',
?bool $IsCiam=null,
string $CompanyName='',
string $Title='',
string $Firstname='',
string $Surname='',
string $EmailAddress='',
string $Telephone='',
?Address $Address=null,
?CustomerMode $Mode=null,
/** @var string|null */
public ?string $ProfileId=null,
/** @var Preferences|null */
public ?Preferences $Preferences=null
) {
parent::__construct($CustomerId,$IsCiam,$CompanyName,$Title,$Firstname,$Surname,$EmailAddress,$Telephone,$Address,$Mode);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ProfileId'])) $this->ProfileId = $o['ProfileId'];
if (isset($o['Preferences'])) $this->Preferences = JsonConverters::from('Preferences', $o['Preferences']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ProfileId)) $o['ProfileId'] = $this->ProfileId;
if (isset($this->Preferences)) $o['Preferences'] = JsonConverters::to('Preferences', $this->Preferences);
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 Criteria 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 string[] */
public array $Engine=[]
) {
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('string', $o['Engine']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Engine)) $o['Engine'] = JsonConverters::toArray('string', $this->Engine);
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 OutrightPurchase implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $IsOutrightPurchase=null,
/** @var string */
public string $Reference='',
/** @var float */
public float $DiscountRate=0.0,
/** @var string */
public string $Bm7NST='',
/** @var bool|null */
public ?bool $IsBackOrder=null,
/** @var bool|null */
public ?bool $IsCOPConverter=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['IsOutrightPurchase'])) $this->IsOutrightPurchase = $o['IsOutrightPurchase'];
if (isset($o['Reference'])) $this->Reference = $o['Reference'];
if (isset($o['DiscountRate'])) $this->DiscountRate = $o['DiscountRate'];
if (isset($o['Bm7NST'])) $this->Bm7NST = $o['Bm7NST'];
if (isset($o['IsBackOrder'])) $this->IsBackOrder = $o['IsBackOrder'];
if (isset($o['IsCOPConverter'])) $this->IsCOPConverter = $o['IsCOPConverter'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->IsOutrightPurchase)) $o['IsOutrightPurchase'] = $this->IsOutrightPurchase;
if (isset($this->Reference)) $o['Reference'] = $this->Reference;
if (isset($this->DiscountRate)) $o['DiscountRate'] = $this->DiscountRate;
if (isset($this->Bm7NST)) $o['Bm7NST'] = $this->Bm7NST;
if (isset($this->IsBackOrder)) $o['IsBackOrder'] = $this->IsBackOrder;
if (isset($this->IsCOPConverter)) $o['IsCOPConverter'] = $this->IsCOPConverter;
return empty($o) ? new class(){} : $o;
}
}
class CreateBackOrderBase implements JsonSerializable
{
public function __construct(
/** @var string */
public string $GssnId='',
/** @var string */
public string $AdditionalInformation='',
/** @var string */
public string $ConfigCode='',
/** @var Source|null */
public ?Source $Source=null,
/** @var string */
public string $TagUrl='',
/** @var Customer|null */
public ?Customer $Customer=null,
/** @var Criteria|null */
public ?Criteria $CustomerCriteria=null,
/** @var V2Criteria|null */
public ?V2Criteria $AgentCriteria=null,
/** @var OutrightPurchase|null */
public ?OutrightPurchase $OutrightPurchase=null,
/** @var string */
public string $GasId='',
/** @var bool|null */
public ?bool $Motability=null,
/** @var int|null */
public ?int $MotabilityPricingId=null,
/** @var int|null */
public ?int $AssistanceProviderId=null,
/** @var string|null */
public ?string $AssistanceDetail=null,
/** @var string|null */
public ?string $ConfiguratorCode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['GssnId'])) $this->GssnId = $o['GssnId'];
if (isset($o['AdditionalInformation'])) $this->AdditionalInformation = $o['AdditionalInformation'];
if (isset($o['ConfigCode'])) $this->ConfigCode = $o['ConfigCode'];
if (isset($o['Source'])) $this->Source = JsonConverters::from('Source', $o['Source']);
if (isset($o['TagUrl'])) $this->TagUrl = $o['TagUrl'];
if (isset($o['Customer'])) $this->Customer = JsonConverters::from('Customer', $o['Customer']);
if (isset($o['CustomerCriteria'])) $this->CustomerCriteria = JsonConverters::from('Criteria', $o['CustomerCriteria']);
if (isset($o['AgentCriteria'])) $this->AgentCriteria = JsonConverters::from('V2Criteria', $o['AgentCriteria']);
if (isset($o['OutrightPurchase'])) $this->OutrightPurchase = JsonConverters::from('OutrightPurchase', $o['OutrightPurchase']);
if (isset($o['GasId'])) $this->GasId = $o['GasId'];
if (isset($o['Motability'])) $this->Motability = $o['Motability'];
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['ConfiguratorCode'])) $this->ConfiguratorCode = $o['ConfiguratorCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->GssnId)) $o['GssnId'] = $this->GssnId;
if (isset($this->AdditionalInformation)) $o['AdditionalInformation'] = $this->AdditionalInformation;
if (isset($this->ConfigCode)) $o['ConfigCode'] = $this->ConfigCode;
if (isset($this->Source)) $o['Source'] = JsonConverters::to('Source', $this->Source);
if (isset($this->TagUrl)) $o['TagUrl'] = $this->TagUrl;
if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('Customer', $this->Customer);
if (isset($this->CustomerCriteria)) $o['CustomerCriteria'] = JsonConverters::to('Criteria', $this->CustomerCriteria);
if (isset($this->AgentCriteria)) $o['AgentCriteria'] = JsonConverters::to('V2Criteria', $this->AgentCriteria);
if (isset($this->OutrightPurchase)) $o['OutrightPurchase'] = JsonConverters::to('OutrightPurchase', $this->OutrightPurchase);
if (isset($this->GasId)) $o['GasId'] = $this->GasId;
if (isset($this->Motability)) $o['Motability'] = $this->Motability;
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->ConfiguratorCode)) $o['ConfiguratorCode'] = $this->ConfiguratorCode;
return empty($o) ? new class(){} : $o;
}
}
class CreateBackOrderResponse implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Guid='',
/** @var string */
public string $Reference=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Reference'])) $this->Reference = $o['Reference'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Reference)) $o['Reference'] = $this->Reference;
return empty($o) ? new class(){} : $o;
}
}
class CreateBackOrderRequest extends CreateBackOrderBase implements IPost, JsonSerializable
{
/**
* @param string $GssnId
* @param string $AdditionalInformation
* @param string $ConfigCode
* @param Source|null $Source
* @param string $TagUrl
* @param Customer|null $Customer
* @param Criteria|null $CustomerCriteria
* @param V2Criteria|null $AgentCriteria
* @param OutrightPurchase|null $OutrightPurchase
* @param string $GasId
* @param bool|null $Motability
* @param int|null $MotabilityPricingId
* @param int|null $AssistanceProviderId
* @param string|null $AssistanceDetail
* @param string|null $ConfiguratorCode
*/
public function __construct(
string $GssnId='',
string $AdditionalInformation='',
string $ConfigCode='',
?Source $Source=null,
string $TagUrl='',
?Customer $Customer=null,
?Criteria $CustomerCriteria=null,
?V2Criteria $AgentCriteria=null,
?OutrightPurchase $OutrightPurchase=null,
string $GasId='',
?bool $Motability=null,
?int $MotabilityPricingId=null,
?int $AssistanceProviderId=null,
?string $AssistanceDetail=null,
?string $ConfiguratorCode=null
) {
parent::__construct($GssnId,$AdditionalInformation,$ConfigCode,$Source,$TagUrl,$Customer,$CustomerCriteria,$AgentCriteria,$OutrightPurchase,$GasId,$Motability,$MotabilityPricingId,$AssistanceProviderId,$AssistanceDetail,$ConfiguratorCode);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
PHP CreateBackOrderRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/backorder HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
GssnId: String,
AdditionalInformation: String,
ConfigCode: String,
Source: OnlineShowroom,
TagUrl: String,
Customer:
{
ProfileId: 00000000000000000000000000000000,
Preferences:
{
OptinEmail: False,
OptinPost: False,
OptinSMS: False,
OptinTelephone: False
},
CustomerId: String,
IsCiam: False,
CompanyName: String,
Title: String,
Firstname: String,
Surname: String,
EmailAddress: String,
Telephone: String,
Address:
{
Property: String,
Street: String,
Town: String,
County: String,
Locality: String,
Postcode: String
},
Mode: Private
},
CustomerCriteria:
{
Engine:
[
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
},
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
},
OutrightPurchase:
{
IsOutrightPurchase: False,
Reference: String,
DiscountRate: 0,
Bm7NST: String,
IsBackOrder: False,
IsCOPConverter: False
},
GasId: String,
Motability: False,
MotabilityPricingId: 0,
AssistanceProviderId: 0,
AssistanceDetail: String,
ConfiguratorCode: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Guid: String, Reference: String }