Trendsic Platform Service

<back to all web services

ProjectTimelineRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/project/{ProjectID}/timeline
<?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 TimelineCrew implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectJobCrewMemberID=0,
        /** @var int */
        public int $ContactID=0,
        /** @var string|null */
        public ?string $ContactName=null,
        /** @var float|null */
        public ?float $BudgetedHours=null
    ) {
    }

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

class TimelineEquipment implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectJobEquipmentID=0,
        /** @var int */
        public int $EquipmentID=0,
        /** @var string|null */
        public ?string $EquipmentName=null
    ) {
    }

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

class TimelineJob implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $JobID=0,
        /** @var string|null */
        public ?string $JobName=null,
        /** @var DateTime|null */
        public ?DateTime $ExpectedStartDate=null,
        /** @var DateTime|null */
        public ?DateTime $ExpectedCompletionDate=null,
        /** @var DateTime|null */
        public ?DateTime $ActualStartDate=null,
        /** @var DateTime|null */
        public ?DateTime $ActualEndDate=null,
        /** @var float */
        public float $PercentComplete=0.0,
        /** @var int|null */
        public ?int $StatusID=null,
        /** @var string|null */
        public ?string $JobCategory=null,
        /** @var bool|null */
        public ?bool $IsAgreementVisit=null,
        /** @var DateTime|null */
        public ?DateTime $OccurrenceDate=null,
        /** @var array<TimelineCrew>|null */
        public ?array $Crew=null,
        /** @var array<TimelineEquipment>|null */
        public ?array $Equipment=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['ExpectedStartDate'])) $this->ExpectedStartDate = JsonConverters::from('DateTime', $o['ExpectedStartDate']);
        if (isset($o['ExpectedCompletionDate'])) $this->ExpectedCompletionDate = JsonConverters::from('DateTime', $o['ExpectedCompletionDate']);
        if (isset($o['ActualStartDate'])) $this->ActualStartDate = JsonConverters::from('DateTime', $o['ActualStartDate']);
        if (isset($o['ActualEndDate'])) $this->ActualEndDate = JsonConverters::from('DateTime', $o['ActualEndDate']);
        if (isset($o['PercentComplete'])) $this->PercentComplete = $o['PercentComplete'];
        if (isset($o['StatusID'])) $this->StatusID = $o['StatusID'];
        if (isset($o['JobCategory'])) $this->JobCategory = $o['JobCategory'];
        if (isset($o['IsAgreementVisit'])) $this->IsAgreementVisit = $o['IsAgreementVisit'];
        if (isset($o['OccurrenceDate'])) $this->OccurrenceDate = JsonConverters::from('DateTime', $o['OccurrenceDate']);
        if (isset($o['Crew'])) $this->Crew = JsonConverters::fromArray('TimelineCrew', $o['Crew']);
        if (isset($o['Equipment'])) $this->Equipment = JsonConverters::fromArray('TimelineEquipment', $o['Equipment']);
    }
    
    /** @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->ExpectedStartDate)) $o['ExpectedStartDate'] = JsonConverters::to('DateTime', $this->ExpectedStartDate);
        if (isset($this->ExpectedCompletionDate)) $o['ExpectedCompletionDate'] = JsonConverters::to('DateTime', $this->ExpectedCompletionDate);
        if (isset($this->ActualStartDate)) $o['ActualStartDate'] = JsonConverters::to('DateTime', $this->ActualStartDate);
        if (isset($this->ActualEndDate)) $o['ActualEndDate'] = JsonConverters::to('DateTime', $this->ActualEndDate);
        if (isset($this->PercentComplete)) $o['PercentComplete'] = $this->PercentComplete;
        if (isset($this->StatusID)) $o['StatusID'] = $this->StatusID;
        if (isset($this->JobCategory)) $o['JobCategory'] = $this->JobCategory;
        if (isset($this->IsAgreementVisit)) $o['IsAgreementVisit'] = $this->IsAgreementVisit;
        if (isset($this->OccurrenceDate)) $o['OccurrenceDate'] = JsonConverters::to('DateTime', $this->OccurrenceDate);
        if (isset($this->Crew)) $o['Crew'] = JsonConverters::toArray('TimelineCrew', $this->Crew);
        if (isset($this->Equipment)) $o['Equipment'] = JsonConverters::toArray('TimelineEquipment', $this->Equipment);
        return empty($o) ? new class(){} : $o;
    }
}

class JobDependency implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $JobDependencyID=0,
        /** @var string */
        public string $TenantId='',
        /** @var int */
        public int $ProjectID=0,
        /** @var int */
        public int $PredecessorJobID=0,
        /** @var int */
        public int $SuccessorJobID=0,
        /** @var string|null */
        public ?string $DependencyType=null,
        /** @var int */
        public int $LagDays=0,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['JobDependencyID'])) $this->JobDependencyID = $o['JobDependencyID'];
        if (isset($o['TenantId'])) $this->TenantId = $o['TenantId'];
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['PredecessorJobID'])) $this->PredecessorJobID = $o['PredecessorJobID'];
        if (isset($o['SuccessorJobID'])) $this->SuccessorJobID = $o['SuccessorJobID'];
        if (isset($o['DependencyType'])) $this->DependencyType = $o['DependencyType'];
        if (isset($o['LagDays'])) $this->LagDays = $o['LagDays'];
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['UpdatedAt'])) $this->UpdatedAt = JsonConverters::from('DateTime', $o['UpdatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->JobDependencyID)) $o['JobDependencyID'] = $this->JobDependencyID;
        if (isset($this->TenantId)) $o['TenantId'] = $this->TenantId;
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->PredecessorJobID)) $o['PredecessorJobID'] = $this->PredecessorJobID;
        if (isset($this->SuccessorJobID)) $o['SuccessorJobID'] = $this->SuccessorJobID;
        if (isset($this->DependencyType)) $o['DependencyType'] = $this->DependencyType;
        if (isset($this->LagDays)) $o['LagDays'] = $this->LagDays;
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->UpdatedAt)) $o['UpdatedAt'] = JsonConverters::to('DateTime', $this->UpdatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class ProjectTimeline implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectID=0,
        /** @var array<TimelineJob>|null */
        public ?array $Jobs=null,
        /** @var array<JobDependency>|null */
        public ?array $Dependencies=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['Jobs'])) $this->Jobs = JsonConverters::fromArray('TimelineJob', $o['Jobs']);
        if (isset($o['Dependencies'])) $this->Dependencies = JsonConverters::fromArray('JobDependency', $o['Dependencies']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->Jobs)) $o['Jobs'] = JsonConverters::toArray('TimelineJob', $this->Jobs);
        if (isset($this->Dependencies)) $o['Dependencies'] = JsonConverters::toArray('JobDependency', $this->Dependencies);
        return empty($o) ? new class(){} : $o;
    }
}

class ProjectTimelineResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var ProjectTimeline|null */
        public ?ProjectTimeline $Timeline=null
    ) {
    }

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

class ProjectTimelineRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectID=0
    ) {
    }

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

PHP ProjectTimelineRequest 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/project/{ProjectID}/timeline HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProjectTimelineResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <Timeline>
    <Dependencies>
      <JobDependency>
        <CreatedAt>0001-01-01T00:00:00</CreatedAt>
        <CreatedBy>String</CreatedBy>
        <DependencyType>String</DependencyType>
        <JobDependencyID>0</JobDependencyID>
        <LagDays>0</LagDays>
        <PredecessorJobID>0</PredecessorJobID>
        <ProjectID>0</ProjectID>
        <SuccessorJobID>0</SuccessorJobID>
        <TenantId>00000000-0000-0000-0000-000000000000</TenantId>
        <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
      </JobDependency>
    </Dependencies>
    <Jobs>
      <TimelineJob>
        <ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
        <ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
        <Crew>
          <TimelineCrew>
            <BudgetedHours>0</BudgetedHours>
            <ContactID>0</ContactID>
            <ContactName>String</ContactName>
            <ProjectJobCrewMemberID>0</ProjectJobCrewMemberID>
          </TimelineCrew>
        </Crew>
        <Equipment>
          <TimelineEquipment>
            <EquipmentID>0</EquipmentID>
            <EquipmentName>String</EquipmentName>
            <ProjectJobEquipmentID>0</ProjectJobEquipmentID>
          </TimelineEquipment>
        </Equipment>
        <ExpectedCompletionDate>0001-01-01T00:00:00</ExpectedCompletionDate>
        <ExpectedStartDate>0001-01-01T00:00:00</ExpectedStartDate>
        <IsAgreementVisit>false</IsAgreementVisit>
        <JobCategory>String</JobCategory>
        <JobID>0</JobID>
        <JobName>String</JobName>
        <OccurrenceDate>0001-01-01T00:00:00</OccurrenceDate>
        <PercentComplete>0</PercentComplete>
        <StatusID>0</StatusID>
      </TimelineJob>
    </Jobs>
    <ProjectID>0</ProjectID>
  </Timeline>
</ProjectTimelineResponse>