1
0
Fork 0
mirror of synced 2024-09-21 20:11:15 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/UsageDatabase.php

111 lines
3.7 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageDatabase extends Model
{
public function __construct()
{
$this
->addRule('range', [
'type' => self::TYPE_STRING,
'description' => 'The time range of the usage stats.',
'default' => '',
'example' => '30d',
])
2021-10-27 02:19:28 +13:00
->addRule('documentsCount', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for total number of documents.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('collectionsCount', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for total number of collections.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('documentsCreate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for documents created.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('documentsRead', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for documents read.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('documentsUpdate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for documents updated.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('documentsDelete', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for documents deleted.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('collectionsCreate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for collections created.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('collectionsRead', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for collections read.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('collectionsUpdate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for collections updated.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
2021-10-27 02:19:28 +13:00
->addRule('collectionsDelete', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for collections delete.',
'default' => [],
2021-10-06 04:39:39 +13:00
'example' => new \stdClass,
'array' => true
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'UsageDatabase';
}
/**
* Get Type
*
* @return string
*/
public function getType():string
{
return Response::MODEL_USAGE_DATABASE;
}
}