All Verbs | /ui/autocomplete/values |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class AutoCompleteValue implements JsonSerializable
{
public function __construct(
/** @description Display name */
// @ApiMember(Description="Display name")
/** @var string|null */
public ?string $displayName=null,
/** @description Value */
// @ApiMember(Description="Value")
/** @var string|null */
public ?string $value=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
if (isset($o['value'])) $this->value = $o['value'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
if (isset($this->value)) $o['value'] = $this->value;
return empty($o) ? new class(){} : $o;
}
}
class ListAutoCompleteValuesResponse implements JsonSerializable
{
public function __construct(
/** @var array<AutoCompleteValue>|null */
public ?array $values=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['values'])) $this->values = JsonConverters::fromArray('AutoCompleteValue', $o['values']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->values)) $o['values'] = JsonConverters::toArray('AutoCompleteValue', $this->values);
return empty($o) ? new class(){} : $o;
}
}
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';
}
class ListAutoCompleteValues implements JsonSerializable
{
public function __construct(
/** @description Account ID */
// @ApiMember(Description="Account ID")
/** @var string|null */
public ?string $accountId=null,
/** @description Filter by customer ID */
// @ApiMember(Description="Filter by customer ID")
/** @var string|null */
public ?string $customerId=null,
/** @description The type of value */
// @ApiMember(Description="The type of value")
/** @var ValueTypes|null */
public ?ValueTypes $type=null,
/** @description The query text to search for */
// @ApiMember(Description="The query text to search for")
/** @var string|null */
public ?string $query=null,
/** @description Type specific filter */
// @ApiMember(Description="Type specific filter")
/** @var string|null */
public ?string $typeSpecificFilter=null,
/** @description The value to search for (will only return one result) */
// @ApiMember(Description="The value to search for (will only return one result)")
/** @var string|null */
public ?string $value=null,
/** @description Should the results be sent back in plain text or with embedded HTML? */
// @ApiMember(Description="Should the results be sent back in plain text or with embedded HTML?")
/** @var bool|null */
public ?bool $plainText=null,
/** @description Include full info? */
// @ApiMember(Description="Include full info?")
/** @var bool|null */
public ?bool $fullInfo=null,
/** @description List all values, only use for small lists. */
// @ApiMember(Description="List all values, only use for small lists.")
/** @var bool|null */
public ?bool $all=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
if (isset($o['customerId'])) $this->customerId = $o['customerId'];
if (isset($o['type'])) $this->type = JsonConverters::from('ValueTypes', $o['type']);
if (isset($o['query'])) $this->query = $o['query'];
if (isset($o['typeSpecificFilter'])) $this->typeSpecificFilter = $o['typeSpecificFilter'];
if (isset($o['value'])) $this->value = $o['value'];
if (isset($o['plainText'])) $this->plainText = $o['plainText'];
if (isset($o['fullInfo'])) $this->fullInfo = $o['fullInfo'];
if (isset($o['all'])) $this->all = $o['all'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
if (isset($this->customerId)) $o['customerId'] = $this->customerId;
if (isset($this->type)) $o['type'] = JsonConverters::to('ValueTypes', $this->type);
if (isset($this->query)) $o['query'] = $this->query;
if (isset($this->typeSpecificFilter)) $o['typeSpecificFilter'] = $this->typeSpecificFilter;
if (isset($this->value)) $o['value'] = $this->value;
if (isset($this->plainText)) $o['plainText'] = $this->plainText;
if (isset($this->fullInfo)) $o['fullInfo'] = $this->fullInfo;
if (isset($this->all)) $o['all'] = $this->all;
return empty($o) ? new class(){} : $o;
}
}
PHP ListAutoCompleteValues DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /ui/autocomplete/values HTTP/1.1
Host: team.evovoice.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"accountId":"String","customerId":"String","type":"NotSpecified","query":"String","typeSpecificFilter":"String","value":"String","plainText":false,"fullInfo":false,"all":false}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"values":[{"displayName":"String","value":"String"}]}