<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/servicehealth/v1/event_resources.proto

namespace Google\Cloud\ServiceHealth\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Represents service health events that may affect Google Cloud products used
 * across the organization. It is a read-only view and does not allow any
 * modifications.
 *
 * Generated from protobuf message <code>google.cloud.servicehealth.v1.OrganizationEvent</code>
 */
class OrganizationEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Identifier. Name of the event. Unique name of the event in
     * this scope including organization ID and location using the form
     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
     * `organization_id` - see [Getting your organization resource
     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
     * `location` - The location to get the service health events from.<br>
     * `event_id` - Organization event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. Brief description for the event.
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $title = '';
    /**
     * Output only. Free-form, human-readable description.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $description = '';
    /**
     * Output only. The category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $category = 0;
    /**
     * Output only. The detailed category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $detailed_category = 0;
    /**
     * Output only. The current state of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Output only. The current detailed state of the incident.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $detailed_state = 0;
    /**
     * Output only. Represents the Google Cloud products and locations impacted by
     * the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $event_impacts;
    /**
     * Output only. Incident-only field. Event updates are correspondence from
     * Google.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $updates;
    /**
     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
     * name of the parent event. All further updates will be published to the
     * parent event.
     *
     * Generated from protobuf field <code>string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $parent_event = '';
    /**
     * Output only. The time the update was posted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. The start time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $start_time = null;
    /**
     * Output only. The end time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $end_time = null;
    /**
     * Output only. Incident-only field. The time when the next update can be
     * expected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $next_update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Identifier. Name of the event. Unique name of the event in
     *           this scope including organization ID and location using the form
     *           `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
     *           `organization_id` - see [Getting your organization resource
     *           ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
     *           `location` - The location to get the service health events from.<br>
     *           `event_id` - Organization event ID to retrieve.
     *     @type string $title
     *           Output only. Brief description for the event.
     *     @type string $description
     *           Output only. Free-form, human-readable description.
     *     @type int $category
     *           Output only. The category of the event.
     *     @type int $detailed_category
     *           Output only. The detailed category of the event.
     *     @type int $state
     *           Output only. The current state of the event.
     *     @type int $detailed_state
     *           Output only. The current detailed state of the incident.
     *     @type array<\Google\Cloud\ServiceHealth\V1\EventImpact>|\Google\Protobuf\Internal\RepeatedField $event_impacts
     *           Output only. Represents the Google Cloud products and locations impacted by
     *           the event.
     *     @type array<\Google\Cloud\ServiceHealth\V1\EventUpdate>|\Google\Protobuf\Internal\RepeatedField $updates
     *           Output only. Incident-only field. Event updates are correspondence from
     *           Google.
     *     @type string $parent_event
     *           Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
     *           name of the parent event. All further updates will be published to the
     *           parent event.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time the update was posted.
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Output only. The start time of the event, if applicable.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Output only. The end time of the event, if applicable.
     *     @type \Google\Protobuf\Timestamp $next_update_time
     *           Output only. Incident-only field. The time when the next update can be
     *           expected.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Servicehealth\V1\EventResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Identifier. Name of the event. Unique name of the event in
     * this scope including organization ID and location using the form
     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
     * `organization_id` - see [Getting your organization resource
     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
     * `location` - The location to get the service health events from.<br>
     * `event_id` - Organization event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Identifier. Name of the event. Unique name of the event in
     * this scope including organization ID and location using the form
     * `organizations/{organization_id}/locations/{location}/organizationEvents/{event_id}`.
     * `organization_id` - see [Getting your organization resource
     * ID](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).<br>
     * `location` - The location to get the service health events from.<br>
     * `event_id` - Organization event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. Brief description for the event.
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Output only. Brief description for the event.
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->title = $var;

        return $this;
    }

    /**
     * Output only. Free-form, human-readable description.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Output only. Free-form, human-readable description.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Output only. The category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * Output only. The category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.EventCategory category = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setCategory($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ServiceHealth\V1\OrganizationEvent\EventCategory::class);
        $this->category = $var;

        return $this;
    }

    /**
     * Output only. The detailed category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getDetailedCategory()
    {
        return $this->detailed_category;
    }

    /**
     * Output only. The detailed category of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedCategory detailed_category = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setDetailedCategory($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ServiceHealth\V1\OrganizationEvent\DetailedCategory::class);
        $this->detailed_category = $var;

        return $this;
    }

    /**
     * Output only. The current state of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The current state of the event.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ServiceHealth\V1\OrganizationEvent\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. The current detailed state of the incident.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getDetailedState()
    {
        return $this->detailed_state;
    }

    /**
     * Output only. The current detailed state of the incident.
     *
     * Generated from protobuf field <code>.google.cloud.servicehealth.v1.OrganizationEvent.DetailedState detailed_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setDetailedState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ServiceHealth\V1\OrganizationEvent\DetailedState::class);
        $this->detailed_state = $var;

        return $this;
    }

    /**
     * Output only. Represents the Google Cloud products and locations impacted by
     * the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getEventImpacts()
    {
        return $this->event_impacts;
    }

    /**
     * Output only. Represents the Google Cloud products and locations impacted by
     * the event.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventImpact event_impacts = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\ServiceHealth\V1\EventImpact>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setEventImpacts($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceHealth\V1\EventImpact::class);
        $this->event_impacts = $arr;

        return $this;
    }

    /**
     * Output only. Incident-only field. Event updates are correspondence from
     * Google.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getUpdates()
    {
        return $this->updates;
    }

    /**
     * Output only. Incident-only field. Event updates are correspondence from
     * Google.
     *
     * Generated from protobuf field <code>repeated .google.cloud.servicehealth.v1.EventUpdate updates = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Cloud\ServiceHealth\V1\EventUpdate>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setUpdates($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ServiceHealth\V1\EventUpdate::class);
        $this->updates = $arr;

        return $this;
    }

    /**
     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
     * name of the parent event. All further updates will be published to the
     * parent event.
     *
     * Generated from protobuf field <code>string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getParentEvent()
    {
        return $this->parent_event;
    }

    /**
     * Output only. When `detailed_state`=`MERGED`, `parent_event` contains the
     * name of the parent event. All further updates will be published to the
     * parent event.
     *
     * Generated from protobuf field <code>string parent_event = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setParentEvent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent_event = $var;

        return $this;
    }

    /**
     * Output only. The time the update was posted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The time the update was posted.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. The start time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * Output only. The start time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Output only. The end time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Output only. The end time of the event, if applicable.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Output only. Incident-only field. The time when the next update can be
     * expected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getNextUpdateTime()
    {
        return $this->next_update_time;
    }

    public function hasNextUpdateTime()
    {
        return isset($this->next_update_time);
    }

    public function clearNextUpdateTime()
    {
        unset($this->next_update_time);
    }

    /**
     * Output only. Incident-only field. The time when the next update can be
     * expected.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setNextUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->next_update_time = $var;

        return $this;
    }

}

