2021-08-26 18:15:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
2025-05-05 08:23:57 +00:00
|
|
|
class UsageTable extends Model
|
2021-08-26 18:15:36 +00:00
|
|
|
{
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this
|
|
|
|
|
->addRule('range', [
|
2021-08-26 18:44:32 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2023-11-09 10:54:33 +00:00
|
|
|
'description' => 'Time range of the usage stats.',
|
2021-08-26 18:44:32 +00:00
|
|
|
'default' => '',
|
|
|
|
|
'example' => '30d',
|
2021-08-26 18:15:36 +00:00
|
|
|
])
|
2025-05-05 08:23:57 +00:00
|
|
|
->addRule('rowsTotal', [
|
2023-11-01 15:20:12 +00:00
|
|
|
'type' => self::TYPE_INTEGER,
|
2025-05-05 08:23:57 +00:00
|
|
|
'description' => 'Total aggregated number of of rows.',
|
2023-11-01 15:20:12 +00:00
|
|
|
'default' => 0,
|
|
|
|
|
'example' => 0,
|
|
|
|
|
])
|
2025-05-05 08:23:57 +00:00
|
|
|
->addRule('rows', [
|
2023-11-01 15:20:12 +00:00
|
|
|
'type' => Response::MODEL_METRIC,
|
2025-05-05 08:23:57 +00:00
|
|
|
'description' => 'Aggregated number of rows per period.',
|
2021-08-26 18:15:36 +00:00
|
|
|
'default' => [],
|
2022-10-11 10:34:42 +00:00
|
|
|
'example' => [],
|
2022-05-23 14:54:50 +00:00
|
|
|
'array' => true
|
2021-08-26 18:15:36 +00:00
|
|
|
])
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Name
|
2022-05-23 14:54:50 +00:00
|
|
|
*
|
2021-08-26 18:15:36 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getName(): string
|
2021-08-26 18:15:36 +00:00
|
|
|
{
|
2025-05-05 08:23:57 +00:00
|
|
|
return 'UsageTable';
|
2021-08-26 18:15:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-08-27 16:45:08 +00:00
|
|
|
* Get Type
|
2022-05-23 14:54:50 +00:00
|
|
|
*
|
2021-08-26 18:15:36 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getType(): string
|
2021-08-26 18:15:36 +00:00
|
|
|
{
|
2025-05-05 08:23:57 +00:00
|
|
|
return Response::MODEL_USAGE_TABLE;
|
2021-08-26 18:15:36 +00:00
|
|
|
}
|
2022-05-23 14:54:50 +00:00
|
|
|
}
|