﻿using System.Collections.Generic;

namespace Toofz.Gmail
{
    /// <summary>
    /// Response data from a UID FETCH command.
    /// </summary>
    public class FetchResponse
    {
        /// <summary>
        /// A collection of name-value pairs in the response. These are items from inline 
        /// data.
        /// </summary>
        public Dictionary<string, string> InlineData { get; private set; }

        /// <summary>
        /// A string containing the main data in the response. This is not parsed.
        /// </summary>
        public string Data { get; private set; }

        /// <summary>
        /// Initializes an instance of the <see cref="FetchResponse" /> class.
        /// </summary>
        /// <param name="dataItems">
        /// A collection of name-value pairs in the response.
        /// </param>
        /// <param name="data">
        /// A string containing the main data in the response.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="dataItems" /> is null.
        /// </exception>
        public FetchResponse(Dictionary<string, string> dataItems, string data)
        {
            dataItems.ThrowIfNull("dataItems");

            InlineData = dataItems;
            Data = data;
        }
    }
}
