Trendsic Platform Service

<back to all web services

CoveragePeopleSearchRequest

Requires Authentication
The following routes are available for this service:
GET/v1/coverage/people/search
<?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 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 CoveragePersonAnswer implements JsonSerializable
{
    public function __construct(
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var string|null */
        public ?string $Answer=null,
        /** @var CoverageExplanation|null */
        public ?CoverageExplanation $Expl=null
    ) {
    }

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

class CoveragePeopleSearchResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<CoveragePersonAnswer>|null */
        public ?array $Answers=null,
        /** @var string|null */
        public ?string $MissAnswer=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class CoveragePeopleSearchRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Q=null,
        /** @var int|null */
        public ?int $CoverageGapId=null
    ) {
    }

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

PHP CoveragePeopleSearchRequest 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/people/search HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Answers: 
	[
		{
			ContactId: 0,
			Name: String,
			Tone: String,
			Answer: 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
			}
		}
	],
	MissAnswer: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}