예제 #1
0
 /// <summary>
 /// Pins an item to a channel.
 /// <see href="https://api.slack.com/methods/pins.add" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// Authentication token. Requires scope: `pins:write`
 /// </param>
 /// <param name='fileComment'>
 /// File comment to pin.
 /// </param>
 /// <param name='timestamp'>
 /// Timestamp of the message to pin.
 /// </param>
 /// <param name='file'>
 /// File to pin.
 /// </param>
 /// <param name='channel'>
 /// Channel to pin the item in.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AddOKResponseModel> AddAsync(this IPins operations, string token = default(string), string fileComment = default(string), string timestamp = default(string), string file = default(string), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddWithHttpMessagesAsync(token, fileComment, timestamp, file, channel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
 /// <summary>
 /// Lists items pinned to a channel.
 /// <see href="https://api.slack.com/methods/pins.list" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// Authentication token. Requires scope: `pins:read`
 /// </param>
 /// <param name='channel'>
 /// Channel to get pinned items for.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> ListAsync(this IPins operations, string token = default(string), string channel = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(token, channel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #3
0
 /// <summary>
 /// Lists items pinned to a channel.
 /// <see href="https://api.slack.com/methods/pins.list" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// Authentication token. Requires scope: `pins:read`
 /// </param>
 /// <param name='channel'>
 /// Channel to get pinned items for.
 /// </param>
 public static object List(this IPins operations, string token = default(string), string channel = default(string))
 {
     return(operations.ListAsync(token, channel).GetAwaiter().GetResult());
 }
예제 #4
0
 /// <summary>
 /// Pins an item to a channel.
 /// <see href="https://api.slack.com/methods/pins.add" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='token'>
 /// Authentication token. Requires scope: `pins:write`
 /// </param>
 /// <param name='fileComment'>
 /// File comment to pin.
 /// </param>
 /// <param name='timestamp'>
 /// Timestamp of the message to pin.
 /// </param>
 /// <param name='file'>
 /// File to pin.
 /// </param>
 /// <param name='channel'>
 /// Channel to pin the item in.
 /// </param>
 public static AddOKResponseModel Add(this IPins operations, string token = default(string), string fileComment = default(string), string timestamp = default(string), string file = default(string), string channel = default(string))
 {
     return(operations.AddAsync(token, fileComment, timestamp, file, channel).GetAwaiter().GetResult());
 }