Evo Voice

<back to all web services

ListSettingsObjects

Get all configurable settings objects for the authenticated user

Requires Authentication
Required role:User
The following routes are available for this service:
GET/app/settings-objects
<?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 SettingsObjectTypes : string
{
    case Endpoint = 'Endpoint';
    case Customer = 'Customer';
}

enum EndpointTypes : string
{
    case PhoneNumber = 'PhoneNumber';
    case User = 'User';
    case FaxNumber = 'FaxNumber';
    case EmailAddress = 'EmailAddress';
    case Unused_1 = 'Unused_1';
    case Unused_2 = 'Unused_2';
    case Unused_3 = 'Unused_3';
    case Unused_4 = 'Unused_4';
    case Unused_5 = 'Unused_5';
    case Team = 'Team';
    case Assistant = 'Assistant';
}

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';
}

/**
 * @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;
    }
}

class SettingsPossibleValue implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $displayName=null,
        /** @var Value|null */
        public ?Value $value=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['value'])) $this->value = JsonConverters::from('Value', $o['value']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->value)) $o['value'] = JsonConverters::to('Value', $this->value);
        return empty($o) ? new class(){} : $o;
    }
}

enum UIHints : string
{
    case None = 'None';
    case LargeText = 'LargeText';
    case InlineForm = 'InlineForm';
    case Password = 'Password';
    case InlineStruct = 'InlineStruct';
}

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 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 SettingsField implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $displayName=null,
        /** @var ValueTypes|null */
        public ?ValueTypes $type=null,
        /** @var Value|null */
        public ?Value $value=null,
        /** @var bool|null */
        public ?bool $readOnly=null,
        /** @var array<SettingsPossibleValue>|null */
        public ?array $possibleValues=null,
        /** @var DataField|null */
        public ?DataField $dataField=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['displayName'])) $this->displayName = $o['displayName'];
        if (isset($o['type'])) $this->type = JsonConverters::from('ValueTypes', $o['type']);
        if (isset($o['value'])) $this->value = JsonConverters::from('Value', $o['value']);
        if (isset($o['readOnly'])) $this->readOnly = $o['readOnly'];
        if (isset($o['possibleValues'])) $this->possibleValues = JsonConverters::fromArray('SettingsPossibleValue', $o['possibleValues']);
        if (isset($o['dataField'])) $this->dataField = JsonConverters::from('DataField', $o['dataField']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->displayName)) $o['displayName'] = $this->displayName;
        if (isset($this->type)) $o['type'] = JsonConverters::to('ValueTypes', $this->type);
        if (isset($this->value)) $o['value'] = JsonConverters::to('Value', $this->value);
        if (isset($this->readOnly)) $o['readOnly'] = $this->readOnly;
        if (isset($this->possibleValues)) $o['possibleValues'] = JsonConverters::toArray('SettingsPossibleValue', $this->possibleValues);
        if (isset($this->dataField)) $o['dataField'] = JsonConverters::to('DataField', $this->dataField);
        return empty($o) ? new class(){} : $o;
    }
}

class SettingsObject implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var bool|null */
        public ?bool $readOnly=null,
        /** @var SettingsObjectTypes|null */
        public ?SettingsObjectTypes $type=null,
        /** @var EndpointTypes|null */
        public ?EndpointTypes $endpointType=null,
        /** @var array<SettingsField>|null */
        public ?array $fields=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['description'])) $this->description = $o['description'];
        if (isset($o['readOnly'])) $this->readOnly = $o['readOnly'];
        if (isset($o['type'])) $this->type = JsonConverters::from('SettingsObjectTypes', $o['type']);
        if (isset($o['endpointType'])) $this->endpointType = JsonConverters::from('EndpointTypes', $o['endpointType']);
        if (isset($o['fields'])) $this->fields = JsonConverters::fromArray('SettingsField', $o['fields']);
    }
    
    /** @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->description)) $o['description'] = $this->description;
        if (isset($this->readOnly)) $o['readOnly'] = $this->readOnly;
        if (isset($this->type)) $o['type'] = JsonConverters::to('SettingsObjectTypes', $this->type);
        if (isset($this->endpointType)) $o['endpointType'] = JsonConverters::to('EndpointTypes', $this->endpointType);
        if (isset($this->fields)) $o['fields'] = JsonConverters::toArray('SettingsField', $this->fields);
        return empty($o) ? new class(){} : $o;
    }
}

class ListSettingsObjectsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<SettingsObject>|null */
        public ?array $settingsObjects=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['settingsObjects'])) $this->settingsObjects = JsonConverters::fromArray('SettingsObject', $o['settingsObjects']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->settingsObjects)) $o['settingsObjects'] = JsonConverters::toArray('SettingsObject', $this->settingsObjects);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Get all configurable settings objects for the authenticated user */
// @Api(Description="Get all configurable settings objects for the authenticated user")
class ListSettingsObjects implements IGet, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP ListSettingsObjects DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /app/settings-objects HTTP/1.1 
Host: team.evovoice.io 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"settingsObjects":[{"id":"String","name":"String","description":"String","readOnly":false,"type":"Endpoint","endpointType":"PhoneNumber","fields":[{"name":"String","displayName":"String","type":"NotSpecified","value":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"readOnly":false,"possibleValues":[{"displayName":"String","value":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}]}]}]}