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

namespace Google\Cloud\BigQuery\DataTransfer\V1;

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

/**
 * Represents a user facing message for a particular data transfer run.
 *
 * Generated from protobuf message <code>google.cloud.bigquery.datatransfer.v1.TransferMessage</code>
 */
class TransferMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Time when message was logged.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp message_time = 1;</code>
     */
    private $message_time = null;
    /**
     * Message severity.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;</code>
     */
    private $severity = 0;
    /**
     * Message text.
     *
     * Generated from protobuf field <code>string message_text = 3;</code>
     */
    private $message_text = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $message_time
     *           Time when message was logged.
     *     @type int $severity
     *           Message severity.
     *     @type string $message_text
     *           Message text.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Datatransfer\V1\Transfer::initOnce();
        parent::__construct($data);
    }

    /**
     * Time when message was logged.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp message_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getMessageTime()
    {
        return $this->message_time;
    }

    public function hasMessageTime()
    {
        return isset($this->message_time);
    }

    public function clearMessageTime()
    {
        unset($this->message_time);
    }

    /**
     * Time when message was logged.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp message_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setMessageTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->message_time = $var;

        return $this;
    }

    /**
     * Message severity.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;</code>
     * @return int
     */
    public function getSeverity()
    {
        return $this->severity;
    }

    /**
     * Message severity.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity severity = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setSeverity($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage\MessageSeverity::class);
        $this->severity = $var;

        return $this;
    }

    /**
     * Message text.
     *
     * Generated from protobuf field <code>string message_text = 3;</code>
     * @return string
     */
    public function getMessageText()
    {
        return $this->message_text;
    }

    /**
     * Message text.
     *
     * Generated from protobuf field <code>string message_text = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMessageText($var)
    {
        GPBUtil::checkString($var, True);
        $this->message_text = $var;

        return $this;
    }

}

