<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/v2/types.proto

namespace Google\Cloud\Bigtable\V2\Type;

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

/**
 * A value that combines incremental updates into a summarized value.
 * Data is never directly written or read using type `Aggregate`. Writes will
 * provide either the `input_type` or `state_type`, and reads will always
 * return the `state_type` .
 *
 * Generated from protobuf message <code>google.bigtable.v2.Type.Aggregate</code>
 */
class Aggregate extends \Google\Protobuf\Internal\Message
{
    /**
     * Type of the inputs that are accumulated by this `Aggregate`, which must
     * specify a full encoding.
     * Use `AddInput` mutations to accumulate new inputs.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type input_type = 1;</code>
     */
    protected $input_type = null;
    /**
     * Output only. Type that holds the internal accumulator state for the
     * `Aggregate`. This is a function of the `input_type` and `aggregator`
     * chosen, and will always specify a full encoding.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state_type = null;
    protected $aggregator;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\Type $input_type
     *           Type of the inputs that are accumulated by this `Aggregate`, which must
     *           specify a full encoding.
     *           Use `AddInput` mutations to accumulate new inputs.
     *     @type \Google\Cloud\Bigtable\V2\Type $state_type
     *           Output only. Type that holds the internal accumulator state for the
     *           `Aggregate`. This is a function of the `input_type` and `aggregator`
     *           chosen, and will always specify a full encoding.
     *     @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum $sum
     *           Sum aggregator.
     *     @type \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $hllpp_unique_count
     *           HyperLogLogPlusPlusUniqueCount aggregator.
     *     @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Max $max
     *           Max aggregator.
     *     @type \Google\Cloud\Bigtable\V2\Type\Aggregate\Min $min
     *           Min aggregator.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Types::initOnce();
        parent::__construct($data);
    }

    /**
     * Type of the inputs that are accumulated by this `Aggregate`, which must
     * specify a full encoding.
     * Use `AddInput` mutations to accumulate new inputs.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type input_type = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\Type|null
     */
    public function getInputType()
    {
        return $this->input_type;
    }

    public function hasInputType()
    {
        return isset($this->input_type);
    }

    public function clearInputType()
    {
        unset($this->input_type);
    }

    /**
     * Type of the inputs that are accumulated by this `Aggregate`, which must
     * specify a full encoding.
     * Use `AddInput` mutations to accumulate new inputs.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type input_type = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\Type $var
     * @return $this
     */
    public function setInputType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class);
        $this->input_type = $var;

        return $this;
    }

    /**
     * Output only. Type that holds the internal accumulator state for the
     * `Aggregate`. This is a function of the `input_type` and `aggregator`
     * chosen, and will always specify a full encoding.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Bigtable\V2\Type|null
     */
    public function getStateType()
    {
        return $this->state_type;
    }

    public function hasStateType()
    {
        return isset($this->state_type);
    }

    public function clearStateType()
    {
        unset($this->state_type);
    }

    /**
     * Output only. Type that holds the internal accumulator state for the
     * `Aggregate`. This is a function of the `input_type` and `aggregator`
     * chosen, and will always specify a full encoding.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Bigtable\V2\Type $var
     * @return $this
     */
    public function setStateType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class);
        $this->state_type = $var;

        return $this;
    }

    /**
     * Sum aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Sum sum = 4;</code>
     * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum|null
     */
    public function getSum()
    {
        return $this->readOneof(4);
    }

    public function hasSum()
    {
        return $this->hasOneof(4);
    }

    /**
     * Sum aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Sum sum = 4;</code>
     * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum $var
     * @return $this
     */
    public function setSum($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Sum::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * HyperLogLogPlusPlusUniqueCount aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5;</code>
     * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount|null
     */
    public function getHllppUniqueCount()
    {
        return $this->readOneof(5);
    }

    public function hasHllppUniqueCount()
    {
        return $this->hasOneof(5);
    }

    /**
     * HyperLogLogPlusPlusUniqueCount aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount hllpp_unique_count = 5;</code>
     * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount $var
     * @return $this
     */
    public function setHllppUniqueCount($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\HyperLogLogPlusPlusUniqueCount::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Max aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Max max = 6;</code>
     * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Max|null
     */
    public function getMax()
    {
        return $this->readOneof(6);
    }

    public function hasMax()
    {
        return $this->hasOneof(6);
    }

    /**
     * Max aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Max max = 6;</code>
     * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Max $var
     * @return $this
     */
    public function setMax($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Max::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Min aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Min min = 7;</code>
     * @return \Google\Cloud\Bigtable\V2\Type\Aggregate\Min|null
     */
    public function getMin()
    {
        return $this->readOneof(7);
    }

    public function hasMin()
    {
        return $this->hasOneof(7);
    }

    /**
     * Min aggregator.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Aggregate.Min min = 7;</code>
     * @param \Google\Cloud\Bigtable\V2\Type\Aggregate\Min $var
     * @return $this
     */
    public function setMin($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Aggregate\Min::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Aggregate::class, \Google\Cloud\Bigtable\V2\Type_Aggregate::class);

