コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
 /// <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);
     }
 }
コード例 #4
0
 /// <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);
     }
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 /// <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);
     }
 }
コード例 #7
0
 /// <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);
     }
 }
コード例 #8
0
 /// <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);
     }
 }
コード例 #9
0
 /// <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);
     }
 }
コード例 #10
0
 /// <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);
     }
 }
コード例 #11
0
 public ChannelMessageProcessor(ConnectionManager connectionManager, IChannels <IRealtimeChannel> channels)
 {
     Logger             = connectionManager.Logger;
     _connectionManager = connectionManager;
     _channels          = channels;
     _connectionManager.MessageReceived += MessageReceived;
 }
コード例 #12
0
 public channelsController(IChannels channelsService)
 {
     if (channelsService == null)
     {
         throw new ProjectException("Channels Service injection failed.");
     }
     _channelsService = channelsService;
 }
コード例 #13
0
        public ChannelView(IMessages messagesApi, IChannels channelsApi)
        {
            this.messagesApi = messagesApi;
            this.channelsApi = channelsApi;

            InitializeComponent();
            messages = new ObservableCollection <MessageViewModel>();
            icMessages.ItemsSource = messages;
        }
コード例 #14
0
        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);
        }
コード例 #15
0
 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;
 }
コード例 #16
0
        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);
        }
コード例 #17
0
        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;
        }
コード例 #18
0
        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);
        }
コード例 #19
0
ファイル: ClientManager.cs プロジェクト: dolittle/Runtime
 /// <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;
 }
コード例 #20
0
 /// <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());
 }
コード例 #21
0
 /// <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();
 }
コード例 #22
0
 /// <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());
 }
コード例 #23
0
 /// <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());
 }
コード例 #24
0
 /// <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());
 }
コード例 #25
0
 /// <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();
 }
コード例 #26
0
 /// <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());
 }
コード例 #27
0
 /// <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();
 }
コード例 #28
0
 /// <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();
 }
コード例 #29
0
 /// <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();
 }
コード例 #30
0
 public ChannelWrapper(IChannels channels, string channelId)
 {
     Channels = channels;
     ChannelId = channelId;
 }
コード例 #31
0
 /// <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());
 }