Trendsic Platform Service

<back to all web services

PolicyRequiredDocumentRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
PUT,DELETE,OPTIONS/v1/PolicyRequiredDocument/{Id}
POST,OPTIONS/v1/PolicyRequiredDocument
GET/v1/PolicyRequiredDocument/GetAllByPolicyAssociateId/{PolicyAssociateId}
<?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 PolicyDocumentStatus implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $IsNBCStatus=null,
        /** @var bool|null */
        public ?bool $IsAgentStatus=null
    ) {
    }

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

class PolicyRequiredDocument implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string */
        public string $PolicyAssociateId='',
        /** @var int */
        public int $PolicyDocumentId=0,
        /** @var int */
        public int $NBCStatusId=0,
        /** @var int */
        public int $AgentStatusId=0,
        /** @var array<PolicyDocumentStatus>|null */
        public ?array $StatusOptions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['PolicyAssociateId'])) $this->PolicyAssociateId = $o['PolicyAssociateId'];
        if (isset($o['PolicyDocumentId'])) $this->PolicyDocumentId = $o['PolicyDocumentId'];
        if (isset($o['NBCStatusId'])) $this->NBCStatusId = $o['NBCStatusId'];
        if (isset($o['AgentStatusId'])) $this->AgentStatusId = $o['AgentStatusId'];
        if (isset($o['StatusOptions'])) $this->StatusOptions = JsonConverters::fromArray('PolicyDocumentStatus', $o['StatusOptions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->PolicyAssociateId)) $o['PolicyAssociateId'] = $this->PolicyAssociateId;
        if (isset($this->PolicyDocumentId)) $o['PolicyDocumentId'] = $this->PolicyDocumentId;
        if (isset($this->NBCStatusId)) $o['NBCStatusId'] = $this->NBCStatusId;
        if (isset($this->AgentStatusId)) $o['AgentStatusId'] = $this->AgentStatusId;
        if (isset($this->StatusOptions)) $o['StatusOptions'] = JsonConverters::toArray('PolicyDocumentStatus', $this->StatusOptions);
        return empty($o) ? new class(){} : $o;
    }
}

class PolicyDocumentReminder implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var int */
        public int $PolicyDocumentId=0,
        /** @var string|null */
        public ?string $ReminderFor=null,
        /** @var int */
        public int $ReminderLeadTime=0,
        /** @var string|null */
        public ?string $ReminderMessage=null,
        /** @var int */
        public int $AdminAgentId=0,
        /** @var bool|null */
        public ?bool $NeedsPrompt=null
    ) {
    }

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

class Reminder implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReminderId='',
        /** @var string|null */
        public ?string $TableName=null,
        /** @var string|null */
        public ?string $FieldName=null,
        /** @var int */
        public int $RecordId=0,
        /** @var DateTime */
        public DateTime $ReminderDate=new DateTime(),
        /** @var string|null */
        public ?string $ReminderNote=null,
        /** @var DateTime */
        public DateTime $CreatedDate=new DateTime(),
        /** @var string|null */
        public ?string $CreatedBy=null,
        /** @var DateTime */
        public DateTime $CompletedDate=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ReminderId'])) $this->ReminderId = $o['ReminderId'];
        if (isset($o['TableName'])) $this->TableName = $o['TableName'];
        if (isset($o['FieldName'])) $this->FieldName = $o['FieldName'];
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['ReminderDate'])) $this->ReminderDate = JsonConverters::from('DateTime', $o['ReminderDate']);
        if (isset($o['ReminderNote'])) $this->ReminderNote = $o['ReminderNote'];
        if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
        if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
        if (isset($o['CompletedDate'])) $this->CompletedDate = JsonConverters::from('DateTime', $o['CompletedDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ReminderId)) $o['ReminderId'] = $this->ReminderId;
        if (isset($this->TableName)) $o['TableName'] = $this->TableName;
        if (isset($this->FieldName)) $o['FieldName'] = $this->FieldName;
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->ReminderDate)) $o['ReminderDate'] = JsonConverters::to('DateTime', $this->ReminderDate);
        if (isset($this->ReminderNote)) $o['ReminderNote'] = $this->ReminderNote;
        if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
        if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
        if (isset($this->CompletedDate)) $o['CompletedDate'] = JsonConverters::to('DateTime', $this->CompletedDate);
        return empty($o) ? new class(){} : $o;
    }
}

class ReminderExtended extends Reminder implements JsonSerializable
{
    /**
     * @param string $ReminderId
     * @param string|null $TableName
     * @param string|null $FieldName
     * @param int $RecordId
     * @param DateTime $ReminderDate
     * @param string|null $ReminderNote
     * @param DateTime $CreatedDate
     * @param string|null $CreatedBy
     * @param DateTime $CompletedDate
     */
    public function __construct(
        string $ReminderId='',
        ?string $TableName=null,
        ?string $FieldName=null,
        int $RecordId=0,
        DateTime $ReminderDate=new DateTime(),
        ?string $ReminderNote=null,
        DateTime $CreatedDate=new DateTime(),
        ?string $CreatedBy=null,
        DateTime $CompletedDate=new DateTime(),
        /** @var string|null */
        public ?string $AgentName=null,
        /** @var string|null */
        public ?string $RecordAgentName=null,
        /** @var int */
        public int $RecordAgentID=0,
        /** @var bool|null */
        public ?bool $IsAdmin=null,
        /** @var int */
        public int $AgentID=0
    ) {
        parent::__construct($ReminderId,$TableName,$FieldName,$RecordId,$ReminderDate,$ReminderNote,$CreatedDate,$CreatedBy,$CompletedDate);
    }

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

class PolicyRequiredDocumentExtended extends PolicyRequiredDocument implements JsonSerializable
{
    /**
     * @param int $Id
     * @param string $PolicyAssociateId
     * @param int $PolicyDocumentId
     * @param int $NBCStatusId
     * @param int $AgentStatusId
     * @param array<PolicyDocumentStatus>|null $StatusOptions
     */
    public function __construct(
        int $Id=0,
        string $PolicyAssociateId='',
        int $PolicyDocumentId=0,
        int $NBCStatusId=0,
        int $AgentStatusId=0,
        ?array $StatusOptions=null,
        /** @var array<PolicyDocumentReminder>|null */
        public ?array $Reminders=null,
        /** @var array<ReminderExtended>|null */
        public ?array $AgentReminders=null
    ) {
        parent::__construct($Id,$PolicyAssociateId,$PolicyDocumentId,$NBCStatusId,$AgentStatusId,$StatusOptions);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Reminders'])) $this->Reminders = JsonConverters::fromArray('PolicyDocumentReminder', $o['Reminders']);
        if (isset($o['AgentReminders'])) $this->AgentReminders = JsonConverters::fromArray('ReminderExtended', $o['AgentReminders']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Reminders)) $o['Reminders'] = JsonConverters::toArray('PolicyDocumentReminder', $this->Reminders);
        if (isset($this->AgentReminders)) $o['AgentReminders'] = JsonConverters::toArray('ReminderExtended', $this->AgentReminders);
        return empty($o) ? new class(){} : $o;
    }
}

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

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

class PolicyRequiredDocumentRequest implements JsonSerializable
{
    public function __construct(
        /** @var PolicyRequiredDocumentExtended|null */
        public ?PolicyRequiredDocumentExtended $PolicyRequiredDocument=null,
        /** @var string|null */
        public ?string $PolicyAssociateId=null,
        /** @var int|null */
        public ?int $Id=null
    ) {
    }

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

PHP PolicyRequiredDocumentRequest DTOs

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

HTTP + XML

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

POST /v1/PolicyRequiredDocument HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PolicyRequiredDocumentRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Id>0</Id>
  <PolicyAssociateId>00000000-0000-0000-0000-000000000000</PolicyAssociateId>
  <PolicyRequiredDocument>
    <AgentStatusId>0</AgentStatusId>
    <Id>0</Id>
    <NBCStatusId>0</NBCStatusId>
    <PolicyAssociateId>00000000-0000-0000-0000-000000000000</PolicyAssociateId>
    <PolicyDocumentId>0</PolicyDocumentId>
    <StatusOptions>
      <PolicyDocumentStatus>
        <Id>0</Id>
        <IsAgentStatus>false</IsAgentStatus>
        <IsNBCStatus>false</IsNBCStatus>
        <Name>String</Name>
      </PolicyDocumentStatus>
    </StatusOptions>
    <AgentReminders>
      <ReminderExtended>
        <CompletedDate>0001-01-01T00:00:00</CompletedDate>
        <CreatedBy>String</CreatedBy>
        <CreatedDate>0001-01-01T00:00:00</CreatedDate>
        <FieldName>String</FieldName>
        <RecordId>0</RecordId>
        <ReminderDate>0001-01-01T00:00:00</ReminderDate>
        <ReminderId>00000000-0000-0000-0000-000000000000</ReminderId>
        <ReminderNote>String</ReminderNote>
        <TableName>String</TableName>
        <AgentID>0</AgentID>
        <AgentName>String</AgentName>
        <IsAdmin>false</IsAdmin>
        <RecordAgentID>0</RecordAgentID>
        <RecordAgentName>String</RecordAgentName>
      </ReminderExtended>
    </AgentReminders>
    <Reminders>
      <PolicyDocumentReminder>
        <AdminAgentId>0</AdminAgentId>
        <Id>0</Id>
        <NeedsPrompt>false</NeedsPrompt>
        <PolicyDocumentId>0</PolicyDocumentId>
        <ReminderFor>String</ReminderFor>
        <ReminderLeadTime>0</ReminderLeadTime>
        <ReminderMessage>String</ReminderMessage>
      </PolicyDocumentReminder>
    </Reminders>
  </PolicyRequiredDocument>
</PolicyRequiredDocumentRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PolicyRequiredDocumentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <PolicyRequiredDocuments>
    <PolicyRequiredDocumentExtended>
      <AgentStatusId>0</AgentStatusId>
      <Id>0</Id>
      <NBCStatusId>0</NBCStatusId>
      <PolicyAssociateId>00000000-0000-0000-0000-000000000000</PolicyAssociateId>
      <PolicyDocumentId>0</PolicyDocumentId>
      <StatusOptions>
        <PolicyDocumentStatus>
          <Id>0</Id>
          <IsAgentStatus>false</IsAgentStatus>
          <IsNBCStatus>false</IsNBCStatus>
          <Name>String</Name>
        </PolicyDocumentStatus>
      </StatusOptions>
      <AgentReminders>
        <ReminderExtended>
          <CompletedDate>0001-01-01T00:00:00</CompletedDate>
          <CreatedBy>String</CreatedBy>
          <CreatedDate>0001-01-01T00:00:00</CreatedDate>
          <FieldName>String</FieldName>
          <RecordId>0</RecordId>
          <ReminderDate>0001-01-01T00:00:00</ReminderDate>
          <ReminderId>00000000-0000-0000-0000-000000000000</ReminderId>
          <ReminderNote>String</ReminderNote>
          <TableName>String</TableName>
          <AgentID>0</AgentID>
          <AgentName>String</AgentName>
          <IsAdmin>false</IsAdmin>
          <RecordAgentID>0</RecordAgentID>
          <RecordAgentName>String</RecordAgentName>
        </ReminderExtended>
      </AgentReminders>
      <Reminders>
        <PolicyDocumentReminder>
          <AdminAgentId>0</AdminAgentId>
          <Id>0</Id>
          <NeedsPrompt>false</NeedsPrompt>
          <PolicyDocumentId>0</PolicyDocumentId>
          <ReminderFor>String</ReminderFor>
          <ReminderLeadTime>0</ReminderLeadTime>
          <ReminderMessage>String</ReminderMessage>
        </PolicyDocumentReminder>
      </Reminders>
    </PolicyRequiredDocumentExtended>
  </PolicyRequiredDocuments>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</PolicyRequiredDocumentResponse>