appwrite/src/Appwrite/Utopia/Response/Model/Execution.php
Jake Barnby 7019be987c Merge remote-tracking branch 'origin/0.16.x' into origin/datetime-attributes
# Conflicts:
#	app/config/specs/open-api3-latest-client.json
#	app/config/specs/open-api3-latest-console.json
#	app/config/specs/open-api3-latest-server.json
#	app/config/specs/swagger2-latest-client.json
#	app/config/specs/swagger2-latest-console.json
#	app/config/specs/swagger2-latest-server.json
#	app/controllers/api/account.php
#	app/controllers/api/users.php
#	app/controllers/shared/api.php
#	app/workers/deletes.php
#	composer.lock
#	docker-compose.yml
#	phpunit.xml
#	src/Appwrite/Event/Delete.php
2022-08-19 16:20:19 +12:00

108 lines
3.8 KiB
PHP

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Execution extends Model
{
public function __construct()
{
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Execution ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_DATETIME,
'description' => 'Execution creation date in Datetime',
'default' => '',
'example' => self::TYPE_DATETIME_EXAMPLE,
])
->addRule('$updatedAt', [
'type' => self::TYPE_DATETIME,
'description' => 'Execution upate date in Datetime',
'default' => '',
'example' => self::TYPE_DATETIME_EXAMPLE,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'Execution read permissions.',
'default' => '',
'example' => 'role:all',
'array' => true,
])
->addRule('functionId', [
'type' => self::TYPE_STRING,
'description' => 'Function ID.',
'default' => '',
'example' => '5e5ea6g16897e',
])
->addRule('trigger', [
'type' => self::TYPE_STRING,
'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.',
'default' => '',
'example' => 'http',
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.',
'default' => '',
'example' => 'processing',
])
->addRule('statusCode', [
'type' => self::TYPE_INTEGER,
'description' => 'The script status code.',
'default' => 0,
'example' => 0,
])
->addRule('response', [
'type' => self::TYPE_STRING,
'description' => 'The script response output string. Logs the last 4,000 characters of the execution response output.',
'default' => '',
'example' => '',
])
->addRule('stdout', [
'type' => self::TYPE_STRING,
'description' => 'The script stdout output string. Logs the last 4,000 characters of the execution stdout output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.',
'default' => '',
'example' => '',
])
->addRule('stderr', [
'type' => self::TYPE_STRING,
'description' => 'The script stderr output string. Logs the last 4,000 characters of the execution stderr output. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.',
'default' => '',
'example' => '',
])
->addRule('time', [
'type' => self::TYPE_FLOAT,
'description' => 'The script execution time in seconds.',
'default' => 0,
'example' => 0.400,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'Execution';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_EXECUTION;
}
}