| POST | /GetKey2keyData/ |
|---|
<?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};
// @DataContract
class GetKey2keyDataResponse implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Code=null,
// @DataMember
/** @var string|null */
public ?string $Message=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['Message'])) $this->Message = $o['Message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->Message)) $o['Message'] = $this->Message;
return empty($o) ? new class(){} : $o;
}
}
class Offer implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $OfferDescription=null,
/** @var string|null */
public ?string $ParityLeadType=null,
/** @var float|null */
public ?float $EquityFigure=null,
/** @var float|null */
public ?float $ParityFigure=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['OfferDescription'])) $this->OfferDescription = $o['OfferDescription'];
if (isset($o['ParityLeadType'])) $this->ParityLeadType = $o['ParityLeadType'];
if (isset($o['EquityFigure'])) $this->EquityFigure = $o['EquityFigure'];
if (isset($o['ParityFigure'])) $this->ParityFigure = $o['ParityFigure'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->OfferDescription)) $o['OfferDescription'] = $this->OfferDescription;
if (isset($this->ParityLeadType)) $o['ParityLeadType'] = $this->ParityLeadType;
if (isset($this->EquityFigure)) $o['EquityFigure'] = $this->EquityFigure;
if (isset($this->ParityFigure)) $o['ParityFigure'] = $this->ParityFigure;
return empty($o) ? new class(){} : $o;
}
}
class Comments implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Comment=null,
/** @var DateTime|null */
public ?DateTime $Created=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Comment'])) $this->Comment = $o['Comment'];
if (isset($o['Created'])) $this->Created = JsonConverters::from('DateTime', $o['Created']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Comment)) $o['Comment'] = $this->Comment;
if (isset($this->Created)) $o['Created'] = JsonConverters::to('DateTime', $this->Created);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class GetKey2keyDataRequest implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $ContractNumber=null,
// @DataMember
/** @var int|null */
public ?int $BPID=null,
// @DataMember
/** @var string|null */
public ?string $AppointmentDate=null,
// @DataMember
/** @var Offer[]|null */
public ?array $Offers=null,
// @DataMember
/** @var float|null */
public ?float $EstimatedSettlement=null,
// @DataMember
/** @var float|null */
public ?float $Valuation=null,
// @DataMember
/** @var string|null */
public ?string $K2KActivityStatus=null,
// @DataMember
/** @var int|null */
public ?int $K2KMileage=null,
// @DataMember
/** @var Comments[]|null */
public ?array $Comments=null,
// @DataMember
/** @var string|null */
public ?string $UpdatedDate=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContractNumber'])) $this->ContractNumber = $o['ContractNumber'];
if (isset($o['BPID'])) $this->BPID = $o['BPID'];
if (isset($o['AppointmentDate'])) $this->AppointmentDate = $o['AppointmentDate'];
if (isset($o['Offers'])) $this->Offers = JsonConverters::fromArray('Offer', $o['Offers']);
if (isset($o['EstimatedSettlement'])) $this->EstimatedSettlement = $o['EstimatedSettlement'];
if (isset($o['Valuation'])) $this->Valuation = $o['Valuation'];
if (isset($o['K2KActivityStatus'])) $this->K2KActivityStatus = $o['K2KActivityStatus'];
if (isset($o['K2KMileage'])) $this->K2KMileage = $o['K2KMileage'];
if (isset($o['Comments'])) $this->Comments = JsonConverters::fromArray('Comments', $o['Comments']);
if (isset($o['UpdatedDate'])) $this->UpdatedDate = $o['UpdatedDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContractNumber)) $o['ContractNumber'] = $this->ContractNumber;
if (isset($this->BPID)) $o['BPID'] = $this->BPID;
if (isset($this->AppointmentDate)) $o['AppointmentDate'] = $this->AppointmentDate;
if (isset($this->Offers)) $o['Offers'] = JsonConverters::toArray('Offer', $this->Offers);
if (isset($this->EstimatedSettlement)) $o['EstimatedSettlement'] = $this->EstimatedSettlement;
if (isset($this->Valuation)) $o['Valuation'] = $this->Valuation;
if (isset($this->K2KActivityStatus)) $o['K2KActivityStatus'] = $this->K2KActivityStatus;
if (isset($this->K2KMileage)) $o['K2KMileage'] = $this->K2KMileage;
if (isset($this->Comments)) $o['Comments'] = JsonConverters::toArray('Comments', $this->Comments);
if (isset($this->UpdatedDate)) $o['UpdatedDate'] = $this->UpdatedDate;
return empty($o) ? new class(){} : $o;
}
}
PHP GetKey2keyDataRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /GetKey2keyData/ HTTP/1.1
Host: webservices.mbukdatabase.co.uk
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetKey2keyDataRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MBKey2keyCCD.GetKey2keyData">
<AppointmentDate>String</AppointmentDate>
<BPID>0</BPID>
<Comments xmlns:d2p1="http://schemas.datacontract.org/2004/07/MBKey2keyCCD.DomainClasses">
<d2p1:Comments>
<d2p1:Comment>String</d2p1:Comment>
<d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
</d2p1:Comments>
</Comments>
<ContractNumber>String</ContractNumber>
<EstimatedSettlement>0</EstimatedSettlement>
<K2KActivityStatus>String</K2KActivityStatus>
<K2KMileage>0</K2KMileage>
<Offers xmlns:d2p1="http://schemas.datacontract.org/2004/07/MBKey2keyCCD.BusinessLib.DomainClasses">
<d2p1:Offer>
<d2p1:EquityFigure>0</d2p1:EquityFigure>
<d2p1:OfferDescription>String</d2p1:OfferDescription>
<d2p1:ParityFigure>0</d2p1:ParityFigure>
<d2p1:ParityLeadType>String</d2p1:ParityLeadType>
</d2p1:Offer>
</Offers>
<UpdatedDate>String</UpdatedDate>
<Valuation>0</Valuation>
</GetKey2keyDataRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetKey2keyDataResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MBKey2keyCCD.GetKey2keyData"> <Code>String</Code> <Message>String</Message> </GetKey2keyDataResponse>