Trendsic Platform Service

<back to all web services

RatesResolveRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
POST,OPTIONS/v1/Rfp/{RfpDocumentUID}/Rates/Resolve
<?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 RateQuote implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Tier=null,
        /** @var string|null */
        public ?string $Confidence=null,
        /** @var float|null */
        public ?float $Value=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var string|null */
        public ?string $Provenance=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var DateTime|null */
        public ?DateTime $FetchedAtUtc=null,
        /** @var string|null */
        public ?string $Vendor=null,
        /** @var string|null */
        public ?string $Location=null,
        /** @var float|null */
        public ?float $RateDay=null,
        /** @var float|null */
        public ?float $RateWeek=null,
        /** @var float|null */
        public ?float $RateMonth=null,
        /** @var float|null */
        public ?float $AdjustmentPct=null,
        /** @var float|null */
        public ?float $ListValue=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $ChipShort=null,
        /** @var string|null */
        public ?string $Status=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Tier'])) $this->Tier = $o['Tier'];
        if (isset($o['Confidence'])) $this->Confidence = $o['Confidence'];
        if (isset($o['Value'])) $this->Value = $o['Value'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['Provenance'])) $this->Provenance = $o['Provenance'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['FetchedAtUtc'])) $this->FetchedAtUtc = JsonConverters::from('DateTime', $o['FetchedAtUtc']);
        if (isset($o['Vendor'])) $this->Vendor = $o['Vendor'];
        if (isset($o['Location'])) $this->Location = $o['Location'];
        if (isset($o['RateDay'])) $this->RateDay = $o['RateDay'];
        if (isset($o['RateWeek'])) $this->RateWeek = $o['RateWeek'];
        if (isset($o['RateMonth'])) $this->RateMonth = $o['RateMonth'];
        if (isset($o['AdjustmentPct'])) $this->AdjustmentPct = $o['AdjustmentPct'];
        if (isset($o['ListValue'])) $this->ListValue = $o['ListValue'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['ChipShort'])) $this->ChipShort = $o['ChipShort'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Tier)) $o['Tier'] = $this->Tier;
        if (isset($this->Confidence)) $o['Confidence'] = $this->Confidence;
        if (isset($this->Value)) $o['Value'] = $this->Value;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->Provenance)) $o['Provenance'] = $this->Provenance;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->FetchedAtUtc)) $o['FetchedAtUtc'] = JsonConverters::to('DateTime', $this->FetchedAtUtc);
        if (isset($this->Vendor)) $o['Vendor'] = $this->Vendor;
        if (isset($this->Location)) $o['Location'] = $this->Location;
        if (isset($this->RateDay)) $o['RateDay'] = $this->RateDay;
        if (isset($this->RateWeek)) $o['RateWeek'] = $this->RateWeek;
        if (isset($this->RateMonth)) $o['RateMonth'] = $this->RateMonth;
        if (isset($this->AdjustmentPct)) $o['AdjustmentPct'] = $this->AdjustmentPct;
        if (isset($this->ListValue)) $o['ListValue'] = $this->ListValue;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->ChipShort)) $o['ChipShort'] = $this->ChipShort;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        return empty($o) ? new class(){} : $o;
    }
}

class RatesResolveResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var string|null */
        public ?string $RateKey=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var array<RateQuote>|null */
        public ?array $Quotes=null,
        /** @var string|null */
        public ?string $RetailRequestId=null,
        /** @var float|null */
        public ?float $CurrentRate=null,
        /** @var string|null */
        public ?string $CurrentChip=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['RateKey'])) $this->RateKey = $o['RateKey'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['Quotes'])) $this->Quotes = JsonConverters::fromArray('RateQuote', $o['Quotes']);
        if (isset($o['RetailRequestId'])) $this->RetailRequestId = $o['RetailRequestId'];
        if (isset($o['CurrentRate'])) $this->CurrentRate = $o['CurrentRate'];
        if (isset($o['CurrentChip'])) $this->CurrentChip = $o['CurrentChip'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->RateKey)) $o['RateKey'] = $this->RateKey;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->Quotes)) $o['Quotes'] = JsonConverters::toArray('RateQuote', $this->Quotes);
        if (isset($this->RetailRequestId)) $o['RetailRequestId'] = $this->RetailRequestId;
        if (isset($this->CurrentRate)) $o['CurrentRate'] = $this->CurrentRate;
        if (isset($this->CurrentChip)) $o['CurrentChip'] = $this->CurrentChip;
        return empty($o) ? new class(){} : $o;
    }
}

class RatesResolveRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $RfpDocumentUID='',
        /** @var string|null */
        public ?string $RateKey=null
    ) {
    }

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

PHP RatesResolveRequest 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/Rfp/{RfpDocumentUID}/Rates/Resolve HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<RatesResolveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <RateKey>String</RateKey>
  <RfpDocumentUID>00000000-0000-0000-0000-000000000000</RfpDocumentUID>
</RatesResolveRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<RatesResolveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <CurrentChip>String</CurrentChip>
  <CurrentRate>0</CurrentRate>
  <Kind>String</Kind>
  <Name>String</Name>
  <Quotes>
    <RateQuote>
      <AdjustmentPct>0</AdjustmentPct>
      <ChipShort>String</ChipShort>
      <Confidence>String</Confidence>
      <FetchedAtUtc>0001-01-01T00:00:00</FetchedAtUtc>
      <ListValue>0</ListValue>
      <Location>String</Location>
      <Note>String</Note>
      <Provenance>String</Provenance>
      <RateDay>0</RateDay>
      <RateMonth>0</RateMonth>
      <RateWeek>0</RateWeek>
      <Status>String</Status>
      <Tier>String</Tier>
      <Unit>String</Unit>
      <Url>String</Url>
      <Value>0</Value>
      <Vendor>String</Vendor>
    </RateQuote>
  </Quotes>
  <RateKey>String</RateKey>
  <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>
  <RetailRequestId>String</RetailRequestId>
  <Unit>String</Unit>
</RatesResolveResponse>