<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/translate/v3/automl_translation.proto

namespace Google\Cloud\Translate\V3\BatchTransferResourcesResponse;

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

/**
 * Transfer response for a single resource.
 *
 * Generated from protobuf message <code>google.cloud.translation.v3.BatchTransferResourcesResponse.TransferResourceResponse</code>
 */
class TransferResourceResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Full name of the resource to transfer as specified in the request.
     *
     * Generated from protobuf field <code>string source = 1;</code>
     */
    private $source = '';
    /**
     * Full name of the new resource successfully transferred from the source
     * hosted by Translation API. Target will be empty if the transfer failed.
     *
     * Generated from protobuf field <code>string target = 2;</code>
     */
    private $target = '';
    /**
     * The error result in case of failure.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     */
    private $error = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $source
     *           Full name of the resource to transfer as specified in the request.
     *     @type string $target
     *           Full name of the new resource successfully transferred from the source
     *           hosted by Translation API. Target will be empty if the transfer failed.
     *     @type \Google\Rpc\Status $error
     *           The error result in case of failure.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Translate\V3\AutomlTranslation::initOnce();
        parent::__construct($data);
    }

    /**
     * Full name of the resource to transfer as specified in the request.
     *
     * Generated from protobuf field <code>string source = 1;</code>
     * @return string
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * Full name of the resource to transfer as specified in the request.
     *
     * Generated from protobuf field <code>string source = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkString($var, True);
        $this->source = $var;

        return $this;
    }

    /**
     * Full name of the new resource successfully transferred from the source
     * hosted by Translation API. Target will be empty if the transfer failed.
     *
     * Generated from protobuf field <code>string target = 2;</code>
     * @return string
     */
    public function getTarget()
    {
        return $this->target;
    }

    /**
     * Full name of the new resource successfully transferred from the source
     * hosted by Translation API. Target will be empty if the transfer failed.
     *
     * Generated from protobuf field <code>string target = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkString($var, True);
        $this->target = $var;

        return $this;
    }

    /**
     * The error result in case of failure.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * The error result in case of failure.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 3;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TransferResourceResponse::class, \Google\Cloud\Translate\V3\BatchTransferResourcesResponse_TransferResourceResponse::class);

