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

/**
 * Response message for
 * [FeatureOnlineStoreService.FetchFeatureValues][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FetchFeatureValues]
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FetchFeatureValuesResponse</code>
 */
class FetchFeatureValuesResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The data key associated with this response.
     * Will only be populated for
     * [FeatureOnlineStoreService.StreamingFetchFeatureValues][] RPCs.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FeatureViewDataKey data_key = 4;</code>
     */
    protected $data_key = null;
    protected $format;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse\FeatureNameValuePairList $key_values
     *           Feature values in KeyValue format.
     *     @type \Google\Protobuf\Struct $proto_struct
     *           Feature values in proto Struct format.
     *     @type \Google\Cloud\AIPlatform\V1\FeatureViewDataKey $data_key
     *           The data key associated with this response.
     *           Will only be populated for
     *           [FeatureOnlineStoreService.StreamingFetchFeatureValues][] RPCs.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\FeatureOnlineStoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * Feature values in KeyValue format.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FetchFeatureValuesResponse.FeatureNameValuePairList key_values = 3;</code>
     * @return \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse\FeatureNameValuePairList|null
     */
    public function getKeyValues()
    {
        return $this->readOneof(3);
    }

    public function hasKeyValues()
    {
        return $this->hasOneof(3);
    }

    /**
     * Feature values in KeyValue format.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FetchFeatureValuesResponse.FeatureNameValuePairList key_values = 3;</code>
     * @param \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse\FeatureNameValuePairList $var
     * @return $this
     */
    public function setKeyValues($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse\FeatureNameValuePairList::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Feature values in proto Struct format.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct proto_struct = 2;</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getProtoStruct()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Feature values in proto Struct format.
     *
     * Generated from protobuf field <code>.google.protobuf.Struct proto_struct = 2;</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setProtoStruct($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The data key associated with this response.
     * Will only be populated for
     * [FeatureOnlineStoreService.StreamingFetchFeatureValues][] RPCs.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FeatureViewDataKey data_key = 4;</code>
     * @return \Google\Cloud\AIPlatform\V1\FeatureViewDataKey|null
     */
    public function getDataKey()
    {
        return $this->data_key;
    }

    public function hasDataKey()
    {
        return isset($this->data_key);
    }

    public function clearDataKey()
    {
        unset($this->data_key);
    }

    /**
     * The data key associated with this response.
     * Will only be populated for
     * [FeatureOnlineStoreService.StreamingFetchFeatureValues][] RPCs.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.FeatureViewDataKey data_key = 4;</code>
     * @param \Google\Cloud\AIPlatform\V1\FeatureViewDataKey $var
     * @return $this
     */
    public function setDataKey($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\FeatureViewDataKey::class);
        $this->data_key = $var;

        return $this;
    }

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

}

