| PUT,OPTIONS | /v1/dispatch/rates/config |
|---|
<?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 DispatchRateConfigView implements JsonSerializable
{
public function __construct(
/** @var float */
public float $FuelSurchargePct=0.0,
/** @var float */
public float $TransportPerMile=0.0,
/** @var float */
public float $TransportJobMin=0.0,
/** @var float */
public float $TransportEnclosedUpliftPct=0.0,
/** @var float */
public float $OdBase=0.0,
/** @var float */
public float $OdPerBag=0.0,
/** @var float */
public float $OdPremiumUpliftPct=0.0,
/** @var string|null */
public ?string $HaulBasis=null,
/** @var string|null */
public ?string $Facility=null,
/** @var string|null */
public ?string $Unit=null,
/** @var float */
public float $LoadQty=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FuelSurchargePct'])) $this->FuelSurchargePct = $o['FuelSurchargePct'];
if (isset($o['TransportPerMile'])) $this->TransportPerMile = $o['TransportPerMile'];
if (isset($o['TransportJobMin'])) $this->TransportJobMin = $o['TransportJobMin'];
if (isset($o['TransportEnclosedUpliftPct'])) $this->TransportEnclosedUpliftPct = $o['TransportEnclosedUpliftPct'];
if (isset($o['OdBase'])) $this->OdBase = $o['OdBase'];
if (isset($o['OdPerBag'])) $this->OdPerBag = $o['OdPerBag'];
if (isset($o['OdPremiumUpliftPct'])) $this->OdPremiumUpliftPct = $o['OdPremiumUpliftPct'];
if (isset($o['HaulBasis'])) $this->HaulBasis = $o['HaulBasis'];
if (isset($o['Facility'])) $this->Facility = $o['Facility'];
if (isset($o['Unit'])) $this->Unit = $o['Unit'];
if (isset($o['LoadQty'])) $this->LoadQty = $o['LoadQty'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FuelSurchargePct)) $o['FuelSurchargePct'] = $this->FuelSurchargePct;
if (isset($this->TransportPerMile)) $o['TransportPerMile'] = $this->TransportPerMile;
if (isset($this->TransportJobMin)) $o['TransportJobMin'] = $this->TransportJobMin;
if (isset($this->TransportEnclosedUpliftPct)) $o['TransportEnclosedUpliftPct'] = $this->TransportEnclosedUpliftPct;
if (isset($this->OdBase)) $o['OdBase'] = $this->OdBase;
if (isset($this->OdPerBag)) $o['OdPerBag'] = $this->OdPerBag;
if (isset($this->OdPremiumUpliftPct)) $o['OdPremiumUpliftPct'] = $this->OdPremiumUpliftPct;
if (isset($this->HaulBasis)) $o['HaulBasis'] = $this->HaulBasis;
if (isset($this->Facility)) $o['Facility'] = $this->Facility;
if (isset($this->Unit)) $o['Unit'] = $this->Unit;
if (isset($this->LoadQty)) $o['LoadQty'] = $this->LoadQty;
return empty($o) ? new class(){} : $o;
}
}
class DispatchLaneRateView implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $DispatchSiteID=null,
/** @var int|null */
public ?int $DispatchSupplierID=null,
/** @var string|null */
public ?string $SourceLabel=null,
/** @var string|null */
public ?string $SupplierName=null,
/** @var int|null */
public ?int $DispatchLaneRateID=null,
/** @var float|null */
public ?float $Miles=null,
/** @var float|null */
public ?float $RatePerTon=null,
/** @var float|null */
public ?float $RatePerLoad=null,
/** @var float|null */
public ?float $RatePerTonMile=null,
/** @var float|null */
public ?float $RatePerHour=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DispatchSiteID'])) $this->DispatchSiteID = $o['DispatchSiteID'];
if (isset($o['DispatchSupplierID'])) $this->DispatchSupplierID = $o['DispatchSupplierID'];
if (isset($o['SourceLabel'])) $this->SourceLabel = $o['SourceLabel'];
if (isset($o['SupplierName'])) $this->SupplierName = $o['SupplierName'];
if (isset($o['DispatchLaneRateID'])) $this->DispatchLaneRateID = $o['DispatchLaneRateID'];
if (isset($o['Miles'])) $this->Miles = $o['Miles'];
if (isset($o['RatePerTon'])) $this->RatePerTon = $o['RatePerTon'];
if (isset($o['RatePerLoad'])) $this->RatePerLoad = $o['RatePerLoad'];
if (isset($o['RatePerTonMile'])) $this->RatePerTonMile = $o['RatePerTonMile'];
if (isset($o['RatePerHour'])) $this->RatePerHour = $o['RatePerHour'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DispatchSiteID)) $o['DispatchSiteID'] = $this->DispatchSiteID;
if (isset($this->DispatchSupplierID)) $o['DispatchSupplierID'] = $this->DispatchSupplierID;
if (isset($this->SourceLabel)) $o['SourceLabel'] = $this->SourceLabel;
if (isset($this->SupplierName)) $o['SupplierName'] = $this->SupplierName;
if (isset($this->DispatchLaneRateID)) $o['DispatchLaneRateID'] = $this->DispatchLaneRateID;
if (isset($this->Miles)) $o['Miles'] = $this->Miles;
if (isset($this->RatePerTon)) $o['RatePerTon'] = $this->RatePerTon;
if (isset($this->RatePerLoad)) $o['RatePerLoad'] = $this->RatePerLoad;
if (isset($this->RatePerTonMile)) $o['RatePerTonMile'] = $this->RatePerTonMile;
if (isset($this->RatePerHour)) $o['RatePerHour'] = $this->RatePerHour;
return empty($o) ? new class(){} : $o;
}
}
class DispatchZoneRateView implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Zone=null,
/** @var int|null */
public ?int $DispatchZoneRateID=null,
/** @var float|null */
public ?float $Base=null,
/** @var float|null */
public ?float $PerBag=null,
/** @var float|null */
public ?float $PremiumUpliftPct=null,
/** @var int */
public int $Drivers=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Zone'])) $this->Zone = $o['Zone'];
if (isset($o['DispatchZoneRateID'])) $this->DispatchZoneRateID = $o['DispatchZoneRateID'];
if (isset($o['Base'])) $this->Base = $o['Base'];
if (isset($o['PerBag'])) $this->PerBag = $o['PerBag'];
if (isset($o['PremiumUpliftPct'])) $this->PremiumUpliftPct = $o['PremiumUpliftPct'];
if (isset($o['Drivers'])) $this->Drivers = $o['Drivers'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Zone)) $o['Zone'] = $this->Zone;
if (isset($this->DispatchZoneRateID)) $o['DispatchZoneRateID'] = $this->DispatchZoneRateID;
if (isset($this->Base)) $o['Base'] = $this->Base;
if (isset($this->PerBag)) $o['PerBag'] = $this->PerBag;
if (isset($this->PremiumUpliftPct)) $o['PremiumUpliftPct'] = $this->PremiumUpliftPct;
if (isset($this->Drivers)) $o['Drivers'] = $this->Drivers;
return empty($o) ? new class(){} : $o;
}
}
class DispatchPayPlanView implements JsonSerializable
{
public function __construct(
/** @var int */
public int $DispatchPayPlanID=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Basis=null,
/** @var float */
public float $Rate=0.0,
/** @var float|null */
public ?float $Rate2=null,
/** @var DateTime|null */
public ?DateTime $EffectiveDate=null,
/** @var bool|null */
public ?bool $IsActive=null,
/** @var int */
public int $Drivers=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DispatchPayPlanID'])) $this->DispatchPayPlanID = $o['DispatchPayPlanID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Basis'])) $this->Basis = $o['Basis'];
if (isset($o['Rate'])) $this->Rate = $o['Rate'];
if (isset($o['Rate2'])) $this->Rate2 = $o['Rate2'];
if (isset($o['EffectiveDate'])) $this->EffectiveDate = JsonConverters::from('DateTime', $o['EffectiveDate']);
if (isset($o['IsActive'])) $this->IsActive = $o['IsActive'];
if (isset($o['Drivers'])) $this->Drivers = $o['Drivers'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DispatchPayPlanID)) $o['DispatchPayPlanID'] = $this->DispatchPayPlanID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Basis)) $o['Basis'] = $this->Basis;
if (isset($this->Rate)) $o['Rate'] = $this->Rate;
if (isset($this->Rate2)) $o['Rate2'] = $this->Rate2;
if (isset($this->EffectiveDate)) $o['EffectiveDate'] = JsonConverters::to('DateTime', $this->EffectiveDate);
if (isset($this->IsActive)) $o['IsActive'] = $this->IsActive;
if (isset($this->Drivers)) $o['Drivers'] = $this->Drivers;
return empty($o) ? new class(){} : $o;
}
}
class DispatchRatesResponse implements JsonSerializable
{
public function __construct(
/** @var DispatchRateConfigView|null */
public ?DispatchRateConfigView $Config=null,
/** @var array<DispatchLaneRateView>|null */
public ?array $Lanes=null,
/** @var array<DispatchZoneRateView>|null */
public ?array $Zones=null,
/** @var array<DispatchPayPlanView>|null */
public ?array $Plans=null,
/** @var int|null */
public ?int $Repriced=null,
/** @var int|null */
public ?int $StillNoRevenue=null,
/** @var int|null */
public ?int $StillNoPay=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Config'])) $this->Config = JsonConverters::from('DispatchRateConfigView', $o['Config']);
if (isset($o['Lanes'])) $this->Lanes = JsonConverters::fromArray('DispatchLaneRateView', $o['Lanes']);
if (isset($o['Zones'])) $this->Zones = JsonConverters::fromArray('DispatchZoneRateView', $o['Zones']);
if (isset($o['Plans'])) $this->Plans = JsonConverters::fromArray('DispatchPayPlanView', $o['Plans']);
if (isset($o['Repriced'])) $this->Repriced = $o['Repriced'];
if (isset($o['StillNoRevenue'])) $this->StillNoRevenue = $o['StillNoRevenue'];
if (isset($o['StillNoPay'])) $this->StillNoPay = $o['StillNoPay'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Config)) $o['Config'] = JsonConverters::to('DispatchRateConfigView', $this->Config);
if (isset($this->Lanes)) $o['Lanes'] = JsonConverters::toArray('DispatchLaneRateView', $this->Lanes);
if (isset($this->Zones)) $o['Zones'] = JsonConverters::toArray('DispatchZoneRateView', $this->Zones);
if (isset($this->Plans)) $o['Plans'] = JsonConverters::toArray('DispatchPayPlanView', $this->Plans);
if (isset($this->Repriced)) $o['Repriced'] = $this->Repriced;
if (isset($this->StillNoRevenue)) $o['StillNoRevenue'] = $this->StillNoRevenue;
if (isset($this->StillNoPay)) $o['StillNoPay'] = $this->StillNoPay;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class DispatchRateConfigSaveRequest implements JsonSerializable
{
public function __construct(
/** @var DispatchRateConfigView|null */
public ?DispatchRateConfigView $Config=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Config'])) $this->Config = JsonConverters::from('DispatchRateConfigView', $o['Config']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Config)) $o['Config'] = JsonConverters::to('DispatchRateConfigView', $this->Config);
return empty($o) ? new class(){} : $o;
}
}
PHP DispatchRateConfigSaveRequest 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.
PUT /v1/dispatch/rates/config HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DispatchRateConfigSaveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Config>
<Facility>String</Facility>
<FuelSurchargePct>0</FuelSurchargePct>
<HaulBasis>String</HaulBasis>
<LoadQty>0</LoadQty>
<OdBase>0</OdBase>
<OdPerBag>0</OdPerBag>
<OdPremiumUpliftPct>0</OdPremiumUpliftPct>
<TransportEnclosedUpliftPct>0</TransportEnclosedUpliftPct>
<TransportJobMin>0</TransportJobMin>
<TransportPerMile>0</TransportPerMile>
<Unit>String</Unit>
</Config>
</DispatchRateConfigSaveRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DispatchRatesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Config>
<Facility>String</Facility>
<FuelSurchargePct>0</FuelSurchargePct>
<HaulBasis>String</HaulBasis>
<LoadQty>0</LoadQty>
<OdBase>0</OdBase>
<OdPerBag>0</OdPerBag>
<OdPremiumUpliftPct>0</OdPremiumUpliftPct>
<TransportEnclosedUpliftPct>0</TransportEnclosedUpliftPct>
<TransportJobMin>0</TransportJobMin>
<TransportPerMile>0</TransportPerMile>
<Unit>String</Unit>
</Config>
<Lanes>
<DispatchLaneRateView>
<DispatchLaneRateID>0</DispatchLaneRateID>
<DispatchSiteID>0</DispatchSiteID>
<DispatchSupplierID>0</DispatchSupplierID>
<Miles>0</Miles>
<RatePerHour>0</RatePerHour>
<RatePerLoad>0</RatePerLoad>
<RatePerTon>0</RatePerTon>
<RatePerTonMile>0</RatePerTonMile>
<SourceLabel>String</SourceLabel>
<SupplierName>String</SupplierName>
</DispatchLaneRateView>
</Lanes>
<Plans>
<DispatchPayPlanView>
<Basis>String</Basis>
<DispatchPayPlanID>0</DispatchPayPlanID>
<Drivers>0</Drivers>
<EffectiveDate>0001-01-01T00:00:00</EffectiveDate>
<IsActive>false</IsActive>
<Name>String</Name>
<Rate>0</Rate>
<Rate2>0</Rate2>
</DispatchPayPlanView>
</Plans>
<Repriced>0</Repriced>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<StillNoPay>0</StillNoPay>
<StillNoRevenue>0</StillNoRevenue>
<Zones>
<DispatchZoneRateView>
<Base>0</Base>
<DispatchZoneRateID>0</DispatchZoneRateID>
<Drivers>0</Drivers>
<PerBag>0</PerBag>
<PremiumUpliftPct>0</PremiumUpliftPct>
<Zone>String</Zone>
</DispatchZoneRateView>
</Zones>
</DispatchRatesResponse>