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

/**
 * 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>
     */
    private $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\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;
    }

    /**
     * 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");
    }

}

