appwrite/src/Appwrite/Utopia/Response/Model/Variable.php

73 lines
1.9 KiB
PHP
Raw Normal View History

2022-07-20 07:18:49 +00:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Variable extends Model
{
public function __construct()
{
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
2022-08-09 12:13:46 +00:00
'description' => 'Variable ID.',
2022-07-20 07:18:49 +00:00
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
2022-08-24 15:07:18 +00:00
'type' => self::TYPE_DATETIME,
2022-09-04 21:26:16 +00:00
'description' => 'Variable creation date in ISO 8601 format.',
2022-08-24 15:07:18 +00:00
'default' => '',
'example' => self::TYPE_DATETIME_EXAMPLE,
2022-07-20 07:18:49 +00:00
])
->addRule('$updatedAt', [
2022-08-24 15:07:18 +00:00
'type' => self::TYPE_DATETIME,
2022-09-04 21:26:16 +00:00
'description' => 'Variable creation date in ISO 8601 format.',
2022-08-24 15:07:18 +00:00
'default' => '',
'example' => self::TYPE_DATETIME_EXAMPLE,
2022-07-20 07:18:49 +00:00
])
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Variable key.',
'default' => '',
'example' => 'API_KEY',
'array' => false,
])
->addRule('value', [
'type' => self::TYPE_STRING,
'description' => 'Variable value.',
'default' => '',
'example' => 'myPa$$word1',
])
->addRule('functionId', [
'type' => self::TYPE_STRING,
2022-08-09 12:13:46 +00:00
'description' => 'Function ID.',
2022-07-20 07:18:49 +00:00
'default' => '',
'example' => '5e5ea5c16897e',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'Variable';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_VARIABLE;
}
}