mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
50 lines
1013 B
PHP
50 lines
1013 B
PHP
<?php
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
use Appwrite\Utopia\Response;
|
|
use Appwrite\Utopia\Response\Model;
|
|
use Utopia\Config\Config;
|
|
|
|
class ProjectProtocol extends Model
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this
|
|
->addRule('$id', [
|
|
'type' => self::TYPE_ENUM,
|
|
'description' => 'Protocol ID.',
|
|
'default' => '',
|
|
'example' => 'graphql',
|
|
'enum' => \array_keys(Config::getParam('protocols', [])),
|
|
])
|
|
->addRule('enabled', [
|
|
'type' => self::TYPE_BOOLEAN,
|
|
'description' => 'Protocol status.',
|
|
'example' => false,
|
|
'default' => true,
|
|
])
|
|
;
|
|
}
|
|
|
|
/**
|
|
* Get Name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName(): string
|
|
{
|
|
return 'ProjectProtocol';
|
|
}
|
|
|
|
/**
|
|
* Get Type
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getType(): string
|
|
{
|
|
return Response::MODEL_PROJECT_PROTOCOL;
|
|
}
|
|
}
|