Trendsic Platform Service

<back to all web services

RfpChangeOrderWritebackRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/Rfp/ChangeOrderWriteback
<?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 RfpChangeOrderWritebackResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var int */
        public int $ChangeOrderID=0,
        /** @var string|null */
        public ?string $Status=null,
        /** @var float */
        public float $TotalCost=0.0,
        /** @var float */
        public float $TotalPrice=0.0
    ) {
    }

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

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 RfpChangeOrderWritebackRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ProjectID=0,
        /** @var int */
        public int $ChangeOrderID=0,
        /** @var int */
        public int $ScheduleDays=0,
        /** @var array<ChangeOrderLine>|null */
        public ?array $Lines=null
    ) {
    }

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

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

POST /v1/Rfp/ChangeOrderWriteback HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ProjectID: 0,
	ChangeOrderID: 0,
	ScheduleDays: 0,
	Lines: 
	[
		{
			ChangeOrderLineID: 0,
			ChangeOrderID: 0,
			Category: String,
			Description: String,
			CostUSD: 0,
			MarkupPct: 0,
			CostCode: String,
			SortOrder: 0
		}
	]
}
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
		}
	},
	ChangeOrderID: 0,
	Status: String,
	TotalCost: 0,
	TotalPrice: 0
}