Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.facebook.ads.sdk.Business Maven / Gradle / Ivy
/*
* 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.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 APIRequestDeleteAdAccounts deleteAdAccounts() {
return new APIRequestDeleteAdAccounts(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 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 APIRequestGetOfflineConversionDataSets getOfflineConversionDataSets() {
return new APIRequestGetOfflineConversionDataSets(this.getPrefixedId().toString(), context);
}
public APIRequestCreateOfflineConversionDataSet createOfflineConversionDataSet() {
return new APIRequestCreateOfflineConversionDataSet(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 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);
}
}
}
);
};
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 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);
}
}
}
);
};
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 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);
}
}
}
);
};
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);
}
}
}
);
};
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 cells) {
this.setParam("cells", cells);
return this;
}
public APIRequestCreateAdStudy setCells (String cells) {
this.setParam("cells", cells);
return this;
}
public APIRequestCreateAdStudy setClientBusiness (String clientBusiness) {
this.setParam("client_business", clientBusiness);
return this;
}
public APIRequestCreateAdStudy setConfidenceLevel (Double confidenceLevel) {
this.setParam("confidence_level", confidenceLevel);
return this;
}
public APIRequestCreateAdStudy setConfidenceLevel (String confidenceLevel) {
this.setParam("confidence_level", confidenceLevel);
return this;
}
public APIRequestCreateAdStudy setCooldownStartTime (Long cooldownStartTime) {
this.setParam("cooldown_start_time", cooldownStartTime);
return this;
}
public APIRequestCreateAdStudy setCooldownStartTime (String cooldownStartTime) {
this.setParam("cooldown_start_time", cooldownStartTime);
return this;
}
public APIRequestCreateAdStudy setDescription (String description) {
this.setParam("description", description);
return this;
}
public APIRequestCreateAdStudy setEndTime (Long endTime) {
this.setParam("end_time", endTime);
return this;
}
public APIRequestCreateAdStudy setEndTime (String endTime) {
this.setParam("end_time", endTime);
return this;
}
public APIRequestCreateAdStudy setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdStudy setObjectives (List objectives) {
this.setParam("objectives", objectives);
return this;
}
public APIRequestCreateAdStudy setObjectives (String objectives) {
this.setParam("objectives", objectives);
return this;
}
public APIRequestCreateAdStudy setObservationEndTime (Long observationEndTime) {
this.setParam("observation_end_time", observationEndTime);
return this;
}
public APIRequestCreateAdStudy setObservationEndTime (String observationEndTime) {
this.setParam("observation_end_time", observationEndTime);
return this;
}
public APIRequestCreateAdStudy setStartTime (Long startTime) {
this.setParam("start_time", startTime);
return this;
}
public APIRequestCreateAdStudy setStartTime (String startTime) {
this.setParam("start_time", startTime);
return this;
}
public APIRequestCreateAdStudy setType (AdStudy.EnumType type) {
this.setParam("type", type);
return this;
}
public APIRequestCreateAdStudy setType (String type) {
this.setParam("type", type);
return this;
}
public APIRequestCreateAdStudy setViewers (List viewers) {
this.setParam("viewers", viewers);
return this;
}
public APIRequestCreateAdStudy setViewers (String viewers) {
this.setParam("viewers", viewers);
return this;
}
public APIRequestCreateAdStudy requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdStudy requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdStudy requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdStudy requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdStudy requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdStudy requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAdAccount extends APIRequest {
AdAccount lastResponse = null;
@Override
public AdAccount getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"ad_account_created_from_bm_flag",
"currency",
"end_advertiser",
"funding_id",
"invoice",
"invoice_group_id",
"invoicing_emails",
"io",
"media_agency",
"name",
"partner",
"po_number",
"timezone_id",
};
public static final String[] FIELDS = {
};
@Override
public AdAccount parseResponse(String response, String header) throws APIException {
return AdAccount.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdAccount execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdAccount 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 AdAccount apply(ResponseWrapper result) {
try {
return APIRequestCreateAdAccount.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateAdAccount(String nodeId, APIContext context) {
super(context, nodeId, "/adaccount", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdAccount setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdAccount setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdAccount setAdAccountCreatedFromBmFlag (Boolean adAccountCreatedFromBmFlag) {
this.setParam("ad_account_created_from_bm_flag", adAccountCreatedFromBmFlag);
return this;
}
public APIRequestCreateAdAccount setAdAccountCreatedFromBmFlag (String adAccountCreatedFromBmFlag) {
this.setParam("ad_account_created_from_bm_flag", adAccountCreatedFromBmFlag);
return this;
}
public APIRequestCreateAdAccount setCurrency (String currency) {
this.setParam("currency", currency);
return this;
}
public APIRequestCreateAdAccount setEndAdvertiser (Object endAdvertiser) {
this.setParam("end_advertiser", endAdvertiser);
return this;
}
public APIRequestCreateAdAccount setEndAdvertiser (String endAdvertiser) {
this.setParam("end_advertiser", endAdvertiser);
return this;
}
public APIRequestCreateAdAccount setFundingId (String fundingId) {
this.setParam("funding_id", fundingId);
return this;
}
public APIRequestCreateAdAccount setInvoice (Boolean invoice) {
this.setParam("invoice", invoice);
return this;
}
public APIRequestCreateAdAccount setInvoice (String invoice) {
this.setParam("invoice", invoice);
return this;
}
public APIRequestCreateAdAccount setInvoiceGroupId (String invoiceGroupId) {
this.setParam("invoice_group_id", invoiceGroupId);
return this;
}
public APIRequestCreateAdAccount setInvoicingEmails (List invoicingEmails) {
this.setParam("invoicing_emails", invoicingEmails);
return this;
}
public APIRequestCreateAdAccount setInvoicingEmails (String invoicingEmails) {
this.setParam("invoicing_emails", invoicingEmails);
return this;
}
public APIRequestCreateAdAccount setIo (Boolean io) {
this.setParam("io", io);
return this;
}
public APIRequestCreateAdAccount setIo (String io) {
this.setParam("io", io);
return this;
}
public APIRequestCreateAdAccount setMediaAgency (String mediaAgency) {
this.setParam("media_agency", mediaAgency);
return this;
}
public APIRequestCreateAdAccount setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdAccount setPartner (String partner) {
this.setParam("partner", partner);
return this;
}
public APIRequestCreateAdAccount setPoNumber (String poNumber) {
this.setParam("po_number", poNumber);
return this;
}
public APIRequestCreateAdAccount setTimezoneId (Long timezoneId) {
this.setParam("timezone_id", timezoneId);
return this;
}
public APIRequestCreateAdAccount setTimezoneId (String timezoneId) {
this.setParam("timezone_id", timezoneId);
return this;
}
public APIRequestCreateAdAccount requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdAccount requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdAccount requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdAccount requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdAccount requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdAccount requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAddPhoneNumber extends APIRequest {
Business lastResponse = null;
@Override
public Business getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"phone_number",
};
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 APIRequestCreateAddPhoneNumber.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateAddPhoneNumber(String nodeId, APIContext context) {
super(context, nodeId, "/add_phone_numbers", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAddPhoneNumber setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAddPhoneNumber setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAddPhoneNumber setPhoneNumber (String phoneNumber) {
this.setParam("phone_number", phoneNumber);
return this;
}
public APIRequestCreateAddPhoneNumber requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAddPhoneNumber requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAddPhoneNumber requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAddPhoneNumber requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAddPhoneNumber requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAddPhoneNumber requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAdNetworkApplication extends APIRequest {
Application lastResponse = null;
@Override
public Application getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"name",
};
public static final String[] FIELDS = {
};
@Override
public Application parseResponse(String response, String header) throws APIException {
return Application.parseResponse(response, getContext(), this, header).head();
}
@Override
public Application execute() throws APIException {
return execute(new HashMap());
}
@Override
public Application 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 Application apply(ResponseWrapper result) {
try {
return APIRequestCreateAdNetworkApplication.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateAdNetworkApplication(String nodeId, APIContext context) {
super(context, nodeId, "/adnetwork_applications", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdNetworkApplication setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdNetworkApplication setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdNetworkApplication setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdNetworkApplication requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdNetworkApplication requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdNetworkApplication requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdNetworkApplication requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdNetworkApplication requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdNetworkApplication requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdNetworkAnalytics extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"aggregation_period",
"breakdowns",
"filters",
"limit",
"metrics",
"ordering_column",
"ordering_type",
"since",
"until",
};
public static final String[] FIELDS = {
"omitted_results",
"query_id",
"results",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdNetworkAnalyticsSyncQueryResult.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 APIRequestGetAdNetworkAnalytics.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAdNetworkAnalytics(String nodeId, APIContext context) {
super(context, nodeId, "/adnetworkanalytics", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdNetworkAnalytics setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdNetworkAnalytics setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdNetworkAnalytics setAggregationPeriod (AdNetworkAnalyticsSyncQueryResult.EnumAggregationPeriod aggregationPeriod) {
this.setParam("aggregation_period", aggregationPeriod);
return this;
}
public APIRequestGetAdNetworkAnalytics setAggregationPeriod (String aggregationPeriod) {
this.setParam("aggregation_period", aggregationPeriod);
return this;
}
public APIRequestGetAdNetworkAnalytics setBreakdowns (List breakdowns) {
this.setParam("breakdowns", breakdowns);
return this;
}
public APIRequestGetAdNetworkAnalytics setBreakdowns (String breakdowns) {
this.setParam("breakdowns", breakdowns);
return this;
}
public APIRequestGetAdNetworkAnalytics setFilters (List> filters) {
this.setParam("filters", filters);
return this;
}
public APIRequestGetAdNetworkAnalytics setFilters (String filters) {
this.setParam("filters", filters);
return this;
}
public APIRequestGetAdNetworkAnalytics setLimit (Long limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestGetAdNetworkAnalytics setLimit (String limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestGetAdNetworkAnalytics setMetrics (List metrics) {
this.setParam("metrics", metrics);
return this;
}
public APIRequestGetAdNetworkAnalytics setMetrics (String metrics) {
this.setParam("metrics", metrics);
return this;
}
public APIRequestGetAdNetworkAnalytics setOrderingColumn (AdNetworkAnalyticsSyncQueryResult.EnumOrderingColumn orderingColumn) {
this.setParam("ordering_column", orderingColumn);
return this;
}
public APIRequestGetAdNetworkAnalytics setOrderingColumn (String orderingColumn) {
this.setParam("ordering_column", orderingColumn);
return this;
}
public APIRequestGetAdNetworkAnalytics setOrderingType (AdNetworkAnalyticsSyncQueryResult.EnumOrderingType orderingType) {
this.setParam("ordering_type", orderingType);
return this;
}
public APIRequestGetAdNetworkAnalytics setOrderingType (String orderingType) {
this.setParam("ordering_type", orderingType);
return this;
}
public APIRequestGetAdNetworkAnalytics setSince (String since) {
this.setParam("since", since);
return this;
}
public APIRequestGetAdNetworkAnalytics setUntil (String until) {
this.setParam("until", until);
return this;
}
public APIRequestGetAdNetworkAnalytics requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdNetworkAnalytics requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdNetworkAnalytics requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdNetworkAnalytics requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdNetworkAnalytics requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdNetworkAnalytics requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdNetworkAnalytics requestOmittedResultsField () {
return this.requestOmittedResultsField(true);
}
public APIRequestGetAdNetworkAnalytics requestOmittedResultsField (boolean value) {
this.requestField("omitted_results", value);
return this;
}
public APIRequestGetAdNetworkAnalytics requestQueryIdField () {
return this.requestQueryIdField(true);
}
public APIRequestGetAdNetworkAnalytics requestQueryIdField (boolean value) {
this.requestField("query_id", value);
return this;
}
public APIRequestGetAdNetworkAnalytics requestResultsField () {
return this.requestResultsField(true);
}
public APIRequestGetAdNetworkAnalytics requestResultsField (boolean value) {
this.requestField("results", value);
return this;
}
}
public static class APIRequestCreateAdNetworkAnalytic extends APIRequest {
Business lastResponse = null;
@Override
public Business getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"aggregation_period",
"breakdowns",
"filters",
"limit",
"metrics",
"ordering_column",
"ordering_type",
"since",
"until",
};
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 APIRequestCreateAdNetworkAnalytic.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateAdNetworkAnalytic(String nodeId, APIContext context) {
super(context, nodeId, "/adnetworkanalytics", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdNetworkAnalytic setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdNetworkAnalytic setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdNetworkAnalytic setAggregationPeriod (AdNetworkAnalyticsSyncQueryResult.EnumAggregationPeriod aggregationPeriod) {
this.setParam("aggregation_period", aggregationPeriod);
return this;
}
public APIRequestCreateAdNetworkAnalytic setAggregationPeriod (String aggregationPeriod) {
this.setParam("aggregation_period", aggregationPeriod);
return this;
}
public APIRequestCreateAdNetworkAnalytic setBreakdowns (List breakdowns) {
this.setParam("breakdowns", breakdowns);
return this;
}
public APIRequestCreateAdNetworkAnalytic setBreakdowns (String breakdowns) {
this.setParam("breakdowns", breakdowns);
return this;
}
public APIRequestCreateAdNetworkAnalytic setFilters (List filters) {
this.setParam("filters", filters);
return this;
}
public APIRequestCreateAdNetworkAnalytic setFilters (String filters) {
this.setParam("filters", filters);
return this;
}
public APIRequestCreateAdNetworkAnalytic setLimit (Long limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestCreateAdNetworkAnalytic setLimit (String limit) {
this.setParam("limit", limit);
return this;
}
public APIRequestCreateAdNetworkAnalytic setMetrics (List metrics) {
this.setParam("metrics", metrics);
return this;
}
public APIRequestCreateAdNetworkAnalytic setMetrics (String metrics) {
this.setParam("metrics", metrics);
return this;
}
public APIRequestCreateAdNetworkAnalytic setOrderingColumn (AdNetworkAnalyticsSyncQueryResult.EnumOrderingColumn orderingColumn) {
this.setParam("ordering_column", orderingColumn);
return this;
}
public APIRequestCreateAdNetworkAnalytic setOrderingColumn (String orderingColumn) {
this.setParam("ordering_column", orderingColumn);
return this;
}
public APIRequestCreateAdNetworkAnalytic setOrderingType (AdNetworkAnalyticsSyncQueryResult.EnumOrderingType orderingType) {
this.setParam("ordering_type", orderingType);
return this;
}
public APIRequestCreateAdNetworkAnalytic setOrderingType (String orderingType) {
this.setParam("ordering_type", orderingType);
return this;
}
public APIRequestCreateAdNetworkAnalytic setSince (String since) {
this.setParam("since", since);
return this;
}
public APIRequestCreateAdNetworkAnalytic setUntil (String until) {
this.setParam("until", until);
return this;
}
public APIRequestCreateAdNetworkAnalytic requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdNetworkAnalytic requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdNetworkAnalytic requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdNetworkAnalytic requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdNetworkAnalytic requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdNetworkAnalytic requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdNetworkAnalyticsResults extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"query_ids",
};
public static final String[] FIELDS = {
"data",
"error",
"omitted_results",
"query_id",
"results",
"status",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdNetworkAnalyticsAsyncQueryResult.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 APIRequestGetAdNetworkAnalyticsResults.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAdNetworkAnalyticsResults(String nodeId, APIContext context) {
super(context, nodeId, "/adnetworkanalytics_results", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdNetworkAnalyticsResults setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdNetworkAnalyticsResults setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults setQueryIds (List queryIds) {
this.setParam("query_ids", queryIds);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults setQueryIds (String queryIds) {
this.setParam("query_ids", queryIds);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdNetworkAnalyticsResults requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdNetworkAnalyticsResults requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdNetworkAnalyticsResults requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdNetworkAnalyticsResults requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestDataField () {
return this.requestDataField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestDataField (boolean value) {
this.requestField("data", value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestErrorField () {
return this.requestErrorField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestErrorField (boolean value) {
this.requestField("error", value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestOmittedResultsField () {
return this.requestOmittedResultsField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestOmittedResultsField (boolean value) {
this.requestField("omitted_results", value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestQueryIdField () {
return this.requestQueryIdField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestQueryIdField (boolean value) {
this.requestField("query_id", value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestResultsField () {
return this.requestResultsField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestResultsField (boolean value) {
this.requestField("results", value);
return this;
}
public APIRequestGetAdNetworkAnalyticsResults requestStatusField () {
return this.requestStatusField(true);
}
public APIRequestGetAdNetworkAnalyticsResults requestStatusField (boolean value) {
this.requestField("status", value);
return this;
}
}
public static class APIRequestGetAdsReportingMmmReports extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"filtering",
};
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 APIRequestGetAdsReportingMmmReports.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAdsReportingMmmReports(String nodeId, APIContext context) {
super(context, nodeId, "/ads_reporting_mmm_reports", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdsReportingMmmReports setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdsReportingMmmReports setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdsReportingMmmReports setFiltering (List> filtering) {
this.setParam("filtering", filtering);
return this;
}
public APIRequestGetAdsReportingMmmReports setFiltering (String filtering) {
this.setParam("filtering", filtering);
return this;
}
public APIRequestGetAdsReportingMmmReports requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdsReportingMmmReports requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsReportingMmmReports requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdsReportingMmmReports requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsReportingMmmReports requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdsReportingMmmReports requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdsReportingMmmSchedulers extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
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 APIRequestGetAdsReportingMmmSchedulers.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAdsReportingMmmSchedulers(String nodeId, APIContext context) {
super(context, nodeId, "/ads_reporting_mmm_schedulers", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdsReportingMmmSchedulers setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdsReportingMmmSchedulers setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdsReportingMmmSchedulers requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdsReportingMmmSchedulers requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsReportingMmmSchedulers requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdsReportingMmmSchedulers requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsReportingMmmSchedulers requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdsReportingMmmSchedulers requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAdsPixels extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"id_filter",
"name_filter",
"sort_by",
};
public static final String[] FIELDS = {
"automatic_matching_fields",
"can_proxy",
"code",
"config",
"creation_time",
"creator",
"data_use_setting",
"description",
"duplicate_entries",
"enable_auto_assign_to_accounts",
"enable_automatic_matching",
"event_stats",
"event_time_max",
"event_time_min",
"first_party_cookie_status",
"id",
"is_consolidated_container",
"is_created_by_business",
"is_crm",
"is_mta_use",
"is_restricted_use",
"is_unavailable",
"last_fired_time",
"last_upload_app",
"last_upload_app_changed_time",
"match_rate_approx",
"matched_entries",
"name",
"owner_ad_account",
"owner_business",
"usage",
"user_access_expire_time",
"valid_entries",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AdsPixel.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 APIRequestGetAdsPixels.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAdsPixels(String nodeId, APIContext context) {
super(context, nodeId, "/adspixels", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAdsPixels setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAdsPixels setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAdsPixels setIdFilter (String idFilter) {
this.setParam("id_filter", idFilter);
return this;
}
public APIRequestGetAdsPixels setNameFilter (String nameFilter) {
this.setParam("name_filter", nameFilter);
return this;
}
public APIRequestGetAdsPixels setSortBy (AdsPixel.EnumSortBy sortBy) {
this.setParam("sort_by", sortBy);
return this;
}
public APIRequestGetAdsPixels setSortBy (String sortBy) {
this.setParam("sort_by", sortBy);
return this;
}
public APIRequestGetAdsPixels requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAdsPixels requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsPixels requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAdsPixels requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAdsPixels requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAdsPixels requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAdsPixels requestAutomaticMatchingFieldsField () {
return this.requestAutomaticMatchingFieldsField(true);
}
public APIRequestGetAdsPixels requestAutomaticMatchingFieldsField (boolean value) {
this.requestField("automatic_matching_fields", value);
return this;
}
public APIRequestGetAdsPixels requestCanProxyField () {
return this.requestCanProxyField(true);
}
public APIRequestGetAdsPixels requestCanProxyField (boolean value) {
this.requestField("can_proxy", value);
return this;
}
public APIRequestGetAdsPixels requestCodeField () {
return this.requestCodeField(true);
}
public APIRequestGetAdsPixels requestCodeField (boolean value) {
this.requestField("code", value);
return this;
}
public APIRequestGetAdsPixels requestConfigField () {
return this.requestConfigField(true);
}
public APIRequestGetAdsPixels requestConfigField (boolean value) {
this.requestField("config", value);
return this;
}
public APIRequestGetAdsPixels requestCreationTimeField () {
return this.requestCreationTimeField(true);
}
public APIRequestGetAdsPixels requestCreationTimeField (boolean value) {
this.requestField("creation_time", value);
return this;
}
public APIRequestGetAdsPixels requestCreatorField () {
return this.requestCreatorField(true);
}
public APIRequestGetAdsPixels requestCreatorField (boolean value) {
this.requestField("creator", value);
return this;
}
public APIRequestGetAdsPixels requestDataUseSettingField () {
return this.requestDataUseSettingField(true);
}
public APIRequestGetAdsPixels requestDataUseSettingField (boolean value) {
this.requestField("data_use_setting", value);
return this;
}
public APIRequestGetAdsPixels requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetAdsPixels requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetAdsPixels requestDuplicateEntriesField () {
return this.requestDuplicateEntriesField(true);
}
public APIRequestGetAdsPixels requestDuplicateEntriesField (boolean value) {
this.requestField("duplicate_entries", value);
return this;
}
public APIRequestGetAdsPixels requestEnableAutoAssignToAccountsField () {
return this.requestEnableAutoAssignToAccountsField(true);
}
public APIRequestGetAdsPixels requestEnableAutoAssignToAccountsField (boolean value) {
this.requestField("enable_auto_assign_to_accounts", value);
return this;
}
public APIRequestGetAdsPixels requestEnableAutomaticMatchingField () {
return this.requestEnableAutomaticMatchingField(true);
}
public APIRequestGetAdsPixels requestEnableAutomaticMatchingField (boolean value) {
this.requestField("enable_automatic_matching", value);
return this;
}
public APIRequestGetAdsPixels requestEventStatsField () {
return this.requestEventStatsField(true);
}
public APIRequestGetAdsPixels requestEventStatsField (boolean value) {
this.requestField("event_stats", value);
return this;
}
public APIRequestGetAdsPixels requestEventTimeMaxField () {
return this.requestEventTimeMaxField(true);
}
public APIRequestGetAdsPixels requestEventTimeMaxField (boolean value) {
this.requestField("event_time_max", value);
return this;
}
public APIRequestGetAdsPixels requestEventTimeMinField () {
return this.requestEventTimeMinField(true);
}
public APIRequestGetAdsPixels requestEventTimeMinField (boolean value) {
this.requestField("event_time_min", value);
return this;
}
public APIRequestGetAdsPixels requestFirstPartyCookieStatusField () {
return this.requestFirstPartyCookieStatusField(true);
}
public APIRequestGetAdsPixels requestFirstPartyCookieStatusField (boolean value) {
this.requestField("first_party_cookie_status", value);
return this;
}
public APIRequestGetAdsPixels requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAdsPixels requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAdsPixels requestIsConsolidatedContainerField () {
return this.requestIsConsolidatedContainerField(true);
}
public APIRequestGetAdsPixels requestIsConsolidatedContainerField (boolean value) {
this.requestField("is_consolidated_container", value);
return this;
}
public APIRequestGetAdsPixels requestIsCreatedByBusinessField () {
return this.requestIsCreatedByBusinessField(true);
}
public APIRequestGetAdsPixels requestIsCreatedByBusinessField (boolean value) {
this.requestField("is_created_by_business", value);
return this;
}
public APIRequestGetAdsPixels requestIsCrmField () {
return this.requestIsCrmField(true);
}
public APIRequestGetAdsPixels requestIsCrmField (boolean value) {
this.requestField("is_crm", value);
return this;
}
public APIRequestGetAdsPixels requestIsMtaUseField () {
return this.requestIsMtaUseField(true);
}
public APIRequestGetAdsPixels requestIsMtaUseField (boolean value) {
this.requestField("is_mta_use", value);
return this;
}
public APIRequestGetAdsPixels requestIsRestrictedUseField () {
return this.requestIsRestrictedUseField(true);
}
public APIRequestGetAdsPixels requestIsRestrictedUseField (boolean value) {
this.requestField("is_restricted_use", value);
return this;
}
public APIRequestGetAdsPixels requestIsUnavailableField () {
return this.requestIsUnavailableField(true);
}
public APIRequestGetAdsPixels requestIsUnavailableField (boolean value) {
this.requestField("is_unavailable", value);
return this;
}
public APIRequestGetAdsPixels requestLastFiredTimeField () {
return this.requestLastFiredTimeField(true);
}
public APIRequestGetAdsPixels requestLastFiredTimeField (boolean value) {
this.requestField("last_fired_time", value);
return this;
}
public APIRequestGetAdsPixels requestLastUploadAppField () {
return this.requestLastUploadAppField(true);
}
public APIRequestGetAdsPixels requestLastUploadAppField (boolean value) {
this.requestField("last_upload_app", value);
return this;
}
public APIRequestGetAdsPixels requestLastUploadAppChangedTimeField () {
return this.requestLastUploadAppChangedTimeField(true);
}
public APIRequestGetAdsPixels requestLastUploadAppChangedTimeField (boolean value) {
this.requestField("last_upload_app_changed_time", value);
return this;
}
public APIRequestGetAdsPixels requestMatchRateApproxField () {
return this.requestMatchRateApproxField(true);
}
public APIRequestGetAdsPixels requestMatchRateApproxField (boolean value) {
this.requestField("match_rate_approx", value);
return this;
}
public APIRequestGetAdsPixels requestMatchedEntriesField () {
return this.requestMatchedEntriesField(true);
}
public APIRequestGetAdsPixels requestMatchedEntriesField (boolean value) {
this.requestField("matched_entries", value);
return this;
}
public APIRequestGetAdsPixels requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAdsPixels requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAdsPixels requestOwnerAdAccountField () {
return this.requestOwnerAdAccountField(true);
}
public APIRequestGetAdsPixels requestOwnerAdAccountField (boolean value) {
this.requestField("owner_ad_account", value);
return this;
}
public APIRequestGetAdsPixels requestOwnerBusinessField () {
return this.requestOwnerBusinessField(true);
}
public APIRequestGetAdsPixels requestOwnerBusinessField (boolean value) {
this.requestField("owner_business", value);
return this;
}
public APIRequestGetAdsPixels requestUsageField () {
return this.requestUsageField(true);
}
public APIRequestGetAdsPixels requestUsageField (boolean value) {
this.requestField("usage", value);
return this;
}
public APIRequestGetAdsPixels requestUserAccessExpireTimeField () {
return this.requestUserAccessExpireTimeField(true);
}
public APIRequestGetAdsPixels requestUserAccessExpireTimeField (boolean value) {
this.requestField("user_access_expire_time", value);
return this;
}
public APIRequestGetAdsPixels requestValidEntriesField () {
return this.requestValidEntriesField(true);
}
public APIRequestGetAdsPixels requestValidEntriesField (boolean value) {
this.requestField("valid_entries", value);
return this;
}
}
public static class APIRequestCreateAdsPixel extends APIRequest {
AdsPixel lastResponse = null;
@Override
public AdsPixel getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"is_crm",
"name",
};
public static final String[] FIELDS = {
};
@Override
public AdsPixel parseResponse(String response, String header) throws APIException {
return AdsPixel.parseResponse(response, getContext(), this, header).head();
}
@Override
public AdsPixel execute() throws APIException {
return execute(new HashMap());
}
@Override
public AdsPixel 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 AdsPixel apply(ResponseWrapper result) {
try {
return APIRequestCreateAdsPixel.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateAdsPixel(String nodeId, APIContext context) {
super(context, nodeId, "/adspixels", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdsPixel setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdsPixel setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdsPixel setIsCrm (Boolean isCrm) {
this.setParam("is_crm", isCrm);
return this;
}
public APIRequestCreateAdsPixel setIsCrm (String isCrm) {
this.setParam("is_crm", isCrm);
return this;
}
public APIRequestCreateAdsPixel setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAdsPixel requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdsPixel requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdsPixel requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdsPixel requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdsPixel requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdsPixel requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestDeleteAgencies extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"business",
};
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 APIRequestDeleteAgencies.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestDeleteAgencies(String nodeId, APIContext context) {
super(context, nodeId, "/agencies", "DELETE", Arrays.asList(PARAMS));
}
@Override
public APIRequestDeleteAgencies setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestDeleteAgencies setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestDeleteAgencies setBusiness (String business) {
this.setParam("business", business);
return this;
}
public APIRequestDeleteAgencies requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestDeleteAgencies requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAgencies requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestDeleteAgencies requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAgencies requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestDeleteAgencies requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAgencies extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"block_offline_analytics",
"collaborative_ads_managed_partner_business_info",
"collaborative_ads_managed_partner_eligibility",
"collaborative_ads_partner_premium_options",
"created_by",
"created_time",
"extended_updated_time",
"id",
"is_hidden",
"link",
"name",
"primary_page",
"profile_picture_uri",
"timezone_id",
"two_factor_type",
"updated_by",
"updated_time",
"user_access_expire_time",
"verification_status",
"vertical",
"vertical_id",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Business.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