1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Deployment.php

114 lines
3.6 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Deployment extends Model
{
public function __construct()
{
$this
->addRule('$id', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
'description' => 'Deployment ID.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
2022-07-04 21:55:11 +12:00
'type' => self::TYPE_DATETIME,
2022-09-05 09:26:16 +12:00
'description' => 'Deployment creation date in ISO 8601 format.',
2022-07-04 21:55:11 +12:00
'default' => '',
2022-08-14 22:27:07 +12:00
'example' => self::TYPE_DATETIME_EXAMPLE,
])
->addRule('$updatedAt', [
2022-07-04 21:55:11 +12:00
'type' => self::TYPE_DATETIME,
2022-09-05 09:26:16 +12:00
'description' => 'Deployment update date in ISO 8601 format.',
2022-07-04 21:55:11 +12:00
'default' => '',
2022-08-14 22:27:07 +12:00
'example' => self::TYPE_DATETIME_EXAMPLE,
])
->addRule('resourceId', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
'description' => 'Resource ID.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => '5e5ea6g16897e',
])
->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,
'description' => 'The entrypoint file to use to execute the deployment 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,
])
->addRule('buildId', [
'type' => self::TYPE_STRING,
'description' => 'The current build ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
2022-02-15 21:46:21 +13:00
->addRule('activate', [
'type' => self::TYPE_BOOLEAN,
2022-02-15 21:46:21 +13:00
'description' => 'Whether the deployment should be automatically activated.',
'default' => false,
'example' => true,
])
2022-02-01 00:29:31 +13:00
->addRule('status', [
'type' => self::TYPE_STRING,
2022-08-05 05:51:57 +12:00
'description' => 'The deployment status. Possible values are "processing", "building", "pending", "ready", and "failed".',
2022-02-01 00:29:31 +13:00
'default' => '',
2022-08-09 02:45:45 +12:00
'example' => 'ready',
2022-02-01 00:29:31 +13:00
])
->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',
])
2022-10-11 04:24:40 +13:00
->addRule('buildTime', [
'type' => self::TYPE_INTEGER,
'description' => 'The current build time in seconds.',
'default' => 0,
'example' => 128,
])
;
}
/**
* Get Name
*
* @return string
*/
2022-05-24 02:54:50 +12:00
public function getName(): string
{
return 'Deployment';
}
/**
2021-12-15 23:19:29 +13:00
* Get Type
*
* @return string
*/
2022-05-24 02:54:50 +12:00
public function getType(): string
{
return Response::MODEL_DEPLOYMENT;
}
}