POST | /v1/copinflightpricing | Corporate Outright Pricing Inflight Pricing for supplied Order Guids |
---|
<?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 OrderOffer implements JsonSerializable
{
public function __construct(
/** @var int */
public int $Id=0,
/** @var int */
public int $OfferTypeId=0,
/** @var string */
public string $OfferTypeDescription='',
/** @var string */
public string $OfferId='',
/** @var string */
public string $OfferDescription='',
/** @var float */
public float $Net=0.0,
/** @var float */
public float $VAT=0.0,
/** @var float */
public float $Gross=0.0,
/** @var bool|null */
public ?bool $GovernmentGrant=null,
/** @var string|null */
public ?string $PromoCode=null,
/** @var string|null */
public ?string $Expiry=null,
/** @var bool|null */
public ?bool $AffectsPrice=null,
/** @var int|null */
public ?int $Product=null,
/** @var string|null */
public ?string $ParentId=null,
/** @var DateTime */
public DateTime $CreationDate=new DateTime(),
/** @var string|null */
public ?string $ProductTypeDescription=null,
/** @var string|null */
public ?string $ProductTypeNegativeDescription=null,
/** @var bool|null */
public ?bool $CertificateRequired=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['OfferTypeId'])) $this->OfferTypeId = $o['OfferTypeId'];
if (isset($o['OfferTypeDescription'])) $this->OfferTypeDescription = $o['OfferTypeDescription'];
if (isset($o['OfferId'])) $this->OfferId = $o['OfferId'];
if (isset($o['OfferDescription'])) $this->OfferDescription = $o['OfferDescription'];
if (isset($o['Net'])) $this->Net = $o['Net'];
if (isset($o['VAT'])) $this->VAT = $o['VAT'];
if (isset($o['Gross'])) $this->Gross = $o['Gross'];
if (isset($o['GovernmentGrant'])) $this->GovernmentGrant = $o['GovernmentGrant'];
if (isset($o['PromoCode'])) $this->PromoCode = $o['PromoCode'];
if (isset($o['Expiry'])) $this->Expiry = $o['Expiry'];
if (isset($o['AffectsPrice'])) $this->AffectsPrice = $o['AffectsPrice'];
if (isset($o['Product'])) $this->Product = $o['Product'];
if (isset($o['ParentId'])) $this->ParentId = $o['ParentId'];
if (isset($o['CreationDate'])) $this->CreationDate = JsonConverters::from('DateTime', $o['CreationDate']);
if (isset($o['ProductTypeDescription'])) $this->ProductTypeDescription = $o['ProductTypeDescription'];
if (isset($o['ProductTypeNegativeDescription'])) $this->ProductTypeNegativeDescription = $o['ProductTypeNegativeDescription'];
if (isset($o['CertificateRequired'])) $this->CertificateRequired = $o['CertificateRequired'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->OfferTypeId)) $o['OfferTypeId'] = $this->OfferTypeId;
if (isset($this->OfferTypeDescription)) $o['OfferTypeDescription'] = $this->OfferTypeDescription;
if (isset($this->OfferId)) $o['OfferId'] = $this->OfferId;
if (isset($this->OfferDescription)) $o['OfferDescription'] = $this->OfferDescription;
if (isset($this->Net)) $o['Net'] = $this->Net;
if (isset($this->VAT)) $o['VAT'] = $this->VAT;
if (isset($this->Gross)) $o['Gross'] = $this->Gross;
if (isset($this->GovernmentGrant)) $o['GovernmentGrant'] = $this->GovernmentGrant;
if (isset($this->PromoCode)) $o['PromoCode'] = $this->PromoCode;
if (isset($this->Expiry)) $o['Expiry'] = $this->Expiry;
if (isset($this->AffectsPrice)) $o['AffectsPrice'] = $this->AffectsPrice;
if (isset($this->Product)) $o['Product'] = $this->Product;
if (isset($this->ParentId)) $o['ParentId'] = $this->ParentId;
if (isset($this->CreationDate)) $o['CreationDate'] = JsonConverters::to('DateTime', $this->CreationDate);
if (isset($this->ProductTypeDescription)) $o['ProductTypeDescription'] = $this->ProductTypeDescription;
if (isset($this->ProductTypeNegativeDescription)) $o['ProductTypeNegativeDescription'] = $this->ProductTypeNegativeDescription;
if (isset($this->CertificateRequired)) $o['CertificateRequired'] = $this->CertificateRequired;
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 MotabilityAdvancePayment implements JsonSerializable
{
public function __construct(
/** @var string */
public string $AdvancePaymentRentalType='',
/** @var float */
public float $AdvancePaymentValueGross=0.0,
/** @var float */
public float $AdvancePaymentValueVAT=0.0,
/** @var float */
public float $AdvancePaymentValueNet=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AdvancePaymentRentalType'])) $this->AdvancePaymentRentalType = $o['AdvancePaymentRentalType'];
if (isset($o['AdvancePaymentValueGross'])) $this->AdvancePaymentValueGross = $o['AdvancePaymentValueGross'];
if (isset($o['AdvancePaymentValueVAT'])) $this->AdvancePaymentValueVAT = $o['AdvancePaymentValueVAT'];
if (isset($o['AdvancePaymentValueNet'])) $this->AdvancePaymentValueNet = $o['AdvancePaymentValueNet'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AdvancePaymentRentalType)) $o['AdvancePaymentRentalType'] = $this->AdvancePaymentRentalType;
if (isset($this->AdvancePaymentValueGross)) $o['AdvancePaymentValueGross'] = $this->AdvancePaymentValueGross;
if (isset($this->AdvancePaymentValueVAT)) $o['AdvancePaymentValueVAT'] = $this->AdvancePaymentValueVAT;
if (isset($this->AdvancePaymentValueNet)) $o['AdvancePaymentValueNet'] = $this->AdvancePaymentValueNet;
return empty($o) ? new class(){} : $o;
}
}
class InflightPricingOrder implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Guid='',
/** @var string */
public string $Vin='',
/** @var int */
public int $AdvanceRentalPaymentType=0,
/** @var array<OrderOffer>|null */
public ?array $Offer=null,
/** @var OutrightPurchase|null */
public ?OutrightPurchase $OutrightPurchase=null,
/** @var MotabilityAdvancePayment|null */
public ?MotabilityAdvancePayment $MotabilityAdvancePayment=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Vin'])) $this->Vin = $o['Vin'];
if (isset($o['AdvanceRentalPaymentType'])) $this->AdvanceRentalPaymentType = $o['AdvanceRentalPaymentType'];
if (isset($o['Offer'])) $this->Offer = JsonConverters::fromArray('OrderOffer', $o['Offer']);
if (isset($o['OutrightPurchase'])) $this->OutrightPurchase = JsonConverters::from('OutrightPurchase', $o['OutrightPurchase']);
if (isset($o['MotabilityAdvancePayment'])) $this->MotabilityAdvancePayment = JsonConverters::from('MotabilityAdvancePayment', $o['MotabilityAdvancePayment']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Vin)) $o['Vin'] = $this->Vin;
if (isset($this->AdvanceRentalPaymentType)) $o['AdvanceRentalPaymentType'] = $this->AdvanceRentalPaymentType;
if (isset($this->Offer)) $o['Offer'] = JsonConverters::toArray('OrderOffer', $this->Offer);
if (isset($this->OutrightPurchase)) $o['OutrightPurchase'] = JsonConverters::to('OutrightPurchase', $this->OutrightPurchase);
if (isset($this->MotabilityAdvancePayment)) $o['MotabilityAdvancePayment'] = JsonConverters::to('MotabilityAdvancePayment', $this->MotabilityAdvancePayment);
return empty($o) ? new class(){} : $o;
}
}
class InflightPricingOrderRequest implements JsonSerializable
{
public function __construct(
/** @var array<string>|null */
public ?array $InvalidFormatGuids=null,
/** @var array<string>|null */
public ?array $OrderNotFoundGuids=null,
/** @var array<InflightPricingOrder>|null */
public ?array $InflightPricingOrders=null,
/** @var bool|null */
public ?bool $IsMotability=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['InvalidFormatGuids'])) $this->InvalidFormatGuids = JsonConverters::fromArray('string', $o['InvalidFormatGuids']);
if (isset($o['OrderNotFoundGuids'])) $this->OrderNotFoundGuids = JsonConverters::fromArray('Guid', $o['OrderNotFoundGuids']);
if (isset($o['InflightPricingOrders'])) $this->InflightPricingOrders = JsonConverters::fromArray('InflightPricingOrder', $o['InflightPricingOrders']);
if (isset($o['IsMotability'])) $this->IsMotability = $o['IsMotability'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->InvalidFormatGuids)) $o['InvalidFormatGuids'] = JsonConverters::toArray('string', $this->InvalidFormatGuids);
if (isset($this->OrderNotFoundGuids)) $o['OrderNotFoundGuids'] = JsonConverters::toArray('Guid', $this->OrderNotFoundGuids);
if (isset($this->InflightPricingOrders)) $o['InflightPricingOrders'] = JsonConverters::toArray('InflightPricingOrder', $this->InflightPricingOrders);
if (isset($this->IsMotability)) $o['IsMotability'] = $this->IsMotability;
return empty($o) ? new class(){} : $o;
}
}
class CopInflightPricingOrderRequest extends InflightPricingOrderRequest implements JsonSerializable
{
/**
* @param array<string>|null $InvalidFormatGuids
* @param array<string>|null $OrderNotFoundGuids
* @param array<InflightPricingOrder>|null $InflightPricingOrders
* @param bool|null $IsMotability
*/
public function __construct(
?array $InvalidFormatGuids=null,
?array $OrderNotFoundGuids=null,
?array $InflightPricingOrders=null,
?bool $IsMotability=null,
/** @var array<string>|null */
public ?array $NoCustomerContract=null,
/** @var array<string>|null */
public ?array $NoVehicleDiscount=null
) {
parent::__construct($InvalidFormatGuids,$OrderNotFoundGuids,$InflightPricingOrders,$IsMotability);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['NoCustomerContract'])) $this->NoCustomerContract = JsonConverters::fromArray('Guid', $o['NoCustomerContract']);
if (isset($o['NoVehicleDiscount'])) $this->NoVehicleDiscount = JsonConverters::fromArray('Guid', $o['NoVehicleDiscount']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->NoCustomerContract)) $o['NoCustomerContract'] = JsonConverters::toArray('Guid', $this->NoCustomerContract);
if (isset($this->NoVehicleDiscount)) $o['NoVehicleDiscount'] = JsonConverters::toArray('Guid', $this->NoVehicleDiscount);
return empty($o) ? new class(){} : $o;
}
}
class SalesforcePrice implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $Description='',
/** @var float */
public float $Net=0.0,
/** @var float */
public float $VAT=0.0,
/** @var float */
public float $Gross=0.0,
/** @var string */
public string $Product=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['Net'])) $this->Net = $o['Net'];
if (isset($o['VAT'])) $this->VAT = $o['VAT'];
if (isset($o['Gross'])) $this->Gross = $o['Gross'];
if (isset($o['Product'])) $this->Product = $o['Product'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->Net)) $o['Net'] = $this->Net;
if (isset($this->VAT)) $o['VAT'] = $this->VAT;
if (isset($this->Gross)) $o['Gross'] = $this->Gross;
if (isset($this->Product)) $o['Product'] = $this->Product;
return empty($o) ? new class(){} : $o;
}
}
class SalesforceTotalPrice implements JsonSerializable
{
public function __construct(
/** @var float */
public float $Net=0.0,
/** @var float */
public float $VAT=0.0,
/** @var float */
public float $Gross=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Net'])) $this->Net = $o['Net'];
if (isset($o['VAT'])) $this->VAT = $o['VAT'];
if (isset($o['Gross'])) $this->Gross = $o['Gross'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Net)) $o['Net'] = $this->Net;
if (isset($this->VAT)) $o['VAT'] = $this->VAT;
if (isset($this->Gross)) $o['Gross'] = $this->Gross;
return empty($o) ? new class(){} : $o;
}
}
class SalesforceOffer implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $Description='',
/** @var float */
public float $Net=0.0,
/** @var float */
public float $VAT=0.0,
/** @var float */
public float $Gross=0.0,
/** @var string|null */
public ?string $Expiry=null,
/** @var string */
public string $Product='',
/** @var bool|null */
public ?bool $RequiresCertification=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['Net'])) $this->Net = $o['Net'];
if (isset($o['VAT'])) $this->VAT = $o['VAT'];
if (isset($o['Gross'])) $this->Gross = $o['Gross'];
if (isset($o['Expiry'])) $this->Expiry = $o['Expiry'];
if (isset($o['Product'])) $this->Product = $o['Product'];
if (isset($o['RequiresCertification'])) $this->RequiresCertification = $o['RequiresCertification'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->Net)) $o['Net'] = $this->Net;
if (isset($this->VAT)) $o['VAT'] = $this->VAT;
if (isset($this->Gross)) $o['Gross'] = $this->Gross;
if (isset($this->Expiry)) $o['Expiry'] = $this->Expiry;
if (isset($this->Product)) $o['Product'] = $this->Product;
if (isset($this->RequiresCertification)) $o['RequiresCertification'] = $this->RequiresCertification;
return empty($o) ? new class(){} : $o;
}
}
class SalesforceOffers implements JsonSerializable
{
public function __construct(
/** @var array<SalesforceOffer>|null */
public ?array $Personalised=null,
/** @var array<SalesforceOffer>|null */
public ?array $NonDiscretionary=null,
/** @var array<SalesforceOffer>|null */
public ?array $NonCampaign=null,
/** @var array<SalesforceOffer>|null */
public ?array $OutrightPurchaseDiscount=null,
/** @var array<SalesforceOffer>|null */
public ?array $MotabilityDiscount=null,
/** @var array<SalesforceOffer>|null */
public ?array $IntegratedProducts=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Personalised'])) $this->Personalised = JsonConverters::fromArray('SalesforceOffer', $o['Personalised']);
if (isset($o['NonDiscretionary'])) $this->NonDiscretionary = JsonConverters::fromArray('SalesforceOffer', $o['NonDiscretionary']);
if (isset($o['NonCampaign'])) $this->NonCampaign = JsonConverters::fromArray('SalesforceOffer', $o['NonCampaign']);
if (isset($o['OutrightPurchaseDiscount'])) $this->OutrightPurchaseDiscount = JsonConverters::fromArray('SalesforceOffer', $o['OutrightPurchaseDiscount']);
if (isset($o['MotabilityDiscount'])) $this->MotabilityDiscount = JsonConverters::fromArray('SalesforceOffer', $o['MotabilityDiscount']);
if (isset($o['IntegratedProducts'])) $this->IntegratedProducts = JsonConverters::fromArray('SalesforceOffer', $o['IntegratedProducts']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Personalised)) $o['Personalised'] = JsonConverters::toArray('SalesforceOffer', $this->Personalised);
if (isset($this->NonDiscretionary)) $o['NonDiscretionary'] = JsonConverters::toArray('SalesforceOffer', $this->NonDiscretionary);
if (isset($this->NonCampaign)) $o['NonCampaign'] = JsonConverters::toArray('SalesforceOffer', $this->NonCampaign);
if (isset($this->OutrightPurchaseDiscount)) $o['OutrightPurchaseDiscount'] = JsonConverters::toArray('SalesforceOffer', $this->OutrightPurchaseDiscount);
if (isset($this->MotabilityDiscount)) $o['MotabilityDiscount'] = JsonConverters::toArray('SalesforceOffer', $this->MotabilityDiscount);
if (isset($this->IntegratedProducts)) $o['IntegratedProducts'] = JsonConverters::toArray('SalesforceOffer', $this->IntegratedProducts);
return empty($o) ? new class(){} : $o;
}
}
class SalesforceOutrightPurchase implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $IsOutrightPurchase=null,
/** @var string */
public string $Reference='',
/** @var float */
public float $DiscountPercentage=0.0,
/** @var string */
public string $ModelId=''
) {
}
/** @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['DiscountPercentage'])) $this->DiscountPercentage = $o['DiscountPercentage'];
if (isset($o['ModelId'])) $this->ModelId = $o['ModelId'];
}
/** @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->DiscountPercentage)) $o['DiscountPercentage'] = $this->DiscountPercentage;
if (isset($this->ModelId)) $o['ModelId'] = $this->ModelId;
return empty($o) ? new class(){} : $o;
}
}
class VehicleInflightPrice implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Guid='',
/** @var string */
public string $Status='',
/** @var bool|null */
public ?bool $Success=null,
/** @var array<SalesforcePrice>|null */
public ?array $Prices=null,
/** @var SalesforceTotalPrice|null */
public ?SalesforceTotalPrice $TotalOTRFees=null,
/** @var SalesforceTotalPrice|null */
public ?SalesforceTotalPrice $TotalOTRPrice=null,
/** @var SalesforceTotalPrice|null */
public ?SalesforceTotalPrice $TotalActualPrice=null,
/** @var SalesforceOffers|null */
public ?SalesforceOffers $Offers=null,
/** @var SalesforceOutrightPurchase|null */
public ?SalesforceOutrightPurchase $OutrightPurchase=null,
/** @var MotabilityAdvancePayment|null */
public ?MotabilityAdvancePayment $Motability=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Guid'])) $this->Guid = $o['Guid'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['Success'])) $this->Success = $o['Success'];
if (isset($o['Prices'])) $this->Prices = JsonConverters::fromArray('SalesforcePrice', $o['Prices']);
if (isset($o['TotalOTRFees'])) $this->TotalOTRFees = JsonConverters::from('SalesforceTotalPrice', $o['TotalOTRFees']);
if (isset($o['TotalOTRPrice'])) $this->TotalOTRPrice = JsonConverters::from('SalesforceTotalPrice', $o['TotalOTRPrice']);
if (isset($o['TotalActualPrice'])) $this->TotalActualPrice = JsonConverters::from('SalesforceTotalPrice', $o['TotalActualPrice']);
if (isset($o['Offers'])) $this->Offers = JsonConverters::from('SalesforceOffers', $o['Offers']);
if (isset($o['OutrightPurchase'])) $this->OutrightPurchase = JsonConverters::from('SalesforceOutrightPurchase', $o['OutrightPurchase']);
if (isset($o['Motability'])) $this->Motability = JsonConverters::from('MotabilityAdvancePayment', $o['Motability']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Guid)) $o['Guid'] = $this->Guid;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->Success)) $o['Success'] = $this->Success;
if (isset($this->Prices)) $o['Prices'] = JsonConverters::toArray('SalesforcePrice', $this->Prices);
if (isset($this->TotalOTRFees)) $o['TotalOTRFees'] = JsonConverters::to('SalesforceTotalPrice', $this->TotalOTRFees);
if (isset($this->TotalOTRPrice)) $o['TotalOTRPrice'] = JsonConverters::to('SalesforceTotalPrice', $this->TotalOTRPrice);
if (isset($this->TotalActualPrice)) $o['TotalActualPrice'] = JsonConverters::to('SalesforceTotalPrice', $this->TotalActualPrice);
if (isset($this->Offers)) $o['Offers'] = JsonConverters::to('SalesforceOffers', $this->Offers);
if (isset($this->OutrightPurchase)) $o['OutrightPurchase'] = JsonConverters::to('SalesforceOutrightPurchase', $this->OutrightPurchase);
if (isset($this->Motability)) $o['Motability'] = JsonConverters::to('MotabilityAdvancePayment', $this->Motability);
return empty($o) ? new class(){} : $o;
}
}
class InflightPricingResponse implements JsonSerializable
{
public function __construct(
/** @var array<VehicleInflightPrice>|null */
public ?array $VehiclesInflightPrices=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['VehiclesInflightPrices'])) $this->VehiclesInflightPrices = JsonConverters::fromArray('VehicleInflightPrice', $o['VehiclesInflightPrices']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->VehiclesInflightPrices)) $o['VehiclesInflightPrices'] = JsonConverters::toArray('VehicleInflightPrice', $this->VehiclesInflightPrices);
return empty($o) ? new class(){} : $o;
}
}
// @ApiResponse(Description="In Flight pricing generated", StatusCode=200)
class CopInflightPricingRequest extends CopInflightPricingOrderRequest implements IPost, JsonSerializable
{
/**
* @param array<string>|null $InvalidFormatGuids
* @param array<string>|null $OrderNotFoundGuids
* @param array<InflightPricingOrder>|null $InflightPricingOrders
* @param bool|null $IsMotability
* @param array<string>|null $NoCustomerContract
* @param array<string>|null $NoVehicleDiscount
*/
public function __construct(
?array $InvalidFormatGuids=null,
?array $OrderNotFoundGuids=null,
?array $InflightPricingOrders=null,
?bool $IsMotability=null,
?array $NoCustomerContract=null,
?array $NoVehicleDiscount=null
) {
parent::__construct($InvalidFormatGuids,$OrderNotFoundGuids,$InflightPricingOrders,$IsMotability,$NoCustomerContract,$NoVehicleDiscount);
}
/** @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 CopInflightPricingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/copinflightpricing HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"NoCustomerContract":["00000000000000000000000000000000"],"NoVehicleDiscount":["00000000000000000000000000000000"],"InvalidFormatGuids":["String"],"OrderNotFoundGuids":["00000000000000000000000000000000"],"InflightPricingOrders":[{"Guid":"00000000000000000000000000000000","Vin":"String","AdvanceRentalPaymentType":0,"Offer":[{"Id":0,"OfferTypeId":0,"OfferTypeDescription":"String","OfferId":"String","OfferDescription":"String","Net":0,"VAT":0,"Gross":0,"GovernmentGrant":false,"PromoCode":"String","Expiry":"String","AffectsPrice":false,"Product":0,"ParentId":"String","CreationDate":"\/Date(-62135596800000-0000)\/","ProductTypeDescription":"String","ProductTypeNegativeDescription":"String","CertificateRequired":false}],"OutrightPurchase":{"IsOutrightPurchase":false,"Reference":"String","DiscountRate":0,"Bm7NST":"String","IsBackOrder":false,"IsCOPConverter":false},"MotabilityAdvancePayment":{"AdvancePaymentRentalType":"String","AdvancePaymentValueGross":0,"AdvancePaymentValueVAT":0,"AdvancePaymentValueNet":0}}],"IsMotability":false}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"VehiclesInflightPrices":[{"Guid":"String","Status":"String","Success":false,"Prices":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Product":"String"}],"TotalOTRFees":{"Net":0,"VAT":0,"Gross":0},"TotalOTRPrice":{"Net":0,"VAT":0,"Gross":0},"TotalActualPrice":{"Net":0,"VAT":0,"Gross":0},"Offers":{"Personalised":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}],"NonDiscretionary":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}],"NonCampaign":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}],"OutrightPurchaseDiscount":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}],"MotabilityDiscount":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}],"IntegratedProducts":[{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Expiry":"String","Product":"String","RequiresCertification":false}]},"OutrightPurchase":{"IsOutrightPurchase":false,"Reference":"String","DiscountPercentage":0,"ModelId":"String"},"Motability":{"AdvancePaymentRentalType":"String","AdvancePaymentValueGross":0,"AdvancePaymentValueVAT":0,"AdvancePaymentValueNet":0}}]}