<?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;

/**
 * Message for getting an event
 *
 * Generated from protobuf message <code>google.cloud.servicehealth.v1.GetEventRequest</code>
 */
class GetEventRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Unique name of the event in this scope including project
     * and location using the form
     * `projects/{project_id}/locations/{location}/events/{event_id}`.
     * `project_id` - Project ID of the project that contains the event. <br>
     * `location` - The location to get the service health events from. <br>
     * `event_id` - Event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';

    /**
     * @param string $name Required. Unique name of the event in this scope including project
     *                     and location using the form
     *                     `projects/{project_id}/locations/{location}/events/{event_id}`.
     *
     *                     `project_id` - Project ID of the project that contains the event. <br>
     *                     `location` - The location to get the service health events from. <br>
     *                     `event_id` - Event ID to retrieve. Please see
     *                     {@see ServiceHealthClient::eventName()} for help formatting this field.
     *
     * @return \Google\Cloud\ServiceHealth\V1\GetEventRequest
     *
     * @experimental
     */
    public static function build(string $name): self
    {
        return (new self())
            ->setName($name);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Unique name of the event in this scope including project
     *           and location using the form
     *           `projects/{project_id}/locations/{location}/events/{event_id}`.
     *           `project_id` - Project ID of the project that contains the event. <br>
     *           `location` - The location to get the service health events from. <br>
     *           `event_id` - Event ID to retrieve.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Servicehealth\V1\EventResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Unique name of the event in this scope including project
     * and location using the form
     * `projects/{project_id}/locations/{location}/events/{event_id}`.
     * `project_id` - Project ID of the project that contains the event. <br>
     * `location` - The location to get the service health events from. <br>
     * `event_id` - Event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Unique name of the event in this scope including project
     * and location using the form
     * `projects/{project_id}/locations/{location}/events/{event_id}`.
     * `project_id` - Project ID of the project that contains the event. <br>
     * `location` - The location to get the service health events from. <br>
     * `event_id` - Event ID to retrieve.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

}

