| POST | /v1/schedule/job/workers |
|---|
<?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 WorkerScheduleItem implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkerScheduleItemID=0,
/** @var int */
public int $JobID=0,
/** @var int|null */
public ?int $ProjectID=null,
/** @var int */
public int $ContactID=0,
/** @var DateTime|null */
public ?DateTime $ScheduledDate=null,
/** @var int */
public int $SortOrder=0,
/** @var int|null */
public ?int $SourceCrewID=null,
/** @var string|null */
public ?string $Status=null,
/** @var DateTime|null */
public ?DateTime $StartedAt=null,
/** @var DateTime|null */
public ?DateTime $CompletedAt=null,
/** @var string|null */
public ?string $WorkerNotes=null,
/** @var string|null */
public ?string $JobName=null,
/** @var string|null */
public ?string $ProjectName=null,
/** @var string|null */
public ?string $FirstName=null,
/** @var string|null */
public ?string $LastName=null,
/** @var string|null */
public ?string $WorkerName=null,
/** @var string|null */
public ?string $SourceCrewName=null,
/** @var int|null */
public ?int $ProjectLocationID=null,
/** @var string|null */
public ?string $ProjectLocationName=null,
/** @var string|null */
public ?string $LocationZip=null,
/** @var string|null */
public ?string $LocationCity=null,
/** @var float|null */
public ?float $LocationLatitude=null,
/** @var float|null */
public ?float $LocationLongitude=null,
/** @var string|null */
public ?string $JobStatusName=null,
/** @var string */
public string $BranchId='',
/** @var string|null */
public ?string $BranchName=null,
/** @var string|null */
public ?string $WorkerHomeBranchId=null,
/** @var string|null */
public ?string $WorkerHomeBranchName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkerScheduleItemID'])) $this->WorkerScheduleItemID = $o['WorkerScheduleItemID'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
if (isset($o['ScheduledDate'])) $this->ScheduledDate = JsonConverters::from('DateTime', $o['ScheduledDate']);
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
if (isset($o['SourceCrewID'])) $this->SourceCrewID = $o['SourceCrewID'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['StartedAt'])) $this->StartedAt = JsonConverters::from('DateTime', $o['StartedAt']);
if (isset($o['CompletedAt'])) $this->CompletedAt = JsonConverters::from('DateTime', $o['CompletedAt']);
if (isset($o['WorkerNotes'])) $this->WorkerNotes = $o['WorkerNotes'];
if (isset($o['JobName'])) $this->JobName = $o['JobName'];
if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['WorkerName'])) $this->WorkerName = $o['WorkerName'];
if (isset($o['SourceCrewName'])) $this->SourceCrewName = $o['SourceCrewName'];
if (isset($o['ProjectLocationID'])) $this->ProjectLocationID = $o['ProjectLocationID'];
if (isset($o['ProjectLocationName'])) $this->ProjectLocationName = $o['ProjectLocationName'];
if (isset($o['LocationZip'])) $this->LocationZip = $o['LocationZip'];
if (isset($o['LocationCity'])) $this->LocationCity = $o['LocationCity'];
if (isset($o['LocationLatitude'])) $this->LocationLatitude = $o['LocationLatitude'];
if (isset($o['LocationLongitude'])) $this->LocationLongitude = $o['LocationLongitude'];
if (isset($o['JobStatusName'])) $this->JobStatusName = $o['JobStatusName'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
if (isset($o['WorkerHomeBranchId'])) $this->WorkerHomeBranchId = $o['WorkerHomeBranchId'];
if (isset($o['WorkerHomeBranchName'])) $this->WorkerHomeBranchName = $o['WorkerHomeBranchName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkerScheduleItemID)) $o['WorkerScheduleItemID'] = $this->WorkerScheduleItemID;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
if (isset($this->ScheduledDate)) $o['ScheduledDate'] = JsonConverters::to('DateTime', $this->ScheduledDate);
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
if (isset($this->SourceCrewID)) $o['SourceCrewID'] = $this->SourceCrewID;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->StartedAt)) $o['StartedAt'] = JsonConverters::to('DateTime', $this->StartedAt);
if (isset($this->CompletedAt)) $o['CompletedAt'] = JsonConverters::to('DateTime', $this->CompletedAt);
if (isset($this->WorkerNotes)) $o['WorkerNotes'] = $this->WorkerNotes;
if (isset($this->JobName)) $o['JobName'] = $this->JobName;
if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->WorkerName)) $o['WorkerName'] = $this->WorkerName;
if (isset($this->SourceCrewName)) $o['SourceCrewName'] = $this->SourceCrewName;
if (isset($this->ProjectLocationID)) $o['ProjectLocationID'] = $this->ProjectLocationID;
if (isset($this->ProjectLocationName)) $o['ProjectLocationName'] = $this->ProjectLocationName;
if (isset($this->LocationZip)) $o['LocationZip'] = $this->LocationZip;
if (isset($this->LocationCity)) $o['LocationCity'] = $this->LocationCity;
if (isset($this->LocationLatitude)) $o['LocationLatitude'] = $this->LocationLatitude;
if (isset($this->LocationLongitude)) $o['LocationLongitude'] = $this->LocationLongitude;
if (isset($this->JobStatusName)) $o['JobStatusName'] = $this->JobStatusName;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
if (isset($this->WorkerHomeBranchId)) $o['WorkerHomeBranchId'] = $this->WorkerHomeBranchId;
if (isset($this->WorkerHomeBranchName)) $o['WorkerHomeBranchName'] = $this->WorkerHomeBranchName;
return empty($o) ? new class(){} : $o;
}
}
class SchedulableJob implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0,
/** @var string|null */
public ?string $JobName=null,
/** @var int */
public int $ProjectID=0,
/** @var string|null */
public ?string $ProjectName=null,
/** @var int|null */
public ?int $StatusID=null,
/** @var string|null */
public ?string $StatusName=null,
/** @var int|null */
public ?int $ProjectLocationID=null,
/** @var string|null */
public ?string $ProjectLocationName=null,
/** @var string|null */
public ?string $LocationZip=null,
/** @var string|null */
public ?string $LocationCity=null,
/** @var float|null */
public ?float $LocationLatitude=null,
/** @var float|null */
public ?float $LocationLongitude=null,
/** @var DateTime|null */
public ?DateTime $ExpectedStartDate=null,
/** @var DateTime|null */
public ?DateTime $ExpectedCompletionDate=null,
/** @var bool|null */
public ?bool $IsRecurring=null,
/** @var array<string>|null */
public ?array $OccurrenceDates=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['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
if (isset($o['StatusID'])) $this->StatusID = $o['StatusID'];
if (isset($o['StatusName'])) $this->StatusName = $o['StatusName'];
if (isset($o['ProjectLocationID'])) $this->ProjectLocationID = $o['ProjectLocationID'];
if (isset($o['ProjectLocationName'])) $this->ProjectLocationName = $o['ProjectLocationName'];
if (isset($o['LocationZip'])) $this->LocationZip = $o['LocationZip'];
if (isset($o['LocationCity'])) $this->LocationCity = $o['LocationCity'];
if (isset($o['LocationLatitude'])) $this->LocationLatitude = $o['LocationLatitude'];
if (isset($o['LocationLongitude'])) $this->LocationLongitude = $o['LocationLongitude'];
if (isset($o['ExpectedStartDate'])) $this->ExpectedStartDate = JsonConverters::from('DateTime', $o['ExpectedStartDate']);
if (isset($o['ExpectedCompletionDate'])) $this->ExpectedCompletionDate = JsonConverters::from('DateTime', $o['ExpectedCompletionDate']);
if (isset($o['IsRecurring'])) $this->IsRecurring = $o['IsRecurring'];
if (isset($o['OccurrenceDates'])) $this->OccurrenceDates = JsonConverters::fromArray('string', $o['OccurrenceDates']);
}
/** @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->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
if (isset($this->StatusID)) $o['StatusID'] = $this->StatusID;
if (isset($this->StatusName)) $o['StatusName'] = $this->StatusName;
if (isset($this->ProjectLocationID)) $o['ProjectLocationID'] = $this->ProjectLocationID;
if (isset($this->ProjectLocationName)) $o['ProjectLocationName'] = $this->ProjectLocationName;
if (isset($this->LocationZip)) $o['LocationZip'] = $this->LocationZip;
if (isset($this->LocationCity)) $o['LocationCity'] = $this->LocationCity;
if (isset($this->LocationLatitude)) $o['LocationLatitude'] = $this->LocationLatitude;
if (isset($this->LocationLongitude)) $o['LocationLongitude'] = $this->LocationLongitude;
if (isset($this->ExpectedStartDate)) $o['ExpectedStartDate'] = JsonConverters::to('DateTime', $this->ExpectedStartDate);
if (isset($this->ExpectedCompletionDate)) $o['ExpectedCompletionDate'] = JsonConverters::to('DateTime', $this->ExpectedCompletionDate);
if (isset($this->IsRecurring)) $o['IsRecurring'] = $this->IsRecurring;
if (isset($this->OccurrenceDates)) $o['OccurrenceDates'] = JsonConverters::toArray('string', $this->OccurrenceDates);
return empty($o) ? new class(){} : $o;
}
}
class ScheduleWorker implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ContactId=0,
/** @var string|null */
public ?string $FirstName=null,
/** @var string|null */
public ?string $LastName=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Initials=null,
/** @var float|null */
public ?float $Rate=null,
/** @var string|null */
public ?string $ImageUrl=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $BranchName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Initials'])) $this->Initials = $o['Initials'];
if (isset($o['Rate'])) $this->Rate = $o['Rate'];
if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Initials)) $o['Initials'] = $this->Initials;
if (isset($this->Rate)) $o['Rate'] = $this->Rate;
if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
return empty($o) ? new class(){} : $o;
}
}
class Crew implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CrewID=0,
/** @var string|null */
public ?string $CrewName=null,
/** @var string|null */
public ?string $CrewNumber=null,
/** @var int */
public int $CrewManagerContactID=0,
/** @var string|null */
public ?string $CrewManagerContactName=null,
/** @var string|null */
public ?string $CrewColor=null,
/** @var DateTime */
public DateTime $RecordCreatedDate=new DateTime(),
/** @var bool|null */
public ?bool $Active=null,
/** @var string */
public string $CreatedByUID='',
/** @var int */
public int $ProjectID=0,
/** @var int */
public int $CrewMemberCount=0,
/** @var int */
public int $ProjectCrewID=0,
/** @var string|null */
public ?string $ProjectName=null,
/** @var string */
public string $BranchId='',
/** @var string|null */
public ?string $BranchName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
if (isset($o['CrewNumber'])) $this->CrewNumber = $o['CrewNumber'];
if (isset($o['CrewManagerContactID'])) $this->CrewManagerContactID = $o['CrewManagerContactID'];
if (isset($o['CrewManagerContactName'])) $this->CrewManagerContactName = $o['CrewManagerContactName'];
if (isset($o['CrewColor'])) $this->CrewColor = $o['CrewColor'];
if (isset($o['RecordCreatedDate'])) $this->RecordCreatedDate = JsonConverters::from('DateTime', $o['RecordCreatedDate']);
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['CrewMemberCount'])) $this->CrewMemberCount = $o['CrewMemberCount'];
if (isset($o['ProjectCrewID'])) $this->ProjectCrewID = $o['ProjectCrewID'];
if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
if (isset($this->CrewNumber)) $o['CrewNumber'] = $this->CrewNumber;
if (isset($this->CrewManagerContactID)) $o['CrewManagerContactID'] = $this->CrewManagerContactID;
if (isset($this->CrewManagerContactName)) $o['CrewManagerContactName'] = $this->CrewManagerContactName;
if (isset($this->CrewColor)) $o['CrewColor'] = $this->CrewColor;
if (isset($this->RecordCreatedDate)) $o['RecordCreatedDate'] = JsonConverters::to('DateTime', $this->RecordCreatedDate);
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->CrewMemberCount)) $o['CrewMemberCount'] = $this->CrewMemberCount;
if (isset($this->ProjectCrewID)) $o['ProjectCrewID'] = $this->ProjectCrewID;
if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
return empty($o) ? new class(){} : $o;
}
}
class ScheduleLastAssignment implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0,
/** @var array<int>|null */
public ?array $ContactIds=null,
/** @var int|null */
public ?int $SourceCrewID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['ContactIds'])) $this->ContactIds = JsonConverters::fromArray('int', $o['ContactIds']);
if (isset($o['SourceCrewID'])) $this->SourceCrewID = $o['SourceCrewID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->ContactIds)) $o['ContactIds'] = JsonConverters::toArray('int', $this->ContactIds);
if (isset($this->SourceCrewID)) $o['SourceCrewID'] = $this->SourceCrewID;
return empty($o) ? new class(){} : $o;
}
}
class ScheduleAutoFillResult implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobsFilled=0,
/** @var int */
public int $JobsSkipped=0,
/** @var int */
public int $VisitsScheduled=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobsFilled'])) $this->JobsFilled = $o['JobsFilled'];
if (isset($o['JobsSkipped'])) $this->JobsSkipped = $o['JobsSkipped'];
if (isset($o['VisitsScheduled'])) $this->VisitsScheduled = $o['VisitsScheduled'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobsFilled)) $o['JobsFilled'] = $this->JobsFilled;
if (isset($this->JobsSkipped)) $o['JobsSkipped'] = $this->JobsSkipped;
if (isset($this->VisitsScheduled)) $o['VisitsScheduled'] = $this->VisitsScheduled;
return empty($o) ? new class(){} : $o;
}
}
class WorkerScheduleResponse implements JsonSerializable
{
public function __construct(
/** @var array<WorkerScheduleItem>|null */
public ?array $Items=null,
/** @var array<SchedulableJob>|null */
public ?array $SchedulableJobs=null,
/** @var array<ScheduleWorker>|null */
public ?array $Workers=null,
/** @var array<Crew>|null */
public ?array $Crews=null,
/** @var array<ScheduleWorker>|null */
public ?array $BudgetedCrew=null,
/** @var ScheduleLastAssignment|null */
public ?ScheduleLastAssignment $LastAssignment=null,
/** @var ScheduleAutoFillResult|null */
public ?ScheduleAutoFillResult $AutoFill=null,
/** @var int|null */
public ?int $DatesScheduled=null,
/** @var int|null */
public ?int $WorkersScheduled=null,
/** @var int|null */
public ?int $ItemsRemoved=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('WorkerScheduleItem', $o['Items']);
if (isset($o['SchedulableJobs'])) $this->SchedulableJobs = JsonConverters::fromArray('SchedulableJob', $o['SchedulableJobs']);
if (isset($o['Workers'])) $this->Workers = JsonConverters::fromArray('ScheduleWorker', $o['Workers']);
if (isset($o['Crews'])) $this->Crews = JsonConverters::fromArray('Crew', $o['Crews']);
if (isset($o['BudgetedCrew'])) $this->BudgetedCrew = JsonConverters::fromArray('ScheduleWorker', $o['BudgetedCrew']);
if (isset($o['LastAssignment'])) $this->LastAssignment = JsonConverters::from('ScheduleLastAssignment', $o['LastAssignment']);
if (isset($o['AutoFill'])) $this->AutoFill = JsonConverters::from('ScheduleAutoFillResult', $o['AutoFill']);
if (isset($o['DatesScheduled'])) $this->DatesScheduled = $o['DatesScheduled'];
if (isset($o['WorkersScheduled'])) $this->WorkersScheduled = $o['WorkersScheduled'];
if (isset($o['ItemsRemoved'])) $this->ItemsRemoved = $o['ItemsRemoved'];
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('WorkerScheduleItem', $this->Items);
if (isset($this->SchedulableJobs)) $o['SchedulableJobs'] = JsonConverters::toArray('SchedulableJob', $this->SchedulableJobs);
if (isset($this->Workers)) $o['Workers'] = JsonConverters::toArray('ScheduleWorker', $this->Workers);
if (isset($this->Crews)) $o['Crews'] = JsonConverters::toArray('Crew', $this->Crews);
if (isset($this->BudgetedCrew)) $o['BudgetedCrew'] = JsonConverters::toArray('ScheduleWorker', $this->BudgetedCrew);
if (isset($this->LastAssignment)) $o['LastAssignment'] = JsonConverters::to('ScheduleLastAssignment', $this->LastAssignment);
if (isset($this->AutoFill)) $o['AutoFill'] = JsonConverters::to('ScheduleAutoFillResult', $this->AutoFill);
if (isset($this->DatesScheduled)) $o['DatesScheduled'] = $this->DatesScheduled;
if (isset($this->WorkersScheduled)) $o['WorkersScheduled'] = $this->WorkersScheduled;
if (isset($this->ItemsRemoved)) $o['ItemsRemoved'] = $this->ItemsRemoved;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class ScheduleJobWorkersRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $JobID=0,
/** @var int */
public int $ProjectID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
return empty($o) ? new class(){} : $o;
}
}
PHP ScheduleJobWorkersRequest 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.
POST /v1/schedule/job/workers HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ScheduleJobWorkersRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<JobID>0</JobID>
<ProjectID>0</ProjectID>
</ScheduleJobWorkersRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<WorkerScheduleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<AutoFill>
<JobsFilled>0</JobsFilled>
<JobsSkipped>0</JobsSkipped>
<VisitsScheduled>0</VisitsScheduled>
</AutoFill>
<BudgetedCrew>
<ScheduleWorker>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<ContactId>0</ContactId>
<FirstName>String</FirstName>
<ImageUrl>String</ImageUrl>
<Initials>String</Initials>
<LastName>String</LastName>
<Name>String</Name>
<Rate>0</Rate>
</ScheduleWorker>
</BudgetedCrew>
<Crews>
<Crew>
<Active>false</Active>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<CreatedByUID>00000000-0000-0000-0000-000000000000</CreatedByUID>
<CrewColor>String</CrewColor>
<CrewID>0</CrewID>
<CrewManagerContactID>0</CrewManagerContactID>
<CrewManagerContactName>String</CrewManagerContactName>
<CrewMemberCount>0</CrewMemberCount>
<CrewName>String</CrewName>
<CrewNumber>String</CrewNumber>
<ProjectCrewID>0</ProjectCrewID>
<ProjectID>0</ProjectID>
<ProjectName>String</ProjectName>
<RecordCreatedDate>0001-01-01T00:00:00</RecordCreatedDate>
</Crew>
</Crews>
<DatesScheduled>0</DatesScheduled>
<Items>
<WorkerScheduleItem>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<CompletedAt>0001-01-01T00:00:00</CompletedAt>
<ContactID>0</ContactID>
<FirstName>String</FirstName>
<JobID>0</JobID>
<JobName>String</JobName>
<JobStatusName>String</JobStatusName>
<LastName>String</LastName>
<LocationCity>String</LocationCity>
<LocationLatitude>0</LocationLatitude>
<LocationLongitude>0</LocationLongitude>
<LocationZip>String</LocationZip>
<ProjectID>0</ProjectID>
<ProjectLocationID>0</ProjectLocationID>
<ProjectLocationName>String</ProjectLocationName>
<ProjectName>String</ProjectName>
<ScheduledDate>0001-01-01T00:00:00</ScheduledDate>
<SortOrder>0</SortOrder>
<SourceCrewID>0</SourceCrewID>
<SourceCrewName>String</SourceCrewName>
<StartedAt>0001-01-01T00:00:00</StartedAt>
<Status>String</Status>
<WorkerHomeBranchId>00000000-0000-0000-0000-000000000000</WorkerHomeBranchId>
<WorkerHomeBranchName>String</WorkerHomeBranchName>
<WorkerName>String</WorkerName>
<WorkerNotes>String</WorkerNotes>
<WorkerScheduleItemID>0</WorkerScheduleItemID>
</WorkerScheduleItem>
</Items>
<ItemsRemoved>0</ItemsRemoved>
<LastAssignment>
<ContactIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:int>0</d3p1:int>
</ContactIds>
<JobID>0</JobID>
<SourceCrewID>0</SourceCrewID>
</LastAssignment>
<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>
<SchedulableJobs>
<SchedulableJob>
<ExpectedCompletionDate>0001-01-01T00:00:00</ExpectedCompletionDate>
<ExpectedStartDate>0001-01-01T00:00:00</ExpectedStartDate>
<IsRecurring>false</IsRecurring>
<JobID>0</JobID>
<JobName>String</JobName>
<LocationCity>String</LocationCity>
<LocationLatitude>0</LocationLatitude>
<LocationLongitude>0</LocationLongitude>
<LocationZip>String</LocationZip>
<OccurrenceDates xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</OccurrenceDates>
<ProjectID>0</ProjectID>
<ProjectLocationID>0</ProjectLocationID>
<ProjectLocationName>String</ProjectLocationName>
<ProjectName>String</ProjectName>
<StatusID>0</StatusID>
<StatusName>String</StatusName>
</SchedulableJob>
</SchedulableJobs>
<Workers>
<ScheduleWorker>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<ContactId>0</ContactId>
<FirstName>String</FirstName>
<ImageUrl>String</ImageUrl>
<Initials>String</Initials>
<LastName>String</LastName>
<Name>String</Name>
<Rate>0</Rate>
</ScheduleWorker>
</Workers>
<WorkersScheduled>0</WorkersScheduled>
</WorkerScheduleResponse>