<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.BackendServiceNetworkPassThroughLbTrafficPolicyZonalAffinity</code>
 */
class BackendServiceNetworkPassThroughLbTrafficPolicyZonalAffinity extends \Google\Protobuf\Internal\Message
{
    /**
     * This field indicates whether zonal affinity is enabled or not. The
     * possible values are:
     *    - ZONAL_AFFINITY_DISABLED: Default Value. Zonal Affinity
     *    is disabled. The load balancer distributes new connections to all
     *    healthy backend endpoints across all zones.
     *    - ZONAL_AFFINITY_STAY_WITHIN_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there are no healthy
     *    backend endpoints in the local zone, the load balancer distributes
     *    new connections to all backend endpoints in the local zone.
     *    - ZONAL_AFFINITY_SPILL_CROSS_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there aren't enough
     *    healthy backend endpoints in the local zone, the load balancer
     *    distributes new connections to all healthy backend endpoints across all
     *    zones.
     * Check the Spillover enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string spillover = 505501440;</code>
     */
    protected $spillover = null;
    /**
     * The value of the field must be in [0, 1]. When the ratio of the count
     * of healthy backend endpoints in a zone to the count of backend
     * endpoints in that same zone is equal to or above this threshold, the
     * load balancer distributes new connections to all healthy endpoints in
     * the local zone only. When the ratio of the count of healthy backend
     * endpoints in a zone to the count of backend endpoints in that same
     * zone is below this threshold, the load balancer distributes all new
     * connections to all healthy endpoints across all zones.
     *
     * Generated from protobuf field <code>optional float spillover_ratio = 135580172;</code>
     */
    protected $spillover_ratio = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $spillover
     *           This field indicates whether zonal affinity is enabled or not. The
     *           possible values are:
     *              - ZONAL_AFFINITY_DISABLED: Default Value. Zonal Affinity
     *              is disabled. The load balancer distributes new connections to all
     *              healthy backend endpoints across all zones.
     *              - ZONAL_AFFINITY_STAY_WITHIN_ZONE: Zonal Affinity is
     *              enabled. The load balancer distributes new connections to all healthy
     *              backend endpoints in the local zone only. If there are no healthy
     *              backend endpoints in the local zone, the load balancer distributes
     *              new connections to all backend endpoints in the local zone.
     *              - ZONAL_AFFINITY_SPILL_CROSS_ZONE: Zonal Affinity is
     *              enabled. The load balancer distributes new connections to all healthy
     *              backend endpoints in the local zone only. If there aren't enough
     *              healthy backend endpoints in the local zone, the load balancer
     *              distributes new connections to all healthy backend endpoints across all
     *              zones.
     *           Check the Spillover enum for the list of possible values.
     *     @type float $spillover_ratio
     *           The value of the field must be in [0, 1]. When the ratio of the count
     *           of healthy backend endpoints in a zone to the count of backend
     *           endpoints in that same zone is equal to or above this threshold, the
     *           load balancer distributes new connections to all healthy endpoints in
     *           the local zone only. When the ratio of the count of healthy backend
     *           endpoints in a zone to the count of backend endpoints in that same
     *           zone is below this threshold, the load balancer distributes all new
     *           connections to all healthy endpoints across all zones.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * This field indicates whether zonal affinity is enabled or not. The
     * possible values are:
     *    - ZONAL_AFFINITY_DISABLED: Default Value. Zonal Affinity
     *    is disabled. The load balancer distributes new connections to all
     *    healthy backend endpoints across all zones.
     *    - ZONAL_AFFINITY_STAY_WITHIN_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there are no healthy
     *    backend endpoints in the local zone, the load balancer distributes
     *    new connections to all backend endpoints in the local zone.
     *    - ZONAL_AFFINITY_SPILL_CROSS_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there aren't enough
     *    healthy backend endpoints in the local zone, the load balancer
     *    distributes new connections to all healthy backend endpoints across all
     *    zones.
     * Check the Spillover enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string spillover = 505501440;</code>
     * @return string
     */
    public function getSpillover()
    {
        return isset($this->spillover) ? $this->spillover : '';
    }

    public function hasSpillover()
    {
        return isset($this->spillover);
    }

    public function clearSpillover()
    {
        unset($this->spillover);
    }

    /**
     * This field indicates whether zonal affinity is enabled or not. The
     * possible values are:
     *    - ZONAL_AFFINITY_DISABLED: Default Value. Zonal Affinity
     *    is disabled. The load balancer distributes new connections to all
     *    healthy backend endpoints across all zones.
     *    - ZONAL_AFFINITY_STAY_WITHIN_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there are no healthy
     *    backend endpoints in the local zone, the load balancer distributes
     *    new connections to all backend endpoints in the local zone.
     *    - ZONAL_AFFINITY_SPILL_CROSS_ZONE: Zonal Affinity is
     *    enabled. The load balancer distributes new connections to all healthy
     *    backend endpoints in the local zone only. If there aren't enough
     *    healthy backend endpoints in the local zone, the load balancer
     *    distributes new connections to all healthy backend endpoints across all
     *    zones.
     * Check the Spillover enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string spillover = 505501440;</code>
     * @param string $var
     * @return $this
     */
    public function setSpillover($var)
    {
        GPBUtil::checkString($var, True);
        $this->spillover = $var;

        return $this;
    }

    /**
     * The value of the field must be in [0, 1]. When the ratio of the count
     * of healthy backend endpoints in a zone to the count of backend
     * endpoints in that same zone is equal to or above this threshold, the
     * load balancer distributes new connections to all healthy endpoints in
     * the local zone only. When the ratio of the count of healthy backend
     * endpoints in a zone to the count of backend endpoints in that same
     * zone is below this threshold, the load balancer distributes all new
     * connections to all healthy endpoints across all zones.
     *
     * Generated from protobuf field <code>optional float spillover_ratio = 135580172;</code>
     * @return float
     */
    public function getSpilloverRatio()
    {
        return isset($this->spillover_ratio) ? $this->spillover_ratio : 0.0;
    }

    public function hasSpilloverRatio()
    {
        return isset($this->spillover_ratio);
    }

    public function clearSpilloverRatio()
    {
        unset($this->spillover_ratio);
    }

    /**
     * The value of the field must be in [0, 1]. When the ratio of the count
     * of healthy backend endpoints in a zone to the count of backend
     * endpoints in that same zone is equal to or above this threshold, the
     * load balancer distributes new connections to all healthy endpoints in
     * the local zone only. When the ratio of the count of healthy backend
     * endpoints in a zone to the count of backend endpoints in that same
     * zone is below this threshold, the load balancer distributes all new
     * connections to all healthy endpoints across all zones.
     *
     * Generated from protobuf field <code>optional float spillover_ratio = 135580172;</code>
     * @param float $var
     * @return $this
     */
    public function setSpilloverRatio($var)
    {
        GPBUtil::checkFloat($var);
        $this->spillover_ratio = $var;

        return $this;
    }

}

