| GET,POST,PUT,DELETE,OPTIONS | /v1/Job | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/Job/{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 Location implements JsonSerializable
{
public function __construct(
/** @var string */
public string $Id='',
/** @var string */
public string $ClientId='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Address1=null,
/** @var string|null */
public ?string $Address2=null,
/** @var string|null */
public ?string $City=null,
/** @var string|null */
public ?string $State=null,
/** @var string|null */
public ?string $Zip=null,
/** @var string|null */
public ?string $Phone=null,
/** @var string|null */
public ?string $Fax=null,
/** @var string|null */
public ?string $URL=null,
/** @var string|null */
public ?string $Email=null,
/** @var string|null */
public ?string $TimeZone=null,
/** @var bool|null */
public ?bool $Active=null,
/** @var DateTime */
public DateTime $EntDate=new DateTime(),
/** @var DateTime */
public DateTime $ModDate=new DateTime(),
/** @var string|null */
public ?string $LocationImage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['ClientId'])) $this->ClientId = $o['ClientId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Address1'])) $this->Address1 = $o['Address1'];
if (isset($o['Address2'])) $this->Address2 = $o['Address2'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['State'])) $this->State = $o['State'];
if (isset($o['Zip'])) $this->Zip = $o['Zip'];
if (isset($o['Phone'])) $this->Phone = $o['Phone'];
if (isset($o['Fax'])) $this->Fax = $o['Fax'];
if (isset($o['URL'])) $this->URL = $o['URL'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['EntDate'])) $this->EntDate = JsonConverters::from('DateTime', $o['EntDate']);
if (isset($o['ModDate'])) $this->ModDate = JsonConverters::from('DateTime', $o['ModDate']);
if (isset($o['LocationImage'])) $this->LocationImage = $o['LocationImage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->ClientId)) $o['ClientId'] = $this->ClientId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Address1)) $o['Address1'] = $this->Address1;
if (isset($this->Address2)) $o['Address2'] = $this->Address2;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->State)) $o['State'] = $this->State;
if (isset($this->Zip)) $o['Zip'] = $this->Zip;
if (isset($this->Phone)) $o['Phone'] = $this->Phone;
if (isset($this->Fax)) $o['Fax'] = $this->Fax;
if (isset($this->URL)) $o['URL'] = $this->URL;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->EntDate)) $o['EntDate'] = JsonConverters::to('DateTime', $this->EntDate);
if (isset($this->ModDate)) $o['ModDate'] = JsonConverters::to('DateTime', $this->ModDate);
if (isset($this->LocationImage)) $o['LocationImage'] = $this->LocationImage;
return empty($o) ? new class(){} : $o;
}
}
class Job implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0,
/** @var string|null */
public ?string $JobName=null,
/** @var string|null */
public ?string $Description=null,
/** @var int */
public int $JobTypeID=0,
/** @var DateTime */
public DateTime $ExpectedStartDate=new DateTime(),
/** @var DateTime */
public DateTime $ActualStartDate=new DateTime(),
/** @var DateTime */
public DateTime $ExpectedCompletionDate=new DateTime(),
/** @var DateTime */
public DateTime $ActualEndDate=new DateTime(),
/** @var bool|null */
public ?bool $Active=null,
/** @var string */
public string $CreatedByUID='',
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $StatusId=0,
/** @var bool|null */
public ?bool $AdvancedScheduling=null,
/** @var bool|null */
public ?bool $ShowTimes=null,
/** @var array<CalendarEvent>|null */
public ?array $Schedule=null,
/** @var bool|null */
public ?bool $HasScheduledWorkers=null,
/** @var bool|null */
public ?bool $HasScheduledPlaceholders=null,
/** @var string|null */
public ?string $ClientApprovalStatus=null,
/** @var float */
public float $InternalCost=0.0,
/** @var float */
public float $CostToClient=0.0,
/** @var Location|null */
public ?Location $Location=null,
/** @var int|null */
public ?int $ProjectLocationID=null,
/** @var int|null */
public ?int $ProjectLocationAreaID=null,
/** @var string|null */
public ?string $ProjectLocationName=null,
/** @var string|null */
public ?string $ProjectLocationAddress1=null,
/** @var string|null */
public ?string $ProjectLocationAddress2=null,
/** @var string|null */
public ?string $ProjectLocationCity=null,
/** @var string|null */
public ?string $ProjectLocationState=null,
/** @var string|null */
public ?string $ProjectLocationZip=null,
/** @var string|null */
public ?string $ProjectLocationAreaName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['JobTypeID'])) $this->JobTypeID = $o['JobTypeID'];
if (isset($o['ExpectedStartDate'])) $this->ExpectedStartDate = JsonConverters::from('DateTime', $o['ExpectedStartDate']);
if (isset($o['ActualStartDate'])) $this->ActualStartDate = JsonConverters::from('DateTime', $o['ActualStartDate']);
if (isset($o['ExpectedCompletionDate'])) $this->ExpectedCompletionDate = JsonConverters::from('DateTime', $o['ExpectedCompletionDate']);
if (isset($o['ActualEndDate'])) $this->ActualEndDate = JsonConverters::from('DateTime', $o['ActualEndDate']);
if (isset($o['Active'])) $this->Active = $o['Active'];
if (isset($o['CreatedByUID'])) $this->CreatedByUID = $o['CreatedByUID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['StatusId'])) $this->StatusId = $o['StatusId'];
if (isset($o['AdvancedScheduling'])) $this->AdvancedScheduling = $o['AdvancedScheduling'];
if (isset($o['ShowTimes'])) $this->ShowTimes = $o['ShowTimes'];
if (isset($o['Schedule'])) $this->Schedule = JsonConverters::fromArray('CalendarEvent', $o['Schedule']);
if (isset($o['HasScheduledWorkers'])) $this->HasScheduledWorkers = $o['HasScheduledWorkers'];
if (isset($o['HasScheduledPlaceholders'])) $this->HasScheduledPlaceholders = $o['HasScheduledPlaceholders'];
if (isset($o['ClientApprovalStatus'])) $this->ClientApprovalStatus = $o['ClientApprovalStatus'];
if (isset($o['InternalCost'])) $this->InternalCost = $o['InternalCost'];
if (isset($o['CostToClient'])) $this->CostToClient = $o['CostToClient'];
if (isset($o['Location'])) $this->Location = JsonConverters::from('Location', $o['Location']);
if (isset($o['ProjectLocationID'])) $this->ProjectLocationID = $o['ProjectLocationID'];
if (isset($o['ProjectLocationAreaID'])) $this->ProjectLocationAreaID = $o['ProjectLocationAreaID'];
if (isset($o['ProjectLocationName'])) $this->ProjectLocationName = $o['ProjectLocationName'];
if (isset($o['ProjectLocationAddress1'])) $this->ProjectLocationAddress1 = $o['ProjectLocationAddress1'];
if (isset($o['ProjectLocationAddress2'])) $this->ProjectLocationAddress2 = $o['ProjectLocationAddress2'];
if (isset($o['ProjectLocationCity'])) $this->ProjectLocationCity = $o['ProjectLocationCity'];
if (isset($o['ProjectLocationState'])) $this->ProjectLocationState = $o['ProjectLocationState'];
if (isset($o['ProjectLocationZip'])) $this->ProjectLocationZip = $o['ProjectLocationZip'];
if (isset($o['ProjectLocationAreaName'])) $this->ProjectLocationAreaName = $o['ProjectLocationAreaName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->JobTypeID)) $o['JobTypeID'] = $this->JobTypeID;
if (isset($this->ExpectedStartDate)) $o['ExpectedStartDate'] = JsonConverters::to('DateTime', $this->ExpectedStartDate);
if (isset($this->ActualStartDate)) $o['ActualStartDate'] = JsonConverters::to('DateTime', $this->ActualStartDate);
if (isset($this->ExpectedCompletionDate)) $o['ExpectedCompletionDate'] = JsonConverters::to('DateTime', $this->ExpectedCompletionDate);
if (isset($this->ActualEndDate)) $o['ActualEndDate'] = JsonConverters::to('DateTime', $this->ActualEndDate);
if (isset($this->Active)) $o['Active'] = $this->Active;
if (isset($this->CreatedByUID)) $o['CreatedByUID'] = $this->CreatedByUID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->StatusId)) $o['StatusId'] = $this->StatusId;
if (isset($this->AdvancedScheduling)) $o['AdvancedScheduling'] = $this->AdvancedScheduling;
if (isset($this->ShowTimes)) $o['ShowTimes'] = $this->ShowTimes;
if (isset($this->Schedule)) $o['Schedule'] = JsonConverters::toArray('CalendarEvent', $this->Schedule);
if (isset($this->HasScheduledWorkers)) $o['HasScheduledWorkers'] = $this->HasScheduledWorkers;
if (isset($this->HasScheduledPlaceholders)) $o['HasScheduledPlaceholders'] = $this->HasScheduledPlaceholders;
if (isset($this->ClientApprovalStatus)) $o['ClientApprovalStatus'] = $this->ClientApprovalStatus;
if (isset($this->InternalCost)) $o['InternalCost'] = $this->InternalCost;
if (isset($this->CostToClient)) $o['CostToClient'] = $this->CostToClient;
if (isset($this->Location)) $o['Location'] = JsonConverters::to('Location', $this->Location);
if (isset($this->ProjectLocationID)) $o['ProjectLocationID'] = $this->ProjectLocationID;
if (isset($this->ProjectLocationAreaID)) $o['ProjectLocationAreaID'] = $this->ProjectLocationAreaID;
if (isset($this->ProjectLocationName)) $o['ProjectLocationName'] = $this->ProjectLocationName;
if (isset($this->ProjectLocationAddress1)) $o['ProjectLocationAddress1'] = $this->ProjectLocationAddress1;
if (isset($this->ProjectLocationAddress2)) $o['ProjectLocationAddress2'] = $this->ProjectLocationAddress2;
if (isset($this->ProjectLocationCity)) $o['ProjectLocationCity'] = $this->ProjectLocationCity;
if (isset($this->ProjectLocationState)) $o['ProjectLocationState'] = $this->ProjectLocationState;
if (isset($this->ProjectLocationZip)) $o['ProjectLocationZip'] = $this->ProjectLocationZip;
if (isset($this->ProjectLocationAreaName)) $o['ProjectLocationAreaName'] = $this->ProjectLocationAreaName;
return empty($o) ? new class(){} : $o;
}
}
class JobResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<Job>|null */
public ?array $Job=null,
/** @var bool|null */
public ?bool $RequiresConfirm=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Job'])) $this->Job = JsonConverters::fromArray('Job', $o['Job']);
if (isset($o['RequiresConfirm'])) $this->RequiresConfirm = $o['RequiresConfirm'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Job)) $o['Job'] = JsonConverters::toArray('Job', $this->Job);
if (isset($this->RequiresConfirm)) $o['RequiresConfirm'] = $this->RequiresConfirm;
return empty($o) ? new class(){} : $o;
}
}
class JobRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0,
/** @var bool|null */
public ?bool $Accept=null,
/** @var bool|null */
public ?bool $UpdateJobOnly=null,
/** @var array<Job>|null */
public ?array $Job=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['Accept'])) $this->Accept = $o['Accept'];
if (isset($o['UpdateJobOnly'])) $this->UpdateJobOnly = $o['UpdateJobOnly'];
if (isset($o['Job'])) $this->Job = JsonConverters::fromArray('Job', $o['Job']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->Accept)) $o['Accept'] = $this->Accept;
if (isset($this->UpdateJobOnly)) $o['UpdateJobOnly'] = $this->UpdateJobOnly;
if (isset($this->Job)) $o['Job'] = JsonConverters::toArray('Job', $this->Job);
return empty($o) ? new class(){} : $o;
}
}
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.
POST /v1/Job HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<JobRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Accept>false</Accept>
<Job>
<Job>
<Active>false</Active>
<ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
<ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
<AdvancedScheduling>false</AdvancedScheduling>
<ClientApprovalStatus>String</ClientApprovalStatus>
<CostToClient>0</CostToClient>
<CreatedByUID>00000000-0000-0000-0000-000000000000</CreatedByUID>
<Description>String</Description>
<ExpectedCompletionDate>0001-01-01T00:00:00</ExpectedCompletionDate>
<ExpectedStartDate>0001-01-01T00:00:00</ExpectedStartDate>
<HasScheduledPlaceholders>false</HasScheduledPlaceholders>
<HasScheduledWorkers>false</HasScheduledWorkers>
<InternalCost>0</InternalCost>
<JobID>0</JobID>
<JobName>String</JobName>
<JobTypeID>0</JobTypeID>
<Location>
<Active>false</Active>
<Address1>String</Address1>
<Address2>String</Address2>
<City>String</City>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Email>String</Email>
<EntDate>0001-01-01T00:00:00</EntDate>
<Fax>String</Fax>
<Id>00000000-0000-0000-0000-000000000000</Id>
<LocationImage>String</LocationImage>
<ModDate>0001-01-01T00:00:00</ModDate>
<Name>String</Name>
<Phone>String</Phone>
<State>String</State>
<TimeZone>String</TimeZone>
<URL>String</URL>
<Zip>String</Zip>
</Location>
<ProjectID>0</ProjectID>
<ProjectLocationAddress1>String</ProjectLocationAddress1>
<ProjectLocationAddress2>String</ProjectLocationAddress2>
<ProjectLocationAreaID>0</ProjectLocationAreaID>
<ProjectLocationAreaName>String</ProjectLocationAreaName>
<ProjectLocationCity>String</ProjectLocationCity>
<ProjectLocationID>0</ProjectLocationID>
<ProjectLocationName>String</ProjectLocationName>
<ProjectLocationState>String</ProjectLocationState>
<ProjectLocationZip>String</ProjectLocationZip>
<Schedule>
<CalendarEvent>
<AgentReminderSentDate>0001-01-01T00:00:00</AgentReminderSentDate>
<AllDay>false</AllDay>
<CalendarEventId>0</CalendarEventId>
<CalendarId>00000000-0000-0000-0000-000000000000</CalendarId>
<CheckInId>00000000-0000-0000-0000-000000000000</CheckInId>
<Checksum>String</Checksum>
<ConfirmationTextId>String</ConfirmationTextId>
<Confirmed>false</Confirmed>
<ContactId>0</ContactId>
<CreatedBy>String</CreatedBy>
<CreatedByName>String</CreatedByName>
<DateCreated>0001-01-01T00:00:00</DateCreated>
<DateModified>0001-01-01T00:00:00</DateModified>
<Deleted>false</Deleted>
<Description>String</Description>
<EventEnd>0001-01-01T00:00:00</EventEnd>
<EventStart>0001-01-01T00:00:00</EventStart>
<EventTypeId>0</EventTypeId>
<FirstTextReminderId>String</FirstTextReminderId>
<IsPrivate>false</IsPrivate>
<JobID>0</JobID>
<JobName>String</JobName>
<JobStatusId>0</JobStatusId>
<JobStatusName>String</JobStatusName>
<Location>String</Location>
<LocationUID>00000000-0000-0000-0000-000000000000</LocationUID>
<MaxCrewEndDate>0001-01-01T00:00:00</MaxCrewEndDate>
<MaxEquipmentEndDate>0001-01-01T00:00:00</MaxEquipmentEndDate>
<ModifiedBy>String</ModifiedBy>
<Offset>0</Offset>
<Original_EventStart>0001-01-01T00:00:00</Original_EventStart>
<Original_Recurrence>false</Original_Recurrence>
<Original_RecurrenceBy>String</Original_RecurrenceBy>
<Original_RecurrenceByValue>String</Original_RecurrenceByValue>
<Original_RecurrenceFrequency>String</Original_RecurrenceFrequency>
<Original_RecurrenceUntil>0001-01-01T00:00:00</Original_RecurrenceUntil>
<ProjectEndDate>0001-01-01T00:00:00</ProjectEndDate>
<ProjectID>0</ProjectID>
<ProjectName>String</ProjectName>
<ProjectStartDate>0001-01-01T00:00:00</ProjectStartDate>
<Recurrence>false</Recurrence>
<RecurrenceBy>String</RecurrenceBy>
<RecurrenceByValue>String</RecurrenceByValue>
<RecurrenceFrequency>String</RecurrenceFrequency>
<RecurrenceUntil>0001-01-01T00:00:00</RecurrenceUntil>
<ResourceId>0</ResourceId>
<ResourceName>String</ResourceName>
<SecondTextReminderId>String</SecondTextReminderId>
<Summary>String</Summary>
<TextReminderSentDate>0001-01-01T00:00:00</TextReminderSentDate>
<TimeZone>String</TimeZone>
</CalendarEvent>
</Schedule>
<ShowTimes>false</ShowTimes>
<StatusId>0</StatusId>
</Job>
</Job>
<JobID>0</JobID>
<UpdateJobOnly>false</UpdateJobOnly>
</JobRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<JobResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Job>
<Job>
<Active>false</Active>
<ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
<ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
<AdvancedScheduling>false</AdvancedScheduling>
<ClientApprovalStatus>String</ClientApprovalStatus>
<CostToClient>0</CostToClient>
<CreatedByUID>00000000-0000-0000-0000-000000000000</CreatedByUID>
<Description>String</Description>
<ExpectedCompletionDate>0001-01-01T00:00:00</ExpectedCompletionDate>
<ExpectedStartDate>0001-01-01T00:00:00</ExpectedStartDate>
<HasScheduledPlaceholders>false</HasScheduledPlaceholders>
<HasScheduledWorkers>false</HasScheduledWorkers>
<InternalCost>0</InternalCost>
<JobID>0</JobID>
<JobName>String</JobName>
<JobTypeID>0</JobTypeID>
<Location>
<Active>false</Active>
<Address1>String</Address1>
<Address2>String</Address2>
<City>String</City>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Email>String</Email>
<EntDate>0001-01-01T00:00:00</EntDate>
<Fax>String</Fax>
<Id>00000000-0000-0000-0000-000000000000</Id>
<LocationImage>String</LocationImage>
<ModDate>0001-01-01T00:00:00</ModDate>
<Name>String</Name>
<Phone>String</Phone>
<State>String</State>
<TimeZone>String</TimeZone>
<URL>String</URL>
<Zip>String</Zip>
</Location>
<ProjectID>0</ProjectID>
<ProjectLocationAddress1>String</ProjectLocationAddress1>
<ProjectLocationAddress2>String</ProjectLocationAddress2>
<ProjectLocationAreaID>0</ProjectLocationAreaID>
<ProjectLocationAreaName>String</ProjectLocationAreaName>
<ProjectLocationCity>String</ProjectLocationCity>
<ProjectLocationID>0</ProjectLocationID>
<ProjectLocationName>String</ProjectLocationName>
<ProjectLocationState>String</ProjectLocationState>
<ProjectLocationZip>String</ProjectLocationZip>
<Schedule>
<CalendarEvent>
<AgentReminderSentDate>0001-01-01T00:00:00</AgentReminderSentDate>
<AllDay>false</AllDay>
<CalendarEventId>0</CalendarEventId>
<CalendarId>00000000-0000-0000-0000-000000000000</CalendarId>
<CheckInId>00000000-0000-0000-0000-000000000000</CheckInId>
<Checksum>String</Checksum>
<ConfirmationTextId>String</ConfirmationTextId>
<Confirmed>false</Confirmed>
<ContactId>0</ContactId>
<CreatedBy>String</CreatedBy>
<CreatedByName>String</CreatedByName>
<DateCreated>0001-01-01T00:00:00</DateCreated>
<DateModified>0001-01-01T00:00:00</DateModified>
<Deleted>false</Deleted>
<Description>String</Description>
<EventEnd>0001-01-01T00:00:00</EventEnd>
<EventStart>0001-01-01T00:00:00</EventStart>
<EventTypeId>0</EventTypeId>
<FirstTextReminderId>String</FirstTextReminderId>
<IsPrivate>false</IsPrivate>
<JobID>0</JobID>
<JobName>String</JobName>
<JobStatusId>0</JobStatusId>
<JobStatusName>String</JobStatusName>
<Location>String</Location>
<LocationUID>00000000-0000-0000-0000-000000000000</LocationUID>
<MaxCrewEndDate>0001-01-01T00:00:00</MaxCrewEndDate>
<MaxEquipmentEndDate>0001-01-01T00:00:00</MaxEquipmentEndDate>
<ModifiedBy>String</ModifiedBy>
<Offset>0</Offset>
<Original_EventStart>0001-01-01T00:00:00</Original_EventStart>
<Original_Recurrence>false</Original_Recurrence>
<Original_RecurrenceBy>String</Original_RecurrenceBy>
<Original_RecurrenceByValue>String</Original_RecurrenceByValue>
<Original_RecurrenceFrequency>String</Original_RecurrenceFrequency>
<Original_RecurrenceUntil>0001-01-01T00:00:00</Original_RecurrenceUntil>
<ProjectEndDate>0001-01-01T00:00:00</ProjectEndDate>
<ProjectID>0</ProjectID>
<ProjectName>String</ProjectName>
<ProjectStartDate>0001-01-01T00:00:00</ProjectStartDate>
<Recurrence>false</Recurrence>
<RecurrenceBy>String</RecurrenceBy>
<RecurrenceByValue>String</RecurrenceByValue>
<RecurrenceFrequency>String</RecurrenceFrequency>
<RecurrenceUntil>0001-01-01T00:00:00</RecurrenceUntil>
<ResourceId>0</ResourceId>
<ResourceName>String</ResourceName>
<SecondTextReminderId>String</SecondTextReminderId>
<Summary>String</Summary>
<TextReminderSentDate>0001-01-01T00:00:00</TextReminderSentDate>
<TimeZone>String</TimeZone>
</CalendarEvent>
</Schedule>
<ShowTimes>false</ShowTimes>
<StatusId>0</StatusId>
</Job>
</Job>
<RequiresConfirm>false</RequiresConfirm>
<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>
</JobResponse>