Trendsic Platform Service

<back to all web services

PursuitDetailRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/pursuits/{PursuitID}
<?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 PursuitDetailRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $PursuitID=0
    ) {
    }

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

PHP PursuitDetailRequest 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/pursuits/{PursuitID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PursuitResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AwardedProjectID>0</AwardedProjectID>
  <Pursuit>
    <Activity>
      <PursuitActivity>
        <Actor>String</Actor>
        <CreatedAt>0001-01-01T00:00:00</CreatedAt>
        <Detail>String</Detail>
        <Kind>String</Kind>
        <Label>String</Label>
        <PursuitActivityID>0</PursuitActivityID>
        <PursuitID>0</PursuitID>
      </PursuitActivity>
    </Activity>
    <AwardedProjectID>0</AwardedProjectID>
    <BidValue>0</BidValue>
    <ClientOwner>String</ClientOwner>
    <CostOfPursuit>0</CostOfPursuit>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CreatedBy>String</CreatedBy>
    <DaysOpen>0</DaysOpen>
    <DecidedAt>0001-01-01T00:00:00</DecidedAt>
    <DueDate>0001-01-01T00:00:00</DueDate>
    <EstCost>0</EstCost>
    <EstimatorRfpRef>String</EstimatorRfpRef>
    <Location>String</Location>
    <Name>String</Name>
    <OpenedAt>0001-01-01T00:00:00</OpenedAt>
    <Outcome>String</Outcome>
    <PursuitID>0</PursuitID>
    <PursuitNumber>String</PursuitNumber>
    <PursuitUID>00000000-0000-0000-0000-000000000000</PursuitUID>
    <Scope>String</Scope>
    <Solicitation>String</Solicitation>
    <Stage>String</Stage>
    <SubmittedAt>0001-01-01T00:00:00</SubmittedAt>
    <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    <WeightedValue>0</WeightedValue>
    <WinProbability>0</WinProbability>
    <WorkType>String</WorkType>
  </Pursuit>
  <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>
</PursuitResponse>