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

namespace Google\Cloud\Container\V1;

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

/**
 * Settings for blue-green upgrade.
 *
 * Generated from protobuf message <code>google.container.v1.BlueGreenSettings</code>
 */
class BlueGreenSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Time needed after draining entire blue pool. After this period, blue pool
     * will be cleaned up.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration node_pool_soak_duration = 2;</code>
     */
    protected $node_pool_soak_duration = null;
    protected $rollout_policy;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Container\V1\BlueGreenSettings\StandardRolloutPolicy $standard_rollout_policy
     *           Standard policy for the blue-green upgrade.
     *     @type \Google\Cloud\Container\V1\BlueGreenSettings\AutoscaledRolloutPolicy $autoscaled_rollout_policy
     *           Autoscaled policy for cluster autoscaler enabled blue-green upgrade.
     *     @type \Google\Protobuf\Duration $node_pool_soak_duration
     *           Time needed after draining entire blue pool. After this period, blue pool
     *           will be cleaned up.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Standard policy for the blue-green upgrade.
     *
     * Generated from protobuf field <code>.google.container.v1.BlueGreenSettings.StandardRolloutPolicy standard_rollout_policy = 1;</code>
     * @return \Google\Cloud\Container\V1\BlueGreenSettings\StandardRolloutPolicy|null
     */
    public function getStandardRolloutPolicy()
    {
        return $this->readOneof(1);
    }

    public function hasStandardRolloutPolicy()
    {
        return $this->hasOneof(1);
    }

    /**
     * Standard policy for the blue-green upgrade.
     *
     * Generated from protobuf field <code>.google.container.v1.BlueGreenSettings.StandardRolloutPolicy standard_rollout_policy = 1;</code>
     * @param \Google\Cloud\Container\V1\BlueGreenSettings\StandardRolloutPolicy $var
     * @return $this
     */
    public function setStandardRolloutPolicy($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\BlueGreenSettings\StandardRolloutPolicy::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Autoscaled policy for cluster autoscaler enabled blue-green upgrade.
     *
     * Generated from protobuf field <code>.google.container.v1.BlueGreenSettings.AutoscaledRolloutPolicy autoscaled_rollout_policy = 3;</code>
     * @return \Google\Cloud\Container\V1\BlueGreenSettings\AutoscaledRolloutPolicy|null
     */
    public function getAutoscaledRolloutPolicy()
    {
        return $this->readOneof(3);
    }

    public function hasAutoscaledRolloutPolicy()
    {
        return $this->hasOneof(3);
    }

    /**
     * Autoscaled policy for cluster autoscaler enabled blue-green upgrade.
     *
     * Generated from protobuf field <code>.google.container.v1.BlueGreenSettings.AutoscaledRolloutPolicy autoscaled_rollout_policy = 3;</code>
     * @param \Google\Cloud\Container\V1\BlueGreenSettings\AutoscaledRolloutPolicy $var
     * @return $this
     */
    public function setAutoscaledRolloutPolicy($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Container\V1\BlueGreenSettings\AutoscaledRolloutPolicy::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Time needed after draining entire blue pool. After this period, blue pool
     * will be cleaned up.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration node_pool_soak_duration = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getNodePoolSoakDuration()
    {
        return $this->node_pool_soak_duration;
    }

    public function hasNodePoolSoakDuration()
    {
        return isset($this->node_pool_soak_duration);
    }

    public function clearNodePoolSoakDuration()
    {
        unset($this->node_pool_soak_duration);
    }

    /**
     * Time needed after draining entire blue pool. After this period, blue pool
     * will be cleaned up.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration node_pool_soak_duration = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setNodePoolSoakDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->node_pool_soak_duration = $var;

        return $this;
    }

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

}

