MB Key2Key CCD API

<back to all web services

GetKey2keyDataRequest

Requires Authentication
The following routes are available for this service:
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 .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"ContractNumber":"String","BPID":0,"AppointmentDate":"String","Offers":[{"OfferDescription":"String","ParityLeadType":"String","EquityFigure":0,"ParityFigure":0}],"EstimatedSettlement":0,"Valuation":0,"K2KActivityStatus":"String","K2KMileage":0,"Comments":[{"Comment":"String","Created":"\/Date(-62135596800000-0000)\/"}],"UpdatedDate":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Code":"String","Message":"String"}