Evo Voice

<back to all web services

ListAutoCompleteValues

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<ListAutoCompleteValues xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.UI">
  <AccountId>String</AccountId>
  <All>false</All>
  <CustomerId>String</CustomerId>
  <FullInfo>false</FullInfo>
  <PlainText>false</PlainText>
  <Query>String</Query>
  <Type>NotSpecified</Type>
  <TypeSpecificFilter>String</TypeSpecificFilter>
  <Value>String</Value>
</ListAutoCompleteValues>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ListAutoCompleteValuesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.UI">
  <Values>
    <AutoCompleteValue>
      <DisplayName>String</DisplayName>
      <Value>String</Value>
    </AutoCompleteValue>
  </Values>
</ListAutoCompleteValuesResponse>