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 .other suffix or ?format=other

HTTP + OTHER

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: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Timeline":{"ProjectID":0,"Jobs":[{"JobID":0,"JobName":"String","ExpectedStartDate":"0001-01-01T00:00:00.0000000","ExpectedCompletionDate":"0001-01-01T00:00:00.0000000","ActualStartDate":"0001-01-01T00:00:00.0000000","ActualEndDate":"0001-01-01T00:00:00.0000000","PercentComplete":0,"StatusID":0,"JobCategory":"String","IsAgreementVisit":false,"OccurrenceDate":"0001-01-01T00:00:00.0000000","Crew":[{"ProjectJobCrewMemberID":0,"ContactID":0,"ContactName":"String","BudgetedHours":0}],"Equipment":[{"ProjectJobEquipmentID":0,"EquipmentID":0,"EquipmentName":"String"}]}],"Dependencies":[{"JobDependencyID":0,"TenantId":"00000000000000000000000000000000","ProjectID":0,"PredecessorJobID":0,"SuccessorJobID":0,"DependencyType":"String","LagDays":0,"CreatedBy":"String","CreatedAt":"0001-01-01T00:00:00.0000000","UpdatedAt":"0001-01-01T00:00:00.0000000"}]}}