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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Lookup key for a feature view.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FeatureViewDataKey</code>
 */
class FeatureViewDataKey extends \Google\Protobuf\Internal\Message
{
    protected $key_oneof;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key
     *           String key to use for lookup.
     *     @type \Google\Cloud\AIPlatform\V1\FeatureViewDataKey\CompositeKey $composite_key
     *           The actual Entity ID will be composed from this struct. This should match
     *           with the way ID is defined in the FeatureView spec.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\FeatureOnlineStoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * String key to use for lookup.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @return string
     */
    public function getKey()
    {
        return $this->readOneof(1);
    }

    public function hasKey()
    {
        return $this->hasOneof(1);
    }

    /**
     * String key to use for lookup.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The actual Entity ID will be composed from this struct. This should match
     * with the way ID is defined in the FeatureView spec.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FeatureViewDataKey.CompositeKey composite_key = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\FeatureViewDataKey\CompositeKey|null
     */
    public function getCompositeKey()
    {
        return $this->readOneof(2);
    }

    public function hasCompositeKey()
    {
        return $this->hasOneof(2);
    }

    /**
     * The actual Entity ID will be composed from this struct. This should match
     * with the way ID is defined in the FeatureView spec.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FeatureViewDataKey.CompositeKey composite_key = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\FeatureViewDataKey\CompositeKey $var
     * @return $this
     */
    public function setCompositeKey($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FeatureViewDataKey\CompositeKey::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getKeyOneof()
    {
        return $this->whichOneof("key_oneof");
    }

}

