POST | /v1/motability/pricing | Gets the motability pricing information for the current user role | Gets the motability pricing information for the current user role |
---|
<?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 GetMotabilityPricingRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
class MotabilityPricingCsv implements JsonSerializable
{
public function __construct(
// @DataMember(Order=0)
/** @var int */
public int $Id=0,
// @DataMember(Order=1)
/** @var string */
public string $CriteriaBM7NST='',
// @DataMember(Order=2)
/** @var string */
public string $VTN='',
// @DataMember(Order=3)
/** @var string */
public string $BackOrderDropDown='',
// @DataMember(Order=4)
/** @var string */
public string $CriteriaFullModelYearCode='',
// @DataMember(Order=5)
/** @var string|null */
public ?string $CriteriaValidOptionCodes=null,
// @DataMember(Order=6)
/** @var string|null */
public ?string $CriteriaInvalidOptionCodes=null,
// @DataMember(Order=7)
/** @var float */
public float $PIPNet=0.0,
// @DataMember(Order=8)
/** @var float */
public float $PIPVat=0.0,
// @DataMember(Order=9)
/** @var float */
public float $PIPGross=0.0,
// @DataMember(Order=10)
/** @var float */
public float $WPMSNet=0.0,
// @DataMember(Order=11)
/** @var float */
public float $WPMSVat=0.0,
// @DataMember(Order=12)
/** @var float */
public float $WPMSGross=0.0,
// @DataMember(Order=13)
/** @var float */
public float $DiscountNet=0.0,
// @DataMember(Order=14)
/** @var float */
public float $DiscountVat=0.0,
// @DataMember(Order=15)
/** @var float */
public float $DiscountGross=0.0,
// @DataMember(Order=16)
/** @var float */
public float $ListPriceNet=0.0,
// @DataMember(Order=17)
/** @var float */
public float $ListPriceVat=0.0,
// @DataMember(Order=18)
/** @var float */
public float $ListPriceGross=0.0,
// @DataMember(Order=19)
/** @var float */
public float $DeliveryChargeNet=0.0,
// @DataMember(Order=20)
/** @var float */
public float $DeliveryChargeVat=0.0,
// @DataMember(Order=21)
/** @var float */
public float $DeliveryChargeGross=0.0,
// @DataMember(Order=22)
/** @var float */
public float $FuelChargeNet=0.0,
// @DataMember(Order=23)
/** @var float */
public float $FuelChargeVat=0.0,
// @DataMember(Order=24)
/** @var float */
public float $FuelChargeGross=0.0,
// @DataMember(Order=25)
/** @var float */
public float $NumberPlateFeeNet=0.0,
// @DataMember(Order=26)
/** @var float */
public float $NumberPlateFeeVat=0.0,
// @DataMember(Order=27)
/** @var float */
public float $NumberPlateFeeGross=0.0,
// @DataMember(Order=28)
/** @var float */
public float $FirstRegistrationFeeNet=0.0,
// @DataMember(Order=29)
/** @var float */
public float $FirstRegistrationFeeVat=0.0,
// @DataMember(Order=30)
/** @var float */
public float $FirstRegistrationFeeGross=0.0,
// @DataMember(Order=31)
/** @var float */
public float $RoadFundLicenceNet=0.0,
// @DataMember(Order=32)
/** @var float */
public float $RoadFundLicenceVat=0.0,
// @DataMember(Order=33)
/** @var float */
public float $RoadFundLicenceGross=0.0,
// @DataMember(Order=34)
/** @var DateTime */
public DateTime $ValidFrom=new DateTime(),
// @DataMember(Order=35)
/** @var DateTime */
public DateTime $ValidTo=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['CriteriaBM7NST'])) $this->CriteriaBM7NST = $o['CriteriaBM7NST'];
if (isset($o['VTN'])) $this->VTN = $o['VTN'];
if (isset($o['BackOrderDropDown'])) $this->BackOrderDropDown = $o['BackOrderDropDown'];
if (isset($o['CriteriaFullModelYearCode'])) $this->CriteriaFullModelYearCode = $o['CriteriaFullModelYearCode'];
if (isset($o['CriteriaValidOptionCodes'])) $this->CriteriaValidOptionCodes = $o['CriteriaValidOptionCodes'];
if (isset($o['CriteriaInvalidOptionCodes'])) $this->CriteriaInvalidOptionCodes = $o['CriteriaInvalidOptionCodes'];
if (isset($o['PIPNet'])) $this->PIPNet = $o['PIPNet'];
if (isset($o['PIPVat'])) $this->PIPVat = $o['PIPVat'];
if (isset($o['PIPGross'])) $this->PIPGross = $o['PIPGross'];
if (isset($o['WPMSNet'])) $this->WPMSNet = $o['WPMSNet'];
if (isset($o['WPMSVat'])) $this->WPMSVat = $o['WPMSVat'];
if (isset($o['WPMSGross'])) $this->WPMSGross = $o['WPMSGross'];
if (isset($o['DiscountNet'])) $this->DiscountNet = $o['DiscountNet'];
if (isset($o['DiscountVat'])) $this->DiscountVat = $o['DiscountVat'];
if (isset($o['DiscountGross'])) $this->DiscountGross = $o['DiscountGross'];
if (isset($o['ListPriceNet'])) $this->ListPriceNet = $o['ListPriceNet'];
if (isset($o['ListPriceVat'])) $this->ListPriceVat = $o['ListPriceVat'];
if (isset($o['ListPriceGross'])) $this->ListPriceGross = $o['ListPriceGross'];
if (isset($o['DeliveryChargeNet'])) $this->DeliveryChargeNet = $o['DeliveryChargeNet'];
if (isset($o['DeliveryChargeVat'])) $this->DeliveryChargeVat = $o['DeliveryChargeVat'];
if (isset($o['DeliveryChargeGross'])) $this->DeliveryChargeGross = $o['DeliveryChargeGross'];
if (isset($o['FuelChargeNet'])) $this->FuelChargeNet = $o['FuelChargeNet'];
if (isset($o['FuelChargeVat'])) $this->FuelChargeVat = $o['FuelChargeVat'];
if (isset($o['FuelChargeGross'])) $this->FuelChargeGross = $o['FuelChargeGross'];
if (isset($o['NumberPlateFeeNet'])) $this->NumberPlateFeeNet = $o['NumberPlateFeeNet'];
if (isset($o['NumberPlateFeeVat'])) $this->NumberPlateFeeVat = $o['NumberPlateFeeVat'];
if (isset($o['NumberPlateFeeGross'])) $this->NumberPlateFeeGross = $o['NumberPlateFeeGross'];
if (isset($o['FirstRegistrationFeeNet'])) $this->FirstRegistrationFeeNet = $o['FirstRegistrationFeeNet'];
if (isset($o['FirstRegistrationFeeVat'])) $this->FirstRegistrationFeeVat = $o['FirstRegistrationFeeVat'];
if (isset($o['FirstRegistrationFeeGross'])) $this->FirstRegistrationFeeGross = $o['FirstRegistrationFeeGross'];
if (isset($o['RoadFundLicenceNet'])) $this->RoadFundLicenceNet = $o['RoadFundLicenceNet'];
if (isset($o['RoadFundLicenceVat'])) $this->RoadFundLicenceVat = $o['RoadFundLicenceVat'];
if (isset($o['RoadFundLicenceGross'])) $this->RoadFundLicenceGross = $o['RoadFundLicenceGross'];
if (isset($o['ValidFrom'])) $this->ValidFrom = JsonConverters::from('DateTime', $o['ValidFrom']);
if (isset($o['ValidTo'])) $this->ValidTo = JsonConverters::from('DateTime', $o['ValidTo']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->CriteriaBM7NST)) $o['CriteriaBM7NST'] = $this->CriteriaBM7NST;
if (isset($this->VTN)) $o['VTN'] = $this->VTN;
if (isset($this->BackOrderDropDown)) $o['BackOrderDropDown'] = $this->BackOrderDropDown;
if (isset($this->CriteriaFullModelYearCode)) $o['CriteriaFullModelYearCode'] = $this->CriteriaFullModelYearCode;
if (isset($this->CriteriaValidOptionCodes)) $o['CriteriaValidOptionCodes'] = $this->CriteriaValidOptionCodes;
if (isset($this->CriteriaInvalidOptionCodes)) $o['CriteriaInvalidOptionCodes'] = $this->CriteriaInvalidOptionCodes;
if (isset($this->PIPNet)) $o['PIPNet'] = $this->PIPNet;
if (isset($this->PIPVat)) $o['PIPVat'] = $this->PIPVat;
if (isset($this->PIPGross)) $o['PIPGross'] = $this->PIPGross;
if (isset($this->WPMSNet)) $o['WPMSNet'] = $this->WPMSNet;
if (isset($this->WPMSVat)) $o['WPMSVat'] = $this->WPMSVat;
if (isset($this->WPMSGross)) $o['WPMSGross'] = $this->WPMSGross;
if (isset($this->DiscountNet)) $o['DiscountNet'] = $this->DiscountNet;
if (isset($this->DiscountVat)) $o['DiscountVat'] = $this->DiscountVat;
if (isset($this->DiscountGross)) $o['DiscountGross'] = $this->DiscountGross;
if (isset($this->ListPriceNet)) $o['ListPriceNet'] = $this->ListPriceNet;
if (isset($this->ListPriceVat)) $o['ListPriceVat'] = $this->ListPriceVat;
if (isset($this->ListPriceGross)) $o['ListPriceGross'] = $this->ListPriceGross;
if (isset($this->DeliveryChargeNet)) $o['DeliveryChargeNet'] = $this->DeliveryChargeNet;
if (isset($this->DeliveryChargeVat)) $o['DeliveryChargeVat'] = $this->DeliveryChargeVat;
if (isset($this->DeliveryChargeGross)) $o['DeliveryChargeGross'] = $this->DeliveryChargeGross;
if (isset($this->FuelChargeNet)) $o['FuelChargeNet'] = $this->FuelChargeNet;
if (isset($this->FuelChargeVat)) $o['FuelChargeVat'] = $this->FuelChargeVat;
if (isset($this->FuelChargeGross)) $o['FuelChargeGross'] = $this->FuelChargeGross;
if (isset($this->NumberPlateFeeNet)) $o['NumberPlateFeeNet'] = $this->NumberPlateFeeNet;
if (isset($this->NumberPlateFeeVat)) $o['NumberPlateFeeVat'] = $this->NumberPlateFeeVat;
if (isset($this->NumberPlateFeeGross)) $o['NumberPlateFeeGross'] = $this->NumberPlateFeeGross;
if (isset($this->FirstRegistrationFeeNet)) $o['FirstRegistrationFeeNet'] = $this->FirstRegistrationFeeNet;
if (isset($this->FirstRegistrationFeeVat)) $o['FirstRegistrationFeeVat'] = $this->FirstRegistrationFeeVat;
if (isset($this->FirstRegistrationFeeGross)) $o['FirstRegistrationFeeGross'] = $this->FirstRegistrationFeeGross;
if (isset($this->RoadFundLicenceNet)) $o['RoadFundLicenceNet'] = $this->RoadFundLicenceNet;
if (isset($this->RoadFundLicenceVat)) $o['RoadFundLicenceVat'] = $this->RoadFundLicenceVat;
if (isset($this->RoadFundLicenceGross)) $o['RoadFundLicenceGross'] = $this->RoadFundLicenceGross;
if (isset($this->ValidFrom)) $o['ValidFrom'] = JsonConverters::to('DateTime', $this->ValidFrom);
if (isset($this->ValidTo)) $o['ValidTo'] = JsonConverters::to('DateTime', $this->ValidTo);
return empty($o) ? new class(){} : $o;
}
}
enum MotabilityPricingStatus : string
{
case Pending = 'Pending';
case Current = 'Current';
case RecentlyExpired = 'RecentlyExpired';
case Expired = 'Expired';
}
class MotabilityPricing extends MotabilityPricingCsv implements JsonSerializable
{
/**
* @param int $Id
* @param string $CriteriaBM7NST
* @param string $VTN
* @param string $BackOrderDropDown
* @param string $CriteriaFullModelYearCode
* @param string|null $CriteriaValidOptionCodes
* @param string|null $CriteriaInvalidOptionCodes
* @param float $PIPNet
* @param float $PIPVat
* @param float $PIPGross
* @param float $WPMSNet
* @param float $WPMSVat
* @param float $WPMSGross
* @param float $DiscountNet
* @param float $DiscountVat
* @param float $DiscountGross
* @param float $ListPriceNet
* @param float $ListPriceVat
* @param float $ListPriceGross
* @param float $DeliveryChargeNet
* @param float $DeliveryChargeVat
* @param float $DeliveryChargeGross
* @param float $FuelChargeNet
* @param float $FuelChargeVat
* @param float $FuelChargeGross
* @param float $NumberPlateFeeNet
* @param float $NumberPlateFeeVat
* @param float $NumberPlateFeeGross
* @param float $FirstRegistrationFeeNet
* @param float $FirstRegistrationFeeVat
* @param float $FirstRegistrationFeeGross
* @param float $RoadFundLicenceNet
* @param float $RoadFundLicenceVat
* @param float $RoadFundLicenceGross
* @param DateTime $ValidFrom
* @param DateTime $ValidTo
*/
public function __construct(
int $Id=0,
string $CriteriaBM7NST='',
string $VTN='',
string $BackOrderDropDown='',
string $CriteriaFullModelYearCode='',
?string $CriteriaValidOptionCodes=null,
?string $CriteriaInvalidOptionCodes=null,
float $PIPNet=0.0,
float $PIPVat=0.0,
float $PIPGross=0.0,
float $WPMSNet=0.0,
float $WPMSVat=0.0,
float $WPMSGross=0.0,
float $DiscountNet=0.0,
float $DiscountVat=0.0,
float $DiscountGross=0.0,
float $ListPriceNet=0.0,
float $ListPriceVat=0.0,
float $ListPriceGross=0.0,
float $DeliveryChargeNet=0.0,
float $DeliveryChargeVat=0.0,
float $DeliveryChargeGross=0.0,
float $FuelChargeNet=0.0,
float $FuelChargeVat=0.0,
float $FuelChargeGross=0.0,
float $NumberPlateFeeNet=0.0,
float $NumberPlateFeeVat=0.0,
float $NumberPlateFeeGross=0.0,
float $FirstRegistrationFeeNet=0.0,
float $FirstRegistrationFeeVat=0.0,
float $FirstRegistrationFeeGross=0.0,
float $RoadFundLicenceNet=0.0,
float $RoadFundLicenceVat=0.0,
float $RoadFundLicenceGross=0.0,
DateTime $ValidFrom=new DateTime(),
DateTime $ValidTo=new DateTime(),
/** @var MotabilityPricingStatus|null */
public ?MotabilityPricingStatus $MotabilityPricingStatus=null
) {
parent::__construct($Id,$CriteriaBM7NST,$VTN,$BackOrderDropDown,$CriteriaFullModelYearCode,$CriteriaValidOptionCodes,$CriteriaInvalidOptionCodes,$PIPNet,$PIPVat,$PIPGross,$WPMSNet,$WPMSVat,$WPMSGross,$DiscountNet,$DiscountVat,$DiscountGross,$ListPriceNet,$ListPriceVat,$ListPriceGross,$DeliveryChargeNet,$DeliveryChargeVat,$DeliveryChargeGross,$FuelChargeNet,$FuelChargeVat,$FuelChargeGross,$NumberPlateFeeNet,$NumberPlateFeeVat,$NumberPlateFeeGross,$FirstRegistrationFeeNet,$FirstRegistrationFeeVat,$FirstRegistrationFeeGross,$RoadFundLicenceNet,$RoadFundLicenceVat,$RoadFundLicenceGross,$ValidFrom,$ValidTo);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['MotabilityPricingStatus'])) $this->MotabilityPricingStatus = JsonConverters::from('MotabilityPricingStatus', $o['MotabilityPricingStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->MotabilityPricingStatus)) $o['MotabilityPricingStatus'] = JsonConverters::to('MotabilityPricingStatus', $this->MotabilityPricingStatus);
return empty($o) ? new class(){} : $o;
}
}
class GetMotabilityPricingResponse implements JsonSerializable
{
public function __construct(
/** @var array<MotabilityPricing>|null */
public ?array $MotabilityPricing=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['MotabilityPricing'])) $this->MotabilityPricing = JsonConverters::fromArray('MotabilityPricing', $o['MotabilityPricing']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->MotabilityPricing)) $o['MotabilityPricing'] = JsonConverters::toArray('MotabilityPricing', $this->MotabilityPricing);
return empty($o) ? new class(){} : $o;
}
}
PHP GetMotabilityPricingRequest 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.
POST /v1/motability/pricing HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {Unable to show example output for type 'GetMotabilityPricingResponse' using the custom 'other' filter}Cannot dynamically create an instance of type 'Mercedes.Agency.API.Shared.POCO.Motability.Responses.GetMotabilityPricingResponse'. Reason: No parameterless constructor defined.