﻿using System.Collections.Generic;
using System.Runtime.InteropServices;
using System;

namespace ChatSDK
{
    /**
     * The generic class which contains the cursor and pagination result.
     * 
     * The class instance is returned when you make a paginated query.
     * 
     */
    public class CursorResult<T>
    {
        /**
	     * The cursor.
	     */
        public string Cursor { get; internal set; }

        /**
        * The data list.
        */
        public List<T> Data { get; internal set; }
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct CursorResultTO
    {
        public string NextPageCursor;
        public DataType Type;
        public int Size;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 200)]
        public MessageBodyType[] SubTypes; //sub types if any
        [MarshalAs(UnmanagedType.ByValArray,SizeConst = 200)]
        public IntPtr[] Data; //list of data
    }
}
