2021-08-27 06:44:32 +12:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
2021-08-28 04:45:08 +12:00
|
|
|
class UsageBuckets extends Model
|
2021-08-27 06:44:32 +12:00
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this
|
|
|
|
->addRule('range', [
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
'description' => 'The time range of the usage stats.',
|
|
|
|
'default' => '',
|
|
|
|
'example' => '30d',
|
|
|
|
])
|
2021-11-09 19:07:01 +13:00
|
|
|
->addRule('filesCount', [
|
2021-08-29 20:54:50 +12:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for total number of files in this bucket.',
|
|
|
|
'default' => [],
|
2021-10-06 04:39:39 +13:00
|
|
|
'example' => new \stdClass,
|
2021-08-29 20:54:50 +12:00
|
|
|
'array' => true
|
|
|
|
])
|
2021-11-10 00:34:16 +13:00
|
|
|
->addRule('filesStorage', [
|
2021-11-09 19:07:01 +13:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for total storage of files in this bucket.',
|
|
|
|
'default' => [],
|
|
|
|
'example' => new \stdClass,
|
|
|
|
'array' => true
|
|
|
|
])
|
|
|
|
->addRule('filesCreate', [
|
2021-08-27 06:44:32 +12:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for files created.',
|
|
|
|
'default' => [],
|
2021-10-06 04:39:39 +13:00
|
|
|
'example' => new \stdClass,
|
2021-08-27 06:44:32 +12:00
|
|
|
'array' => true
|
|
|
|
])
|
2021-11-09 19:07:01 +13:00
|
|
|
->addRule('filesRead', [
|
2021-08-27 06:44:32 +12:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for files read.',
|
|
|
|
'default' => [],
|
2021-10-06 04:39:39 +13:00
|
|
|
'example' => new \stdClass,
|
2021-08-27 06:44:32 +12:00
|
|
|
'array' => true
|
|
|
|
])
|
2021-11-09 19:07:01 +13:00
|
|
|
->addRule('filesUpdate', [
|
2021-08-27 06:44:32 +12:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for files updated.',
|
|
|
|
'default' => [],
|
2021-10-06 04:39:39 +13:00
|
|
|
'example' => new \stdClass,
|
2021-08-27 06:44:32 +12:00
|
|
|
'array' => true
|
|
|
|
])
|
2021-11-09 19:07:01 +13:00
|
|
|
->addRule('filesDelete', [
|
2021-08-27 06:44:32 +12:00
|
|
|
'type' => Response::MODEL_METRIC_LIST,
|
|
|
|
'description' => 'Aggregated stats for files deleted.',
|
|
|
|
'default' => [],
|
2021-10-06 04:39:39 +13:00
|
|
|
'example' => new \stdClass,
|
2021-08-27 06:44:32 +12:00
|
|
|
'array' => true
|
|
|
|
])
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Name
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getName():string
|
|
|
|
{
|
2021-08-28 04:45:08 +12:00
|
|
|
return 'UsageBuckets';
|
2021-08-27 06:44:32 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2021-08-28 04:45:08 +12:00
|
|
|
* Get Type
|
2021-08-27 06:44:32 +12:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getType():string
|
|
|
|
{
|
2021-08-28 04:45:08 +12:00
|
|
|
return Response::MODEL_USAGE_BUCKETS;
|
2021-08-27 06:44:32 +12:00
|
|
|
}
|
|
|
|
}
|