Trendsic Platform Service

<back to all web services

FieldLogPrefillRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/fieldlog/prefill
<?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 FieldLogCrewPrefill implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var float */
        public float $DefaultHours=0.0,
        /** @var string|null */
        public ?string $CostCode=null
    ) {
    }

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

class FieldLogEquipmentPrefill implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $EquipmentId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Code=null
    ) {
    }

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

class FieldLogPayItemPrefill implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var float */
        public float $ToDate=0.0,
        /** @var float */
        public float $Total=0.0
    ) {
    }

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

class FieldLogSubPrefill implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Trade=null
    ) {
    }

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

class FieldLogPrefillResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string|null */
        public ?string $ProjectName=null,
        /** @var string|null */
        public ?string $SolicitationNumber=null,
        /** @var string|null */
        public ?string $StationRange=null,
        /** @var array<FieldLogCrewPrefill>|null */
        public ?array $Crew=null,
        /** @var array<FieldLogEquipmentPrefill>|null */
        public ?array $Equipment=null,
        /** @var array<FieldLogPayItemPrefill>|null */
        public ?array $PayItems=null,
        /** @var array<FieldLogSubPrefill>|null */
        public ?array $Subs=null,
        /** @var bool|null */
        public ?bool $PriorDayFilled=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['ProjectName'])) $this->ProjectName = $o['ProjectName'];
        if (isset($o['SolicitationNumber'])) $this->SolicitationNumber = $o['SolicitationNumber'];
        if (isset($o['StationRange'])) $this->StationRange = $o['StationRange'];
        if (isset($o['Crew'])) $this->Crew = JsonConverters::fromArray('FieldLogCrewPrefill', $o['Crew']);
        if (isset($o['Equipment'])) $this->Equipment = JsonConverters::fromArray('FieldLogEquipmentPrefill', $o['Equipment']);
        if (isset($o['PayItems'])) $this->PayItems = JsonConverters::fromArray('FieldLogPayItemPrefill', $o['PayItems']);
        if (isset($o['Subs'])) $this->Subs = JsonConverters::fromArray('FieldLogSubPrefill', $o['Subs']);
        if (isset($o['PriorDayFilled'])) $this->PriorDayFilled = $o['PriorDayFilled'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->ProjectName)) $o['ProjectName'] = $this->ProjectName;
        if (isset($this->SolicitationNumber)) $o['SolicitationNumber'] = $this->SolicitationNumber;
        if (isset($this->StationRange)) $o['StationRange'] = $this->StationRange;
        if (isset($this->Crew)) $o['Crew'] = JsonConverters::toArray('FieldLogCrewPrefill', $this->Crew);
        if (isset($this->Equipment)) $o['Equipment'] = JsonConverters::toArray('FieldLogEquipmentPrefill', $this->Equipment);
        if (isset($this->PayItems)) $o['PayItems'] = JsonConverters::toArray('FieldLogPayItemPrefill', $this->PayItems);
        if (isset($this->Subs)) $o['Subs'] = JsonConverters::toArray('FieldLogSubPrefill', $this->Subs);
        if (isset($this->PriorDayFilled)) $o['PriorDayFilled'] = $this->PriorDayFilled;
        return empty($o) ? new class(){} : $o;
    }
}

class FieldLogPrefillRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectId=0,
        /** @var string|null */
        public ?string $Date=null
    ) {
    }

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

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

<FieldLogPrefillResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Crew>
    <FieldLogCrewPrefill>
      <ContactId>0</ContactId>
      <CostCode>String</CostCode>
      <DefaultHours>0</DefaultHours>
      <Name>String</Name>
      <Role>String</Role>
    </FieldLogCrewPrefill>
  </Crew>
  <Equipment>
    <FieldLogEquipmentPrefill>
      <Code>String</Code>
      <EquipmentId>0</EquipmentId>
      <Name>String</Name>
    </FieldLogEquipmentPrefill>
  </Equipment>
  <PayItems>
    <FieldLogPayItemPrefill>
      <Code>String</Code>
      <Name>String</Name>
      <ToDate>0</ToDate>
      <Total>0</Total>
      <Unit>String</Unit>
    </FieldLogPayItemPrefill>
  </PayItems>
  <PriorDayFilled>false</PriorDayFilled>
  <ProjectName>String</ProjectName>
  <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>
  <SolicitationNumber>String</SolicitationNumber>
  <StationRange>String</StationRange>
  <Subs>
    <FieldLogSubPrefill>
      <ContactId>0</ContactId>
      <Name>String</Name>
      <Trade>String</Trade>
    </FieldLogSubPrefill>
  </Subs>
</FieldLogPrefillResponse>