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

75 lines
2 KiB
PHP
Raw Normal View History

<?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', [
'type' => self::TYPE_STRING,
2021-08-22 16:36:26 +00:00
'description' => 'Index Key.',
'default' => '',
2021-08-22 16:36:26 +00:00
'example' => 'index1',
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Index type.',
'default' => '',
'example' => 'primary',
])
2021-08-22 16:36:26 +00:00
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`',
2021-08-22 16:36:26 +00:00
'default' => '',
'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',
])
->addRule('attributes', [
2021-06-09 21:10:19 +00:00
'type' => self::TYPE_STRING,
'description' => 'Index attributes.',
'default' => [],
'example' => [],
2021-06-09 21:10:19 +00:00
'array' => true,
])
->addRule('orders', [
2021-06-09 21:10:19 +00:00
'type' => self::TYPE_STRING,
'description' => 'Index orders.',
'default' => [],
'example' => [],
2021-06-09 21:10:19 +00:00
'array' => true,
'required' => false,
])
;
}
/**
* Get Name
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'Index';
}
/**
* Get Collection
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getType(): string
{
return Response::MODEL_INDEX;
}
}