Trendsic Platform Service

<back to all web services

AutomatedAdjustmentTypeRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
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 .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.

GET /v1/AutomatedAdjustment/type HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<AutomatedAdjustmentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AutomatedAdjustment>
    <Amount>0</Amount>
    <AutomatedAdustmentId>0</AutomatedAdustmentId>
    <ChargeCount>0</ChargeCount>
    <ChargeSum>0</ChargeSum>
    <CreatedBy>String</CreatedBy>
    <DateCreated>0001-01-01T00:00:00</DateCreated>
    <Description>String</Description>
    <FirstCommissionRequired>false</FirstCommissionRequired>
    <FrequencyDescription>String</FrequencyDescription>
    <FrequencyId>0</FrequencyId>
    <FromAgentId>0</FromAgentId>
    <Installments>0</Installments>
    <ModifiedBy>String</ModifiedBy>
    <Name>String</Name>
    <PauseUntil>0001-01-01T00:00:00</PauseUntil>
    <ToAgentId>0</ToAgentId>
    <ToAgentName>String</ToAgentName>
    <TypeDescription>String</TypeDescription>
    <TypeId>0</TypeId>
  </AutomatedAdjustment>
  <AutomatedAdjustmentFrequencies>
    <AutomatedAdjustmentfrequency>
      <AutomatedAdjustmentFrequencyId>0</AutomatedAdjustmentFrequencyId>
      <Description>String</Description>
    </AutomatedAdjustmentfrequency>
  </AutomatedAdjustmentFrequencies>
  <AutomatedAdjustmentID>0</AutomatedAdjustmentID>
  <AutomatedAdjustmentTypes>
    <AutomatedAdjustmentType>
      <AutomatedAdjustmentTypeId>0</AutomatedAdjustmentTypeId>
      <Description>String</Description>
    </AutomatedAdjustmentType>
  </AutomatedAdjustmentTypes>
  <AutomatedAdjustments>
    <AutomatedAdjustment>
      <Amount>0</Amount>
      <AutomatedAdustmentId>0</AutomatedAdustmentId>
      <ChargeCount>0</ChargeCount>
      <ChargeSum>0</ChargeSum>
      <CreatedBy>String</CreatedBy>
      <DateCreated>0001-01-01T00:00:00</DateCreated>
      <Description>String</Description>
      <FirstCommissionRequired>false</FirstCommissionRequired>
      <FrequencyDescription>String</FrequencyDescription>
      <FrequencyId>0</FrequencyId>
      <FromAgentId>0</FromAgentId>
      <Installments>0</Installments>
      <ModifiedBy>String</ModifiedBy>
      <Name>String</Name>
      <PauseUntil>0001-01-01T00:00:00</PauseUntil>
      <ToAgentId>0</ToAgentId>
      <ToAgentName>String</ToAgentName>
      <TypeDescription>String</TypeDescription>
      <TypeId>0</TypeId>
    </AutomatedAdjustment>
  </AutomatedAdjustments>
  <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>
</AutomatedAdjustmentResponse>