openstatus.status_page.v1.PageSubscriber
*/
class PageSubscriber extends \Google\Protobuf\Internal\Message
{
/**
* Unique identifier for the subscriber.
*
* Generated from protobuf field string id = 1 [json_name = "id"];
*/
protected $id = '';
/**
* ID of the status page the user is subscribed to.
*
* Generated from protobuf field string page_id = 2 [json_name = "pageId"];
*/
protected $page_id = '';
/**
* Email address of the subscriber (empty for webhook channels).
*
* Generated from protobuf field string email = 3 [json_name = "email"];
*/
protected $email = '';
/**
* Timestamp when the subscription was accepted/confirmed (RFC 3339 format, optional).
*
* Generated from protobuf field string accepted_at = 4 [json_name = "acceptedAt"];
*/
protected $accepted_at = '';
/**
* Timestamp when the user unsubscribed (RFC 3339 format, optional).
*
* Generated from protobuf field string unsubscribed_at = 5 [json_name = "unsubscribedAt"];
*/
protected $unsubscribed_at = '';
/**
* Timestamp when the subscription was created (RFC 3339 format).
*
* Generated from protobuf field string created_at = 6 [json_name = "createdAt"];
*/
protected $created_at = '';
/**
* Timestamp when the subscription was last updated (RFC 3339 format).
*
* Generated from protobuf field string updated_at = 7 [json_name = "updatedAt"];
*/
protected $updated_at = '';
/**
* How the subscription was created. Vendor-added rows skip verification.
*
* Generated from protobuf field .openstatus.status_page.v1.SubscriberSource source = 8 [json_name = "source"];
*/
protected $source = 0;
/**
* Optional human-readable label (e.g. "Supabase #incidents").
*
* Generated from protobuf field optional string name = 9 [json_name = "name"];
*/
protected $name = null;
/**
* Channel type: "email" or "webhook".
*
* Generated from protobuf field string channel_type = 10 [json_name = "channelType"];
*/
protected $channel_type = '';
/**
* Webhook URL (populated only for channel_type = "webhook").
*
* Generated from protobuf field optional string webhook_url = 11 [json_name = "webhookUrl"];
*/
protected $webhook_url = null;
/**
* JSON-encoded channel config (e.g. custom headers). Populated for webhook channels.
*
* Generated from protobuf field optional string channel_config = 12 [json_name = "channelConfig"];
*/
protected $channel_config = null;
/**
* IDs of components this subscription is scoped to. Empty = entire page.
*
* Generated from protobuf field repeated string component_ids = 13 [json_name = "componentIds"];
*/
private $component_ids;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $id
* Unique identifier for the subscriber.
* @type string $page_id
* ID of the status page the user is subscribed to.
* @type string $email
* Email address of the subscriber (empty for webhook channels).
* @type string $accepted_at
* Timestamp when the subscription was accepted/confirmed (RFC 3339 format, optional).
* @type string $unsubscribed_at
* Timestamp when the user unsubscribed (RFC 3339 format, optional).
* @type string $created_at
* Timestamp when the subscription was created (RFC 3339 format).
* @type string $updated_at
* Timestamp when the subscription was last updated (RFC 3339 format).
* @type int $source
* How the subscription was created. Vendor-added rows skip verification.
* @type string $name
* Optional human-readable label (e.g. "Supabase #incidents").
* @type string $channel_type
* Channel type: "email" or "webhook".
* @type string $webhook_url
* Webhook URL (populated only for channel_type = "webhook").
* @type string $channel_config
* JSON-encoded channel config (e.g. custom headers). Populated for webhook channels.
* @type string[] $component_ids
* IDs of components this subscription is scoped to. Empty = entire page.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Openstatus\StatusPage\V1\PageSubscriber::initOnce();
parent::__construct($data);
}
/**
* Unique identifier for the subscriber.
*
* Generated from protobuf field string id = 1 [json_name = "id"];
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* Unique identifier for the subscriber.
*
* 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;
}
/**
* ID of the status page the user is subscribed to.
*
* Generated from protobuf field string page_id = 2 [json_name = "pageId"];
* @return string
*/
public function getPageId()
{
return $this->page_id;
}
/**
* ID of the status page the user is subscribed to.
*
* Generated from protobuf field string page_id = 2 [json_name = "pageId"];
* @param string $var
* @return $this
*/
public function setPageId(string $var)
{
GPBUtil::checkString($var, true);
$this->page_id = $var;
return $this;
}
/**
* Email address of the subscriber (empty for webhook channels).
*
* Generated from protobuf field string email = 3 [json_name = "email"];
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Email address of the subscriber (empty for webhook channels).
*
* Generated from protobuf field string email = 3 [json_name = "email"];
* @param string $var
* @return $this
*/
public function setEmail(string $var)
{
GPBUtil::checkString($var, true);
$this->email = $var;
return $this;
}
/**
* Timestamp when the subscription was accepted/confirmed (RFC 3339 format, optional).
*
* Generated from protobuf field string accepted_at = 4 [json_name = "acceptedAt"];
* @return string
*/
public function getAcceptedAt()
{
return $this->accepted_at;
}
/**
* Timestamp when the subscription was accepted/confirmed (RFC 3339 format, optional).
*
* Generated from protobuf field string accepted_at = 4 [json_name = "acceptedAt"];
* @param string $var
* @return $this
*/
public function setAcceptedAt(string $var)
{
GPBUtil::checkString($var, true);
$this->accepted_at = $var;
return $this;
}
/**
* Timestamp when the user unsubscribed (RFC 3339 format, optional).
*
* Generated from protobuf field string unsubscribed_at = 5 [json_name = "unsubscribedAt"];
* @return string
*/
public function getUnsubscribedAt()
{
return $this->unsubscribed_at;
}
/**
* Timestamp when the user unsubscribed (RFC 3339 format, optional).
*
* Generated from protobuf field string unsubscribed_at = 5 [json_name = "unsubscribedAt"];
* @param string $var
* @return $this
*/
public function setUnsubscribedAt(string $var)
{
GPBUtil::checkString($var, true);
$this->unsubscribed_at = $var;
return $this;
}
/**
* Timestamp when the subscription was created (RFC 3339 format).
*
* Generated from protobuf field string created_at = 6 [json_name = "createdAt"];
* @return string
*/
public function getCreatedAt()
{
return $this->created_at;
}
/**
* Timestamp when the subscription was created (RFC 3339 format).
*
* Generated from protobuf field string created_at = 6 [json_name = "createdAt"];
* @param string $var
* @return $this
*/
public function setCreatedAt(string $var)
{
GPBUtil::checkString($var, true);
$this->created_at = $var;
return $this;
}
/**
* Timestamp when the subscription was last updated (RFC 3339 format).
*
* Generated from protobuf field string updated_at = 7 [json_name = "updatedAt"];
* @return string
*/
public function getUpdatedAt()
{
return $this->updated_at;
}
/**
* Timestamp when the subscription was last updated (RFC 3339 format).
*
* Generated from protobuf field string updated_at = 7 [json_name = "updatedAt"];
* @param string $var
* @return $this
*/
public function setUpdatedAt(string $var)
{
GPBUtil::checkString($var, true);
$this->updated_at = $var;
return $this;
}
/**
* How the subscription was created. Vendor-added rows skip verification.
*
* Generated from protobuf field .openstatus.status_page.v1.SubscriberSource source = 8 [json_name = "source"];
* @return int one of the values in {@see \Openstatus\Status_page\V1\SubscriberSource}
*/
public function getSource()
{
return $this->source;
}
/**
* How the subscription was created. Vendor-added rows skip verification.
*
* Generated from protobuf field .openstatus.status_page.v1.SubscriberSource source = 8 [json_name = "source"];
* @param int $var one of the values in {@see \Openstatus\Status_page\V1\SubscriberSource}
* @return $this
*/
public function setSource(int $var)
{
GPBUtil::checkEnum($var, \Openstatus\Status_page\V1\SubscriberSource::class);
$this->source = $var;
return $this;
}
/**
* Optional human-readable label (e.g. "Supabase #incidents").
*
* Generated from protobuf field optional string name = 9 [json_name = "name"];
* @return string
*/
public function getName()
{
return isset($this->name) ? $this->name : '';
}
public function hasName()
{
return isset($this->name);
}
public function clearName()
{
unset($this->name);
}
/**
* Optional human-readable label (e.g. "Supabase #incidents").
*
* Generated from protobuf field optional string name = 9 [json_name = "name"];
* @param string $var
* @return $this
*/
public function setName(string $var)
{
GPBUtil::checkString($var, true);
$this->name = $var;
return $this;
}
/**
* Channel type: "email" or "webhook".
*
* Generated from protobuf field string channel_type = 10 [json_name = "channelType"];
* @return string
*/
public function getChannelType()
{
return $this->channel_type;
}
/**
* Channel type: "email" or "webhook".
*
* Generated from protobuf field string channel_type = 10 [json_name = "channelType"];
* @param string $var
* @return $this
*/
public function setChannelType(string $var)
{
GPBUtil::checkString($var, true);
$this->channel_type = $var;
return $this;
}
/**
* Webhook URL (populated only for channel_type = "webhook").
*
* Generated from protobuf field optional string webhook_url = 11 [json_name = "webhookUrl"];
* @return string
*/
public function getWebhookUrl()
{
return isset($this->webhook_url) ? $this->webhook_url : '';
}
public function hasWebhookUrl()
{
return isset($this->webhook_url);
}
public function clearWebhookUrl()
{
unset($this->webhook_url);
}
/**
* Webhook URL (populated only for channel_type = "webhook").
*
* Generated from protobuf field optional string webhook_url = 11 [json_name = "webhookUrl"];
* @param string $var
* @return $this
*/
public function setWebhookUrl(string $var)
{
GPBUtil::checkString($var, true);
$this->webhook_url = $var;
return $this;
}
/**
* JSON-encoded channel config (e.g. custom headers). Populated for webhook channels.
*
* Generated from protobuf field optional string channel_config = 12 [json_name = "channelConfig"];
* @return string
*/
public function getChannelConfig()
{
return isset($this->channel_config) ? $this->channel_config : '';
}
public function hasChannelConfig()
{
return isset($this->channel_config);
}
public function clearChannelConfig()
{
unset($this->channel_config);
}
/**
* JSON-encoded channel config (e.g. custom headers). Populated for webhook channels.
*
* Generated from protobuf field optional string channel_config = 12 [json_name = "channelConfig"];
* @param string $var
* @return $this
*/
public function setChannelConfig(string $var)
{
GPBUtil::checkString($var, true);
$this->channel_config = $var;
return $this;
}
/**
* IDs of components this subscription is scoped to. Empty = entire page.
*
* Generated from protobuf field repeated string component_ids = 13 [json_name = "componentIds"];
* @return RepeatedField
*/
public function getComponentIds()
{
return $this->component_ids;
}
/**
* IDs of components this subscription is scoped to. Empty = entire page.
*
* Generated from protobuf field repeated string component_ids = 13 [json_name = "componentIds"];
* @param string[] $var
* @return $this
*/
public function setComponentIds(array|RepeatedField $var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
$this->component_ids = $arr;
return $this;
}
}