All Downloads are FREE. Search and download functionalities are using the official Maven repository.

twitter4j.api.TwitterAdsAudienceApi Maven / Gradle / Ivy

There is a newer version: 2.2
Show newest version
package twitter4j.api;

import com.google.common.base.Optional;
import twitter4j.BaseAdsListResponseIterable;
import twitter4j.BaseAdsResponse;
import twitter4j.TwitterException;
import twitter4j.models.ads.TailoredAudience;
import twitter4j.models.ads.TailoredAudienceChangeInfo;
import twitter4j.models.ads.TailoredAudienceDataType;
import twitter4j.models.ads.TailoredAudienceOperation;

/**
 * User: abhay
 * Date: 4/5/16
 * Time: 10:54 AM
 */
public interface TwitterAdsAudienceApi {

    /**
     * @param accountId The identifier for the leveraged account.
     * @param withDeleted (optional) Include deleted results in your request. Defaults to false.
     * @param count (optional) Limit the number returned per page of requests to the specified amount.
     * @param cursor (optional) Specifies a cursor to get the next page of TailoredAudience objects (function automatically handles paging upon iteration when you do not specify cursor value).
     * @return the collection of TailoredAudience objects belonging to the authenticated user.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tailored_audiences
     */
    BaseAdsListResponseIterable getAllTailoredAudiences(String accountId, Optional count,
                                                                          Optional withDeleted, Optional cursor)
            throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param tailoredAudienceId The identifier for a specific tailored audience.
     * @return detailed information on a specific tailored audience.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tailored_audiences/%3Aid
     */
    BaseAdsResponse getTailoredAudienceForId(String accountId, String tailoredAudienceId) throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param tailoredAudienceId The identifier for a specific tailored audience.
     * @return response of deleting a tailored audience.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/delete/accounts/%3Aaccount_id/tailored_audiences/%3Aid
     */
    BaseAdsResponse deleteTailoredAudience(String accountId, String tailoredAudienceId) throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param name The name of the tailored audience to create.
     * @param tailoredAudienceDataType The data type of tailored audience being created (e.g. TWITTER_ID).
     * @return response of creating a tailored audience.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/tailored_audiences
     */
    BaseAdsResponse createTailoredAudience(String accountId, String name, TailoredAudienceDataType tailoredAudienceDataType)
            throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param tailoredAudienceId The identifier for a specific tailored audience.
     * @return detailed information on the status of changes being processed for tailored audience.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tailored_audience_change/%3Aid
     */
    BaseAdsResponse getChangeRecordsForTailoredAudienceById(String accountId, String tailoredAudienceId)
            throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param tailoredAudienceId The identifier for a specific tailored audience.
     * @param bucketLocation File path returned by data upload endpoints.
     * @param tailoredAudienceOperation The operation to perform on tailored audience (e.g. ADD, REMOVE, REPLACE).
     * @return response of request to edit users in existing tailored audience.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/tailored_audience_change
     */
    BaseAdsResponse editUsersInTailoredAudience(String accountId, String tailoredAudienceId, String bucketLocation,
                                                                            TailoredAudienceOperation tailoredAudienceOperation)
            throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param withDeleted (optional) Include deleted results in your request. Defaults to false.
     * @param count (optional) Limit the number returned per page of requests to the specified amount.
     * @param nextCursor (optional) Specify a cursor to retrieve data from a specific page (function automatically handles paging upon iteration when you do not specify cursor value).
     * @return a collection of change records for each tailored audience the authenticating account has access to.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/tailored_audience_change
     */
    BaseAdsResponse getChangeRecordsForAllTailoredAudiences(String accountId, Optional count, Optional nextCursor)
            throws TwitterException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy