<?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;

/**
 * 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>
     */
    private $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>
     */
    private $state = 0;
    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 \Google\Cloud\Deploy\V1\DeploymentJobs $deployment_jobs
     *           Output only. Deployment 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. 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;
    }

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

}

