<?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 single task for a migration which has details about the configuration of
 * the task.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.migration.v2.MigrationTask</code>
 */
class MigrationTask extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Immutable. The unique identifier for the migration task. The
     * ID is server-generated.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $id = '';
    /**
     * The type of the task. This must be one of the supported task types:
     * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
     * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
     * Translation_Snowflake2BQ, Translation_Netezza2BQ,
     * Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
     * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ.
     *
     * Generated from protobuf field <code>string type = 2;</code>
     */
    private $type = '';
    /**
     * Output only. The current state of the task.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.MigrationTask.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $state = 0;
    /**
     * Output only. An explanation that may be populated when the task is in
     * FAILED state.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $processing_error = null;
    /**
     * Time when the task was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</code>
     */
    private $create_time = null;
    /**
     * Time when the task was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 7;</code>
     */
    private $last_update_time = null;
    protected $task_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails $translation_config_details
     *           Task configuration for Batch SQL Translation.
     *     @type string $id
     *           Output only. Immutable. The unique identifier for the migration task. The
     *           ID is server-generated.
     *     @type string $type
     *           The type of the task. This must be one of the supported task types:
     *           Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
     *           Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
     *           Translation_Snowflake2BQ, Translation_Netezza2BQ,
     *           Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
     *           Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ.
     *     @type int $state
     *           Output only. The current state of the task.
     *     @type \Google\Rpc\ErrorInfo $processing_error
     *           Output only. An explanation that may be populated when the task is in
     *           FAILED state.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Time when the task was created.
     *     @type \Google\Protobuf\Timestamp $last_update_time
     *           Time when the task was last updated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce();
        parent::__construct($data);
    }

    /**
     * Task configuration for Batch SQL Translation.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.TranslationConfigDetails translation_config_details = 14;</code>
     * @return \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails|null
     */
    public function getTranslationConfigDetails()
    {
        return $this->readOneof(14);
    }

    public function hasTranslationConfigDetails()
    {
        return $this->hasOneof(14);
    }

    /**
     * Task configuration for Batch SQL Translation.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.migration.v2.TranslationConfigDetails translation_config_details = 14;</code>
     * @param \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails $var
     * @return $this
     */
    public function setTranslationConfigDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\TranslationConfigDetails::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * Output only. Immutable. The unique identifier for the migration task. The
     * ID is server-generated.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Output only. Immutable. The unique identifier for the migration task. The
     * ID is server-generated.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * The type of the task. This must be one of the supported task types:
     * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
     * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
     * Translation_Snowflake2BQ, Translation_Netezza2BQ,
     * Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
     * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ.
     *
     * Generated from protobuf field <code>string type = 2;</code>
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The type of the task. This must be one of the supported task types:
     * Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
     * Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
     * Translation_Snowflake2BQ, Translation_Netezza2BQ,
     * Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
     * Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ.
     *
     * Generated from protobuf field <code>string type = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkString($var, True);
        $this->type = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Output only. An explanation that may be populated when the task is in
     * FAILED state.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Rpc\ErrorInfo|null
     */
    public function getProcessingError()
    {
        return $this->processing_error;
    }

    public function hasProcessingError()
    {
        return isset($this->processing_error);
    }

    public function clearProcessingError()
    {
        unset($this->processing_error);
    }

    /**
     * Output only. An explanation that may be populated when the task is in
     * FAILED state.
     *
     * Generated from protobuf field <code>.google.rpc.ErrorInfo processing_error = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Rpc\ErrorInfo $var
     * @return $this
     */
    public function setProcessingError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class);
        $this->processing_error = $var;

        return $this;
    }

    /**
     * Time when the task was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</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 task was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6;</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 task was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 7;</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 task was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 7;</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;
    }

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

}

