Trendsic Platform Service

<back to all web services

WorkerMyDayRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/worker/myday
<?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 WorkerVisit implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $WorkerScheduleItemID=0,
        /** @var int */
        public int $JobID=0,
        /** @var int */
        public int $SortOrder=0,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $PropertyName=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $TimeWindow=null,
        /** @var string|null */
        public ?string $DistanceLabel=null,
        /** @var string|null */
        public ?string $ServiceSummary=null,
        /** @var int|null */
        public ?int $AreaCount=null,
        /** @var string|null */
        public ?string $AccessNotes=null,
        /** @var bool|null */
        public ?bool $HasRestrictedDetails=null,
        /** @var bool|null */
        public ?bool $CanViewRestricted=null,
        /** @var string|null */
        public ?string $PriorVisitNotes=null,
        /** @var bool|null */
        public ?bool $RainRisk=null,
        /** @var string|null */
        public ?string $CompletedAtLabel=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['SortOrder'])) $this->SortOrder = $o['SortOrder'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['PropertyName'])) $this->PropertyName = $o['PropertyName'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['TimeWindow'])) $this->TimeWindow = $o['TimeWindow'];
        if (isset($o['DistanceLabel'])) $this->DistanceLabel = $o['DistanceLabel'];
        if (isset($o['ServiceSummary'])) $this->ServiceSummary = $o['ServiceSummary'];
        if (isset($o['AreaCount'])) $this->AreaCount = $o['AreaCount'];
        if (isset($o['AccessNotes'])) $this->AccessNotes = $o['AccessNotes'];
        if (isset($o['HasRestrictedDetails'])) $this->HasRestrictedDetails = $o['HasRestrictedDetails'];
        if (isset($o['CanViewRestricted'])) $this->CanViewRestricted = $o['CanViewRestricted'];
        if (isset($o['PriorVisitNotes'])) $this->PriorVisitNotes = $o['PriorVisitNotes'];
        if (isset($o['RainRisk'])) $this->RainRisk = $o['RainRisk'];
        if (isset($o['CompletedAtLabel'])) $this->CompletedAtLabel = $o['CompletedAtLabel'];
    }
    
    /** @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->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->PropertyName)) $o['PropertyName'] = $this->PropertyName;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->TimeWindow)) $o['TimeWindow'] = $this->TimeWindow;
        if (isset($this->DistanceLabel)) $o['DistanceLabel'] = $this->DistanceLabel;
        if (isset($this->ServiceSummary)) $o['ServiceSummary'] = $this->ServiceSummary;
        if (isset($this->AreaCount)) $o['AreaCount'] = $this->AreaCount;
        if (isset($this->AccessNotes)) $o['AccessNotes'] = $this->AccessNotes;
        if (isset($this->HasRestrictedDetails)) $o['HasRestrictedDetails'] = $this->HasRestrictedDetails;
        if (isset($this->CanViewRestricted)) $o['CanViewRestricted'] = $this->CanViewRestricted;
        if (isset($this->PriorVisitNotes)) $o['PriorVisitNotes'] = $this->PriorVisitNotes;
        if (isset($this->RainRisk)) $o['RainRisk'] = $this->RainRisk;
        if (isset($this->CompletedAtLabel)) $o['CompletedAtLabel'] = $this->CompletedAtLabel;
        return empty($o) ? new class(){} : $o;
    }
}

class WorkerMyDayResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string|null */
        public ?string $Route=null,
        /** @var string|null */
        public ?string $DateLabel=null,
        /** @var bool|null */
        public ?bool $IsCrewLead=null,
        /** @var bool|null */
        public ?bool $IsCrewMember=null,
        /** @var array<WorkerVisit>|null */
        public ?array $Visits=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Route'])) $this->Route = $o['Route'];
        if (isset($o['DateLabel'])) $this->DateLabel = $o['DateLabel'];
        if (isset($o['IsCrewLead'])) $this->IsCrewLead = $o['IsCrewLead'];
        if (isset($o['IsCrewMember'])) $this->IsCrewMember = $o['IsCrewMember'];
        if (isset($o['Visits'])) $this->Visits = JsonConverters::fromArray('WorkerVisit', $o['Visits']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Route)) $o['Route'] = $this->Route;
        if (isset($this->DateLabel)) $o['DateLabel'] = $this->DateLabel;
        if (isset($this->IsCrewLead)) $o['IsCrewLead'] = $this->IsCrewLead;
        if (isset($this->IsCrewMember)) $o['IsCrewMember'] = $this->IsCrewMember;
        if (isset($this->Visits)) $o['Visits'] = JsonConverters::toArray('WorkerVisit', $this->Visits);
        return empty($o) ? new class(){} : $o;
    }
}

class WorkerMyDayRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Date'])) $this->Date = $o['Date'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Date)) $o['Date'] = $this->Date;
        return empty($o) ? new class(){} : $o;
    }
}

PHP WorkerMyDayRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/worker/myday HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<WorkerMyDayResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <DateLabel>String</DateLabel>
  <IsCrewLead>false</IsCrewLead>
  <IsCrewMember>false</IsCrewMember>
  <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>
  <Route>String</Route>
  <Visits>
    <WorkerVisit>
      <AccessNotes>String</AccessNotes>
      <Address>String</Address>
      <AreaCount>0</AreaCount>
      <CanViewRestricted>false</CanViewRestricted>
      <CompletedAtLabel>String</CompletedAtLabel>
      <DistanceLabel>String</DistanceLabel>
      <HasRestrictedDetails>false</HasRestrictedDetails>
      <JobID>0</JobID>
      <PriorVisitNotes>String</PriorVisitNotes>
      <PropertyName>String</PropertyName>
      <RainRisk>false</RainRisk>
      <ServiceSummary>String</ServiceSummary>
      <SortOrder>0</SortOrder>
      <Status>String</Status>
      <TimeWindow>String</TimeWindow>
      <WorkerScheduleItemID>0</WorkerScheduleItemID>
    </WorkerVisit>
  </Visits>
</WorkerMyDayResponse>