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

twitter4jads.api.TwitterAdsTargetingApi Maven / Gradle / Ivy

The newest version!
package twitter4jads.api;

import twitter4jads.BaseAdsListResponseIterable;
import twitter4jads.BaseAdsResponse;
import twitter4jads.internal.models4j.LocationType;
import twitter4jads.internal.models4j.TwitterException;
import twitter4jads.models.ads.*;
import twitter4jads.models.ads.tags.TwitterApplicationList;
import twitter4jads.models.ads.targeting.TargetingParamRequest;
import twitter4jads.models.ads.targeting.TargetingParamResponse;
import twitter4jads.models.ads.targeting.TwitterTargetingOperator;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

/**
 *
 * Date: 4/4/16
 * Time: 7:15 PM
 */
public interface TwitterAdsTargetingApi {

    /**
     * @param accountId   The identifier for the leveraged account.
     * @param lineItemId  Scope targeting criteria to a specific line item by providing its identifier.
     * @param withDeleted Include deleted results in your request. Defaults to false.
     * @return Retrieve details for some or all TargetingCriterias associated with the current account.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria
     */
    @Deprecated
    BaseAdsListResponseIterable getTargetingCriterias(String accountId, String lineItemId, boolean withDeleted)
            throws TwitterException;

    /**
     * @param accountId   The identifier for the leveraged account.
     * @param accountId   The identifier for the leveraged account.
     * @param lineItemIds Scope targeting criteria to specific line items by providing its identifier. Max size: 200
     * @param withDeleted Include deleted results in your request. Defaults to false.
     * @param count       Specifies the number of records to try and retrieve per distinct request. Default: 200, Min: 1, Max: 1000
     * @param cursor      Specifies a cursor to get the next page of results.
     * @param sortBy      Sorts by supported attribute in ascending or descending order.
     * @return Retrieve details for some or all TargetingCriterias associated with the current account.
     */
    BaseAdsListResponseIterable getTargetingCriterias(String accountId, Collection lineItemIds, boolean withDeleted,
                                                                         Integer count, String cursor, String sortBy) throws TwitterException;

    /**
     * @param accountId   The identifier for the leveraged account.
     * @param targetingId A reference to the targeting criteria you are operating with in the request.
     * @param withDeleted Include deleted results in your request. Defaults to false.
     * @return Retrieve detailed information on a targeting criterion associated with a specific line item.
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria/%3Aid
     */
    BaseAdsResponse getTargetingCriteriaById(String accountId, String targetingId, boolean withDeleted) throws TwitterException;

    /**
     * @param accountId                 The identifier for the leveraged account.
     * @param lineItemId                The line item ID to create targeting criteria upon.
     * @param targetingType             The type of targeting to be used with this targeting criteria.
     * @param targetingValue            The targeting value being set.
     * @return created targeting criteria
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/targeting_criteria
     */
    BaseAdsResponse createTargetingCriteria(String accountId, String lineItemId, TargetingType targetingType,
                                                               String targetingValue, TwitterTargetingOperator targetingOperator)
            throws TwitterException;

    /**
     * @param accountId               The identifier for the leveraged account.
     * @param lineItemId              The line item ID to create targeting criteria upon.
     * @param targetingCriteriaValues A list of TargetingCriteria object to set multiple targeting criteria.
     * @return created targeting criterias
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/put/accounts/%3Aaccount_id/targeting_criteria
     */
    //deprecated in v3
    List createTargetingCriterias(String accountId, String lineItemId, List targetingCriteriaValues)
            throws TwitterException;

    /**
     * @param accountId           The identifier for the leveraged account.
     * @param targetingCriteriaId The targeting criteria ID to delete.
     * @return deleted targeting criteria with deleted field set to true
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/delete/accounts/%3Aaccount_id/targeting_criteria
     */
    BaseAdsResponse deleteTargetingCriteria(String accountId, String targetingCriteriaId) throws TwitterException;

    /**
     * @param locationType (optional) Scope the results to a specific type of location.
     * @param q            (optional) Search for a specific location.
     * @param countryCode  (optional) Specify a country code to retrieve results from.
     * @param count        (optional) Limit the number of results to the given count.
     * @return all possible targeting locations to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/locations
     */
    BaseAdsListResponseIterable getAllTargetingLocations(Optional locationType, String q,
                                                                            String countryCode, Optional count) throws TwitterException;

    /**
     * @param locationType (optional) Scope the results to a specific type of location.
     * @param query        (optional) Search for a specific location.
     * @return all possible targeting locations to choose from for the given location type
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/locations
     */
    BaseAdsListResponseIterable getTargetingLocations(String query, twitter4jads.models.LocationType locationType) throws TwitterException;

    /**
     * @param q (optional) Search results for matching a specific locale.
     * @return all possible twitter targeting languages to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/languages
     */
    BaseAdsListResponseIterable getAllTargetingLocales(String q) throws TwitterException;

    /**
     * @param q (optional) Search for a specific event.
     * @return all possible events to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/events
     */
    BaseAdsListResponseIterable getAllTargetingEvents(String q) throws TwitterException;

    /**
     * @return all the events that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/events
     */
    BaseAdsListResponseIterable getAllEvents() throws TwitterException;

    /**
     * @param q (optional) Search for a specific interest.
     * @return all possible targeting interests to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/interests
     */
    BaseAdsListResponseIterable getAllTargetingInterests(String q) throws TwitterException;

    /**
     * @param q (optional) Search results for matching a specific platform.
     * @return all possible targeting platforms to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/platforms
     */
    BaseAdsListResponseIterable getAllTargetingPlatforms(String q) throws TwitterException;

    /**
     * @param q (optional) Search results for matching a specific network operator.
     * @return all possible network operators to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/network_operators
     */
    BaseAdsListResponseIterable getAllTargetingNetworkOperators(String q) throws TwitterException;

    /**
     * @return all possible targeting platform versions to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/platform_versions
     */
    BaseAdsListResponseIterable getAllTargetingPlatformVersions() throws TwitterException;

    BaseAdsListResponseIterable getAllTargetingPlatformVersions(String q, TwitterOSType osType) throws TwitterException;

    /**
     * @return all possible targeting conversations to choose from
     * @throws TwitterException
     */
    BaseAdsListResponseIterable getAllTargetingConversations() throws TwitterException;

    /**
     * @param q (optional) Search results for matching a specific device.
     * @return all possible targeting devices to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/devices
     */
    BaseAdsListResponseIterable getAllTargetingDevices(String q) throws TwitterException;

    /**
     * @param tvMarketLocale (optional) Scope the results to a specific tv market locale.
     * @param count          (optional) Limit the number of results to the given count.
     * @param cursor         (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 all possible twitter targeting tv channels to choose from
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_channels
     */
    BaseAdsListResponseIterable getAllTargetingTVChannels(String tvMarketLocale, Optional count, Optional cursor)
            throws TwitterException;

    /**
     * @param tvMarket (optional) Scope the results to a specific tv market.
     * @param q        (optional) Search results for matching a specific tv show.
     * @param count    (optional) Limit the number of results to the given count.
     * @param cursor   (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 all the tv shows (matching q if provided) that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_shows
     */
    BaseAdsListResponseIterable getAllTVShows(String tvMarket, String q, Optional count, Optional cursor) throws TwitterException;

    /**
     * @return All the TV Markets that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_markets
     */
    BaseAdsListResponseIterable getAllTVMarkets() throws TwitterException;

    /**
     * @return All the TV Genres that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_genres
     */
    BaseAdsListResponseIterable getAllTargetingTVGenres() throws TwitterException;


    /**
     * @param accountId       The identifier for the leveraged account.
     * @param suggestionType  Specify the enum of suggestions being received.
     * @param targetingValues Targeting values being used to seed the suggestion.
     * @param count           (optional) Limit the number of results to the given count.
     * @param ignoredValues   (optional) A list of values to ignore from suggested output.
     * @return list of targeting suggestions for keywords and user IDs
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_suggestions
     */
    List getTargetingSuggestion(String accountId, SuggestionType suggestionType, List targetingValues,
                                                     Optional count, List ignoredValues) throws TwitterException;

    /**
     * @param behaviorIds (optional) Scope the results to a set of behavior IDs.
     * @param count       (optional) Limit the number of results to the given count.
     * @param cursor      (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 all the behaviors that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/behaviors
     */
    BaseAdsListResponseIterable getBehaviors(Optional count, Optional cursor, List behaviorIds,
                                                              Optional countryCode) throws TwitterException;

    /**
     * @param behaviorTaxonomyIds       (optional) List of behavior taxonomy identifiers by which to filter the response.
     * @param parentBehaviorTaxonomyIds (optional) List of behavior taxonomy identifiers of parent nodes in the tree structures. Specifying parents will only return children nodes of the taxonomy.
     * @param count                     (optional) Limit the number of results to the given count.
     * @param cursor                    (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 the full or partial behavior taxonomy tree
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/behavior_taxonomies
     */
    BaseAdsListResponseIterable getBehaviorTaxonomy(List behaviorTaxonomyIds,
                                                                             List parentBehaviorTaxonomyIds, Optional count,
                                                                             Optional cursor) throws TwitterException;

    /**
     * @param q      (optional) Search results for matching a specific app store category.
     * @param osType (optional) Limit the number of results to the given count.
     * @return Some or all of the targetable app store categories
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/targeting_criteria/app_store_categories
     */
    List searchAppStoreCategories(String q, Optional osType) throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @return all app lists associated with the specified account ID
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists
     */
    BaseAdsListResponseIterable getAllAppLists(String accountId) throws TwitterException;

    /**
     * @param accountId The identifier for the leveraged account.
     * @param listId    A specific app list ID.
     * @return an application list given a specific list ID
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists
     */
    BaseAdsResponse getAllAppsListsById(String accountId, String listId) throws TwitterException;

    /**
     * @param accountId              The identifier for the leveraged account.
     * @param twitterApplicationList A list of applications to add to app list.
     * @return response of creating a new application list
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/app_lists
     */
    BaseAdsResponse createNewApplicationList(String accountId, TwitterApplicationList twitterApplicationList)
            throws TwitterException;

    /**
     * @param q (optional) Search results for matching a specific IAB category.
     * @return all the Twitter IAB categories that can be targeted
     * @throws TwitterException
     * @see https://dev.twitter.com/ads/reference/get/iab_categories
     */
    BaseAdsListResponseIterable getAllIabCategories(String q) throws TwitterException;

    /**
     * @return reach_estimate of the ad
     */
    BaseAdsResponse getReachEstimate(String accountId, ProductType productType, List targetingCriterias,
                                                              String objective, Long bidAmountLocalMicro, String currency, Long campaignDailyBudgetAmountLocalMicro, String bidType)
            throws TwitterException;

    BaseAdsListResponseIterable fetchIabCategories(String q) throws TwitterException;

    TargetingParamResponse createTargetingBatchRequest(String accountId, List targetingParamRequests)
            throws TwitterException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy