Trendsic Platform Service

<back to all web services

CoverageSurgePreviewRequest

Requires Authentication
The following routes are available for this service:
GET/v1/coverage/surge/preview
<?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 CoverageSurgeGap implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CoverageGapId=0,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Track=null
    ) {
    }

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

class CoverageExplanationSource implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $PolicyName=null,
        /** @var string|null */
        public ?string $CascadeLevel=null
    ) {
    }

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

class CoverageExplanationOverride implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Who=null,
        /** @var string|null */
        public ?string $Consequence=null
    ) {
    }

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

class CoverageExplanation implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $PlainSentence=null,
        /** @var string|null */
        public ?string $RuleId=null,
        /** @var string|null */
        public ?string $RuleName=null,
        /** @var string|null */
        public ?string $Demand=null,
        /** @var CoverageExplanationSource|null */
        public ?CoverageExplanationSource $Source=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $WhyItExists=null,
        /** @var string|null */
        public ?string $WhatWouldChangeIt=null,
        /** @var CoverageExplanationOverride|null */
        public ?CoverageExplanationOverride $Override=null,
        /** @var string|null */
        public ?string $Drill=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PlainSentence'])) $this->PlainSentence = $o['PlainSentence'];
        if (isset($o['RuleId'])) $this->RuleId = $o['RuleId'];
        if (isset($o['RuleName'])) $this->RuleName = $o['RuleName'];
        if (isset($o['Demand'])) $this->Demand = $o['Demand'];
        if (isset($o['Source'])) $this->Source = JsonConverters::from('CoverageExplanationSource', $o['Source']);
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['WhyItExists'])) $this->WhyItExists = $o['WhyItExists'];
        if (isset($o['WhatWouldChangeIt'])) $this->WhatWouldChangeIt = $o['WhatWouldChangeIt'];
        if (isset($o['Override'])) $this->Override = JsonConverters::from('CoverageExplanationOverride', $o['Override']);
        if (isset($o['Drill'])) $this->Drill = $o['Drill'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PlainSentence)) $o['PlainSentence'] = $this->PlainSentence;
        if (isset($this->RuleId)) $o['RuleId'] = $this->RuleId;
        if (isset($this->RuleName)) $o['RuleName'] = $this->RuleName;
        if (isset($this->Demand)) $o['Demand'] = $this->Demand;
        if (isset($this->Source)) $o['Source'] = JsonConverters::to('CoverageExplanationSource', $this->Source);
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->WhyItExists)) $o['WhyItExists'] = $this->WhyItExists;
        if (isset($this->WhatWouldChangeIt)) $o['WhatWouldChangeIt'] = $this->WhatWouldChangeIt;
        if (isset($this->Override)) $o['Override'] = JsonConverters::to('CoverageExplanationOverride', $this->Override);
        if (isset($this->Drill)) $o['Drill'] = $this->Drill;
        return empty($o) ? new class(){} : $o;
    }
}

class CoverageEffect implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Icon=null,
        /** @var string|null */
        public ?string $Text=null,
        /** @var string|null */
        public ?string $RuleId=null,
        /** @var CoverageExplanation|null */
        public ?CoverageExplanation $Expl=null
    ) {
    }

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

class CoverageSurgePreviewResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Banner=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Sub=null,
        /** @var array<CoverageSurgeGap>|null */
        public ?array $Items=null,
        /** @var int */
        public int $PoolCount=0,
        /** @var array<CoverageEffect>|null */
        public ?array $Conseq=null,
        /** @var string|null */
        public ?string $GuardLine=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Banner'])) $this->Banner = $o['Banner'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['Sub'])) $this->Sub = $o['Sub'];
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('CoverageSurgeGap', $o['Items']);
        if (isset($o['PoolCount'])) $this->PoolCount = $o['PoolCount'];
        if (isset($o['Conseq'])) $this->Conseq = JsonConverters::fromArray('CoverageEffect', $o['Conseq']);
        if (isset($o['GuardLine'])) $this->GuardLine = $o['GuardLine'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Banner)) $o['Banner'] = $this->Banner;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->Sub)) $o['Sub'] = $this->Sub;
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('CoverageSurgeGap', $this->Items);
        if (isset($this->PoolCount)) $o['PoolCount'] = $this->PoolCount;
        if (isset($this->Conseq)) $o['Conseq'] = JsonConverters::toArray('CoverageEffect', $this->Conseq);
        if (isset($this->GuardLine)) $o['GuardLine'] = $this->GuardLine;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class CoverageSurgePreviewRequest implements JsonSerializable
{
    public function __construct(
        /** @var DateTime|null */
        public ?DateTime $ScopeDate=null
    ) {
    }

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

PHP CoverageSurgePreviewRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/coverage/surge/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Banner":"String","Title":"String","Sub":"String","Items":[{"CoverageGapId":0,"Label":"String","Note":"String","Track":"String"}],"PoolCount":0,"Conseq":[{"Icon":"String","Text":"String","RuleId":"String","Expl":{"PlainSentence":"String","RuleId":"String","RuleName":"String","Demand":"String","Source":{"PolicyName":"String","CascadeLevel":"String"},"Kind":"String","WhyItExists":"String","WhatWouldChangeIt":"String","Override":{"Who":"String","Consequence":"String"},"Drill":"String"}}],"GuardLine":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}