| Requires any of the roles: | Agent, Administrator, Agent, Administrator, Agent, Administrator, Agent, Administrator |
| GET,DELETE,OPTIONS | /v1/CommissionListing/{CommissionListingId} | ||
|---|---|---|---|
| GET,POST,PUT,OPTIONS | /v1/CommissionListing/ |
<?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 CommissionListingResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<CommissionListing>|null */
public ?array $CommissionListings=null,
/** @var int */
public int $CommissionListingId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['CommissionListings'])) $this->CommissionListings = JsonConverters::fromArray('CommissionListing', $o['CommissionListings']);
if (isset($o['CommissionListingId'])) $this->CommissionListingId = $o['CommissionListingId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->CommissionListings)) $o['CommissionListings'] = JsonConverters::toArray('CommissionListing', $this->CommissionListings);
if (isset($this->CommissionListingId)) $o['CommissionListingId'] = $this->CommissionListingId;
return empty($o) ? new class(){} : $o;
}
}
class CommissionListingRequest implements JsonSerializable
{
public function __construct(
/** @var array<CommissionListing>|null */
public ?array $CommissionListings=null,
/** @var CommissionListing|null */
public ?CommissionListing $CommissionListing=null,
/** @var int */
public int $CommissionListingId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CommissionListings'])) $this->CommissionListings = JsonConverters::fromArray('CommissionListing', $o['CommissionListings']);
if (isset($o['CommissionListing'])) $this->CommissionListing = JsonConverters::from('CommissionListing', $o['CommissionListing']);
if (isset($o['CommissionListingId'])) $this->CommissionListingId = $o['CommissionListingId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CommissionListings)) $o['CommissionListings'] = JsonConverters::toArray('CommissionListing', $this->CommissionListings);
if (isset($this->CommissionListing)) $o['CommissionListing'] = JsonConverters::to('CommissionListing', $this->CommissionListing);
if (isset($this->CommissionListingId)) $o['CommissionListingId'] = $this->CommissionListingId;
return empty($o) ? new class(){} : $o;
}
}
PHP CommissionListingRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/CommissionListing/ HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CommissionListingRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CommissionListing>
<Agent>String</Agent>
<AgentId>0</AgentId>
<AgentNumber>String</AgentNumber>
<Amount>0</Amount>
<CommissionRate>0</CommissionRate>
<Company>String</Company>
<Description>String</Description>
<Gross>0</Gross>
<ID>0</ID>
<Insured>String</Insured>
<OAgent>String</OAgent>
<OAgentID>0</OAgentID>
<Part>0</Part>
<PartPercent>0</PartPercent>
<PaymentDate>0001-01-01T00:00:00</PaymentDate>
<Policy>String</Policy>
<PolicyType>String</PolicyType>
<Premium>0</Premium>
<ProcessDate>0001-01-01T00:00:00</ProcessDate>
</CommissionListing>
<CommissionListingId>0</CommissionListingId>
<CommissionListings>
<CommissionListing>
<Agent>String</Agent>
<AgentId>0</AgentId>
<AgentNumber>String</AgentNumber>
<Amount>0</Amount>
<CommissionRate>0</CommissionRate>
<Company>String</Company>
<Description>String</Description>
<Gross>0</Gross>
<ID>0</ID>
<Insured>String</Insured>
<OAgent>String</OAgent>
<OAgentID>0</OAgentID>
<Part>0</Part>
<PartPercent>0</PartPercent>
<PaymentDate>0001-01-01T00:00:00</PaymentDate>
<Policy>String</Policy>
<PolicyType>String</PolicyType>
<Premium>0</Premium>
<ProcessDate>0001-01-01T00:00:00</ProcessDate>
</CommissionListing>
</CommissionListings>
</CommissionListingRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CommissionListingResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<CommissionListingId>0</CommissionListingId>
<CommissionListings>
<CommissionListing>
<Agent>String</Agent>
<AgentId>0</AgentId>
<AgentNumber>String</AgentNumber>
<Amount>0</Amount>
<CommissionRate>0</CommissionRate>
<Company>String</Company>
<Description>String</Description>
<Gross>0</Gross>
<ID>0</ID>
<Insured>String</Insured>
<OAgent>String</OAgent>
<OAgentID>0</OAgentID>
<Part>0</Part>
<PartPercent>0</PartPercent>
<PaymentDate>0001-01-01T00:00:00</PaymentDate>
<Policy>String</Policy>
<PolicyType>String</PolicyType>
<Premium>0</Premium>
<ProcessDate>0001-01-01T00:00:00</ProcessDate>
</CommissionListing>
</CommissionListings>
<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>
</CommissionListingResponse>