//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
{
///
/// Result message object with timestamp and actual message
///
public class ResultMessage
{
///
/// ID of the batch that generated this message. If null, this message
/// was not generated as part of a batch
///
public int? BatchId { get; set; }
///
/// Whether or not this message is an error
///
public bool IsError { get; set; }
///
/// Timestamp of the message
/// Stored in UTC ISO 8601 format; should be localized before displaying to any user
///
public string Time { get; set; }
///
/// Message contents
///
public string Message { get; set; }
///
/// Constructor with default "Now" time
///
public ResultMessage(string message, bool isError, int? batchId)
{
BatchId = batchId;
IsError = isError;
Time = DateTime.Now.ToString("o");
Message = message;
}
///
/// Default constructor, used for deserializing JSON RPC only
///
public ResultMessage()
{
}
}
}