| Requires any of the roles: | Agent, Administrator |
| GET | /v1/AutomatedAdjustment/type |
|---|
<?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 AutomatedAdjustment implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AutomatedAdustmentId=0,
/** @var string|null */
public ?string $Name=null,
/** @var int */
public int $FromAgentId=0,
/** @var string|null */
public ?string $ToAgentId=null,
/** @var string|null */
public ?string $ToAgentName=null,
/** @var string|null */
public ?string $Description=null,
/** @var int */
public int $TypeId=0,
/** @var string|null */
public ?string $TypeDescription=null,
/** @var int */
public int $FrequencyId=0,
/** @var string|null */
public ?string $FrequencyDescription=null,
/** @var float */
public float $Amount=0.0,
/** @var int */
public int $ChargeCount=0,
/** @var float */
public float $ChargeSum=0.0,
/** @var int */
public int $Installments=0,
/** @var DateTime|null */
public ?DateTime $PauseUntil=null,
/** @var DateTime */
public DateTime $DateCreated=new DateTime(),
/** @var string|null */
public ?string $CreatedBy=null,
/** @var string|null */
public ?string $ModifiedBy=null,
/** @var bool|null */
public ?bool $FirstCommissionRequired=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AutomatedAdustmentId'])) $this->AutomatedAdustmentId = $o['AutomatedAdustmentId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['FromAgentId'])) $this->FromAgentId = $o['FromAgentId'];
if (isset($o['ToAgentId'])) $this->ToAgentId = $o['ToAgentId'];
if (isset($o['ToAgentName'])) $this->ToAgentName = $o['ToAgentName'];
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['TypeId'])) $this->TypeId = $o['TypeId'];
if (isset($o['TypeDescription'])) $this->TypeDescription = $o['TypeDescription'];
if (isset($o['FrequencyId'])) $this->FrequencyId = $o['FrequencyId'];
if (isset($o['FrequencyDescription'])) $this->FrequencyDescription = $o['FrequencyDescription'];
if (isset($o['Amount'])) $this->Amount = $o['Amount'];
if (isset($o['ChargeCount'])) $this->ChargeCount = $o['ChargeCount'];
if (isset($o['ChargeSum'])) $this->ChargeSum = $o['ChargeSum'];
if (isset($o['Installments'])) $this->Installments = $o['Installments'];
if (isset($o['PauseUntil'])) $this->PauseUntil = JsonConverters::from('DateTime', $o['PauseUntil']);
if (isset($o['DateCreated'])) $this->DateCreated = JsonConverters::from('DateTime', $o['DateCreated']);
if (isset($o['CreatedBy'])) $this->CreatedBy = $o['CreatedBy'];
if (isset($o['ModifiedBy'])) $this->ModifiedBy = $o['ModifiedBy'];
if (isset($o['FirstCommissionRequired'])) $this->FirstCommissionRequired = $o['FirstCommissionRequired'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AutomatedAdustmentId)) $o['AutomatedAdustmentId'] = $this->AutomatedAdustmentId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->FromAgentId)) $o['FromAgentId'] = $this->FromAgentId;
if (isset($this->ToAgentId)) $o['ToAgentId'] = $this->ToAgentId;
if (isset($this->ToAgentName)) $o['ToAgentName'] = $this->ToAgentName;
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->TypeId)) $o['TypeId'] = $this->TypeId;
if (isset($this->TypeDescription)) $o['TypeDescription'] = $this->TypeDescription;
if (isset($this->FrequencyId)) $o['FrequencyId'] = $this->FrequencyId;
if (isset($this->FrequencyDescription)) $o['FrequencyDescription'] = $this->FrequencyDescription;
if (isset($this->Amount)) $o['Amount'] = $this->Amount;
if (isset($this->ChargeCount)) $o['ChargeCount'] = $this->ChargeCount;
if (isset($this->ChargeSum)) $o['ChargeSum'] = $this->ChargeSum;
if (isset($this->Installments)) $o['Installments'] = $this->Installments;
if (isset($this->PauseUntil)) $o['PauseUntil'] = JsonConverters::to('DateTime', $this->PauseUntil);
if (isset($this->DateCreated)) $o['DateCreated'] = JsonConverters::to('DateTime', $this->DateCreated);
if (isset($this->CreatedBy)) $o['CreatedBy'] = $this->CreatedBy;
if (isset($this->ModifiedBy)) $o['ModifiedBy'] = $this->ModifiedBy;
if (isset($this->FirstCommissionRequired)) $o['FirstCommissionRequired'] = $this->FirstCommissionRequired;
return empty($o) ? new class(){} : $o;
}
}
class AutomatedAdjustmentType implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AutomatedAdjustmentTypeId=0,
/** @var string|null */
public ?string $Description=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AutomatedAdjustmentTypeId'])) $this->AutomatedAdjustmentTypeId = $o['AutomatedAdjustmentTypeId'];
if (isset($o['Description'])) $this->Description = $o['Description'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AutomatedAdjustmentTypeId)) $o['AutomatedAdjustmentTypeId'] = $this->AutomatedAdjustmentTypeId;
if (isset($this->Description)) $o['Description'] = $this->Description;
return empty($o) ? new class(){} : $o;
}
}
class AutomatedAdjustmentfrequency implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AutomatedAdjustmentFrequencyId=0,
/** @var string|null */
public ?string $Description=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AutomatedAdjustmentFrequencyId'])) $this->AutomatedAdjustmentFrequencyId = $o['AutomatedAdjustmentFrequencyId'];
if (isset($o['Description'])) $this->Description = $o['Description'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AutomatedAdjustmentFrequencyId)) $o['AutomatedAdjustmentFrequencyId'] = $this->AutomatedAdjustmentFrequencyId;
if (isset($this->Description)) $o['Description'] = $this->Description;
return empty($o) ? new class(){} : $o;
}
}
class AutomatedAdjustmentResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<AutomatedAdjustment>|null */
public ?array $AutomatedAdjustments=null,
/** @var AutomatedAdjustment|null */
public ?AutomatedAdjustment $AutomatedAdjustment=null,
/** @var int */
public int $AutomatedAdjustmentID=0,
/** @var array<AutomatedAdjustmentType>|null */
public ?array $AutomatedAdjustmentTypes=null,
/** @var array<AutomatedAdjustmentfrequency>|null */
public ?array $AutomatedAdjustmentFrequencies=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['AutomatedAdjustments'])) $this->AutomatedAdjustments = JsonConverters::fromArray('AutomatedAdjustment', $o['AutomatedAdjustments']);
if (isset($o['AutomatedAdjustment'])) $this->AutomatedAdjustment = JsonConverters::from('AutomatedAdjustment', $o['AutomatedAdjustment']);
if (isset($o['AutomatedAdjustmentID'])) $this->AutomatedAdjustmentID = $o['AutomatedAdjustmentID'];
if (isset($o['AutomatedAdjustmentTypes'])) $this->AutomatedAdjustmentTypes = JsonConverters::fromArray('AutomatedAdjustmentType', $o['AutomatedAdjustmentTypes']);
if (isset($o['AutomatedAdjustmentFrequencies'])) $this->AutomatedAdjustmentFrequencies = JsonConverters::fromArray('AutomatedAdjustmentfrequency', $o['AutomatedAdjustmentFrequencies']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->AutomatedAdjustments)) $o['AutomatedAdjustments'] = JsonConverters::toArray('AutomatedAdjustment', $this->AutomatedAdjustments);
if (isset($this->AutomatedAdjustment)) $o['AutomatedAdjustment'] = JsonConverters::to('AutomatedAdjustment', $this->AutomatedAdjustment);
if (isset($this->AutomatedAdjustmentID)) $o['AutomatedAdjustmentID'] = $this->AutomatedAdjustmentID;
if (isset($this->AutomatedAdjustmentTypes)) $o['AutomatedAdjustmentTypes'] = JsonConverters::toArray('AutomatedAdjustmentType', $this->AutomatedAdjustmentTypes);
if (isset($this->AutomatedAdjustmentFrequencies)) $o['AutomatedAdjustmentFrequencies'] = JsonConverters::toArray('AutomatedAdjustmentfrequency', $this->AutomatedAdjustmentFrequencies);
return empty($o) ? new class(){} : $o;
}
}
class AutomatedAdjustmentTypeRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP AutomatedAdjustmentTypeRequest 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.
GET /v1/AutomatedAdjustment/type HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsv
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
}
},
AutomatedAdjustments:
[
{
AutomatedAdustmentId: 0,
Name: String,
FromAgentId: 0,
ToAgentId: 0,
ToAgentName: String,
Description: String,
TypeId: 0,
TypeDescription: String,
FrequencyId: 0,
FrequencyDescription: String,
Amount: 0,
ChargeCount: 0,
ChargeSum: 0,
Installments: 0,
PauseUntil: 0001-01-01,
DateCreated: 0001-01-01,
CreatedBy: String,
ModifiedBy: String,
FirstCommissionRequired: False
}
],
AutomatedAdjustment:
{
AutomatedAdustmentId: 0,
Name: String,
FromAgentId: 0,
ToAgentId: 0,
ToAgentName: String,
Description: String,
TypeId: 0,
TypeDescription: String,
FrequencyId: 0,
FrequencyDescription: String,
Amount: 0,
ChargeCount: 0,
ChargeSum: 0,
Installments: 0,
PauseUntil: 0001-01-01,
DateCreated: 0001-01-01,
CreatedBy: String,
ModifiedBy: String,
FirstCommissionRequired: False
},
AutomatedAdjustmentID: 0,
AutomatedAdjustmentTypes:
[
{
AutomatedAdjustmentTypeId: 0,
Description: String
}
],
AutomatedAdjustmentFrequencies:
[
{
AutomatedAdjustmentFrequencyId: 0,
Description: String
}
]
}