| 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 .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CommissionListings:
[
{
ID: 0,
ProcessDate: 0001-01-01,
PaymentDate: 0001-01-01,
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
}
],
CommissionListing:
{
ID: 0,
ProcessDate: 0001-01-01,
PaymentDate: 0001-01-01,
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
},
CommissionListingId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
CommissionListings:
[
{
ID: 0,
ProcessDate: 0001-01-01,
PaymentDate: 0001-01-01,
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
}
],
CommissionListingId: 0
}