1
0
Fork 0
mirror of synced 2024-05-17 11:12:41 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/UsageProject.php

98 lines
2.9 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', [
'type' => self::TYPE_STRING,
'description' => 'The time range of the usage stats.',
'default' => '',
'example' => '30d',
])
->addRule('requests', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for number of requests.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('network', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for consumed bandwidth.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
2022-08-11 18:05:38 +12:00
->addRule('executions', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for function executions.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('documents', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for number of documents.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('databases', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for number of databases.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('users', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for number of users.',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('storage', [
2022-10-11 23:34:42 +13:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for the occupied storage size (in bytes).',
'default' => [],
2022-10-11 23:34:42 +13:00
'example' => [],
2022-05-24 02:54:50 +12:00
'array' => true
])
->addRule('buckets', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for number of buckets.',
'default' => [],
'example' => [],
'array' => true
])
;
}
/**
* Get Name
2022-05-24 02:54:50 +12:00
*
* @return string
*/
2022-05-24 02:54:50 +12:00
public function getName(): string
{
return 'UsageProject';
}
/**
* Get Type
2022-05-24 02:54:50 +12:00
*
* @return string
*/
2022-05-24 02:54:50 +12:00
public function getType(): string
{
return Response::MODEL_USAGE_PROJECT;
}
2022-05-24 02:54:50 +12:00
}