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

/**
 * Phase represents a collection of jobs that are logically grouped together
 * for a `Rollout`.
 *
 * Generated from protobuf message <code>google.cloud.deploy.v1.Phase</code>
 */
class Phase extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The ID of the Phase.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $id = '';
    /**
     * Output only. Current state of the Phase.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.Phase.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Output only. Additional information on why the Phase was skipped, if
     * available.
     *
     * Generated from protobuf field <code>string skip_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $skip_message = '';
    protected $jobs;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Output only. The ID of the Phase.
     *     @type int $state
     *           Output only. Current state of the Phase.
     *     @type string $skip_message
     *           Output only. Additional information on why the Phase was skipped, if
     *           available.
     *     @type \Google\Cloud\Deploy\V1\DeploymentJobs $deployment_jobs
     *           Output only. Deployment job composition.
     *     @type \Google\Cloud\Deploy\V1\ChildRolloutJobs $child_rollout_jobs
     *           Output only. ChildRollout job composition.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The ID of the Phase.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Output only. The ID of the Phase.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Output only. Current state of the Phase.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.Phase.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. Current state of the Phase.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.Phase.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Phase\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. Additional information on why the Phase was skipped, if
     * available.
     *
     * Generated from protobuf field <code>string skip_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getSkipMessage()
    {
        return $this->skip_message;
    }

    /**
     * Output only. Additional information on why the Phase was skipped, if
     * available.
     *
     * Generated from protobuf field <code>string skip_message = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setSkipMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->skip_message = $var;

        return $this;
    }

    /**
     * Output only. Deployment job composition.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.DeploymentJobs deployment_jobs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Deploy\V1\DeploymentJobs|null
     */
    public function getDeploymentJobs()
    {
        return $this->readOneof(4);
    }

    public function hasDeploymentJobs()
    {
        return $this->hasOneof(4);
    }

    /**
     * Output only. Deployment job composition.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.DeploymentJobs deployment_jobs = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Deploy\V1\DeploymentJobs $var
     * @return $this
     */
    public function setDeploymentJobs($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\DeploymentJobs::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Output only. ChildRollout job composition.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.ChildRolloutJobs child_rollout_jobs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Deploy\V1\ChildRolloutJobs|null
     */
    public function getChildRolloutJobs()
    {
        return $this->readOneof(5);
    }

    public function hasChildRolloutJobs()
    {
        return $this->hasOneof(5);
    }

    /**
     * Output only. ChildRollout job composition.
     *
     * Generated from protobuf field <code>.google.cloud.deploy.v1.ChildRolloutJobs child_rollout_jobs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Deploy\V1\ChildRolloutJobs $var
     * @return $this
     */
    public function setChildRolloutJobs($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\ChildRolloutJobs::class);
        $this->writeOneof(5, $var);

        return $this;
    }

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

}

