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

namespace Google\Cloud\Deploy\V1;

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

/**
 * The `PromoteRelease` rule will automatically promote a release from the
 * current target to a specified target.
 *
 * Generated from protobuf message <code>google.cloud.deploy.v1.PromoteReleaseRule</code>
 */
class PromoteReleaseRule extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. ID of the rule. This id must be unique in the `Automation`
     * resource to which this rule belongs. The format is
     * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';
    /**
     * Optional. How long the release need to be paused until being promoted to
     * the next target.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $wait = null;
    /**
     * Optional. The ID of the stage in the pipeline to which this `Release` is
     * deploying. If unspecified, default it to the next stage in the promotion
     * flow. The value of this field could be one of the following:
     * * The last segment of a target name. It only needs the ID to determine
     * if the target is one of the stages in the promotion sequence defined
     * in the pipeline.
     * * "&#64;next", the next target in the promotion sequence.
     *
     * Generated from protobuf field <code>string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $destination_target_id = '';
    /**
     * Output only. Information around the state of the Automation rule.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $condition = null;
    /**
     * Optional. The starting phase of the rollout created by this operation.
     * Default to the first phase.
     *
     * Generated from protobuf field <code>string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $destination_phase = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Required. ID of the rule. This id must be unique in the `Automation`
     *           resource to which this rule belongs. The format is
     *           `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
     *     @type \Google\Protobuf\Duration $wait
     *           Optional. How long the release need to be paused until being promoted to
     *           the next target.
     *     @type string $destination_target_id
     *           Optional. The ID of the stage in the pipeline to which this `Release` is
     *           deploying. If unspecified, default it to the next stage in the promotion
     *           flow. The value of this field could be one of the following:
     *           * The last segment of a target name. It only needs the ID to determine
     *           if the target is one of the stages in the promotion sequence defined
     *           in the pipeline.
     *           * "&#64;next", the next target in the promotion sequence.
     *     @type \Google\Cloud\Deploy\V1\AutomationRuleCondition $condition
     *           Output only. Information around the state of the Automation rule.
     *     @type string $destination_phase
     *           Optional. The starting phase of the rollout created by this operation.
     *           Default to the first phase.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. ID of the rule. This id must be unique in the `Automation`
     * resource to which this rule belongs. The format is
     * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Required. ID of the rule. This id must be unique in the `Automation`
     * resource to which this rule belongs. The format is
     * `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Optional. How long the release need to be paused until being promoted to
     * the next target.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getWait()
    {
        return $this->wait;
    }

    public function hasWait()
    {
        return isset($this->wait);
    }

    public function clearWait()
    {
        unset($this->wait);
    }

    /**
     * Optional. How long the release need to be paused until being promoted to
     * the next target.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setWait($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->wait = $var;

        return $this;
    }

    /**
     * Optional. The ID of the stage in the pipeline to which this `Release` is
     * deploying. If unspecified, default it to the next stage in the promotion
     * flow. The value of this field could be one of the following:
     * * The last segment of a target name. It only needs the ID to determine
     * if the target is one of the stages in the promotion sequence defined
     * in the pipeline.
     * * "&#64;next", the next target in the promotion sequence.
     *
     * Generated from protobuf field <code>string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDestinationTargetId()
    {
        return $this->destination_target_id;
    }

    /**
     * Optional. The ID of the stage in the pipeline to which this `Release` is
     * deploying. If unspecified, default it to the next stage in the promotion
     * flow. The value of this field could be one of the following:
     * * The last segment of a target name. It only needs the ID to determine
     * if the target is one of the stages in the promotion sequence defined
     * in the pipeline.
     * * "&#64;next", the next target in the promotion sequence.
     *
     * Generated from protobuf field <code>string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationTargetId($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_target_id = $var;

        return $this;
    }

    /**
     * Output only. Information around the state of the Automation rule.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Deploy\V1\AutomationRuleCondition|null
     */
    public function getCondition()
    {
        return $this->condition;
    }

    public function hasCondition()
    {
        return isset($this->condition);
    }

    public function clearCondition()
    {
        unset($this->condition);
    }

    /**
     * Output only. Information around the state of the Automation rule.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Deploy\V1\AutomationRuleCondition $var
     * @return $this
     */
    public function setCondition($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationRuleCondition::class);
        $this->condition = $var;

        return $this;
    }

    /**
     * Optional. The starting phase of the rollout created by this operation.
     * Default to the first phase.
     *
     * Generated from protobuf field <code>string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDestinationPhase()
    {
        return $this->destination_phase;
    }

    /**
     * Optional. The starting phase of the rollout created by this operation.
     * Default to the first phase.
     *
     * Generated from protobuf field <code>string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDestinationPhase($var)
    {
        GPBUtil::checkString($var, True);
        $this->destination_phase = $var;

        return $this;
    }

}

