| GET,OPTIONS | /v1/dispatch/courier/recurrences |
|---|
<?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 CourierRecurrenceView implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CourierRecurrenceID=0,
/** @var int */
public int $CourierProfileId=0,
/** @var string|null */
public ?string $ProfileName=null,
/** @var int|null */
public ?int $CourierFacilityId=null,
/** @var int|null */
public ?int $CustomerContactId=null,
/** @var string|null */
public ?string $CustomerName=null,
/** @var string|null */
public ?string $CustomerPhone=null,
/** @var string|null */
public ?string $Address=null,
/** @var string|null */
public ?string $Unit=null,
/** @var string|null */
public ?string $City=null,
/** @var string|null */
public ?string $Zip=null,
/** @var string|null */
public ?string $Zone=null,
/** @var float|null */
public ?float $Lat=null,
/** @var float|null */
public ?float $Lng=null,
/** @var int */
public int $Weekday=0,
/** @var string|null */
public ?string $WindowStart=null,
/** @var string|null */
public ?string $WindowEnd=null,
/** @var string|null */
public ?string $Cadence=null,
/** @var string|null */
public ?string $AnchorDate=null,
/** @var string|null */
public ?string $ServiceLevelCode=null,
/** @var int */
public int $UnitsExpected=0,
/** @var string|null */
public ?string $Handoff=null,
/** @var string|null */
public ?string $Instructions=null,
/** @var string|null */
public ?string $PayMode=null,
/** @var string|null */
public ?string $AccountCode=null,
/** @var bool|null */
public ?bool $Paused=null,
/** @var string|null */
public ?string $LastMaterializedDate=null,
/** @var string|null */
public ?string $NextDate=null,
/** @var array<string>|null */
public ?array $SkipDates=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CourierRecurrenceID'])) $this->CourierRecurrenceID = $o['CourierRecurrenceID'];
if (isset($o['CourierProfileId'])) $this->CourierProfileId = $o['CourierProfileId'];
if (isset($o['ProfileName'])) $this->ProfileName = $o['ProfileName'];
if (isset($o['CourierFacilityId'])) $this->CourierFacilityId = $o['CourierFacilityId'];
if (isset($o['CustomerContactId'])) $this->CustomerContactId = $o['CustomerContactId'];
if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
if (isset($o['CustomerPhone'])) $this->CustomerPhone = $o['CustomerPhone'];
if (isset($o['Address'])) $this->Address = $o['Address'];
if (isset($o['Unit'])) $this->Unit = $o['Unit'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['Zip'])) $this->Zip = $o['Zip'];
if (isset($o['Zone'])) $this->Zone = $o['Zone'];
if (isset($o['Lat'])) $this->Lat = $o['Lat'];
if (isset($o['Lng'])) $this->Lng = $o['Lng'];
if (isset($o['Weekday'])) $this->Weekday = $o['Weekday'];
if (isset($o['WindowStart'])) $this->WindowStart = $o['WindowStart'];
if (isset($o['WindowEnd'])) $this->WindowEnd = $o['WindowEnd'];
if (isset($o['Cadence'])) $this->Cadence = $o['Cadence'];
if (isset($o['AnchorDate'])) $this->AnchorDate = $o['AnchorDate'];
if (isset($o['ServiceLevelCode'])) $this->ServiceLevelCode = $o['ServiceLevelCode'];
if (isset($o['UnitsExpected'])) $this->UnitsExpected = $o['UnitsExpected'];
if (isset($o['Handoff'])) $this->Handoff = $o['Handoff'];
if (isset($o['Instructions'])) $this->Instructions = $o['Instructions'];
if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
if (isset($o['AccountCode'])) $this->AccountCode = $o['AccountCode'];
if (isset($o['Paused'])) $this->Paused = $o['Paused'];
if (isset($o['LastMaterializedDate'])) $this->LastMaterializedDate = $o['LastMaterializedDate'];
if (isset($o['NextDate'])) $this->NextDate = $o['NextDate'];
if (isset($o['SkipDates'])) $this->SkipDates = JsonConverters::fromArray('string', $o['SkipDates']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CourierRecurrenceID)) $o['CourierRecurrenceID'] = $this->CourierRecurrenceID;
if (isset($this->CourierProfileId)) $o['CourierProfileId'] = $this->CourierProfileId;
if (isset($this->ProfileName)) $o['ProfileName'] = $this->ProfileName;
if (isset($this->CourierFacilityId)) $o['CourierFacilityId'] = $this->CourierFacilityId;
if (isset($this->CustomerContactId)) $o['CustomerContactId'] = $this->CustomerContactId;
if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
if (isset($this->CustomerPhone)) $o['CustomerPhone'] = $this->CustomerPhone;
if (isset($this->Address)) $o['Address'] = $this->Address;
if (isset($this->Unit)) $o['Unit'] = $this->Unit;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->Zip)) $o['Zip'] = $this->Zip;
if (isset($this->Zone)) $o['Zone'] = $this->Zone;
if (isset($this->Lat)) $o['Lat'] = $this->Lat;
if (isset($this->Lng)) $o['Lng'] = $this->Lng;
if (isset($this->Weekday)) $o['Weekday'] = $this->Weekday;
if (isset($this->WindowStart)) $o['WindowStart'] = $this->WindowStart;
if (isset($this->WindowEnd)) $o['WindowEnd'] = $this->WindowEnd;
if (isset($this->Cadence)) $o['Cadence'] = $this->Cadence;
if (isset($this->AnchorDate)) $o['AnchorDate'] = $this->AnchorDate;
if (isset($this->ServiceLevelCode)) $o['ServiceLevelCode'] = $this->ServiceLevelCode;
if (isset($this->UnitsExpected)) $o['UnitsExpected'] = $this->UnitsExpected;
if (isset($this->Handoff)) $o['Handoff'] = $this->Handoff;
if (isset($this->Instructions)) $o['Instructions'] = $this->Instructions;
if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
if (isset($this->AccountCode)) $o['AccountCode'] = $this->AccountCode;
if (isset($this->Paused)) $o['Paused'] = $this->Paused;
if (isset($this->LastMaterializedDate)) $o['LastMaterializedDate'] = $this->LastMaterializedDate;
if (isset($this->NextDate)) $o['NextDate'] = $this->NextDate;
if (isset($this->SkipDates)) $o['SkipDates'] = JsonConverters::toArray('string', $this->SkipDates);
return empty($o) ? new class(){} : $o;
}
}
class CourierRecurrenceResponse implements JsonSerializable
{
public function __construct(
/** @var array<CourierRecurrenceView>|null */
public ?array $Recurrences=null,
/** @var string|null */
public ?string $Message=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Recurrences'])) $this->Recurrences = JsonConverters::fromArray('CourierRecurrenceView', $o['Recurrences']);
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Recurrences)) $o['Recurrences'] = JsonConverters::toArray('CourierRecurrenceView', $this->Recurrences);
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class CourierRecurrencesRequest implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $ProfileId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProfileId'])) $this->ProfileId = $o['ProfileId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProfileId)) $o['ProfileId'] = $this->ProfileId;
return empty($o) ? new class(){} : $o;
}
}
PHP CourierRecurrencesRequest 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.
GET /v1/dispatch/courier/recurrences HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CourierRecurrenceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Message>String</Message>
<Recurrences>
<CourierRecurrenceView>
<AccountCode>String</AccountCode>
<Address>String</Address>
<AnchorDate>String</AnchorDate>
<Cadence>String</Cadence>
<City>String</City>
<CourierFacilityId>0</CourierFacilityId>
<CourierProfileId>0</CourierProfileId>
<CourierRecurrenceID>0</CourierRecurrenceID>
<CustomerContactId>0</CustomerContactId>
<CustomerName>String</CustomerName>
<CustomerPhone>String</CustomerPhone>
<Handoff>String</Handoff>
<Instructions>String</Instructions>
<LastMaterializedDate>String</LastMaterializedDate>
<Lat>0</Lat>
<Lng>0</Lng>
<NextDate>String</NextDate>
<Paused>false</Paused>
<PayMode>String</PayMode>
<ProfileName>String</ProfileName>
<ServiceLevelCode>String</ServiceLevelCode>
<SkipDates xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</SkipDates>
<Unit>String</Unit>
<UnitsExpected>0</UnitsExpected>
<Weekday>0</Weekday>
<WindowEnd>String</WindowEnd>
<WindowStart>String</WindowStart>
<Zip>String</Zip>
<Zone>String</Zone>
</CourierRecurrenceView>
</Recurrences>
<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>
</CourierRecurrenceResponse>