Trendsic Platform Service

<back to all web services

LeaderboardRequest

The following routes are available for this service:
POST,OPTIONS/v1/Leaderboard
GET,OPTIONS/v1/Leaderboard/{LeaderboardType}/{StartDate}/{EndDate}
<?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 Leaderboard implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Position=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Location=null,
        /** @var float */
        public float $LifeCashFlow=0.0,
        /** @var float */
        public float $AnnuityCashFlow=0.0,
        /** @var float */
        public float $TotalCashFlow=0.0,
        /** @var float */
        public float $PremiumLife=0.0,
        /** @var float */
        public float $PremiumAnnuity=0.0,
        /** @var float */
        public float $PointsLife=0.0,
        /** @var float */
        public float $PointsAnnuity=0.0,
        /** @var float */
        public float $TotalPoints=0.0,
        /** @var bool|null */
        public ?bool $IsMVP=null,
        /** @var bool|null */
        public ?bool $IsRVP=null,
        /** @var bool|null */
        public ?bool $IsAVP=null,
        /** @var bool|null */
        public ?bool $IsAgent=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Upline1Name=null,
        /** @var string|null */
        public ?string $Upline2Name=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Position'])) $this->Position = $o['Position'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Location'])) $this->Location = $o['Location'];
        if (isset($o['LifeCashFlow'])) $this->LifeCashFlow = $o['LifeCashFlow'];
        if (isset($o['AnnuityCashFlow'])) $this->AnnuityCashFlow = $o['AnnuityCashFlow'];
        if (isset($o['TotalCashFlow'])) $this->TotalCashFlow = $o['TotalCashFlow'];
        if (isset($o['PremiumLife'])) $this->PremiumLife = $o['PremiumLife'];
        if (isset($o['PremiumAnnuity'])) $this->PremiumAnnuity = $o['PremiumAnnuity'];
        if (isset($o['PointsLife'])) $this->PointsLife = $o['PointsLife'];
        if (isset($o['PointsAnnuity'])) $this->PointsAnnuity = $o['PointsAnnuity'];
        if (isset($o['TotalPoints'])) $this->TotalPoints = $o['TotalPoints'];
        if (isset($o['IsMVP'])) $this->IsMVP = $o['IsMVP'];
        if (isset($o['IsRVP'])) $this->IsRVP = $o['IsRVP'];
        if (isset($o['IsAVP'])) $this->IsAVP = $o['IsAVP'];
        if (isset($o['IsAgent'])) $this->IsAgent = $o['IsAgent'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Upline1Name'])) $this->Upline1Name = $o['Upline1Name'];
        if (isset($o['Upline2Name'])) $this->Upline2Name = $o['Upline2Name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Position)) $o['Position'] = $this->Position;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Location)) $o['Location'] = $this->Location;
        if (isset($this->LifeCashFlow)) $o['LifeCashFlow'] = $this->LifeCashFlow;
        if (isset($this->AnnuityCashFlow)) $o['AnnuityCashFlow'] = $this->AnnuityCashFlow;
        if (isset($this->TotalCashFlow)) $o['TotalCashFlow'] = $this->TotalCashFlow;
        if (isset($this->PremiumLife)) $o['PremiumLife'] = $this->PremiumLife;
        if (isset($this->PremiumAnnuity)) $o['PremiumAnnuity'] = $this->PremiumAnnuity;
        if (isset($this->PointsLife)) $o['PointsLife'] = $this->PointsLife;
        if (isset($this->PointsAnnuity)) $o['PointsAnnuity'] = $this->PointsAnnuity;
        if (isset($this->TotalPoints)) $o['TotalPoints'] = $this->TotalPoints;
        if (isset($this->IsMVP)) $o['IsMVP'] = $this->IsMVP;
        if (isset($this->IsRVP)) $o['IsRVP'] = $this->IsRVP;
        if (isset($this->IsAVP)) $o['IsAVP'] = $this->IsAVP;
        if (isset($this->IsAgent)) $o['IsAgent'] = $this->IsAgent;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Upline1Name)) $o['Upline1Name'] = $this->Upline1Name;
        if (isset($this->Upline2Name)) $o['Upline2Name'] = $this->Upline2Name;
        return empty($o) ? new class(){} : $o;
    }
}

class LeaderboardResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<Leaderboard>|null */
        public ?array $AllData=null,
        /** @var array<Leaderboard>|null */
        public ?array $MVP=null,
        /** @var array<Leaderboard>|null */
        public ?array $AVP=null,
        /** @var array<Leaderboard>|null */
        public ?array $RVP=null,
        /** @var array<Leaderboard>|null */
        public ?array $Agents=null
    ) {
    }

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

class LeaderboardRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $StartDate=null,
        /** @var string|null */
        public ?string $EndDate=null,
        /** @var string|null */
        public ?string $LeaderboardType=null
    ) {
    }

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

PHP LeaderboardRequest 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/Leaderboard HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<LeaderboardRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <EndDate>String</EndDate>
  <LeaderboardType>String</LeaderboardType>
  <StartDate>String</StartDate>
</LeaderboardRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<LeaderboardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AVP>
    <Leaderboard>
      <_AnnuityCashFlow>0</_AnnuityCashFlow>
      <_IsAVP>false</_IsAVP>
      <_IsAgent>false</_IsAgent>
      <_IsMVP>false</_IsMVP>
      <_IsRVP>false</_IsRVP>
      <_LifeCashFlow>0</_LifeCashFlow>
      <_Location>String</_Location>
      <_Name>String</_Name>
      <_Phone>String</_Phone>
      <_PointsAnnuity>0</_PointsAnnuity>
      <_PointsLife>0</_PointsLife>
      <_Position>0</_Position>
      <_PremiumAnnuity>0</_PremiumAnnuity>
      <_PremiumLife>0</_PremiumLife>
      <_TotalCashFlow>0</_TotalCashFlow>
      <_TotalPoints>0</_TotalPoints>
      <_Upline1Name>String</_Upline1Name>
      <_Upline2Name>String</_Upline2Name>
    </Leaderboard>
  </AVP>
  <Agents>
    <Leaderboard>
      <_AnnuityCashFlow>0</_AnnuityCashFlow>
      <_IsAVP>false</_IsAVP>
      <_IsAgent>false</_IsAgent>
      <_IsMVP>false</_IsMVP>
      <_IsRVP>false</_IsRVP>
      <_LifeCashFlow>0</_LifeCashFlow>
      <_Location>String</_Location>
      <_Name>String</_Name>
      <_Phone>String</_Phone>
      <_PointsAnnuity>0</_PointsAnnuity>
      <_PointsLife>0</_PointsLife>
      <_Position>0</_Position>
      <_PremiumAnnuity>0</_PremiumAnnuity>
      <_PremiumLife>0</_PremiumLife>
      <_TotalCashFlow>0</_TotalCashFlow>
      <_TotalPoints>0</_TotalPoints>
      <_Upline1Name>String</_Upline1Name>
      <_Upline2Name>String</_Upline2Name>
    </Leaderboard>
  </Agents>
  <AllData>
    <Leaderboard>
      <_AnnuityCashFlow>0</_AnnuityCashFlow>
      <_IsAVP>false</_IsAVP>
      <_IsAgent>false</_IsAgent>
      <_IsMVP>false</_IsMVP>
      <_IsRVP>false</_IsRVP>
      <_LifeCashFlow>0</_LifeCashFlow>
      <_Location>String</_Location>
      <_Name>String</_Name>
      <_Phone>String</_Phone>
      <_PointsAnnuity>0</_PointsAnnuity>
      <_PointsLife>0</_PointsLife>
      <_Position>0</_Position>
      <_PremiumAnnuity>0</_PremiumAnnuity>
      <_PremiumLife>0</_PremiumLife>
      <_TotalCashFlow>0</_TotalCashFlow>
      <_TotalPoints>0</_TotalPoints>
      <_Upline1Name>String</_Upline1Name>
      <_Upline2Name>String</_Upline2Name>
    </Leaderboard>
  </AllData>
  <MVP>
    <Leaderboard>
      <_AnnuityCashFlow>0</_AnnuityCashFlow>
      <_IsAVP>false</_IsAVP>
      <_IsAgent>false</_IsAgent>
      <_IsMVP>false</_IsMVP>
      <_IsRVP>false</_IsRVP>
      <_LifeCashFlow>0</_LifeCashFlow>
      <_Location>String</_Location>
      <_Name>String</_Name>
      <_Phone>String</_Phone>
      <_PointsAnnuity>0</_PointsAnnuity>
      <_PointsLife>0</_PointsLife>
      <_Position>0</_Position>
      <_PremiumAnnuity>0</_PremiumAnnuity>
      <_PremiumLife>0</_PremiumLife>
      <_TotalCashFlow>0</_TotalCashFlow>
      <_TotalPoints>0</_TotalPoints>
      <_Upline1Name>String</_Upline1Name>
      <_Upline2Name>String</_Upline2Name>
    </Leaderboard>
  </MVP>
  <RVP>
    <Leaderboard>
      <_AnnuityCashFlow>0</_AnnuityCashFlow>
      <_IsAVP>false</_IsAVP>
      <_IsAgent>false</_IsAgent>
      <_IsMVP>false</_IsMVP>
      <_IsRVP>false</_IsRVP>
      <_LifeCashFlow>0</_LifeCashFlow>
      <_Location>String</_Location>
      <_Name>String</_Name>
      <_Phone>String</_Phone>
      <_PointsAnnuity>0</_PointsAnnuity>
      <_PointsLife>0</_PointsLife>
      <_Position>0</_Position>
      <_PremiumAnnuity>0</_PremiumAnnuity>
      <_PremiumLife>0</_PremiumLife>
      <_TotalCashFlow>0</_TotalCashFlow>
      <_TotalPoints>0</_TotalPoints>
      <_Upline1Name>String</_Upline1Name>
      <_Upline2Name>String</_Upline2Name>
    </Leaderboard>
  </RVP>
  <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>
</LeaderboardResponse>