Trendsic Platform Service

<back to all web services

CoverageBoardRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/coverage/board
<?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 CoverageSelfMatrixRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Tone=null
    ) {
    }

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

class CoverageBoardShift implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CoverageGapId=0,
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $Day=null,
        /** @var string|null */
        public ?string $Window=null,
        /** @var string|null */
        public ?string $Site=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $Poster=null,
        /** @var string|null */
        public ?string $ExpiryLabel=null,
        /** @var bool|null */
        public ?bool $ExpiresSoon=null,
        /** @var int */
        public int $EligibleCount=0,
        /** @var int */
        public int $IneligibleCount=0,
        /** @var int */
        public int $OfferedCount=0,
        /** @var int */
        public int $ClaimsCount=0,
        /** @var string|null */
        public ?string $ClaimantName=null,
        /** @var string|null */
        public ?string $AudienceTier=null,
        /** @var array<CoverageSelfMatrixRow>|null */
        public ?array $Matrix=null,
        /** @var int */
        public int $NotYetOffered=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CoverageGapId'])) $this->CoverageGapId = $o['CoverageGapId'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Day'])) $this->Day = $o['Day'];
        if (isset($o['Window'])) $this->Window = $o['Window'];
        if (isset($o['Site'])) $this->Site = $o['Site'];
        if (isset($o['Role'])) $this->Role = $o['Role'];
        if (isset($o['Poster'])) $this->Poster = $o['Poster'];
        if (isset($o['ExpiryLabel'])) $this->ExpiryLabel = $o['ExpiryLabel'];
        if (isset($o['ExpiresSoon'])) $this->ExpiresSoon = $o['ExpiresSoon'];
        if (isset($o['EligibleCount'])) $this->EligibleCount = $o['EligibleCount'];
        if (isset($o['IneligibleCount'])) $this->IneligibleCount = $o['IneligibleCount'];
        if (isset($o['OfferedCount'])) $this->OfferedCount = $o['OfferedCount'];
        if (isset($o['ClaimsCount'])) $this->ClaimsCount = $o['ClaimsCount'];
        if (isset($o['ClaimantName'])) $this->ClaimantName = $o['ClaimantName'];
        if (isset($o['AudienceTier'])) $this->AudienceTier = $o['AudienceTier'];
        if (isset($o['Matrix'])) $this->Matrix = JsonConverters::fromArray('CoverageSelfMatrixRow', $o['Matrix']);
        if (isset($o['NotYetOffered'])) $this->NotYetOffered = $o['NotYetOffered'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CoverageGapId)) $o['CoverageGapId'] = $this->CoverageGapId;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Day)) $o['Day'] = $this->Day;
        if (isset($this->Window)) $o['Window'] = $this->Window;
        if (isset($this->Site)) $o['Site'] = $this->Site;
        if (isset($this->Role)) $o['Role'] = $this->Role;
        if (isset($this->Poster)) $o['Poster'] = $this->Poster;
        if (isset($this->ExpiryLabel)) $o['ExpiryLabel'] = $this->ExpiryLabel;
        if (isset($this->ExpiresSoon)) $o['ExpiresSoon'] = $this->ExpiresSoon;
        if (isset($this->EligibleCount)) $o['EligibleCount'] = $this->EligibleCount;
        if (isset($this->IneligibleCount)) $o['IneligibleCount'] = $this->IneligibleCount;
        if (isset($this->OfferedCount)) $o['OfferedCount'] = $this->OfferedCount;
        if (isset($this->ClaimsCount)) $o['ClaimsCount'] = $this->ClaimsCount;
        if (isset($this->ClaimantName)) $o['ClaimantName'] = $this->ClaimantName;
        if (isset($this->AudienceTier)) $o['AudienceTier'] = $this->AudienceTier;
        if (isset($this->Matrix)) $o['Matrix'] = JsonConverters::toArray('CoverageSelfMatrixRow', $this->Matrix);
        if (isset($this->NotYetOffered)) $o['NotYetOffered'] = $this->NotYetOffered;
        return empty($o) ? new class(){} : $o;
    }
}

class CoverageBoardApproval implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $CoverageApprovalId=0,
        /** @var int */
        public int $CoverageGapId=0,
        /** @var string|null */
        public ?string $Claimant=null,
        /** @var string|null */
        public ?string $Poster=null,
        /** @var string|null */
        public ?string $Day=null,
        /** @var string|null */
        public ?string $Window=null,
        /** @var string|null */
        public ?string $Site=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $OtText=null,
        /** @var string|null */
        public ?string $OtNote=null,
        /** @var bool|null */
        public ?bool $OtWarn=null,
        /** @var string|null */
        public ?string $MarginText=null,
        /** @var string|null */
        public ?string $MarginNote=null,
        /** @var string|null */
        public ?string $MarginTone=null,
        /** @var string|null */
        public ?string $EligText=null,
        /** @var string|null */
        public ?string $EligNote=null,
        /** @var bool|null */
        public ?bool $EligWarn=null,
        /** @var string|null */
        public ?string $Channel=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CoverageApprovalId'])) $this->CoverageApprovalId = $o['CoverageApprovalId'];
        if (isset($o['CoverageGapId'])) $this->CoverageGapId = $o['CoverageGapId'];
        if (isset($o['Claimant'])) $this->Claimant = $o['Claimant'];
        if (isset($o['Poster'])) $this->Poster = $o['Poster'];
        if (isset($o['Day'])) $this->Day = $o['Day'];
        if (isset($o['Window'])) $this->Window = $o['Window'];
        if (isset($o['Site'])) $this->Site = $o['Site'];
        if (isset($o['Role'])) $this->Role = $o['Role'];
        if (isset($o['OtText'])) $this->OtText = $o['OtText'];
        if (isset($o['OtNote'])) $this->OtNote = $o['OtNote'];
        if (isset($o['OtWarn'])) $this->OtWarn = $o['OtWarn'];
        if (isset($o['MarginText'])) $this->MarginText = $o['MarginText'];
        if (isset($o['MarginNote'])) $this->MarginNote = $o['MarginNote'];
        if (isset($o['MarginTone'])) $this->MarginTone = $o['MarginTone'];
        if (isset($o['EligText'])) $this->EligText = $o['EligText'];
        if (isset($o['EligNote'])) $this->EligNote = $o['EligNote'];
        if (isset($o['EligWarn'])) $this->EligWarn = $o['EligWarn'];
        if (isset($o['Channel'])) $this->Channel = $o['Channel'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CoverageApprovalId)) $o['CoverageApprovalId'] = $this->CoverageApprovalId;
        if (isset($this->CoverageGapId)) $o['CoverageGapId'] = $this->CoverageGapId;
        if (isset($this->Claimant)) $o['Claimant'] = $this->Claimant;
        if (isset($this->Poster)) $o['Poster'] = $this->Poster;
        if (isset($this->Day)) $o['Day'] = $this->Day;
        if (isset($this->Window)) $o['Window'] = $this->Window;
        if (isset($this->Site)) $o['Site'] = $this->Site;
        if (isset($this->Role)) $o['Role'] = $this->Role;
        if (isset($this->OtText)) $o['OtText'] = $this->OtText;
        if (isset($this->OtNote)) $o['OtNote'] = $this->OtNote;
        if (isset($this->OtWarn)) $o['OtWarn'] = $this->OtWarn;
        if (isset($this->MarginText)) $o['MarginText'] = $this->MarginText;
        if (isset($this->MarginNote)) $o['MarginNote'] = $this->MarginNote;
        if (isset($this->MarginTone)) $o['MarginTone'] = $this->MarginTone;
        if (isset($this->EligText)) $o['EligText'] = $this->EligText;
        if (isset($this->EligNote)) $o['EligNote'] = $this->EligNote;
        if (isset($this->EligWarn)) $o['EligWarn'] = $this->EligWarn;
        if (isset($this->Channel)) $o['Channel'] = $this->Channel;
        return empty($o) ? new class(){} : $o;
    }
}

class CoverageBoardHistoryRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $Detail=null,
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var string|null */
        public ?string $WhenLabel=null
    ) {
    }

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

class CoverageBoardResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<CoverageBoardShift>|null */
        public ?array $Shifts=null,
        /** @var array<CoverageBoardApproval>|null */
        public ?array $Approvals=null,
        /** @var array<CoverageBoardHistoryRow>|null */
        public ?array $History=null,
        /** @var bool|null */
        public ?bool $CanApprove=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Shifts'])) $this->Shifts = JsonConverters::fromArray('CoverageBoardShift', $o['Shifts']);
        if (isset($o['Approvals'])) $this->Approvals = JsonConverters::fromArray('CoverageBoardApproval', $o['Approvals']);
        if (isset($o['History'])) $this->History = JsonConverters::fromArray('CoverageBoardHistoryRow', $o['History']);
        if (isset($o['CanApprove'])) $this->CanApprove = $o['CanApprove'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Shifts)) $o['Shifts'] = JsonConverters::toArray('CoverageBoardShift', $this->Shifts);
        if (isset($this->Approvals)) $o['Approvals'] = JsonConverters::toArray('CoverageBoardApproval', $this->Approvals);
        if (isset($this->History)) $o['History'] = JsonConverters::toArray('CoverageBoardHistoryRow', $this->History);
        if (isset($this->CanApprove)) $o['CanApprove'] = $this->CanApprove;
        return empty($o) ? new class(){} : $o;
    }
}

class CoverageBoardRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $BranchId=null
    ) {
    }

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

PHP CoverageBoardRequest 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.

GET /v1/coverage/board HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
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
		}
	},
	Shifts: 
	[
		{
			CoverageGapId: 0,
			State: String,
			Day: String,
			Window: String,
			Site: String,
			Role: String,
			Poster: String,
			ExpiryLabel: String,
			ExpiresSoon: False,
			EligibleCount: 0,
			IneligibleCount: 0,
			OfferedCount: 0,
			ClaimsCount: 0,
			ClaimantName: String,
			AudienceTier: String,
			Matrix: 
			[
				{
					Name: String,
					Note: String,
					Tone: String
				}
			],
			NotYetOffered: 0
		}
	],
	Approvals: 
	[
		{
			CoverageApprovalId: 0,
			CoverageGapId: 0,
			Claimant: String,
			Poster: String,
			Day: String,
			Window: String,
			Site: String,
			Role: String,
			OtText: String,
			OtNote: String,
			OtWarn: False,
			MarginText: String,
			MarginNote: String,
			MarginTone: String,
			EligText: String,
			EligNote: String,
			EligWarn: False,
			Channel: String
		}
	],
	History: 
	[
		{
			Kind: String,
			Title: String,
			Detail: String,
			Outcome: String,
			WhenLabel: String
		}
	],
	CanApprove: False
}