1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Index.php
2022-05-23 14:54:50 +00:00

69 lines
1.7 KiB
PHP

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Index extends Model
{
public function __construct()
{
$this
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Index Key.',
'default' => '',
'example' => 'index1',
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Index type.',
'default' => '',
'example' => 'primary',
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`',
'default' => '',
'example' => 'available',
])
->addRule('attributes', [
'type' => self::TYPE_STRING,
'description' => 'Index attributes.',
'default' => [],
'example' => [],
'array' => true,
])
->addRule('orders', [
'type' => self::TYPE_STRING,
'description' => 'Index orders.',
'default' => [],
'example' => [],
'array' => true,
'required' => false,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'Index';
}
/**
* Get Collection
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_INDEX;
}
}