Trendsic Platform Service

<back to all web services

PolicyReportRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/PolicyReport/{PolicyNumber}
<?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 CommissionListing implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var DateTime */
        public DateTime $ProcessDate=new DateTime(),
        /** @var DateTime */
        public DateTime $PaymentDate=new DateTime(),
        /** @var int */
        public int $AgentId=0,
        /** @var string|null */
        public ?string $Agent=null,
        /** @var int */
        public int $OAgentID=0,
        /** @var string|null */
        public ?string $OAgent=null,
        /** @var string|null */
        public ?string $Policy=null,
        /** @var string|null */
        public ?string $PolicyType=null,
        /** @var string|null */
        public ?string $Insured=null,
        /** @var float */
        public float $Premium=0.0,
        /** @var float */
        public float $Part=0.0,
        /** @var float */
        public float $PartPercent=0.0,
        /** @var float */
        public float $Amount=0.0,
        /** @var string|null */
        public ?string $Company=null,
        /** @var float */
        public float $Gross=0.0,
        /** @var string|null */
        public ?string $AgentNumber=null,
        /** @var float */
        public float $CommissionRate=0.0,
        /** @var string|null */
        public ?string $Description=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['ProcessDate'])) $this->ProcessDate = JsonConverters::from('DateTime', $o['ProcessDate']);
        if (isset($o['PaymentDate'])) $this->PaymentDate = JsonConverters::from('DateTime', $o['PaymentDate']);
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
        if (isset($o['Agent'])) $this->Agent = $o['Agent'];
        if (isset($o['OAgentID'])) $this->OAgentID = $o['OAgentID'];
        if (isset($o['OAgent'])) $this->OAgent = $o['OAgent'];
        if (isset($o['Policy'])) $this->Policy = $o['Policy'];
        if (isset($o['PolicyType'])) $this->PolicyType = $o['PolicyType'];
        if (isset($o['Insured'])) $this->Insured = $o['Insured'];
        if (isset($o['Premium'])) $this->Premium = $o['Premium'];
        if (isset($o['Part'])) $this->Part = $o['Part'];
        if (isset($o['PartPercent'])) $this->PartPercent = $o['PartPercent'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Company'])) $this->Company = $o['Company'];
        if (isset($o['Gross'])) $this->Gross = $o['Gross'];
        if (isset($o['AgentNumber'])) $this->AgentNumber = $o['AgentNumber'];
        if (isset($o['CommissionRate'])) $this->CommissionRate = $o['CommissionRate'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->ProcessDate)) $o['ProcessDate'] = JsonConverters::to('DateTime', $this->ProcessDate);
        if (isset($this->PaymentDate)) $o['PaymentDate'] = JsonConverters::to('DateTime', $this->PaymentDate);
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        if (isset($this->Agent)) $o['Agent'] = $this->Agent;
        if (isset($this->OAgentID)) $o['OAgentID'] = $this->OAgentID;
        if (isset($this->OAgent)) $o['OAgent'] = $this->OAgent;
        if (isset($this->Policy)) $o['Policy'] = $this->Policy;
        if (isset($this->PolicyType)) $o['PolicyType'] = $this->PolicyType;
        if (isset($this->Insured)) $o['Insured'] = $this->Insured;
        if (isset($this->Premium)) $o['Premium'] = $this->Premium;
        if (isset($this->Part)) $o['Part'] = $this->Part;
        if (isset($this->PartPercent)) $o['PartPercent'] = $this->PartPercent;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Company)) $o['Company'] = $this->Company;
        if (isset($this->Gross)) $o['Gross'] = $this->Gross;
        if (isset($this->AgentNumber)) $o['AgentNumber'] = $this->AgentNumber;
        if (isset($this->CommissionRate)) $o['CommissionRate'] = $this->CommissionRate;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        return empty($o) ? new class(){} : $o;
    }
}

class PolicyReportResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<CommissionListing>|null */
        public ?array $ReportData=null
    ) {
    }

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

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

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

PHP PolicyReportRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /v1/PolicyReport/{PolicyNumber} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ReportData":[{"ID":0,"ProcessDate":"0001-01-01T00:00:00.0000000","PaymentDate":"0001-01-01T00:00:00.0000000","AgentId":0,"Agent":"String","OAgentID":0,"OAgent":"String","Policy":"String","PolicyType":"String","Insured":"String","Premium":0,"Part":0,"PartPercent":0,"Amount":0,"Company":"String","Gross":0,"AgentNumber":"String","CommissionRate":0,"Description":"String"}]}