1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Error.php

54 lines
1.1 KiB
PHP
Raw Normal View History

2020-06-24 03:01:20 +12:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Error extends Model
{
public function __construct()
{
$this
->addRule('message', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
2020-06-24 03:01:20 +12:00
'description' => 'Error message.',
2021-01-14 04:06:36 +13:00
'default' => '',
2020-06-24 03:01:20 +12:00
'example' => 'Not found',
])
->addRule('code', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
2020-06-24 03:01:20 +12:00
'description' => 'Error code.',
2021-01-14 04:06:36 +13:00
'default' => '',
2020-06-24 03:01:20 +12:00
'example' => '404',
])
->addRule('version', [
2020-11-08 11:14:48 +13:00
'type' => self::TYPE_STRING,
2020-06-24 03:01:20 +12:00
'description' => 'Server version number.',
2021-01-14 04:06:36 +13:00
'default' => '',
'example' => '1.0',
2020-06-24 03:01:20 +12:00
])
;
}
/**
* Get Name
*
2020-06-24 03:01:20 +12:00
* @return string
*/
public function getName():string
{
return 'Error';
}
/**
2021-12-15 23:19:29 +13:00
* Get Type
*
2020-06-24 03:01:20 +12:00
* @return string
*/
public function getType():string
{
return Response::MODEL_ERROR;
}
}