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' => '',
|
|
|
|
|
'example' => '',
|
|
|
|
|
])
|
2021-08-22 16:36:26 +00:00
|
|
|
->addRule('status', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, or `failed`',
|
|
|
|
|
'default' => '',
|
2021-08-23 20:41:38 +00:00
|
|
|
'example' => 'available',
|
2021-08-22 16:36:26 +00:00
|
|
|
])
|
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
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getName():string
|
|
|
|
|
{
|
|
|
|
|
return 'Index';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Collection
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getType():string
|
|
|
|
|
{
|
|
|
|
|
return Response::MODEL_INDEX;
|
|
|
|
|
}
|
2021-06-30 15:10:45 +00:00
|
|
|
}
|