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