Trendsic Platform Service

<back to all web services

PursuitSetStageRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/pursuits/{PursuitID}/stage
<?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 PursuitActivity implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PursuitActivityID=0,
        /** @var int */
        public int $PursuitID=0,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Detail=null,
        /** @var string|null */
        public ?string $Actor=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PursuitActivityID'])) $this->PursuitActivityID = $o['PursuitActivityID'];
        if (isset($o['PursuitID'])) $this->PursuitID = $o['PursuitID'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Detail'])) $this->Detail = $o['Detail'];
        if (isset($o['Actor'])) $this->Actor = $o['Actor'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PursuitActivityID)) $o['PursuitActivityID'] = $this->PursuitActivityID;
        if (isset($this->PursuitID)) $o['PursuitID'] = $this->PursuitID;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Detail)) $o['Detail'] = $this->Detail;
        if (isset($this->Actor)) $o['Actor'] = $this->Actor;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        return empty($o) ? new class(){} : $o;
    }
}

class Pursuit implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PursuitID=0,
        /** @var string */
        public string $PursuitUID='',
        /** @var string|null */
        public ?string $PursuitNumber=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $ClientOwner=null,
        /** @var string|null */
        public ?string $WorkType=null,
        /** @var string|null */
        public ?string $Solicitation=null,
        /** @var string|null */
        public ?string $Location=null,
        /** @var string|null */
        public ?string $Scope=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var float */
        public float $BidValue=0.0,
        /** @var float */
        public float $EstCost=0.0,
        /** @var float */
        public float $WinProbability=0.0,
        /** @var float */
        public float $CostOfPursuit=0.0,
        /** @var DateTime|null */
        public ?DateTime $DueDate=null,
        /** @var string|null */
        public ?string $EstimatorRfpRef=null,
        /** @var int|null */
        public ?int $AwardedProjectID=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 float */
        public float $WeightedValue=0.0,
        /** @var array<PursuitActivity>|null */
        public ?array $Activity=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PursuitID'])) $this->PursuitID = $o['PursuitID'];
        if (isset($o['PursuitUID'])) $this->PursuitUID = $o['PursuitUID'];
        if (isset($o['PursuitNumber'])) $this->PursuitNumber = $o['PursuitNumber'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['ClientOwner'])) $this->ClientOwner = $o['ClientOwner'];
        if (isset($o['WorkType'])) $this->WorkType = $o['WorkType'];
        if (isset($o['Solicitation'])) $this->Solicitation = $o['Solicitation'];
        if (isset($o['Location'])) $this->Location = $o['Location'];
        if (isset($o['Scope'])) $this->Scope = $o['Scope'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
        if (isset($o['BidValue'])) $this->BidValue = $o['BidValue'];
        if (isset($o['EstCost'])) $this->EstCost = $o['EstCost'];
        if (isset($o['WinProbability'])) $this->WinProbability = $o['WinProbability'];
        if (isset($o['CostOfPursuit'])) $this->CostOfPursuit = $o['CostOfPursuit'];
        if (isset($o['DueDate'])) $this->DueDate = JsonConverters::from('DateTime', $o['DueDate']);
        if (isset($o['EstimatorRfpRef'])) $this->EstimatorRfpRef = $o['EstimatorRfpRef'];
        if (isset($o['AwardedProjectID'])) $this->AwardedProjectID = $o['AwardedProjectID'];
        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['WeightedValue'])) $this->WeightedValue = $o['WeightedValue'];
        if (isset($o['Activity'])) $this->Activity = JsonConverters::fromArray('PursuitActivity', $o['Activity']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PursuitID)) $o['PursuitID'] = $this->PursuitID;
        if (isset($this->PursuitUID)) $o['PursuitUID'] = $this->PursuitUID;
        if (isset($this->PursuitNumber)) $o['PursuitNumber'] = $this->PursuitNumber;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->ClientOwner)) $o['ClientOwner'] = $this->ClientOwner;
        if (isset($this->WorkType)) $o['WorkType'] = $this->WorkType;
        if (isset($this->Solicitation)) $o['Solicitation'] = $this->Solicitation;
        if (isset($this->Location)) $o['Location'] = $this->Location;
        if (isset($this->Scope)) $o['Scope'] = $this->Scope;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
        if (isset($this->BidValue)) $o['BidValue'] = $this->BidValue;
        if (isset($this->EstCost)) $o['EstCost'] = $this->EstCost;
        if (isset($this->WinProbability)) $o['WinProbability'] = $this->WinProbability;
        if (isset($this->CostOfPursuit)) $o['CostOfPursuit'] = $this->CostOfPursuit;
        if (isset($this->DueDate)) $o['DueDate'] = JsonConverters::to('DateTime', $this->DueDate);
        if (isset($this->EstimatorRfpRef)) $o['EstimatorRfpRef'] = $this->EstimatorRfpRef;
        if (isset($this->AwardedProjectID)) $o['AwardedProjectID'] = $this->AwardedProjectID;
        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->WeightedValue)) $o['WeightedValue'] = $this->WeightedValue;
        if (isset($this->Activity)) $o['Activity'] = JsonConverters::toArray('PursuitActivity', $this->Activity);
        return empty($o) ? new class(){} : $o;
    }
}

class PursuitResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var Pursuit|null */
        public ?Pursuit $Pursuit=null,
        /** @var int|null */
        public ?int $AwardedProjectID=null
    ) {
    }

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

class PursuitSetStageRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PursuitID=0,
        /** @var string|null */
        public ?string $Stage=null
    ) {
    }

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

PHP PursuitSetStageRequest 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/pursuits/{PursuitID}/stage HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	PursuitID: 0,
	Stage: String
}
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
		}
	},
	Pursuit: 
	{
		PursuitID: 0,
		PursuitUID: 00000000000000000000000000000000,
		PursuitNumber: String,
		Name: String,
		ClientOwner: String,
		WorkType: String,
		Solicitation: String,
		Location: String,
		Scope: String,
		Stage: String,
		Outcome: String,
		BidValue: 0,
		EstCost: 0,
		WinProbability: 0,
		CostOfPursuit: 0,
		DueDate: 0001-01-01,
		EstimatorRfpRef: String,
		AwardedProjectID: 0,
		OpenedAt: 0001-01-01,
		SubmittedAt: 0001-01-01,
		DecidedAt: 0001-01-01,
		CreatedBy: String,
		CreatedAt: 0001-01-01,
		UpdatedAt: 0001-01-01,
		DaysOpen: 0,
		WeightedValue: 0,
		Activity: 
		[
			{
				PursuitActivityID: 0,
				PursuitID: 0,
				Kind: String,
				Label: String,
				Detail: String,
				Actor: String,
				CreatedAt: 0001-01-01
			}
		]
	},
	AwardedProjectID: 0
}