appwrite/src/Appwrite/Utopia/Response/Model/DetectionRuntime.php

58 lines
1.3 KiB
PHP
Raw Normal View History

2023-06-13 18:44:44 +00:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
2025-11-14 14:49:19 +00:00
class DetectionRuntime extends Detection
2023-06-13 18:44:44 +00:00
{
public function __construct()
{
$this->conditions = [
'type' => 'runtime',
];
parent::__construct('runtime');
2025-11-14 14:49:19 +00:00
2023-06-13 18:44:44 +00:00
$this
->addRule('runtime', [
'type' => self::TYPE_STRING,
'description' => 'Runtime',
'default' => '',
'example' => 'node',
2025-02-06 18:29:43 +00:00
])
->addRule('entrypoint', [
'type' => self::TYPE_STRING,
'description' => 'Function Entrypoint',
'default' => '',
'example' => 'index.js',
])
->addRule('commands', [
'type' => self::TYPE_STRING,
'description' => 'Function install and build commands',
'default' => '',
'example' => 'npm install && npm run build',
2023-06-13 18:44:44 +00:00
]);
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
2025-03-08 15:50:39 +00:00
return 'DetectionRuntime';
2023-06-13 18:44:44 +00:00
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
2025-03-08 15:50:39 +00:00
return Response::MODEL_DETECTION_RUNTIME;
2023-06-13 18:44:44 +00:00
}
}