Trendsic Platform Service

<back to all web services

AgreementPlannerRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/serviceagreement/planner
<?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 AgreementPlannerRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AgreementID=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $ProjectName=null,
        /** @var string|null */
        public ?string $ServiceType=null,
        /** @var string|null */
        public ?string $Area=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var string|null */
        public ?string $Frequency=null,
        /** @var string|null */
        public ?string $NextDueIso=null,
        /** @var string|null */
        public ?string $NextDueLabel=null,
        /** @var bool|null */
        public ?bool $Overdue=null,
        /** @var int */
        public int $DurationMin=0,
        /** @var array<int>|null */
        public ?array $EligibleDow=null,
        /** @var int */
        public int $ScheduledDow=0,
        /** @var bool|null */
        public ?bool $WeeklyAll=null,
        /** @var bool|null */
        public ?bool $DueThisWeek=null,
        /** @var int|null */
        public ?int $AssignedCrewID=null,
        /** @var string|null */
        public ?string $AssignedCrewName=null,
        /** @var int|null */
        public ?int $ThisWeekJobID=null,
        /** @var int|null */
        public ?int $ThisWeekBackingJobID=null,
        /** @var string|null */
        public ?string $ThisWeekOccIso=null,
        /** @var string|null */
        public ?string $ThisWeekStandingIso=null,
        /** @var int|null */
        public ?int $StandingDow=null,
        /** @var bool|null */
        public ?bool $Moved=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgreementID'])) $this->AgreementID = $o['AgreementID'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
        if (isset($o['ServiceType'])) $this->ServiceType = $o['ServiceType'];
        if (isset($o['Area'])) $this->Area = $o['Area'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['Frequency'])) $this->Frequency = $o['Frequency'];
        if (isset($o['NextDueIso'])) $this->NextDueIso = $o['NextDueIso'];
        if (isset($o['NextDueLabel'])) $this->NextDueLabel = $o['NextDueLabel'];
        if (isset($o['Overdue'])) $this->Overdue = $o['Overdue'];
        if (isset($o['DurationMin'])) $this->DurationMin = $o['DurationMin'];
        if (isset($o['EligibleDow'])) $this->EligibleDow = JsonConverters::fromArray('int', $o['EligibleDow']);
        if (isset($o['ScheduledDow'])) $this->ScheduledDow = $o['ScheduledDow'];
        if (isset($o['WeeklyAll'])) $this->WeeklyAll = $o['WeeklyAll'];
        if (isset($o['DueThisWeek'])) $this->DueThisWeek = $o['DueThisWeek'];
        if (isset($o['AssignedCrewID'])) $this->AssignedCrewID = $o['AssignedCrewID'];
        if (isset($o['AssignedCrewName'])) $this->AssignedCrewName = $o['AssignedCrewName'];
        if (isset($o['ThisWeekJobID'])) $this->ThisWeekJobID = $o['ThisWeekJobID'];
        if (isset($o['ThisWeekBackingJobID'])) $this->ThisWeekBackingJobID = $o['ThisWeekBackingJobID'];
        if (isset($o['ThisWeekOccIso'])) $this->ThisWeekOccIso = $o['ThisWeekOccIso'];
        if (isset($o['ThisWeekStandingIso'])) $this->ThisWeekStandingIso = $o['ThisWeekStandingIso'];
        if (isset($o['StandingDow'])) $this->StandingDow = $o['StandingDow'];
        if (isset($o['Moved'])) $this->Moved = $o['Moved'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgreementID)) $o['AgreementID'] = $this->AgreementID;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
        if (isset($this->ServiceType)) $o['ServiceType'] = $this->ServiceType;
        if (isset($this->Area)) $o['Area'] = $this->Area;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->Frequency)) $o['Frequency'] = $this->Frequency;
        if (isset($this->NextDueIso)) $o['NextDueIso'] = $this->NextDueIso;
        if (isset($this->NextDueLabel)) $o['NextDueLabel'] = $this->NextDueLabel;
        if (isset($this->Overdue)) $o['Overdue'] = $this->Overdue;
        if (isset($this->DurationMin)) $o['DurationMin'] = $this->DurationMin;
        if (isset($this->EligibleDow)) $o['EligibleDow'] = JsonConverters::toArray('int', $this->EligibleDow);
        if (isset($this->ScheduledDow)) $o['ScheduledDow'] = $this->ScheduledDow;
        if (isset($this->WeeklyAll)) $o['WeeklyAll'] = $this->WeeklyAll;
        if (isset($this->DueThisWeek)) $o['DueThisWeek'] = $this->DueThisWeek;
        if (isset($this->AssignedCrewID)) $o['AssignedCrewID'] = $this->AssignedCrewID;
        if (isset($this->AssignedCrewName)) $o['AssignedCrewName'] = $this->AssignedCrewName;
        if (isset($this->ThisWeekJobID)) $o['ThisWeekJobID'] = $this->ThisWeekJobID;
        if (isset($this->ThisWeekBackingJobID)) $o['ThisWeekBackingJobID'] = $this->ThisWeekBackingJobID;
        if (isset($this->ThisWeekOccIso)) $o['ThisWeekOccIso'] = $this->ThisWeekOccIso;
        if (isset($this->ThisWeekStandingIso)) $o['ThisWeekStandingIso'] = $this->ThisWeekStandingIso;
        if (isset($this->StandingDow)) $o['StandingDow'] = $this->StandingDow;
        if (isset($this->Moved)) $o['Moved'] = $this->Moved;
        return empty($o) ? new class(){} : $o;
    }
}

class AgreementPlannerCrew implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CrewID=0,
        /** @var string|null */
        public ?string $CrewName=null,
        /** @var string|null */
        public ?string $CrewColor=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['CrewColor'])) $this->CrewColor = $o['CrewColor'];
    }
    
    /** @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->CrewColor)) $o['CrewColor'] = $this->CrewColor;
        return empty($o) ? new class(){} : $o;
    }
}

class AgreementPlannerResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string|null */
        public ?string $FromIso=null,
        /** @var string|null */
        public ?string $ToIso=null,
        /** @var int */
        public int $WeekdayCapacity=0,
        /** @var array<AgreementPlannerRow>|null */
        public ?array $Rows=null,
        /** @var array<AgreementPlannerCrew>|null */
        public ?array $Crews=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['FromIso'])) $this->FromIso = $o['FromIso'];
        if (isset($o['ToIso'])) $this->ToIso = $o['ToIso'];
        if (isset($o['WeekdayCapacity'])) $this->WeekdayCapacity = $o['WeekdayCapacity'];
        if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('AgreementPlannerRow', $o['Rows']);
        if (isset($o['Crews'])) $this->Crews = JsonConverters::fromArray('AgreementPlannerCrew', $o['Crews']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->FromIso)) $o['FromIso'] = $this->FromIso;
        if (isset($this->ToIso)) $o['ToIso'] = $this->ToIso;
        if (isset($this->WeekdayCapacity)) $o['WeekdayCapacity'] = $this->WeekdayCapacity;
        if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('AgreementPlannerRow', $this->Rows);
        if (isset($this->Crews)) $o['Crews'] = JsonConverters::toArray('AgreementPlannerCrew', $this->Crews);
        return empty($o) ? new class(){} : $o;
    }
}

class AgreementPlannerRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $From=null,
        /** @var string|null */
        public ?string $Scope=null
    ) {
    }

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

PHP AgreementPlannerRequest DTOs

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

HTTP + JSV

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

GET /v1/serviceagreement/planner HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	FromIso: String,
	ToIso: String,
	WeekdayCapacity: 0,
	Rows: 
	[
		{
			AgreementID: 0,
			Name: String,
			ProjectName: String,
			ServiceType: String,
			Area: String,
			Zip: String,
			Frequency: String,
			NextDueIso: String,
			NextDueLabel: String,
			Overdue: False,
			DurationMin: 0,
			EligibleDow: 
			[
				0
			],
			ScheduledDow: 0,
			WeeklyAll: False,
			DueThisWeek: False,
			AssignedCrewID: 0,
			AssignedCrewName: String,
			ThisWeekJobID: 0,
			ThisWeekBackingJobID: 0,
			ThisWeekOccIso: String,
			ThisWeekStandingIso: String,
			StandingDow: 0,
			Moved: False
		}
	],
	Crews: 
	[
		{
			CrewID: 0,
			CrewName: String,
			CrewColor: String
		}
	]
}