<?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 requests, connections and retries to this 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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_connections = 110652154;</code>
     */
    private $max_connections = null;
    /**
     * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_pending_requests = 375558887;</code>
     */
    private $max_pending_requests = null;
    /**
     * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit.
     *
     * Generated from protobuf field <code>optional int32 max_requests = 28097599;</code>
     */
    private $max_requests = null;
    /**
     * 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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_requests_per_connection = 361630528;</code>
     */
    private $max_requests_per_connection = null;
    /**
     * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_retries = 55546219;</code>
     */
    private $max_retries = null;

    /**
     * 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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *     @type int $max_pending_requests
     *           The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *     @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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *     @type int $max_retries
     *           The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     * }
     */
    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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_connections = 110652154;</code>
     * @return int
     */
    public function getMaxConnections()
    {
        return isset($this->max_connections) ? $this->max_connections : 0;
    }

    public function hasMaxConnections()
    {
        return isset($this->max_connections);
    }

    public function clearMaxConnections()
    {
        unset($this->max_connections);
    }

    /**
     * The maximum number of connections to the backend service. If not specified, there is no limit. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional 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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_pending_requests = 375558887;</code>
     * @return int
     */
    public function getMaxPendingRequests()
    {
        return isset($this->max_pending_requests) ? $this->max_pending_requests : 0;
    }

    public function hasMaxPendingRequests()
    {
        return isset($this->max_pending_requests);
    }

    public function clearMaxPendingRequests()
    {
        unset($this->max_pending_requests);
    }

    /**
     * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_pending_requests = 375558887;</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>optional int32 max_requests = 28097599;</code>
     * @return int
     */
    public function getMaxRequests()
    {
        return isset($this->max_requests) ? $this->max_requests : 0;
    }

    public function hasMaxRequests()
    {
        return isset($this->max_requests);
    }

    public function clearMaxRequests()
    {
        unset($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>optional 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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_requests_per_connection = 361630528;</code>
     * @return int
     */
    public function getMaxRequestsPerConnection()
    {
        return isset($this->max_requests_per_connection) ? $this->max_requests_per_connection : 0;
    }

    public function hasMaxRequestsPerConnection()
    {
        return isset($this->max_requests_per_connection);
    }

    public function clearMaxRequestsPerConnection()
    {
        unset($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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_requests_per_connection = 361630528;</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. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_retries = 55546219;</code>
     * @return int
     */
    public function getMaxRetries()
    {
        return isset($this->max_retries) ? $this->max_retries : 0;
    }

    public function hasMaxRetries()
    {
        return isset($this->max_retries);
    }

    public function clearMaxRetries()
    {
        unset($this->max_retries);
    }

    /**
     * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
     *
     * Generated from protobuf field <code>optional int32 max_retries = 55546219;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxRetries($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_retries = $var;

        return $this;
    }

}

