GET | /DashboardStats |
---|
<?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};
// @DataContract(Name="Metadata", Namespace="schemas.agentivity.com/types")
class PagingMetadata implements JsonSerializable
{
public function __construct(
/** @description Starting Record */
// @DataMember
// @ApiMember(DataType="string", Description="Starting Record", Name="Offset", ParameterType="query")
/** @var string|null */
public ?string $Offset=null,
/** @description Number of records to return (PageSize) */
// @DataMember
// @ApiMember(DataType="string", Description="Number of records to return (PageSize)", Name="Limit", ParameterType="query")
/** @var string|null */
public ?string $Limit=null,
/** @description Total Number of Records in a Full Reponse (if no paging) */
// @DataMember
// @ApiMember(DataType="string", Description="Total Number of Records in a Full Reponse (if no paging)", Name="TotalRecords", ParameterType="query")
/** @var int */
public int $TotalRecords=0,
/** @description Total Number of Records in this Reponse (on this page) */
// @DataMember
// @ApiMember(DataType="string", Description="Total Number of Records in this Reponse (on this page)", Name="ResponseRecords", ParameterType="query")
/** @var int */
public int $ResponseRecords=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Offset'])) $this->Offset = $o['Offset'];
if (isset($o['Limit'])) $this->Limit = $o['Limit'];
if (isset($o['TotalRecords'])) $this->TotalRecords = $o['TotalRecords'];
if (isset($o['ResponseRecords'])) $this->ResponseRecords = $o['ResponseRecords'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Offset)) $o['Offset'] = $this->Offset;
if (isset($this->Limit)) $o['Limit'] = $this->Limit;
if (isset($this->TotalRecords)) $o['TotalRecords'] = $this->TotalRecords;
if (isset($this->ResponseRecords)) $o['ResponseRecords'] = $this->ResponseRecords;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="ThreeDayCounts", Namespace="schemas.agentivity.com/types")
class ThreeDayCounts implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var int */
public int $DayPlusZeroTtl=0,
// @DataMember(Order=20)
/** @var int */
public int $DayPlusOneTtl=0,
// @DataMember(Order=30)
/** @var int */
public int $DayPlusTwoTtl=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DayPlusZeroTtl'])) $this->DayPlusZeroTtl = $o['DayPlusZeroTtl'];
if (isset($o['DayPlusOneTtl'])) $this->DayPlusOneTtl = $o['DayPlusOneTtl'];
if (isset($o['DayPlusTwoTtl'])) $this->DayPlusTwoTtl = $o['DayPlusTwoTtl'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DayPlusZeroTtl)) $o['DayPlusZeroTtl'] = $this->DayPlusZeroTtl;
if (isset($this->DayPlusOneTtl)) $o['DayPlusOneTtl'] = $this->DayPlusOneTtl;
if (isset($this->DayPlusTwoTtl)) $o['DayPlusTwoTtl'] = $this->DayPlusTwoTtl;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="MonthlyActivityBreakdown", Namespace="schemas.agentivity.com/types")
class MonthlyActivityBreakdown implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var string|null */
public ?string $ReportDate=null,
// @DataMember(Order=20)
/** @var int */
public int $MonthlyEvents=0,
// @DataMember(Order=30)
/** @var int */
public int $C=0,
// @DataMember(Order=40)
/** @var float */
public float $C_Percentage=0.0,
// @DataMember(Order=50)
/** @var int */
public int $I=0,
// @DataMember(Order=60)
/** @var float */
public float $I_Percentage=0.0,
// @DataMember(Order=70)
/** @var int */
public int $T=0,
// @DataMember(Order=80)
/** @var float */
public float $T_Percentage=0.0,
// @DataMember(Order=90)
/** @var int */
public int $X=0,
// @DataMember(Order=100)
/** @var float */
public float $X_Percentage=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ReportDate'])) $this->ReportDate = $o['ReportDate'];
if (isset($o['MonthlyEvents'])) $this->MonthlyEvents = $o['MonthlyEvents'];
if (isset($o['C'])) $this->C = $o['C'];
if (isset($o['C_Percentage'])) $this->C_Percentage = $o['C_Percentage'];
if (isset($o['I'])) $this->I = $o['I'];
if (isset($o['I_Percentage'])) $this->I_Percentage = $o['I_Percentage'];
if (isset($o['T'])) $this->T = $o['T'];
if (isset($o['T_Percentage'])) $this->T_Percentage = $o['T_Percentage'];
if (isset($o['X'])) $this->X = $o['X'];
if (isset($o['X_Percentage'])) $this->X_Percentage = $o['X_Percentage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ReportDate)) $o['ReportDate'] = $this->ReportDate;
if (isset($this->MonthlyEvents)) $o['MonthlyEvents'] = $this->MonthlyEvents;
if (isset($this->C)) $o['C'] = $this->C;
if (isset($this->C_Percentage)) $o['C_Percentage'] = $this->C_Percentage;
if (isset($this->I)) $o['I'] = $this->I;
if (isset($this->I_Percentage)) $o['I_Percentage'] = $this->I_Percentage;
if (isset($this->T)) $o['T'] = $this->T;
if (isset($this->T_Percentage)) $o['T_Percentage'] = $this->T_Percentage;
if (isset($this->X)) $o['X'] = $this->X;
if (isset($this->X_Percentage)) $o['X_Percentage'] = $this->X_Percentage;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="UserActivity", Namespace="schemas.agentivity.com/types")
class UserActivity implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var string|null */
public ?string $UserName=null,
// @DataMember(Order=20)
/** @var string|null */
public ?string $FirstName=null,
// @DataMember(Order=30)
/** @var string|null */
public ?string $LastName=null,
// @DataMember(Order=40)
/** @var int */
public int $UserID=0,
// @DataMember(Order=50)
/** @var string|null */
public ?string $UserFrequency=null,
// @DataMember(Order=60)
/** @var float */
public float $ActivityMeasure=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['UserName'])) $this->UserName = $o['UserName'];
if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
if (isset($o['LastName'])) $this->LastName = $o['LastName'];
if (isset($o['UserID'])) $this->UserID = $o['UserID'];
if (isset($o['UserFrequency'])) $this->UserFrequency = $o['UserFrequency'];
if (isset($o['ActivityMeasure'])) $this->ActivityMeasure = $o['ActivityMeasure'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->UserName)) $o['UserName'] = $this->UserName;
if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
if (isset($this->LastName)) $o['LastName'] = $this->LastName;
if (isset($this->UserID)) $o['UserID'] = $this->UserID;
if (isset($this->UserFrequency)) $o['UserFrequency'] = $this->UserFrequency;
if (isset($this->ActivityMeasure)) $o['ActivityMeasure'] = $this->ActivityMeasure;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="ConsultantPerformance", Namespace="schemas.agentivity.com/types")
class ConsultantPerformance implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var string|null */
public ?string $Name=null,
// @DataMember(Order=20)
/** @var int */
public int $Total=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Total'])) $this->Total = $o['Total'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Total)) $o['Total'] = $this->Total;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="ReportPerformance", Namespace="schemas.agentivity.com/types")
class ReportPerformance implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var string|null */
public ?string $Name=null,
// @DataMember(Order=20)
/** @var string|null */
public ?string $UrlSlug=null,
// @DataMember(Order=30)
/** @var int */
public int $Total=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['UrlSlug'])) $this->UrlSlug = $o['UrlSlug'];
if (isset($o['Total'])) $this->Total = $o['Total'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->UrlSlug)) $o['UrlSlug'] = $this->UrlSlug;
if (isset($this->Total)) $o['Total'] = $this->Total;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="BookingsAirConversion", Namespace="schemas.agentivity.com/types")
class BookingsAirConversion implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var int */
public int $TotalTicketed=0,
// @DataMember(Order=20)
/** @var int */
public int $TotalUnticketed=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['TotalTicketed'])) $this->TotalTicketed = $o['TotalTicketed'];
if (isset($o['TotalUnticketed'])) $this->TotalUnticketed = $o['TotalUnticketed'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->TotalTicketed)) $o['TotalTicketed'] = $this->TotalTicketed;
if (isset($this->TotalUnticketed)) $o['TotalUnticketed'] = $this->TotalUnticketed;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="PassengerContactElements", Namespace="schemas.agentivity.com/types")
class PassengerContactElements implements JsonSerializable
{
public function __construct(
// @DataMember(Order=20)
/** @var int */
public int $DateYear=0,
// @DataMember(Order=20)
/** @var int */
public int $DateMonth=0,
// @DataMember(Order=30)
/** @var float */
public float $WithMobilePercent=0.0,
// @DataMember(Order=40)
/** @var float */
public float $WithEmailPercent=0.0,
// @DataMember(Order=50)
/** @var int */
public int $TotalWithMobile=0,
// @DataMember(Order=60)
/** @var int */
public int $TotalWithEmail=0,
// @DataMember(Order=70)
/** @var int */
public int $TotalCreated=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DateYear'])) $this->DateYear = $o['DateYear'];
if (isset($o['DateMonth'])) $this->DateMonth = $o['DateMonth'];
if (isset($o['WithMobilePercent'])) $this->WithMobilePercent = $o['WithMobilePercent'];
if (isset($o['WithEmailPercent'])) $this->WithEmailPercent = $o['WithEmailPercent'];
if (isset($o['TotalWithMobile'])) $this->TotalWithMobile = $o['TotalWithMobile'];
if (isset($o['TotalWithEmail'])) $this->TotalWithEmail = $o['TotalWithEmail'];
if (isset($o['TotalCreated'])) $this->TotalCreated = $o['TotalCreated'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DateYear)) $o['DateYear'] = $this->DateYear;
if (isset($this->DateMonth)) $o['DateMonth'] = $this->DateMonth;
if (isset($this->WithMobilePercent)) $o['WithMobilePercent'] = $this->WithMobilePercent;
if (isset($this->WithEmailPercent)) $o['WithEmailPercent'] = $this->WithEmailPercent;
if (isset($this->TotalWithMobile)) $o['TotalWithMobile'] = $this->TotalWithMobile;
if (isset($this->TotalWithEmail)) $o['TotalWithEmail'] = $this->TotalWithEmail;
if (isset($this->TotalCreated)) $o['TotalCreated'] = $this->TotalCreated;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="DashboardStats", Namespace="schemas.agentivity.com/types")
class DashboardStats implements JsonSerializable
{
public function __construct(
// @DataMember(Order=10)
/** @var ThreeDayCounts|null */
public ?ThreeDayCounts $ProblematicBookings=null,
// @DataMember(Order=20)
/** @var ThreeDayCounts|null */
public ?ThreeDayCounts $AirlineTicketing=null,
// @DataMember(Order=30)
/** @var ThreeDayCounts|null */
public ?ThreeDayCounts $UnticketedBookingsByTau=null,
// @DataMember(Order=34)
/** @var ThreeDayCounts|null */
public ?ThreeDayCounts $OutstandingBookingActions=null,
// @DataMember(Order=40)
/** @var array<MonthlyActivityBreakdown>|null */
public ?array $MonthlyActivity=null,
// @DataMember(Order=50)
/** @var array<UserActivity>|null */
public ?array $MostActiveUsers=null,
// @DataMember(Order=60)
/** @var array<ConsultantPerformance>|null */
public ?array $TopConsultants=null,
// @DataMember(Order=70)
/** @var array<ReportPerformance>|null */
public ?array $TopReports=null,
// @DataMember(Order=80)
/** @var BookingsAirConversion|null */
public ?BookingsAirConversion $ActiveBookingsAirConversion=null,
// @DataMember(Order=90)
/** @var array<PassengerContactElements>|null */
public ?array $PassengerElements=null,
// @DataMember(Order=90)
/** @var array<ReportPerformance>|null */
public ?array $ReportUsageSummary=null,
// @DataMember(Order=200)
/** @var string|null */
public ?string $MonthlyActivityFormatted=null,
// @DataMember(Order=210)
/** @var string|null */
public ?string $PassengerElementsFormatted=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProblematicBookings'])) $this->ProblematicBookings = JsonConverters::from('ThreeDayCounts', $o['ProblematicBookings']);
if (isset($o['AirlineTicketing'])) $this->AirlineTicketing = JsonConverters::from('ThreeDayCounts', $o['AirlineTicketing']);
if (isset($o['UnticketedBookingsByTau'])) $this->UnticketedBookingsByTau = JsonConverters::from('ThreeDayCounts', $o['UnticketedBookingsByTau']);
if (isset($o['OutstandingBookingActions'])) $this->OutstandingBookingActions = JsonConverters::from('ThreeDayCounts', $o['OutstandingBookingActions']);
if (isset($o['MonthlyActivity'])) $this->MonthlyActivity = JsonConverters::fromArray('MonthlyActivityBreakdown', $o['MonthlyActivity']);
if (isset($o['MostActiveUsers'])) $this->MostActiveUsers = JsonConverters::fromArray('UserActivity', $o['MostActiveUsers']);
if (isset($o['TopConsultants'])) $this->TopConsultants = JsonConverters::fromArray('ConsultantPerformance', $o['TopConsultants']);
if (isset($o['TopReports'])) $this->TopReports = JsonConverters::fromArray('ReportPerformance', $o['TopReports']);
if (isset($o['ActiveBookingsAirConversion'])) $this->ActiveBookingsAirConversion = JsonConverters::from('BookingsAirConversion', $o['ActiveBookingsAirConversion']);
if (isset($o['PassengerElements'])) $this->PassengerElements = JsonConverters::fromArray('PassengerContactElements', $o['PassengerElements']);
if (isset($o['ReportUsageSummary'])) $this->ReportUsageSummary = JsonConverters::fromArray('ReportPerformance', $o['ReportUsageSummary']);
if (isset($o['MonthlyActivityFormatted'])) $this->MonthlyActivityFormatted = $o['MonthlyActivityFormatted'];
if (isset($o['PassengerElementsFormatted'])) $this->PassengerElementsFormatted = $o['PassengerElementsFormatted'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProblematicBookings)) $o['ProblematicBookings'] = JsonConverters::to('ThreeDayCounts', $this->ProblematicBookings);
if (isset($this->AirlineTicketing)) $o['AirlineTicketing'] = JsonConverters::to('ThreeDayCounts', $this->AirlineTicketing);
if (isset($this->UnticketedBookingsByTau)) $o['UnticketedBookingsByTau'] = JsonConverters::to('ThreeDayCounts', $this->UnticketedBookingsByTau);
if (isset($this->OutstandingBookingActions)) $o['OutstandingBookingActions'] = JsonConverters::to('ThreeDayCounts', $this->OutstandingBookingActions);
if (isset($this->MonthlyActivity)) $o['MonthlyActivity'] = JsonConverters::toArray('MonthlyActivityBreakdown', $this->MonthlyActivity);
if (isset($this->MostActiveUsers)) $o['MostActiveUsers'] = JsonConverters::toArray('UserActivity', $this->MostActiveUsers);
if (isset($this->TopConsultants)) $o['TopConsultants'] = JsonConverters::toArray('ConsultantPerformance', $this->TopConsultants);
if (isset($this->TopReports)) $o['TopReports'] = JsonConverters::toArray('ReportPerformance', $this->TopReports);
if (isset($this->ActiveBookingsAirConversion)) $o['ActiveBookingsAirConversion'] = JsonConverters::to('BookingsAirConversion', $this->ActiveBookingsAirConversion);
if (isset($this->PassengerElements)) $o['PassengerElements'] = JsonConverters::toArray('PassengerContactElements', $this->PassengerElements);
if (isset($this->ReportUsageSummary)) $o['ReportUsageSummary'] = JsonConverters::toArray('ReportPerformance', $this->ReportUsageSummary);
if (isset($this->MonthlyActivityFormatted)) $o['MonthlyActivityFormatted'] = $this->MonthlyActivityFormatted;
if (isset($this->PassengerElementsFormatted)) $o['PassengerElementsFormatted'] = $this->PassengerElementsFormatted;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Namespace="schemas.agentivity.com/types")
/**
* @template TItemResponse
* @template TItem
*/
class Report2 implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): Report2 {
$to = new Report2();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
// @DataMember(Order=1, EmitDefaultValue=false)
/** @var TItem|null */
public mixed $Item=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Item'])) $this->Item = JsonConverters::from($this->genericArgs[1], $o['Item']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Item)) $o['Item'] = JsonConverters::to($this->genericArgs[1], $this->Item);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="DashboardStats", Namespace="schemas.agentivity.com/types")
/**
* @template Report2 of DashboardStatsByOptionsItemResponse
* @template Report21 of DashboardStats
*/
class DashboardStatsByOptionsResponseReport extends Report2 implements JsonSerializable
{
/**
* @param TItem|null $Item
*/
public function __construct(
?TItem $Item=null
) {
parent::__construct($Item);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="CacheMetadata", Namespace="schemas.agentivity.com/types")
class CacheMetadata implements JsonSerializable
{
public function __construct(
// @DataMember(Order=1)
/** @var DateTime */
public DateTime $CachedAt=new DateTime(),
// @DataMember(Order=2)
/** @var DateTime */
public DateTime $CacheExpiresAt=new DateTime(),
// @DataMember(Order=0)
/** @var bool|null */
public ?bool $IsFromCache=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CachedAt'])) $this->CachedAt = JsonConverters::from('DateTime', $o['CachedAt']);
if (isset($o['CacheExpiresAt'])) $this->CacheExpiresAt = JsonConverters::from('DateTime', $o['CacheExpiresAt']);
if (isset($o['IsFromCache'])) $this->IsFromCache = $o['IsFromCache'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CachedAt)) $o['CachedAt'] = JsonConverters::to('DateTime', $this->CachedAt);
if (isset($this->CacheExpiresAt)) $o['CacheExpiresAt'] = JsonConverters::to('DateTime', $this->CacheExpiresAt);
if (isset($this->IsFromCache)) $o['IsFromCache'] = $this->IsFromCache;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class ResponseMetadata implements JsonSerializable
{
public function __construct(
// @DataMember(Order=0)
/** @var bool|null */
public ?bool $Success=null,
// @DataMember(Order=1)
/** @var bool|null */
public ?bool $HasCache=null,
// @DataMember(Order=2)
/** @var bool|null */
public ?bool $HasPaging=null,
// @DataMember(Order=3, EmitDefaultValue=false)
/** @var CacheMetadata|null */
public ?CacheMetadata $CacheMetadata=null,
// @DataMember(Order=4, EmitDefaultValue=false)
/** @var PagingMetadata|null */
public ?PagingMetadata $PagingMetadata=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Success'])) $this->Success = $o['Success'];
if (isset($o['HasCache'])) $this->HasCache = $o['HasCache'];
if (isset($o['HasPaging'])) $this->HasPaging = $o['HasPaging'];
if (isset($o['CacheMetadata'])) $this->CacheMetadata = JsonConverters::from('CacheMetadata', $o['CacheMetadata']);
if (isset($o['PagingMetadata'])) $this->PagingMetadata = JsonConverters::from('PagingMetadata', $o['PagingMetadata']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Success)) $o['Success'] = $this->Success;
if (isset($this->HasCache)) $o['HasCache'] = $this->HasCache;
if (isset($this->HasPaging)) $o['HasPaging'] = $this->HasPaging;
if (isset($this->CacheMetadata)) $o['CacheMetadata'] = JsonConverters::to('CacheMetadata', $this->CacheMetadata);
if (isset($this->PagingMetadata)) $o['PagingMetadata'] = JsonConverters::to('PagingMetadata', $this->PagingMetadata);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="ResponseMetadata", Namespace="schemas.agentivity.com/types")
class AgentivityError implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $ErrorCode=null,
// @DataMember
/** @var string|null */
public ?string $Message=null,
// @DataMember
/** @var string|null */
public ?string $StatusCode=null,
// @DataMember
/** @var string|null */
public ?string $VerboseMessage=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
if (isset($o['VerboseMessage'])) $this->VerboseMessage = $o['VerboseMessage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
if (isset($this->VerboseMessage)) $o['VerboseMessage'] = $this->VerboseMessage;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
/**
* @template TItem
* @template TReport
*/
class ItemResponse2 implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): ItemResponse2 {
$to = new ItemResponse2();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
// @DataMember(Order=1)
/** @var ResponseMetadata|null */
public mixed $ResponseMetadata=null,
// @DataMember(Order=2, EmitDefaultValue=false)
/** @var TReport|null */
public mixed $ResponseReport=null,
// @DataMember(Order=3, EmitDefaultValue=false)
/** @var AgentivityError|null */
public mixed $ResponseError=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseMetadata'])) $this->ResponseMetadata = JsonConverters::from('ResponseMetadata', $o['ResponseMetadata']);
if (isset($o['ResponseReport'])) $this->ResponseReport = JsonConverters::from($this->genericArgs[1], $o['ResponseReport']);
if (isset($o['ResponseError'])) $this->ResponseError = JsonConverters::from('AgentivityError', $o['ResponseError']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseMetadata)) $o['ResponseMetadata'] = JsonConverters::to('ResponseMetadata', $this->ResponseMetadata);
if (isset($this->ResponseReport)) $o['ResponseReport'] = JsonConverters::to($this->genericArgs[1], $this->ResponseReport);
if (isset($this->ResponseError)) $o['ResponseError'] = JsonConverters::to('AgentivityError', $this->ResponseError);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract(Name="AgentivityResponse", Namespace="schemas.agentivity.com/types")
/**
* @template ItemResponse2 of DashboardStats
* @template ItemResponse21 of DashboardStatsByOptionsResponseReport
*/
class DashboardStatsByOptionsItemResponse extends ItemResponse2 implements JsonSerializable
{
/**
* @param ResponseMetadata|null $ResponseMetadata
* @param TReport|null $ResponseReport
* @param AgentivityError|null $ResponseError
*/
public function __construct(
?ResponseMetadata $ResponseMetadata=null,
?TReport $ResponseReport=null,
?AgentivityError $ResponseError=null
) {
parent::__construct($ResponseMetadata,$ResponseReport,$ResponseError);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
// @Flags()
enum DashboardOptions : int
{
case ProblematicBookingsCount = 1;
case AirlineTicketingCount = 2;
case UnticketedBookingsByTauCount = 4;
case MonthlyActivity = 8;
case ActiveBookingsAirConversion = 16;
case PassengerContacts = 32;
case TopConsultants = 64;
case MostActiveUsers = 128;
case TopReports = 256;
case ReportUsageSummary = 512;
case OutstandingBookingActionsCount = 1024;
}
// @DataContract(Namespace="schemas.agentivity.com/types")
class DashboardStatsByOptions extends PagingMetadata implements JsonSerializable
{
/**
* @param string|null $Offset
* @param string|null $Limit
* @param int $TotalRecords
* @param int $ResponseRecords
*/
public function __construct(
?string $Offset=null,
?string $Limit=null,
int $TotalRecords=0,
int $ResponseRecords=0,
/** @description UserName in form of an email address */
// @DataMember
/** @var string */
public string $UserName='',
/** @description Top reports */
// @DataMember
/** @var int|null */
public ?int $ReportsTop=null,
/** @description Reports in days span */
// @DataMember
/** @var int|null */
public ?int $ReportsDaysSpan=null,
/** @description Top most active users */
// @DataMember
/** @var int|null */
public ?int $MostActiveUsersTop=null,
/** @description Most active users in days span */
// @DataMember
/** @var int|null */
public ?int $MostActiveUsersDaysSpan=null,
/** @description Top consultants last days span */
// @DataMember
/** @var int|null */
public ?int $TopConsultantsLastDaysSpan=null,
/** @description Options */
// @DataMember
/** @var DashboardOptions|null */
public ?DashboardOptions $Options=null
) {
parent::__construct($Offset,$Limit,$TotalRecords,$ResponseRecords);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['UserName'])) $this->UserName = $o['UserName'];
if (isset($o['ReportsTop'])) $this->ReportsTop = $o['ReportsTop'];
if (isset($o['ReportsDaysSpan'])) $this->ReportsDaysSpan = $o['ReportsDaysSpan'];
if (isset($o['MostActiveUsersTop'])) $this->MostActiveUsersTop = $o['MostActiveUsersTop'];
if (isset($o['MostActiveUsersDaysSpan'])) $this->MostActiveUsersDaysSpan = $o['MostActiveUsersDaysSpan'];
if (isset($o['TopConsultantsLastDaysSpan'])) $this->TopConsultantsLastDaysSpan = $o['TopConsultantsLastDaysSpan'];
if (isset($o['Options'])) $this->Options = JsonConverters::from('DashboardOptions', $o['Options']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->UserName)) $o['UserName'] = $this->UserName;
if (isset($this->ReportsTop)) $o['ReportsTop'] = $this->ReportsTop;
if (isset($this->ReportsDaysSpan)) $o['ReportsDaysSpan'] = $this->ReportsDaysSpan;
if (isset($this->MostActiveUsersTop)) $o['MostActiveUsersTop'] = $this->MostActiveUsersTop;
if (isset($this->MostActiveUsersDaysSpan)) $o['MostActiveUsersDaysSpan'] = $this->MostActiveUsersDaysSpan;
if (isset($this->TopConsultantsLastDaysSpan)) $o['TopConsultantsLastDaysSpan'] = $this->TopConsultantsLastDaysSpan;
if (isset($this->Options)) $o['Options'] = JsonConverters::to('DashboardOptions', $this->Options);
return empty($o) ? new class(){} : $o;
}
}
PHP DashboardStatsByOptions DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /DashboardStats HTTP/1.1 Host: api.agentivity.com Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"ResponseMetadata":{"Success":false,"HasCache":false,"HasPaging":false,"CacheMetadata":{"IsFromCache":false,"CachedAt":"\/Date(-62135596800000-0000)\/","CacheExpiresAt":"\/Date(-62135596800000-0000)\/"},"PagingMetadata":{"Offset":"String","Limit":"String","TotalRecords":0,"ResponseRecords":0}},"ResponseReport":{"Item":{"ProblematicBookings":{"DayPlusZeroTtl":0,"DayPlusOneTtl":0,"DayPlusTwoTtl":0},"AirlineTicketing":{"DayPlusZeroTtl":0,"DayPlusOneTtl":0,"DayPlusTwoTtl":0},"UnticketedBookingsByTau":{"DayPlusZeroTtl":0,"DayPlusOneTtl":0,"DayPlusTwoTtl":0},"OutstandingBookingActions":{"DayPlusZeroTtl":0,"DayPlusOneTtl":0,"DayPlusTwoTtl":0},"MonthlyActivity":[{"ReportDate":"String","MonthlyEvents":0,"C":0,"C_Percentage":0,"I":0,"I_Percentage":0,"T":0,"T_Percentage":0,"X":0,"X_Percentage":0}],"MostActiveUsers":[{"UserName":"String","FirstName":"String","LastName":"String","UserID":0,"UserFrequency":"String","ActivityMeasure":0}],"TopConsultants":[{"Name":"String","Total":0}],"TopReports":[{"Name":"String","UrlSlug":"String","Total":0}],"ActiveBookingsAirConversion":{"TotalTicketed":0,"TotalUnticketed":0},"PassengerElements":[{"DateYear":0,"DateMonth":0,"WithMobilePercent":0,"WithEmailPercent":0,"TotalWithMobile":0,"TotalWithEmail":0,"TotalCreated":0}],"ReportUsageSummary":[{"Name":"String","UrlSlug":"String","Total":0}],"MonthlyActivityFormatted":"String","PassengerElementsFormatted":"String"}},"ResponseError":{"ErrorCode":"String","Message":"String","StatusCode":"String","VerboseMessage":"String"}}