<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1beta/analytics_admin.proto

namespace Google\Analytics\Admin\V1beta;

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

/**
 * Request message for CreateKeyEvent RPC
 *
 * Generated from protobuf message <code>google.analytics.admin.v1beta.CreateKeyEventRequest</code>
 */
class CreateKeyEventRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The Key Event to create.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1beta.KeyEvent key_event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $key_event = null;
    /**
     * Required. The resource name of the parent property where this Key Event
     * will be created. Format: properties/123
     *
     * Generated from protobuf field <code>string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';

    /**
     * @param string                                  $parent   Required. The resource name of the parent property where this Key Event
     *                                                          will be created. Format: properties/123
     *                                                          Please see {@see AnalyticsAdminServiceClient::propertyName()} for help formatting this field.
     * @param \Google\Analytics\Admin\V1beta\KeyEvent $keyEvent Required. The Key Event to create.
     *
     * @return \Google\Analytics\Admin\V1beta\CreateKeyEventRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Analytics\Admin\V1beta\KeyEvent $keyEvent): self
    {
        return (new self())
            ->setParent($parent)
            ->setKeyEvent($keyEvent);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Analytics\Admin\V1beta\KeyEvent $key_event
     *           Required. The Key Event to create.
     *     @type string $parent
     *           Required. The resource name of the parent property where this Key Event
     *           will be created. Format: properties/123
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Analytics\Admin\V1Beta\AnalyticsAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The Key Event to create.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1beta.KeyEvent key_event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Analytics\Admin\V1beta\KeyEvent|null
     */
    public function getKeyEvent()
    {
        return $this->key_event;
    }

    public function hasKeyEvent()
    {
        return isset($this->key_event);
    }

    public function clearKeyEvent()
    {
        unset($this->key_event);
    }

    /**
     * Required. The Key Event to create.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1beta.KeyEvent key_event = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Analytics\Admin\V1beta\KeyEvent $var
     * @return $this
     */
    public function setKeyEvent($var)
    {
        GPBUtil::checkMessage($var, \Google\Analytics\Admin\V1beta\KeyEvent::class);
        $this->key_event = $var;

        return $this;
    }

    /**
     * Required. The resource name of the parent property where this Key Event
     * will be created. Format: properties/123
     *
     * Generated from protobuf field <code>string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The resource name of the parent property where this Key Event
     * will be created. Format: properties/123
     *
     * Generated from protobuf field <code>string parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

}

