Trendsic Platform Service

<back to all web services

CoverageOfferClaimRequest

The following routes are available for this service:
POST/v1/coverage/offer/{Token}/claim
<?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 CoverageOfferEligChip implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Detail=null,
        /** @var string|null */
        public ?string $State=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Detail'])) $this->Detail = $o['Detail'];
        if (isset($o['State'])) $this->State = $o['State'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Detail)) $o['Detail'] = $this->Detail;
        if (isset($this->State)) $o['State'] = $this->State;
        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 CoverageOfferViewResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $WorkerFirst=null,
        /** @var string|null */
        public ?string $Primary=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Role=null,
        /** @var string|null */
        public ?string $Pay=null,
        /** @var string|null */
        public ?string $Site=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $GapDate=null,
        /** @var string|null */
        public ?string $GapTime=null,
        /** @var string|null */
        public ?string $CalMon=null,
        /** @var string|null */
        public ?string $CalDay=null,
        /** @var string|null */
        public ?string $ReportTo=null,
        /** @var array<CoverageOfferEligChip>|null */
        public ?array $Elig=null,
        /** @var string|null */
        public ?string $AssignmentMode=null,
        /** @var string|null */
        public ?string $Ticket=null,
        /** @var string|null */
        public ?string $Expires=null,
        /** @var CoverageExplanation|null */
        public ?CoverageExplanation $BlockExpl=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['WorkerFirst'])) $this->WorkerFirst = $o['WorkerFirst'];
        if (isset($o['Primary'])) $this->Primary = $o['Primary'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['Role'])) $this->Role = $o['Role'];
        if (isset($o['Pay'])) $this->Pay = $o['Pay'];
        if (isset($o['Site'])) $this->Site = $o['Site'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['GapDate'])) $this->GapDate = $o['GapDate'];
        if (isset($o['GapTime'])) $this->GapTime = $o['GapTime'];
        if (isset($o['CalMon'])) $this->CalMon = $o['CalMon'];
        if (isset($o['CalDay'])) $this->CalDay = $o['CalDay'];
        if (isset($o['ReportTo'])) $this->ReportTo = $o['ReportTo'];
        if (isset($o['Elig'])) $this->Elig = JsonConverters::fromArray('CoverageOfferEligChip', $o['Elig']);
        if (isset($o['AssignmentMode'])) $this->AssignmentMode = $o['AssignmentMode'];
        if (isset($o['Ticket'])) $this->Ticket = $o['Ticket'];
        if (isset($o['Expires'])) $this->Expires = $o['Expires'];
        if (isset($o['BlockExpl'])) $this->BlockExpl = JsonConverters::from('CoverageExplanation', $o['BlockExpl']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->WorkerFirst)) $o['WorkerFirst'] = $this->WorkerFirst;
        if (isset($this->Primary)) $o['Primary'] = $this->Primary;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->Role)) $o['Role'] = $this->Role;
        if (isset($this->Pay)) $o['Pay'] = $this->Pay;
        if (isset($this->Site)) $o['Site'] = $this->Site;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->GapDate)) $o['GapDate'] = $this->GapDate;
        if (isset($this->GapTime)) $o['GapTime'] = $this->GapTime;
        if (isset($this->CalMon)) $o['CalMon'] = $this->CalMon;
        if (isset($this->CalDay)) $o['CalDay'] = $this->CalDay;
        if (isset($this->ReportTo)) $o['ReportTo'] = $this->ReportTo;
        if (isset($this->Elig)) $o['Elig'] = JsonConverters::toArray('CoverageOfferEligChip', $this->Elig);
        if (isset($this->AssignmentMode)) $o['AssignmentMode'] = $this->AssignmentMode;
        if (isset($this->Ticket)) $o['Ticket'] = $this->Ticket;
        if (isset($this->Expires)) $o['Expires'] = $this->Expires;
        if (isset($this->BlockExpl)) $o['BlockExpl'] = JsonConverters::to('CoverageExplanation', $this->BlockExpl);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

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

POST /v1/coverage/offer/{Token}/claim HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Token: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	State: String,
	WorkerFirst: String,
	Primary: String,
	Kind: String,
	Role: String,
	Pay: String,
	Site: String,
	Address: String,
	GapDate: String,
	GapTime: String,
	CalMon: String,
	CalDay: String,
	ReportTo: String,
	Elig: 
	[
		{
			Label: String,
			Detail: String,
			State: String
		}
	],
	AssignmentMode: String,
	Ticket: String,
	Expires: String,
	BlockExpl: 
	{
		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
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}