| PUT | /v1/configurator | Removes a back order from a car configurator | This endpoint calls Agency API when a ConfigurationCode is removed from a back order. |
|---|
<?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 KeyInformation implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $BM7NST=null,
/** @var string|null */
public ?string $ConfigurationDate=null,
/** @var string|null */
public ?string $ModelYear=null,
/** @var string|null */
public ?string $HalfYear=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BM7NST'])) $this->BM7NST = $o['BM7NST'];
if (isset($o['ConfigurationDate'])) $this->ConfigurationDate = $o['ConfigurationDate'];
if (isset($o['ModelYear'])) $this->ModelYear = $o['ModelYear'];
if (isset($o['HalfYear'])) $this->HalfYear = $o['HalfYear'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BM7NST)) $o['BM7NST'] = $this->BM7NST;
if (isset($this->ConfigurationDate)) $o['ConfigurationDate'] = $this->ConfigurationDate;
if (isset($this->ModelYear)) $o['ModelYear'] = $this->ModelYear;
if (isset($this->HalfYear)) $o['HalfYear'] = $this->HalfYear;
return empty($o) ? new class(){} : $o;
}
}
class EquipmentCache implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Code='',
/** @var string */
public string $Description='',
/** @var string */
public string $StandardFlag='',
/** @var float */
public float $Price=0.0,
/** @var string */
public string $Category='',
/** @var string */
public string $Importance=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['StandardFlag'])) $this->StandardFlag = $o['StandardFlag'];
if (isset($o['Price'])) $this->Price = $o['Price'];
if (isset($o['Category'])) $this->Category = $o['Category'];
if (isset($o['Importance'])) $this->Importance = $o['Importance'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->StandardFlag)) $o['StandardFlag'] = $this->StandardFlag;
if (isset($this->Price)) $o['Price'] = $this->Price;
if (isset($this->Category)) $o['Category'] = $this->Category;
if (isset($this->Importance)) $o['Importance'] = $this->Importance;
return empty($o) ? new class(){} : $o;
}
}
class OrderingOptions implements JsonSerializable
{
public function __construct(
/** @var array<string>|null */
public ?array $Interior=null,
/** @var array<string>|null */
public ?array $Exterior=null,
/** @var array<string>|null */
public ?array $Options=null,
/** @var array<EquipmentCache>|null */
public ?array $WheelOptions=null,
/** @var array<EquipmentCache>|null */
public ?array $TrimOptions=null,
/** @var array<EquipmentCache>|null */
public ?array $OptionCodes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Interior'])) $this->Interior = JsonConverters::fromArray('string', $o['Interior']);
if (isset($o['Exterior'])) $this->Exterior = JsonConverters::fromArray('string', $o['Exterior']);
if (isset($o['Options'])) $this->Options = JsonConverters::fromArray('string', $o['Options']);
if (isset($o['WheelOptions'])) $this->WheelOptions = JsonConverters::fromArray('EquipmentCache', $o['WheelOptions']);
if (isset($o['TrimOptions'])) $this->TrimOptions = JsonConverters::fromArray('EquipmentCache', $o['TrimOptions']);
if (isset($o['OptionCodes'])) $this->OptionCodes = JsonConverters::fromArray('EquipmentCache', $o['OptionCodes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Interior)) $o['Interior'] = JsonConverters::toArray('string', $this->Interior);
if (isset($this->Exterior)) $o['Exterior'] = JsonConverters::toArray('string', $this->Exterior);
if (isset($this->Options)) $o['Options'] = JsonConverters::toArray('string', $this->Options);
if (isset($this->WheelOptions)) $o['WheelOptions'] = JsonConverters::toArray('EquipmentCache', $this->WheelOptions);
if (isset($this->TrimOptions)) $o['TrimOptions'] = JsonConverters::toArray('EquipmentCache', $this->TrimOptions);
if (isset($this->OptionCodes)) $o['OptionCodes'] = JsonConverters::toArray('EquipmentCache', $this->OptionCodes);
return empty($o) ? new class(){} : $o;
}
}
class CarConfiguratorResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Name=null,
/** @var KeyInformation|null */
public ?KeyInformation $KeyInformation=null,
/** @var OrderingOptions|null */
public ?OrderingOptions $OrderingOptions=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var string|null */
public ?string $ConfiguratorCode=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['KeyInformation'])) $this->KeyInformation = JsonConverters::from('KeyInformation', $o['KeyInformation']);
if (isset($o['OrderingOptions'])) $this->OrderingOptions = JsonConverters::from('OrderingOptions', $o['OrderingOptions']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['ConfiguratorCode'])) $this->ConfiguratorCode = $o['ConfiguratorCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->KeyInformation)) $o['KeyInformation'] = JsonConverters::to('KeyInformation', $this->KeyInformation);
if (isset($this->OrderingOptions)) $o['OrderingOptions'] = JsonConverters::to('OrderingOptions', $this->OrderingOptions);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->ConfiguratorCode)) $o['ConfiguratorCode'] = $this->ConfiguratorCode;
return empty($o) ? new class(){} : $o;
}
}
class UpdateCarConfiguratorRequest implements IPut, JsonSerializable
{
public function __construct(
/** @description Configurator code */
// @ApiMember(Description="Configurator code", IsRequired=true)
/** @var string */
public string $ConfiguratorCode='',
/** @description BackOrder Guid */
// @ApiMember(Description="BackOrder Guid")
/** @var string|null */
public ?string $Guid=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ConfiguratorCode'])) $this->ConfiguratorCode = $o['ConfiguratorCode'];
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ConfiguratorCode)) $o['ConfiguratorCode'] = $this->ConfiguratorCode;
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
return empty($o) ? new class(){} : $o;
}
}
PHP UpdateCarConfiguratorRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /v1/configurator HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"ConfiguratorCode":"String","Guid":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Name":"String","KeyInformation":{"BM7NST":"String","ConfigurationDate":"String","ModelYear":"String","HalfYear":"String"},"OrderingOptions":{"Interior":["String"],"Exterior":["String"],"Options":["String"],"WheelOptions":[{"Code":"String","Description":"String","StandardFlag":"String","Price":0,"Category":"String","Importance":"String"}],"TrimOptions":[{"Code":"String","Description":"String","StandardFlag":"String","Price":0,"Category":"String","Importance":"String"}],"OptionCodes":[{"Code":"String","Description":"String","StandardFlag":"String","Price":0,"Category":"String","Importance":"String"}]},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ConfiguratorCode":"String"}