<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: couchbase/search/v1/search.proto

namespace Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse;

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

/**
 * Generated from protobuf message <code>couchbase.search.v1.SearchQueryResponse.FacetResult</code>
 */
class FacetResult extends \Google\Protobuf\Internal\Message
{
    protected $search_facet;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\TermFacetResult $term_facet
     *     @type \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\DateRangeFacetResult $date_range_facet
     *     @type \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\NumericRangeFacetResult $numeric_range_facet
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Couchbase\Search\V1\Search::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.TermFacetResult term_facet = 1;</code>
     * @return \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\TermFacetResult|null
     */
    public function getTermFacet()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.TermFacetResult term_facet = 1;</code>
     * @param \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\TermFacetResult $var
     * @return $this
     */
    public function setTermFacet($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\TermFacetResult::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.DateRangeFacetResult date_range_facet = 2;</code>
     * @return \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\DateRangeFacetResult|null
     */
    public function getDateRangeFacet()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.DateRangeFacetResult date_range_facet = 2;</code>
     * @param \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\DateRangeFacetResult $var
     * @return $this
     */
    public function setDateRangeFacet($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\DateRangeFacetResult::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.NumericRangeFacetResult numeric_range_facet = 3;</code>
     * @return \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\NumericRangeFacetResult|null
     */
    public function getNumericRangeFacet()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Generated from protobuf field <code>.couchbase.search.v1.SearchQueryResponse.NumericRangeFacetResult numeric_range_facet = 3;</code>
     * @param \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\NumericRangeFacetResult $var
     * @return $this
     */
    public function setNumericRangeFacet($var)
    {
        GPBUtil::checkMessage($var, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse\NumericRangeFacetResult::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FacetResult::class, \Couchbase\Protostellar\Generated\Search\V1\SearchQueryResponse_FacetResult::class);

