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

namespace Google\Cloud\ConfigDelivery\V1beta;

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

/**
 * RolloutStrategy defines different ways to rollout a resource bundle across
 * a set of clusters.
 *
 * Generated from protobuf message <code>google.cloud.configdelivery.v1beta.RolloutStrategy</code>
 */
class RolloutStrategy extends \Google\Protobuf\Internal\Message
{
    protected $strategy;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ConfigDelivery\V1beta\AllAtOnceStrategy $all_at_once
     *           AllAtOnceStrategy causes all clusters to be updated concurrently.
     *     @type \Google\Cloud\ConfigDelivery\V1beta\RollingStrategy $rolling
     *           RollingStrategy causes a specified number of clusters to be updated
     *           concurrently until all clusters are updated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Configdelivery\V1Beta\ConfigDelivery::initOnce();
        parent::__construct($data);
    }

    /**
     * AllAtOnceStrategy causes all clusters to be updated concurrently.
     *
     * Generated from protobuf field <code>.google.cloud.configdelivery.v1beta.AllAtOnceStrategy all_at_once = 1;</code>
     * @return \Google\Cloud\ConfigDelivery\V1beta\AllAtOnceStrategy|null
     */
    public function getAllAtOnce()
    {
        return $this->readOneof(1);
    }

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

    /**
     * AllAtOnceStrategy causes all clusters to be updated concurrently.
     *
     * Generated from protobuf field <code>.google.cloud.configdelivery.v1beta.AllAtOnceStrategy all_at_once = 1;</code>
     * @param \Google\Cloud\ConfigDelivery\V1beta\AllAtOnceStrategy $var
     * @return $this
     */
    public function setAllAtOnce($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ConfigDelivery\V1beta\AllAtOnceStrategy::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * RollingStrategy causes a specified number of clusters to be updated
     * concurrently until all clusters are updated.
     *
     * Generated from protobuf field <code>.google.cloud.configdelivery.v1beta.RollingStrategy rolling = 2;</code>
     * @return \Google\Cloud\ConfigDelivery\V1beta\RollingStrategy|null
     */
    public function getRolling()
    {
        return $this->readOneof(2);
    }

    public function hasRolling()
    {
        return $this->hasOneof(2);
    }

    /**
     * RollingStrategy causes a specified number of clusters to be updated
     * concurrently until all clusters are updated.
     *
     * Generated from protobuf field <code>.google.cloud.configdelivery.v1beta.RollingStrategy rolling = 2;</code>
     * @param \Google\Cloud\ConfigDelivery\V1beta\RollingStrategy $var
     * @return $this
     */
    public function setRolling($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ConfigDelivery\V1beta\RollingStrategy::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

