openstatus.monitor.v1.TCPMonitor */ class TCPMonitor extends \Google\Protobuf\Internal\Message { /** * Unique identifier for the monitor (output only for create requests). * * Generated from protobuf field string id = 1 [json_name = "id"]; */ protected $id = ''; /** * Name of the monitor (required, max 256 characters). * * Generated from protobuf field string name = 2 [json_name = "name", (.gnostic.openapi.v3.property) = { */ protected $name = ''; /** * URI to monitor in format "host:port" (required, max 2048 characters). * * Generated from protobuf field string uri = 3 [json_name = "uri", (.gnostic.openapi.v3.property) = { */ protected $uri = ''; /** * Check periodicity (required). * * Generated from protobuf field .openstatus.monitor.v1.Periodicity periodicity = 4 [json_name = "periodicity", (.buf.validate.field) = { */ protected $periodicity = 0; /** * Timeout in milliseconds (0-120000, defaults to 45000). * * Generated from protobuf field int64 timeout = 5 [json_name = "timeout", (.buf.validate.field) = { */ protected $timeout = 0; /** * Latency threshold for degraded status in milliseconds (optional, 0-120000). * * Generated from protobuf field optional int64 degraded_at = 6 [json_name = "degradedAt", (.buf.validate.field) = { */ protected $degraded_at = null; /** * Number of retry attempts (0-10, defaults to 3). * * Generated from protobuf field int64 retry = 7 [json_name = "retry", (.buf.validate.field) = { */ protected $retry = 0; /** * Description of the monitor (optional). * * Generated from protobuf field string description = 8 [json_name = "description", (.buf.validate.field) = { */ protected $description = ''; /** * Whether the monitor is active (defaults to false). * * Generated from protobuf field bool active = 9 [json_name = "active"]; */ protected $active = false; /** * Whether the monitor is publicly visible (defaults to false). * * Generated from protobuf field bool public = 10 [json_name = "public"]; */ protected $public = false; /** * Geographic regions to run checks from. * * Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 11 [json_name = "regions", (.buf.validate.field) = { */ private $regions; /** * OpenTelemetry configuration for exporting metrics. * * Generated from protobuf field .openstatus.monitor.v1.OpenTelemetryConfig open_telemetry = 12 [json_name = "openTelemetry"]; */ protected $open_telemetry = null; /** * Current operational status of the monitor. * * Generated from protobuf field .openstatus.monitor.v1.MonitorStatus status = 13 [json_name = "status"]; */ protected $status = 0; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $id * Unique identifier for the monitor (output only for create requests). * @type string $name * Name of the monitor (required, max 256 characters). * @type string $uri * URI to monitor in format "host:port" (required, max 2048 characters). * @type int $periodicity * Check periodicity (required). * @type int|string $timeout * Timeout in milliseconds (0-120000, defaults to 45000). * @type int|string $degraded_at * Latency threshold for degraded status in milliseconds (optional, 0-120000). * @type int|string $retry * Number of retry attempts (0-10, defaults to 3). * @type string $description * Description of the monitor (optional). * @type bool $active * Whether the monitor is active (defaults to false). * @type bool $public * Whether the monitor is publicly visible (defaults to false). * @type int[] $regions * Geographic regions to run checks from. * @type \Openstatus\Monitor\V1\OpenTelemetryConfig $open_telemetry * OpenTelemetry configuration for exporting metrics. * @type int $status * Current operational status of the monitor. * } */ public function __construct($data = NULL) { \GPBMetadata\Openstatus\Monitor\V1\TcpMonitor::initOnce(); parent::__construct($data); } /** * Unique identifier for the monitor (output only for create requests). * * Generated from protobuf field string id = 1 [json_name = "id"]; * @return string */ public function getId() { return $this->id; } /** * Unique identifier for the monitor (output only for create requests). * * Generated from protobuf field string id = 1 [json_name = "id"]; * @param string $var * @return $this */ public function setId(string $var) { GPBUtil::checkString($var, true); $this->id = $var; return $this; } /** * Name of the monitor (required, max 256 characters). * * Generated from protobuf field string name = 2 [json_name = "name", (.gnostic.openapi.v3.property) = { * @return string */ public function getName() { return $this->name; } /** * Name of the monitor (required, max 256 characters). * * Generated from protobuf field string name = 2 [json_name = "name", (.gnostic.openapi.v3.property) = { * @param string $var * @return $this */ public function setName(string $var) { GPBUtil::checkString($var, true); $this->name = $var; return $this; } /** * URI to monitor in format "host:port" (required, max 2048 characters). * * Generated from protobuf field string uri = 3 [json_name = "uri", (.gnostic.openapi.v3.property) = { * @return string */ public function getUri() { return $this->uri; } /** * URI to monitor in format "host:port" (required, max 2048 characters). * * Generated from protobuf field string uri = 3 [json_name = "uri", (.gnostic.openapi.v3.property) = { * @param string $var * @return $this */ public function setUri(string $var) { GPBUtil::checkString($var, true); $this->uri = $var; return $this; } /** * Check periodicity (required). * * Generated from protobuf field .openstatus.monitor.v1.Periodicity periodicity = 4 [json_name = "periodicity", (.buf.validate.field) = { * @return int one of the values in {@see \Openstatus\Monitor\V1\Periodicity} */ public function getPeriodicity() { return $this->periodicity; } /** * Check periodicity (required). * * Generated from protobuf field .openstatus.monitor.v1.Periodicity periodicity = 4 [json_name = "periodicity", (.buf.validate.field) = { * @param int $var one of the values in {@see \Openstatus\Monitor\V1\Periodicity} * @return $this */ public function setPeriodicity(int $var) { GPBUtil::checkEnum($var, \Openstatus\Monitor\V1\Periodicity::class); $this->periodicity = $var; return $this; } /** * Timeout in milliseconds (0-120000, defaults to 45000). * * Generated from protobuf field int64 timeout = 5 [json_name = "timeout", (.buf.validate.field) = { * @return int|string */ public function getTimeout() { return $this->timeout; } /** * Timeout in milliseconds (0-120000, defaults to 45000). * * Generated from protobuf field int64 timeout = 5 [json_name = "timeout", (.buf.validate.field) = { * @param int|string $var * @return $this */ public function setTimeout(int|string $var) { GPBUtil::checkInt64($var); $this->timeout = $var; return $this; } /** * Latency threshold for degraded status in milliseconds (optional, 0-120000). * * Generated from protobuf field optional int64 degraded_at = 6 [json_name = "degradedAt", (.buf.validate.field) = { * @return int|string */ public function getDegradedAt() { return isset($this->degraded_at) ? $this->degraded_at : GPBUtil::compatibleInt64(0, '0'); } public function hasDegradedAt() { return isset($this->degraded_at); } public function clearDegradedAt() { unset($this->degraded_at); } /** * Latency threshold for degraded status in milliseconds (optional, 0-120000). * * Generated from protobuf field optional int64 degraded_at = 6 [json_name = "degradedAt", (.buf.validate.field) = { * @param int|string $var * @return $this */ public function setDegradedAt(int|string $var) { GPBUtil::checkInt64($var); $this->degraded_at = $var; return $this; } /** * Number of retry attempts (0-10, defaults to 3). * * Generated from protobuf field int64 retry = 7 [json_name = "retry", (.buf.validate.field) = { * @return int|string */ public function getRetry() { return $this->retry; } /** * Number of retry attempts (0-10, defaults to 3). * * Generated from protobuf field int64 retry = 7 [json_name = "retry", (.buf.validate.field) = { * @param int|string $var * @return $this */ public function setRetry(int|string $var) { GPBUtil::checkInt64($var); $this->retry = $var; return $this; } /** * Description of the monitor (optional). * * Generated from protobuf field string description = 8 [json_name = "description", (.buf.validate.field) = { * @return string */ public function getDescription() { return $this->description; } /** * Description of the monitor (optional). * * Generated from protobuf field string description = 8 [json_name = "description", (.buf.validate.field) = { * @param string $var * @return $this */ public function setDescription(string $var) { GPBUtil::checkString($var, true); $this->description = $var; return $this; } /** * Whether the monitor is active (defaults to false). * * Generated from protobuf field bool active = 9 [json_name = "active"]; * @return bool */ public function getActive() { return $this->active; } /** * Whether the monitor is active (defaults to false). * * Generated from protobuf field bool active = 9 [json_name = "active"]; * @param bool $var * @return $this */ public function setActive(bool $var) { $this->active = $var; return $this; } /** * Whether the monitor is publicly visible (defaults to false). * * Generated from protobuf field bool public = 10 [json_name = "public"]; * @return bool */ public function getPublic() { return $this->public; } /** * Whether the monitor is publicly visible (defaults to false). * * Generated from protobuf field bool public = 10 [json_name = "public"]; * @param bool $var * @return $this */ public function setPublic(bool $var) { $this->public = $var; return $this; } /** * Geographic regions to run checks from. * * Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 11 [json_name = "regions", (.buf.validate.field) = { * @return RepeatedField one of the values in {@see \Openstatus\Monitor\V1\Region} */ public function getRegions() { return $this->regions; } /** * Geographic regions to run checks from. * * Generated from protobuf field repeated .openstatus.monitor.v1.Region regions = 11 [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; } /** * OpenTelemetry configuration for exporting metrics. * * Generated from protobuf field .openstatus.monitor.v1.OpenTelemetryConfig open_telemetry = 12 [json_name = "openTelemetry"]; * @return \Openstatus\Monitor\V1\OpenTelemetryConfig|null */ public function getOpenTelemetry() { return $this->open_telemetry; } public function hasOpenTelemetry() { return isset($this->open_telemetry); } public function clearOpenTelemetry() { unset($this->open_telemetry); } /** * OpenTelemetry configuration for exporting metrics. * * Generated from protobuf field .openstatus.monitor.v1.OpenTelemetryConfig open_telemetry = 12 [json_name = "openTelemetry"]; * @param \Openstatus\Monitor\V1\OpenTelemetryConfig $var * @return $this */ public function setOpenTelemetry(\Openstatus\Monitor\V1\OpenTelemetryConfig|null $var) { $this->open_telemetry = $var; return $this; } /** * Current operational status of the monitor. * * Generated from protobuf field .openstatus.monitor.v1.MonitorStatus status = 13 [json_name = "status"]; * @return int one of the values in {@see \Openstatus\Monitor\V1\MonitorStatus} */ public function getStatus() { return $this->status; } /** * Current operational status of the monitor. * * Generated from protobuf field .openstatus.monitor.v1.MonitorStatus status = 13 [json_name = "status"]; * @param int $var one of the values in {@see \Openstatus\Monitor\V1\MonitorStatus} * @return $this */ public function setStatus(int $var) { GPBUtil::checkEnum($var, \Openstatus\Monitor\V1\MonitorStatus::class); $this->status = $var; return $this; } }