Evo Voice

<back to all web services

AppUpdateSystemSettings

Requires Authentication
The following routes are available for this service:
PATCH/portal/system-settings
<?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 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';
}

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

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

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

class EndpointDataField 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 $showInSearch=null,
        /** @var bool|null */
        public ?bool $showInLists=null,
        /** @var EndpointTypes|null */
        public ?EndpointTypes $endpointType=null,
        /** @var bool|null */
        public ?bool $isCallerId=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['showInSearch'])) $this->showInSearch = $o['showInSearch'];
        if (isset($o['showInLists'])) $this->showInLists = $o['showInLists'];
        if (isset($o['endpointType'])) $this->endpointType = JsonConverters::from('EndpointTypes', $o['endpointType']);
        if (isset($o['isCallerId'])) $this->isCallerId = $o['isCallerId'];
        if (isset($o['isKnob'])) $this->isKnob = $o['isKnob'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->showInSearch)) $o['showInSearch'] = $this->showInSearch;
        if (isset($this->showInLists)) $o['showInLists'] = $this->showInLists;
        if (isset($this->endpointType)) $o['endpointType'] = JsonConverters::to('EndpointTypes', $this->endpointType);
        if (isset($this->isCallerId)) $o['isCallerId'] = $this->isCallerId;
        if (isset($this->isKnob)) $o['isKnob'] = $this->isKnob;
        return empty($o) ? new class(){} : $o;
    }
}

class AppSystemSettingsInfo implements JsonSerializable
{
    public function __construct(
        /** @var array<EndpointDataField>|null */
        public ?array $endpointFields=null,
        /** @description Is this customer a HostedSuite customer? */
        // @ApiMember(Description="Is this customer a HostedSuite customer?")
        /** @var bool|null */
        public ?bool $isHostedSuiteCustomer=null,

        /** @description The customer's time zone */
        // @ApiMember(Description="The customer's time zone")
        /** @var string|null */
        public ?string $customerTimeZoneId=null
    ) {
    }

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

class AppUpdateSystemSettings implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $accountId=null,
        /** @var string|null */
        public ?string $customerId=null,
        /** @var string|null */
        public ?string $customerTimeZoneId=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['customerTimeZoneId'])) $this->customerTimeZoneId = $o['customerTimeZoneId'];
    }
    
    /** @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->customerTimeZoneId)) $o['customerTimeZoneId'] = $this->customerTimeZoneId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP AppUpdateSystemSettings DTOs

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

HTTP + OTHER

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

PATCH /portal/system-settings HTTP/1.1 
Host: team.evovoice.io 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"accountId":"String","customerId":"String","customerTimeZoneId":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"endpointFields":[{"showInSearch":false,"showInLists":false,"endpointType":"PhoneNumber","isCallerId":false,"isKnob":false,"id":"String","name":"String","type":"NotSpecified","uiHint":"None","uiTab":"String","isAsync":false,"disableBinding":false,"description":"String","possibleValues":["String"],"isOutput":false,"customFieldValuesUrl":"String","defaultValue":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]},"transitionNameFormat":"String","uniqueness":"NotUnique","voiceOnly":false,"conditionalVisibilityField":"String","conditionalVisibilityValue":"String","noEvalTemplate":false,"userMode":"Hidden","anyValueType":false}],"isHostedSuiteCustomer":false,"customerTimeZoneId":"String"}