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 .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/serviceagreement/planner HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AgreementPlannerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Crews>
    <AgreementPlannerCrew>
      <CrewColor>String</CrewColor>
      <CrewID>0</CrewID>
      <CrewName>String</CrewName>
    </AgreementPlannerCrew>
  </Crews>
  <FromIso>String</FromIso>
  <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>
  <Rows>
    <AgreementPlannerRow>
      <AgreementID>0</AgreementID>
      <Area>String</Area>
      <AssignedCrewID>0</AssignedCrewID>
      <AssignedCrewName>String</AssignedCrewName>
      <DueThisWeek>false</DueThisWeek>
      <DurationMin>0</DurationMin>
      <EligibleDow xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </EligibleDow>
      <Frequency>String</Frequency>
      <Moved>false</Moved>
      <Name>String</Name>
      <NextDueIso>String</NextDueIso>
      <NextDueLabel>String</NextDueLabel>
      <Overdue>false</Overdue>
      <ProjectName>String</ProjectName>
      <ScheduledDow>0</ScheduledDow>
      <ServiceType>String</ServiceType>
      <StandingDow>0</StandingDow>
      <ThisWeekBackingJobID>0</ThisWeekBackingJobID>
      <ThisWeekJobID>0</ThisWeekJobID>
      <ThisWeekOccIso>String</ThisWeekOccIso>
      <ThisWeekStandingIso>String</ThisWeekStandingIso>
      <WeeklyAll>false</WeeklyAll>
      <Zip>String</Zip>
    </AgreementPlannerRow>
  </Rows>
  <ToIso>String</ToIso>
  <WeekdayCapacity>0</WeekdayCapacity>
</AgreementPlannerResponse>