twitter4j.api.FavoritesResources Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twitter4j-core Show documentation
Show all versions of twitter4j-core Show documentation
A Java library for the Twitter API
/*
* Copyright 2007 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package twitter4j.api;
import twitter4j.Paging;
import twitter4j.ResponseList;
import twitter4j.Status;
import twitter4j.TwitterException;
/**
* @author Joern Huxhorn - jhuxhorn at googlemail.com
*/
public interface FavoritesResources {
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
This method calls https://api.twitter.com/1.1/favorites.json
*
* @return List
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 2.0.1
*/
ResponseList getFavorites()
throws TwitterException;
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
* @param userId the id of the user for whom to request a list of favorite statuses
* @return ResponseList
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 3.0.0
*/
ResponseList getFavorites(long userId)
throws TwitterException;
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
* @param screenName the screen name of the user for whom to request a list of favorite statuses
* @return ResponseList
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 2.0.1
*/
ResponseList getFavorites(String screenName)
throws TwitterException;
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
This method calls https://api.twitter.com/1.1/favorites.json
*
* @param paging controls pagination. Supports sinceId and page parameters.
* @return ResponseList
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 2.2.5
*/
ResponseList getFavorites(Paging paging)
throws TwitterException;
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
This method calls https://api.twitter.com/1.1/favorites/[id].json
*
* @param userId the id of the user for whom to request a list of favorite statuses
* @param paging controls pagination. Supports sinceId and page parameters.
* @return ResponseList
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 3.0.0
*/
ResponseList getFavorites(long userId, Paging paging)
throws TwitterException;
/**
* Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
*
This method calls https://api.twitter.com/1.1/favorites/[id].json
*
* @param screenName the screen name of the user for whom to request a list of favorite statuses
* @param paging controls pagination. Supports sinceId and page parameters.
* @return ResponseList
* @throws TwitterException when Twitter service or network is unavailable
* @see GET favorites | Twitter Developers
* @since Twitter4J 2.2.5
*/
ResponseList getFavorites(String screenName, Paging paging)
throws TwitterException;
/**
* Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.
*
This method calls https://api.twitter.com/1.1/favorites/create/[id].json
*
* @param id the ID of the status to favorite
* @return Status
* @throws TwitterException when Twitter service or network is unavailable
* @see POST favorites/create/:id | Twitter Developers
*/
Status createFavorite(long id)
throws TwitterException;
/**
* Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.
*
This method calls https://api.twitter.com/1.1/favorites/destroy/[id].json
*
* @param id the ID of the status to un-favorite
* @return Status
* @throws TwitterException when Twitter service or network is unavailable
* @see POST favorites/destroy/:id | Twitter Developers
*/
Status destroyFavorite(long id)
throws TwitterException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy