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

namespace Couchbase\Protostellar\Generated\Search\V1;

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

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

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

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

}

