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',
|
|
|
|
])
|
2022-06-16 00:46:52 +12:00
|
|
|
->addRule('$createdAt', [
|
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
'description' => 'Deployment creation date in Unix timestamp.',
|
|
|
|
'default' => 0,
|
|
|
|
'example' => 1592981250,
|
|
|
|
])
|
|
|
|
->addRule('$updatedAt', [
|
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
'description' => 'Deployment update date in Unix timestamp.',
|
|
|
|
'default' => 0,
|
|
|
|
'example' => 1592981250,
|
|
|
|
])
|
2022-01-26 05:51:05 +13:00
|
|
|
->addRule('resourceId', [
|
2020-11-08 11:14:48 +13:00
|
|
|
'type' => self::TYPE_STRING,
|
2022-01-26 05:51:05 +13:00
|
|
|
'description' => 'Resource ID.',
|
2021-01-14 04:06:36 +13:00
|
|
|
'default' => '',
|
2020-10-30 02:07:56 +13:00
|
|
|
'example' => '5e5ea6g16897e',
|
|
|
|
])
|
2022-01-26 05:51:05 +13:00
|
|
|
->addRule('resourceType', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'Resource type.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => 'functions',
|
|
|
|
])
|
2021-09-01 21:48:56 +12:00
|
|
|
->addRule('entrypoint', [
|
2020-11-08 11:14:48 +13:00
|
|
|
'type' => self::TYPE_STRING,
|
2022-01-26 05:51:05 +13:00
|
|
|
'description' => 'The entrypoint file to use to execute the deployment 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
|
|
|
])
|
2021-12-09 04:08:53 +13:00
|
|
|
->addRule('buildId', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'The current build ID.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => '5e5ea5c16897e',
|
|
|
|
])
|
2022-02-15 21:46:21 +13:00
|
|
|
->addRule('activate', [
|
2021-12-09 04:08:53 +13:00
|
|
|
'type' => self::TYPE_BOOLEAN,
|
2022-02-15 21:46:21 +13:00
|
|
|
'description' => 'Whether the deployment should be automatically activated.',
|
2021-12-09 04:08:53 +13:00
|
|
|
'default' => false,
|
|
|
|
'example' => true,
|
|
|
|
])
|
2022-02-01 00:29:31 +13:00
|
|
|
->addRule('status', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'The deployment status.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => 'enabled',
|
|
|
|
])
|
|
|
|
->addRule('buildStdout', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'The build stdout.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => 'enabled',
|
|
|
|
])
|
|
|
|
->addRule('buildStderr', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'The build stderr.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => 'enabled',
|
|
|
|
])
|
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
|
|
|
|
*/
|
2022-05-24 02:54:50 +12:00
|
|
|
public function getName(): string
|
2020-10-30 02:07:56 +13:00
|
|
|
{
|
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
|
|
|
|
*/
|
2022-05-24 02:54:50 +12:00
|
|
|
public function getType(): string
|
2020-10-30 02:07:56 +13:00
|
|
|
{
|
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
|
|
|
}
|