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

namespace Google\Cloud\Compute\V1;

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

/**
 * Settings controlling the volume of connections to a backend service.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.CircuitBreakers</code>
 */
class CircuitBreakers extends \Google\Protobuf\Internal\Message
{
    /**
     * The maximum number of connections to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_connections = 110652154;</code>
     */
    private $max_connections = 0;
    /**
     * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_pending_requests = 107123431;</code>
     */
    private $max_pending_requests = 0;
    /**
     * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_requests = 28097599;</code>
     */
    private $max_requests = 0;
    /**
     * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.
     *
     * Generated from protobuf field <code>int32 max_requests_per_connection = 93195072;</code>
     */
    private $max_requests_per_connection = 0;
    /**
     * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1.
     *
     * Generated from protobuf field <code>int32 max_retries = 55546219;</code>
     */
    private $max_retries = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $max_connections
     *           The maximum number of connections to the backend service. If not specified, there is no limit.
     *     @type int $max_pending_requests
     *           The maximum number of pending requests allowed to the backend service. If not specified, there is no limit.
     *     @type int $max_requests
     *           The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit.
     *     @type int $max_requests_per_connection
     *           Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.
     *     @type int $max_retries
     *           The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The maximum number of connections to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_connections = 110652154;</code>
     * @return int
     */
    public function getMaxConnections()
    {
        return $this->max_connections;
    }

    /**
     * The maximum number of connections to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_connections = 110652154;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxConnections($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_connections = $var;

        return $this;
    }

    /**
     * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_pending_requests = 107123431;</code>
     * @return int
     */
    public function getMaxPendingRequests()
    {
        return $this->max_pending_requests;
    }

    /**
     * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_pending_requests = 107123431;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxPendingRequests($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_pending_requests = $var;

        return $this;
    }

    /**
     * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_requests = 28097599;</code>
     * @return int
     */
    public function getMaxRequests()
    {
        return $this->max_requests;
    }

    /**
     * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>int32 max_requests = 28097599;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxRequests($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_requests = $var;

        return $this;
    }

    /**
     * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.
     *
     * Generated from protobuf field <code>int32 max_requests_per_connection = 93195072;</code>
     * @return int
     */
    public function getMaxRequestsPerConnection()
    {
        return $this->max_requests_per_connection;
    }

    /**
     * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive.
     *
     * Generated from protobuf field <code>int32 max_requests_per_connection = 93195072;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxRequestsPerConnection($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_requests_per_connection = $var;

        return $this;
    }

    /**
     * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1.
     *
     * Generated from protobuf field <code>int32 max_retries = 55546219;</code>
     * @return int
     */
    public function getMaxRetries()
    {
        return $this->max_retries;
    }

    /**
     * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1.
     *
     * Generated from protobuf field <code>int32 max_retries = 55546219;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxRetries($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_retries = $var;

        return $this;
    }

}

