using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EQNetwork.Objects;
using EQNetwork.Interfaces;
using EQNetwork.Utility;

namespace EQNetwork.Services
{
    public partial class CollectionService : ICollectionService
    {
        public EQTask Get(int collectionId, Action<Collection, EQException> onComplete) { return _api.Collection_Get(collectionId, onComplete); }
        public EQTask Get(Guid collectionGuid, Action<Collection, EQException> onComplete) { return _api.Collection_Get(collectionGuid, onComplete); }

        public EQTask Create(Collection collection, Action<Collection, EQException> onComplete) { return _api.Collection_Create(collection, onComplete); }

        public EQTask Update(Collection collection, Action<Collection, EQException> onComplete) { return _api.Collection_Update(collection, onComplete); }
        public EQTask UploadIcon(int collectionId, string path, Action<Collection, EQException> onComplete) { return UploadIcon(collectionId, new FileUploadSpec(path), onComplete); }
        public EQTask UploadIcon(int collectionId, FileUploadSpec fileUploadSpec, Action<Collection, EQException> onComplete)
        {
            Collection collection = new Collection();
            collection.CollectionId = collectionId;
            collection.Icon = fileUploadSpec;
            return Update(collection, onComplete);
        }
        public EQTask DeleteIcon(int collectionId, Action<Collection, EQException> onComplete)
        {
            Collection collection = new Collection();
            collection.CollectionId = collectionId;
            collection.Icon = null;
            return Update(collection, onComplete);
        }

        public EQTask Delete(Collection collection, Action<EQException> onComplete) { return _api.Collection_Delete(collection, onComplete); }
        public EQTask Delete(int collectionId, Action<EQException> onComplete) { return _api.Collection_Delete(collectionId, onComplete); }

        public EQTask ListContentFiles(int collectionId, ListContentFilesContext listContentFilesContext, PagingParameters pagingParameters, Action<List<ContentFile>, bool, EQException> onComplete) { return _api.Collection_ListContentFiles(collectionId, listContentFilesContext, pagingParameters, onComplete); }

        public EQTask AddRelationship(int collectionId, Db.User_CollectionType user_CollectionType, Action<EQException> onComplete) { return _api.Collection_AddRelationship(collectionId, user_CollectionType, onComplete); }
        public EQTask AddRelationship(int collectionId, Db.User_CollectionType user_CollectionType,
            int? collectionTriggerId, bool? silent, Action<EQException> onComplete) { return _api.Collection_AddRelationship(collectionId, user_CollectionType, collectionTriggerId, silent, onComplete); }

        public EQTask SocialAdd(int collectionId, string action, Db.SocialService? exclude, bool? force, Action<EQException> onComplete) { return _api.Collection_SocialAdd(collectionId, action, exclude, force, onComplete); }
        public EQTask SocialRemove(int collectionId, string action, bool? force, Action<EQException> onComplete) { return _api.Collection_SocialRemove(collectionId, action, force, onComplete); }

        public EQTask MarkAsViewed(int collectionId, Action<EQException> onComplete) { return _api.Collection_Viewed(collectionId, onComplete); }
    }
}
