<?php declare(strict_types = 0);
class CControllerConnectorUpdate extends CController {
protected function init(): void {
$this->setPostContentType(self::POST_CONTENT_TYPE_JSON);
protected function checkInput(): bool {
'connectorid' => 'required|db connector.connectorid',
'name' => 'required|not_empty|db connector.name',
'protocol' => 'db connector.protocol|in '.ZBX_STREAMING_PROTOCOL_V1,
'data_type' => 'db connector.data_type|in '.implode(',', [ZBX_CONNECTOR_DATA_TYPE_ITEM_VALUES, ZBX_CONNECTOR_DATA_TYPE_EVENTS]),
'url' => 'required|not_empty|db connector.url',
'item_value_types' => 'array',
'authtype' => 'db connector.authtype|in '.implode(',', [ZBX_HTTP_AUTH_NONE, ZBX_HTTP_AUTH_BASIC, ZBX_HTTP_AUTH_NTLM, ZBX_HTTP_AUTH_KERBEROS, ZBX_HTTP_AUTH_DIGEST, ZBX_HTTP_AUTH_BEARER]),
'username' => 'db connector.username',
'password' => 'db connector.password',
'token' => 'db connector.token',
'http_proxy' => 'db connector.http_proxy',
'max_records_mode' => 'in 0,1',
'max_records' => 'db connector.max_records|ge 0',
'max_senders' => 'db connector.max_senders|ge 1|le 100',
'max_attempts' => 'db connector.max_attempts|ge 1|le 5',
'attempt_interval' => 'db connector.attempt_interval',
'timeout' => 'db connector.timeout',
'verify_peer' => 'db connector.verify_peer|in '.implode(',', [ZBX_HTTP_VERIFY_PEER_OFF, ZBX_HTTP_VERIFY_PEER_ON]),
'verify_host' => 'db connector.verify_host|in '.implode(',', [ZBX_HTTP_VERIFY_HOST_OFF, ZBX_HTTP_VERIFY_HOST_ON]),
'ssl_cert_file' => 'db connector.ssl_cert_file',
'ssl_key_file' => 'db connector.ssl_key_file',
'ssl_key_password' => 'db connector.ssl_key_password',
'description' => 'db connector.description',
'status' => 'db connector.status|in '.implode(',', [ZBX_CONNECTOR_STATUS_DISABLED, ZBX_CONNECTOR_STATUS_ENABLED]),
'tags_evaltype' => 'db connector.tags_evaltype|in '.implode(',', [CONDITION_EVAL_TYPE_AND_OR, CONDITION_EVAL_TYPE_OR]),
$ret = $this->validateInput($fields);
'max_records' => 'required',
'max_senders' => 'required',
'max_attempts' => 'required',
'timeout' => 'required|not_empty'
$data_type = $this->getInput('data_type', ZBX_CONNECTOR_DATA_TYPE_ITEM_VALUES);