com.facebook.ads.sdk.AdAccount Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of facebook-java-business-sdk Show documentation
Show all versions of facebook-java-business-sdk Show documentation
Facebook Business Solutions SDK for Java
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.ads.sdk;
import java.io.File;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.facebook.ads.sdk.APIException.MalformedResponseException;
/**
* This class is auto-generated.
*
* For any issues or feature requests related to this class, please let us know
* on github and we'll fix in our codegen framework. We'll not be able to accept
* pull request for this class.
*
*/
public class AdAccount extends APINode {
@SerializedName("account_id")
private String mAccountId = null;
@SerializedName("account_status")
private Long mAccountStatus = null;
@SerializedName("ad_account_promotable_objects")
private AdAccountPromotableObjects mAdAccountPromotableObjects = null;
@SerializedName("age")
private Double mAge = null;
@SerializedName("agency_client_declaration")
private AgencyClientDeclaration mAgencyClientDeclaration = null;
@SerializedName("all_capabilities")
private List mAllCapabilities = null;
@SerializedName("amount_spent")
private String mAmountSpent = null;
@SerializedName("attribution_spec")
private List mAttributionSpec = null;
@SerializedName("balance")
private String mBalance = null;
@SerializedName("brand_safety_content_filter_levels")
private List mBrandSafetyContentFilterLevels = null;
@SerializedName("business")
private Business mBusiness = null;
@SerializedName("business_city")
private String mBusinessCity = null;
@SerializedName("business_country_code")
private String mBusinessCountryCode = null;
@SerializedName("business_name")
private String mBusinessName = null;
@SerializedName("business_state")
private String mBusinessState = null;
@SerializedName("business_street")
private String mBusinessStreet = null;
@SerializedName("business_street2")
private String mBusinessStreet2 = null;
@SerializedName("business_zip")
private String mBusinessZip = null;
@SerializedName("can_create_brand_lift_study")
private Boolean mCanCreateBrandLiftStudy = null;
@SerializedName("capabilities")
private List mCapabilities = null;
@SerializedName("created_time")
private String mCreatedTime = null;
@SerializedName("currency")
private String mCurrency = null;
@SerializedName("custom_audience_info")
private CustomAudienceGroup mCustomAudienceInfo = null;
@SerializedName("default_dsa_beneficiary")
private String mDefaultDsaBeneficiary = null;
@SerializedName("default_dsa_payor")
private String mDefaultDsaPayor = null;
@SerializedName("disable_reason")
private Long mDisableReason = null;
@SerializedName("end_advertiser")
private String mEndAdvertiser = null;
@SerializedName("end_advertiser_name")
private String mEndAdvertiserName = null;
@SerializedName("existing_customers")
private List mExistingCustomers = null;
@SerializedName("extended_credit_invoice_group")
private ExtendedCreditInvoiceGroup mExtendedCreditInvoiceGroup = null;
@SerializedName("failed_delivery_checks")
private List mFailedDeliveryChecks = null;
@SerializedName("fb_entity")
private Long mFbEntity = null;
@SerializedName("funding_source")
private String mFundingSource = null;
@SerializedName("funding_source_details")
private FundingSourceDetails mFundingSourceDetails = null;
@SerializedName("has_migrated_permissions")
private Boolean mHasMigratedPermissions = null;
@SerializedName("has_page_authorized_adaccount")
private Boolean mHasPageAuthorizedAdaccount = null;
@SerializedName("id")
private String mId = null;
@SerializedName("io_number")
private String mIoNumber = null;
@SerializedName("is_attribution_spec_system_default")
private Boolean mIsAttributionSpecSystemDefault = null;
@SerializedName("is_direct_deals_enabled")
private Boolean mIsDirectDealsEnabled = null;
@SerializedName("is_in_3ds_authorization_enabled_market")
private Boolean mIsIn3dsAuthorizationEnabledMarket = null;
@SerializedName("is_notifications_enabled")
private Boolean mIsNotificationsEnabled = null;
@SerializedName("is_personal")
private Long mIsPersonal = null;
@SerializedName("is_prepay_account")
private Boolean mIsPrepayAccount = null;
@SerializedName("is_tax_id_required")
private Boolean mIsTaxIdRequired = null;
@SerializedName("liable_address")
private CRMAddress mLiableAddress = null;
@SerializedName("line_numbers")
private List mLineNumbers = null;
@SerializedName("media_agency")
private String mMediaAgency = null;
@SerializedName("min_campaign_group_spend_cap")
private String mMinCampaignGroupSpendCap = null;
@SerializedName("min_daily_budget")
private Long mMinDailyBudget = null;
@SerializedName("name")
private String mName = null;
@SerializedName("offsite_pixels_tos_accepted")
private Boolean mOffsitePixelsTosAccepted = null;
@SerializedName("owner")
private String mOwner = null;
@SerializedName("owner_business")
private Business mOwnerBusiness = null;
@SerializedName("partner")
private String mPartner = null;
@SerializedName("rf_spec")
private ReachFrequencySpec mRfSpec = null;
@SerializedName("send_bill_to_address")
private CRMAddress mSendBillToAddress = null;
@SerializedName("show_checkout_experience")
private Boolean mShowCheckoutExperience = null;
@SerializedName("sold_to_address")
private CRMAddress mSoldToAddress = null;
@SerializedName("spend_cap")
private String mSpendCap = null;
@SerializedName("tax_id")
private String mTaxId = null;
@SerializedName("tax_id_status")
private Long mTaxIdStatus = null;
@SerializedName("tax_id_type")
private String mTaxIdType = null;
@SerializedName("timezone_id")
private Long mTimezoneId = null;
@SerializedName("timezone_name")
private String mTimezoneName = null;
@SerializedName("timezone_offset_hours_utc")
private Double mTimezoneOffsetHoursUtc = null;
@SerializedName("tos_accepted")
private Map mTosAccepted = null;
@SerializedName("user_access_expire_time")
private String mUserAccessExpireTime = null;
@SerializedName("user_tasks")
private List mUserTasks = null;
@SerializedName("user_tos_accepted")
private Map mUserTosAccepted = null;
@SerializedName("viewable_business")
private Business mViewableBusiness = null;
protected static Gson gson = null;
AdAccount() {
}
public AdAccount(Long id, APIContext context) {
this(id.toString(), context);
}
public AdAccount(String id, APIContext context) {
this.mId = id.replaceAll("act_", "");
this.context = context;
}
public AdAccount fetch() throws APIException{
AdAccount newInstance = fetchById(this.getPrefixedId().toString(), this.context);
this.copyFrom(newInstance);
mId = mId.replaceAll("act_", "");
return this;
}
public static AdAccount fetchById(Long id, APIContext context) throws APIException {
return fetchById(id.toString(), context);
}
public static ListenableFuture fetchByIdAsync(Long id, APIContext context) throws APIException {
return fetchByIdAsync(id.toString(), context);
}
public static AdAccount fetchById(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.execute();
}
public static ListenableFuture fetchByIdAsync(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.executeAsync();
}
public static APINodeList fetchByIds(List ids, List fields, APIContext context) throws APIException {
return (APINodeList)(
new APIRequest(context, "", "/", "GET", AdAccount.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.execute()
);
}
public static ListenableFuture> fetchByIdsAsync(List ids, List fields, APIContext context) throws APIException {
return
new APIRequest(context, "", "/", "GET", AdAccount.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.executeAsyncBase();
}
private String getPrefixedId() {
return "act_" + getId();
}
public String getId() {
return getFieldId().toString();
}
public static AdAccount loadJSON(String json, APIContext context, String header) {
AdAccount adAccount = getGson().fromJson(json, AdAccount.class);
if (context.isDebug()) {
JsonParser parser = new JsonParser();
JsonElement o1 = parser.parse(json);
JsonElement o2 = parser.parse(adAccount.toString());
if (o1.getAsJsonObject().get("__fb_trace_id__") != null) {
o2.getAsJsonObject().add("__fb_trace_id__", o1.getAsJsonObject().get("__fb_trace_id__"));
}
if (!o1.equals(o2)) {
context.log("[Warning] When parsing response, object is not consistent with JSON:");
context.log("[JSON]" + o1);
context.log("[Object]" + o2);
}
}
adAccount.context = context;
adAccount.rawValue = json;
adAccount.header = header;
JsonParser parser = new JsonParser();
JsonObject o = parser.parse(json).getAsJsonObject();
if (o.has("account_id")) {
String accountId = o.get("account_id").getAsString();
if (accountId != null) {
adAccount.mId = accountId;
}
}
if (adAccount.mId != null) {
adAccount.mId = adAccount.mId.replaceAll("act_", "");
}
return adAccount;
}
public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
APINodeList adAccounts = new APINodeList(request, json, header);
JsonArray arr;
JsonObject obj;
JsonParser parser = new JsonParser();
Exception exception = null;
try{
JsonElement result = parser.parse(json);
if (result.isJsonArray()) {
// First, check if it's a pure JSON Array
arr = result.getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
adAccounts.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
return adAccounts;
} else if (result.isJsonObject()) {
obj = result.getAsJsonObject();
if (obj.has("data")) {
if (obj.has("paging")) {
JsonObject paging = obj.get("paging").getAsJsonObject();
if (paging.has("cursors")) {
JsonObject cursors = paging.get("cursors").getAsJsonObject();
String before = cursors.has("before") ? cursors.get("before").getAsString() : null;
String after = cursors.has("after") ? cursors.get("after").getAsString() : null;
adAccounts.setCursors(before, after);
}
String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
String next = paging.has("next") ? paging.get("next").getAsString() : null;
adAccounts.setPaging(previous, next);
if (context.hasAppSecret()) {
adAccounts.setAppSecret(context.getAppSecretProof());
}
}
if (obj.get("data").isJsonArray()) {
// Second, check if it's a JSON array with "data"
arr = obj.get("data").getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
adAccounts.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
} else if (obj.get("data").isJsonObject()) {
// Third, check if it's a JSON object with "data"
obj = obj.get("data").getAsJsonObject();
boolean isRedownload = false;
for (String s : new String[]{"campaigns", "adsets", "ads"}) {
if (obj.has(s)) {
isRedownload = true;
obj = obj.getAsJsonObject(s);
for (Map.Entry entry : obj.entrySet()) {
adAccounts.add(loadJSON(entry.getValue().toString(), context, header));
}
break;
}
}
if (!isRedownload) {
adAccounts.add(loadJSON(obj.toString(), context, header));
}
}
return adAccounts;
} else if (obj.has("images")) {
// Fourth, check if it's a map of image objects
obj = obj.get("images").getAsJsonObject();
for (Map.Entry entry : obj.entrySet()) {
adAccounts.add(loadJSON(entry.getValue().toString(), context, header));
}
return adAccounts;
} else {
// Fifth, check if it's an array of objects indexed by id
boolean isIdIndexedArray = true;
for (Map.Entry entry : obj.entrySet()) {
String key = (String) entry.getKey();
if (key.equals("__fb_trace_id__")) {
continue;
}
JsonElement value = (JsonElement) entry.getValue();
if (
value != null &&
value.isJsonObject() &&
value.getAsJsonObject().has("id") &&
value.getAsJsonObject().get("id") != null &&
value.getAsJsonObject().get("id").getAsString().equals(key)
) {
adAccounts.add(loadJSON(value.toString(), context, header));
} else {
isIdIndexedArray = false;
break;
}
}
if (isIdIndexedArray) {
return adAccounts;
}
// Sixth, check if it's pure JsonObject
adAccounts.clear();
adAccounts.add(loadJSON(json, context, header));
return adAccounts;
}
}
} catch (Exception e) {
exception = e;
}
throw new MalformedResponseException(
"Invalid response string: " + json,
exception
);
}
@Override
public APIContext getContext() {
return context;
}
@Override
public void setContext(APIContext context) {
this.context = context;
}
@Override
public String toString() {
return getGson().toJson(this);
}
public APIRequestGetAccountControls getAccountControls() {
return new APIRequestGetAccountControls(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAccountControl createAccountControl() {
return new APIRequestCreateAccountControl(this.getPrefixedId().toString(), context);
}
public APIRequestGetActivities getActivities() {
return new APIRequestGetActivities(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdPlacePageSets getAdPlacePageSets() {
return new APIRequestGetAdPlacePageSets(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdPlacePageSet createAdPlacePageSet() {
return new APIRequestCreateAdPlacePageSet(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdPlacePageSetsAsync createAdPlacePageSetsAsync() {
return new APIRequestCreateAdPlacePageSetsAsync(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdSavedKeywords getAdSavedKeywords() {
return new APIRequestGetAdSavedKeywords(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdStudies getAdStudies() {
return new APIRequestGetAdStudies(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdCloudPlayables getAdCloudPlayables() {
return new APIRequestGetAdCloudPlayables(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdCreatives getAdCreatives() {
return new APIRequestGetAdCreatives(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdCreative createAdCreative() {
return new APIRequestCreateAdCreative(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdCreativesByLabels getAdCreativesByLabels() {
return new APIRequestGetAdCreativesByLabels(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteAdImages deleteAdImages() {
return new APIRequestDeleteAdImages(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdImages getAdImages() {
return new APIRequestGetAdImages(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdImage createAdImage() {
return new APIRequestCreateAdImage(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdLabels getAdLabels() {
return new APIRequestGetAdLabels(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdLabel createAdLabel() {
return new APIRequestCreateAdLabel(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdPlayables getAdPlayables() {
return new APIRequestGetAdPlayables(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdPlayable createAdPlayable() {
return new APIRequestCreateAdPlayable(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdRulesHistory getAdRulesHistory() {
return new APIRequestGetAdRulesHistory(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdRulesLibrary getAdRulesLibrary() {
return new APIRequestGetAdRulesLibrary(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdRulesLibrary createAdRulesLibrary() {
return new APIRequestCreateAdRulesLibrary(this.getPrefixedId().toString(), context);
}
public APIRequestGetAds getAds() {
return new APIRequestGetAds(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAd createAd() {
return new APIRequestCreateAd(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdsReportingMmmReports getAdsReportingMmmReports() {
return new APIRequestGetAdsReportingMmmReports(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdsReportingMmmSchedulers getAdsReportingMmmSchedulers() {
return new APIRequestGetAdsReportingMmmSchedulers(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdsVolume getAdsVolume() {
return new APIRequestGetAdsVolume(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdsByLabels getAdsByLabels() {
return new APIRequestGetAdsByLabels(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdSets getAdSets() {
return new APIRequestGetAdSets(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdSet createAdSet() {
return new APIRequestCreateAdSet(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdSetsByLabels getAdSetsByLabels() {
return new APIRequestGetAdSetsByLabels(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdsPixels getAdsPixels() {
return new APIRequestGetAdsPixels(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdsPixel createAdsPixel() {
return new APIRequestCreateAdsPixel(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdvertisableApplications getAdvertisableApplications() {
return new APIRequestGetAdvertisableApplications(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteAdVideos deleteAdVideos() {
return new APIRequestDeleteAdVideos(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdVideos getAdVideos() {
return new APIRequestGetAdVideos(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdVideo createAdVideo() {
return new APIRequestCreateAdVideo(this.getPrefixedId().toString(), context);
}
public APIRequestGetAffectedAdSets getAffectedAdSets() {
return new APIRequestGetAffectedAdSets(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteAgencies deleteAgencies() {
return new APIRequestDeleteAgencies(this.getPrefixedId().toString(), context);
}
public APIRequestGetAgencies getAgencies() {
return new APIRequestGetAgencies(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAgency createAgency() {
return new APIRequestCreateAgency(this.getPrefixedId().toString(), context);
}
public APIRequestGetApplications getApplications() {
return new APIRequestGetApplications(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteAssignedUsers deleteAssignedUsers() {
return new APIRequestDeleteAssignedUsers(this.getPrefixedId().toString(), context);
}
public APIRequestGetAssignedUsers getAssignedUsers() {
return new APIRequestGetAssignedUsers(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAssignedUser createAssignedUser() {
return new APIRequestCreateAssignedUser(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAsyncBatchRequest createAsyncBatchRequest() {
return new APIRequestCreateAsyncBatchRequest(this.getPrefixedId().toString(), context);
}
public APIRequestGetAsyncRequests getAsyncRequests() {
return new APIRequestGetAsyncRequests(this.getPrefixedId().toString(), context);
}
public APIRequestGetAsyncAdRequestSets getAsyncAdRequestSets() {
return new APIRequestGetAsyncAdRequestSets(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAsyncAdRequestSet createAsyncAdRequestSet() {
return new APIRequestCreateAsyncAdRequestSet(this.getPrefixedId().toString(), context);
}
public APIRequestGetAudienceFunnel getAudienceFunnel() {
return new APIRequestGetAudienceFunnel(this.getPrefixedId().toString(), context);
}
public APIRequestCreateBlockListDraft createBlockListDraft() {
return new APIRequestCreateBlockListDraft(this.getPrefixedId().toString(), context);
}
public APIRequestCreateBrandSafetyContentFilterLevel createBrandSafetyContentFilterLevel() {
return new APIRequestCreateBrandSafetyContentFilterLevel(this.getPrefixedId().toString(), context);
}
public APIRequestGetBroadTargetingCategories getBroadTargetingCategories() {
return new APIRequestGetBroadTargetingCategories(this.getPrefixedId().toString(), context);
}
public APIRequestGetBusinessProjects getBusinessProjects() {
return new APIRequestGetBusinessProjects(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteCampaigns deleteCampaigns() {
return new APIRequestDeleteCampaigns(this.getPrefixedId().toString(), context);
}
public APIRequestGetCampaigns getCampaigns() {
return new APIRequestGetCampaigns(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCampaign createCampaign() {
return new APIRequestCreateCampaign(this.getPrefixedId().toString(), context);
}
public APIRequestGetCampaignsByLabels getCampaignsByLabels() {
return new APIRequestGetCampaignsByLabels(this.getPrefixedId().toString(), context);
}
public APIRequestGetConnectedInstagramAccounts getConnectedInstagramAccounts() {
return new APIRequestGetConnectedInstagramAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetConnectedInstagramAccountsWithIabp getConnectedInstagramAccountsWithIabp() {
return new APIRequestGetConnectedInstagramAccountsWithIabp(this.getPrefixedId().toString(), context);
}
public APIRequestGetConversionGoals getConversionGoals() {
return new APIRequestGetConversionGoals(this.getPrefixedId().toString(), context);
}
public APIRequestGetCpaGuidance getCpaGuidance() {
return new APIRequestGetCpaGuidance(this.getPrefixedId().toString(), context);
}
public APIRequestGetCustomAudiences getCustomAudiences() {
return new APIRequestGetCustomAudiences(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCustomAudience createCustomAudience() {
return new APIRequestCreateCustomAudience(this.getPrefixedId().toString(), context);
}
public APIRequestGetCustomAudiencesTos getCustomAudiencesTos() {
return new APIRequestGetCustomAudiencesTos(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCustomAudiencesTo createCustomAudiencesTo() {
return new APIRequestCreateCustomAudiencesTo(this.getPrefixedId().toString(), context);
}
public APIRequestGetCustomConversions getCustomConversions() {
return new APIRequestGetCustomConversions(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCustomConversion createCustomConversion() {
return new APIRequestCreateCustomConversion(this.getPrefixedId().toString(), context);
}
public APIRequestGetDeliveryEstimate getDeliveryEstimate() {
return new APIRequestGetDeliveryEstimate(this.getPrefixedId().toString(), context);
}
public APIRequestGetDeprecatedTargetingAdSets getDeprecatedTargetingAdSets() {
return new APIRequestGetDeprecatedTargetingAdSets(this.getPrefixedId().toString(), context);
}
public APIRequestGetDsaRecommendations getDsaRecommendations() {
return new APIRequestGetDsaRecommendations(this.getPrefixedId().toString(), context);
}
public APIRequestGetGeneratePreviews getGeneratePreviews() {
return new APIRequestGetGeneratePreviews(this.getPrefixedId().toString(), context);
}
public APIRequestGetImpactingAdStudies getImpactingAdStudies() {
return new APIRequestGetImpactingAdStudies(this.getPrefixedId().toString(), context);
}
public APIRequestGetInsights getInsights() {
return new APIRequestGetInsights(this.getPrefixedId().toString(), context);
}
public APIRequestGetInsightsAsync getInsightsAsync() {
return new APIRequestGetInsightsAsync(this.getPrefixedId().toString(), context);
}
public APIRequestGetInstagramAccounts getInstagramAccounts() {
return new APIRequestGetInstagramAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetIosFourteenCampaignLimits getIosFourteenCampaignLimits() {
return new APIRequestGetIosFourteenCampaignLimits(this.getPrefixedId().toString(), context);
}
public APIRequestCreateManagedPartnerAd createManagedPartnerAd() {
return new APIRequestCreateManagedPartnerAd(this.getPrefixedId().toString(), context);
}
public APIRequestGetMatchedSearchApplications getMatchedSearchApplications() {
return new APIRequestGetMatchedSearchApplications(this.getPrefixedId().toString(), context);
}
public APIRequestGetMaxBid getMaxBid() {
return new APIRequestGetMaxBid(this.getPrefixedId().toString(), context);
}
public APIRequestGetMinimumBudgets getMinimumBudgets() {
return new APIRequestGetMinimumBudgets(this.getPrefixedId().toString(), context);
}
public APIRequestGetOnBehalfRequests getOnBehalfRequests() {
return new APIRequestGetOnBehalfRequests(this.getPrefixedId().toString(), context);
}
public APIRequestCreateProductAudience createProductAudience() {
return new APIRequestCreateProductAudience(this.getPrefixedId().toString(), context);
}
public APIRequestGetPromotePages getPromotePages() {
return new APIRequestGetPromotePages(this.getPrefixedId().toString(), context);
}
public APIRequestGetPublisherBlockLists getPublisherBlockLists() {
return new APIRequestGetPublisherBlockLists(this.getPrefixedId().toString(), context);
}
public APIRequestCreatePublisherBlockList createPublisherBlockList() {
return new APIRequestCreatePublisherBlockList(this.getPrefixedId().toString(), context);
}
public APIRequestGetReachEstimate getReachEstimate() {
return new APIRequestGetReachEstimate(this.getPrefixedId().toString(), context);
}
public APIRequestGetReachFrequencyPredictions getReachFrequencyPredictions() {
return new APIRequestGetReachFrequencyPredictions(this.getPrefixedId().toString(), context);
}
public APIRequestCreateReachFrequencyPrediction createReachFrequencyPrediction() {
return new APIRequestCreateReachFrequencyPrediction(this.getPrefixedId().toString(), context);
}
public APIRequestGetRecommendations getRecommendations() {
return new APIRequestGetRecommendations(this.getPrefixedId().toString(), context);
}
public APIRequestCreateRecommendation createRecommendation() {
return new APIRequestCreateRecommendation(this.getPrefixedId().toString(), context);
}
public APIRequestGetSavedAudiences getSavedAudiences() {
return new APIRequestGetSavedAudiences(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteSubscribedApps deleteSubscribedApps() {
return new APIRequestDeleteSubscribedApps(this.getPrefixedId().toString(), context);
}
public APIRequestGetSubscribedApps getSubscribedApps() {
return new APIRequestGetSubscribedApps(this.getPrefixedId().toString(), context);
}
public APIRequestCreateSubscribedApp createSubscribedApp() {
return new APIRequestCreateSubscribedApp(this.getPrefixedId().toString(), context);
}
public APIRequestGetTargetingBrowse getTargetingBrowse() {
return new APIRequestGetTargetingBrowse(this.getPrefixedId().toString(), context);
}
public APIRequestGetTargetingSearch getTargetingSearch() {
return new APIRequestGetTargetingSearch(this.getPrefixedId().toString(), context);
}
public APIRequestGetTargetingSentenceLines getTargetingSentenceLines() {
return new APIRequestGetTargetingSentenceLines(this.getPrefixedId().toString(), context);
}
public APIRequestGetTargetingSuggestions getTargetingSuggestions() {
return new APIRequestGetTargetingSuggestions(this.getPrefixedId().toString(), context);
}
public APIRequestGetTargetingValidATIOn getTargetingValidATIOn() {
return new APIRequestGetTargetingValidATIOn(this.getPrefixedId().toString(), context);
}
public APIRequestGetTracking getTracking() {
return new APIRequestGetTracking(this.getPrefixedId().toString(), context);
}
public APIRequestCreateTracking createTracking() {
return new APIRequestCreateTracking(this.getPrefixedId().toString(), context);
}
public APIRequestGetUsers getUsers() {
return new APIRequestGetUsers(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteUsersOfAnyAudience deleteUsersOfAnyAudience() {
return new APIRequestDeleteUsersOfAnyAudience(this.getPrefixedId().toString(), context);
}
public APIRequestGetValueAdjustmentRuleCollections getValueAdjustmentRuleCollections() {
return new APIRequestGetValueAdjustmentRuleCollections(this.getPrefixedId().toString(), context);
}
public APIRequestGetValueAdjustmentRules getValueAdjustmentRules() {
return new APIRequestGetValueAdjustmentRules(this.getPrefixedId().toString(), context);
}
public APIRequestGet get() {
return new APIRequestGet(this.getPrefixedId().toString(), context);
}
public APIRequestUpdate update() {
return new APIRequestUpdate(this.getPrefixedId().toString(), context);
}
public String getFieldAccountId() {
return mAccountId;
}
public Long getFieldAccountStatus() {
return mAccountStatus;
}
public AdAccountPromotableObjects getFieldAdAccountPromotableObjects() {
return mAdAccountPromotableObjects;
}
public Double getFieldAge() {
return mAge;
}
public AgencyClientDeclaration getFieldAgencyClientDeclaration() {
return mAgencyClientDeclaration;
}
public List getFieldAllCapabilities() {
return mAllCapabilities;
}
public String getFieldAmountSpent() {
return mAmountSpent;
}
public List getFieldAttributionSpec() {
return mAttributionSpec;
}
public String getFieldBalance() {
return mBalance;
}
public List getFieldBrandSafetyContentFilterLevels() {
return mBrandSafetyContentFilterLevels;
}
public Business getFieldBusiness() {
if (mBusiness != null) {
mBusiness.context = getContext();
}
return mBusiness;
}
public String getFieldBusinessCity() {
return mBusinessCity;
}
public String getFieldBusinessCountryCode() {
return mBusinessCountryCode;
}
public String getFieldBusinessName() {
return mBusinessName;
}
public String getFieldBusinessState() {
return mBusinessState;
}
public String getFieldBusinessStreet() {
return mBusinessStreet;
}
public String getFieldBusinessStreet2() {
return mBusinessStreet2;
}
public String getFieldBusinessZip() {
return mBusinessZip;
}
public Boolean getFieldCanCreateBrandLiftStudy() {
return mCanCreateBrandLiftStudy;
}
public List getFieldCapabilities() {
return mCapabilities;
}
public String getFieldCreatedTime() {
return mCreatedTime;
}
public String getFieldCurrency() {
return mCurrency;
}
public CustomAudienceGroup getFieldCustomAudienceInfo() {
return mCustomAudienceInfo;
}
public String getFieldDefaultDsaBeneficiary() {
return mDefaultDsaBeneficiary;
}
public String getFieldDefaultDsaPayor() {
return mDefaultDsaPayor;
}
public Long getFieldDisableReason() {
return mDisableReason;
}
public String getFieldEndAdvertiser() {
return mEndAdvertiser;
}
public String getFieldEndAdvertiserName() {
return mEndAdvertiserName;
}
public List getFieldExistingCustomers() {
return mExistingCustomers;
}
public ExtendedCreditInvoiceGroup getFieldExtendedCreditInvoiceGroup() {
if (mExtendedCreditInvoiceGroup != null) {
mExtendedCreditInvoiceGroup.context = getContext();
}
return mExtendedCreditInvoiceGroup;
}
public List getFieldFailedDeliveryChecks() {
return mFailedDeliveryChecks;
}
public Long getFieldFbEntity() {
return mFbEntity;
}
public String getFieldFundingSource() {
return mFundingSource;
}
public FundingSourceDetails getFieldFundingSourceDetails() {
return mFundingSourceDetails;
}
public Boolean getFieldHasMigratedPermissions() {
return mHasMigratedPermissions;
}
public Boolean getFieldHasPageAuthorizedAdaccount() {
return mHasPageAuthorizedAdaccount;
}
public String getFieldId() {
return mId;
}
public String getFieldIoNumber() {
return mIoNumber;
}
public Boolean getFieldIsAttributionSpecSystemDefault() {
return mIsAttributionSpecSystemDefault;
}
public Boolean getFieldIsDirectDealsEnabled() {
return mIsDirectDealsEnabled;
}
public Boolean getFieldIsIn3dsAuthorizationEnabledMarket() {
return mIsIn3dsAuthorizationEnabledMarket;
}
public Boolean getFieldIsNotificationsEnabled() {
return mIsNotificationsEnabled;
}
public Long getFieldIsPersonal() {
return mIsPersonal;
}
public Boolean getFieldIsPrepayAccount() {
return mIsPrepayAccount;
}
public Boolean getFieldIsTaxIdRequired() {
return mIsTaxIdRequired;
}
public CRMAddress getFieldLiableAddress() {
if (mLiableAddress != null) {
mLiableAddress.context = getContext();
}
return mLiableAddress;
}
public List getFieldLineNumbers() {
return mLineNumbers;
}
public String getFieldMediaAgency() {
return mMediaAgency;
}
public String getFieldMinCampaignGroupSpendCap() {
return mMinCampaignGroupSpendCap;
}
public Long getFieldMinDailyBudget() {
return mMinDailyBudget;
}
public String getFieldName() {
return mName;
}
public Boolean getFieldOffsitePixelsTosAccepted() {
return mOffsitePixelsTosAccepted;
}
public String getFieldOwner() {
return mOwner;
}
public Business getFieldOwnerBusiness() {
if (mOwnerBusiness != null) {
mOwnerBusiness.context = getContext();
}
return mOwnerBusiness;
}
public String getFieldPartner() {
return mPartner;
}
public ReachFrequencySpec getFieldRfSpec() {
return mRfSpec;
}
public CRMAddress getFieldSendBillToAddress() {
if (mSendBillToAddress != null) {
mSendBillToAddress.context = getContext();
}
return mSendBillToAddress;
}
public Boolean getFieldShowCheckoutExperience() {
return mShowCheckoutExperience;
}
public CRMAddress getFieldSoldToAddress() {
if (mSoldToAddress != null) {
mSoldToAddress.context = getContext();
}
return mSoldToAddress;
}
public String getFieldSpendCap() {
return mSpendCap;
}
public String getFieldTaxId() {
return mTaxId;
}
public Long getFieldTaxIdStatus() {
return mTaxIdStatus;
}
public String getFieldTaxIdType() {
return mTaxIdType;
}
public Long getFieldTimezoneId() {
return mTimezoneId;
}
public String getFieldTimezoneName() {
return mTimezoneName;
}
public Double getFieldTimezoneOffsetHoursUtc() {
return mTimezoneOffsetHoursUtc;
}
public Map getFieldTosAccepted() {
return mTosAccepted;
}
public String getFieldUserAccessExpireTime() {
return mUserAccessExpireTime;
}
public List getFieldUserTasks() {
return mUserTasks;
}
public Map getFieldUserTosAccepted() {
return mUserTosAccepted;
}
public Business getFieldViewableBusiness() {
if (mViewableBusiness != null) {
mViewableBusiness.context = getContext();
}
return mViewableBusiness;
}
public static class APIRequestGetAccountControls extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"audience_controls",
"campaigns_with_error",
"placement_controls",
"status",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdAccountBusinessConstraints.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAccountControls.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAccountControls(String nodeId, APIContext context) {
super(context, nodeId, "/account_controls", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAccountControls setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAccountControls setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAccountControls requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAccountControls requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAccountControls requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAccountControls requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAccountControls requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAccountControls requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAccountControls requestAudienceControlsField () {
return this.requestAudienceControlsField(true);
}
public APIRequestGetAccountControls requestAudienceControlsField (boolean value) {
this.requestField("audience_controls", value);
return this;
}
public APIRequestGetAccountControls requestCampaignsWithErrorField () {
return this.requestCampaignsWithErrorField(true);
}
public APIRequestGetAccountControls requestCampaignsWithErrorField (boolean value) {
this.requestField("campaigns_with_error", value);
return this;
}
public APIRequestGetAccountControls requestPlacementControlsField () {
return this.requestPlacementControlsField(true);
}
public APIRequestGetAccountControls requestPlacementControlsField (boolean value) {
this.requestField("placement_controls", value);
return this;
}
public APIRequestGetAccountControls requestStatusField () {
return this.requestStatusField(true);
}
public APIRequestGetAccountControls requestStatusField (boolean value) {
this.requestField("status", value);
return this;
}
}
public static class APIRequestCreateAccountControl extends APIRequest {
AdAccountBusinessConstraints lastResponse = null;
@Override
public AdAccountBusinessConstraints getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"audience_controls",
"placement_controls",
};
public static final String[] FIELDS = {
};
@Override
public AdAccountBusinessConstraints parseResponse(String response, String header) throws APIException {
return AdAccountBusinessConstraints.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdAccountBusinessConstraints execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdAccountBusinessConstraints execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public AdAccountBusinessConstraints apply(ResponseWrapper result) {
try {
return APIRequestCreateAccountControl.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAccountControl(String nodeId, APIContext context) {
super(context, nodeId, "/account_controls", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAccountControl setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAccountControl setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAccountControl setAudienceControls (Object audienceControls) {
this.setParam("audience_controls", audienceControls);
return this;
}
public APIRequestCreateAccountControl setAudienceControls (String audienceControls) {
this.setParam("audience_controls", audienceControls);
return this;
}
public APIRequestCreateAccountControl setPlacementControls (Object placementControls) {
this.setParam("placement_controls", placementControls);
return this;
}
public APIRequestCreateAccountControl setPlacementControls (String placementControls) {
this.setParam("placement_controls", placementControls);
return this;
}
public APIRequestCreateAccountControl requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAccountControl requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAccountControl requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAccountControl requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAccountControl requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAccountControl requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetActivities extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"add_children",
"after",
"business_id",
"category",
"data_source",
"extra_oids",
"limit",
"oid",
"since",
"uid",
"until",
};
public static final String[] FIELDS = {
"actor_id",
"actor_name",
"application_id",
"application_name",
"date_time_in_timezone",
"event_time",
"event_type",
"extra_data",
"object_id",
"object_name",
"object_type",
"translated_event_type",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdActivity.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetActivities.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetActivities(String nodeId, APIContext context) {
super(context, nodeId, "/activities", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetActivities setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetActivities setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetActivities setAddChildren (Boolean addChildren) {
this.setParam("add_children", addChildren);
return this;
}
public APIRequestGetActivities setAddChildren (String addChildren) {
this.setParam("add_children", addChildren);
return this;
}
public APIRequestGetActivities setAfter (String after) {
this.setParam("after", after);
return this;
}
public APIRequestGetActivities setBusinessId (String businessId) {
this.setParam("business_id", businessId);
return this;
}
public APIRequestGetActivities setCategory (AdActivity.EnumCategory category) {
this.setParam("category", category);
return this;
}
public APIRequestGetActivities setCategory (String category) {
this.setParam("category", category);
return this;
}
public APIRequestGetActivities setDataSource (AdActivity.EnumDataSource dataSource) {
this.setParam("data_source", dataSource);
return this;
}
public APIRequestGetActivities setDataSource (String dataSource) {
this.setParam("data_source", dataSource);
return this;
}
public APIRequestGetActivities setExtraOids (List extraOids) {
this.setParam("extra_oids", extraOids);
return this;
}
public APIRequestGetActivities setExtraOids (String extraOids) {
this.setParam("extra_oids", extraOids);
return this;
}
public APIRequestGetActivities setLimit (Long limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestGetActivities setLimit (String limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestGetActivities setOid (String oid) {
this.setParam("oid", oid);
return this;
}
public APIRequestGetActivities setSince (String since) {
this.setParam("since", since);
return this;
}
public APIRequestGetActivities setUid (Long uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestGetActivities setUid (String uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestGetActivities setUntil (String until) {
this.setParam("until", until);
return this;
}
public APIRequestGetActivities requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetActivities requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetActivities requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetActivities requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetActivities requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetActivities requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetActivities requestActorIdField () {
return this.requestActorIdField(true);
}
public APIRequestGetActivities requestActorIdField (boolean value) {
this.requestField("actor_id", value);
return this;
}
public APIRequestGetActivities requestActorNameField () {
return this.requestActorNameField(true);
}
public APIRequestGetActivities requestActorNameField (boolean value) {
this.requestField("actor_name", value);
return this;
}
public APIRequestGetActivities requestApplicationIdField () {
return this.requestApplicationIdField(true);
}
public APIRequestGetActivities requestApplicationIdField (boolean value) {
this.requestField("application_id", value);
return this;
}
public APIRequestGetActivities requestApplicationNameField () {
return this.requestApplicationNameField(true);
}
public APIRequestGetActivities requestApplicationNameField (boolean value) {
this.requestField("application_name", value);
return this;
}
public APIRequestGetActivities requestDateTimeInTimezoneField () {
return this.requestDateTimeInTimezoneField(true);
}
public APIRequestGetActivities requestDateTimeInTimezoneField (boolean value) {
this.requestField("date_time_in_timezone", value);
return this;
}
public APIRequestGetActivities requestEventTimeField () {
return this.requestEventTimeField(true);
}
public APIRequestGetActivities requestEventTimeField (boolean value) {
this.requestField("event_time", value);
return this;
}
public APIRequestGetActivities requestEventTypeField () {
return this.requestEventTypeField(true);
}
public APIRequestGetActivities requestEventTypeField (boolean value) {
this.requestField("event_type", value);
return this;
}
public APIRequestGetActivities requestExtraDataField () {
return this.requestExtraDataField(true);
}
public APIRequestGetActivities requestExtraDataField (boolean value) {
this.requestField("extra_data", value);
return this;
}
public APIRequestGetActivities requestObjectIdField () {
return this.requestObjectIdField(true);
}
public APIRequestGetActivities requestObjectIdField (boolean value) {
this.requestField("object_id", value);
return this;
}
public APIRequestGetActivities requestObjectNameField () {
return this.requestObjectNameField(true);
}
public APIRequestGetActivities requestObjectNameField (boolean value) {
this.requestField("object_name", value);
return this;
}
public APIRequestGetActivities requestObjectTypeField () {
return this.requestObjectTypeField(true);
}
public APIRequestGetActivities requestObjectTypeField (boolean value) {
this.requestField("object_type", value);
return this;
}
public APIRequestGetActivities requestTranslatedEventTypeField () {
return this.requestTranslatedEventTypeField(true);
}
public APIRequestGetActivities requestTranslatedEventTypeField (boolean value) {
this.requestField("translated_event_type", value);
return this;
}
}
public static class APIRequestGetAdPlacePageSets extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"account_id",
"id",
"location_types",
"name",
"pages_count",
"parent_page",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdPlacePageSet.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAdPlacePageSets.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdPlacePageSets(String nodeId, APIContext context) {
super(context, nodeId, "/ad_place_page_sets", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdPlacePageSets setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdPlacePageSets setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdPlacePageSets requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdPlacePageSets requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdPlacePageSets requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdPlacePageSets requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdPlacePageSets requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdPlacePageSets requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdPlacePageSets requestAccountIdField () {
return this.requestAccountIdField(true);
}
public APIRequestGetAdPlacePageSets requestAccountIdField (boolean value) {
this.requestField("account_id", value);
return this;
}
public APIRequestGetAdPlacePageSets requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdPlacePageSets requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdPlacePageSets requestLocationTypesField () {
return this.requestLocationTypesField(true);
}
public APIRequestGetAdPlacePageSets requestLocationTypesField (boolean value) {
this.requestField("location_types", value);
return this;
}
public APIRequestGetAdPlacePageSets requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAdPlacePageSets requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAdPlacePageSets requestPagesCountField () {
return this.requestPagesCountField(true);
}
public APIRequestGetAdPlacePageSets requestPagesCountField (boolean value) {
this.requestField("pages_count", value);
return this;
}
public APIRequestGetAdPlacePageSets requestParentPageField () {
return this.requestParentPageField(true);
}
public APIRequestGetAdPlacePageSets requestParentPageField (boolean value) {
this.requestField("parent_page", value);
return this;
}
}
public static class APIRequestCreateAdPlacePageSet extends APIRequest {
AdPlacePageSet lastResponse = null;
@Override
public AdPlacePageSet getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"location_types",
"name",
"parent_page",
"targeted_area_type",
};
public static final String[] FIELDS = {
};
@Override
public AdPlacePageSet parseResponse(String response, String header) throws APIException {
return AdPlacePageSet.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdPlacePageSet execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdPlacePageSet execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public AdPlacePageSet apply(ResponseWrapper result) {
try {
return APIRequestCreateAdPlacePageSet.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdPlacePageSet(String nodeId, APIContext context) {
super(context, nodeId, "/ad_place_page_sets", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdPlacePageSet setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdPlacePageSet setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdPlacePageSet setLocationTypes (List locationTypes) {
this.setParam("location_types", locationTypes);
return this;
}
public APIRequestCreateAdPlacePageSet setLocationTypes (String locationTypes) {
this.setParam("location_types", locationTypes);
return this;
}
public APIRequestCreateAdPlacePageSet setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdPlacePageSet setParentPage (String parentPage) {
this.setParam("parent_page", parentPage);
return this;
}
public APIRequestCreateAdPlacePageSet setTargetedAreaType (AdPlacePageSet.EnumTargetedAreaType targetedAreaType) {
this.setParam("targeted_area_type", targetedAreaType);
return this;
}
public APIRequestCreateAdPlacePageSet setTargetedAreaType (String targetedAreaType) {
this.setParam("targeted_area_type", targetedAreaType);
return this;
}
public APIRequestCreateAdPlacePageSet requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdPlacePageSet requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdPlacePageSet requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdPlacePageSet requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdPlacePageSet requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdPlacePageSet requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAdPlacePageSetsAsync extends APIRequest {
AdPlacePageSet lastResponse = null;
@Override
public AdPlacePageSet getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"location_types",
"name",
"parent_page",
"targeted_area_type",
};
public static final String[] FIELDS = {
};
@Override
public AdPlacePageSet parseResponse(String response, String header) throws APIException {
return AdPlacePageSet.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdPlacePageSet execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdPlacePageSet execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public AdPlacePageSet apply(ResponseWrapper result) {
try {
return APIRequestCreateAdPlacePageSetsAsync.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdPlacePageSetsAsync(String nodeId, APIContext context) {
super(context, nodeId, "/ad_place_page_sets_async", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdPlacePageSetsAsync setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdPlacePageSetsAsync setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setLocationTypes (List locationTypes) {
this.setParam("location_types", locationTypes);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setLocationTypes (String locationTypes) {
this.setParam("location_types", locationTypes);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setParentPage (String parentPage) {
this.setParam("parent_page", parentPage);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setTargetedAreaType (AdPlacePageSet.EnumTargetedAreaType targetedAreaType) {
this.setParam("targeted_area_type", targetedAreaType);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync setTargetedAreaType (String targetedAreaType) {
this.setParam("targeted_area_type", targetedAreaType);
return this;
}
public APIRequestCreateAdPlacePageSetsAsync requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdPlacePageSetsAsync requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdPlacePageSetsAsync requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdPlacePageSetsAsync requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdPlacePageSetsAsync requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdPlacePageSetsAsync requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdSavedKeywords extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"fields",
};
public static final String[] FIELDS = {
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdSavedKeywords.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAdSavedKeywords.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdSavedKeywords(String nodeId, APIContext context) {
super(context, nodeId, "/ad_saved_keywords", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdSavedKeywords setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdSavedKeywords setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdSavedKeywords setFields (List fields) {
this.setParam("fields", fields);
return this;
}
public APIRequestGetAdSavedKeywords setFields (String fields) {
this.setParam("fields", fields);
return this;
}
public APIRequestGetAdSavedKeywords requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdSavedKeywords requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdSavedKeywords requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdSavedKeywords requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdSavedKeywords requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdSavedKeywords requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdStudies extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"business",
"canceled_time",
"client_business",
"cooldown_start_time",
"created_by",
"created_time",
"description",
"end_time",
"id",
"measurement_contact",
"name",
"observation_end_time",
"results_first_available_date",
"sales_contact",
"start_time",
"type",
"updated_by",
"updated_time",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdStudy.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAdStudies.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdStudies(String nodeId, APIContext context) {
super(context, nodeId, "/ad_studies", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdStudies setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdStudies setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdStudies requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdStudies requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdStudies requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdStudies requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdStudies requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdStudies requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdStudies requestBusinessField () {
return this.requestBusinessField(true);
}
public APIRequestGetAdStudies requestBusinessField (boolean value) {
this.requestField("business", value);
return this;
}
public APIRequestGetAdStudies requestCanceledTimeField () {
return this.requestCanceledTimeField(true);
}
public APIRequestGetAdStudies requestCanceledTimeField (boolean value) {
this.requestField("canceled_time", value);
return this;
}
public APIRequestGetAdStudies requestClientBusinessField () {
return this.requestClientBusinessField(true);
}
public APIRequestGetAdStudies requestClientBusinessField (boolean value) {
this.requestField("client_business", value);
return this;
}
public APIRequestGetAdStudies requestCooldownStartTimeField () {
return this.requestCooldownStartTimeField(true);
}
public APIRequestGetAdStudies requestCooldownStartTimeField (boolean value) {
this.requestField("cooldown_start_time", value);
return this;
}
public APIRequestGetAdStudies requestCreatedByField () {
return this.requestCreatedByField(true);
}
public APIRequestGetAdStudies requestCreatedByField (boolean value) {
this.requestField("created_by", value);
return this;
}
public APIRequestGetAdStudies requestCreatedTimeField () {
return this.requestCreatedTimeField(true);
}
public APIRequestGetAdStudies requestCreatedTimeField (boolean value) {
this.requestField("created_time", value);
return this;
}
public APIRequestGetAdStudies requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetAdStudies requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetAdStudies requestEndTimeField () {
return this.requestEndTimeField(true);
}
public APIRequestGetAdStudies requestEndTimeField (boolean value) {
this.requestField("end_time", value);
return this;
}
public APIRequestGetAdStudies requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdStudies requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdStudies requestMeasurementContactField () {
return this.requestMeasurementContactField(true);
}
public APIRequestGetAdStudies requestMeasurementContactField (boolean value) {
this.requestField("measurement_contact", value);
return this;
}
public APIRequestGetAdStudies requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAdStudies requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAdStudies requestObservationEndTimeField () {
return this.requestObservationEndTimeField(true);
}
public APIRequestGetAdStudies requestObservationEndTimeField (boolean value) {
this.requestField("observation_end_time", value);
return this;
}
public APIRequestGetAdStudies requestResultsFirstAvailableDateField () {
return this.requestResultsFirstAvailableDateField(true);
}
public APIRequestGetAdStudies requestResultsFirstAvailableDateField (boolean value) {
this.requestField("results_first_available_date", value);
return this;
}
public APIRequestGetAdStudies requestSalesContactField () {
return this.requestSalesContactField(true);
}
public APIRequestGetAdStudies requestSalesContactField (boolean value) {
this.requestField("sales_contact", value);
return this;
}
public APIRequestGetAdStudies requestStartTimeField () {
return this.requestStartTimeField(true);
}
public APIRequestGetAdStudies requestStartTimeField (boolean value) {
this.requestField("start_time", value);
return this;
}
public APIRequestGetAdStudies requestTypeField () {
return this.requestTypeField(true);
}
public APIRequestGetAdStudies requestTypeField (boolean value) {
this.requestField("type", value);
return this;
}
public APIRequestGetAdStudies requestUpdatedByField () {
return this.requestUpdatedByField(true);
}
public APIRequestGetAdStudies requestUpdatedByField (boolean value) {
this.requestField("updated_by", value);
return this;
}
public APIRequestGetAdStudies requestUpdatedTimeField () {
return this.requestUpdatedTimeField(true);
}
public APIRequestGetAdStudies requestUpdatedTimeField (boolean value) {
this.requestField("updated_time", value);
return this;
}
}
public static class APIRequestGetAdCloudPlayables extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"id",
"name",
"owner",
"playable_ad_file_size",
"playable_ad_orientation",
"playable_ad_package_name",
"playable_ad_reject_reason",
"playable_ad_status",
"playable_ad_upload_time",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return CloudGame.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAdCloudPlayables.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdCloudPlayables(String nodeId, APIContext context) {
super(context, nodeId, "/adcloudplayables", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdCloudPlayables setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdCloudPlayables setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdCloudPlayables requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdCloudPlayables requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdCloudPlayables requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdCloudPlayables requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdCloudPlayables requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdCloudPlayables requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdCloudPlayables requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdCloudPlayables requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdCloudPlayables requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAdCloudPlayables requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAdCloudPlayables requestOwnerField () {
return this.requestOwnerField(true);
}
public APIRequestGetAdCloudPlayables requestOwnerField (boolean value) {
this.requestField("owner", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdFileSizeField () {
return this.requestPlayableAdFileSizeField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdFileSizeField (boolean value) {
this.requestField("playable_ad_file_size", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdOrientationField () {
return this.requestPlayableAdOrientationField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdOrientationField (boolean value) {
this.requestField("playable_ad_orientation", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdPackageNameField () {
return this.requestPlayableAdPackageNameField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdPackageNameField (boolean value) {
this.requestField("playable_ad_package_name", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdRejectReasonField () {
return this.requestPlayableAdRejectReasonField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdRejectReasonField (boolean value) {
this.requestField("playable_ad_reject_reason", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdStatusField () {
return this.requestPlayableAdStatusField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdStatusField (boolean value) {
this.requestField("playable_ad_status", value);
return this;
}
public APIRequestGetAdCloudPlayables requestPlayableAdUploadTimeField () {
return this.requestPlayableAdUploadTimeField(true);
}
public APIRequestGetAdCloudPlayables requestPlayableAdUploadTimeField (boolean value) {
this.requestField("playable_ad_upload_time", value);
return this;
}
}
public static class APIRequestGetAdCreatives extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"account_id",
"actor_id",
"adlabels",
"applink_treatment",
"asset_feed_spec",
"authorization_category",
"auto_update",
"body",
"branded_content",
"branded_content_sponsor_page_id",
"bundle_folder_id",
"call_to_action_type",
"categorization_criteria",
"category_media_source",
"collaborative_ads_lsb_image_bank_id",
"contextual_multi_ads",
"creative_sourcing_spec",
"degrees_of_freedom_spec",
"destination_set_id",
"dynamic_ad_voice",
"effective_authorization_category",
"effective_instagram_media_id",
"effective_instagram_story_id",
"effective_object_story_id",
"enable_direct_install",
"enable_launch_instant_app",
"facebook_branded_content",
"id",
"image_crops",
"image_hash",
"image_url",
"instagram_actor_id",
"instagram_branded_content",
"instagram_permalink_url",
"instagram_story_id",
"instagram_user_id",
"interactive_components_spec",
"link_deep_link_url",
"link_destination_display_url",
"link_og_id",
"link_url",
"name",
"object_id",
"object_store_url",
"object_story_id",
"object_story_spec",
"object_type",
"object_url",
"omnichannel_link_spec",
"page_welcome_message",
"photo_album_source_object_story_id",
"place_page_set_id",
"platform_customizations",
"playable_asset_id",
"portrait_customizations",
"product_set_id",
"recommender_settings",
"source_instagram_media_id",
"status",
"template_url",
"template_url_spec",
"thumbnail_id",
"thumbnail_url",
"title",
"url_tags",
"use_page_actor_override",
"video_id",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdCreative.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAdCreatives.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdCreatives(String nodeId, APIContext context) {
super(context, nodeId, "/adcreatives", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdCreatives setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdCreatives setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdCreatives requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdCreatives requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdCreatives requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdCreatives requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdCreatives requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdCreatives requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdCreatives requestAccountIdField () {
return this.requestAccountIdField(true);
}
public APIRequestGetAdCreatives requestAccountIdField (boolean value) {
this.requestField("account_id", value);
return this;
}
public APIRequestGetAdCreatives requestActorIdField () {
return this.requestActorIdField(true);
}
public APIRequestGetAdCreatives requestActorIdField (boolean value) {
this.requestField("actor_id", value);
return this;
}
public APIRequestGetAdCreatives requestAdlabelsField () {
return this.requestAdlabelsField(true);
}
public APIRequestGetAdCreatives requestAdlabelsField (boolean value) {
this.requestField("adlabels", value);
return this;
}
public APIRequestGetAdCreatives requestApplinkTreatmentField () {
return this.requestApplinkTreatmentField(true);
}
public APIRequestGetAdCreatives requestApplinkTreatmentField (boolean value) {
this.requestField("applink_treatment", value);
return this;
}
public APIRequestGetAdCreatives requestAssetFeedSpecField () {
return this.requestAssetFeedSpecField(true);
}
public APIRequestGetAdCreatives requestAssetFeedSpecField (boolean value) {
this.requestField("asset_feed_spec", value);
return this;
}
public APIRequestGetAdCreatives requestAuthorizationCategoryField () {
return this.requestAuthorizationCategoryField(true);
}
public APIRequestGetAdCreatives requestAuthorizationCategoryField (boolean value) {
this.requestField("authorization_category", value);
return this;
}
public APIRequestGetAdCreatives requestAutoUpdateField () {
return this.requestAutoUpdateField(true);
}
public APIRequestGetAdCreatives requestAutoUpdateField (boolean value) {
this.requestField("auto_update", value);
return this;
}
public APIRequestGetAdCreatives requestBodyField () {
return this.requestBodyField(true);
}
public APIRequestGetAdCreatives requestBodyField (boolean value) {
this.requestField("body", value);
return this;
}
public APIRequestGetAdCreatives requestBrandedContentField () {
return this.requestBrandedContentField(true);
}
public APIRequestGetAdCreatives requestBrandedContentField (boolean value) {
this.requestField("branded_content", value);
return this;
}
public APIRequestGetAdCreatives requestBrandedContentSponsorPageIdField () {
return this.requestBrandedContentSponsorPageIdField(true);
}
public APIRequestGetAdCreatives requestBrandedContentSponsorPageIdField (boolean value) {
this.requestField("branded_content_sponsor_page_id", value);
return this;
}
public APIRequestGetAdCreatives requestBundleFolderIdField () {
return this.requestBundleFolderIdField(true);
}
public APIRequestGetAdCreatives requestBundleFolderIdField (boolean value) {
this.requestField("bundle_folder_id", value);
return this;
}
public APIRequestGetAdCreatives requestCallToActionTypeField () {
return this.requestCallToActionTypeField(true);
}
public APIRequestGetAdCreatives requestCallToActionTypeField (boolean value) {
this.requestField("call_to_action_type", value);
return this;
}
public APIRequestGetAdCreatives requestCategorizationCriteriaField () {
return this.requestCategorizationCriteriaField(true);
}
public APIRequestGetAdCreatives requestCategorizationCriteriaField (boolean value) {
this.requestField("categorization_criteria", value);
return this;
}
public APIRequestGetAdCreatives requestCategoryMediaSourceField () {
return this.requestCategoryMediaSourceField(true);
}
public APIRequestGetAdCreatives requestCategoryMediaSourceField (boolean value) {
this.requestField("category_media_source", value);
return this;
}
public APIRequestGetAdCreatives requestCollaborativeAdsLsbImageBankIdField () {
return this.requestCollaborativeAdsLsbImageBankIdField(true);
}
public APIRequestGetAdCreatives requestCollaborativeAdsLsbImageBankIdField (boolean value) {
this.requestField("collaborative_ads_lsb_image_bank_id", value);
return this;
}
public APIRequestGetAdCreatives requestContextualMultiAdsField () {
return this.requestContextualMultiAdsField(true);
}
public APIRequestGetAdCreatives requestContextualMultiAdsField (boolean value) {
this.requestField("contextual_multi_ads", value);
return this;
}
public APIRequestGetAdCreatives requestCreativeSourcingSpecField () {
return this.requestCreativeSourcingSpecField(true);
}
public APIRequestGetAdCreatives requestCreativeSourcingSpecField (boolean value) {
this.requestField("creative_sourcing_spec", value);
return this;
}
public APIRequestGetAdCreatives requestDegreesOfFreedomSpecField () {
return this.requestDegreesOfFreedomSpecField(true);
}
public APIRequestGetAdCreatives requestDegreesOfFreedomSpecField (boolean value) {
this.requestField("degrees_of_freedom_spec", value);
return this;
}
public APIRequestGetAdCreatives requestDestinationSetIdField () {
return this.requestDestinationSetIdField(true);
}
public APIRequestGetAdCreatives requestDestinationSetIdField (boolean value) {
this.requestField("destination_set_id", value);
return this;
}
public APIRequestGetAdCreatives requestDynamicAdVoiceField () {
return this.requestDynamicAdVoiceField(true);
}
public APIRequestGetAdCreatives requestDynamicAdVoiceField (boolean value) {
this.requestField("dynamic_ad_voice", value);
return this;
}
public APIRequestGetAdCreatives requestEffectiveAuthorizationCategoryField () {
return this.requestEffectiveAuthorizationCategoryField(true);
}
public APIRequestGetAdCreatives requestEffectiveAuthorizationCategoryField (boolean value) {
this.requestField("effective_authorization_category", value);
return this;
}
public APIRequestGetAdCreatives requestEffectiveInstagramMediaIdField () {
return this.requestEffectiveInstagramMediaIdField(true);
}
public APIRequestGetAdCreatives requestEffectiveInstagramMediaIdField (boolean value) {
this.requestField("effective_instagram_media_id", value);
return this;
}
public APIRequestGetAdCreatives requestEffectiveInstagramStoryIdField () {
return this.requestEffectiveInstagramStoryIdField(true);
}
public APIRequestGetAdCreatives requestEffectiveInstagramStoryIdField (boolean value) {
this.requestField("effective_instagram_story_id", value);
return this;
}
public APIRequestGetAdCreatives requestEffectiveObjectStoryIdField () {
return this.requestEffectiveObjectStoryIdField(true);
}
public APIRequestGetAdCreatives requestEffectiveObjectStoryIdField (boolean value) {
this.requestField("effective_object_story_id", value);
return this;
}
public APIRequestGetAdCreatives requestEnableDirectInstallField () {
return this.requestEnableDirectInstallField(true);
}
public APIRequestGetAdCreatives requestEnableDirectInstallField (boolean value) {
this.requestField("enable_direct_install", value);
return this;
}
public APIRequestGetAdCreatives requestEnableLaunchInstantAppField () {
return this.requestEnableLaunchInstantAppField(true);
}
public APIRequestGetAdCreatives requestEnableLaunchInstantAppField (boolean value) {
this.requestField("enable_launch_instant_app", value);
return this;
}
public APIRequestGetAdCreatives requestFacebookBrandedContentField () {
return this.requestFacebookBrandedContentField(true);
}
public APIRequestGetAdCreatives requestFacebookBrandedContentField (boolean value) {
this.requestField("facebook_branded_content", value);
return this;
}
public APIRequestGetAdCreatives requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdCreatives requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdCreatives requestImageCropsField () {
return this.requestImageCropsField(true);
}
public APIRequestGetAdCreatives requestImageCropsField (boolean value) {
this.requestField("image_crops", value);
return this;
}
public APIRequestGetAdCreatives requestImageHashField () {
return this.requestImageHashField(true);
}
public APIRequestGetAdCreatives requestImageHashField (boolean value) {
this.requestField("image_hash", value);
return this;
}
public APIRequestGetAdCreatives requestImageUrlField () {
return this.requestImageUrlField(true);
}
public APIRequestGetAdCreatives requestImageUrlField (boolean value) {
this.requestField("image_url", value);
return this;
}
public APIRequestGetAdCreatives requestInstagramActorIdField () {
return this.requestInstagramActorIdField(true);
}
public APIRequestGetAdCreatives requestInstagramActorIdField (boolean value) {
this.requestField("instagram_actor_id", value);
return this;
}
public APIRequestGetAdCreatives requestInstagramBrandedContentField () {
return this.requestInstagramBrandedContentField(true);
}
public APIRequestGetAdCreatives requestInstagramBrandedContentField (boolean value) {
this.requestField("instagram_branded_content", value);
return this;
}
public APIRequestGetAdCreatives requestInstagramPermalinkUrlField () {
return this.requestInstagramPermalinkUrlField(true);
}
public APIRequestGetAdCreatives requestInstagramPermalinkUrlField (boolean value) {
this.requestField("instagram_permalink_url", value);
return this;
}
public APIRequestGetAdCreatives requestInstagramStoryIdField () {
return this.requestInstagramStoryIdField(true);
}
public APIRequestGetAdCreatives requestInstagramStoryIdField (boolean value) {
this.requestField("instagram_story_id", value);
return this;
}
public APIRequestGetAdCreatives requestInstagramUserIdField () {
return this.requestInstagramUserIdField(true);
}
public APIRequestGetAdCreatives requestInstagramUserIdField (boolean value) {
this.requestField("instagram_user_id", value);
return this;
}
public APIRequestGetAdCreatives requestInteractiveComponentsSpecField () {
return this.requestInteractiveComponentsSpecField(true);
}
public APIRequestGetAdCreatives requestInteractiveComponentsSpecField (boolean value) {
this.requestField("interactive_components_spec", value);
return this;
}
public APIRequestGetAdCreatives requestLinkDeepLinkUrlField () {
return this.requestLinkDeepLinkUrlField(true);
}
public APIRequestGetAdCreatives requestLinkDeepLinkUrlField (boolean value) {
this.requestField("link_deep_link_url", value);
return this;
}
public APIRequestGetAdCreatives requestLinkDestinationDisplayUrlField () {
return this.requestLinkDestinationDisplayUrlField(true);
}
public APIRequestGetAdCreatives requestLinkDestinationDisplayUrlField (boolean value) {
this.requestField("link_destination_display_url", value);
return this;
}
public APIRequestGetAdCreatives requestLinkOgIdField () {
return this.requestLinkOgIdField(true);
}
public APIRequestGetAdCreatives requestLinkOgIdField (boolean value) {
this.requestField("link_og_id", value);
return this;
}
public APIRequestGetAdCreatives requestLinkUrlField () {
return this.requestLinkUrlField(true);
}
public APIRequestGetAdCreatives requestLinkUrlField (boolean value) {
this.requestField("link_url", value);
return this;
}
public APIRequestGetAdCreatives requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAdCreatives requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAdCreatives requestObjectIdField () {
return this.requestObjectIdField(true);
}
public APIRequestGetAdCreatives requestObjectIdField (boolean value) {
this.requestField("object_id", value);
return this;
}
public APIRequestGetAdCreatives requestObjectStoreUrlField () {
return this.requestObjectStoreUrlField(true);
}
public APIRequestGetAdCreatives requestObjectStoreUrlField (boolean value) {
this.requestField("object_store_url", value);
return this;
}
public APIRequestGetAdCreatives requestObjectStoryIdField () {
return this.requestObjectStoryIdField(true);
}
public APIRequestGetAdCreatives requestObjectStoryIdField (boolean value) {
this.requestField("object_story_id", value);
return this;
}
public APIRequestGetAdCreatives requestObjectStorySpecField () {
return this.requestObjectStorySpecField(true);
}
public APIRequestGetAdCreatives requestObjectStorySpecField (boolean value) {
this.requestField("object_story_spec", value);
return this;
}
public APIRequestGetAdCreatives requestObjectTypeField () {
return this.requestObjectTypeField(true);
}
public APIRequestGetAdCreatives requestObjectTypeField (boolean value) {
this.requestField("object_type", value);
return this;
}
public APIRequestGetAdCreatives requestObjectUrlField () {
return this.requestObjectUrlField(true);
}
public APIRequestGetAdCreatives requestObjectUrlField (boolean value) {
this.requestField("object_url", value);
return this;
}
public APIRequestGetAdCreatives requestOmnichannelLinkSpecField () {
return this.requestOmnichannelLinkSpecField(true);
}
public APIRequestGetAdCreatives requestOmnichannelLinkSpecField (boolean value) {
this.requestField("omnichannel_link_spec", value);
return this;
}
public APIRequestGetAdCreatives requestPageWelcomeMessageField () {
return this.requestPageWelcomeMessageField(true);
}
public APIRequestGetAdCreatives requestPageWelcomeMessageField (boolean value) {
this.requestField("page_welcome_message", value);
return this;
}
public APIRequestGetAdCreatives requestPhotoAlbumSourceObjectStoryIdField () {
return this.requestPhotoAlbumSourceObjectStoryIdField(true);
}
public APIRequestGetAdCreatives requestPhotoAlbumSourceObjectStoryIdField (boolean value) {
this.requestField("photo_album_source_object_story_id", value);
return this;
}
public APIRequestGetAdCreatives requestPlacePageSetIdField () {
return this.requestPlacePageSetIdField(true);
}
public APIRequestGetAdCreatives requestPlacePageSetIdField (boolean value) {
this.requestField("place_page_set_id", value);
return this;
}
public APIRequestGetAdCreatives requestPlatformCustomizationsField () {
return this.requestPlatformCustomizationsField(true);
}
public APIRequestGetAdCreatives requestPlatformCustomizationsField (boolean value) {
this.requestField("platform_customizations", value);
return this;
}
public APIRequestGetAdCreatives requestPlayableAssetIdField () {
return this.requestPlayableAssetIdField(true);
}
public APIRequestGetAdCreatives requestPlayableAssetIdField (boolean value) {
this.requestField("playable_asset_id", value);
return this;
}
public APIRequestGetAdCreatives requestPortraitCustomizationsField () {
return this.requestPortraitCustomizationsField(true);
}
public APIRequestGetAdCreatives requestPortraitCustomizationsField (boolean value) {
this.requestField("portrait_customizations", value);
return this;
}
public APIRequestGetAdCreatives requestProductSetIdField () {
return this.requestProductSetIdField(true);
}
public APIRequestGetAdCreatives requestProductSetIdField (boolean value) {
this.requestField("product_set_id", value);
return this;
}
public APIRequestGetAdCreatives requestRecommenderSettingsField () {
return this.requestRecommenderSettingsField(true);
}
public APIRequestGetAdCreatives requestRecommenderSettingsField (boolean value) {
this.requestField("recommender_settings", value);
return this;
}
public APIRequestGetAdCreatives requestSourceInstagramMediaIdField () {
return this.requestSourceInstagramMediaIdField(true);
}
public APIRequestGetAdCreatives requestSourceInstagramMediaIdField (boolean value) {
this.requestField("source_instagram_media_id", value);
return this;
}
public APIRequestGetAdCreatives requestStatusField () {
return this.requestStatusField(true);
}
public APIRequestGetAdCreatives requestStatusField (boolean value) {
this.requestField("status", value);
return this;
}
public APIRequestGetAdCreatives requestTemplateUrlField () {
return this.requestTemplateUrlField(true);
}
public APIRequestGetAdCreatives requestTemplateUrlField (boolean value) {
this.requestField("template_url", value);
return this;
}
public APIRequestGetAdCreatives requestTemplateUrlSpecField () {
return this.requestTemplateUrlSpecField(true);
}
public APIRequestGetAdCreatives requestTemplateUrlSpecField (boolean value) {
this.requestField("template_url_spec", value);
return this;
}
public APIRequestGetAdCreatives requestThumbnailIdField () {
return this.requestThumbnailIdField(true);
}
public APIRequestGetAdCreatives requestThumbnailIdField (boolean value) {
this.requestField("thumbnail_id", value);
return this;
}
public APIRequestGetAdCreatives requestThumbnailUrlField () {
return this.requestThumbnailUrlField(true);
}
public APIRequestGetAdCreatives requestThumbnailUrlField (boolean value) {
this.requestField("thumbnail_url", value);
return this;
}
public APIRequestGetAdCreatives requestTitleField () {
return this.requestTitleField(true);
}
public APIRequestGetAdCreatives requestTitleField (boolean value) {
this.requestField("title", value);
return this;
}
public APIRequestGetAdCreatives requestUrlTagsField () {
return this.requestUrlTagsField(true);
}
public APIRequestGetAdCreatives requestUrlTagsField (boolean value) {
this.requestField("url_tags", value);
return this;
}
public APIRequestGetAdCreatives requestUsePageActorOverrideField () {
return this.requestUsePageActorOverrideField(true);
}
public APIRequestGetAdCreatives requestUsePageActorOverrideField (boolean value) {
this.requestField("use_page_actor_override", value);
return this;
}
public APIRequestGetAdCreatives requestVideoIdField () {
return this.requestVideoIdField(true);
}
public APIRequestGetAdCreatives requestVideoIdField (boolean value) {
this.requestField("video_id", value);
return this;
}
}
public static class APIRequestCreateAdCreative extends APIRequest {
AdCreative lastResponse = null;
@Override
public AdCreative getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"actor_id",
"adlabels",
"applink_treatment",
"asset_feed_spec",
"authorization_category",
"body",
"branded_content",
"branded_content_sponsor_page_id",
"bundle_folder_id",
"call_to_action",
"categorization_criteria",
"category_media_source",
"contextual_multi_ads",
"degrees_of_freedom_spec",
"destination_set_id",
"dynamic_ad_voice",
"enable_launch_instant_app",
"facebook_branded_content",
"image_crops",
"image_file",
"image_hash",
"image_url",
"instagram_actor_id",
"instagram_branded_content",
"instagram_permalink_url",
"instagram_user_id",
"interactive_components_spec",
"is_dco_internal",
"link_og_id",
"link_url",
"name",
"object_id",
"object_story_id",
"object_story_spec",
"object_type",
"object_url",
"omnichannel_link_spec",
"page_welcome_message",
"place_page_set_id",
"platform_customizations",
"playable_asset_id",
"portrait_customizations",
"product_set_id",
"recommender_settings",
"source_instagram_media_id",
"template_url",
"template_url_spec",
"thumbnail_url",
"title",
"url_tags",
"use_page_actor_override",
};
public static final String[] FIELDS = {
};
@Override
public AdCreative parseResponse(String response, String header) throws APIException {
return AdCreative.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdCreative execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdCreative execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public AdCreative apply(ResponseWrapper result) {
try {
return APIRequestCreateAdCreative.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdCreative(String nodeId, APIContext context) {
super(context, nodeId, "/adcreatives", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdCreative setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdCreative setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdCreative setActorId (Long actorId) {
this.setParam("actor_id", actorId);
return this;
}
public APIRequestCreateAdCreative setActorId (String actorId) {
this.setParam("actor_id", actorId);
return this;
}
public APIRequestCreateAdCreative setAdlabels (List