diff --git a/SlackAPI/RPCMessages/ChannelListResponse.cs b/SlackAPI/RPCMessages/ChannelListResponse.cs deleted file mode 100644 index 22280c1..0000000 --- a/SlackAPI/RPCMessages/ChannelListResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace SlackAPI -{ - [RequestPath("channels.list")] - public class ChannelListResponse : Response - { - public Channel[] channels; - } -} diff --git a/SlackAPI/RPCMessages/GroupArchiveResponse.cs b/SlackAPI/RPCMessages/GroupArchiveResponse.cs deleted file mode 100644 index d043012..0000000 --- a/SlackAPI/RPCMessages/GroupArchiveResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.archive")] - public class GroupArchiveResponse : Response - { - } -} diff --git a/SlackAPI/RPCMessages/GroupCloseResponse.cs b/SlackAPI/RPCMessages/GroupCloseResponse.cs deleted file mode 100644 index d0fdcd2..0000000 --- a/SlackAPI/RPCMessages/GroupCloseResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.close")] - public class GroupCloseResponse : Response - { - public string no_op; - public string already_closed; - } -} diff --git a/SlackAPI/RPCMessages/GroupCreateChildResponse.cs b/SlackAPI/RPCMessages/GroupCreateChildResponse.cs deleted file mode 100644 index 51d495e..0000000 --- a/SlackAPI/RPCMessages/GroupCreateChildResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.createChild")] - public class GroupCreateChildResponse : GroupResponse - { - } -} diff --git a/SlackAPI/RPCMessages/GroupKickResponse.cs b/SlackAPI/RPCMessages/GroupKickResponse.cs deleted file mode 100644 index 3213fb2..0000000 --- a/SlackAPI/RPCMessages/GroupKickResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.kick")] - public class GroupKickResponse : Response - { - } -} diff --git a/SlackAPI/RPCMessages/GroupLeaveResponse.cs b/SlackAPI/RPCMessages/GroupLeaveResponse.cs deleted file mode 100644 index 9c96122..0000000 --- a/SlackAPI/RPCMessages/GroupLeaveResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.leave")] - public class GroupLeaveResponse : Response - { - } -} diff --git a/SlackAPI/RPCMessages/GroupListResponse.cs b/SlackAPI/RPCMessages/GroupListResponse.cs deleted file mode 100644 index d8ad777..0000000 --- a/SlackAPI/RPCMessages/GroupListResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.list")] - public class GroupListResponse : Response - { - public Channel[] groups; - } -} diff --git a/SlackAPI/RPCMessages/GroupMessageHistory.cs b/SlackAPI/RPCMessages/GroupMessageHistory.cs deleted file mode 100644 index 5708ca8..0000000 --- a/SlackAPI/RPCMessages/GroupMessageHistory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace SlackAPI -{ - [RequestPath("groups.history")] - public class GroupMessageHistory : MessageHistory - { - } -} diff --git a/SlackAPI/RPCMessages/GroupRenameResponse.cs b/SlackAPI/RPCMessages/GroupRenameResponse.cs deleted file mode 100644 index 6590576..0000000 --- a/SlackAPI/RPCMessages/GroupRenameResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.rename")] - public class GroupRenameResponse : Response - { - public Channel channel; - } -} diff --git a/SlackAPI/RPCMessages/GroupSetPurposeResponse.cs b/SlackAPI/RPCMessages/GroupSetPurposeResponse.cs deleted file mode 100644 index 93a061c..0000000 --- a/SlackAPI/RPCMessages/GroupSetPurposeResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.setPurpose")] - public class GroupSetPurposeResponse : Response - { - public string purpose; - } -} diff --git a/SlackAPI/RPCMessages/GroupSetTopicResponse.cs b/SlackAPI/RPCMessages/GroupSetTopicResponse.cs deleted file mode 100644 index f8adab9..0000000 --- a/SlackAPI/RPCMessages/GroupSetTopicResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.setTopic")] - public class GroupSetTopicResponse : Response - { - public string topic; - } -} diff --git a/SlackAPI/RPCMessages/GroupUnarchiveResponse.cs b/SlackAPI/RPCMessages/GroupUnarchiveResponse.cs deleted file mode 100644 index d68061c..0000000 --- a/SlackAPI/RPCMessages/GroupUnarchiveResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SlackAPI -{ - [RequestPath("groups.unarchive")] - public class GroupUnarchiveResponse : Response - { - } -} diff --git a/SlackAPI/RPCMessages/MessageHistory.cs b/SlackAPI/RPCMessages/MessageHistory.cs index 8fb797a..f760d78 100644 --- a/SlackAPI/RPCMessages/MessageHistory.cs +++ b/SlackAPI/RPCMessages/MessageHistory.cs @@ -3,8 +3,7 @@ namespace SlackAPI { - [RequestPath("im.history")] - public class MessageHistory : Response + public abstract class MessageHistory : Response { /// /// I believe this is where the read cursor is? IE: How far the user has read. diff --git a/SlackAPI/SlackClient.cs b/SlackAPI/SlackClient.cs index e81a55c..b8b72df 100644 --- a/SlackAPI/SlackClient.cs +++ b/SlackAPI/SlackClient.cs @@ -170,16 +170,7 @@ public void GetConversationsMembers(Action callbac APIRequestWithToken(callback, parameters.ToArray()); } - public void GetChannelList(Action callback, bool ExcludeArchived = true) - { - APIRequestWithToken(callback, new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); - } - - public void GetGroupsList(Action callback, bool ExcludeArchived = true) - { - APIRequestWithToken(callback, new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); - } - + [Obsolete("Use conversations API")] public void GetDirectMessageList(Action callback) { APIRequestWithToken(callback); @@ -260,11 +251,6 @@ public void GetDirectMessageHistory(Action callback, DirectMessa GetHistory(callback, conversationInfo.id, latest, oldest, count, unreads); } - public void GetGroupHistory(Action callback, Channel groupInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false) - { - GetHistory(callback, groupInfo.id, latest, oldest, count, unreads); - } - public void GetConversationsHistory(Action callback, Channel conversationInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false) { GetHistory(callback, conversationInfo.id, latest, oldest, count, unreads); @@ -293,26 +279,14 @@ public void GetFileInfo(Action callback, string fileId, int? p APIRequestWithToken(callback, parameters.ToArray()); } #region Groups - public void GroupsArchive(Action callback, string channelId) - { - APIRequestWithToken(callback, new Tuple("channel", channelId)); - } - - public void GroupsClose(Action callback, string channelId) - { - APIRequestWithToken(callback, new Tuple("channel", channelId)); - } + [Obsolete("Use conversations API")] public void GroupsCreate(Action callback, string name) { APIRequestWithToken(callback, new Tuple("name", name)); } - public void GroupsCreateChild(Action callback, string channelId) - { - APIRequestWithToken(callback, new Tuple("channel", channelId)); - } - + [Obsolete("Use conversations API")] public void GroupsInvite(Action callback, string userId, string channelId) { List> parameters = new List>(); @@ -323,66 +297,18 @@ public void GroupsInvite(Action callback, string userId, st APIRequestWithToken(callback, parameters.ToArray()); } - public void GroupsKick(Action callback, string userId, string channelId) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("user", userId)); - - APIRequestWithToken(callback, parameters.ToArray()); - } - - public void GroupsLeave(Action callback, string channelId) - { - APIRequestWithToken(callback, new Tuple("channel", channelId)); - } - + [Obsolete("Use conversations API")] public void GroupsMark(Action callback, string channelId, DateTime ts) { APIRequestWithToken(callback, new Tuple("channel", channelId), new Tuple("ts", ts.ToProperTimeStamp())); } + [Obsolete("Use conversations API")] public void GroupsOpen(Action callback, string channelId) { APIRequestWithToken(callback, new Tuple("channel", channelId)); } - public void GroupsRename(Action callback, string channelId, string name) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("name", name)); - - APIRequestWithToken(callback, parameters.ToArray()); - } - - public void GroupsSetPurpose(Action callback, string channelId, string purpose) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("purpose", purpose)); - - APIRequestWithToken(callback, parameters.ToArray()); - } - - public void GroupsSetTopic(Action callback, string channelId, string topic) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("topic", topic)); - - APIRequestWithToken(callback, parameters.ToArray()); - } - - public void GroupsUnarchive(Action callback, string channelId) - { - APIRequestWithToken(callback, new Tuple("channel", channelId)); - } - #endregion #region Conversations diff --git a/SlackAPI/SlackTaskClient.cs b/SlackAPI/SlackTaskClient.cs index fd65669..1b7b305 100644 --- a/SlackAPI/SlackTaskClient.cs +++ b/SlackAPI/SlackTaskClient.cs @@ -124,10 +124,12 @@ public Task GetUserByEmailAsync(string email) return APIRequestWithTokenAsync(new Tuple("email", email)); } + [Obsolete("Use conversations API")] public Task ChannelsCreateAsync(string name) { return APIRequestWithTokenAsync(new Tuple("name", name)); } + [Obsolete("Use conversations API")] public Task ChannelsInviteAsync(string userId, string channelId) { List> parameters = new List>(); @@ -168,16 +170,6 @@ public Task GetConversationsMembersAsync(string ch return APIRequestWithTokenAsync(parameters.ToArray()); } - public Task GetChannelListAsync(bool ExcludeArchived = true) - { - return APIRequestWithTokenAsync(new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); - } - - public Task GetGroupsListAsync(bool ExcludeArchived = true) - { - return APIRequestWithTokenAsync(new Tuple("exclude_archived", ExcludeArchived ? "1" : "0")); - } - public Task GetDirectMessageListAsync() { return APIRequestWithTokenAsync(); @@ -255,11 +247,6 @@ public Task GetDirectMessageHistoryAsync(DirectMessageConversati return GetHistoryAsync(conversationInfo.id, latest, oldest, count, unreads); } - public Task GetGroupHistoryAsync(Channel groupInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false) - { - return GetHistoryAsync(groupInfo.id, latest, oldest, count, unreads); - } - public Task GetConversationsHistoryAsync(Channel conversationInfo, DateTime? latest = null, DateTime? oldest = null, int? count = null, bool? unreads = false) { return GetHistoryAsync(conversationInfo.id, latest, oldest, count, unreads); @@ -287,26 +274,12 @@ public Task GetFileInfoAsync(string fileId, int? page = null, return APIRequestWithTokenAsync(parameters.ToArray()); } #region Groups - public Task GroupsArchiveAsync(string channelId) - { - return APIRequestWithTokenAsync(new Tuple("channel", channelId)); - } - - public Task GroupsCloseAsync(string channelId) - { - return APIRequestWithTokenAsync(new Tuple("channel", channelId)); - } public Task GroupsCreateAsync(string name) { return APIRequestWithTokenAsync(new Tuple("name", name)); } - public Task GroupsCreateChildAsync(string channelId) - { - return APIRequestWithTokenAsync(new Tuple("channel", channelId)); - } - public Task GroupsInviteAsync(string userId, string channelId) { List> parameters = new List>(); @@ -317,66 +290,17 @@ public Task GroupsInviteAsync(string userId, string channel return APIRequestWithTokenAsync(parameters.ToArray()); } - public Task GroupsKickAsync(string userId, string channelId) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("user", userId)); - - return APIRequestWithTokenAsync(parameters.ToArray()); - } - - public Task GroupsLeaveAsync(string channelId) - { - return APIRequestWithTokenAsync(new Tuple("channel", channelId)); - } - public Task GroupsMarkAsync(string channelId, DateTime ts) { return APIRequestWithTokenAsync(new Tuple("channel", channelId), new Tuple("ts", ts.ToProperTimeStamp())); } + [Obsolete] public Task GroupsOpenAsync(string channelId) { return APIRequestWithTokenAsync(new Tuple("channel", channelId)); } - public Task GroupsRenameAsync(string channelId, string name) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("name", name)); - - return APIRequestWithTokenAsync(parameters.ToArray()); - } - - public Task GroupsSetPurposeAsync(string channelId, string purpose) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("purpose", purpose)); - - return APIRequestWithTokenAsync(parameters.ToArray()); - } - - public Task GroupsSetTopicAsync(string channelId, string topic) - { - List> parameters = new List>(); - - parameters.Add(new Tuple("channel", channelId)); - parameters.Add(new Tuple("topic", topic)); - - return APIRequestWithTokenAsync(parameters.ToArray()); - } - - public Task GroupsUnarchiveAsync(string channelId) - { - return APIRequestWithTokenAsync(new Tuple("channel", channelId)); - } - #endregion #region Conversations