openstatus.monitor.v1.GetMonitorSummaryRequest
*/
class GetMonitorSummaryRequest extends \Google\Protobuf\Internal\Message
{
/**
* Monitor ID to get summary for (required).
*
* Generated from protobuf field string id = 1 [json_name = "id", (.buf.validate.field) = {
*/
protected $id = '';
/**
* Time range for metrics aggregation (defaults to 1 day if unspecified).
*
* Generated from protobuf field .openstatus.monitor.v1.TimeRange time_range = 2 [json_name = "timeRange"];
*/
protected $time_range = 0;
/**
* Optional filter by regions. If empty, returns metrics for all regions.
*
* Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 3 [json_name = "regions", (.buf.validate.field) = {
*/
private $regions;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $id
* Monitor ID to get summary for (required).
* @type int $time_range
* Time range for metrics aggregation (defaults to 1 day if unspecified).
* @type int[] $regions
* Optional filter by regions. If empty, returns metrics for all regions.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Openstatus\Monitor\V1\Service::initOnce();
parent::__construct($data);
}
/**
* Monitor ID to get summary for (required).
*
* Generated from protobuf field string id = 1 [json_name = "id", (.buf.validate.field) = {
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* Monitor ID to get summary for (required).
*
* Generated from protobuf field string id = 1 [json_name = "id", (.buf.validate.field) = {
* @param string $var
* @return $this
*/
public function setId(string $var)
{
GPBUtil::checkString($var, true);
$this->id = $var;
return $this;
}
/**
* Time range for metrics aggregation (defaults to 1 day if unspecified).
*
* Generated from protobuf field .openstatus.monitor.v1.TimeRange time_range = 2 [json_name = "timeRange"];
* @return int one of the values in {@see \Openstatus\Monitor\V1\TimeRange}
*/
public function getTimeRange()
{
return $this->time_range;
}
/**
* Time range for metrics aggregation (defaults to 1 day if unspecified).
*
* Generated from protobuf field .openstatus.monitor.v1.TimeRange time_range = 2 [json_name = "timeRange"];
* @param int $var one of the values in {@see \Openstatus\Monitor\V1\TimeRange}
* @return $this
*/
public function setTimeRange(int $var)
{
GPBUtil::checkEnum($var, \Openstatus\Monitor\V1\TimeRange::class);
$this->time_range = $var;
return $this;
}
/**
* Optional filter by regions. If empty, returns metrics for all regions.
*
* Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 3 [json_name = "regions", (.buf.validate.field) = {
* @return RepeatedField one of the values in {@see \Openstatus\Monitor\V1\Region}
*/
public function getRegions()
{
return $this->regions;
}
/**
* Optional filter by regions. If empty, returns metrics for all regions.
*
* Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 3 [json_name = "regions", (.buf.validate.field) = {
* @param int[] $var one of the values in {@see \Openstatus\Monitor\V1\Region}
* @return $this
*/
public function setRegions(array|RepeatedField $var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Openstatus\Monitor\V1\Region::class);
$this->regions = $arr;
return $this;
}
}