GET | /portal/call-history |
---|
<?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};
enum SortOrders : string
{
case Ascend = 'Ascend';
case Descend = 'Descend';
}
/**
* @template T
*/
class ListRequest implements IGet, JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): ListRequest {
$to = new ListRequest();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
/** @description The page of data to retrieve */
// @ApiMember(Description="The page of data to retrieve")
/** @var int */
public mixed $page=0,
/** @description If you want all objects to be returned. This should be used with care */
// @ApiMember(Description="If you want all objects to be returned. This should be used with care")
/** @var bool|null */
public mixed $all=null,
/** @description The number per page to retrieve */
// @ApiMember(Description="The number per page to retrieve")
/** @var int */
public mixed $countPerPage=0,
/** @description Specific IDs */
// @ApiMember(Description="Specific IDs")
/** @var array<string>|null */
public mixed $specificIds=null,
/** @description Specify a sort field */
// @ApiMember(Description="Specify a sort field")
/** @var string|null */
public mixed $sortField=null,
/** @description Specify a sort order */
// @ApiMember(Description="Specify a sort order")
/** @var SortOrders|null */
public mixed $sortOrder=null,
/** @description Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array */
// @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array")
/** @var bool|null */
public mixed $simplifiedPaging=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['all'])) $this->all = $o['all'];
if (isset($o['countPerPage'])) $this->countPerPage = $o['countPerPage'];
if (isset($o['specificIds'])) $this->specificIds = JsonConverters::fromArray('string', $o['specificIds']);
if (isset($o['sortField'])) $this->sortField = $o['sortField'];
if (isset($o['sortOrder'])) $this->sortOrder = JsonConverters::from('SortOrders', $o['sortOrder']);
if (isset($o['simplifiedPaging'])) $this->simplifiedPaging = $o['simplifiedPaging'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->all)) $o['all'] = $this->all;
if (isset($this->countPerPage)) $o['countPerPage'] = $this->countPerPage;
if (isset($this->specificIds)) $o['specificIds'] = JsonConverters::toArray('string', $this->specificIds);
if (isset($this->sortField)) $o['sortField'] = $this->sortField;
if (isset($this->sortOrder)) $o['sortOrder'] = JsonConverters::to('SortOrders', $this->sortOrder);
if (isset($this->simplifiedPaging)) $o['simplifiedPaging'] = $this->simplifiedPaging;
return empty($o) ? new class(){} : $o;
}
}
class EntityInfo implements JsonSerializable
{
public function __construct(
/** @description The ID of the object */
// @ApiMember(Description="The ID of the object")
/** @var string|null */
public ?string $id=null,
/** @description The date the object was created */
// @ApiMember(Description="The date the object was created")
/** @var string|null */
public ?string $dateCreated=null,
/** @description The date the object was last modified */
// @ApiMember(Description="The date the object was last modified")
/** @var string|null */
public ?string $dateLastModified=null,
/** @description The user that created this object */
// @ApiMember(Description="The user that created this object")
/** @var string|null */
public ?string $createdBy=null,
/** @description The user that last modified this object */
// @ApiMember(Description="The user that last modified this object")
/** @var string|null */
public ?string $lastModifiedBy=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
if (isset($o['dateLastModified'])) $this->dateLastModified = $o['dateLastModified'];
if (isset($o['createdBy'])) $this->createdBy = $o['createdBy'];
if (isset($o['lastModifiedBy'])) $this->lastModifiedBy = $o['lastModifiedBy'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
if (isset($this->dateLastModified)) $o['dateLastModified'] = $this->dateLastModified;
if (isset($this->createdBy)) $o['createdBy'] = $this->createdBy;
if (isset($this->lastModifiedBy)) $o['lastModifiedBy'] = $this->lastModifiedBy;
return empty($o) ? new class(){} : $o;
}
}
enum SessionDialState : string
{
case None = 'None';
case Active = 'Active';
}
enum SessionCallState : string
{
case Disconnected = 'Disconnected';
case Ringing = 'Ringing';
case Connected = 'Connected';
case Hold = 'Hold';
case Passive = 'Passive';
}
enum SessionQueueStates : string
{
case None = 'None';
case Queued = 'Queued';
case Ringing = 'Ringing';
case Connected = 'Connected';
case Hold = 'Hold';
case Disconnected = 'Disconnected';
}
class CustomerBreadcrumb implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
enum FlowChannels : string
{
case Voice = 'Voice';
case Chat = 'Chat';
case Fax = 'Fax';
}
enum SessionHoldReasons : string
{
case None = 'None';
case Transferring = 'Transferring';
}
class SessionLogInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $date=null,
/** @var string|null */
public ?string $message=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['date'])) $this->date = $o['date'];
if (isset($o['message'])) $this->message = $o['message'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->date)) $o['date'] = $this->date;
if (isset($this->message)) $o['message'] = $this->message;
return empty($o) ? new class(){} : $o;
}
}
enum SessionMemberCallState : string
{
case None = 'None';
case Ringing = 'Ringing';
case Connected = 'Connected';
case Hold = 'Hold';
}
enum SessionMemberRoles : string
{
case None = 'None';
case Caller = 'Caller';
case Agent = 'Agent';
case Transfer = 'Transfer';
}
class SessionMemberInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $identity=null,
/** @var string|null */
public ?string $endpointId=null,
/** @var string|null */
public ?string $displayName=null,
/** @var bool|null */
public ?bool $isOriginalMember=null,
/** @var string|null */
public ?string $avatarUrl=null,
/** @var array<string,string>|null */
public ?array $applicationData=null,
/** @var SessionMemberCallState|null */
public ?SessionMemberCallState $callState=null,
/** @var SessionMemberRoles|null */
public ?SessionMemberRoles $role=null,
/** @var string|null */
public ?string $callSid=null,
/** @var bool|null */
public ?bool $muted=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['identity'])) $this->identity = $o['identity'];
if (isset($o['endpointId'])) $this->endpointId = $o['endpointId'];
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
if (isset($o['isOriginalMember'])) $this->isOriginalMember = $o['isOriginalMember'];
if (isset($o['avatarUrl'])) $this->avatarUrl = $o['avatarUrl'];
if (isset($o['applicationData'])) $this->applicationData = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['applicationData']);
if (isset($o['callState'])) $this->callState = JsonConverters::from('SessionMemberCallState', $o['callState']);
if (isset($o['role'])) $this->role = JsonConverters::from('SessionMemberRoles', $o['role']);
if (isset($o['callSid'])) $this->callSid = $o['callSid'];
if (isset($o['muted'])) $this->muted = $o['muted'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->identity)) $o['identity'] = $this->identity;
if (isset($this->endpointId)) $o['endpointId'] = $this->endpointId;
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
if (isset($this->isOriginalMember)) $o['isOriginalMember'] = $this->isOriginalMember;
if (isset($this->avatarUrl)) $o['avatarUrl'] = $this->avatarUrl;
if (isset($this->applicationData)) $o['applicationData'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->applicationData);
if (isset($this->callState)) $o['callState'] = JsonConverters::to('SessionMemberCallState', $this->callState);
if (isset($this->role)) $o['role'] = JsonConverters::to('SessionMemberRoles', $this->role);
if (isset($this->callSid)) $o['callSid'] = $this->callSid;
if (isset($this->muted)) $o['muted'] = $this->muted;
return empty($o) ? new class(){} : $o;
}
}
enum SessionDirections : string
{
case Incoming = 'Incoming';
case Outgoing = 'Outgoing';
}
class SessionInfo extends EntityInfo implements JsonSerializable
{
/**
* @param string|null $id
* @param string|null $dateCreated
* @param string|null $dateLastModified
* @param string|null $createdBy
* @param string|null $lastModifiedBy
*/
public function __construct(
?string $id=null,
?string $dateCreated=null,
?string $dateLastModified=null,
?string $createdBy=null,
?string $lastModifiedBy=null,
/** @description The state of the session */
// @ApiMember(Description="The state of the session")
/** @var SessionDialState|null */
public ?SessionDialState $dialState=null,
/** @description The call state of the session */
// @ApiMember(Description="The call state of the session")
/** @var SessionCallState|null */
public ?SessionCallState $callState=null,
/** @description The queue state of the session */
// @ApiMember(Description="The queue state of the session")
/** @var SessionQueueStates|null */
public ?SessionQueueStates $queueState=null,
/** @description The ID of the account associated with the flow */
// @ApiMember(Description="The ID of the account associated with the flow")
/** @var string|null */
public ?string $accountId=null,
/** @description The name of the account associated with the session */
// @ApiMember(Description="The name of the account associated with the session")
/** @var string|null */
public ?string $accountName=null,
/** @description The ID of the customer this session is associated with */
// @ApiMember(Description="The ID of the customer this session is associated with")
/** @var string|null */
public ?string $customerId=null,
/** @description The customer breadcrumb this session is associated with */
// @ApiMember(Description="The customer breadcrumb this session is associated with")
/** @var array<CustomerBreadcrumb>|null */
public ?array $customerBreadcrumb=null,
/** @description The name of the customer this session is associated with */
// @ApiMember(Description="The name of the customer this session is associated with")
/** @var string|null */
public ?string $customerName=null,
/** @description The ID of the endpoint associated with this session */
// @ApiMember(Description="The ID of the endpoint associated with this session")
/** @var string|null */
public ?string $endpointId=null,
/** @description The name of the endpoint associated with this session */
// @ApiMember(Description="The name of the endpoint associated with this session")
/** @var string|null */
public ?string $endpointName=null,
/** @description The date the call completed */
// @ApiMember(Description="The date the call completed")
/** @var string|null */
public ?string $dateCompleted=null,
/** @description The destination of the session (e.g. what was entered into the Dial box) */
// @ApiMember(Description="The destination of the session (e.g. what was entered into the Dial box)")
/** @var string|null */
public ?string $destination=null,
/** @description The to address if any */
// @ApiMember(Description="The to address if any")
/** @var string|null */
public ?string $toAddress=null,
/** @description The from address if any */
// @ApiMember(Description="The from address if any")
/** @var string|null */
public ?string $fromAddress=null,
/** @description The from name if any */
// @ApiMember(Description="The from name if any")
/** @var string|null */
public ?string $fromName=null,
/** @description Answered by name (if any) */
// @ApiMember(Description="Answered by name (if any)")
/** @var string|null */
public ?string $answeredByName=null,
/** @description The ID of the queue member assigned to this call */
// @ApiMember(Description="The ID of the queue member assigned to this call")
/** @var string|null */
public ?string $queueMemberId=null,
/** @description The flow channel */
// @ApiMember(Description="The flow channel")
/** @var FlowChannels|null */
public ?FlowChannels $channel=null,
/** @description Has the session ended */
// @ApiMember(Description="Has the session ended")
/** @var bool|null */
public ?bool $ended=null,
/** @description The outcome of the call */
// @ApiMember(Description="The outcome of the call")
/** @var string|null */
public ?string $outcome=null,
/** @description The twilio Call SID of this session */
// @ApiMember(Description="The twilio Call SID of this session")
/** @var string|null */
public ?string $callSid=null,
/** @description Any console data for this session */
// @ApiMember(Description="Any console data for this session")
/** @var string|null */
public ?string $consoleData=null,
/** @description The name of the hold queue for this call */
// @ApiMember(Description="The name of the hold queue for this call")
/** @var string|null */
public ?string $holdQueueName=null,
/** @description The user ID who put this call on hold */
// @ApiMember(Description="The user ID who put this call on hold")
/** @var string|null */
public ?string $heldByUserId=null,
/** @description The reason for the hold */
// @ApiMember(Description="The reason for the hold")
/** @var SessionHoldReasons|null */
public ?SessionHoldReasons $holdReason=null,
/** @description The SID of the conference if in a conference call */
// @ApiMember(Description="The SID of the conference if in a conference call")
/** @var string|null */
public ?string $conferenceSid=null,
/** @description The display name for this session */
// @ApiMember(Description="The display name for this session")
/** @var string|null */
public ?string $displayName=null,
/** @description The log entries for this session */
// @ApiMember(Description="The log entries for this session")
/** @var array<SessionLogInfo>|null */
public ?array $log=null,
/** @description The members of this session */
// @ApiMember(Description="The members of this session")
/** @var array<SessionMemberInfo>|null */
public ?array $members=null,
/** @description The callback number (typically used for SIP to User calls) */
// @ApiMember(Description="The callback number (typically used for SIP to User calls)")
/** @var string|null */
public ?string $callbackNumber=null,
/** @description The ID of the endpoint that answered */
// @ApiMember(Description="The ID of the endpoint that answered")
/** @var string|null */
public ?string $answeredById=null,
/** @description Is this session incoming or outgoing? */
// @ApiMember(Description="Is this session incoming or outgoing?")
/** @var SessionDirections|null */
public ?SessionDirections $direction=null,
/** @description The phone number that this session is coming from (used with SMS chats) */
// @ApiMember(Description="The phone number that this session is coming from (used with SMS chats)")
/** @var string|null */
public ?string $fromPhoneNumber=null,
/** @description The Call SID of the most recently added conference participant */
// @ApiMember(Description="The Call SID of the most recently added conference participant")
/** @var string|null */
public ?string $mostRecentParticipantCallSid=null,
/** @description Was this session missed? */
// @ApiMember(Description="Was this session missed?")
/** @var bool|null */
public ?bool $wasMissed=null,
/** @description The ring queue that the call is currently in */
// @ApiMember(Description="The ring queue that the call is currently in")
/** @var string|null */
public ?string $ringQueueId=null
) {
parent::__construct($id,$dateCreated,$dateLastModified,$createdBy,$lastModifiedBy);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['dialState'])) $this->dialState = JsonConverters::from('SessionDialState', $o['dialState']);
if (isset($o['callState'])) $this->callState = JsonConverters::from('SessionCallState', $o['callState']);
if (isset($o['queueState'])) $this->queueState = JsonConverters::from('SessionQueueStates', $o['queueState']);
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
if (isset($o['accountName'])) $this->accountName = $o['accountName'];
if (isset($o['customerId'])) $this->customerId = $o['customerId'];
if (isset($o['customerBreadcrumb'])) $this->customerBreadcrumb = JsonConverters::fromArray('CustomerBreadcrumb', $o['customerBreadcrumb']);
if (isset($o['customerName'])) $this->customerName = $o['customerName'];
if (isset($o['endpointId'])) $this->endpointId = $o['endpointId'];
if (isset($o['endpointName'])) $this->endpointName = $o['endpointName'];
if (isset($o['dateCompleted'])) $this->dateCompleted = $o['dateCompleted'];
if (isset($o['destination'])) $this->destination = $o['destination'];
if (isset($o['toAddress'])) $this->toAddress = $o['toAddress'];
if (isset($o['fromAddress'])) $this->fromAddress = $o['fromAddress'];
if (isset($o['fromName'])) $this->fromName = $o['fromName'];
if (isset($o['answeredByName'])) $this->answeredByName = $o['answeredByName'];
if (isset($o['queueMemberId'])) $this->queueMemberId = $o['queueMemberId'];
if (isset($o['channel'])) $this->channel = JsonConverters::from('FlowChannels', $o['channel']);
if (isset($o['ended'])) $this->ended = $o['ended'];
if (isset($o['outcome'])) $this->outcome = $o['outcome'];
if (isset($o['callSid'])) $this->callSid = $o['callSid'];
if (isset($o['consoleData'])) $this->consoleData = $o['consoleData'];
if (isset($o['holdQueueName'])) $this->holdQueueName = $o['holdQueueName'];
if (isset($o['heldByUserId'])) $this->heldByUserId = $o['heldByUserId'];
if (isset($o['holdReason'])) $this->holdReason = JsonConverters::from('SessionHoldReasons', $o['holdReason']);
if (isset($o['conferenceSid'])) $this->conferenceSid = $o['conferenceSid'];
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
if (isset($o['log'])) $this->log = JsonConverters::fromArray('SessionLogInfo', $o['log']);
if (isset($o['members'])) $this->members = JsonConverters::fromArray('SessionMemberInfo', $o['members']);
if (isset($o['callbackNumber'])) $this->callbackNumber = $o['callbackNumber'];
if (isset($o['answeredById'])) $this->answeredById = $o['answeredById'];
if (isset($o['direction'])) $this->direction = JsonConverters::from('SessionDirections', $o['direction']);
if (isset($o['fromPhoneNumber'])) $this->fromPhoneNumber = $o['fromPhoneNumber'];
if (isset($o['mostRecentParticipantCallSid'])) $this->mostRecentParticipantCallSid = $o['mostRecentParticipantCallSid'];
if (isset($o['wasMissed'])) $this->wasMissed = $o['wasMissed'];
if (isset($o['ringQueueId'])) $this->ringQueueId = $o['ringQueueId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->dialState)) $o['dialState'] = JsonConverters::to('SessionDialState', $this->dialState);
if (isset($this->callState)) $o['callState'] = JsonConverters::to('SessionCallState', $this->callState);
if (isset($this->queueState)) $o['queueState'] = JsonConverters::to('SessionQueueStates', $this->queueState);
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
if (isset($this->accountName)) $o['accountName'] = $this->accountName;
if (isset($this->customerId)) $o['customerId'] = $this->customerId;
if (isset($this->customerBreadcrumb)) $o['customerBreadcrumb'] = JsonConverters::toArray('CustomerBreadcrumb', $this->customerBreadcrumb);
if (isset($this->customerName)) $o['customerName'] = $this->customerName;
if (isset($this->endpointId)) $o['endpointId'] = $this->endpointId;
if (isset($this->endpointName)) $o['endpointName'] = $this->endpointName;
if (isset($this->dateCompleted)) $o['dateCompleted'] = $this->dateCompleted;
if (isset($this->destination)) $o['destination'] = $this->destination;
if (isset($this->toAddress)) $o['toAddress'] = $this->toAddress;
if (isset($this->fromAddress)) $o['fromAddress'] = $this->fromAddress;
if (isset($this->fromName)) $o['fromName'] = $this->fromName;
if (isset($this->answeredByName)) $o['answeredByName'] = $this->answeredByName;
if (isset($this->queueMemberId)) $o['queueMemberId'] = $this->queueMemberId;
if (isset($this->channel)) $o['channel'] = JsonConverters::to('FlowChannels', $this->channel);
if (isset($this->ended)) $o['ended'] = $this->ended;
if (isset($this->outcome)) $o['outcome'] = $this->outcome;
if (isset($this->callSid)) $o['callSid'] = $this->callSid;
if (isset($this->consoleData)) $o['consoleData'] = $this->consoleData;
if (isset($this->holdQueueName)) $o['holdQueueName'] = $this->holdQueueName;
if (isset($this->heldByUserId)) $o['heldByUserId'] = $this->heldByUserId;
if (isset($this->holdReason)) $o['holdReason'] = JsonConverters::to('SessionHoldReasons', $this->holdReason);
if (isset($this->conferenceSid)) $o['conferenceSid'] = $this->conferenceSid;
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
if (isset($this->log)) $o['log'] = JsonConverters::toArray('SessionLogInfo', $this->log);
if (isset($this->members)) $o['members'] = JsonConverters::toArray('SessionMemberInfo', $this->members);
if (isset($this->callbackNumber)) $o['callbackNumber'] = $this->callbackNumber;
if (isset($this->answeredById)) $o['answeredById'] = $this->answeredById;
if (isset($this->direction)) $o['direction'] = JsonConverters::to('SessionDirections', $this->direction);
if (isset($this->fromPhoneNumber)) $o['fromPhoneNumber'] = $this->fromPhoneNumber;
if (isset($this->mostRecentParticipantCallSid)) $o['mostRecentParticipantCallSid'] = $this->mostRecentParticipantCallSid;
if (isset($this->wasMissed)) $o['wasMissed'] = $this->wasMissed;
if (isset($this->ringQueueId)) $o['ringQueueId'] = $this->ringQueueId;
return empty($o) ? new class(){} : $o;
}
}
/**
* @template ListRequest of SessionInfo
*/
class AppGetCallHistory extends ListRequest implements JsonSerializable
{
/**
* @param int $page
* @param bool|null $all
* @param int $countPerPage
* @param array<string>|null $specificIds
* @param string|null $sortField
* @param SortOrders|null $sortOrder
* @param bool|null $simplifiedPaging
*/
public function __construct(
int $page=0,
?bool $all=null,
int $countPerPage=0,
?array $specificIds=null,
?string $sortField=null,
?SortOrders $sortOrder=null,
?bool $simplifiedPaging=null,
/** @var string|null */
public ?string $accountId=null,
/** @var string|null */
public ?string $customerId=null
) {
parent::__construct($page,$all,$countPerPage,$specificIds,$sortField,$sortOrder,$simplifiedPaging);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
if (isset($o['customerId'])) $this->customerId = $o['customerId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
if (isset($this->customerId)) $o['customerId'] = $this->customerId;
return empty($o) ? new class(){} : $o;
}
}
class BillingItem implements JsonSerializable
{
public function __construct(
/** @var float */
public float $baseCost=0.0,
/** @var float */
public float $rawUnitMultiplier=0.0,
/** @var float */
public float $unitCost=0.0,
/** @var int */
public int $allowance=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['baseCost'])) $this->baseCost = $o['baseCost'];
if (isset($o['rawUnitMultiplier'])) $this->rawUnitMultiplier = $o['rawUnitMultiplier'];
if (isset($o['unitCost'])) $this->unitCost = $o['unitCost'];
if (isset($o['allowance'])) $this->allowance = $o['allowance'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->baseCost)) $o['baseCost'] = $this->baseCost;
if (isset($this->rawUnitMultiplier)) $o['rawUnitMultiplier'] = $this->rawUnitMultiplier;
if (isset($this->unitCost)) $o['unitCost'] = $this->unitCost;
if (isset($this->allowance)) $o['allowance'] = $this->allowance;
return empty($o) ? new class(){} : $o;
}
}
class BillingSettings implements JsonSerializable
{
public function __construct(
/** @var BillingItem|null */
public ?BillingItem $base=null,
/** @var BillingItem|null */
public ?BillingItem $localNumbers=null,
/** @var BillingItem|null */
public ?BillingItem $tollFreeNumbers=null,
/** @var BillingItem|null */
public ?BillingItem $inboundVoiceCalls=null,
/** @var BillingItem|null */
public ?BillingItem $outboundVoiceCalls=null,
/** @var BillingItem|null */
public ?BillingItem $inboundFaxes=null,
/** @var BillingItem|null */
public ?BillingItem $outboundFaxes=null,
/** @var BillingItem|null */
public ?BillingItem $inboundSmsMessages=null,
/** @var BillingItem|null */
public ?BillingItem $outboundSmsMessages=null,
/** @var BillingItem|null */
public ?BillingItem $aiInsights=null,
/** @var BillingItem|null */
public ?BillingItem $aiLiveMinutes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['base'])) $this->base = JsonConverters::from('BillingItem', $o['base']);
if (isset($o['localNumbers'])) $this->localNumbers = JsonConverters::from('BillingItem', $o['localNumbers']);
if (isset($o['tollFreeNumbers'])) $this->tollFreeNumbers = JsonConverters::from('BillingItem', $o['tollFreeNumbers']);
if (isset($o['inboundVoiceCalls'])) $this->inboundVoiceCalls = JsonConverters::from('BillingItem', $o['inboundVoiceCalls']);
if (isset($o['outboundVoiceCalls'])) $this->outboundVoiceCalls = JsonConverters::from('BillingItem', $o['outboundVoiceCalls']);
if (isset($o['inboundFaxes'])) $this->inboundFaxes = JsonConverters::from('BillingItem', $o['inboundFaxes']);
if (isset($o['outboundFaxes'])) $this->outboundFaxes = JsonConverters::from('BillingItem', $o['outboundFaxes']);
if (isset($o['inboundSmsMessages'])) $this->inboundSmsMessages = JsonConverters::from('BillingItem', $o['inboundSmsMessages']);
if (isset($o['outboundSmsMessages'])) $this->outboundSmsMessages = JsonConverters::from('BillingItem', $o['outboundSmsMessages']);
if (isset($o['aiInsights'])) $this->aiInsights = JsonConverters::from('BillingItem', $o['aiInsights']);
if (isset($o['aiLiveMinutes'])) $this->aiLiveMinutes = JsonConverters::from('BillingItem', $o['aiLiveMinutes']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->base)) $o['base'] = JsonConverters::to('BillingItem', $this->base);
if (isset($this->localNumbers)) $o['localNumbers'] = JsonConverters::to('BillingItem', $this->localNumbers);
if (isset($this->tollFreeNumbers)) $o['tollFreeNumbers'] = JsonConverters::to('BillingItem', $this->tollFreeNumbers);
if (isset($this->inboundVoiceCalls)) $o['inboundVoiceCalls'] = JsonConverters::to('BillingItem', $this->inboundVoiceCalls);
if (isset($this->outboundVoiceCalls)) $o['outboundVoiceCalls'] = JsonConverters::to('BillingItem', $this->outboundVoiceCalls);
if (isset($this->inboundFaxes)) $o['inboundFaxes'] = JsonConverters::to('BillingItem', $this->inboundFaxes);
if (isset($this->outboundFaxes)) $o['outboundFaxes'] = JsonConverters::to('BillingItem', $this->outboundFaxes);
if (isset($this->inboundSmsMessages)) $o['inboundSmsMessages'] = JsonConverters::to('BillingItem', $this->inboundSmsMessages);
if (isset($this->outboundSmsMessages)) $o['outboundSmsMessages'] = JsonConverters::to('BillingItem', $this->outboundSmsMessages);
if (isset($this->aiInsights)) $o['aiInsights'] = JsonConverters::to('BillingItem', $this->aiInsights);
if (isset($this->aiLiveMinutes)) $o['aiLiveMinutes'] = JsonConverters::to('BillingItem', $this->aiLiveMinutes);
return empty($o) ? new class(){} : $o;
}
}
class AccountInfo extends EntityInfo implements JsonSerializable
{
/**
* @param string|null $id
* @param string|null $dateCreated
* @param string|null $dateLastModified
* @param string|null $createdBy
* @param string|null $lastModifiedBy
*/
public function __construct(
?string $id=null,
?string $dateCreated=null,
?string $dateLastModified=null,
?string $createdBy=null,
?string $lastModifiedBy=null,
/** @description The name of this account */
// @ApiMember(Description="The name of this account")
/** @var string|null */
public ?string $name=null,
/** @description The ID of this account's parent */
// @ApiMember(Description="The ID of this account's parent")
/** @var string|null */
public ?string $parentAccountId=null,
/** @description The twilio account SID */
// @ApiMember(Description="The twilio account SID")
/** @var string|null */
public ?string $twilioAccountSid=null,
/** @description The ancestors of this account. Useful for breadcrumbs */
// @ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")
/** @var array<string>|null */
public ?array $ancestorIds=null,
/** @description The max number of phone numbers this account can have */
// @ApiMember(Description="The max number of phone numbers this account can have")
/** @var int */
public int $maxPhoneNumbers=0,
/** @description This account is BYOA */
// @ApiMember(Description="This account is BYOA")
/** @var bool|null */
public ?bool $isBYOA=null,
/** @description TrustHub Profile Sid */
// @ApiMember(Description="TrustHub Profile Sid")
/** @var string|null */
public ?string $trustHubProfileSid=null,
/** @description The ID of the logo file */
// @ApiMember(Description="The ID of the logo file")
/** @var string|null */
public ?string $logoId=null,
/** @description The URI of the logo file */
// @ApiMember(Description="The URI of the logo file")
/** @var string|null */
public ?string $logoUri=null,
/** @description The billing settings for this account */
// @ApiMember(Description="The billing settings for this account")
/** @var BillingSettings|null */
public ?BillingSettings $billingSettings=null
) {
parent::__construct($id,$dateCreated,$dateLastModified,$createdBy,$lastModifiedBy);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['parentAccountId'])) $this->parentAccountId = $o['parentAccountId'];
if (isset($o['twilioAccountSid'])) $this->twilioAccountSid = $o['twilioAccountSid'];
if (isset($o['ancestorIds'])) $this->ancestorIds = JsonConverters::fromArray('string', $o['ancestorIds']);
if (isset($o['maxPhoneNumbers'])) $this->maxPhoneNumbers = $o['maxPhoneNumbers'];
if (isset($o['isBYOA'])) $this->isBYOA = $o['isBYOA'];
if (isset($o['trustHubProfileSid'])) $this->trustHubProfileSid = $o['trustHubProfileSid'];
if (isset($o['logoId'])) $this->logoId = $o['logoId'];
if (isset($o['logoUri'])) $this->logoUri = $o['logoUri'];
if (isset($o['billingSettings'])) $this->billingSettings = JsonConverters::from('BillingSettings', $o['billingSettings']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->parentAccountId)) $o['parentAccountId'] = $this->parentAccountId;
if (isset($this->twilioAccountSid)) $o['twilioAccountSid'] = $this->twilioAccountSid;
if (isset($this->ancestorIds)) $o['ancestorIds'] = JsonConverters::toArray('string', $this->ancestorIds);
if (isset($this->maxPhoneNumbers)) $o['maxPhoneNumbers'] = $this->maxPhoneNumbers;
if (isset($this->isBYOA)) $o['isBYOA'] = $this->isBYOA;
if (isset($this->trustHubProfileSid)) $o['trustHubProfileSid'] = $this->trustHubProfileSid;
if (isset($this->logoId)) $o['logoId'] = $this->logoId;
if (isset($this->logoUri)) $o['logoUri'] = $this->logoUri;
if (isset($this->billingSettings)) $o['billingSettings'] = JsonConverters::to('BillingSettings', $this->billingSettings);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template T
*/
class ListResponse implements JsonSerializable
{
public array $genericArgs = [];
public static function create(array $genericArgs=[]): ListResponse {
$to = new ListResponse();
$to->genericArgs = $genericArgs;
return $to;
}
public function __construct(
/** @description The items */
// @ApiMember(Description="The items")
/** @var array<AccountInfo>|null */
public mixed $items=null,
/** @description The total number of items */
// @ApiMember(Description="The total number of items")
/** @var int */
public mixed $totalCount=0,
/** @description The total number of pages */
// @ApiMember(Description="The total number of pages")
/** @var int */
public mixed $totalPages=0,
/** @description Are there more pages of items? Used with simplified paging */
// @ApiMember(Description="Are there more pages of items? Used with simplified paging")
/** @var bool|null */
public mixed $hasMorePages=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['items'])) $this->items = JsonConverters::fromArray('AccountInfo', $o['items']);
if (isset($o['totalCount'])) $this->totalCount = $o['totalCount'];
if (isset($o['totalPages'])) $this->totalPages = $o['totalPages'];
if (isset($o['hasMorePages'])) $this->hasMorePages = $o['hasMorePages'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->items)) $o['items'] = JsonConverters::toArray('AccountInfo', $this->items);
if (isset($this->totalCount)) $o['totalCount'] = $this->totalCount;
if (isset($this->totalPages)) $o['totalPages'] = $this->totalPages;
if (isset($this->hasMorePages)) $o['hasMorePages'] = $this->hasMorePages;
return empty($o) ? new class(){} : $o;
}
}
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 /portal/call-history HTTP/1.1 Host: team.evovoice.io Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"items":[{"dialState":"None","callState":"Disconnected","queueState":"None","accountId":"String","accountName":"String","customerId":"String","customerBreadcrumb":[{"id":"String","name":"String"}],"customerName":"String","endpointId":"String","endpointName":"String","dateCompleted":"String","destination":"String","toAddress":"String","fromAddress":"String","fromName":"String","answeredByName":"String","queueMemberId":"String","channel":"Voice","ended":false,"outcome":"String","callSid":"String","consoleData":"String","holdQueueName":"String","heldByUserId":"String","holdReason":"None","conferenceSid":"String","displayName":"String","log":[{"date":"String","message":"String"}],"members":[{"identity":"String","endpointId":"String","displayName":"String","isOriginalMember":false,"avatarUrl":"String","applicationData":{"String":"String"},"callState":"None","role":"None","callSid":"String","muted":false}],"callbackNumber":"String","answeredById":"String","direction":"Incoming","fromPhoneNumber":"String","mostRecentParticipantCallSid":"String","wasMissed":false,"ringQueueId":"String","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}],"totalCount":0,"totalPages":0,"hasMorePages":false}