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

92 lines
2.8 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageProject extends Model
{
public function __construct()
{
$this
->addRule('range', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
'description' => 'The time range of the usage stats.',
'default' => '',
'example' => '30d',
])
2023-10-25 09:46:45 +00:00
->addRule('executionsTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total function executions.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('documentsTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total number of documents.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('databasesTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total number of databases.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('usersTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total number of users.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-11-08 09:09:32 +00:00
->addRule('filesStorageTotal', [
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total occupied storage size (in bytes).',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('bucketsTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-08 16:12:36 +00:00
'description' => 'Aggregated statistics of total number of buckets.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-11-08 16:12:36 +00:00
->addRule('requests', [
'type' => self::TYPE_INTEGER,
'description' => 'Aggregated statistics of number of requests per period.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('network', [
'type' => self::TYPE_INTEGER,
'description' => 'Aggregated statistics of consumed bandwidth per period.',
'default' => [],
'example' => [],
'array' => true
])
;
}
/**
* 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 'UsageProject';
}
/**
* Get Type
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_USAGE_PROJECT;
}
2022-05-23 14:54:50 +00:00
}