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

69 lines
1.7 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' => '',
])
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' => '',
'example' => 'available',
2021-08-22 16:36:26 +00:00
])
->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
*
* @return string
*/
public function getName():string
{
return 'Index';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_INDEX;
}
}