private static void ValidateListInputs(TwitterList list)
 {
     if (list.User == null || list.User.ScreenName.IsNullOrBlank())
     {
         throw new TweetSharpException("You must provide the authenticating user to create a list.");
     }
 }
 public static ITwitterListsSubscribersCreate Follow(this ITwitterLists instance,
                                                     TwitterList list)
 {
     instance.Root.Parameters.Action = "subscribers";
     instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
     instance.Root.Parameters.ListId = list.Id;
     return new TwitterListsSubscribersCreate(instance.Root);
 }
 public static ITwitterListsSubscribersDelete Unfollow(this ITwitterLists instance,
                                                       TwitterList list)
 {
     instance.Root.Parameters.Action = "subscribers";
     instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
     instance.Root.Parameters.ListSlug = list.Slug;
     return new TwitterListsSubscribersDelete(instance.Root);
 }
 public static ITwitterListsIsMember AddMemberTo(this ITwitterLists instance,
                                                 TwitterList list,
                                                 TwitterUser user)
 {
     instance.Root.Parameters.Action = "members";
     instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
     instance.Root.Parameters.ListId = list.Id;
     instance.Root.Parameters.UserId = user.Id;
     return new TwitterListsIsMember(instance.Root);
 }
        public static ITwitterListsMembersDelete RemoveMemberFrom(this ITwitterLists instance,
                                                                  TwitterList list,
                                                                  TwitterUser user)
        {
            ValidateListInputs(list);

            instance.Root.Parameters.Action = "members";
            instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
            instance.Root.Parameters.ListId = list.Id;
            instance.Root.Parameters.UserId = user.Id;
            return new TwitterListsMembersDelete(instance.Root);
        }
        public static ITwitterListsIsMember IsUserFollowerOf(this ITwitterLists instance,
                                                             TwitterList list,
                                                             TwitterUser user)
        {
            ValidateListInputs(list);

            instance.Root.Parameters.Action = "subscribers_id";
            instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
            instance.Root.Parameters.ListId = list.Id;
            instance.Root.Parameters.UserId = user.Id;
            return new TwitterListsIsMember(instance.Root);
        }
        public static ITwitterListsSubscribers GetSubscribersOf(this ITwitterLists instance,
                                                                TwitterList list)
        {
            ValidateListInputs(list);

            instance.Root.Parameters.Action = "subscribers";
            instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
            instance.Root.Parameters.ListId = list.Id;
            return new TwitterListsSubscribers(instance.Root);
        }
 public static ITwitterListsUpdate UpdateList(this ITwitterLists instance,
                                              TwitterList list)
 {
     instance.Root.Parameters.ListId = list.Id;
     instance.Root.Parameters.ListName = list.Name;
     instance.Root.Parameters.ListMode = list.Mode;
     instance.Root.Parameters.ListDescription = list.Description;
     instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
     return new TwitterListsUpdate(instance.Root);
 }
        public static ITwitterListsCreate CreatePrivateList(this ITwitterLists instance,
                                                            TwitterList list)
        {
            ValidateListInputs(list);

            instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
            instance.Root.Parameters.ListName = list.Name;
            instance.Root.Parameters.ListDescription = list.Description;
            instance.Root.Parameters.ListMode = "private";
            return new TwitterListsCreate(instance.Root);
        }
 public static ITwitterListsDelete DeleteList(this ITwitterLists instance,
                                              TwitterList list)
 {
     instance.Root.Parameters.UserScreenName = list.User.ScreenName.ToLower();
     instance.Root.Parameters.ListId = list.Id;
     return new TwitterListsDelete(instance.Root);
 }