| Requires any of the roles: | Agent, Administrator |
| 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;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
RfpDocumentUID: 00000000000000000000000000000000,
RateKey: 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
}
},
RateKey: String,
Name: String,
Kind: String,
Unit: String,
Quotes:
[
{
Tier: String,
Confidence: String,
Value: 0,
Unit: String,
Provenance: String,
Url: String,
FetchedAtUtc: 0001-01-01,
Vendor: String,
Location: String,
RateDay: 0,
RateWeek: 0,
RateMonth: 0,
AdjustmentPct: 0,
ListValue: 0,
Note: String,
ChipShort: String,
Status: String
}
],
RetailRequestId: String,
CurrentRate: 0,
CurrentChip: String
}