Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /flows |
---|
<?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 FlowRoles : string
{
case UI = 'UI';
case Reference = 'Reference';
case PhoneNumberRouting = 'PhoneNumberRouting';
case UserDialOut = 'UserDialOut';
case FaxNumberRouting = 'FaxNumberRouting';
}
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 FlowNodeCategories : string
{
case General = 'General';
case Voice = 'Voice';
case Logic = 'Logic';
case DateAndTime = 'DateAndTime';
case Audio = 'Audio';
case Messaging = 'Messaging';
case Assistant = 'Assistant';
case Flows = 'Flows';
case Fax = 'Fax';
case Network = 'Network';
case Cookies = 'Cookies';
case CallCenter = 'CallCenter';
case Intelligence = 'Intelligence';
}
enum ValueTypes : string
{
case NotSpecified = 'NotSpecified';
case String = 'String';
case Boolean = 'Boolean';
case Number = 'Number';
case List = 'List';
case Struct = 'Struct';
case Transition = 'Transition';
case Custom = 'Custom';
case Date = 'Date';
case AudioFile = 'AudioFile';
case TimeZoneId = 'TimeZoneId';
case PhoneNumber = 'PhoneNumber';
case User = 'User';
case Endpoint = 'Endpoint';
case Time = 'Time';
case File = 'File';
case FaxNumber = 'FaxNumber';
case EmailAccount = 'EmailAccount';
case Customer = 'Customer';
case Flow = 'Flow';
case Team = 'Team';
case FlowReference = 'FlowReference';
case Integration = 'Integration';
case Assistant = 'Assistant';
}
enum UIHints : string
{
case None = 'None';
case LargeText = 'LargeText';
case InlineForm = 'InlineForm';
case Password = 'Password';
case InlineStruct = 'InlineStruct';
}
/**
* @template array of String
* @template array1 of Value
*/
class Struct extends array implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
class Value implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $boolValue=null,
/** @var string|null */
public ?string $stringValue=null,
/** @var float|null */
public ?float $numberValue=null,
/** @var array<Struct>|null */
public ?array $listValue=null,
/** @var Struct|null */
public ?Struct $structValue=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['boolValue'])) $this->boolValue = $o['boolValue'];
if (isset($o['stringValue'])) $this->stringValue = $o['stringValue'];
if (isset($o['numberValue'])) $this->numberValue = $o['numberValue'];
if (isset($o['listValue'])) $this->listValue = JsonConverters::fromArray('Struct', $o['listValue']);
if (isset($o['structValue'])) $this->structValue = JsonConverters::from('Struct', $o['structValue']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->boolValue)) $o['boolValue'] = $this->boolValue;
if (isset($this->stringValue)) $o['stringValue'] = $this->stringValue;
if (isset($this->numberValue)) $o['numberValue'] = $this->numberValue;
if (isset($this->listValue)) $o['listValue'] = JsonConverters::toArray('Struct', $this->listValue);
if (isset($this->structValue)) $o['structValue'] = JsonConverters::to('Struct', $this->structValue);
return empty($o) ? new class(){} : $o;
}
}
enum DataFieldUniqueness : string
{
case NotUnique = 'NotUnique';
case Unique = 'Unique';
case UniqueToCustomer = 'UniqueToCustomer';
}
enum UserDataFieldModes : string
{
case Hidden = 'Hidden';
case ReadOnly = 'ReadOnly';
case ReadWrite = 'ReadWrite';
}
class DataField implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $name=null,
/** @var ValueTypes|null */
public ?ValueTypes $type=null,
/** @var UIHints|null */
public ?UIHints $uiHint=null,
/** @var string|null */
public ?string $uiTab=null,
/** @var bool|null */
public ?bool $isAsync=null,
/** @var bool|null */
public ?bool $disableBinding=null,
/** @var DataType|null */
public ?DataType $structType=null,
/** @var DataType|null */
public ?DataType $listType=null,
/** @var string|null */
public ?string $description=null,
/** @var array<string>|null */
public ?array $possibleValues=null,
/** @var bool|null */
public ?bool $isOutput=null,
/** @var string|null */
public ?string $customFieldValuesUrl=null,
/** @var Value|null */
public ?Value $defaultValue=null,
/** @var string|null */
public ?string $transitionNameFormat=null,
/** @var DataFieldUniqueness|null */
public ?DataFieldUniqueness $uniqueness=null,
/** @var bool|null */
public ?bool $voiceOnly=null,
/** @var string|null */
public ?string $conditionalVisibilityField=null,
/** @var string|null */
public ?string $conditionalVisibilityValue=null,
/** @var bool|null */
public ?bool $noEvalTemplate=null,
/** @var UserDataFieldModes|null */
public ?UserDataFieldModes $userMode=null,
/** @var bool|null */
public ?bool $anyValueType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['type'])) $this->type = JsonConverters::from('ValueTypes', $o['type']);
if (isset($o['uiHint'])) $this->uiHint = JsonConverters::from('UIHints', $o['uiHint']);
if (isset($o['uiTab'])) $this->uiTab = $o['uiTab'];
if (isset($o['isAsync'])) $this->isAsync = $o['isAsync'];
if (isset($o['disableBinding'])) $this->disableBinding = $o['disableBinding'];
if (isset($o['structType'])) $this->structType = JsonConverters::from('DataType', $o['structType']);
if (isset($o['listType'])) $this->listType = JsonConverters::from('DataType', $o['listType']);
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['possibleValues'])) $this->possibleValues = JsonConverters::fromArray('string', $o['possibleValues']);
if (isset($o['isOutput'])) $this->isOutput = $o['isOutput'];
if (isset($o['customFieldValuesUrl'])) $this->customFieldValuesUrl = $o['customFieldValuesUrl'];
if (isset($o['defaultValue'])) $this->defaultValue = JsonConverters::from('Value', $o['defaultValue']);
if (isset($o['transitionNameFormat'])) $this->transitionNameFormat = $o['transitionNameFormat'];
if (isset($o['uniqueness'])) $this->uniqueness = JsonConverters::from('DataFieldUniqueness', $o['uniqueness']);
if (isset($o['voiceOnly'])) $this->voiceOnly = $o['voiceOnly'];
if (isset($o['conditionalVisibilityField'])) $this->conditionalVisibilityField = $o['conditionalVisibilityField'];
if (isset($o['conditionalVisibilityValue'])) $this->conditionalVisibilityValue = $o['conditionalVisibilityValue'];
if (isset($o['noEvalTemplate'])) $this->noEvalTemplate = $o['noEvalTemplate'];
if (isset($o['userMode'])) $this->userMode = JsonConverters::from('UserDataFieldModes', $o['userMode']);
if (isset($o['anyValueType'])) $this->anyValueType = $o['anyValueType'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->type)) $o['type'] = JsonConverters::to('ValueTypes', $this->type);
if (isset($this->uiHint)) $o['uiHint'] = JsonConverters::to('UIHints', $this->uiHint);
if (isset($this->uiTab)) $o['uiTab'] = $this->uiTab;
if (isset($this->isAsync)) $o['isAsync'] = $this->isAsync;
if (isset($this->disableBinding)) $o['disableBinding'] = $this->disableBinding;
if (isset($this->structType)) $o['structType'] = JsonConverters::to('DataType', $this->structType);
if (isset($this->listType)) $o['listType'] = JsonConverters::to('DataType', $this->listType);
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->possibleValues)) $o['possibleValues'] = JsonConverters::toArray('string', $this->possibleValues);
if (isset($this->isOutput)) $o['isOutput'] = $this->isOutput;
if (isset($this->customFieldValuesUrl)) $o['customFieldValuesUrl'] = $this->customFieldValuesUrl;
if (isset($this->defaultValue)) $o['defaultValue'] = JsonConverters::to('Value', $this->defaultValue);
if (isset($this->transitionNameFormat)) $o['transitionNameFormat'] = $this->transitionNameFormat;
if (isset($this->uniqueness)) $o['uniqueness'] = JsonConverters::to('DataFieldUniqueness', $this->uniqueness);
if (isset($this->voiceOnly)) $o['voiceOnly'] = $this->voiceOnly;
if (isset($this->conditionalVisibilityField)) $o['conditionalVisibilityField'] = $this->conditionalVisibilityField;
if (isset($this->conditionalVisibilityValue)) $o['conditionalVisibilityValue'] = $this->conditionalVisibilityValue;
if (isset($this->noEvalTemplate)) $o['noEvalTemplate'] = $this->noEvalTemplate;
if (isset($this->userMode)) $o['userMode'] = JsonConverters::to('UserDataFieldModes', $this->userMode);
if (isset($this->anyValueType)) $o['anyValueType'] = $this->anyValueType;
return empty($o) ? new class(){} : $o;
}
}
class DataType implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $typeName=null,
/** @var array<DataField>|null */
public ?array $fields=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['typeName'])) $this->typeName = $o['typeName'];
if (isset($o['fields'])) $this->fields = JsonConverters::fromArray('DataField', $o['fields']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->typeName)) $o['typeName'] = $this->typeName;
if (isset($this->fields)) $o['fields'] = JsonConverters::toArray('DataField', $this->fields);
return empty($o) ? new class(){} : $o;
}
}
enum FlowChannels : string
{
case Voice = 'Voice';
case Chat = 'Chat';
case Fax = 'Fax';
}
class FlowNodeSpec implements JsonSerializable
{
public function __construct(
/** @description The name of this node */
// @ApiMember(Description="The name of this node")
/** @var string|null */
public ?string $name=null,
/** @description A description of this node */
// @ApiMember(Description="A description of this node")
/** @var string|null */
public ?string $description=null,
/** @description Icon class for this node (FontAwesome) */
// @ApiMember(Description="Icon class for this node (FontAwesome)")
/** @var string|null */
public ?string $iconClass=null,
/** @description The type name for this node */
// @ApiMember(Description="The type name for this node")
/** @var string|null */
public ?string $typeName=null,
/** @description The category this node should be grouped under */
// @ApiMember(Description="The category this node should be grouped under")
/** @var FlowNodeCategories|null */
public ?FlowNodeCategories $category=null,
/** @description The URL where this node is located */
// @ApiMember(Description="The URL where this node is located")
/** @var string|null */
public ?string $url=null,
/** @description The data type for this node */
// @ApiMember(Description="The data type for this node")
/** @var DataType|null */
public ?DataType $dataType=null,
/** @description URL for documentation for this node */
// @ApiMember(Description="URL for documentation for this node")
/** @var string|null */
public ?string $documentationUrl=null,
/** @description The channels that this node is restricted to */
// @ApiMember(Description="The channels that this node is restricted to")
/** @var array<FlowChannels>|null */
public ?array $restrictToChannels=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['iconClass'])) $this->iconClass = $o['iconClass'];
if (isset($o['typeName'])) $this->typeName = $o['typeName'];
if (isset($o['category'])) $this->category = JsonConverters::from('FlowNodeCategories', $o['category']);
if (isset($o['url'])) $this->url = $o['url'];
if (isset($o['dataType'])) $this->dataType = JsonConverters::from('DataType', $o['dataType']);
if (isset($o['documentationUrl'])) $this->documentationUrl = $o['documentationUrl'];
if (isset($o['restrictToChannels'])) $this->restrictToChannels = JsonConverters::fromArray('FlowChannels', $o['restrictToChannels']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->iconClass)) $o['iconClass'] = $this->iconClass;
if (isset($this->typeName)) $o['typeName'] = $this->typeName;
if (isset($this->category)) $o['category'] = JsonConverters::to('FlowNodeCategories', $this->category);
if (isset($this->url)) $o['url'] = $this->url;
if (isset($this->dataType)) $o['dataType'] = JsonConverters::to('DataType', $this->dataType);
if (isset($this->documentationUrl)) $o['documentationUrl'] = $this->documentationUrl;
if (isset($this->restrictToChannels)) $o['restrictToChannels'] = JsonConverters::toArray('FlowChannels', $this->restrictToChannels);
return empty($o) ? new class(){} : $o;
}
}
class FlowNodeUI implements JsonSerializable
{
public function __construct(
/** @description The X position of the node */
// @ApiMember(Description="The X position of the node")
/** @var float */
public float $x=0.0,
/** @description The Y position of the node */
// @ApiMember(Description="The Y position of the node")
/** @var float */
public float $y=0.0,
/** @description Notes for this node */
// @ApiMember(Description="Notes for this node")
/** @var string|null */
public ?string $notes=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['x'])) $this->x = $o['x'];
if (isset($o['y'])) $this->y = $o['y'];
if (isset($o['notes'])) $this->notes = $o['notes'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->x)) $o['x'] = $this->x;
if (isset($this->y)) $o['y'] = $this->y;
if (isset($this->notes)) $o['notes'] = $this->notes;
return empty($o) ? new class(){} : $o;
}
}
enum ValueSources : string
{
case Value = 'Value';
case Flow = 'Flow';
case System = 'System';
case Customer = 'Customer';
case Session = 'Session';
case Endpoint = 'Endpoint';
case Expression = 'Expression';
case User = 'User';
}
class NodeParameter implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var ValueTypes|null */
public ?ValueTypes $type=null,
/** @var ValueSources|null */
public ?ValueSources $source=null,
/** @var bool|null */
public ?bool $isAsync=null,
/** @var string|null */
public ?string $referenceId=null,
/** @var Value|null */
public ?Value $value=null,
/** @var bool|null */
public ?bool $noEvalTemplate=null,
/** @var array<NodeParameterMap>|null */
public ?array $listParameters=null,
/** @var NodeParameterMap|null */
public ?NodeParameterMap $structParameters=null,
/** @var bool|null */
public ?bool $isOutput=null,
/** @var string|null */
public ?string $expression=null,
/** @var DataType|null */
public ?DataType $listType=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['type'])) $this->type = JsonConverters::from('ValueTypes', $o['type']);
if (isset($o['source'])) $this->source = JsonConverters::from('ValueSources', $o['source']);
if (isset($o['isAsync'])) $this->isAsync = $o['isAsync'];
if (isset($o['referenceId'])) $this->referenceId = $o['referenceId'];
if (isset($o['value'])) $this->value = JsonConverters::from('Value', $o['value']);
if (isset($o['noEvalTemplate'])) $this->noEvalTemplate = $o['noEvalTemplate'];
if (isset($o['listParameters'])) $this->listParameters = JsonConverters::fromArray('NodeParameterMap', $o['listParameters']);
if (isset($o['structParameters'])) $this->structParameters = JsonConverters::from('NodeParameterMap', $o['structParameters']);
if (isset($o['isOutput'])) $this->isOutput = $o['isOutput'];
if (isset($o['expression'])) $this->expression = $o['expression'];
if (isset($o['listType'])) $this->listType = JsonConverters::from('DataType', $o['listType']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->type)) $o['type'] = JsonConverters::to('ValueTypes', $this->type);
if (isset($this->source)) $o['source'] = JsonConverters::to('ValueSources', $this->source);
if (isset($this->isAsync)) $o['isAsync'] = $this->isAsync;
if (isset($this->referenceId)) $o['referenceId'] = $this->referenceId;
if (isset($this->value)) $o['value'] = JsonConverters::to('Value', $this->value);
if (isset($this->noEvalTemplate)) $o['noEvalTemplate'] = $this->noEvalTemplate;
if (isset($this->listParameters)) $o['listParameters'] = JsonConverters::toArray('NodeParameterMap', $this->listParameters);
if (isset($this->structParameters)) $o['structParameters'] = JsonConverters::to('NodeParameterMap', $this->structParameters);
if (isset($this->isOutput)) $o['isOutput'] = $this->isOutput;
if (isset($this->expression)) $o['expression'] = $this->expression;
if (isset($this->listType)) $o['listType'] = JsonConverters::to('DataType', $this->listType);
return empty($o) ? new class(){} : $o;
}
}
/**
* @template array of String
* @template array1 of NodeParameter
*/
class NodeParameterMap extends array implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
class FlowNode implements JsonSerializable
{
public function __construct(
/** @description The ID of this node. Must be unique within the flow but can be anything */
// @ApiMember(Description="The ID of this node. Must be unique within the flow but can be anything")
/** @var string|null */
public ?string $id=null,
/** @description Is this the starting node for the flow. Only one node can have this set */
// @ApiMember(Description="Is this the starting node for the flow. Only one node can have this set")
/** @var bool|null */
public ?bool $isStartNode=null,
/** @description The name of the node, descriptive to be used as a reminder in the GUI */
// @ApiMember(Description="The name of the node, descriptive to be used as a reminder in the GUI")
/** @var string|null */
public ?string $name=null,
/** @description The specification for the node */
// @ApiMember(Description="The specification for the node")
/** @var FlowNodeSpec|null */
public ?FlowNodeSpec $spec=null,
/** @description The UI data for the node */
// @ApiMember(Description="The UI data for the node")
/** @var FlowNodeUI|null */
public ?FlowNodeUI $ui=null,
/** @description The data for this node. These will be POST'd to the endpoint when it is called. */
// @ApiMember(Description="The data for this node. These will be POST'd to the endpoint when it is called.")
/** @var NodeParameterMap|null */
public ?NodeParameterMap $parameters=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['isStartNode'])) $this->isStartNode = $o['isStartNode'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['spec'])) $this->spec = JsonConverters::from('FlowNodeSpec', $o['spec']);
if (isset($o['ui'])) $this->ui = JsonConverters::from('FlowNodeUI', $o['ui']);
if (isset($o['parameters'])) $this->parameters = JsonConverters::from('NodeParameterMap', $o['parameters']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->isStartNode)) $o['isStartNode'] = $this->isStartNode;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->spec)) $o['spec'] = JsonConverters::to('FlowNodeSpec', $this->spec);
if (isset($this->ui)) $o['ui'] = JsonConverters::to('FlowNodeUI', $this->ui);
if (isset($this->parameters)) $o['parameters'] = JsonConverters::to('NodeParameterMap', $this->parameters);
return empty($o) ? new class(){} : $o;
}
}
class FlowParameter extends DataField implements JsonSerializable
{
/**
* @param string|null $id
* @param string|null $name
* @param ValueTypes|null $type
* @param UIHints|null $uiHint
* @param string|null $uiTab
* @param bool|null $isAsync
* @param bool|null $disableBinding
* @param DataType|null $structType
* @param DataType|null $listType
* @param string|null $description
* @param array<string>|null $possibleValues
* @param bool|null $isOutput
* @param string|null $customFieldValuesUrl
* @param Value|null $defaultValue
* @param string|null $transitionNameFormat
* @param DataFieldUniqueness|null $uniqueness
* @param bool|null $voiceOnly
* @param string|null $conditionalVisibilityField
* @param string|null $conditionalVisibilityValue
* @param bool|null $noEvalTemplate
* @param UserDataFieldModes|null $userMode
* @param bool|null $anyValueType
*/
public function __construct(
?string $id=null,
?string $name=null,
?ValueTypes $type=null,
?UIHints $uiHint=null,
?string $uiTab=null,
?bool $isAsync=null,
?bool $disableBinding=null,
?DataType $structType=null,
?DataType $listType=null,
?string $description=null,
?array $possibleValues=null,
?bool $isOutput=null,
?string $customFieldValuesUrl=null,
?Value $defaultValue=null,
?string $transitionNameFormat=null,
?DataFieldUniqueness $uniqueness=null,
?bool $voiceOnly=null,
?string $conditionalVisibilityField=null,
?string $conditionalVisibilityValue=null,
?bool $noEvalTemplate=null,
?UserDataFieldModes $userMode=null,
?bool $anyValueType=null,
/** @var bool|null */
public ?bool $isPublic=null,
/** @var bool|null */
public ?bool $isKnob=null
) {
parent::__construct($id,$name,$type,$uiHint,$uiTab,$isAsync,$disableBinding,$structType,$listType,$description,$possibleValues,$isOutput,$customFieldValuesUrl,$defaultValue,$transitionNameFormat,$uniqueness,$voiceOnly,$conditionalVisibilityField,$conditionalVisibilityValue,$noEvalTemplate,$userMode,$anyValueType);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['isPublic'])) $this->isPublic = $o['isPublic'];
if (isset($o['isKnob'])) $this->isKnob = $o['isKnob'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->isPublic)) $o['isPublic'] = $this->isPublic;
if (isset($this->isKnob)) $o['isKnob'] = $this->isKnob;
return empty($o) ? new class(){} : $o;
}
}
class FlowExit implements JsonSerializable
{
public function __construct(
/** @description The unique ID for this exit */
// @ApiMember(Description="The unique ID for this exit")
/** @var string|null */
public ?string $id=null,
/** @description The name of this exit */
// @ApiMember(Description="The name of this exit")
/** @var string|null */
public ?string $name=null,
/** @description The UI for the exit */
// @ApiMember(Description="The UI for the exit")
/** @var FlowNodeUI|null */
public ?FlowNodeUI $ui=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['ui'])) $this->ui = JsonConverters::from('FlowNodeUI', $o['ui']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->ui)) $o['ui'] = JsonConverters::to('FlowNodeUI', $this->ui);
return empty($o) ? new class(){} : $o;
}
}
class FlowUI implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $selectedNode=null,
/** @var float */
public float $canvasX=0.0,
/** @var float */
public float $canvasY=0.0,
/** @var float */
public float $canvasZoom=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['selectedNode'])) $this->selectedNode = $o['selectedNode'];
if (isset($o['canvasX'])) $this->canvasX = $o['canvasX'];
if (isset($o['canvasY'])) $this->canvasY = $o['canvasY'];
if (isset($o['canvasZoom'])) $this->canvasZoom = $o['canvasZoom'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->selectedNode)) $o['selectedNode'] = $this->selectedNode;
if (isset($this->canvasX)) $o['canvasX'] = $this->canvasX;
if (isset($this->canvasY)) $o['canvasY'] = $this->canvasY;
if (isset($this->canvasZoom)) $o['canvasZoom'] = $this->canvasZoom;
return empty($o) ? new class(){} : $o;
}
}
enum TagColors : string
{
case Magenta = 'Magenta';
case Red = 'Red';
case Volcano = 'Volcano';
case Orange = 'Orange';
case Gold = 'Gold';
case Lime = 'Lime';
case Green = 'Green';
case Cyan = 'Cyan';
case Blue = 'Blue';
case GeekBlue = 'GeekBlue';
case Purple = 'Purple';
}
class Tag implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $name=null,
/** @var TagColors|null */
public ?TagColors $color=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['color'])) $this->color = JsonConverters::from('TagColors', $o['color']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->color)) $o['color'] = JsonConverters::to('TagColors', $this->color);
return empty($o) ? new class(){} : $o;
}
}
class FlowInfo 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 flow */
// @ApiMember(Description="The name of this flow")
/** @var string|null */
public ?string $name=null,
/** @description The roles that this flow has */
// @ApiMember(Description="The roles that this flow has")
/** @var array<FlowRoles>|null */
public ?array $roles=null,
/** @description What this flow does */
// @ApiMember(Description="What this flow does")
/** @var string|null */
public ?string $description=null,
/** @description Any notes for this flow */
// @ApiMember(Description="Any notes for this flow")
/** @var string|null */
public ?string $notes=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 flow */
// @ApiMember(Description="The name of the account associated with the flow")
/** @var string|null */
public ?string $accountName=null,
/** @description The ID of the customer this flow is associated with */
// @ApiMember(Description="The ID of the customer this flow is associated with")
/** @var string|null */
public ?string $customerId=null,
/** @description The name of the customer this flow is associated with */
// @ApiMember(Description="The name of the customer this flow is associated with")
/** @var string|null */
public ?string $customerName=null,
/** @description The breadcrumb to the flow for this endpoint */
// @ApiMember(Description="The breadcrumb to the flow for this endpoint")
/** @var array<CustomerBreadcrumb>|null */
public ?array $customerBreadcrumb=null,
/** @description The nodes in this flow */
// @ApiMember(Description="The nodes in this flow")
/** @var array<FlowNode>|null */
public ?array $nodes=null,
/** @description The flow's parameters */
// @ApiMember(Description="The flow's parameters")
/** @var array<FlowParameter>|null */
public ?array $parameters=null,
/** @description The flow's exits */
// @ApiMember(Description="The flow's exits")
/** @var array<FlowExit>|null */
public ?array $exits=null,
/** @description The UI data for the flow */
// @ApiMember(Description="The UI data for the flow")
/** @var FlowUI|null */
public ?FlowUI $ui=null,
/** @description The list of tags for this flow */
// @ApiMember(Description="The list of tags for this flow")
/** @var array<Tag>|null */
public ?array $tags=null,
/** @description The number of nodes in this flow */
// @ApiMember(Description="The number of nodes in this flow")
/** @var int */
public int $nodeCount=0
) {
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['roles'])) $this->roles = JsonConverters::fromArray('FlowRoles', $o['roles']);
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['notes'])) $this->notes = $o['notes'];
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['nodes'])) $this->nodes = JsonConverters::fromArray('FlowNode', $o['nodes']);
if (isset($o['parameters'])) $this->parameters = JsonConverters::fromArray('FlowParameter', $o['parameters']);
if (isset($o['exits'])) $this->exits = JsonConverters::fromArray('FlowExit', $o['exits']);
if (isset($o['ui'])) $this->ui = JsonConverters::from('FlowUI', $o['ui']);
if (isset($o['tags'])) $this->tags = JsonConverters::fromArray('Tag', $o['tags']);
if (isset($o['nodeCount'])) $this->nodeCount = $o['nodeCount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->roles)) $o['roles'] = JsonConverters::toArray('FlowRoles', $this->roles);
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->notes)) $o['notes'] = $this->notes;
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->nodes)) $o['nodes'] = JsonConverters::toArray('FlowNode', $this->nodes);
if (isset($this->parameters)) $o['parameters'] = JsonConverters::toArray('FlowParameter', $this->parameters);
if (isset($this->exits)) $o['exits'] = JsonConverters::toArray('FlowExit', $this->exits);
if (isset($this->ui)) $o['ui'] = JsonConverters::to('FlowUI', $this->ui);
if (isset($this->tags)) $o['tags'] = JsonConverters::toArray('Tag', $this->tags);
if (isset($this->nodeCount)) $o['nodeCount'] = $this->nodeCount;
return empty($o) ? new class(){} : $o;
}
}
/** @description Lists all the flows */
// @Api(Description="Lists all the flows")
/**
* @template ListRequest of FlowInfo
*/
class ListFlows 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,
/** @description Filter by accounts */
// @ApiMember(Description="Filter by accounts")
/** @var array<string>|null */
public ?array $accountIds=null,
/** @description The IDs of the customers whose flows you want to retrieve */
// @ApiMember(Description="The IDs of the customers whose flows you want to retrieve")
/** @var array<string>|null */
public ?array $customerIds=null,
/** @description Filter by name */
// @ApiMember(Description="Filter by name")
/** @var string|null */
public ?string $nameFilter=null,
/** @description The list of tag IDs to filter by (must contain all) */
// @ApiMember(Description="The list of tag IDs to filter by (must contain all)")
/** @var array<string>|null */
public ?array $tagIds=null,
/** @description List flows by specific role */
// @ApiMember(Description="List flows by specific role")
/** @var FlowRoles|null */
public ?FlowRoles $role=null,
/** @description Exclude nodes */
// @ApiMember(Description="Exclude nodes")
/** @var bool|null */
public ?bool $includeNodes=null,
/** @description Node Type Filter */
// @ApiMember(Description="Node Type Filter")
/** @var string|null */
public ?string $nodeTypeFilter=null
) {
parent::__construct($page,$all,$countPerPage,$specificIds,$sortField,$sortOrder,$simplifiedPaging);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['accountIds'])) $this->accountIds = JsonConverters::fromArray('string', $o['accountIds']);
if (isset($o['customerIds'])) $this->customerIds = JsonConverters::fromArray('string', $o['customerIds']);
if (isset($o['nameFilter'])) $this->nameFilter = $o['nameFilter'];
if (isset($o['tagIds'])) $this->tagIds = JsonConverters::fromArray('string', $o['tagIds']);
if (isset($o['role'])) $this->role = JsonConverters::from('FlowRoles', $o['role']);
if (isset($o['includeNodes'])) $this->includeNodes = $o['includeNodes'];
if (isset($o['nodeTypeFilter'])) $this->nodeTypeFilter = $o['nodeTypeFilter'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->accountIds)) $o['accountIds'] = JsonConverters::toArray('string', $this->accountIds);
if (isset($this->customerIds)) $o['customerIds'] = JsonConverters::toArray('string', $this->customerIds);
if (isset($this->nameFilter)) $o['nameFilter'] = $this->nameFilter;
if (isset($this->tagIds)) $o['tagIds'] = JsonConverters::toArray('string', $this->tagIds);
if (isset($this->role)) $o['role'] = JsonConverters::to('FlowRoles', $this->role);
if (isset($this->includeNodes)) $o['includeNodes'] = $this->includeNodes;
if (isset($this->nodeTypeFilter)) $o['nodeTypeFilter'] = $this->nodeTypeFilter;
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 .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /flows HTTP/1.1 Host: team.evovoice.io Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ListResponseOfFlowInfoM153aFo_P xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api"> <HasMorePages>false</HasMorePages> <Items xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Flows"> <d2p1:FlowInfo> <CreatedBy>String</CreatedBy> <DateCreated>String</DateCreated> <DateLastModified>String</DateLastModified> <Id>String</Id> <LastModifiedBy>String</LastModifiedBy> <d2p1:AccountId>String</d2p1:AccountId> <d2p1:AccountName>String</d2p1:AccountName> <d2p1:CustomerBreadcrumb xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers"> <d4p1:CustomerBreadcrumb> <d4p1:Id>String</d4p1:Id> <d4p1:Name>String</d4p1:Name> </d4p1:CustomerBreadcrumb> </d2p1:CustomerBreadcrumb> <d2p1:CustomerId>String</d2p1:CustomerId> <d2p1:CustomerName>String</d2p1:CustomerName> <d2p1:Description>String</d2p1:Description> <d2p1:Exits> <d2p1:FlowExit> <d2p1:Id>String</d2p1:Id> <d2p1:Name>String</d2p1:Name> <d2p1:UI> <d2p1:Notes>String</d2p1:Notes> <d2p1:X>0</d2p1:X> <d2p1:Y>0</d2p1:Y> </d2p1:UI> </d2p1:FlowExit> </d2p1:Exits> <d2p1:Name>String</d2p1:Name> <d2p1:NodeCount>0</d2p1:NodeCount> <d2p1:Nodes> <d2p1:FlowNode> <d2p1:Id>String</d2p1:Id> <d2p1:IsStartNode>false</d2p1:IsStartNode> <d2p1:Name>String</d2p1:Name> <d2p1:Parameters xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d6p1:KeyValueOfstringNodeParameteripFhVFNS> <d6p1:Key>String</d6p1:Key> <d6p1:Value i:nil="true" /> </d6p1:KeyValueOfstringNodeParameteripFhVFNS> </d2p1:Parameters> <d2p1:Spec> <d2p1:Category>General</d2p1:Category> <d2p1:DataType xmlns:d7p1="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" i:nil="true" /> <d2p1:Description>String</d2p1:Description> <d2p1:DocumentationUrl>String</d2p1:DocumentationUrl> <d2p1:IconClass>String</d2p1:IconClass> <d2p1:Name>String</d2p1:Name> <d2p1:RestrictToChannels> <d2p1:FlowChannels>Voice</d2p1:FlowChannels> </d2p1:RestrictToChannels> <d2p1:TypeName>String</d2p1:TypeName> <d2p1:Url>String</d2p1:Url> </d2p1:Spec> <d2p1:UI> <d2p1:Notes>String</d2p1:Notes> <d2p1:X>0</d2p1:X> <d2p1:Y>0</d2p1:Y> </d2p1:UI> </d2p1:FlowNode> </d2p1:Nodes> <d2p1:Notes>String</d2p1:Notes> <d2p1:Parameters> <d2p1:FlowParameter> <AnyValueType xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</AnyValueType> <ConditionalVisibilityField xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</ConditionalVisibilityField> <ConditionalVisibilityValue xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</ConditionalVisibilityValue> <CustomFieldValuesUrl xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</CustomFieldValuesUrl> <DefaultValue xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data"> <BoolValue>false</BoolValue> <ListValue xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d7p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" /> </ListValue> <NumberValue>0</NumberValue> <StringValue>String</StringValue> <StructValue xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> </DefaultValue> <Description xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Description> <DisableBinding xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</DisableBinding> <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Id> <IsAsync xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</IsAsync> <IsOutput xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</IsOutput> <ListType i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" /> <Name xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Name> <NoEvalTemplate xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</NoEvalTemplate> <PossibleValues xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data"> <d6p1:string>String</d6p1:string> </PossibleValues> <StructType i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" /> <TransitionNameFormat xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</TransitionNameFormat> <Type xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">NotSpecified</Type> <UIHint xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">None</UIHint> <UITab xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</UITab> <Uniqueness xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">NotUnique</Uniqueness> <UserMode xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">Hidden</UserMode> <VoiceOnly xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</VoiceOnly> <d2p1:IsKnob>false</d2p1:IsKnob> <d2p1:IsPublic>false</d2p1:IsPublic> </d2p1:FlowParameter> </d2p1:Parameters> <d2p1:Roles> <d2p1:FlowRoles>UI</d2p1:FlowRoles> </d2p1:Roles> <d2p1:Tags xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Settings"> <d4p1:Tag> <d4p1:Color>Magenta</d4p1:Color> <d4p1:Id>String</d4p1:Id> <d4p1:Name>String</d4p1:Name> </d4p1:Tag> </d2p1:Tags> <d2p1:UI> <d2p1:CanvasX>0</d2p1:CanvasX> <d2p1:CanvasY>0</d2p1:CanvasY> <d2p1:CanvasZoom>0</d2p1:CanvasZoom> <d2p1:SelectedNode>String</d2p1:SelectedNode> </d2p1:UI> </d2p1:FlowInfo> </Items> <TotalCount>0</TotalCount> <TotalPages>0</TotalPages> </ListResponseOfFlowInfoM153aFo_P>