Required role: | User |
GET | /app/activity |
---|
<?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;
}
}
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 NotificationTypes : string
{
case Email = 'Email';
case Sms = 'Sms';
case Push = 'Push';
case IncomingCall = 'IncomingCall';
case OutgoingCall = 'OutgoingCall';
}
class NotificationRecipientInfo implements JsonSerializable
{
public function __construct(
/** @description The address of the recipient */
// @ApiMember(Description="The address of the recipient")
/** @var string|null */
public ?string $address=null,
/** @description Extra info about the recipient e.g. CC, BCC */
// @ApiMember(Description="Extra info about the recipient e.g. CC, BCC")
/** @var string|null */
public ?string $extra=null,
/** @description The name of the recipient */
// @ApiMember(Description="The name of the recipient")
/** @var string|null */
public ?string $name=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['address'])) $this->address = $o['address'];
if (isset($o['extra'])) $this->extra = $o['extra'];
if (isset($o['name'])) $this->name = $o['name'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->address)) $o['address'] = $this->address;
if (isset($this->extra)) $o['extra'] = $this->extra;
if (isset($this->name)) $o['name'] = $this->name;
return empty($o) ? new class(){} : $o;
}
}
enum FileTypes : string
{
case Upload = 'Upload';
case VoiceMessage = 'VoiceMessage';
case CallRecording = 'CallRecording';
case Fax = 'Fax';
case Attachment = 'Attachment';
case FaxOutgoing = 'FaxOutgoing';
}
class FileInfo 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 type of file this is */
// @ApiMember(Description="The type of file this is")
/** @var FileTypes|null */
public ?FileTypes $type=null,
/** @description The account ID this file is associated with */
// @ApiMember(Description="The account ID this file is associated with")
/** @var string|null */
public ?string $accountId=null,
/** @description The name of the account this file is associated with */
// @ApiMember(Description="The name of the account this file is associated with")
/** @var string|null */
public ?string $accountName=null,
/** @description The ID of the customer this file is associated with */
// @ApiMember(Description="The ID of the customer this file is associated with")
/** @var string|null */
public ?string $customerId=null,
/** @description The name of the customer this file is associated with */
// @ApiMember(Description="The name of the customer this file is associated with")
/** @var string|null */
public ?string $customerName=null,
/** @description The breadcrumb to the customer for this file */
// @ApiMember(Description="The breadcrumb to the customer for this file")
/** @var array<CustomerBreadcrumb>|null */
public ?array $customerBreadcrumb=null,
/** @description The ID of the user this file is assocaited with */
// @ApiMember(Description="The ID of the user this file is assocaited with")
/** @var string|null */
public ?string $userId=null,
/** @description The name of the user this file is associated with */
// @ApiMember(Description="The name of the user this file is associated with")
/** @var string|null */
public ?string $userName=null,
/** @description The original file name for the file */
// @ApiMember(Description="The original file name for the file")
/** @var string|null */
public ?string $fileName=null,
/** @description The URI of the file */
// @ApiMember(Description="The URI of the file")
/** @var string|null */
public ?string $uri=null,
/** @description The Content type of the file */
// @ApiMember(Description="The Content type of the file")
/** @var string|null */
public ?string $contentType=null,
/** @description The size of the file */
// @ApiMember(Description="The size of the file")
/** @var int */
public int $contentLength=0,
/** @description The Twilio ID of the recording */
// @ApiMember(Description="The Twilio ID of the recording")
/** @var string|null */
public ?string $recordingSid=null,
/** @description The duration of the recording in seconds */
// @ApiMember(Description="The duration of the recording in seconds")
/** @var int */
public int $recordingDuration=0,
/** @description Who is the recording from? */
// @ApiMember(Description="Who is the recording from?")
/** @var string|null */
public ?string $recordingFrom=null,
/** @description Transcription (if available) */
// @ApiMember(Description="Transcription (if available)")
/** @var string|null */
public ?string $transcription=null,
/** @description From Address (e.g. caller ID) for incoming calls */
// @ApiMember(Description="From Address (e.g. caller ID) for incoming calls")
/** @var string|null */
public ?string $fromAddress=null,
/** @description To Address (e.g. dialed number) for outgoing calls */
// @ApiMember(Description="To Address (e.g. dialed number) for outgoing calls")
/** @var string|null */
public ?string $toAddress=null,
/** @description The AI transcription for this call */
// @ApiMember(Description="The AI transcription for this call")
/** @var string|null */
public ?string $aiTranscription=null
) {
parent::__construct($id,$dateCreated,$dateLastModified,$createdBy,$lastModifiedBy);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['type'])) $this->type = JsonConverters::from('FileTypes', $o['type']);
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['customerName'])) $this->customerName = $o['customerName'];
if (isset($o['customerBreadcrumb'])) $this->customerBreadcrumb = JsonConverters::fromArray('CustomerBreadcrumb', $o['customerBreadcrumb']);
if (isset($o['userId'])) $this->userId = $o['userId'];
if (isset($o['userName'])) $this->userName = $o['userName'];
if (isset($o['fileName'])) $this->fileName = $o['fileName'];
if (isset($o['uri'])) $this->uri = $o['uri'];
if (isset($o['contentType'])) $this->contentType = $o['contentType'];
if (isset($o['contentLength'])) $this->contentLength = $o['contentLength'];
if (isset($o['recordingSid'])) $this->recordingSid = $o['recordingSid'];
if (isset($o['recordingDuration'])) $this->recordingDuration = $o['recordingDuration'];
if (isset($o['recordingFrom'])) $this->recordingFrom = $o['recordingFrom'];
if (isset($o['transcription'])) $this->transcription = $o['transcription'];
if (isset($o['fromAddress'])) $this->fromAddress = $o['fromAddress'];
if (isset($o['toAddress'])) $this->toAddress = $o['toAddress'];
if (isset($o['aiTranscription'])) $this->aiTranscription = $o['aiTranscription'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->type)) $o['type'] = JsonConverters::to('FileTypes', $this->type);
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->customerName)) $o['customerName'] = $this->customerName;
if (isset($this->customerBreadcrumb)) $o['customerBreadcrumb'] = JsonConverters::toArray('CustomerBreadcrumb', $this->customerBreadcrumb);
if (isset($this->userId)) $o['userId'] = $this->userId;
if (isset($this->userName)) $o['userName'] = $this->userName;
if (isset($this->fileName)) $o['fileName'] = $this->fileName;
if (isset($this->uri)) $o['uri'] = $this->uri;
if (isset($this->contentType)) $o['contentType'] = $this->contentType;
if (isset($this->contentLength)) $o['contentLength'] = $this->contentLength;
if (isset($this->recordingSid)) $o['recordingSid'] = $this->recordingSid;
if (isset($this->recordingDuration)) $o['recordingDuration'] = $this->recordingDuration;
if (isset($this->recordingFrom)) $o['recordingFrom'] = $this->recordingFrom;
if (isset($this->transcription)) $o['transcription'] = $this->transcription;
if (isset($this->fromAddress)) $o['fromAddress'] = $this->fromAddress;
if (isset($this->toAddress)) $o['toAddress'] = $this->toAddress;
if (isset($this->aiTranscription)) $o['aiTranscription'] = $this->aiTranscription;
return empty($o) ? new class(){} : $o;
}
}
class NotificationInfo 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 account ID this endpoint is associated with */
// @ApiMember(Description="The account ID this endpoint is associated with")
/** @var string|null */
public ?string $accountId=null,
/** @description The name of the account this endpoint is associated with */
// @ApiMember(Description="The name of the account this endpoint is associated with")
/** @var string|null */
public ?string $accountName=null,
/** @description The ID of the customer this endpoint is associated with */
// @ApiMember(Description="The ID of the customer this endpoint is associated with")
/** @var string|null */
public ?string $customerId=null,
/** @description The name of the customer this endpoint is associated with */
// @ApiMember(Description="The name of the customer this endpoint is associated with")
/** @var string|null */
public ?string $customerName=null,
/** @description The breadcrumb to the customer for this endpoint */
// @ApiMember(Description="The breadcrumb to the customer for this endpoint")
/** @var array<CustomerBreadcrumb>|null */
public ?array $customerBreadcrumb=null,
/** @description The type of notification */
// @ApiMember(Description="The type of notification")
/** @var NotificationTypes|null */
public ?NotificationTypes $type=null,
/** @description The subject of the notification */
// @ApiMember(Description="The subject of the notification")
/** @var string|null */
public ?string $subject=null,
/** @description The body of the notification */
// @ApiMember(Description="The body of the notification")
/** @var string|null */
public ?string $body=null,
/** @description The recipients of this notification */
// @ApiMember(Description="The recipients of this notification")
/** @var array<NotificationRecipientInfo>|null */
public ?array $recipients=null,
/** @description The list of attachments */
// @ApiMember(Description="The list of attachments")
/** @var array<FileInfo>|null */
public ?array $attachments=null,
/** @description The original from for the session */
// @ApiMember(Description="The original from for the session")
/** @var string|null */
public ?string $from=null,
/** @description The original To for the session */
// @ApiMember(Description="The original To for the session")
/** @var string|null */
public ?string $to=null,
/** @description Was there an error? */
// @ApiMember(Description="Was there an error?")
/** @var bool|null */
public ?bool $error=null,
/** @description The error message */
// @ApiMember(Description="The error message")
/** @var string|null */
public ?string $errorMessage=null
) {
parent::__construct($id,$dateCreated,$dateLastModified,$createdBy,$lastModifiedBy);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
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['customerName'])) $this->customerName = $o['customerName'];
if (isset($o['customerBreadcrumb'])) $this->customerBreadcrumb = JsonConverters::fromArray('CustomerBreadcrumb', $o['customerBreadcrumb']);
if (isset($o['type'])) $this->type = JsonConverters::from('NotificationTypes', $o['type']);
if (isset($o['subject'])) $this->subject = $o['subject'];
if (isset($o['body'])) $this->body = $o['body'];
if (isset($o['recipients'])) $this->recipients = JsonConverters::fromArray('NotificationRecipientInfo', $o['recipients']);
if (isset($o['attachments'])) $this->attachments = JsonConverters::fromArray('FileInfo', $o['attachments']);
if (isset($o['from'])) $this->from = $o['from'];
if (isset($o['to'])) $this->to = $o['to'];
if (isset($o['error'])) $this->error = $o['error'];
if (isset($o['errorMessage'])) $this->errorMessage = $o['errorMessage'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
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->customerName)) $o['customerName'] = $this->customerName;
if (isset($this->customerBreadcrumb)) $o['customerBreadcrumb'] = JsonConverters::toArray('CustomerBreadcrumb', $this->customerBreadcrumb);
if (isset($this->type)) $o['type'] = JsonConverters::to('NotificationTypes', $this->type);
if (isset($this->subject)) $o['subject'] = $this->subject;
if (isset($this->body)) $o['body'] = $this->body;
if (isset($this->recipients)) $o['recipients'] = JsonConverters::toArray('NotificationRecipientInfo', $this->recipients);
if (isset($this->attachments)) $o['attachments'] = JsonConverters::toArray('FileInfo', $this->attachments);
if (isset($this->from)) $o['from'] = $this->from;
if (isset($this->to)) $o['to'] = $this->to;
if (isset($this->error)) $o['error'] = $this->error;
if (isset($this->errorMessage)) $o['errorMessage'] = $this->errorMessage;
return empty($o) ? new class(){} : $o;
}
}
/** @description Gets activity for the specified date range. Date range must be a week or less */
// @Api(Description="Gets activity for the specified date range. Date range must be a week or less")
/**
* @template ListRequest of NotificationInfo
*/
class GetActivity 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
) {
parent::__construct($page,$all,$countPerPage,$specificIds,$sortField,$sortOrder,$simplifiedPaging);
}
/** @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;
}
}
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 .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /app/activity HTTP/1.1 Host: team.evovoice.io Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"items":[{"accountId":"String","accountName":"String","customerId":"String","customerName":"String","customerBreadcrumb":[{"id":"String","name":"String"}],"type":"Email","subject":"String","body":"String","recipients":[{"address":"String","extra":"String","name":"String"}],"attachments":[{"type":"Upload","accountId":"String","accountName":"String","customerId":"String","customerName":"String","customerBreadcrumb":[{"id":"String","name":"String"}],"userId":"String","userName":"String","fileName":"String","uri":"String","contentType":"String","contentLength":0,"recordingSid":"String","recordingDuration":0,"recordingFrom":"String","transcription":"String","fromAddress":"String","toAddress":"String","aiTranscription":"String","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}],"from":"String","to":"String","error":false,"errorMessage":"String","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}],"totalCount":0,"totalPages":0,"hasMorePages":false}