com.facebook.ads.sdk.Business 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 Business extends APINode {
@SerializedName("block_offline_analytics")
private Boolean mBlockOfflineAnalytics = null;
@SerializedName("collaborative_ads_managed_partner_business_info")
private ManagedPartnerBusiness mCollaborativeAdsManagedPartnerBusinessInfo = null;
@SerializedName("collaborative_ads_managed_partner_eligibility")
private BusinessManagedPartnerEligibility mCollaborativeAdsManagedPartnerEligibility = null;
@SerializedName("collaborative_ads_partner_premium_options")
private BusinessPartnerPremiumOptions mCollaborativeAdsPartnerPremiumOptions = null;
@SerializedName("created_by")
private Object mCreatedBy = null;
@SerializedName("created_time")
private String mCreatedTime = null;
@SerializedName("extended_updated_time")
private String mExtendedUpdatedTime = null;
@SerializedName("id")
private String mId = null;
@SerializedName("is_hidden")
private Boolean mIsHidden = null;
@SerializedName("link")
private String mLink = null;
@SerializedName("name")
private String mName = null;
@SerializedName("payment_account_id")
private String mPaymentAccountId = null;
@SerializedName("primary_page")
private Page mPrimaryPage = null;
@SerializedName("profile_picture_uri")
private String mProfilePictureUri = null;
@SerializedName("timezone_id")
private Long mTimezoneId = null;
@SerializedName("two_factor_type")
private String mTwoFactorType = null;
@SerializedName("updated_by")
private Object mUpdatedBy = null;
@SerializedName("updated_time")
private String mUpdatedTime = null;
@SerializedName("user_access_expire_time")
private String mUserAccessExpireTime = null;
@SerializedName("verification_status")
private String mVerificationStatus = null;
@SerializedName("vertical")
private String mVertical = null;
@SerializedName("vertical_id")
private Long mVerticalId = null;
protected static Gson gson = null;
Business() {
}
public Business(Long id, APIContext context) {
this(id.toString(), context);
}
public Business(String id, APIContext context) {
this.mId = id;
this.context = context;
}
public Business fetch() throws APIException{
Business newInstance = fetchById(this.getPrefixedId().toString(), this.context);
this.copyFrom(newInstance);
return this;
}
public static Business 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 Business 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", Business.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", Business.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.executeAsyncBase();
}
private String getPrefixedId() {
return getId();
}
public String getId() {
return getFieldId().toString();
}
public static Business loadJSON(String json, APIContext context, String header) {
Business business = getGson().fromJson(json, Business.class);
if (context.isDebug()) {
JsonParser parser = new JsonParser();
JsonElement o1 = parser.parse(json);
JsonElement o2 = parser.parse(business.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);
}
}
business.context = context;
business.rawValue = json;
business.header = header;
return business;
}
public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
APINodeList businesss = 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++) {
businesss.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
return businesss;
} 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;
businesss.setCursors(before, after);
}
String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
String next = paging.has("next") ? paging.get("next").getAsString() : null;
businesss.setPaging(previous, next);
if (context.hasAppSecret()) {
businesss.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++) {
businesss.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()) {
businesss.add(loadJSON(entry.getValue().toString(), context, header));
}
break;
}
}
if (!isRedownload) {
businesss.add(loadJSON(obj.toString(), context, header));
}
}
return businesss;
} 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()) {
businesss.add(loadJSON(entry.getValue().toString(), context, header));
}
return businesss;
} 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)
) {
businesss.add(loadJSON(value.toString(), context, header));
} else {
isIdIndexedArray = false;
break;
}
}
if (isIdIndexedArray) {
return businesss;
}
// Sixth, check if it's pure JsonObject
businesss.clear();
businesss.add(loadJSON(json, context, header));
return businesss;
}
}
} 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 APIRequestCreateAccessToken createAccessToken() {
return new APIRequestCreateAccessToken(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdAccountInfos getAdAccountInfos() {
return new APIRequestGetAdAccountInfos(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteAdAccounts deleteAdAccounts() {
return new APIRequestDeleteAdAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdReviewRequest createAdReviewRequest() {
return new APIRequestCreateAdReviewRequest(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdStudies getAdStudies() {
return new APIRequestGetAdStudies(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdStudy createAdStudy() {
return new APIRequestCreateAdStudy(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdAccount createAdAccount() {
return new APIRequestCreateAdAccount(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAddPhoneNumber createAddPhoneNumber() {
return new APIRequestCreateAddPhoneNumber(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdNetworkApplication createAdNetworkApplication() {
return new APIRequestCreateAdNetworkApplication(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdNetworkAnalytics getAdNetworkAnalytics() {
return new APIRequestGetAdNetworkAnalytics(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdNetworkAnalytic createAdNetworkAnalytic() {
return new APIRequestCreateAdNetworkAnalytic(this.getPrefixedId().toString(), context);
}
public APIRequestGetAdNetworkAnalyticsResults getAdNetworkAnalyticsResults() {
return new APIRequestGetAdNetworkAnalyticsResults(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 APIRequestGetAdsPixels getAdsPixels() {
return new APIRequestGetAdsPixels(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdsPixel createAdsPixel() {
return new APIRequestCreateAdsPixel(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 APIRequestGetAnPlacements getAnPlacements() {
return new APIRequestGetAnPlacements(this.getPrefixedId().toString(), context);
}
public APIRequestCreateBlockListDraft createBlockListDraft() {
return new APIRequestCreateBlockListDraft(this.getPrefixedId().toString(), context);
}
public APIRequestCreateBmReviewRequest createBmReviewRequest() {
return new APIRequestCreateBmReviewRequest(this.getPrefixedId().toString(), context);
}
public APIRequestGetBusinessAssetGroups getBusinessAssetGroups() {
return new APIRequestGetBusinessAssetGroups(this.getPrefixedId().toString(), context);
}
public APIRequestGetBusinessInvoices getBusinessInvoices() {
return new APIRequestGetBusinessInvoices(this.getPrefixedId().toString(), context);
}
public APIRequestGetBusinessUsers getBusinessUsers() {
return new APIRequestGetBusinessUsers(this.getPrefixedId().toString(), context);
}
public APIRequestCreateBusinessUser createBusinessUser() {
return new APIRequestCreateBusinessUser(this.getPrefixedId().toString(), context);
}
public APIRequestGetBusinessProjects getBusinessProjects() {
return new APIRequestGetBusinessProjects(this.getPrefixedId().toString(), context);
}
public APIRequestCreateClaimCustomConversion createClaimCustomConversion() {
return new APIRequestCreateClaimCustomConversion(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientAdAccounts getClientAdAccounts() {
return new APIRequestGetClientAdAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientApps getClientApps() {
return new APIRequestGetClientApps(this.getPrefixedId().toString(), context);
}
public APIRequestCreateClientApp createClientApp() {
return new APIRequestCreateClientApp(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientOffsiteSignalContainerBusinessObjects getClientOffsiteSignalContainerBusinessObjects() {
return new APIRequestGetClientOffsiteSignalContainerBusinessObjects(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientPages getClientPages() {
return new APIRequestGetClientPages(this.getPrefixedId().toString(), context);
}
public APIRequestCreateClientPage createClientPage() {
return new APIRequestCreateClientPage(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientPixels getClientPixels() {
return new APIRequestGetClientPixels(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientProductCatalogs getClientProductCatalogs() {
return new APIRequestGetClientProductCatalogs(this.getPrefixedId().toString(), context);
}
public APIRequestGetClientWhatsAppBusinessAccounts getClientWhatsAppBusinessAccounts() {
return new APIRequestGetClientWhatsAppBusinessAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteClients deleteClients() {
return new APIRequestDeleteClients(this.getPrefixedId().toString(), context);
}
public APIRequestGetClients getClients() {
return new APIRequestGetClients(this.getPrefixedId().toString(), context);
}
public APIRequestGetCollaborativeAdsCollaborationRequests getCollaborativeAdsCollaborationRequests() {
return new APIRequestGetCollaborativeAdsCollaborationRequests(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCollaborativeAdsCollaborationRequest createCollaborativeAdsCollaborationRequest() {
return new APIRequestCreateCollaborativeAdsCollaborationRequest(this.getPrefixedId().toString(), context);
}
public APIRequestGetCollaborativeAdsSuggestedPartners getCollaborativeAdsSuggestedPartners() {
return new APIRequestGetCollaborativeAdsSuggestedPartners(this.getPrefixedId().toString(), context);
}
public APIRequestGetCommerceMerchantSettings getCommerceMerchantSettings() {
return new APIRequestGetCommerceMerchantSettings(this.getPrefixedId().toString(), context);
}
public APIRequestGetCpasBusinessSetupConfig getCpasBusinessSetupConfig() {
return new APIRequestGetCpasBusinessSetupConfig(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCpasBusinessSetupConfig createCpasBusinessSetupConfig() {
return new APIRequestCreateCpasBusinessSetupConfig(this.getPrefixedId().toString(), context);
}
public APIRequestGetCpasMerchantConfig getCpasMerchantConfig() {
return new APIRequestGetCpasMerchantConfig(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCreativeFolder createCreativeFolder() {
return new APIRequestCreateCreativeFolder(this.getPrefixedId().toString(), context);
}
public APIRequestGetCreditCards getCreditCards() {
return new APIRequestGetCreditCards(this.getPrefixedId().toString(), context);
}
public APIRequestCreateCustomConversion createCustomConversion() {
return new APIRequestCreateCustomConversion(this.getPrefixedId().toString(), context);
}
public APIRequestCreateDraftNegativeKeywordList createDraftNegativeKeywordList() {
return new APIRequestCreateDraftNegativeKeywordList(this.getPrefixedId().toString(), context);
}
public APIRequestGetEventSourceGroups getEventSourceGroups() {
return new APIRequestGetEventSourceGroups(this.getPrefixedId().toString(), context);
}
public APIRequestCreateEventSourceGroup createEventSourceGroup() {
return new APIRequestCreateEventSourceGroup(this.getPrefixedId().toString(), context);
}
public APIRequestGetExtendedCreditApplications getExtendedCreditApplications() {
return new APIRequestGetExtendedCreditApplications(this.getPrefixedId().toString(), context);
}
public APIRequestGetExtendedCredits getExtendedCredits() {
return new APIRequestGetExtendedCredits(this.getPrefixedId().toString(), context);
}
public APIRequestCreateImage createImage() {
return new APIRequestCreateImage(this.getPrefixedId().toString(), context);
}
public APIRequestGetInitiatedAudienceSharingRequests getInitiatedAudienceSharingRequests() {
return new APIRequestGetInitiatedAudienceSharingRequests(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteInstagramAccounts deleteInstagramAccounts() {
return new APIRequestDeleteInstagramAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetInstagramAccounts getInstagramAccounts() {
return new APIRequestGetInstagramAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetInstagramBusinessAccounts getInstagramBusinessAccounts() {
return new APIRequestGetInstagramBusinessAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteManagedBusinesses deleteManagedBusinesses() {
return new APIRequestDeleteManagedBusinesses(this.getPrefixedId().toString(), context);
}
public APIRequestCreateManagedBusiness createManagedBusiness() {
return new APIRequestCreateManagedBusiness(this.getPrefixedId().toString(), context);
}
public APIRequestCreateManagedPartnerBusinessSetup createManagedPartnerBusinessSetup() {
return new APIRequestCreateManagedPartnerBusinessSetup(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteManagedPartnerBusinesses deleteManagedPartnerBusinesses() {
return new APIRequestDeleteManagedPartnerBusinesses(this.getPrefixedId().toString(), context);
}
public APIRequestCreateManagedPartnerBusiness createManagedPartnerBusiness() {
return new APIRequestCreateManagedPartnerBusiness(this.getPrefixedId().toString(), context);
}
public APIRequestGetNegativeKeywordLists getNegativeKeywordLists() {
return new APIRequestGetNegativeKeywordLists(this.getPrefixedId().toString(), context);
}
public APIRequestGetOpenBridgeConfigurations getOpenBridgeConfigurations() {
return new APIRequestGetOpenBridgeConfigurations(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOpenBridgeConfiguration createOpenBridgeConfiguration() {
return new APIRequestCreateOpenBridgeConfiguration(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedAdAccounts getOwnedAdAccounts() {
return new APIRequestGetOwnedAdAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOwnedAdAccount createOwnedAdAccount() {
return new APIRequestCreateOwnedAdAccount(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedApps getOwnedApps() {
return new APIRequestGetOwnedApps(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOwnedApp createOwnedApp() {
return new APIRequestCreateOwnedApp(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteOwnedBusinesses deleteOwnedBusinesses() {
return new APIRequestDeleteOwnedBusinesses(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedBusinesses getOwnedBusinesses() {
return new APIRequestGetOwnedBusinesses(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOwnedBusiness createOwnedBusiness() {
return new APIRequestCreateOwnedBusiness(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedInstagramAccounts getOwnedInstagramAccounts() {
return new APIRequestGetOwnedInstagramAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedOffsiteSignalContainerBusinessObjects getOwnedOffsiteSignalContainerBusinessObjects() {
return new APIRequestGetOwnedOffsiteSignalContainerBusinessObjects(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedPages getOwnedPages() {
return new APIRequestGetOwnedPages(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOwnedPage createOwnedPage() {
return new APIRequestCreateOwnedPage(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedPixels getOwnedPixels() {
return new APIRequestGetOwnedPixels(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedProductCatalogs getOwnedProductCatalogs() {
return new APIRequestGetOwnedProductCatalogs(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOwnedProductCatalog createOwnedProductCatalog() {
return new APIRequestCreateOwnedProductCatalog(this.getPrefixedId().toString(), context);
}
public APIRequestGetOwnedWhatsAppBusinessAccounts getOwnedWhatsAppBusinessAccounts() {
return new APIRequestGetOwnedWhatsAppBusinessAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestDeletePages deletePages() {
return new APIRequestDeletePages(this.getPrefixedId().toString(), context);
}
public APIRequestGetPartnerAccountLinking getPartnerAccountLinking() {
return new APIRequestGetPartnerAccountLinking(this.getPrefixedId().toString(), context);
}
public APIRequestCreatePartnerPremiumOption createPartnerPremiumOption() {
return new APIRequestCreatePartnerPremiumOption(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingClientAdAccounts getPendingClientAdAccounts() {
return new APIRequestGetPendingClientAdAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingClientApps getPendingClientApps() {
return new APIRequestGetPendingClientApps(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingClientPages getPendingClientPages() {
return new APIRequestGetPendingClientPages(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingOwnedAdAccounts getPendingOwnedAdAccounts() {
return new APIRequestGetPendingOwnedAdAccounts(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingOwnedPages getPendingOwnedPages() {
return new APIRequestGetPendingOwnedPages(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingSharedOffsiteSignalContainerBusinessObjects getPendingSharedOffsiteSignalContainerBusinessObjects() {
return new APIRequestGetPendingSharedOffsiteSignalContainerBusinessObjects(this.getPrefixedId().toString(), context);
}
public APIRequestGetPendingUsers getPendingUsers() {
return new APIRequestGetPendingUsers(this.getPrefixedId().toString(), context);
}
public APIRequestGetPicture getPicture() {
return new APIRequestGetPicture(this.getPrefixedId().toString(), context);
}
public APIRequestCreatePixelTo createPixelTo() {
return new APIRequestCreatePixelTo(this.getPrefixedId().toString(), context);
}
public APIRequestGetPreVerifiedNumbers getPreVerifiedNumbers() {
return new APIRequestGetPreVerifiedNumbers(this.getPrefixedId().toString(), context);
}
public APIRequestGetReceivedAudienceSharingRequests getReceivedAudienceSharingRequests() {
return new APIRequestGetReceivedAudienceSharingRequests(this.getPrefixedId().toString(), context);
}
public APIRequestGetResellerGuidances getResellerGuidances() {
return new APIRequestGetResellerGuidances(this.getPrefixedId().toString(), context);
}
public APIRequestGetSelfCertifiedWhatsAppBusinessSubmissions getSelfCertifiedWhatsAppBusinessSubmissions() {
return new APIRequestGetSelfCertifiedWhatsAppBusinessSubmissions(this.getPrefixedId().toString(), context);
}
public APIRequestCreateSetupManagedPartnerAdAccount createSetupManagedPartnerAdAccount() {
return new APIRequestCreateSetupManagedPartnerAdAccount(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteSharePreVerifiedNumbers deleteSharePreVerifiedNumbers() {
return new APIRequestDeleteSharePreVerifiedNumbers(this.getPrefixedId().toString(), context);
}
public APIRequestCreateSharePreVerifiedNumber createSharePreVerifiedNumber() {
return new APIRequestCreateSharePreVerifiedNumber(this.getPrefixedId().toString(), context);
}
public APIRequestCreateSystemUserAccessToken createSystemUserAccessToken() {
return new APIRequestCreateSystemUserAccessToken(this.getPrefixedId().toString(), context);
}
public APIRequestGetSystemUsers getSystemUsers() {
return new APIRequestGetSystemUsers(this.getPrefixedId().toString(), context);
}
public APIRequestCreateSystemUser createSystemUser() {
return new APIRequestCreateSystemUser(this.getPrefixedId().toString(), context);
}
public APIRequestGetThirdPartyMeasurementReportDataset getThirdPartyMeasurementReportDataset() {
return new APIRequestGetThirdPartyMeasurementReportDataset(this.getPrefixedId().toString(), context);
}
public APIRequestCreateVideo createVideo() {
return new APIRequestCreateVideo(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 Boolean getFieldBlockOfflineAnalytics() {
return mBlockOfflineAnalytics;
}
public ManagedPartnerBusiness getFieldCollaborativeAdsManagedPartnerBusinessInfo() {
return mCollaborativeAdsManagedPartnerBusinessInfo;
}
public BusinessManagedPartnerEligibility getFieldCollaborativeAdsManagedPartnerEligibility() {
return mCollaborativeAdsManagedPartnerEligibility;
}
public BusinessPartnerPremiumOptions getFieldCollaborativeAdsPartnerPremiumOptions() {
return mCollaborativeAdsPartnerPremiumOptions;
}
public Object getFieldCreatedBy() {
return mCreatedBy;
}
public String getFieldCreatedTime() {
return mCreatedTime;
}
public String getFieldExtendedUpdatedTime() {
return mExtendedUpdatedTime;
}
public String getFieldId() {
return mId;
}
public Boolean getFieldIsHidden() {
return mIsHidden;
}
public String getFieldLink() {
return mLink;
}
public String getFieldName() {
return mName;
}
public String getFieldPaymentAccountId() {
return mPaymentAccountId;
}
public Page getFieldPrimaryPage() {
if (mPrimaryPage != null) {
mPrimaryPage.context = getContext();
}
return mPrimaryPage;
}
public String getFieldProfilePictureUri() {
return mProfilePictureUri;
}
public Long getFieldTimezoneId() {
return mTimezoneId;
}
public String getFieldTwoFactorType() {
return mTwoFactorType;
}
public Object getFieldUpdatedBy() {
return mUpdatedBy;
}
public String getFieldUpdatedTime() {
return mUpdatedTime;
}
public String getFieldUserAccessExpireTime() {
return mUserAccessExpireTime;
}
public String getFieldVerificationStatus() {
return mVerificationStatus;
}
public String getFieldVertical() {
return mVertical;
}
public Long getFieldVerticalId() {
return mVerticalId;
}
public static class APIRequestCreateAccessToken extends APIRequest {
Business lastResponse = null;
@Override
public Business getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"app_id",
"fbe_external_business_id",
"scope",
"system_user_name",
};
public static final String[] FIELDS = {
};
@Override
public Business parseResponse(String response, String header) throws APIException {
return Business.parseResponse(response, getContext(), this, header).head();
}
@Override
public Business execute() throws APIException {
return execute(new HashMap());
}
@Override
public Business 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 Business apply(ResponseWrapper result) {
try {
return APIRequestCreateAccessToken.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAccessToken(String nodeId, APIContext context) {
super(context, nodeId, "/access_token", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAccessToken setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAccessToken setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAccessToken setAppId (String appId) {
this.setParam("app_id", appId);
return this;
}
public APIRequestCreateAccessToken setFbeExternalBusinessId (String fbeExternalBusinessId) {
this.setParam("fbe_external_business_id", fbeExternalBusinessId);
return this;
}
public APIRequestCreateAccessToken setScope (List scope) {
this.setParam("scope", scope);
return this;
}
public APIRequestCreateAccessToken setScope (String scope) {
this.setParam("scope", scope);
return this;
}
public APIRequestCreateAccessToken setSystemUserName (String systemUserName) {
this.setParam("system_user_name", systemUserName);
return this;
}
public APIRequestCreateAccessToken requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAccessToken requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAccessToken requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAccessToken requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAccessToken requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAccessToken requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdAccountInfos extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"ad_account_id",
"parent_advertiser_id",
"user_id",
};
public static final String[] FIELDS = {
"ad_account_id",
"id",
"managed_by",
"parent_advertiser_id",
"sub_vertical",
"tag",
"user_ids",
"vertical",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return ALMAdAccountInfo.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 APIRequestGetAdAccountInfos.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAdAccountInfos(String nodeId, APIContext context) {
super(context, nodeId, "/ad_account_infos", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdAccountInfos setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdAccountInfos setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdAccountInfos setAdAccountId (String adAccountId) {
this.setParam("ad_account_id", adAccountId);
return this;
}
public APIRequestGetAdAccountInfos setParentAdvertiserId (String parentAdvertiserId) {
this.setParam("parent_advertiser_id", parentAdvertiserId);
return this;
}
public APIRequestGetAdAccountInfos setUserId (String userId) {
this.setParam("user_id", userId);
return this;
}
public APIRequestGetAdAccountInfos requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdAccountInfos requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdAccountInfos requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdAccountInfos requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdAccountInfos requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdAccountInfos requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdAccountInfos requestAdAccountIdField () {
return this.requestAdAccountIdField(true);
}
public APIRequestGetAdAccountInfos requestAdAccountIdField (boolean value) {
this.requestField("ad_account_id", value);
return this;
}
public APIRequestGetAdAccountInfos requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdAccountInfos requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdAccountInfos requestManagedByField () {
return this.requestManagedByField(true);
}
public APIRequestGetAdAccountInfos requestManagedByField (boolean value) {
this.requestField("managed_by", value);
return this;
}
public APIRequestGetAdAccountInfos requestParentAdvertiserIdField () {
return this.requestParentAdvertiserIdField(true);
}
public APIRequestGetAdAccountInfos requestParentAdvertiserIdField (boolean value) {
this.requestField("parent_advertiser_id", value);
return this;
}
public APIRequestGetAdAccountInfos requestSubVerticalField () {
return this.requestSubVerticalField(true);
}
public APIRequestGetAdAccountInfos requestSubVerticalField (boolean value) {
this.requestField("sub_vertical", value);
return this;
}
public APIRequestGetAdAccountInfos requestTagField () {
return this.requestTagField(true);
}
public APIRequestGetAdAccountInfos requestTagField (boolean value) {
this.requestField("tag", value);
return this;
}
public APIRequestGetAdAccountInfos requestUserIdsField () {
return this.requestUserIdsField(true);
}
public APIRequestGetAdAccountInfos requestUserIdsField (boolean value) {
this.requestField("user_ids", value);
return this;
}
public APIRequestGetAdAccountInfos requestVerticalField () {
return this.requestVerticalField(true);
}
public APIRequestGetAdAccountInfos requestVerticalField (boolean value) {
this.requestField("vertical", value);
return this;
}
}
public static class APIRequestDeleteAdAccounts extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"adaccount_id",
};
public static final String[] FIELDS = {
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return APINode.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 APIRequestDeleteAdAccounts.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestDeleteAdAccounts(String nodeId, APIContext context) {
super(context, nodeId, "/ad_accounts", "DELETE", Arrays.asList(PARAMS));
}
@Override
public APIRequestDeleteAdAccounts setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestDeleteAdAccounts setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestDeleteAdAccounts setAdaccountId (String adaccountId) {
this.setParam("adaccount_id", adaccountId);
return this;
}
public APIRequestDeleteAdAccounts requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestDeleteAdAccounts requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAdAccounts requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestDeleteAdAccounts requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAdAccounts requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestDeleteAdAccounts requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAdReviewRequest extends APIRequest {
APINode lastResponse = null;
@Override
public APINode getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"ad_account_ids",
};
public static final String[] FIELDS = {
};
@Override
public APINode parseResponse(String response, String header) throws APIException {
return APINode.parseResponse(response, getContext(), this, header).head();
}
@Override
public APINode execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINode 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 APINode apply(ResponseWrapper result) {
try {
return APIRequestCreateAdReviewRequest.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdReviewRequest(String nodeId, APIContext context) {
super(context, nodeId, "/ad_review_requests", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdReviewRequest setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdReviewRequest setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdReviewRequest setAdAccountIds (List adAccountIds) {
this.setParam("ad_account_ids", adAccountIds);
return this;
}
public APIRequestCreateAdReviewRequest setAdAccountIds (String adAccountIds) {
this.setParam("ad_account_ids", adAccountIds);
return this;
}
public APIRequestCreateAdReviewRequest requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdReviewRequest requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdReviewRequest requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdReviewRequest requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdReviewRequest requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdReviewRequest 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 APIRequestCreateAdStudy extends APIRequest {
AdStudy lastResponse = null;
@Override
public AdStudy getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"cells",
"client_business",
"confidence_level",
"cooldown_start_time",
"description",
"end_time",
"name",
"objectives",
"observation_end_time",
"start_time",
"type",
"viewers",
};
public static final String[] FIELDS = {
};
@Override
public AdStudy parseResponse(String response, String header) throws APIException {
return AdStudy.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdStudy execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdStudy 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 AdStudy apply(ResponseWrapper result) {
try {
return APIRequestCreateAdStudy.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdStudy(String nodeId, APIContext context) {
super(context, nodeId, "/ad_studies", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdStudy setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdStudy setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdStudy setCells (List