BoxKite.Twitter.ListExtensions.DeleteUsersFromList C# (CSharp) Метод

DeleteUsersFromList() публичный статический Метод

Removes multiple members from a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to remove members from it.
ref: https://dev.twitter.com/docs/api/1.1/post/lists/members/destroy_all
public static DeleteUsersFromList ( this session, long listId, string slug = "", IEnumerable screenNames = null, IEnumerable userIds = null, string ownerScreenName = "", long ownerId ) : Task
session this
listId long The numerical id of the list.
slug string You can identify a list by its slug instead of its numerical id. If you decide to do so, note that you'll also have to specify the list owner using the owner_id or owner_screen_name parameters.
screenNames IEnumerable list of screen names, up to 100 are allowed in a single request.
userIds IEnumerable list of user IDs, up to 100 are allowed in a single request.
ownerScreenName string The screen name of the user who owns the list being requested by a slug.
ownerId long The user ID of the user who owns the list being requested by a slug.
Результат Task
        public static async Task<TwitterSuccess> DeleteUsersFromList(this IUserSession session, long listId=0, string slug="",
            IEnumerable<string> screenNames=null, IEnumerable<long> userIds=null,
            string ownerScreenName = "", long ownerId = 0)
        {
            var parameters = new TwitterParametersCollection();
            parameters.Create(list_id: listId, slug: slug, owner_id: ownerId, owner_screen_name: ownerScreenName);
            parameters.CreateCollection(screen_names:screenNames, user_ids:userIds);

            if (parameters.EnsureEitherOr("screen_name", "user_id").IsFalse())
            {
                return session.MapParameterError<TwitterSuccess>(
                        "Either screen_names or user_ids required");
            }

            return await session.PostAsync(TwitterApi.Resolve("/1.1/lists/members/destroy_all.json"), parameters)
                          .ContinueWith(c => c.MapToTwitterSuccess());
        }