1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Tag.php

101 lines
3.1 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Tag extends Model
{
public function __construct()
{
$this
->addRule('$id', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
'description' => 'Tag ID.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('functionId', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
'description' => 'Function ID.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => '5e5ea6g16897e',
])
->addRule('dateCreated', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_INTEGER,
'description' => 'The tag creation date in Unix timestamp.',
2021-01-14 04:06:36 +13:00
'default' => 0,
'example' => 1592981250,
])
2021-09-01 21:48:56 +12:00
->addRule('entrypoint', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
2021-09-01 21:48:56 +12:00
'description' => 'The entrypoint file to use to execute the tag code.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => 'enabled',
])
->addRule('size', [
'type' => self::TYPE_INTEGER,
'description' => 'The code size in bytes.',
'default' => 0,
'example' => 128,
])
2022-01-11 03:01:50 +13:00
// Build Status
// Failed - The tag build has failed. More details can usually be found in buildStderr
// Ready - The tag build was successful and the tag is ready to be deployed
// Processing - The tag is currently waiting to have a build triggered
// Building - The tag is currently being built
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'The tags current built status',
'default' => '',
'example' => 'ready',
])
->addRule('buildId', [
'type' => self::TYPE_STRING,
'description' => 'The current build ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('buildStdout', [
'type' => self::TYPE_STRING,
'description' => 'The stdout of the build.',
'default' => '',
'example' => '',
])
->addRule('buildStderr', [
'type' => self::TYPE_STRING,
'description' => 'The stderr of the build.',
'default' => '',
'example' => '',
])
->addRule('automaticDeploy', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Whether the tag should be automatically deployed.',
'default' => false,
'example' => true,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Tag';
}
/**
2021-12-15 23:19:29 +13:00
* Get Type
*
* @return string
*/
public function getType():string
{
return Response::MODEL_TAG;
}
}