| GET,POST,PUT,DELETE,OPTIONS | /v1/Job/Schedule/{JobID} |
|---|
<?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 CalendarEvent implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CalendarEventId=0,
/** @var string */
public string $CalendarId='',
/** @var DateTime */
public DateTime $EventStart=new DateTime(),
/** @var DateTime */
public DateTime $EventEnd=new DateTime(),
/** @var string|null */
public ?string $Location=null,
/** @var string|null */
public ?string $Summary=null,
/** @var string|null */
public ?string $Description=null,
/** @var int */
public int $EventTypeId=0,
/** @var bool|null */
public ?bool $Recurrence=null,
/** @var string|null */
public ?string $RecurrenceFrequency=null,
/** @var string|null */
public ?string $RecurrenceBy=null,
/** @var string|null */
public ?string $RecurrenceByValue=null,
/** @var DateTime */
public DateTime $RecurrenceUntil=new DateTime(),
/** @var string|null */
public ?string $CreatedBy=null,
/** @var string|null */
public ?string $CreatedByName=null,
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
/** @var string|null */
public ?string $ModifiedBy=null,
/** @var DateTime */
public DateTime $DateModified=new DateTime(),
/** @var bool|null */
public ?bool $Deleted=null,
/** @var string|null */
public ?string $TimeZone=null,
/** @var int */
public int $Offset=0,
/** @var DateTime */
public DateTime $TextReminderSentDate=new DateTime(),
/** @var bool|null */
public ?bool $Confirmed=null,
/** @var string|null */
public ?string $ConfirmationTextId=null,
/** @var string|null */
public ?string $FirstTextReminderId=null,
/** @var string|null */
public ?string $SecondTextReminderId=null,
/** @var string|null */
public ?string $LocationUID=null,
/** @var DateTime */
public DateTime $AgentReminderSentDate=new DateTime(),
/** @var int */
public int $ContactId=0,
/** @var bool|null */
public ?bool $IsPrivate=null,
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $JobID=0,
/** @var DateTime */
public DateTime $ProjectStartDate=new DateTime(),
/** @var DateTime */
public DateTime $ProjectEndDate=new DateTime(),
/** @var DateTime */
public DateTime $MaxCrewEndDate=new DateTime(),
/** @var DateTime */
public DateTime $MaxEquipmentEndDate=new DateTime(),
/** @var string */
public string $CheckInId='',
/** @var bool|null */
public ?bool $AllDay=null,
/** @var string|null */
public ?string $JobName=null,
/** @var string|null */
public ?string $JobStatusName=null,
/** @var int */
public int $JobStatusId=0,
/** @var string|null */
public ?string $ProjectName=null,
/** @var int */
public int $ResourceId=0,
/** @var string|null */
public ?string $ResourceName=null,
/** @var DateTime */
public DateTime $Original_EventStart=new DateTime(),
/** @var bool|null */
public ?bool $Original_Recurrence=null,
/** @var string|null */
public ?string $Original_RecurrenceFrequency=null,
/** @var string|null */
public ?string $Original_RecurrenceBy=null,
/** @var string|null */
public ?string $Original_RecurrenceByValue=null,
/** @var DateTime */
public DateTime $Original_RecurrenceUntil=new DateTime(),
/** @var string|null */
public ?string $Checksum=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CalendarEventId'])) $this->CalendarEventId = $o['CalendarEventId'];
if (isset($o['CalendarId'])) $this->CalendarId = $o['CalendarId'];
if (isset($o['EventStart'])) $this->EventStart = JsonConverters::from('DateTime', $o['EventStart']);
if (isset($o['EventEnd'])) $this->EventEnd = JsonConverters::from('DateTime', $o['EventEnd']);
if (isset($o['Location'])) $this->Location = $o['Location'];
if (isset($o['Summary'])) $this->Summary = $o['Summary'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['EventTypeId'])) $this->EventTypeId = $o['EventTypeId'];
if (isset($o['Recurrence'])) $this->Recurrence = $o['Recurrence'];
if (isset($o['RecurrenceFrequency'])) $this->RecurrenceFrequency = $o['RecurrenceFrequency'];
if (isset($o['RecurrenceBy'])) $this->RecurrenceBy = $o['RecurrenceBy'];
if (isset($o['RecurrenceByValue'])) $this->RecurrenceByValue = $o['RecurrenceByValue'];
if (isset($o['RecurrenceUntil'])) $this->RecurrenceUntil = JsonConverters::from('DateTime', $o['RecurrenceUntil']);
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['CreatedByName'])) $this->CreatedByName = $o['CreatedByName'];
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['ModifiedBy'])) $this->ModifiedBy = $o['ModifiedBy'];
if (isset($o['DateModified'])) $this->DateModified = JsonConverters::from('DateTime', $o['DateModified']);
if (isset($o['Deleted'])) $this->Deleted = $o['Deleted'];
if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
if (isset($o['Offset'])) $this->Offset = $o['Offset'];
if (isset($o['TextReminderSentDate'])) $this->TextReminderSentDate = JsonConverters::from('DateTime', $o['TextReminderSentDate']);
if (isset($o['Confirmed'])) $this->Confirmed = $o['Confirmed'];
if (isset($o['ConfirmationTextId'])) $this->ConfirmationTextId = $o['ConfirmationTextId'];
if (isset($o['FirstTextReminderId'])) $this->FirstTextReminderId = $o['FirstTextReminderId'];
if (isset($o['SecondTextReminderId'])) $this->SecondTextReminderId = $o['SecondTextReminderId'];
if (isset($o['LocationUID'])) $this->LocationUID = $o['LocationUID'];
if (isset($o['AgentReminderSentDate'])) $this->AgentReminderSentDate = JsonConverters::from('DateTime', $o['AgentReminderSentDate']);
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['IsPrivate'])) $this->IsPrivate = $o['IsPrivate'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['ProjectStartDate'])) $this->ProjectStartDate = JsonConverters::from('DateTime', $o['ProjectStartDate']);
if (isset($o['ProjectEndDate'])) $this->ProjectEndDate = JsonConverters::from('DateTime', $o['ProjectEndDate']);
if (isset($o['MaxCrewEndDate'])) $this->MaxCrewEndDate = JsonConverters::from('DateTime', $o['MaxCrewEndDate']);
if (isset($o['MaxEquipmentEndDate'])) $this->MaxEquipmentEndDate = JsonConverters::from('DateTime', $o['MaxEquipmentEndDate']);
if (isset($o['CheckInId'])) $this->CheckInId = $o['CheckInId'];
if (isset($o['AllDay'])) $this->AllDay = $o['AllDay'];
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['JobStatusName'])) $this->JobStatusName = $o['JobStatusName'];
if (isset($o['JobStatusId'])) $this->JobStatusId = $o['JobStatusId'];
if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
if (isset($o['ResourceId'])) $this->ResourceId = $o['ResourceId'];
if (isset($o['ResourceName'])) $this->ResourceName = $o['ResourceName'];
if (isset($o['Original_EventStart'])) $this->Original_EventStart = JsonConverters::from('DateTime', $o['Original_EventStart']);
if (isset($o['Original_Recurrence'])) $this->Original_Recurrence = $o['Original_Recurrence'];
if (isset($o['Original_RecurrenceFrequency'])) $this->Original_RecurrenceFrequency = $o['Original_RecurrenceFrequency'];
if (isset($o['Original_RecurrenceBy'])) $this->Original_RecurrenceBy = $o['Original_RecurrenceBy'];
if (isset($o['Original_RecurrenceByValue'])) $this->Original_RecurrenceByValue = $o['Original_RecurrenceByValue'];
if (isset($o['Original_RecurrenceUntil'])) $this->Original_RecurrenceUntil = JsonConverters::from('DateTime', $o['Original_RecurrenceUntil']);
if (isset($o['Checksum'])) $this->Checksum = $o['Checksum'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CalendarEventId)) $o['CalendarEventId'] = $this->CalendarEventId;
if (isset($this->CalendarId)) $o['CalendarId'] = $this->CalendarId;
if (isset($this->EventStart)) $o['EventStart'] = JsonConverters::to('DateTime', $this->EventStart);
if (isset($this->EventEnd)) $o['EventEnd'] = JsonConverters::to('DateTime', $this->EventEnd);
if (isset($this->Location)) $o['Location'] = $this->Location;
if (isset($this->Summary)) $o['Summary'] = $this->Summary;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->EventTypeId)) $o['EventTypeId'] = $this->EventTypeId;
if (isset($this->Recurrence)) $o['Recurrence'] = $this->Recurrence;
if (isset($this->RecurrenceFrequency)) $o['RecurrenceFrequency'] = $this->RecurrenceFrequency;
if (isset($this->RecurrenceBy)) $o['RecurrenceBy'] = $this->RecurrenceBy;
if (isset($this->RecurrenceByValue)) $o['RecurrenceByValue'] = $this->RecurrenceByValue;
if (isset($this->RecurrenceUntil)) $o['RecurrenceUntil'] = JsonConverters::to('DateTime', $this->RecurrenceUntil);
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->CreatedByName)) $o['CreatedByName'] = $this->CreatedByName;
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->ModifiedBy)) $o['ModifiedBy'] = $this->ModifiedBy;
if (isset($this->DateModified)) $o['DateModified'] = JsonConverters::to('DateTime', $this->DateModified);
if (isset($this->Deleted)) $o['Deleted'] = $this->Deleted;
if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
if (isset($this->Offset)) $o['Offset'] = $this->Offset;
if (isset($this->TextReminderSentDate)) $o['TextReminderSentDate'] = JsonConverters::to('DateTime', $this->TextReminderSentDate);
if (isset($this->Confirmed)) $o['Confirmed'] = $this->Confirmed;
if (isset($this->ConfirmationTextId)) $o['ConfirmationTextId'] = $this->ConfirmationTextId;
if (isset($this->FirstTextReminderId)) $o['FirstTextReminderId'] = $this->FirstTextReminderId;
if (isset($this->SecondTextReminderId)) $o['SecondTextReminderId'] = $this->SecondTextReminderId;
if (isset($this->LocationUID)) $o['LocationUID'] = $this->LocationUID;
if (isset($this->AgentReminderSentDate)) $o['AgentReminderSentDate'] = JsonConverters::to('DateTime', $this->AgentReminderSentDate);
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->IsPrivate)) $o['IsPrivate'] = $this->IsPrivate;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->ProjectStartDate)) $o['ProjectStartDate'] = JsonConverters::to('DateTime', $this->ProjectStartDate);
if (isset($this->ProjectEndDate)) $o['ProjectEndDate'] = JsonConverters::to('DateTime', $this->ProjectEndDate);
if (isset($this->MaxCrewEndDate)) $o['MaxCrewEndDate'] = JsonConverters::to('DateTime', $this->MaxCrewEndDate);
if (isset($this->MaxEquipmentEndDate)) $o['MaxEquipmentEndDate'] = JsonConverters::to('DateTime', $this->MaxEquipmentEndDate);
if (isset($this->CheckInId)) $o['CheckInId'] = $this->CheckInId;
if (isset($this->AllDay)) $o['AllDay'] = $this->AllDay;
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->JobStatusName)) $o['JobStatusName'] = $this->JobStatusName;
if (isset($this->JobStatusId)) $o['JobStatusId'] = $this->JobStatusId;
if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
if (isset($this->ResourceId)) $o['ResourceId'] = $this->ResourceId;
if (isset($this->ResourceName)) $o['ResourceName'] = $this->ResourceName;
if (isset($this->Original_EventStart)) $o['Original_EventStart'] = JsonConverters::to('DateTime', $this->Original_EventStart);
if (isset($this->Original_Recurrence)) $o['Original_Recurrence'] = $this->Original_Recurrence;
if (isset($this->Original_RecurrenceFrequency)) $o['Original_RecurrenceFrequency'] = $this->Original_RecurrenceFrequency;
if (isset($this->Original_RecurrenceBy)) $o['Original_RecurrenceBy'] = $this->Original_RecurrenceBy;
if (isset($this->Original_RecurrenceByValue)) $o['Original_RecurrenceByValue'] = $this->Original_RecurrenceByValue;
if (isset($this->Original_RecurrenceUntil)) $o['Original_RecurrenceUntil'] = JsonConverters::to('DateTime', $this->Original_RecurrenceUntil);
if (isset($this->Checksum)) $o['Checksum'] = $this->Checksum;
return empty($o) ? new class(){} : $o;
}
}
class JobScheduleResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<CalendarEvent>|null */
public ?array $JobSchedule=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['JobSchedule'])) $this->JobSchedule = JsonConverters::fromArray('CalendarEvent', $o['JobSchedule']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->JobSchedule)) $o['JobSchedule'] = JsonConverters::toArray('CalendarEvent', $this->JobSchedule);
return empty($o) ? new class(){} : $o;
}
}
class JobScheduleRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Job/Schedule/{JobID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
JobID: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
JobSchedule:
[
{
CalendarEventId: 0,
CalendarId: 00000000000000000000000000000000,
EventStart: 0001-01-01,
EventEnd: 0001-01-01,
Location: String,
Summary: String,
Description: String,
EventTypeId: 0,
Recurrence: False,
RecurrenceFrequency: String,
RecurrenceBy: String,
RecurrenceByValue: String,
RecurrenceUntil: 0001-01-01,
CreatedBy: String,
CreatedByName: String,
DateCreated: 0001-01-01,
ModifiedBy: String,
DateModified: 0001-01-01,
Deleted: False,
TimeZone: String,
Offset: 0,
TextReminderSentDate: 0001-01-01,
Confirmed: False,
ConfirmationTextId: String,
FirstTextReminderId: String,
SecondTextReminderId: String,
LocationUID: 00000000000000000000000000000000,
AgentReminderSentDate: 0001-01-01,
ContactId: 0,
IsPrivate: False,
ProjectID: 0,
JobID: 0,
ProjectStartDate: 0001-01-01,
ProjectEndDate: 0001-01-01,
MaxCrewEndDate: 0001-01-01,
MaxEquipmentEndDate: 0001-01-01,
CheckInId: 00000000000000000000000000000000,
AllDay: False,
JobName: String,
JobStatusName: String,
JobStatusId: 0,
ProjectName: String,
ResourceId: 0,
ResourceName: String,
Original_EventStart: 0001-01-01,
Original_Recurrence: False,
Original_RecurrenceFrequency: String,
Original_RecurrenceBy: String,
Original_RecurrenceByValue: String,
Original_RecurrenceUntil: 0001-01-01,
Checksum: String
}
]
}