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

namespace Google\Api;

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

/**
 * `BatchingSettingsProto` specifies a set of batching thresholds, each of
 * which acts as a trigger to send a batch of messages as a request. At least
 * one threshold must be positive nonzero.
 *
 * Generated from protobuf message <code>google.api.BatchingSettingsProto</code>
 */
class BatchingSettingsProto extends \Google\Protobuf\Internal\Message
{
    /**
     * The number of elements of a field collected into a batch which, if
     * exceeded, causes the batch to be sent.
     *
     * Generated from protobuf field <code>int32 element_count_threshold = 1;</code>
     */
    protected $element_count_threshold = 0;
    /**
     * The aggregated size of the batched field which, if exceeded, causes the
     * batch to be sent. This size is computed by aggregating the sizes of the
     * request field to be batched, not of the entire request message.
     *
     * Generated from protobuf field <code>int64 request_byte_threshold = 2;</code>
     */
    protected $request_byte_threshold = 0;
    /**
     * The duration after which a batch should be sent, starting from the addition
     * of the first message to that batch.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_threshold = 3;</code>
     */
    protected $delay_threshold = null;
    /**
     * The maximum number of elements collected in a batch that could be accepted
     * by server.
     *
     * Generated from protobuf field <code>int32 element_count_limit = 4;</code>
     */
    protected $element_count_limit = 0;
    /**
     * The maximum size of the request that could be accepted by server.
     *
     * Generated from protobuf field <code>int32 request_byte_limit = 5;</code>
     */
    protected $request_byte_limit = 0;
    /**
     * The maximum number of elements allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_element_limit = 6;</code>
     */
    protected $flow_control_element_limit = 0;
    /**
     * The maximum size of data allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_byte_limit = 7;</code>
     */
    protected $flow_control_byte_limit = 0;
    /**
     * The behavior to take when the flow control limit is exceeded.
     *
     * Generated from protobuf field <code>.google.api.FlowControlLimitExceededBehaviorProto flow_control_limit_exceeded_behavior = 8;</code>
     */
    protected $flow_control_limit_exceeded_behavior = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $element_count_threshold
     *           The number of elements of a field collected into a batch which, if
     *           exceeded, causes the batch to be sent.
     *     @type int|string $request_byte_threshold
     *           The aggregated size of the batched field which, if exceeded, causes the
     *           batch to be sent. This size is computed by aggregating the sizes of the
     *           request field to be batched, not of the entire request message.
     *     @type \Google\Protobuf\Duration $delay_threshold
     *           The duration after which a batch should be sent, starting from the addition
     *           of the first message to that batch.
     *     @type int $element_count_limit
     *           The maximum number of elements collected in a batch that could be accepted
     *           by server.
     *     @type int $request_byte_limit
     *           The maximum size of the request that could be accepted by server.
     *     @type int $flow_control_element_limit
     *           The maximum number of elements allowed by flow control.
     *     @type int $flow_control_byte_limit
     *           The maximum size of data allowed by flow control.
     *     @type int $flow_control_limit_exceeded_behavior
     *           The behavior to take when the flow control limit is exceeded.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Api\Client::initOnce();
        parent::__construct($data);
    }

    /**
     * The number of elements of a field collected into a batch which, if
     * exceeded, causes the batch to be sent.
     *
     * Generated from protobuf field <code>int32 element_count_threshold = 1;</code>
     * @return int
     */
    public function getElementCountThreshold()
    {
        return $this->element_count_threshold;
    }

    /**
     * The number of elements of a field collected into a batch which, if
     * exceeded, causes the batch to be sent.
     *
     * Generated from protobuf field <code>int32 element_count_threshold = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setElementCountThreshold($var)
    {
        GPBUtil::checkInt32($var);
        $this->element_count_threshold = $var;

        return $this;
    }

    /**
     * The aggregated size of the batched field which, if exceeded, causes the
     * batch to be sent. This size is computed by aggregating the sizes of the
     * request field to be batched, not of the entire request message.
     *
     * Generated from protobuf field <code>int64 request_byte_threshold = 2;</code>
     * @return int|string
     */
    public function getRequestByteThreshold()
    {
        return $this->request_byte_threshold;
    }

    /**
     * The aggregated size of the batched field which, if exceeded, causes the
     * batch to be sent. This size is computed by aggregating the sizes of the
     * request field to be batched, not of the entire request message.
     *
     * Generated from protobuf field <code>int64 request_byte_threshold = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRequestByteThreshold($var)
    {
        GPBUtil::checkInt64($var);
        $this->request_byte_threshold = $var;

        return $this;
    }

    /**
     * The duration after which a batch should be sent, starting from the addition
     * of the first message to that batch.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_threshold = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDelayThreshold()
    {
        return $this->delay_threshold;
    }

    public function hasDelayThreshold()
    {
        return isset($this->delay_threshold);
    }

    public function clearDelayThreshold()
    {
        unset($this->delay_threshold);
    }

    /**
     * The duration after which a batch should be sent, starting from the addition
     * of the first message to that batch.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration delay_threshold = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDelayThreshold($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->delay_threshold = $var;

        return $this;
    }

    /**
     * The maximum number of elements collected in a batch that could be accepted
     * by server.
     *
     * Generated from protobuf field <code>int32 element_count_limit = 4;</code>
     * @return int
     */
    public function getElementCountLimit()
    {
        return $this->element_count_limit;
    }

    /**
     * The maximum number of elements collected in a batch that could be accepted
     * by server.
     *
     * Generated from protobuf field <code>int32 element_count_limit = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setElementCountLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->element_count_limit = $var;

        return $this;
    }

    /**
     * The maximum size of the request that could be accepted by server.
     *
     * Generated from protobuf field <code>int32 request_byte_limit = 5;</code>
     * @return int
     */
    public function getRequestByteLimit()
    {
        return $this->request_byte_limit;
    }

    /**
     * The maximum size of the request that could be accepted by server.
     *
     * Generated from protobuf field <code>int32 request_byte_limit = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setRequestByteLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->request_byte_limit = $var;

        return $this;
    }

    /**
     * The maximum number of elements allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_element_limit = 6;</code>
     * @return int
     */
    public function getFlowControlElementLimit()
    {
        return $this->flow_control_element_limit;
    }

    /**
     * The maximum number of elements allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_element_limit = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setFlowControlElementLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->flow_control_element_limit = $var;

        return $this;
    }

    /**
     * The maximum size of data allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_byte_limit = 7;</code>
     * @return int
     */
    public function getFlowControlByteLimit()
    {
        return $this->flow_control_byte_limit;
    }

    /**
     * The maximum size of data allowed by flow control.
     *
     * Generated from protobuf field <code>int32 flow_control_byte_limit = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setFlowControlByteLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->flow_control_byte_limit = $var;

        return $this;
    }

    /**
     * The behavior to take when the flow control limit is exceeded.
     *
     * Generated from protobuf field <code>.google.api.FlowControlLimitExceededBehaviorProto flow_control_limit_exceeded_behavior = 8;</code>
     * @return int
     */
    public function getFlowControlLimitExceededBehavior()
    {
        return $this->flow_control_limit_exceeded_behavior;
    }

    /**
     * The behavior to take when the flow control limit is exceeded.
     *
     * Generated from protobuf field <code>.google.api.FlowControlLimitExceededBehaviorProto flow_control_limit_exceeded_behavior = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setFlowControlLimitExceededBehavior($var)
    {
        GPBUtil::checkEnum($var, \Google\Api\FlowControlLimitExceededBehaviorProto::class);
        $this->flow_control_limit_exceeded_behavior = $var;

        return $this;
    }

}

