Trendsic Platform Service

<back to all web services

ChangeOrderVoidRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/projects/{ProjectID}/change-orders/{ChangeOrderID}/void
<?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 ChangeOrderLine implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ChangeOrderLineID=0,
        /** @var int */
        public int $ChangeOrderID=0,
        /** @var string|null */
        public ?string $Category=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var float */
        public float $CostUSD=0.0,
        /** @var float */
        public float $MarkupPct=0.0,
        /** @var string|null */
        public ?string $CostCode=null,
        /** @var int */
        public int $SortOrder=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ChangeOrderLineID'])) $this->ChangeOrderLineID = $o['ChangeOrderLineID'];
        if (isset($o['ChangeOrderID'])) $this->ChangeOrderID = $o['ChangeOrderID'];
        if (isset($o['Category'])) $this->Category = $o['Category'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['CostUSD'])) $this->CostUSD = $o['CostUSD'];
        if (isset($o['MarkupPct'])) $this->MarkupPct = $o['MarkupPct'];
        if (isset($o['CostCode'])) $this->CostCode = $o['CostCode'];
        if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ChangeOrderLineID)) $o['ChangeOrderLineID'] = $this->ChangeOrderLineID;
        if (isset($this->ChangeOrderID)) $o['ChangeOrderID'] = $this->ChangeOrderID;
        if (isset($this->Category)) $o['Category'] = $this->Category;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->CostUSD)) $o['CostUSD'] = $this->CostUSD;
        if (isset($this->MarkupPct)) $o['MarkupPct'] = $this->MarkupPct;
        if (isset($this->CostCode)) $o['CostCode'] = $this->CostCode;
        if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
        return empty($o) ? new class(){} : $o;
    }
}

class ChangeOrder implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ChangeOrderID=0,
        /** @var string */
        public string $ChangeOrderUID='',
        /** @var int */
        public int $ProjectID=0,
        /** @var string|null */
        public ?string $CONumber=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Scope=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var float */
        public float $CostUSD=0.0,
        /** @var float */
        public float $PriceUSD=0.0,
        /** @var int */
        public int $ScheduleDays=0,
        /** @var float */
        public float $OverheadProfitPct=0.0,
        /** @var string|null */
        public ?string $PricingMethod=null,
        /** @var string|null */
        public ?string $OriginType=null,
        /** @var string|null */
        public ?string $OriginRef=null,
        /** @var string|null */
        public ?string $CostCode=null,
        /** @var DateTime|null */
        public ?DateTime $OpenedAt=null,
        /** @var DateTime|null */
        public ?DateTime $SubmittedAt=null,
        /** @var DateTime|null */
        public ?DateTime $DecidedAt=null,
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var DateTime|null */
        public ?DateTime $UpdatedAt=null,
        /** @var int */
        public int $DaysOpen=0,
        /** @var array<ChangeOrderLine>|null */
        public ?array $Lines=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ChangeOrderID'])) $this->ChangeOrderID = $o['ChangeOrderID'];
        if (isset($o['ChangeOrderUID'])) $this->ChangeOrderUID = $o['ChangeOrderUID'];
        if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
        if (isset($o['CONumber'])) $this->CONumber = $o['CONumber'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Scope'])) $this->Scope = $o['Scope'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['CostUSD'])) $this->CostUSD = $o['CostUSD'];
        if (isset($o['PriceUSD'])) $this->PriceUSD = $o['PriceUSD'];
        if (isset($o['ScheduleDays'])) $this->ScheduleDays = $o['ScheduleDays'];
        if (isset($o['OverheadProfitPct'])) $this->OverheadProfitPct = $o['OverheadProfitPct'];
        if (isset($o['PricingMethod'])) $this->PricingMethod = $o['PricingMethod'];
        if (isset($o['OriginType'])) $this->OriginType = $o['OriginType'];
        if (isset($o['OriginRef'])) $this->OriginRef = $o['OriginRef'];
        if (isset($o['CostCode'])) $this->CostCode = $o['CostCode'];
        if (isset($o['OpenedAt'])) $this->OpenedAt = JsonConverters::from('DateTime', $o['OpenedAt']);
        if (isset($o['SubmittedAt'])) $this->SubmittedAt = JsonConverters::from('DateTime', $o['SubmittedAt']);
        if (isset($o['DecidedAt'])) $this->DecidedAt = JsonConverters::from('DateTime', $o['DecidedAt']);
        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']);
        if (isset($o['DaysOpen'])) $this->DaysOpen = $o['DaysOpen'];
        if (isset($o['Lines'])) $this->Lines = JsonConverters::fromArray('ChangeOrderLine', $o['Lines']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ChangeOrderID)) $o['ChangeOrderID'] = $this->ChangeOrderID;
        if (isset($this->ChangeOrderUID)) $o['ChangeOrderUID'] = $this->ChangeOrderUID;
        if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
        if (isset($this->CONumber)) $o['CONumber'] = $this->CONumber;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Scope)) $o['Scope'] = $this->Scope;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->CostUSD)) $o['CostUSD'] = $this->CostUSD;
        if (isset($this->PriceUSD)) $o['PriceUSD'] = $this->PriceUSD;
        if (isset($this->ScheduleDays)) $o['ScheduleDays'] = $this->ScheduleDays;
        if (isset($this->OverheadProfitPct)) $o['OverheadProfitPct'] = $this->OverheadProfitPct;
        if (isset($this->PricingMethod)) $o['PricingMethod'] = $this->PricingMethod;
        if (isset($this->OriginType)) $o['OriginType'] = $this->OriginType;
        if (isset($this->OriginRef)) $o['OriginRef'] = $this->OriginRef;
        if (isset($this->CostCode)) $o['CostCode'] = $this->CostCode;
        if (isset($this->OpenedAt)) $o['OpenedAt'] = JsonConverters::to('DateTime', $this->OpenedAt);
        if (isset($this->SubmittedAt)) $o['SubmittedAt'] = JsonConverters::to('DateTime', $this->SubmittedAt);
        if (isset($this->DecidedAt)) $o['DecidedAt'] = JsonConverters::to('DateTime', $this->DecidedAt);
        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);
        if (isset($this->DaysOpen)) $o['DaysOpen'] = $this->DaysOpen;
        if (isset($this->Lines)) $o['Lines'] = JsonConverters::toArray('ChangeOrderLine', $this->Lines);
        return empty($o) ? new class(){} : $o;
    }
}

class ChangeOrderContractSummary implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectID=0,
        /** @var float */
        public float $OriginalContract=0.0,
        /** @var float */
        public float $ApprovedCOValue=0.0,
        /** @var int */
        public int $ApprovedCOCount=0,
        /** @var float */
        public float $PendingCOValue=0.0,
        /** @var int */
        public int $PendingCOCount=0,
        /** @var float */
        public float $RevisedContract=0.0,
        /** @var float */
        public float $PotentialContract=0.0,
        /** @var int */
        public int $ApprovedScheduleDays=0
    ) {
    }

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

class ChangeOrderResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var ChangeOrder|null */
        public ?ChangeOrder $Order=null,
        /** @var ChangeOrderContractSummary|null */
        public ?ChangeOrderContractSummary $Summary=null
    ) {
    }

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

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

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

PHP ChangeOrderVoidRequest 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.

POST /v1/projects/{ProjectID}/change-orders/{ChangeOrderID}/void HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ChangeOrderVoidRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <ChangeOrderID>0</ChangeOrderID>
  <ProjectID>0</ProjectID>
</ChangeOrderVoidRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ChangeOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Order>
    <CONumber>String</CONumber>
    <ChangeOrderID>0</ChangeOrderID>
    <ChangeOrderUID>00000000-0000-0000-0000-000000000000</ChangeOrderUID>
    <CostCode>String</CostCode>
    <CostUSD>0</CostUSD>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CreatedBy>String</CreatedBy>
    <DaysOpen>0</DaysOpen>
    <DecidedAt>0001-01-01T00:00:00</DecidedAt>
    <Lines>
      <ChangeOrderLine>
        <Category>String</Category>
        <ChangeOrderID>0</ChangeOrderID>
        <ChangeOrderLineID>0</ChangeOrderLineID>
        <CostCode>String</CostCode>
        <CostUSD>0</CostUSD>
        <Description>String</Description>
        <MarkupPct>0</MarkupPct>
        <SortOrder>0</SortOrder>
      </ChangeOrderLine>
    </Lines>
    <OpenedAt>0001-01-01T00:00:00</OpenedAt>
    <OriginRef>String</OriginRef>
    <OriginType>String</OriginType>
    <OverheadProfitPct>0</OverheadProfitPct>
    <PriceUSD>0</PriceUSD>
    <PricingMethod>String</PricingMethod>
    <ProjectID>0</ProjectID>
    <ScheduleDays>0</ScheduleDays>
    <Scope>String</Scope>
    <Status>String</Status>
    <SubmittedAt>0001-01-01T00:00:00</SubmittedAt>
    <Title>String</Title>
    <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
  </Order>
  <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>
  <Summary>
    <ApprovedCOCount>0</ApprovedCOCount>
    <ApprovedCOValue>0</ApprovedCOValue>
    <ApprovedScheduleDays>0</ApprovedScheduleDays>
    <OriginalContract>0</OriginalContract>
    <PendingCOCount>0</PendingCOCount>
    <PendingCOValue>0</PendingCOValue>
    <PotentialContract>0</PotentialContract>
    <ProjectID>0</ProjectID>
    <RevisedContract>0</RevisedContract>
  </Summary>
</ChangeOrderResponse>