| POST,OPTIONS | /v1/dispatch/courier/recurrences | ||
|---|---|---|---|
| PUT,OPTIONS | /v1/dispatch/courier/recurrences/{Id} |
<?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 CourierRecurrenceSaveRequest implements JsonSerializable
{
public function __construct(
/** @var int|null */
public ?int $Id=null,
/** @var CourierRecurrenceView|null */
public ?CourierRecurrenceView $Recurrence=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Recurrence'])) $this->Recurrence = JsonConverters::from('CourierRecurrenceView', $o['Recurrence']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Recurrence)) $o['Recurrence'] = JsonConverters::to('CourierRecurrenceView', $this->Recurrence);
return empty($o) ? new class(){} : $o;
}
}
PHP CourierRecurrenceSaveRequest 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/dispatch/courier/recurrences HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Id":0,"Recurrence":{"CourierRecurrenceID":0,"CourierProfileId":0,"ProfileName":"String","CourierFacilityId":0,"CustomerContactId":0,"CustomerName":"String","CustomerPhone":"String","Address":"String","Unit":"String","City":"String","Zip":"String","Zone":"String","Lat":0,"Lng":0,"Weekday":0,"WindowStart":"String","WindowEnd":"String","Cadence":"String","AnchorDate":"String","ServiceLevelCode":"String","UnitsExpected":0,"Handoff":"String","Instructions":"String","PayMode":"String","AccountCode":"String","Paused":false,"LastMaterializedDate":"String","NextDate":"String","SkipDates":["String"]}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Recurrences":[{"CourierRecurrenceID":0,"CourierProfileId":0,"ProfileName":"String","CourierFacilityId":0,"CustomerContactId":0,"CustomerName":"String","CustomerPhone":"String","Address":"String","Unit":"String","City":"String","Zip":"String","Zone":"String","Lat":0,"Lng":0,"Weekday":0,"WindowStart":"String","WindowEnd":"String","Cadence":"String","AnchorDate":"String","ServiceLevelCode":"String","UnitsExpected":0,"Handoff":"String","Instructions":"String","PayMode":"String","AccountCode":"String","Paused":false,"LastMaterializedDate":"String","NextDate":"String","SkipDates":["String"]}],"Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}