public static ChangeList ( this session, long listId, string slug, string name = "", string mode = "", string description = "", long ownerId, string ownerScreenName = "" ) : 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. |
name | string | The name for the list. |
mode | string | Whether your list is public or private. Values can be public or private. If no mode is specified the list will be public. |
description | string | The description to give the list. |
ownerId | long | The user ID of the user who owns the list being requested by a slug. |
ownerScreenName | string | The screen name of the user who owns the list being requested by a slug. |
return | Task |
public static async Task<TwitterSuccess> ChangeList(this IUserSession session, long listId,
string slug, string name = "", string mode = "", string description = "", long ownerId = 0,
string ownerScreenName = "")
{
var parameters = new TwitterParametersCollection();
parameters.Create(name:name, list_id: listId, slug: slug, owner_id: ownerId, owner_screen_name: ownerScreenName);
if (!string.IsNullOrWhiteSpace(mode))
{
parameters.Add("mode", mode);
}
if (!string.IsNullOrWhiteSpace(description))
{
parameters.Add("description", description);
}
return await session.PostAsync(TwitterApi.Resolve("/1.1/lists/update.json"), parameters)
.ContinueWith(c => c.MapToTwitterSuccess());
}