1
0
Fork 0
mirror of synced 2024-09-21 12:01:56 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/UsageBuckets.php

84 lines
2.5 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageBuckets extends Model
{
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', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for total number of files in this bucket.',
'default' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'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' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'array' => true
2021-11-09 19:07:01 +13:00
])
->addRule('filesCreate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for files created.',
'default' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'array' => true
])
2021-11-09 19:07:01 +13:00
->addRule('filesRead', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for files read.',
'default' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'array' => true
])
2021-11-09 19:07:01 +13:00
->addRule('filesUpdate', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for files updated.',
'default' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'array' => true
])
2021-11-09 19:07:01 +13:00
->addRule('filesDelete', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for files deleted.',
'default' => [],
2022-05-24 02:54:50 +12:00
'example' => new \stdClass(),
'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 'UsageBuckets';
}
/**
* 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_BUCKETS;
}
2022-05-24 02:54:50 +12:00
}