<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/migration/v2/migration_entities.proto

namespace Google\Cloud\BigQuery\Migration\V2;

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

/**
 * A migration workflow which specifies what needs to be done for an EDW
 * migration.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.migration.v2.MigrationWorkflow</code>
 */
class MigrationWorkflow extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Immutable. The unique identifier for the migration workflow.
     * The ID is server-generated.
     * Example: `projects/123/locations/us/workflows/345`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $name = '';
    /**
     * The display name of the workflow. This can be set to give a workflow
     * a descriptive name. There is no guarantee or enforcement of uniqueness.
     *
     * Generated from protobuf field <code>string display_name = 6;</code>
     */
    private $display_name = '';
    /**
     * The tasks in a workflow in a named map. The name (i.e. key) has no
     * meaning and is merely a convenient way to address a specific task
     * in a workflow.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.bigquery.migration.v2.MigrationTask> tasks = 2;</code>
     */
    private $tasks;
    /**
     * Output only. That status of the workflow.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Time when the workflow was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     */
    private $create_time = null;
    /**
     * Time when the workflow was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 5;</code>
     */
    private $last_update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Immutable. The unique identifier for the migration workflow.
     *           The ID is server-generated.
     *           Example: `projects/123/locations/us/workflows/345`
     *     @type string $display_name
     *           The display name of the workflow. This can be set to give a workflow
     *           a descriptive name. There is no guarantee or enforcement of uniqueness.
     *     @type array|\Google\Protobuf\Internal\MapField $tasks
     *           The tasks in a workflow in a named map. The name (i.e. key) has no
     *           meaning and is merely a convenient way to address a specific task
     *           in a workflow.
     *     @type int $state
     *           Output only. That status of the workflow.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Time when the workflow was created.
     *     @type \Google\Protobuf\Timestamp $last_update_time
     *           Time when the workflow was last updated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Immutable. The unique identifier for the migration workflow.
     * The ID is server-generated.
     * Example: `projects/123/locations/us/workflows/345`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. Immutable. The unique identifier for the migration workflow.
     * The ID is server-generated.
     * Example: `projects/123/locations/us/workflows/345`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The display name of the workflow. This can be set to give a workflow
     * a descriptive name. There is no guarantee or enforcement of uniqueness.
     *
     * Generated from protobuf field <code>string display_name = 6;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The display name of the workflow. This can be set to give a workflow
     * a descriptive name. There is no guarantee or enforcement of uniqueness.
     *
     * Generated from protobuf field <code>string display_name = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * The tasks in a workflow in a named map. The name (i.e. key) has no
     * meaning and is merely a convenient way to address a specific task
     * in a workflow.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.bigquery.migration.v2.MigrationTask> tasks = 2;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getTasks()
    {
        return $this->tasks;
    }

    /**
     * The tasks in a workflow in a named map. The name (i.e. key) has no
     * meaning and is merely a convenient way to address a specific task
     * in a workflow.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.bigquery.migration.v2.MigrationTask> tasks = 2;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setTasks($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\MigrationTask::class);
        $this->tasks = $arr;

        return $this;
    }

    /**
     * Output only. That status of the workflow.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. That status of the workflow.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.MigrationWorkflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\MigrationWorkflow\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Time when the workflow was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Time when the workflow was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Time when the workflow was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastUpdateTime()
    {
        return $this->last_update_time;
    }

    public function hasLastUpdateTime()
    {
        return isset($this->last_update_time);
    }

    public function clearLastUpdateTime()
    {
        unset($this->last_update_time);
    }

    /**
     * Time when the workflow was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_update_time = $var;

        return $this;
    }

}

