/// <summary> /// Unarchives a channel. /// <see href="https://api.slack.com/methods/channels.unarchive" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='channel'> /// Channel to unarchive /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <UnarchiveOKResponse> UnarchiveAsync(this IChannels operations, string token = default(string), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UnarchiveWithHttpMessagesAsync(token, channel, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Wait for and get new messages, message deletions, message edits, channel /// information updates, and channel deletions in a channel /// </summary> /// <remarks> /// This request will not return from the service until at least one new /// channel event has occurred /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='channelId'> /// The id of the channel to listen to /// </param> /// <param name='since'> /// The time to get channel events since /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <ChannelEventDTO> > GetChannelEventsAsync(this IChannels operations, int channelId, System.DateTime since, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetChannelEventsWithHttpMessagesAsync(channelId, since, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// </param> /// <param name='classification'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Channel> CreateChannelAsync(this IChannels operations, string name, string classification, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateChannelWithHttpMessagesAsync(name, classification, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='classification'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <Channel> > GetAsync(this IChannels operations, string classification = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(classification, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all channels in a Slack team. /// <see href="https://api.slack.com/methods/channels.list" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='excludeMembers'> /// Exclude the `members` collection from each `channel` /// </param> /// <param name='cursor'> /// Paginate through collections of data by setting the `cursor` parameter to a /// `next_cursor` attribute returned by a previous request's /// `response_metadata`. Default value fetches the first "page" of the /// collection. See [pagination](/docs/pagination) for more detail. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:read` /// </param> /// <param name='limit'> /// The maximum number of items to return. Fewer than the requested number of /// items may be returned, even if the end of the users list hasn't been /// reached. /// </param> /// <param name='excludeArchived'> /// Exclude archived channels from the list /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ListOKResponseModelModel> ListAsync(this IChannels operations, bool?excludeMembers = default(bool?), string cursor = default(string), string token = default(string), int?limit = default(int?), bool?excludeArchived = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(excludeMembers, cursor, token, limit, excludeArchived, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Channel> GetChannelAsync(this IChannels operations, int id, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetChannelWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve a thread of messages posted to a channel /// <see href="https://api.slack.com/methods/channels.replies" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='threadTs'> /// Unique identifier of a thread's parent message /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:history` /// </param> /// <param name='channel'> /// Channel to fetch thread from /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RepliesOKResponseModel> RepliesAsync(this IChannels operations, string threadTs = default(string), string token = default(string), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RepliesWithHttpMessagesAsync(threadTs, token, channel, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Renames a channel. /// <see href="https://api.slack.com/methods/channels.rename" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='validate'> /// Whether to return errors on invalid channel name instead of modifying it to /// meet the specified criteria. /// </param> /// <param name='name'> /// New name for channel. /// </param> /// <param name='channel'> /// Channel to rename /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <RenameOKResponse> RenameAsync(this IChannels operations, string token = default(string), bool?validate = default(bool?), string name = default(string), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RenameWithHttpMessagesAsync(token, validate, name, channel, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets information about a channel. /// <see href="https://api.slack.com/methods/channels.info" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:read` /// </param> /// <param name='includeLocale'> /// Set this to `true` to receive the locale for this channel. Defaults to /// `false` /// </param> /// <param name='channel'> /// Channel to get info on /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <InfoOKResponseModelModel> InfoAsync(this IChannels operations, string token = default(string), bool?includeLocale = default(bool?), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.InfoWithHttpMessagesAsync(token, includeLocale, channel, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Fetches history of messages and events from a channel. /// <see href="https://api.slack.com/methods/channels.history" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='count'> /// Number of messages to return, between 1 and 1000. /// </param> /// <param name='unreads'> /// Include `unread_count_display` in the output? /// </param> /// <param name='inclusive'> /// Include messages with latest or oldest timestamp in results. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:history` /// </param> /// <param name='oldest'> /// Start of time range of messages to include in results. /// </param> /// <param name='channel'> /// Channel to fetch history for. /// </param> /// <param name='latest'> /// End of time range of messages to include in results. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <HistoryOKResponse> HistoryAsync(this IChannels operations, int?count = default(int?), bool?unreads = default(bool?), bool?inclusive = default(bool?), string token = default(string), string oldest = default(string), string channel = default(string), string latest = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.HistoryWithHttpMessagesAsync(count, unreads, inclusive, token, oldest, channel, latest, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public ChannelMessageProcessor(ConnectionManager connectionManager, IChannels <IRealtimeChannel> channels) { Logger = connectionManager.Logger; _connectionManager = connectionManager; _channels = channels; _connectionManager.MessageReceived += MessageReceived; }
public channelsController(IChannels channelsService) { if (channelsService == null) { throw new ProjectException("Channels Service injection failed."); } _channelsService = channelsService; }
public ChannelView(IMessages messagesApi, IChannels channelsApi) { this.messagesApi = messagesApi; this.channelsApi = channelsApi; InitializeComponent(); messages = new ObservableCollection <MessageViewModel>(); icMessages.ItemsSource = messages; }
public EditGroup(IGroups groupsApi, IChannels channelsApi, GroupSettings ucGroupSettings) { this.groupsApi = groupsApi; this.channelsApi = channelsApi; InitializeComponent(); this.ucGroupSettings = ucGroupSettings; ucGroupSettings.GroupValidStateChanged += UcGroupSettings_GroupValidStateChanged; DockPanel.SetDock(ucGroupSettings, Dock.Top); dpnlSettings.Children.Add(ucGroupSettings); }
public schemeController(ISchemes schemeService, IRoutes routeService, IFees feesService, IChannels channelsService, ITransactionType transService) { if (schemeService == null) { throw new Exception("The Scheme service injection failed."); } _schemeService = schemeService; _routesService = routeService; _feesService = feesService; _channelsService = channelsService; _transTypeService = transService; }
public Overview(GroupChooser groupChooser, ChatView chatView, IUsers usersApi, IRoles rolesApi, IChannels channelsApi, IGroups groupsApi) { this.usersApi = usersApi; this.rolesApi = rolesApi; this.channelsApi = channelsApi; this.groupsApi = groupsApi; this.groupChooser = groupChooser; this.chatView = chatView; InitializeComponent(); setCurrentView(groupChooser); }
public GroupChooser(IUsers usersApi, IChannels channelsApi, ChannelView ucChannelView, GroupView ucGroupView, CreateGroup ucCreateGroupView, EditGroup ucEditGroupView) { this.usersApi = usersApi; this.channelsApi = channelsApi; InitializeComponent(); this.ucChannelView = ucChannelView; this.ucGroupView = ucGroupView; this.ucCreateGroupView = ucCreateGroupView; this.ucEditGroupView = ucEditGroupView; ucCreateGroupView.GroupCreated += groupChanged; ucEditGroupView.GroupUpdated += groupChanged; }
private static string ChannelDeviceBuilder(IChannels item, string id) { string result = null; TagBuilder h = new TagBuilder("h5"); h.SetInnerText("Канал"); h.AddCssClass("text-left"); result += h.ToString(); TagBuilder p = new TagBuilder("p"); p.AddCssClass("btn"); p.Attributes.Add("style", "padding: 2px 7px"); TagBuilder span = new TagBuilder("span"); span.AddCssClass("glyphicon glyphicon-minus"); p.Attributes.Add("id", "channel " + "minus"); p.InnerHtml += span.ToString(); result += p.ToString(); TagBuilder input = new TagBuilder("input"); input.Attributes.Add("type", "text"); input.Attributes.Add("style", "width: 65px; text-align:center"); input.Attributes.Add("value", item.GetCurrentChannelName()); input.Attributes.Add("id", id + " " + "channel"); result += input.ToString(); TagBuilder p2 = new TagBuilder("p"); p2.AddCssClass("btn"); p2.Attributes.Add("style", "padding: 2px 7px"); TagBuilder span2 = new TagBuilder("span"); span2.AddCssClass("glyphicon glyphicon-plus"); p2.Attributes.Add("id", "channel " + "plus"); p2.InnerHtml += span2.ToString(); result += p2.ToString(); return(result); }
/// <summary> /// Initializes a new instance of the <see cref="ClientManager"/> class. /// </summary> /// <param name="channels"><see cref="IChannels"/> to get <see cref="CallInvoker"/> from.</param> public ClientManager(IChannels channels) { _channels = channels; }
/// <summary> /// Retrieve a thread of messages posted to a channel /// <see href="https://api.slack.com/methods/channels.replies" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='threadTs'> /// Unique identifier of a thread's parent message /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:history` /// </param> /// <param name='channel'> /// Channel to fetch thread from /// </param> public static RepliesOKResponseModel Replies(this IChannels operations, string threadTs = default(string), string token = default(string), string channel = default(string)) { return(operations.RepliesAsync(threadTs, token, channel).GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='channelId'> /// </param> /// <param name='buildId'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task AddBuildToChannelAsync(this IChannels operations, int channelId, int buildId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.AddBuildToChannelWithHttpMessagesAsync(channelId, buildId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Sets the purpose for a channel. /// <see href="https://api.slack.com/methods/channels.setPurpose" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='purpose'> /// The new purpose /// </param> /// <param name='channel'> /// Channel to set the purpose of /// </param> public static SetPurposeOKResponse SetPurpose(this IChannels operations, string token = default(string), string purpose = default(string), string channel = default(string)) { return(operations.SetPurposeAsync(token, purpose, channel).GetAwaiter().GetResult()); }
/// <summary> /// Unarchives a channel. /// <see href="https://api.slack.com/methods/channels.unarchive" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='channel'> /// Channel to unarchive /// </param> public static UnarchiveOKResponse Unarchive(this IChannels operations, string token = default(string), string channel = default(string)) { return(operations.UnarchiveAsync(token, channel).GetAwaiter().GetResult()); }
/// <summary> /// Sets the topic for a channel. /// <see href="https://api.slack.com/methods/channels.setTopic" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='topic'> /// The new topic /// </param> /// <param name='channel'> /// Channel to set the topic of /// </param> public static SetTopicOKResponse SetTopic(this IChannels operations, string token = default(string), string topic = default(string), string channel = default(string)) { return(operations.SetTopicAsync(token, topic, channel).GetAwaiter().GetResult()); }
/// <summary> /// Change the information about a channel in a group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='channelId'> /// The id of the channel to update /// </param> /// <param name='channelName'> /// The new name of the channel /// </param> public static void UpdateChannel(this IChannels operations, int channelId, string channelName) { operations.UpdateChannelAsync(channelId, channelName).GetAwaiter().GetResult(); }
/// <summary> /// Creates a channel. /// <see href="https://api.slack.com/methods/channels.create" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='token'> /// Authentication token. Requires scope: `channels:write` /// </param> /// <param name='validate'> /// Whether to return errors on invalid channel name instead of modifying it to /// meet the specified criteria. /// </param> /// <param name='name'> /// Name of channel to create /// </param> public static CreateOKResponse Create(this IChannels operations, string token = default(string), bool?validate = default(bool?), string name = default(string)) { return(operations.CreateAsync(token, validate, name).GetAwaiter().GetResult()); }
/// <summary> /// Delete a channel from a group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='channelId'> /// The id of the channel to delete /// </param> public static void DeleteChannel(this IChannels operations, int channelId) { operations.DeleteChannelAsync(channelId).GetAwaiter().GetResult(); }
/// <summary> /// Create a channel in a group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='groupId'> /// </param> /// <param name='channelName'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task CreateChannelAsync(this IChannels operations, int groupId, string channelName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.CreateChannelWithHttpMessagesAsync(groupId, channelName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Create a channel in a group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='groupId'> /// </param> /// <param name='channelName'> /// </param> public static void CreateChannel(this IChannels operations, int groupId, string channelName) { operations.CreateChannelAsync(groupId, channelName).GetAwaiter().GetResult(); }
public ChannelWrapper(IChannels channels, string channelId) { Channels = channels; ChannelId = channelId; }
/// <summary> /// Wait for and get new messages, message deletions, message edits, channel /// information updates, and channel deletions in a channel /// </summary> /// <remarks> /// This request will not return from the service until at least one new /// channel event has occurred /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='channelId'> /// The id of the channel to listen to /// </param> /// <param name='since'> /// The time to get channel events since /// </param> public static IList <ChannelEventDTO> GetChannelEvents(this IChannels operations, int channelId, System.DateTime since) { return(operations.GetChannelEventsAsync(channelId, since).GetAwaiter().GetResult()); }