2021-06-08 19:30:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
class Index extends Model
|
|
|
|
|
{
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this
|
2021-08-22 16:36:26 +00:00
|
|
|
->addRule('key', [
|
2021-06-08 19:30:42 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2021-08-22 16:36:26 +00:00
|
|
|
'description' => 'Index Key.',
|
2021-06-08 19:30:42 +00:00
|
|
|
'default' => '',
|
2021-08-22 16:36:26 +00:00
|
|
|
'example' => 'index1',
|
2021-06-08 19:30:42 +00:00
|
|
|
])
|
|
|
|
|
->addRule('type', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Index type.',
|
|
|
|
|
'default' => '',
|
2022-01-04 11:44:28 +00:00
|
|
|
'example' => 'primary',
|
2021-06-08 19:30:42 +00:00
|
|
|
])
|
2021-08-22 16:36:26 +00:00
|
|
|
->addRule('status', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
2021-10-05 00:23:15 +00:00
|
|
|
'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`',
|
2021-08-22 16:36:26 +00:00
|
|
|
'default' => '',
|
2021-08-23 20:41:38 +00:00
|
|
|
'example' => 'available',
|
2021-08-22 16:36:26 +00:00
|
|
|
])
|
2022-10-25 17:37:07 +00:00
|
|
|
->addRule('error', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
2022-11-07 19:38:06 +00:00
|
|
|
'description' => 'Error message. Displays error generated on failure of creating or deleting an index.',
|
2022-10-25 17:37:07 +00:00
|
|
|
'default' => '',
|
|
|
|
|
'example' => 'string',
|
|
|
|
|
])
|
2021-06-08 19:30:42 +00:00
|
|
|
->addRule('attributes', [
|
2021-06-09 21:10:19 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2021-06-08 19:30:42 +00:00
|
|
|
'description' => 'Index attributes.',
|
|
|
|
|
'default' => [],
|
|
|
|
|
'example' => [],
|
2021-06-09 21:10:19 +00:00
|
|
|
'array' => true,
|
2021-06-08 19:30:42 +00:00
|
|
|
])
|
|
|
|
|
->addRule('orders', [
|
2021-06-09 21:10:19 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2021-06-08 19:30:42 +00:00
|
|
|
'description' => 'Index orders.',
|
|
|
|
|
'default' => [],
|
|
|
|
|
'example' => [],
|
2021-06-09 21:10:19 +00:00
|
|
|
'array' => true,
|
|
|
|
|
'required' => false,
|
2021-06-08 19:30:42 +00:00
|
|
|
])
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Name
|
2022-05-23 14:54:50 +00:00
|
|
|
*
|
2021-06-08 19:30:42 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getName(): string
|
2021-06-08 19:30:42 +00:00
|
|
|
{
|
|
|
|
|
return 'Index';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Collection
|
2022-05-23 14:54:50 +00:00
|
|
|
*
|
2021-06-08 19:30:42 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getType(): string
|
2021-06-08 19:30:42 +00:00
|
|
|
{
|
|
|
|
|
return Response::MODEL_INDEX;
|
|
|
|
|
}
|
2021-06-30 15:10:45 +00:00
|
|
|
}
|