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

namespace Google\Cloud\OsConfig\V1\OSPolicyAssignment;

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

/**
 * Message to configure the rollout at the zonal level for the OS policy
 * assignment.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.OSPolicyAssignment.Rollout</code>
 */
class Rollout extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The maximum number (or percentage) of VMs per zone to disrupt
     * at any given moment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.FixedOrPercent disruption_budget = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $disruption_budget = null;
    /**
     * Required. This determines the minimum duration of time to wait after the
     * configuration changes are applied through the current rollout. A
     * VM continues to count towards the `disruption_budget` at least
     * until this duration of time has passed after configuration changes are
     * applied.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_wait_duration = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $min_wait_duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\OsConfig\V1\FixedOrPercent $disruption_budget
     *           Required. The maximum number (or percentage) of VMs per zone to disrupt
     *           at any given moment.
     *     @type \Google\Protobuf\Duration $min_wait_duration
     *           Required. This determines the minimum duration of time to wait after the
     *           configuration changes are applied through the current rollout. A
     *           VM continues to count towards the `disruption_budget` at least
     *           until this duration of time has passed after configuration changes are
     *           applied.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\OsPolicyAssignments::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The maximum number (or percentage) of VMs per zone to disrupt
     * at any given moment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.FixedOrPercent disruption_budget = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OsConfig\V1\FixedOrPercent|null
     */
    public function getDisruptionBudget()
    {
        return $this->disruption_budget;
    }

    public function hasDisruptionBudget()
    {
        return isset($this->disruption_budget);
    }

    public function clearDisruptionBudget()
    {
        unset($this->disruption_budget);
    }

    /**
     * Required. The maximum number (or percentage) of VMs per zone to disrupt
     * at any given moment.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.FixedOrPercent disruption_budget = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OsConfig\V1\FixedOrPercent $var
     * @return $this
     */
    public function setDisruptionBudget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\FixedOrPercent::class);
        $this->disruption_budget = $var;

        return $this;
    }

    /**
     * Required. This determines the minimum duration of time to wait after the
     * configuration changes are applied through the current rollout. A
     * VM continues to count towards the `disruption_budget` at least
     * until this duration of time has passed after configuration changes are
     * applied.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_wait_duration = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getMinWaitDuration()
    {
        return $this->min_wait_duration;
    }

    public function hasMinWaitDuration()
    {
        return isset($this->min_wait_duration);
    }

    public function clearMinWaitDuration()
    {
        unset($this->min_wait_duration);
    }

    /**
     * Required. This determines the minimum duration of time to wait after the
     * configuration changes are applied through the current rollout. A
     * VM continues to count towards the `disruption_budget` at least
     * until this duration of time has passed after configuration changes are
     * applied.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration min_wait_duration = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setMinWaitDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->min_wait_duration = $var;

        return $this;
    }

}


