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

namespace Google\Cloud\AutoMl\V1;

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

/**
 * Metadata used across all long running operations returned by AutoML API.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1.OperationMetadata</code>
 */
class OperationMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Progress of operation. Range: [0, 100].
     * Not used currently.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13;</code>
     */
    private $progress_percent = 0;
    /**
     * Output only. Partial failures encountered.
     * E.g. single files that couldn't be read.
     * This field should never exceed 20 entries.
     * Status details field will contain standard GCP error details.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status partial_failures = 2;</code>
     */
    private $partial_failures;
    /**
     * Output only. Time when the operation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</code>
     */
    private $create_time = null;
    /**
     * Output only. Time when the operation was updated for the last time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</code>
     */
    private $update_time = null;
    protected $details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $delete_details
     *           Details of a Delete operation.
     *     @type \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $deploy_model_details
     *           Details of a DeployModel operation.
     *     @type \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $undeploy_model_details
     *           Details of an UndeployModel operation.
     *     @type \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $create_model_details
     *           Details of CreateModel operation.
     *     @type \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $create_dataset_details
     *           Details of CreateDataset operation.
     *     @type \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $import_data_details
     *           Details of ImportData operation.
     *     @type \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $batch_predict_details
     *           Details of BatchPredict operation.
     *     @type \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $export_data_details
     *           Details of ExportData operation.
     *     @type \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $export_model_details
     *           Details of ExportModel operation.
     *     @type int $progress_percent
     *           Output only. Progress of operation. Range: [0, 100].
     *           Not used currently.
     *     @type \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $partial_failures
     *           Output only. Partial failures encountered.
     *           E.g. single files that couldn't be read.
     *           This field should never exceed 20 entries.
     *           Status details field will contain standard GCP error details.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Time when the operation was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. Time when the operation was updated for the last time.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1\Operations::initOnce();
        parent::__construct($data);
    }

    /**
     * Details of a Delete operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8;</code>
     * @return \Google\Cloud\AutoMl\V1\DeleteOperationMetadata
     */
    public function getDeleteDetails()
    {
        return $this->readOneof(8);
    }

    /**
     * Details of a Delete operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.DeleteOperationMetadata delete_details = 8;</code>
     * @param \Google\Cloud\AutoMl\V1\DeleteOperationMetadata $var
     * @return $this
     */
    public function setDeleteDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeleteOperationMetadata::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Details of a DeployModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24;</code>
     * @return \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata
     */
    public function getDeployModelDetails()
    {
        return $this->readOneof(24);
    }

    /**
     * Details of a DeployModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.DeployModelOperationMetadata deploy_model_details = 24;</code>
     * @param \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata $var
     * @return $this
     */
    public function setDeployModelDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\DeployModelOperationMetadata::class);
        $this->writeOneof(24, $var);

        return $this;
    }

    /**
     * Details of an UndeployModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25;</code>
     * @return \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata
     */
    public function getUndeployModelDetails()
    {
        return $this->readOneof(25);
    }

    /**
     * Details of an UndeployModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.UndeployModelOperationMetadata undeploy_model_details = 25;</code>
     * @param \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata $var
     * @return $this
     */
    public function setUndeployModelDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\UndeployModelOperationMetadata::class);
        $this->writeOneof(25, $var);

        return $this;
    }

    /**
     * Details of CreateModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10;</code>
     * @return \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata
     */
    public function getCreateModelDetails()
    {
        return $this->readOneof(10);
    }

    /**
     * Details of CreateModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.CreateModelOperationMetadata create_model_details = 10;</code>
     * @param \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata $var
     * @return $this
     */
    public function setCreateModelDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateModelOperationMetadata::class);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Details of CreateDataset operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30;</code>
     * @return \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata
     */
    public function getCreateDatasetDetails()
    {
        return $this->readOneof(30);
    }

    /**
     * Details of CreateDataset operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.CreateDatasetOperationMetadata create_dataset_details = 30;</code>
     * @param \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata $var
     * @return $this
     */
    public function setCreateDatasetDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\CreateDatasetOperationMetadata::class);
        $this->writeOneof(30, $var);

        return $this;
    }

    /**
     * Details of ImportData operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15;</code>
     * @return \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata
     */
    public function getImportDataDetails()
    {
        return $this->readOneof(15);
    }

    /**
     * Details of ImportData operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ImportDataOperationMetadata import_data_details = 15;</code>
     * @param \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata $var
     * @return $this
     */
    public function setImportDataDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ImportDataOperationMetadata::class);
        $this->writeOneof(15, $var);

        return $this;
    }

    /**
     * Details of BatchPredict operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16;</code>
     * @return \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata
     */
    public function getBatchPredictDetails()
    {
        return $this->readOneof(16);
    }

    /**
     * Details of BatchPredict operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.BatchPredictOperationMetadata batch_predict_details = 16;</code>
     * @param \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata $var
     * @return $this
     */
    public function setBatchPredictDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\BatchPredictOperationMetadata::class);
        $this->writeOneof(16, $var);

        return $this;
    }

    /**
     * Details of ExportData operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21;</code>
     * @return \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata
     */
    public function getExportDataDetails()
    {
        return $this->readOneof(21);
    }

    /**
     * Details of ExportData operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ExportDataOperationMetadata export_data_details = 21;</code>
     * @param \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata $var
     * @return $this
     */
    public function setExportDataDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportDataOperationMetadata::class);
        $this->writeOneof(21, $var);

        return $this;
    }

    /**
     * Details of ExportModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22;</code>
     * @return \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata
     */
    public function getExportModelDetails()
    {
        return $this->readOneof(22);
    }

    /**
     * Details of ExportModel operation.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1.ExportModelOperationMetadata export_model_details = 22;</code>
     * @param \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata $var
     * @return $this
     */
    public function setExportModelDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1\ExportModelOperationMetadata::class);
        $this->writeOneof(22, $var);

        return $this;
    }

    /**
     * Output only. Progress of operation. Range: [0, 100].
     * Not used currently.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13;</code>
     * @return int
     */
    public function getProgressPercent()
    {
        return $this->progress_percent;
    }

    /**
     * Output only. Progress of operation. Range: [0, 100].
     * Not used currently.
     *
     * Generated from protobuf field <code>int32 progress_percent = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setProgressPercent($var)
    {
        GPBUtil::checkInt32($var);
        $this->progress_percent = $var;

        return $this;
    }

    /**
     * Output only. Partial failures encountered.
     * E.g. single files that couldn't be read.
     * This field should never exceed 20 entries.
     * Status details field will contain standard GCP error details.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status partial_failures = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPartialFailures()
    {
        return $this->partial_failures;
    }

    /**
     * Output only. Partial failures encountered.
     * E.g. single files that couldn't be read.
     * This field should never exceed 20 entries.
     * Status details field will contain standard GCP error details.
     *
     * Generated from protobuf field <code>repeated .google.rpc.Status partial_failures = 2;</code>
     * @param \Google\Rpc\Status[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPartialFailures($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class);
        $this->partial_failures = $arr;

        return $this;
    }

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

    /**
     * Output only. Time when the operation was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3;</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;
    }

    /**
     * Output only. Time when the operation was updated for the last time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    /**
     * Output only. Time when the operation was updated for the last time.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

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

}

