From 8f5d1f41a9c9f0edc5bb24e599e387f0aa6aa51a Mon Sep 17 00:00:00 2001 From: generatedunixname89002005295453 Date: Mon, 15 Apr 2024 11:24:23 -0700 Subject: [PATCH] Auto-generated java SDK code update Summary: ignore-conflict-markers Reviewed By: stcheng Differential Revision: D56033361 fbshipit-source-id: 27416c3be801e0728fbf483bf381ef27ea2d77ab --- .../AdAccountAdSetsPostAdSetCreateCpa.java | 4 +- ...ountAdSetsPostAdSetCreateCpaAppEvents.java | 4 +- examples/AdAccountAdSetsPostCreateAdSet.java | 4 +- .../AdAccountAdSetsPostDailyBudget20.java | 4 +- ...tsPostLifetimeBudget200Duration10Days.java | 4 +- ...countAdSetsPostOptimizePostEngagement.java | 4 +- .../AdgroupLeadsEdgeAdgroupLeadsFiltered.java | 2 +- examples/AdsPixelEventsPost.java | 2 +- pom.xml | 2 +- .../java/com/facebook/ads/sdk/APIConfig.java | 2 +- .../java/com/facebook/ads/sdk/AdAccount.java | 406 ++++++++++++ .../facebook/ads/sdk/AdAccountAdVolume.java | 10 + .../ads/sdk/AdAccountTargetingUnified.java | 2 + .../java/com/facebook/ads/sdk/AdActivity.java | 2 + .../com/facebook/ads/sdk/AdAssetFeedSpec.java | 26 + .../java/com/facebook/ads/sdk/AdCreative.java | 14 + .../ads/sdk/AdCreativeFeaturesSpec.java | 68 ++ .../facebook/ads/sdk/AdCreativeLinkData.java | 2 + .../sdk/AdCreativeLinkDataCallToAction.java | 14 + .../ads/sdk/AdCreativeSourcingSpec.java | 12 + .../java/com/facebook/ads/sdk/AdLabel.java | 8 + .../java/com/facebook/ads/sdk/AdPreview.java | 6 + src/main/java/com/facebook/ads/sdk/AdSet.java | 28 + .../com/facebook/ads/sdk/AdStudyCell.java | 16 + .../java/com/facebook/ads/sdk/AdVideo.java | 16 + .../java/com/facebook/ads/sdk/AdsPixel.java | 125 +--- .../com/facebook/ads/sdk/Application.java | 431 +------------ .../java/com/facebook/ads/sdk/Business.java | 40 +- .../facebook/ads/sdk/BusinessAssetGroup.java | 16 + .../com/facebook/ads/sdk/BusinessUser.java | 16 + .../ads/sdk/CPASBusinessSetupConfig.java | 8 + .../java/com/facebook/ads/sdk/Campaign.java | 8 + .../ads/sdk/CommerceMerchantSettings.java | 272 -------- .../com/facebook/ads/sdk/CommerceOrder.java | 197 +++++- .../com/facebook/ads/sdk/CustomAudience.java | 12 + .../com/facebook/ads/sdk/Destination.java | 15 + .../facebook/ads/sdk/EventSourceGroup.java | 8 + .../ads/sdk/ExtendedCreditInvoiceGroup.java | 8 + .../java/com/facebook/ads/sdk/Flight.java | 15 + src/main/java/com/facebook/ads/sdk/Hotel.java | 15 + .../com/facebook/ads/sdk/IGUpcomingEvent.java | 579 ++++++++++++++++++ .../com/facebook/ads/sdk/InstagramUser.java | 189 +++++- .../java/com/facebook/ads/sdk/LiveVideo.java | 8 + .../ads/sdk/LocalServiceBusiness.java | 15 + .../ads/sdk/OfflineConversionDataSet.java | 16 + src/main/java/com/facebook/ads/sdk/Page.java | 182 ++---- .../ads/sdk/PageCommerceEligibility.java | 248 -------- .../java/com/facebook/ads/sdk/PagePost.java | 8 + src/main/java/com/facebook/ads/sdk/Photo.java | 8 + src/main/java/com/facebook/ads/sdk/Post.java | 8 + .../com/facebook/ads/sdk/ProductCatalog.java | 175 ++++++ .../com/facebook/ads/sdk/ProductFeed.java | 24 + .../com/facebook/ads/sdk/ProductItem.java | 2 + .../java/com/facebook/ads/sdk/ProductSet.java | 24 + .../java/com/facebook/ads/sdk/SystemUser.java | 16 + .../ads/sdk/TargetingGeoLocation.java | 17 - ...TargetingGeoLocationLocationExpansion.java | 236 ------- src/main/java/com/facebook/ads/sdk/User.java | 56 ++ .../ads/sdk/WhatsAppBusinessAccount.java | 115 +++- ...ssPartnerClientVerificationSubmission.java | 56 +- 60 files changed, 2334 insertions(+), 1496 deletions(-) create mode 100644 src/main/java/com/facebook/ads/sdk/IGUpcomingEvent.java delete mode 100644 src/main/java/com/facebook/ads/sdk/PageCommerceEligibility.java delete mode 100644 src/main/java/com/facebook/ads/sdk/TargetingGeoLocationLocationExpansion.java diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpa.java b/examples/AdAccountAdSetsPostAdSetCreateCpa.java index a9baf4d8..92160c05 100644 --- a/examples/AdAccountAdSetsPostAdSetCreateCpa.java +++ b/examples/AdAccountAdSetsPostAdSetCreateCpa.java @@ -39,8 +39,8 @@ public static void main (String args[]) throws APIException { .setName("A CPA Ad Set") .setCampaignId("") .setDailyBudget(5000L) - .setStartTime("2024-03-20T14:31:58-0700") - .setEndTime("2024-03-27T14:31:58-0700") + .setStartTime("2024-04-08T11:26:05-0700") + .setEndTime("2024-04-15T11:26:05-0700") .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) .setBidAmount(1000L) diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java index 220947b3..0e178098 100644 --- a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java +++ b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java @@ -39,8 +39,8 @@ public static void main (String args[]) throws APIException { .setName("A CPA Ad Set optimized for App Events") .setCampaignId("") .setDailyBudget(300L) - .setStartTime("2024-03-20T14:32:42-0700") - .setEndTime("2024-03-27T14:32:42-0700") + .setStartTime("2024-04-08T11:26:49-0700") + .setEndTime("2024-04-15T11:26:49-0700") .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS) .setBidAmount(100L) diff --git a/examples/AdAccountAdSetsPostCreateAdSet.java b/examples/AdAccountAdSetsPostCreateAdSet.java index 813699f0..83d8ab98 100644 --- a/examples/AdAccountAdSetsPostCreateAdSet.java +++ b/examples/AdAccountAdSetsPostCreateAdSet.java @@ -38,8 +38,8 @@ public static void main (String args[]) throws APIException { new AdAccount(id, context).createAdSet() .setName("My First AdSet") .setLifetimeBudget(20000L) - .setStartTime("2024-03-20T14:31:13-0700") - .setEndTime("2024-03-27T14:31:13-0700") + .setStartTime("2024-04-08T11:25:19-0700") + .setEndTime("2024-04-15T11:25:19-0700") .setCampaignId("") .setBidAmount(500L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) diff --git a/examples/AdAccountAdSetsPostDailyBudget20.java b/examples/AdAccountAdSetsPostDailyBudget20.java index 7120ddd3..bd0785dd 100644 --- a/examples/AdAccountAdSetsPostDailyBudget20.java +++ b/examples/AdAccountAdSetsPostDailyBudget20.java @@ -38,8 +38,8 @@ public static void main (String args[]) throws APIException { new AdAccount(id, context).createAdSet() .setName("My First Adset") .setDailyBudget(2000L) - .setStartTime("2024-03-13T14:32:15-0700") - .setEndTime("2024-03-20T14:32:15-0700") + .setStartTime("2024-04-01T11:26:23-0700") + .setEndTime("2024-04-08T11:26:23-0700") .setCampaignId("") .setBidAmount(100L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) diff --git a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java index 83b71ae7..7aaaefbf 100644 --- a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java +++ b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java @@ -38,8 +38,8 @@ public static void main (String args[]) throws APIException { new AdAccount(id, context).createAdSet() .setName("My First Adset") .setLifetimeBudget(20000L) - .setStartTime("2024-03-13T14:32:24-0700") - .setEndTime("2024-03-23T14:32:24-0700") + .setStartTime("2024-04-01T11:26:32-0700") + .setEndTime("2024-04-11T11:26:32-0700") .setCampaignId("") .setBidAmount(100L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) diff --git a/examples/AdAccountAdSetsPostOptimizePostEngagement.java b/examples/AdAccountAdSetsPostOptimizePostEngagement.java index a0d7ef8e..14c09485 100644 --- a/examples/AdAccountAdSetsPostOptimizePostEngagement.java +++ b/examples/AdAccountAdSetsPostOptimizePostEngagement.java @@ -38,8 +38,8 @@ public static void main (String args[]) throws APIException { new AdAccount(id, context).createAdSet() .setName("My First Adset") .setLifetimeBudget(20000L) - .setStartTime("2024-03-13T14:32:33-0700") - .setEndTime("2024-03-23T14:32:33-0700") + .setStartTime("2024-04-01T11:26:40-0700") + .setEndTime("2024-04-11T11:26:40-0700") .setCampaignId("") .setBidAmount(500L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java index 5a760b58..e263f719 100644 --- a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java @@ -36,7 +36,7 @@ public static void main (String args[]) throws APIException { APIContext context = new APIContext(access_token).enableDebug(true); new Ad(id, context).getLeads() - .setParam("filtering", "[{\"field\":\"time_created\",\"operator\":\"GREATER_THAN\",\"value\":1681144509}]") + .setParam("filtering", "[{\"field\":\"time_created\",\"operator\":\"GREATER_THAN\",\"value\":1711391704}]") .execute(); } diff --git a/examples/AdsPixelEventsPost.java b/examples/AdsPixelEventsPost.java index 40d51bf8..47c0fd35 100644 --- a/examples/AdsPixelEventsPost.java +++ b/examples/AdsPixelEventsPost.java @@ -36,7 +36,7 @@ public static void main (String args[]) throws APIException { APIContext context = new APIContext(access_token).enableDebug(true); new AdsPixel(id, context).createEvent() - .setData("[{\"event_name\":\"PageView\",\"event_time\":1681748568,\"user_data\":{\"fbc\":\"fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890\",\"fbp\":\"fb.1.1558571054389.1098115397\",\"em\":\"309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd\"}}]") + .setData("[{\"event_name\":\"PageView\",\"event_time\":1711995835,\"user_data\":{\"fbc\":\"fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890\",\"fbp\":\"fb.1.1558571054389.1098115397\",\"em\":\"309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd\"}}]") .execute(); } diff --git a/pom.xml b/pom.xml index 19c4d2b4..a5ee16e7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.facebook.business.sdk facebook-java-business-sdk jar - 19.0.2 + 19.0.3 ${project.groupId}:${project.artifactId} Facebook Business Solutions SDK for Java https://developers.facebook.com/docs/marketing-api/sdks diff --git a/src/main/java/com/facebook/ads/sdk/APIConfig.java b/src/main/java/com/facebook/ads/sdk/APIConfig.java index 71f47eca..d3609b8c 100644 --- a/src/main/java/com/facebook/ads/sdk/APIConfig.java +++ b/src/main/java/com/facebook/ads/sdk/APIConfig.java @@ -27,5 +27,5 @@ public class APIConfig { public static final String DEFAULT_API_VERSION = "v19.0"; public static final String DEFAULT_API_BASE = "https://graph.facebook.com"; public static final String DEFAULT_VIDEO_API_BASE = "https://graph-video.facebook.com"; - public static final String USER_AGENT = "fbbizsdk-java-v19.0.2"; + public static final String USER_AGENT = "fbbizsdk-java-v19.0.3"; }; diff --git a/src/main/java/com/facebook/ads/sdk/AdAccount.java b/src/main/java/com/facebook/ads/sdk/AdAccount.java index 8e7e2f66..d63634ee 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccount.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccount.java @@ -59,6 +59,8 @@ public class AdAccount extends APINode { private List mAttributionSpec = null; @SerializedName("balance") private String mBalance = null; + @SerializedName("brand_safety_content_filter_levels") + private List mBrandSafetyContentFilterLevels = null; @SerializedName("business") private Business mBusiness = null; @SerializedName("business_city") @@ -598,6 +600,10 @@ public APIRequestCreateAsyncAdRequestSet createAsyncAdRequestSet() { return new APIRequestCreateAsyncAdRequestSet(this.getPrefixedId().toString(), context); } + public APIRequestGetAudienceFunnel getAudienceFunnel() { + return new APIRequestGetAudienceFunnel(this.getPrefixedId().toString(), context); + } + public APIRequestCreateBlockListDraft createBlockListDraft() { return new APIRequestCreateBlockListDraft(this.getPrefixedId().toString(), context); } @@ -638,6 +644,10 @@ public APIRequestGetConversionGoals getConversionGoals() { return new APIRequestGetConversionGoals(this.getPrefixedId().toString(), context); } + public APIRequestGetCpaGuidance getCpaGuidance() { + return new APIRequestGetCpaGuidance(this.getPrefixedId().toString(), context); + } + public APIRequestGetCustomAudiences getCustomAudiences() { return new APIRequestGetCustomAudiences(this.getPrefixedId().toString(), context); } @@ -802,6 +812,10 @@ public APIRequestDeleteUsersOfAnyAudience deleteUsersOfAnyAudience() { return new APIRequestDeleteUsersOfAnyAudience(this.getPrefixedId().toString(), context); } + public APIRequestGetValueAdjustmentRuleCollections getValueAdjustmentRuleCollections() { + return new APIRequestGetValueAdjustmentRuleCollections(this.getPrefixedId().toString(), context); + } + public APIRequestGetValueAdjustmentRules getValueAdjustmentRules() { return new APIRequestGetValueAdjustmentRules(this.getPrefixedId().toString(), context); } @@ -851,6 +865,10 @@ public String getFieldBalance() { return mBalance; } + public List getFieldBrandSafetyContentFilterLevels() { + return mBrandSafetyContentFilterLevels; + } + public Business getFieldBusiness() { if (mBusiness != null) { mBusiness.context = getContext(); @@ -7724,6 +7742,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -8209,6 +8228,13 @@ public APIRequestGetAdSets requestRecurringBudgetSemanticsField (boolean value) this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -8899,6 +8925,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -9357,6 +9384,13 @@ public APIRequestGetAdSetsByLabels requestRecurringBudgetSemanticsField (boolean this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAdSetsByLabels requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAdSetsByLabels requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAdSetsByLabels requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -12315,6 +12349,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -12755,6 +12790,13 @@ public APIRequestGetAffectedAdSets requestRecurringBudgetSemanticsField (boolean this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAffectedAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAffectedAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAffectedAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -15332,6 +15374,111 @@ public APIRequestCreateAsyncAdRequestSet requestField (String field, boolean val } + public static class APIRequestGetAudienceFunnel 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 APIRequestGetAudienceFunnel.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestGetAudienceFunnel(String nodeId, APIContext context) { + super(context, nodeId, "/audience_funnel", "GET", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestGetAudienceFunnel setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestGetAudienceFunnel setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestGetAudienceFunnel requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestGetAudienceFunnel requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetAudienceFunnel requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestGetAudienceFunnel requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetAudienceFunnel requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestGetAudienceFunnel requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestCreateBlockListDraft extends APIRequest { AdAccount lastResponse = null; @@ -17648,6 +17795,111 @@ public APIRequestGetConversionGoals requestField (String field, boolean value) { } + public static class APIRequestGetCpaGuidance 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 APIRequestGetCpaGuidance.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestGetCpaGuidance(String nodeId, APIContext context) { + super(context, nodeId, "/cpa_guidance", "GET", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestGetCpaGuidance setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestGetCpaGuidance setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestGetCpaGuidance requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestGetCpaGuidance requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetCpaGuidance requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestGetCpaGuidance requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetCpaGuidance requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestGetCpaGuidance requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestGetCustomAudiences extends APIRequest { APINodeList lastResponse = null; @@ -19091,6 +19343,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -19536,6 +19789,13 @@ public APIRequestGetDeprecatedTargetingAdSets requestRecurringBudgetSemanticsFie this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetDeprecatedTargetingAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetDeprecatedTargetingAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetDeprecatedTargetingAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -22774,6 +23034,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -23430,6 +23691,13 @@ public APIRequestGetPromotePages requestIsEligibleForDisableConnectIgBtnForNonPa this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetPromotePages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetPromotePages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetPromotePages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -26604,6 +26872,8 @@ public APINodeList getLastResponse() { "allow_only_fat_head_interests", "app_store", "countries", + "is_account_level_brand_safety_exclusion", + "is_account_level_employer_exclusion", "is_exclusion", "limit_type", "objective", @@ -26723,6 +26993,24 @@ public APIRequestGetTargetingSearch setCountries (String countries) { return this; } + public APIRequestGetTargetingSearch setIsAccountLevelBrandSafetyExclusion (Boolean isAccountLevelBrandSafetyExclusion) { + this.setParam("is_account_level_brand_safety_exclusion", isAccountLevelBrandSafetyExclusion); + return this; + } + public APIRequestGetTargetingSearch setIsAccountLevelBrandSafetyExclusion (String isAccountLevelBrandSafetyExclusion) { + this.setParam("is_account_level_brand_safety_exclusion", isAccountLevelBrandSafetyExclusion); + return this; + } + + public APIRequestGetTargetingSearch setIsAccountLevelEmployerExclusion (Boolean isAccountLevelEmployerExclusion) { + this.setParam("is_account_level_employer_exclusion", isAccountLevelEmployerExclusion); + return this; + } + public APIRequestGetTargetingSearch setIsAccountLevelEmployerExclusion (String isAccountLevelEmployerExclusion) { + this.setParam("is_account_level_employer_exclusion", isAccountLevelEmployerExclusion); + return this; + } + public APIRequestGetTargetingSearch setIsExclusion (Boolean isExclusion) { this.setParam("is_exclusion", isExclusion); return this; @@ -28393,6 +28681,111 @@ public APIRequestDeleteUsersOfAnyAudience requestField (String field, boolean va } + public static class APIRequestGetValueAdjustmentRuleCollections 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 APIRequestGetValueAdjustmentRuleCollections.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestGetValueAdjustmentRuleCollections(String nodeId, APIContext context) { + super(context, nodeId, "/value_adjustment_rule_collections", "GET", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestGetValueAdjustmentRuleCollections requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestGetValueAdjustmentRuleCollections requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestGetValueAdjustmentRuleCollections requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestGetValueAdjustmentRules extends APIRequest { APINodeList lastResponse = null; @@ -28518,6 +28911,7 @@ public AdAccount getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -28733,6 +29127,13 @@ public APIRequestGet requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGet requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGet requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGet requestBusinessField () { return this.requestBusinessField(true); } @@ -29615,6 +30016,8 @@ public static enum EnumContentType { VALUE_DESTINATION("DESTINATION"), @SerializedName("FLIGHT") VALUE_FLIGHT("FLIGHT"), + @SerializedName("GENERIC") + VALUE_GENERIC("GENERIC"), @SerializedName("HOME_LISTING") VALUE_HOME_LISTING("HOME_LISTING"), @SerializedName("HOTEL") @@ -29662,6 +30065,8 @@ public static enum EnumSubtype { VALUE_CUSTOM("CUSTOM"), @SerializedName("ENGAGEMENT") VALUE_ENGAGEMENT("ENGAGEMENT"), + @SerializedName("EXCLUSION") + VALUE_EXCLUSION("EXCLUSION"), @SerializedName("FOX") VALUE_FOX("FOX"), @SerializedName("LOOKALIKE") @@ -29824,6 +30229,7 @@ public AdAccount copyFrom(AdAccount instance) { this.mAmountSpent = instance.mAmountSpent; this.mAttributionSpec = instance.mAttributionSpec; this.mBalance = instance.mBalance; + this.mBrandSafetyContentFilterLevels = instance.mBrandSafetyContentFilterLevels; this.mBusiness = instance.mBusiness; this.mBusinessCity = instance.mBusinessCity; this.mBusinessCountryCode = instance.mBusinessCountryCode; diff --git a/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java b/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java index 6d4cdacc..0775c80c 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java @@ -389,6 +389,8 @@ public static enum EnumRecommendationType { VALUE_ASC_BUDGET_OPTIMIZATION_PFR("ASC_BUDGET_OPTIMIZATION_PFR"), @SerializedName("ASC_CREATION_PACKAGE") VALUE_ASC_CREATION_PACKAGE("ASC_CREATION_PACKAGE"), + @SerializedName("ASC_FRAGMENTATION_V2") + VALUE_ASC_FRAGMENTATION_V2("ASC_FRAGMENTATION_V2"), @SerializedName("ASPECT_RATIO") VALUE_ASPECT_RATIO("ASPECT_RATIO"), @SerializedName("ATLEAST_6_PLACEMENTS") @@ -423,6 +425,8 @@ public static enum EnumRecommendationType { VALUE_CAPI_PERFORMANCE_MATCH_KEY_V2("CAPI_PERFORMANCE_MATCH_KEY_V2"), @SerializedName("CASH_REWARDS_OPT_IN") VALUE_CASH_REWARDS_OPT_IN("CASH_REWARDS_OPT_IN"), + @SerializedName("CONNECTED_SOURCES") + VALUE_CONNECTED_SOURCES("CONNECTED_SOURCES"), @SerializedName("CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM") VALUE_CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM("CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM"), @SerializedName("CONNECT_FACEBOOK_PAGE_TO_WHATSAPP") @@ -461,10 +465,14 @@ public static enum EnumRecommendationType { VALUE_CTA("CTA"), @SerializedName("CTX_BUDGET_OPTIMIZATION") VALUE_CTX_BUDGET_OPTIMIZATION("CTX_BUDGET_OPTIMIZATION"), + @SerializedName("CTX_CREATION_PACKAGE") + VALUE_CTX_CREATION_PACKAGE("CTX_CREATION_PACKAGE"), @SerializedName("CTX_GUIDANCE") VALUE_CTX_GUIDANCE("CTX_GUIDANCE"), @SerializedName("DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS") VALUE_DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS("DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS"), + @SerializedName("DA_DUPLICATION_PRODUCT_TAGS") + VALUE_DA_DUPLICATION_PRODUCT_TAGS("DA_DUPLICATION_PRODUCT_TAGS"), @SerializedName("DEAD_LINK") VALUE_DEAD_LINK("DEAD_LINK"), @SerializedName("DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET") @@ -525,6 +533,8 @@ public static enum EnumRecommendationType { VALUE_PREDICTIVE_CREATIVE_LIMITED("PREDICTIVE_CREATIVE_LIMITED"), @SerializedName("PREDICTIVE_CREATIVE_LIMITED_HOURLY") VALUE_PREDICTIVE_CREATIVE_LIMITED_HOURLY("PREDICTIVE_CREATIVE_LIMITED_HOURLY"), + @SerializedName("PREPARING_STATUS") + VALUE_PREPARING_STATUS("PREPARING_STATUS"), @SerializedName("RAPID_LEARNING_LIMITED") VALUE_RAPID_LEARNING_LIMITED("RAPID_LEARNING_LIMITED"), @SerializedName("RAPID_LEARNING_PHASE") diff --git a/src/main/java/com/facebook/ads/sdk/AdAccountTargetingUnified.java b/src/main/java/com/facebook/ads/sdk/AdAccountTargetingUnified.java index 6fd51fa3..b2ccb618 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccountTargetingUnified.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccountTargetingUnified.java @@ -1237,6 +1237,8 @@ public static enum EnumWhitelistedTypes { VALUE_LOCATION_CLUSTER_IDS("location_cluster_ids"), @SerializedName("location_expansion") VALUE_LOCATION_EXPANSION("location_expansion"), + @SerializedName("marketing_message_channels") + VALUE_MARKETING_MESSAGE_CHANNELS("marketing_message_channels"), @SerializedName("marketing_message_targeting") VALUE_MARKETING_MESSAGE_TARGETING("marketing_message_targeting"), @SerializedName("marketplace_product_categories") diff --git a/src/main/java/com/facebook/ads/sdk/AdActivity.java b/src/main/java/com/facebook/ads/sdk/AdActivity.java index 550a8009..d4871b81 100644 --- a/src/main/java/com/facebook/ads/sdk/AdActivity.java +++ b/src/main/java/com/facebook/ads/sdk/AdActivity.java @@ -489,6 +489,8 @@ public static enum EnumEventType { VALUE_UPDATE_CAMPAIGN_RUN_STATUS("update_campaign_run_status"), @SerializedName("update_campaign_schedule") VALUE_UPDATE_CAMPAIGN_SCHEDULE("update_campaign_schedule"), + @SerializedName("update_campaign_value_adjustment_rule") + VALUE_UPDATE_CAMPAIGN_VALUE_ADJUSTMENT_RULE("update_campaign_value_adjustment_rule"), @SerializedName("update_delivery_type_cross_level_shift") VALUE_UPDATE_DELIVERY_TYPE_CROSS_LEVEL_SHIFT("update_delivery_type_cross_level_shift"), ; diff --git a/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpec.java b/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpec.java index 593d2426..668822a8 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpec.java +++ b/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpec.java @@ -77,6 +77,8 @@ public class AdAssetFeedSpec extends APINode { private List mOnsiteDestinations = null; @SerializedName("optimization_type") private String mOptimizationType = null; + @SerializedName("promotional_metadata") + private Object mPromotionalMetadata = null; @SerializedName("reasons_to_shop") private Boolean mReasonsToShop = null; @SerializedName("shops_bundle") @@ -463,6 +465,15 @@ public AdAssetFeedSpec setFieldOptimizationType(String value) { return this; } + public Object getFieldPromotionalMetadata() { + return mPromotionalMetadata; + } + + public AdAssetFeedSpec setFieldPromotionalMetadata(Object value) { + this.mPromotionalMetadata = value; + return this; + } + public Boolean getFieldReasonsToShop() { return mReasonsToShop; } @@ -516,8 +527,14 @@ public static enum EnumCallToActionTypes { VALUE_ADD_TO_CART("ADD_TO_CART"), @SerializedName("APPLY_NOW") VALUE_APPLY_NOW("APPLY_NOW"), + @SerializedName("ASK_ABOUT_SERVICES") + VALUE_ASK_ABOUT_SERVICES("ASK_ABOUT_SERVICES"), + @SerializedName("ASK_FOR_MORE_INFO") + VALUE_ASK_FOR_MORE_INFO("ASK_FOR_MORE_INFO"), @SerializedName("AUDIO_CALL") VALUE_AUDIO_CALL("AUDIO_CALL"), + @SerializedName("BOOK_A_CONSULTATION") + VALUE_BOOK_A_CONSULTATION("BOOK_A_CONSULTATION"), @SerializedName("BOOK_NOW") VALUE_BOOK_NOW("BOOK_NOW"), @SerializedName("BOOK_TRAVEL") @@ -528,12 +545,16 @@ public static enum EnumCallToActionTypes { VALUE_BUY_NOW("BUY_NOW"), @SerializedName("BUY_TICKETS") VALUE_BUY_TICKETS("BUY_TICKETS"), + @SerializedName("BUY_VIA_MESSAGE") + VALUE_BUY_VIA_MESSAGE("BUY_VIA_MESSAGE"), @SerializedName("CALL") VALUE_CALL("CALL"), @SerializedName("CALL_ME") VALUE_CALL_ME("CALL_ME"), @SerializedName("CALL_NOW") VALUE_CALL_NOW("CALL_NOW"), + @SerializedName("CHAT_WITH_US") + VALUE_CHAT_WITH_US("CHAT_WITH_US"), @SerializedName("CONFIRM") VALUE_CONFIRM("CONFIRM"), @SerializedName("CONTACT") @@ -558,6 +579,8 @@ public static enum EnumCallToActionTypes { VALUE_FOLLOW_PAGE("FOLLOW_PAGE"), @SerializedName("FOLLOW_USER") VALUE_FOLLOW_USER("FOLLOW_USER"), + @SerializedName("GET_A_QUOTE") + VALUE_GET_A_QUOTE("GET_A_QUOTE"), @SerializedName("GET_DIRECTIONS") VALUE_GET_DIRECTIONS("GET_DIRECTIONS"), @SerializedName("GET_OFFER") @@ -588,6 +611,8 @@ public static enum EnumCallToActionTypes { VALUE_LISTEN_MUSIC("LISTEN_MUSIC"), @SerializedName("LISTEN_NOW") VALUE_LISTEN_NOW("LISTEN_NOW"), + @SerializedName("MAKE_AN_APPOINTMENT") + VALUE_MAKE_AN_APPOINTMENT("MAKE_AN_APPOINTMENT"), @SerializedName("MESSAGE_PAGE") VALUE_MESSAGE_PAGE("MESSAGE_PAGE"), @SerializedName("MOBILE_DOWNLOAD") @@ -711,6 +736,7 @@ public AdAssetFeedSpec copyFrom(AdAssetFeedSpec instance) { this.mMessageExtensions = instance.mMessageExtensions; this.mOnsiteDestinations = instance.mOnsiteDestinations; this.mOptimizationType = instance.mOptimizationType; + this.mPromotionalMetadata = instance.mPromotionalMetadata; this.mReasonsToShop = instance.mReasonsToShop; this.mShopsBundle = instance.mShopsBundle; this.mTitles = instance.mTitles; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreative.java b/src/main/java/com/facebook/ads/sdk/AdCreative.java index 73b162fa..e83b648f 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreative.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreative.java @@ -2489,8 +2489,14 @@ public static enum EnumCallToActionType { VALUE_ADD_TO_CART("ADD_TO_CART"), @SerializedName("APPLY_NOW") VALUE_APPLY_NOW("APPLY_NOW"), + @SerializedName("ASK_ABOUT_SERVICES") + VALUE_ASK_ABOUT_SERVICES("ASK_ABOUT_SERVICES"), + @SerializedName("ASK_FOR_MORE_INFO") + VALUE_ASK_FOR_MORE_INFO("ASK_FOR_MORE_INFO"), @SerializedName("AUDIO_CALL") VALUE_AUDIO_CALL("AUDIO_CALL"), + @SerializedName("BOOK_A_CONSULTATION") + VALUE_BOOK_A_CONSULTATION("BOOK_A_CONSULTATION"), @SerializedName("BOOK_NOW") VALUE_BOOK_NOW("BOOK_NOW"), @SerializedName("BOOK_TRAVEL") @@ -2501,12 +2507,16 @@ public static enum EnumCallToActionType { VALUE_BUY_NOW("BUY_NOW"), @SerializedName("BUY_TICKETS") VALUE_BUY_TICKETS("BUY_TICKETS"), + @SerializedName("BUY_VIA_MESSAGE") + VALUE_BUY_VIA_MESSAGE("BUY_VIA_MESSAGE"), @SerializedName("CALL") VALUE_CALL("CALL"), @SerializedName("CALL_ME") VALUE_CALL_ME("CALL_ME"), @SerializedName("CALL_NOW") VALUE_CALL_NOW("CALL_NOW"), + @SerializedName("CHAT_WITH_US") + VALUE_CHAT_WITH_US("CHAT_WITH_US"), @SerializedName("CONFIRM") VALUE_CONFIRM("CONFIRM"), @SerializedName("CONTACT") @@ -2531,6 +2541,8 @@ public static enum EnumCallToActionType { VALUE_FOLLOW_PAGE("FOLLOW_PAGE"), @SerializedName("FOLLOW_USER") VALUE_FOLLOW_USER("FOLLOW_USER"), + @SerializedName("GET_A_QUOTE") + VALUE_GET_A_QUOTE("GET_A_QUOTE"), @SerializedName("GET_DIRECTIONS") VALUE_GET_DIRECTIONS("GET_DIRECTIONS"), @SerializedName("GET_OFFER") @@ -2561,6 +2573,8 @@ public static enum EnumCallToActionType { VALUE_LISTEN_MUSIC("LISTEN_MUSIC"), @SerializedName("LISTEN_NOW") VALUE_LISTEN_NOW("LISTEN_NOW"), + @SerializedName("MAKE_AN_APPOINTMENT") + VALUE_MAKE_AN_APPOINTMENT("MAKE_AN_APPOINTMENT"), @SerializedName("MESSAGE_PAGE") VALUE_MESSAGE_PAGE("MESSAGE_PAGE"), @SerializedName("MOBILE_DOWNLOAD") diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java b/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java index 1bf9e718..74eae218 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java @@ -43,10 +43,16 @@ public class AdCreativeFeaturesSpec extends APINode { @SerializedName("advantage_plus_creative") private AdCreativeFeatureDetails mAdvantagePlusCreative = null; + @SerializedName("app_highlights") + private AdCreativeFeatureDetails mAppHighlights = null; @SerializedName("audio") private AdCreativeFeatureDetails mAudio = null; @SerializedName("carousel_to_video") private AdCreativeFeatureDetails mCarouselToVideo = null; + @SerializedName("catalog_feed_tag") + private AdCreativeFeatureDetails mCatalogFeedTag = null; + @SerializedName("customize_product_recommendation") + private AdCreativeFeatureDetails mCustomizeProductRecommendation = null; @SerializedName("cv_transformation") private AdCreativeFeatureDetails mCvTransformation = null; @SerializedName("description_automation") @@ -83,6 +89,8 @@ public class AdCreativeFeaturesSpec extends APINode { private AdCreativeFeatureDetails mProductTags = null; @SerializedName("profile_card") private AdCreativeFeatureDetails mProfileCard = null; + @SerializedName("site_extensions") + private AdCreativeFeatureDetails mSiteExtensions = null; @SerializedName("standard_enhancements") private AdCreativeFeatureDetails mStandardEnhancements = null; @SerializedName("standard_enhancements_catalog") @@ -260,6 +268,20 @@ public AdCreativeFeaturesSpec setFieldAdvantagePlusCreative(String value) { this.mAdvantagePlusCreative = AdCreativeFeatureDetails.getGson().fromJson(value, type); return this; } + public AdCreativeFeatureDetails getFieldAppHighlights() { + return mAppHighlights; + } + + public AdCreativeFeaturesSpec setFieldAppHighlights(AdCreativeFeatureDetails value) { + this.mAppHighlights = value; + return this; + } + + public AdCreativeFeaturesSpec setFieldAppHighlights(String value) { + Type type = new TypeToken(){}.getType(); + this.mAppHighlights = AdCreativeFeatureDetails.getGson().fromJson(value, type); + return this; + } public AdCreativeFeatureDetails getFieldAudio() { return mAudio; } @@ -288,6 +310,34 @@ public AdCreativeFeaturesSpec setFieldCarouselToVideo(String value) { this.mCarouselToVideo = AdCreativeFeatureDetails.getGson().fromJson(value, type); return this; } + public AdCreativeFeatureDetails getFieldCatalogFeedTag() { + return mCatalogFeedTag; + } + + public AdCreativeFeaturesSpec setFieldCatalogFeedTag(AdCreativeFeatureDetails value) { + this.mCatalogFeedTag = value; + return this; + } + + public AdCreativeFeaturesSpec setFieldCatalogFeedTag(String value) { + Type type = new TypeToken(){}.getType(); + this.mCatalogFeedTag = AdCreativeFeatureDetails.getGson().fromJson(value, type); + return this; + } + public AdCreativeFeatureDetails getFieldCustomizeProductRecommendation() { + return mCustomizeProductRecommendation; + } + + public AdCreativeFeaturesSpec setFieldCustomizeProductRecommendation(AdCreativeFeatureDetails value) { + this.mCustomizeProductRecommendation = value; + return this; + } + + public AdCreativeFeaturesSpec setFieldCustomizeProductRecommendation(String value) { + Type type = new TypeToken(){}.getType(); + this.mCustomizeProductRecommendation = AdCreativeFeatureDetails.getGson().fromJson(value, type); + return this; + } public AdCreativeFeatureDetails getFieldCvTransformation() { return mCvTransformation; } @@ -540,6 +590,20 @@ public AdCreativeFeaturesSpec setFieldProfileCard(String value) { this.mProfileCard = AdCreativeFeatureDetails.getGson().fromJson(value, type); return this; } + public AdCreativeFeatureDetails getFieldSiteExtensions() { + return mSiteExtensions; + } + + public AdCreativeFeaturesSpec setFieldSiteExtensions(AdCreativeFeatureDetails value) { + this.mSiteExtensions = value; + return this; + } + + public AdCreativeFeaturesSpec setFieldSiteExtensions(String value) { + Type type = new TypeToken(){}.getType(); + this.mSiteExtensions = AdCreativeFeatureDetails.getGson().fromJson(value, type); + return this; + } public AdCreativeFeatureDetails getFieldStandardEnhancements() { return mStandardEnhancements; } @@ -642,8 +706,11 @@ public AdCreativeFeaturesSpec setFieldVideoHighlight(String value) { public AdCreativeFeaturesSpec copyFrom(AdCreativeFeaturesSpec instance) { this.mAdvantagePlusCreative = instance.mAdvantagePlusCreative; + this.mAppHighlights = instance.mAppHighlights; this.mAudio = instance.mAudio; this.mCarouselToVideo = instance.mCarouselToVideo; + this.mCatalogFeedTag = instance.mCatalogFeedTag; + this.mCustomizeProductRecommendation = instance.mCustomizeProductRecommendation; this.mCvTransformation = instance.mCvTransformation; this.mDescriptionAutomation = instance.mDescriptionAutomation; this.mDhaOptimization = instance.mDhaOptimization; @@ -662,6 +729,7 @@ public AdCreativeFeaturesSpec copyFrom(AdCreativeFeaturesSpec instance) { this.mProductMetadataAutomation = instance.mProductMetadataAutomation; this.mProductTags = instance.mProductTags; this.mProfileCard = instance.mProfileCard; + this.mSiteExtensions = instance.mSiteExtensions; this.mStandardEnhancements = instance.mStandardEnhancements; this.mStandardEnhancementsCatalog = instance.mStandardEnhancementsCatalog; this.mTextGeneration = instance.mTextGeneration; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java index 6285ea57..0036fa95 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java @@ -627,6 +627,8 @@ public static enum EnumFormatOption { VALUE_CAROUSEL_IMAGES_SINGLE_ITEM("carousel_images_single_item"), @SerializedName("carousel_slideshows") VALUE_CAROUSEL_SLIDESHOWS("carousel_slideshows"), + @SerializedName("collection_video") + VALUE_COLLECTION_VIDEO("collection_video"), @SerializedName("single_image") VALUE_SINGLE_IMAGE("single_image"), ; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkDataCallToAction.java b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkDataCallToAction.java index eecb2ae8..04a5b7f1 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkDataCallToAction.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkDataCallToAction.java @@ -226,8 +226,14 @@ public static enum EnumType { VALUE_ADD_TO_CART("ADD_TO_CART"), @SerializedName("APPLY_NOW") VALUE_APPLY_NOW("APPLY_NOW"), + @SerializedName("ASK_ABOUT_SERVICES") + VALUE_ASK_ABOUT_SERVICES("ASK_ABOUT_SERVICES"), + @SerializedName("ASK_FOR_MORE_INFO") + VALUE_ASK_FOR_MORE_INFO("ASK_FOR_MORE_INFO"), @SerializedName("AUDIO_CALL") VALUE_AUDIO_CALL("AUDIO_CALL"), + @SerializedName("BOOK_A_CONSULTATION") + VALUE_BOOK_A_CONSULTATION("BOOK_A_CONSULTATION"), @SerializedName("BOOK_NOW") VALUE_BOOK_NOW("BOOK_NOW"), @SerializedName("BOOK_TRAVEL") @@ -238,12 +244,16 @@ public static enum EnumType { VALUE_BUY_NOW("BUY_NOW"), @SerializedName("BUY_TICKETS") VALUE_BUY_TICKETS("BUY_TICKETS"), + @SerializedName("BUY_VIA_MESSAGE") + VALUE_BUY_VIA_MESSAGE("BUY_VIA_MESSAGE"), @SerializedName("CALL") VALUE_CALL("CALL"), @SerializedName("CALL_ME") VALUE_CALL_ME("CALL_ME"), @SerializedName("CALL_NOW") VALUE_CALL_NOW("CALL_NOW"), + @SerializedName("CHAT_WITH_US") + VALUE_CHAT_WITH_US("CHAT_WITH_US"), @SerializedName("CONFIRM") VALUE_CONFIRM("CONFIRM"), @SerializedName("CONTACT") @@ -268,6 +278,8 @@ public static enum EnumType { VALUE_FOLLOW_PAGE("FOLLOW_PAGE"), @SerializedName("FOLLOW_USER") VALUE_FOLLOW_USER("FOLLOW_USER"), + @SerializedName("GET_A_QUOTE") + VALUE_GET_A_QUOTE("GET_A_QUOTE"), @SerializedName("GET_DIRECTIONS") VALUE_GET_DIRECTIONS("GET_DIRECTIONS"), @SerializedName("GET_OFFER") @@ -298,6 +310,8 @@ public static enum EnumType { VALUE_LISTEN_MUSIC("LISTEN_MUSIC"), @SerializedName("LISTEN_NOW") VALUE_LISTEN_NOW("LISTEN_NOW"), + @SerializedName("MAKE_AN_APPOINTMENT") + VALUE_MAKE_AN_APPOINTMENT("MAKE_AN_APPOINTMENT"), @SerializedName("MESSAGE_PAGE") VALUE_MESSAGE_PAGE("MESSAGE_PAGE"), @SerializedName("MOBILE_DOWNLOAD") diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeSourcingSpec.java b/src/main/java/com/facebook/ads/sdk/AdCreativeSourcingSpec.java index fc663a91..07588160 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeSourcingSpec.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeSourcingSpec.java @@ -47,6 +47,8 @@ public class AdCreativeSourcingSpec extends APINode { private List mPromotionMetadataSpec = null; @SerializedName("site_links_spec") private List mSiteLinksSpec = null; + @SerializedName("source_url") + private String mSourceUrl = null; protected static Gson gson = null; public AdCreativeSourcingSpec() { @@ -235,6 +237,15 @@ public AdCreativeSourcingSpec setFieldSiteLinksSpec(String value) { this.mSiteLinksSpec = AdCreativeSiteLinksSpec.getGson().fromJson(value, type); return this; } + public String getFieldSourceUrl() { + return mSourceUrl; + } + + public AdCreativeSourcingSpec setFieldSourceUrl(String value) { + this.mSourceUrl = value; + return this; + } + @@ -255,6 +266,7 @@ public AdCreativeSourcingSpec copyFrom(AdCreativeSourcingSpec instance) { this.mAssociatedProductSetId = instance.mAssociatedProductSetId; this.mPromotionMetadataSpec = instance.mPromotionMetadataSpec; this.mSiteLinksSpec = instance.mSiteLinksSpec; + this.mSourceUrl = instance.mSourceUrl; this.context = instance.context; this.rawValue = instance.rawValue; return this; diff --git a/src/main/java/com/facebook/ads/sdk/AdLabel.java b/src/main/java/com/facebook/ads/sdk/AdLabel.java index e91ee533..2d3ef53e 100644 --- a/src/main/java/com/facebook/ads/sdk/AdLabel.java +++ b/src/main/java/com/facebook/ads/sdk/AdLabel.java @@ -1407,6 +1407,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -1847,6 +1848,13 @@ public APIRequestGetAdSets requestRecurringBudgetSemanticsField (boolean value) this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdPreview.java b/src/main/java/com/facebook/ads/sdk/AdPreview.java index 05b1e303..3ff82d0e 100644 --- a/src/main/java/com/facebook/ads/sdk/AdPreview.java +++ b/src/main/java/com/facebook/ads/sdk/AdPreview.java @@ -287,12 +287,16 @@ public static enum EnumAdFormat { VALUE_INSTANT_ARTICLE_STANDARD("INSTANT_ARTICLE_STANDARD"), @SerializedName("INSTREAM_BANNER_DESKTOP") VALUE_INSTREAM_BANNER_DESKTOP("INSTREAM_BANNER_DESKTOP"), + @SerializedName("INSTREAM_BANNER_FULLSCREEN_MOBILE") + VALUE_INSTREAM_BANNER_FULLSCREEN_MOBILE("INSTREAM_BANNER_FULLSCREEN_MOBILE"), @SerializedName("INSTREAM_BANNER_IMMERSIVE_MOBILE") VALUE_INSTREAM_BANNER_IMMERSIVE_MOBILE("INSTREAM_BANNER_IMMERSIVE_MOBILE"), @SerializedName("INSTREAM_BANNER_MOBILE") VALUE_INSTREAM_BANNER_MOBILE("INSTREAM_BANNER_MOBILE"), @SerializedName("INSTREAM_VIDEO_DESKTOP") VALUE_INSTREAM_VIDEO_DESKTOP("INSTREAM_VIDEO_DESKTOP"), + @SerializedName("INSTREAM_VIDEO_FULLSCREEN_MOBILE") + VALUE_INSTREAM_VIDEO_FULLSCREEN_MOBILE("INSTREAM_VIDEO_FULLSCREEN_MOBILE"), @SerializedName("INSTREAM_VIDEO_IMAGE") VALUE_INSTREAM_VIDEO_IMAGE("INSTREAM_VIDEO_IMAGE"), @SerializedName("INSTREAM_VIDEO_IMMERSIVE_MOBILE") @@ -327,6 +331,8 @@ public static enum EnumAdFormat { VALUE_RIGHT_COLUMN_STANDARD("RIGHT_COLUMN_STANDARD"), @SerializedName("SUGGESTED_VIDEO_DESKTOP") VALUE_SUGGESTED_VIDEO_DESKTOP("SUGGESTED_VIDEO_DESKTOP"), + @SerializedName("SUGGESTED_VIDEO_FULLSCREEN_MOBILE") + VALUE_SUGGESTED_VIDEO_FULLSCREEN_MOBILE("SUGGESTED_VIDEO_FULLSCREEN_MOBILE"), @SerializedName("SUGGESTED_VIDEO_IMMERSIVE_MOBILE") VALUE_SUGGESTED_VIDEO_IMMERSIVE_MOBILE("SUGGESTED_VIDEO_IMMERSIVE_MOBILE"), @SerializedName("SUGGESTED_VIDEO_MOBILE") diff --git a/src/main/java/com/facebook/ads/sdk/AdSet.java b/src/main/java/com/facebook/ads/sdk/AdSet.java index 613b4ec3..caf085e2 100644 --- a/src/main/java/com/facebook/ads/sdk/AdSet.java +++ b/src/main/java/com/facebook/ads/sdk/AdSet.java @@ -137,6 +137,8 @@ public class AdSet extends APINode { private List mRecommendations = null; @SerializedName("recurring_budget_semantics") private Boolean mRecurringBudgetSemantics = null; + @SerializedName("regional_regulation_identities") + private Object mRegionalRegulationIdentities = null; @SerializedName("review_feedback") private String mReviewFeedback = null; @SerializedName("rf_prediction_id") @@ -933,6 +935,15 @@ public AdSet setFieldRecurringBudgetSemantics(Boolean value) { return this; } + public Object getFieldRegionalRegulationIdentities() { + return mRegionalRegulationIdentities; + } + + public AdSet setFieldRegionalRegulationIdentities(Object value) { + this.mRegionalRegulationIdentities = value; + return this; + } + public String getFieldReviewFeedback() { return mReviewFeedback; } @@ -3474,6 +3485,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -3950,6 +3962,13 @@ public APIRequestGetCopies requestRecurringBudgetSemanticsField (boolean value) this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetCopies requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetCopies requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetCopies requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -5285,6 +5304,7 @@ public AdSet getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -5761,6 +5781,13 @@ public APIRequestGet requestRecurringBudgetSemanticsField (boolean value) { this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGet requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGet requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGet requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } @@ -6886,6 +6913,7 @@ public AdSet copyFrom(AdSet instance) { this.mPromotedObject = instance.mPromotedObject; this.mRecommendations = instance.mRecommendations; this.mRecurringBudgetSemantics = instance.mRecurringBudgetSemantics; + this.mRegionalRegulationIdentities = instance.mRegionalRegulationIdentities; this.mReviewFeedback = instance.mReviewFeedback; this.mRfPredictionId = instance.mRfPredictionId; this.mSourceAdset = instance.mSourceAdset; diff --git a/src/main/java/com/facebook/ads/sdk/AdStudyCell.java b/src/main/java/com/facebook/ads/sdk/AdStudyCell.java index 99ff5dcf..ec79f7dc 100644 --- a/src/main/java/com/facebook/ads/sdk/AdStudyCell.java +++ b/src/main/java/com/facebook/ads/sdk/AdStudyCell.java @@ -323,6 +323,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -538,6 +539,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -1019,6 +1027,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -1459,6 +1468,13 @@ public APIRequestGetAdSets requestRecurringBudgetSemanticsField (boolean value) this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdVideo.java b/src/main/java/com/facebook/ads/sdk/AdVideo.java index e286c3b8..35ad9230 100644 --- a/src/main/java/com/facebook/ads/sdk/AdVideo.java +++ b/src/main/java/com/facebook/ads/sdk/AdVideo.java @@ -1688,6 +1688,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -2344,6 +2345,13 @@ public APIRequestGetCrosspostSharedPages requestIsEligibleForDisableConnectIgBtn this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetCrosspostSharedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetCrosspostSharedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetCrosspostSharedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -3871,6 +3879,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -4527,6 +4536,13 @@ public APIRequestGetSponsorTags requestIsEligibleForDisableConnectIgBtnForNonPag this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetSponsorTags requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdsPixel.java b/src/main/java/com/facebook/ads/sdk/AdsPixel.java index 7fcad135..a45299e4 100644 --- a/src/main/java/com/facebook/ads/sdk/AdsPixel.java +++ b/src/main/java/com/facebook/ads/sdk/AdsPixel.java @@ -376,10 +376,6 @@ public APIRequestGetStats getStats() { return new APIRequestGetStats(this.getPrefixedId().toString(), context); } - public APIRequestCreateTelemetry createTelemetry() { - return new APIRequestCreateTelemetry(this.getPrefixedId().toString(), context); - } - public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } @@ -553,6 +549,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -773,6 +770,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -2880,6 +2884,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -3100,6 +3105,13 @@ public APIRequestGetSharedAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetSharedAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -4075,111 +4087,6 @@ public APIRequestGetStats requestStartTimeField (boolean value) { } } - public static class APIRequestCreateTelemetry extends APIRequest { - - APINode lastResponse = null; - @Override - public APINode getLastResponse() { - return lastResponse; - } - public static final String[] PARAMS = { - }; - - public static final String[] FIELDS = { - }; - - @Override - public APINode parseResponse(String response, String header) throws APIException { - return APINode.parseResponse(response, getContext(), this, header).head(); - } - - @Override - public APINode execute() throws APIException { - return execute(new HashMap()); - } - - @Override - public APINode execute(Map extraParams) throws APIException { - ResponseWrapper rw = executeInternal(extraParams); - lastResponse = parseResponse(rw.getBody(), rw.getHeader()); - return lastResponse; - } - - public ListenableFuture executeAsync() throws APIException { - return executeAsync(new HashMap()); - }; - - public ListenableFuture executeAsync(Map extraParams) throws APIException { - return Futures.transform( - executeAsyncInternal(extraParams), - new Function() { - public APINode apply(ResponseWrapper result) { - try { - return APIRequestCreateTelemetry.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestCreateTelemetry(String nodeId, APIContext context) { - super(context, nodeId, "/telemetry", "POST", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestCreateTelemetry setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestCreateTelemetry setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestCreateTelemetry requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestCreateTelemetry requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateTelemetry requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestCreateTelemetry requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateTelemetry requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestCreateTelemetry requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - } - public static class APIRequestGet extends APIRequest { AdsPixel lastResponse = null; diff --git a/src/main/java/com/facebook/ads/sdk/Application.java b/src/main/java/com/facebook/ads/sdk/Application.java index 6feaefb1..fbd97ac9 100644 --- a/src/main/java/com/facebook/ads/sdk/Application.java +++ b/src/main/java/com/facebook/ads/sdk/Application.java @@ -580,10 +580,6 @@ public APIRequestGetDaChecks getDaChecks() { return new APIRequestGetDaChecks(this.getPrefixedId().toString(), context); } - public APIRequestGetEvents getEvents() { - return new APIRequestGetEvents(this.getPrefixedId().toString(), context); - } - public APIRequestGetIapPurchases getIapPurchases() { return new APIRequestGetIapPurchases(this.getPrefixedId().toString(), context); } @@ -1567,6 +1563,7 @@ public APINode getLastResponse() { "page_id", "page_scoped_user_id", "receipt_data", + "sdk_version", "ud", "url_schemes", "user_id", @@ -1855,6 +1852,11 @@ public APIRequestCreateActivity setReceiptData (String receiptData) { return this; } + public APIRequestCreateActivity setSdkVersion (String sdkVersion) { + this.setParam("sdk_version", sdkVersion); + return this; + } + public APIRequestCreateActivity setUd (Map ud) { this.setParam("ud", ud); return this; @@ -5055,6 +5057,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -5275,6 +5278,13 @@ public APIRequestGetAuthorizedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAuthorizedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAuthorizedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAuthorizedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -6231,419 +6241,6 @@ public APIRequestGetDaChecks requestUserMessageField (boolean value) { } } - public static class APIRequestGetEvents extends APIRequest { - - APINodeList lastResponse = null; - @Override - public APINodeList getLastResponse() { - return lastResponse; - } - public static final String[] PARAMS = { - "include_canceled", - "type", - }; - - public static final String[] FIELDS = { - "attending_count", - "can_guests_invite", - "category", - "cover", - "created_time", - "declined_count", - "description", - "discount_code_enabled", - "end_time", - "event_times", - "guest_list_enabled", - "id", - "interested_count", - "is_canceled", - "is_draft", - "is_online", - "is_page_owned", - "maybe_count", - "name", - "noreply_count", - "online_event_format", - "online_event_third_party_url", - "owner", - "parent_group", - "place", - "registration_setting", - "scheduled_publish_time", - "start_time", - "ticket_setting", - "ticket_uri", - "ticket_uri_start_sales_time", - "ticketing_privacy_uri", - "ticketing_terms_uri", - "timezone", - "type", - "updated_time", - }; - - @Override - public APINodeList parseResponse(String response, String header) throws APIException { - return Event.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 APIRequestGetEvents.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestGetEvents(String nodeId, APIContext context) { - super(context, nodeId, "/events", "GET", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestGetEvents setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestGetEvents setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestGetEvents setIncludeCanceled (Boolean includeCanceled) { - this.setParam("include_canceled", includeCanceled); - return this; - } - public APIRequestGetEvents setIncludeCanceled (String includeCanceled) { - this.setParam("include_canceled", includeCanceled); - return this; - } - - public APIRequestGetEvents setType (Event.EnumType type) { - this.setParam("type", type); - return this; - } - public APIRequestGetEvents setType (String type) { - this.setParam("type", type); - return this; - } - - public APIRequestGetEvents requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestGetEvents requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetEvents requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestGetEvents requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetEvents requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestGetEvents requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - public APIRequestGetEvents requestAttendingCountField () { - return this.requestAttendingCountField(true); - } - public APIRequestGetEvents requestAttendingCountField (boolean value) { - this.requestField("attending_count", value); - return this; - } - public APIRequestGetEvents requestCanGuestsInviteField () { - return this.requestCanGuestsInviteField(true); - } - public APIRequestGetEvents requestCanGuestsInviteField (boolean value) { - this.requestField("can_guests_invite", value); - return this; - } - public APIRequestGetEvents requestCategoryField () { - return this.requestCategoryField(true); - } - public APIRequestGetEvents requestCategoryField (boolean value) { - this.requestField("category", value); - return this; - } - public APIRequestGetEvents requestCoverField () { - return this.requestCoverField(true); - } - public APIRequestGetEvents requestCoverField (boolean value) { - this.requestField("cover", value); - return this; - } - public APIRequestGetEvents requestCreatedTimeField () { - return this.requestCreatedTimeField(true); - } - public APIRequestGetEvents requestCreatedTimeField (boolean value) { - this.requestField("created_time", value); - return this; - } - public APIRequestGetEvents requestDeclinedCountField () { - return this.requestDeclinedCountField(true); - } - public APIRequestGetEvents requestDeclinedCountField (boolean value) { - this.requestField("declined_count", value); - return this; - } - public APIRequestGetEvents requestDescriptionField () { - return this.requestDescriptionField(true); - } - public APIRequestGetEvents requestDescriptionField (boolean value) { - this.requestField("description", value); - return this; - } - public APIRequestGetEvents requestDiscountCodeEnabledField () { - return this.requestDiscountCodeEnabledField(true); - } - public APIRequestGetEvents requestDiscountCodeEnabledField (boolean value) { - this.requestField("discount_code_enabled", value); - return this; - } - public APIRequestGetEvents requestEndTimeField () { - return this.requestEndTimeField(true); - } - public APIRequestGetEvents requestEndTimeField (boolean value) { - this.requestField("end_time", value); - return this; - } - public APIRequestGetEvents requestEventTimesField () { - return this.requestEventTimesField(true); - } - public APIRequestGetEvents requestEventTimesField (boolean value) { - this.requestField("event_times", value); - return this; - } - public APIRequestGetEvents requestGuestListEnabledField () { - return this.requestGuestListEnabledField(true); - } - public APIRequestGetEvents requestGuestListEnabledField (boolean value) { - this.requestField("guest_list_enabled", value); - return this; - } - public APIRequestGetEvents requestIdField () { - return this.requestIdField(true); - } - public APIRequestGetEvents requestIdField (boolean value) { - this.requestField("id", value); - return this; - } - public APIRequestGetEvents requestInterestedCountField () { - return this.requestInterestedCountField(true); - } - public APIRequestGetEvents requestInterestedCountField (boolean value) { - this.requestField("interested_count", value); - return this; - } - public APIRequestGetEvents requestIsCanceledField () { - return this.requestIsCanceledField(true); - } - public APIRequestGetEvents requestIsCanceledField (boolean value) { - this.requestField("is_canceled", value); - return this; - } - public APIRequestGetEvents requestIsDraftField () { - return this.requestIsDraftField(true); - } - public APIRequestGetEvents requestIsDraftField (boolean value) { - this.requestField("is_draft", value); - return this; - } - public APIRequestGetEvents requestIsOnlineField () { - return this.requestIsOnlineField(true); - } - public APIRequestGetEvents requestIsOnlineField (boolean value) { - this.requestField("is_online", value); - return this; - } - public APIRequestGetEvents requestIsPageOwnedField () { - return this.requestIsPageOwnedField(true); - } - public APIRequestGetEvents requestIsPageOwnedField (boolean value) { - this.requestField("is_page_owned", value); - return this; - } - public APIRequestGetEvents requestMaybeCountField () { - return this.requestMaybeCountField(true); - } - public APIRequestGetEvents requestMaybeCountField (boolean value) { - this.requestField("maybe_count", value); - return this; - } - public APIRequestGetEvents requestNameField () { - return this.requestNameField(true); - } - public APIRequestGetEvents requestNameField (boolean value) { - this.requestField("name", value); - return this; - } - public APIRequestGetEvents requestNoreplyCountField () { - return this.requestNoreplyCountField(true); - } - public APIRequestGetEvents requestNoreplyCountField (boolean value) { - this.requestField("noreply_count", value); - return this; - } - public APIRequestGetEvents requestOnlineEventFormatField () { - return this.requestOnlineEventFormatField(true); - } - public APIRequestGetEvents requestOnlineEventFormatField (boolean value) { - this.requestField("online_event_format", value); - return this; - } - public APIRequestGetEvents requestOnlineEventThirdPartyUrlField () { - return this.requestOnlineEventThirdPartyUrlField(true); - } - public APIRequestGetEvents requestOnlineEventThirdPartyUrlField (boolean value) { - this.requestField("online_event_third_party_url", value); - return this; - } - public APIRequestGetEvents requestOwnerField () { - return this.requestOwnerField(true); - } - public APIRequestGetEvents requestOwnerField (boolean value) { - this.requestField("owner", value); - return this; - } - public APIRequestGetEvents requestParentGroupField () { - return this.requestParentGroupField(true); - } - public APIRequestGetEvents requestParentGroupField (boolean value) { - this.requestField("parent_group", value); - return this; - } - public APIRequestGetEvents requestPlaceField () { - return this.requestPlaceField(true); - } - public APIRequestGetEvents requestPlaceField (boolean value) { - this.requestField("place", value); - return this; - } - public APIRequestGetEvents requestRegistrationSettingField () { - return this.requestRegistrationSettingField(true); - } - public APIRequestGetEvents requestRegistrationSettingField (boolean value) { - this.requestField("registration_setting", value); - return this; - } - public APIRequestGetEvents requestScheduledPublishTimeField () { - return this.requestScheduledPublishTimeField(true); - } - public APIRequestGetEvents requestScheduledPublishTimeField (boolean value) { - this.requestField("scheduled_publish_time", value); - return this; - } - public APIRequestGetEvents requestStartTimeField () { - return this.requestStartTimeField(true); - } - public APIRequestGetEvents requestStartTimeField (boolean value) { - this.requestField("start_time", value); - return this; - } - public APIRequestGetEvents requestTicketSettingField () { - return this.requestTicketSettingField(true); - } - public APIRequestGetEvents requestTicketSettingField (boolean value) { - this.requestField("ticket_setting", value); - return this; - } - public APIRequestGetEvents requestTicketUriField () { - return this.requestTicketUriField(true); - } - public APIRequestGetEvents requestTicketUriField (boolean value) { - this.requestField("ticket_uri", value); - return this; - } - public APIRequestGetEvents requestTicketUriStartSalesTimeField () { - return this.requestTicketUriStartSalesTimeField(true); - } - public APIRequestGetEvents requestTicketUriStartSalesTimeField (boolean value) { - this.requestField("ticket_uri_start_sales_time", value); - return this; - } - public APIRequestGetEvents requestTicketingPrivacyUriField () { - return this.requestTicketingPrivacyUriField(true); - } - public APIRequestGetEvents requestTicketingPrivacyUriField (boolean value) { - this.requestField("ticketing_privacy_uri", value); - return this; - } - public APIRequestGetEvents requestTicketingTermsUriField () { - return this.requestTicketingTermsUriField(true); - } - public APIRequestGetEvents requestTicketingTermsUriField (boolean value) { - this.requestField("ticketing_terms_uri", value); - return this; - } - public APIRequestGetEvents requestTimezoneField () { - return this.requestTimezoneField(true); - } - public APIRequestGetEvents requestTimezoneField (boolean value) { - this.requestField("timezone", value); - return this; - } - public APIRequestGetEvents requestTypeField () { - return this.requestTypeField(true); - } - public APIRequestGetEvents requestTypeField (boolean value) { - this.requestField("type", value); - return this; - } - public APIRequestGetEvents requestUpdatedTimeField () { - return this.requestUpdatedTimeField(true); - } - public APIRequestGetEvents requestUpdatedTimeField (boolean value) { - this.requestField("updated_time", value); - return this; - } - } - public static class APIRequestGetIapPurchases extends APIRequest { APINodeList lastResponse = null; diff --git a/src/main/java/com/facebook/ads/sdk/Business.java b/src/main/java/com/facebook/ads/sdk/Business.java index 06501672..6a0a668a 100644 --- a/src/main/java/com/facebook/ads/sdk/Business.java +++ b/src/main/java/com/facebook/ads/sdk/Business.java @@ -4923,6 +4923,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -5143,6 +5144,13 @@ public APIRequestGetClientAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetClientAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetClientAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetClientAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -6810,6 +6818,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -7466,6 +7475,13 @@ public APIRequestGetClientPages requestIsEligibleForDisableConnectIgBtnForNonPag this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetClientPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetClientPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetClientPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -9999,7 +10015,6 @@ public APINodeList getLastResponse() { "supported_card_types", "terms", "terms_url_by_locale", - "whatsapp_channel", }; @Override @@ -10260,13 +10275,6 @@ public APIRequestGetCommerceMerchantSettings requestTermsUrlByLocaleField (boole this.requestField("terms_url_by_locale", value); return this; } - public APIRequestGetCommerceMerchantSettings requestWhatsappChannelField () { - return this.requestWhatsappChannelField(true); - } - public APIRequestGetCommerceMerchantSettings requestWhatsappChannelField (boolean value) { - this.requestField("whatsapp_channel", value); - return this; - } } public static class APIRequestGetCpasBusinessSetupConfig extends APIRequest { @@ -14708,6 +14716,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -14928,6 +14937,13 @@ public APIRequestGetOwnedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetOwnedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetOwnedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetOwnedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -17488,6 +17504,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -18144,6 +18161,13 @@ public APIRequestGetOwnedPages requestIsEligibleForDisableConnectIgBtnForNonPage this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetOwnedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetOwnedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetOwnedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java b/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java index 3e584c56..ecb63ff0 100644 --- a/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java +++ b/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java @@ -934,6 +934,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -1149,6 +1150,13 @@ public APIRequestGetContainedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetContainedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetContainedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetContainedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -4517,6 +4525,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -5173,6 +5182,13 @@ public APIRequestGetContainedPages requestIsEligibleForDisableConnectIgBtnForNon this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetContainedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetContainedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetContainedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/BusinessUser.java b/src/main/java/com/facebook/ads/sdk/BusinessUser.java index c169245d..ecdfc54c 100644 --- a/src/main/java/com/facebook/ads/sdk/BusinessUser.java +++ b/src/main/java/com/facebook/ads/sdk/BusinessUser.java @@ -391,6 +391,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -606,6 +607,13 @@ public APIRequestGetAssignedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAssignedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -1244,6 +1252,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -1909,6 +1918,13 @@ public APIRequestGetAssignedPages requestIsEligibleForDisableConnectIgBtnForNonP this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetAssignedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java b/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java index 86d57b0b..462691a8 100644 --- a/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java +++ b/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java @@ -314,6 +314,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -529,6 +530,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/Campaign.java b/src/main/java/com/facebook/ads/sdk/Campaign.java index c7d36ca7..245529ff 100644 --- a/src/main/java/com/facebook/ads/sdk/Campaign.java +++ b/src/main/java/com/facebook/ads/sdk/Campaign.java @@ -1621,6 +1621,7 @@ public APINodeList getLastResponse() { "promoted_object", "recommendations", "recurring_budget_semantics", + "regional_regulation_identities", "review_feedback", "rf_prediction_id", "source_adset", @@ -2097,6 +2098,13 @@ public APIRequestGetAdSets requestRecurringBudgetSemanticsField (boolean value) this.requestField("recurring_budget_semantics", value); return this; } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField () { + return this.requestRegionalRegulationIdentitiesField(true); + } + public APIRequestGetAdSets requestRegionalRegulationIdentitiesField (boolean value) { + this.requestField("regional_regulation_identities", value); + return this; + } public APIRequestGetAdSets requestReviewFeedbackField () { return this.requestReviewFeedbackField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java b/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java index 8a0f3137..970c2b82 100644 --- a/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java +++ b/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java @@ -89,8 +89,6 @@ public class CommerceMerchantSettings extends APINode { private String mTerms = null; @SerializedName("terms_url_by_locale") private List> mTermsUrlByLocale = null; - @SerializedName("whatsapp_channel") - private Object mWhatsappChannel = null; protected static Gson gson = null; CommerceMerchantSettings() { @@ -332,10 +330,6 @@ public APIRequestGetReturns getReturns() { return new APIRequestGetReturns(this.getPrefixedId().toString(), context); } - public APIRequestGetSellerIssues getSellerIssues() { - return new APIRequestGetSellerIssues(this.getPrefixedId().toString(), context); - } - public APIRequestGetSetupStatus getSetupStatus() { return new APIRequestGetSetupStatus(this.getPrefixedId().toString(), context); } @@ -356,10 +350,6 @@ public APIRequestGetTaxSettings getTaxSettings() { return new APIRequestGetTaxSettings(this.getPrefixedId().toString(), context); } - public APIRequestCreateWhatsappChannel createWhatsappChannel() { - return new APIRequestCreateWhatsappChannel(this.getPrefixedId().toString(), context); - } - public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } @@ -464,10 +454,6 @@ public List> getFieldTermsUrlByLocale() { return mTermsUrlByLocale; } - public Object getFieldWhatsappChannel() { - return mWhatsappChannel; - } - public static class APIRequestCreateAcknowledgeOrder extends APIRequest { @@ -2624,111 +2610,6 @@ public APIRequestGetReturns requestField (String field, boolean value) { } - public static class APIRequestGetSellerIssues 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 APIRequestGetSellerIssues.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestGetSellerIssues(String nodeId, APIContext context) { - super(context, nodeId, "/seller_issues", "GET", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestGetSellerIssues setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestGetSellerIssues setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestGetSellerIssues requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestGetSellerIssues requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetSellerIssues requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestGetSellerIssues requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetSellerIssues requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestGetSellerIssues requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - } - public static class APIRequestGetSetupStatus extends APIRequest { APINodeList lastResponse = null; @@ -3416,131 +3297,6 @@ public APIRequestGetTaxSettings requestField (String field, boolean value) { } - public static class APIRequestCreateWhatsappChannel extends APIRequest { - - APINode lastResponse = null; - @Override - public APINode getLastResponse() { - return lastResponse; - } - public static final String[] PARAMS = { - "op", - "whatsapp_business_accounts", - }; - - public static final String[] FIELDS = { - }; - - @Override - public APINode parseResponse(String response, String header) throws APIException { - return APINode.parseResponse(response, getContext(), this, header).head(); - } - - @Override - public APINode execute() throws APIException { - return execute(new HashMap()); - } - - @Override - public APINode execute(Map extraParams) throws APIException { - ResponseWrapper rw = executeInternal(extraParams); - lastResponse = parseResponse(rw.getBody(), rw.getHeader()); - return lastResponse; - } - - public ListenableFuture executeAsync() throws APIException { - return executeAsync(new HashMap()); - }; - - public ListenableFuture executeAsync(Map extraParams) throws APIException { - return Futures.transform( - executeAsyncInternal(extraParams), - new Function() { - public APINode apply(ResponseWrapper result) { - try { - return APIRequestCreateWhatsappChannel.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestCreateWhatsappChannel(String nodeId, APIContext context) { - super(context, nodeId, "/whatsapp_channel", "POST", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestCreateWhatsappChannel setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestCreateWhatsappChannel setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestCreateWhatsappChannel setOp (EnumOp op) { - this.setParam("op", op); - return this; - } - public APIRequestCreateWhatsappChannel setOp (String op) { - this.setParam("op", op); - return this; - } - - public APIRequestCreateWhatsappChannel setWhatsappBusinessAccounts (List whatsappBusinessAccounts) { - this.setParam("whatsapp_business_accounts", whatsappBusinessAccounts); - return this; - } - public APIRequestCreateWhatsappChannel setWhatsappBusinessAccounts (String whatsappBusinessAccounts) { - this.setParam("whatsapp_business_accounts", whatsappBusinessAccounts); - return this; - } - - public APIRequestCreateWhatsappChannel requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestCreateWhatsappChannel requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateWhatsappChannel requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestCreateWhatsappChannel requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateWhatsappChannel requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestCreateWhatsappChannel requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - } - public static class APIRequestGet extends APIRequest { CommerceMerchantSettings lastResponse = null; @@ -3576,7 +3332,6 @@ public CommerceMerchantSettings getLastResponse() { "supported_card_types", "terms", "terms_url_by_locale", - "whatsapp_channel", }; @Override @@ -3837,13 +3592,6 @@ public APIRequestGet requestTermsUrlByLocaleField (boolean value) { this.requestField("terms_url_by_locale", value); return this; } - public APIRequestGet requestWhatsappChannelField () { - return this.requestWhatsappChannelField(true); - } - public APIRequestGet requestWhatsappChannelField (boolean value) { - this.requestField("whatsapp_channel", value); - return this; - } } public static enum EnumStatuses { @@ -3871,25 +3619,6 @@ public String toString() { } } - public static enum EnumOp { - @SerializedName("ADD") - VALUE_ADD("ADD"), - @SerializedName("REMOVE") - VALUE_REMOVE("REMOVE"), - ; - - private String value; - - private EnumOp(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - synchronized /*package*/ static Gson getGson() { if (gson != null) { @@ -3929,7 +3658,6 @@ public CommerceMerchantSettings copyFrom(CommerceMerchantSettings instance) { this.mSupportedCardTypes = instance.mSupportedCardTypes; this.mTerms = instance.mTerms; this.mTermsUrlByLocale = instance.mTermsUrlByLocale; - this.mWhatsappChannel = instance.mWhatsappChannel; this.context = instance.context; this.rawValue = instance.rawValue; return this; diff --git a/src/main/java/com/facebook/ads/sdk/CommerceOrder.java b/src/main/java/com/facebook/ads/sdk/CommerceOrder.java index 1d3e4158..80fd4e92 100644 --- a/src/main/java/com/facebook/ads/sdk/CommerceOrder.java +++ b/src/main/java/com/facebook/ads/sdk/CommerceOrder.java @@ -288,8 +288,8 @@ public APIRequestCreateCancellation createCancellation() { return new APIRequestCreateCancellation(this.getPrefixedId().toString(), context); } - public APIRequestCreateFulfillOrder createFulfillOrder() { - return new APIRequestCreateFulfillOrder(this.getPrefixedId().toString(), context); + public APIRequestCreateItemUpdate createItemUpdate() { + return new APIRequestCreateItemUpdate(this.getPrefixedId().toString(), context); } public APIRequestGetItems getItems() { @@ -336,6 +336,10 @@ public APIRequestCreateUpdateShipment createUpdateShipment() { return new APIRequestCreateUpdateShipment(this.getPrefixedId().toString(), context); } + public APIRequestCreateUpdate createUpdate() { + return new APIRequestCreateUpdate(this.getPrefixedId().toString(), context); + } + public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } @@ -768,7 +772,7 @@ public APIRequestCreateCancellation requestField (String field, boolean value) { } - public static class APIRequestCreateFulfillOrder extends APIRequest { + public static class APIRequestCreateItemUpdate extends APIRequest { CommerceOrder lastResponse = null; @Override @@ -776,8 +780,8 @@ public CommerceOrder getLastResponse() { return lastResponse; } public static final String[] PARAMS = { - "idempotency_key", "items", + "merchant_order_reference", }; public static final String[] FIELDS = { @@ -810,7 +814,7 @@ public ListenableFuture executeAsync(Map extraPar new Function() { public CommerceOrder apply(ResponseWrapper result) { try { - return APIRequestCreateFulfillOrder.this.parseResponse(result.getBody(), result.getHeader()); + return APIRequestCreateItemUpdate.this.parseResponse(result.getBody(), result.getHeader()); } catch (Exception e) { throw new RuntimeException(e); } @@ -820,42 +824,42 @@ public CommerceOrder apply(ResponseWrapper result) { ); }; - public APIRequestCreateFulfillOrder(String nodeId, APIContext context) { - super(context, nodeId, "/fulfill_order", "POST", Arrays.asList(PARAMS)); + public APIRequestCreateItemUpdate(String nodeId, APIContext context) { + super(context, nodeId, "/item_updates", "POST", Arrays.asList(PARAMS)); } @Override - public APIRequestCreateFulfillOrder setParam(String param, Object value) { + public APIRequestCreateItemUpdate setParam(String param, Object value) { setParamInternal(param, value); return this; } @Override - public APIRequestCreateFulfillOrder setParams(Map params) { + public APIRequestCreateItemUpdate setParams(Map params) { setParamsInternal(params); return this; } - public APIRequestCreateFulfillOrder setIdempotencyKey (String idempotencyKey) { - this.setParam("idempotency_key", idempotencyKey); + public APIRequestCreateItemUpdate setItems (List> items) { + this.setParam("items", items); return this; } - - public APIRequestCreateFulfillOrder setItems (List> items) { + public APIRequestCreateItemUpdate setItems (String items) { this.setParam("items", items); return this; } - public APIRequestCreateFulfillOrder setItems (String items) { - this.setParam("items", items); + + public APIRequestCreateItemUpdate setMerchantOrderReference (String merchantOrderReference) { + this.setParam("merchant_order_reference", merchantOrderReference); return this; } - public APIRequestCreateFulfillOrder requestAllFields () { + public APIRequestCreateItemUpdate requestAllFields () { return this.requestAllFields(true); } - public APIRequestCreateFulfillOrder requestAllFields (boolean value) { + public APIRequestCreateItemUpdate requestAllFields (boolean value) { for (String field : FIELDS) { this.requestField(field, value); } @@ -863,12 +867,12 @@ public APIRequestCreateFulfillOrder requestAllFields (boolean value) { } @Override - public APIRequestCreateFulfillOrder requestFields (List fields) { + public APIRequestCreateItemUpdate requestFields (List fields) { return this.requestFields(fields, true); } @Override - public APIRequestCreateFulfillOrder requestFields (List fields, boolean value) { + public APIRequestCreateItemUpdate requestFields (List fields, boolean value) { for (String field : fields) { this.requestField(field, value); } @@ -876,13 +880,13 @@ public APIRequestCreateFulfillOrder requestFields (List fields, boolean } @Override - public APIRequestCreateFulfillOrder requestField (String field) { + public APIRequestCreateItemUpdate requestField (String field) { this.requestField(field, true); return this; } @Override - public APIRequestCreateFulfillOrder requestField (String field, boolean value) { + public APIRequestCreateItemUpdate requestField (String field, boolean value) { this.requestFieldInternal(field, value); return this; } @@ -2274,6 +2278,157 @@ public APIRequestCreateUpdateShipment requestField (String field, boolean value) } + public static class APIRequestCreateUpdate extends APIRequest { + + CommerceOrder lastResponse = null; + @Override + public CommerceOrder getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "cancel_amount", + "fulfill_amount", + "merchant_order_reference", + "refund_amount", + "total_amount", + }; + + public static final String[] FIELDS = { + }; + + @Override + public CommerceOrder parseResponse(String response, String header) throws APIException { + return CommerceOrder.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public CommerceOrder execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public CommerceOrder 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 CommerceOrder apply(ResponseWrapper result) { + try { + return APIRequestCreateUpdate.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateUpdate(String nodeId, APIContext context) { + super(context, nodeId, "/updates", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateUpdate setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateUpdate setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateUpdate setCancelAmount (Map cancelAmount) { + this.setParam("cancel_amount", cancelAmount); + return this; + } + public APIRequestCreateUpdate setCancelAmount (String cancelAmount) { + this.setParam("cancel_amount", cancelAmount); + return this; + } + + public APIRequestCreateUpdate setFulfillAmount (Map fulfillAmount) { + this.setParam("fulfill_amount", fulfillAmount); + return this; + } + public APIRequestCreateUpdate setFulfillAmount (String fulfillAmount) { + this.setParam("fulfill_amount", fulfillAmount); + return this; + } + + public APIRequestCreateUpdate setMerchantOrderReference (String merchantOrderReference) { + this.setParam("merchant_order_reference", merchantOrderReference); + return this; + } + + public APIRequestCreateUpdate setRefundAmount (Map refundAmount) { + this.setParam("refund_amount", refundAmount); + return this; + } + public APIRequestCreateUpdate setRefundAmount (String refundAmount) { + this.setParam("refund_amount", refundAmount); + return this; + } + + public APIRequestCreateUpdate setTotalAmount (Map totalAmount) { + this.setParam("total_amount", totalAmount); + return this; + } + public APIRequestCreateUpdate setTotalAmount (String totalAmount) { + this.setParam("total_amount", totalAmount); + return this; + } + + public APIRequestCreateUpdate requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateUpdate requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateUpdate requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateUpdate requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateUpdate requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateUpdate requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestGet extends APIRequest { CommerceOrder lastResponse = null; diff --git a/src/main/java/com/facebook/ads/sdk/CustomAudience.java b/src/main/java/com/facebook/ads/sdk/CustomAudience.java index d4bb04ca..dc283bdd 100644 --- a/src/main/java/com/facebook/ads/sdk/CustomAudience.java +++ b/src/main/java/com/facebook/ads/sdk/CustomAudience.java @@ -685,6 +685,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -905,6 +906,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -3725,6 +3733,8 @@ public static enum EnumContentType { VALUE_DESTINATION("DESTINATION"), @SerializedName("FLIGHT") VALUE_FLIGHT("FLIGHT"), + @SerializedName("GENERIC") + VALUE_GENERIC("GENERIC"), @SerializedName("HOME_LISTING") VALUE_HOME_LISTING("HOME_LISTING"), @SerializedName("HOTEL") @@ -3793,6 +3803,8 @@ public static enum EnumSubtype { VALUE_CUSTOM("CUSTOM"), @SerializedName("ENGAGEMENT") VALUE_ENGAGEMENT("ENGAGEMENT"), + @SerializedName("EXCLUSION") + VALUE_EXCLUSION("EXCLUSION"), @SerializedName("FOX") VALUE_FOX("FOX"), @SerializedName("LOOKALIKE") diff --git a/src/main/java/com/facebook/ads/sdk/Destination.java b/src/main/java/com/facebook/ads/sdk/Destination.java index f93c9751..1e83ecc8 100644 --- a/src/main/java/com/facebook/ads/sdk/Destination.java +++ b/src/main/java/com/facebook/ads/sdk/Destination.java @@ -67,6 +67,8 @@ public class Destination extends APINode { private String mPriceChange = null; @SerializedName("sanitized_images") private List mSanitizedImages = null; + @SerializedName("tags") + private List mTags = null; @SerializedName("types") private List mTypes = null; @SerializedName("unit_price") @@ -353,6 +355,10 @@ public List getFieldSanitizedImages() { return mSanitizedImages; } + public List getFieldTags() { + return mTags; + } + public List getFieldTypes() { return mTypes; } @@ -758,6 +764,7 @@ public Destination getLastResponse() { "price", "price_change", "sanitized_images", + "tags", "types", "unit_price", "url", @@ -945,6 +952,13 @@ public APIRequestGet requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGet requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGet requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGet requestTypesField () { return this.requestTypesField(true); } @@ -1049,6 +1063,7 @@ public Destination copyFrom(Destination instance) { this.mPrice = instance.mPrice; this.mPriceChange = instance.mPriceChange; this.mSanitizedImages = instance.mSanitizedImages; + this.mTags = instance.mTags; this.mTypes = instance.mTypes; this.mUnitPrice = instance.mUnitPrice; this.mUrl = instance.mUrl; diff --git a/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java b/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java index af5718e1..23c5158b 100644 --- a/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java +++ b/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java @@ -325,6 +325,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -540,6 +541,13 @@ public APIRequestGetSharedAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetSharedAccounts requestBusinessField () { return this.requestBusinessField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java b/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java index 015024da..81e5337b 100644 --- a/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java +++ b/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java @@ -471,6 +471,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -686,6 +687,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/Flight.java b/src/main/java/com/facebook/ads/sdk/Flight.java index b42c2b2f..f84ebf4c 100644 --- a/src/main/java/com/facebook/ads/sdk/Flight.java +++ b/src/main/java/com/facebook/ads/sdk/Flight.java @@ -73,6 +73,8 @@ public class Flight extends APINode { private String mPrice = null; @SerializedName("sanitized_images") private List mSanitizedImages = null; + @SerializedName("tags") + private List mTags = null; @SerializedName("unit_price") private Object mUnitPrice = null; @SerializedName("url") @@ -373,6 +375,10 @@ public List getFieldSanitizedImages() { return mSanitizedImages; } + public List getFieldTags() { + return mTags; + } + public Object getFieldUnitPrice() { return mUnitPrice; } @@ -777,6 +783,7 @@ public Flight getLastResponse() { "origin_city", "price", "sanitized_images", + "tags", "unit_price", "url", "visibility", @@ -984,6 +991,13 @@ public APIRequestGet requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGet requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGet requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGet requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -1251,6 +1265,7 @@ public Flight copyFrom(Flight instance) { this.mOriginCity = instance.mOriginCity; this.mPrice = instance.mPrice; this.mSanitizedImages = instance.mSanitizedImages; + this.mTags = instance.mTags; this.mUnitPrice = instance.mUnitPrice; this.mUrl = instance.mUrl; this.mVisibility = instance.mVisibility; diff --git a/src/main/java/com/facebook/ads/sdk/Hotel.java b/src/main/java/com/facebook/ads/sdk/Hotel.java index a226464f..1ecde174 100644 --- a/src/main/java/com/facebook/ads/sdk/Hotel.java +++ b/src/main/java/com/facebook/ads/sdk/Hotel.java @@ -81,6 +81,8 @@ public class Hotel extends APINode { private List mSanitizedImages = null; @SerializedName("star_rating") private Double mStarRating = null; + @SerializedName("tags") + private List mTags = null; @SerializedName("unit_price") private Object mUnitPrice = null; @SerializedName("url") @@ -405,6 +407,10 @@ public Double getFieldStarRating() { return mStarRating; } + public List getFieldTags() { + return mTags; + } + public Object getFieldUnitPrice() { return mUnitPrice; } @@ -1111,6 +1117,7 @@ public Hotel getLastResponse() { "sale_price", "sanitized_images", "star_rating", + "tags", "unit_price", "url", "visibility", @@ -1346,6 +1353,13 @@ public APIRequestGet requestStarRatingField (boolean value) { this.requestField("star_rating", value); return this; } + public APIRequestGet requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGet requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGet requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -1651,6 +1665,7 @@ public Hotel copyFrom(Hotel instance) { this.mSalePrice = instance.mSalePrice; this.mSanitizedImages = instance.mSanitizedImages; this.mStarRating = instance.mStarRating; + this.mTags = instance.mTags; this.mUnitPrice = instance.mUnitPrice; this.mUrl = instance.mUrl; this.mVisibility = instance.mVisibility; diff --git a/src/main/java/com/facebook/ads/sdk/IGUpcomingEvent.java b/src/main/java/com/facebook/ads/sdk/IGUpcomingEvent.java new file mode 100644 index 00000000..86b42c11 --- /dev/null +++ b/src/main/java/com/facebook/ads/sdk/IGUpcomingEvent.java @@ -0,0 +1,579 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under the license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.ads.sdk; + +import java.io.File; +import java.lang.reflect.Modifier; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.common.base.Function; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.common.util.concurrent.SettableFuture; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +import com.facebook.ads.sdk.APIException.MalformedResponseException; + +/** + * This class is auto-generated. + * + * For any issues or feature requests related to this class, please let us know + * on github and we'll fix in our codegen framework. We'll not be able to accept + * pull request for this class. + * + */ +public class IGUpcomingEvent extends APINode { + @SerializedName("end_time") + private String mEndTime = null; + @SerializedName("id") + private String mId = null; + @SerializedName("start_time") + private String mStartTime = null; + @SerializedName("title") + private String mTitle = null; + protected static Gson gson = null; + + IGUpcomingEvent() { + } + + public IGUpcomingEvent(Long id, APIContext context) { + this(id.toString(), context); + } + + public IGUpcomingEvent(String id, APIContext context) { + this.mId = id; + + this.context = context; + } + + public IGUpcomingEvent fetch() throws APIException{ + IGUpcomingEvent newInstance = fetchById(this.getPrefixedId().toString(), this.context); + this.copyFrom(newInstance); + return this; + } + + public static IGUpcomingEvent 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 IGUpcomingEvent 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", IGUpcomingEvent.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", IGUpcomingEvent.getParser()) + .setParam("ids", APIRequest.joinStringList(ids)) + .requestFields(fields) + .executeAsyncBase(); + } + + private String getPrefixedId() { + return getId(); + } + + public String getId() { + return getFieldId().toString(); + } + public static IGUpcomingEvent loadJSON(String json, APIContext context, String header) { + IGUpcomingEvent igUpcomingEvent = getGson().fromJson(json, IGUpcomingEvent.class); + if (context.isDebug()) { + JsonParser parser = new JsonParser(); + JsonElement o1 = parser.parse(json); + JsonElement o2 = parser.parse(igUpcomingEvent.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); + } + } + igUpcomingEvent.context = context; + igUpcomingEvent.rawValue = json; + igUpcomingEvent.header = header; + return igUpcomingEvent; + } + + public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { + APINodeList igUpcomingEvents = 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++) { + igUpcomingEvents.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); + }; + return igUpcomingEvents; + } 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; + igUpcomingEvents.setCursors(before, after); + } + String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; + String next = paging.has("next") ? paging.get("next").getAsString() : null; + igUpcomingEvents.setPaging(previous, next); + if (context.hasAppSecret()) { + igUpcomingEvents.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++) { + igUpcomingEvents.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()) { + igUpcomingEvents.add(loadJSON(entry.getValue().toString(), context, header)); + } + break; + } + } + if (!isRedownload) { + igUpcomingEvents.add(loadJSON(obj.toString(), context, header)); + } + } + return igUpcomingEvents; + } 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()) { + igUpcomingEvents.add(loadJSON(entry.getValue().toString(), context, header)); + } + return igUpcomingEvents; + } 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) + ) { + igUpcomingEvents.add(loadJSON(value.toString(), context, header)); + } else { + isIdIndexedArray = false; + break; + } + } + if (isIdIndexedArray) { + return igUpcomingEvents; + } + + // Sixth, check if it's pure JsonObject + igUpcomingEvents.clear(); + igUpcomingEvents.add(loadJSON(json, context, header)); + return igUpcomingEvents; + } + } + } 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 APIRequestGet get() { + return new APIRequestGet(this.getPrefixedId().toString(), context); + } + + public APIRequestUpdate update() { + return new APIRequestUpdate(this.getPrefixedId().toString(), context); + } + + + public String getFieldEndTime() { + return mEndTime; + } + + public String getFieldId() { + return mId; + } + + public String getFieldStartTime() { + return mStartTime; + } + + public String getFieldTitle() { + return mTitle; + } + + + + public static class APIRequestGet extends APIRequest { + + IGUpcomingEvent lastResponse = null; + @Override + public IGUpcomingEvent getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + }; + + public static final String[] FIELDS = { + "end_time", + "id", + "start_time", + "title", + }; + + @Override + public IGUpcomingEvent parseResponse(String response, String header) throws APIException { + return IGUpcomingEvent.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public IGUpcomingEvent execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public IGUpcomingEvent 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 IGUpcomingEvent apply(ResponseWrapper result) { + try { + return APIRequestGet.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestGet(String nodeId, APIContext context) { + super(context, nodeId, "/", "GET", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestGet setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestGet setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestGet requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestGet requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGet requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestGet requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGet requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestGet requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + public APIRequestGet requestEndTimeField () { + return this.requestEndTimeField(true); + } + public APIRequestGet requestEndTimeField (boolean value) { + this.requestField("end_time", value); + return this; + } + public APIRequestGet requestIdField () { + return this.requestIdField(true); + } + public APIRequestGet requestIdField (boolean value) { + this.requestField("id", value); + return this; + } + public APIRequestGet requestStartTimeField () { + return this.requestStartTimeField(true); + } + public APIRequestGet requestStartTimeField (boolean value) { + this.requestField("start_time", value); + return this; + } + public APIRequestGet requestTitleField () { + return this.requestTitleField(true); + } + public APIRequestGet requestTitleField (boolean value) { + this.requestField("title", value); + return this; + } + } + + public static class APIRequestUpdate extends APIRequest { + + IGUpcomingEvent lastResponse = null; + @Override + public IGUpcomingEvent getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "end_time", + "start_time", + "title", + }; + + public static final String[] FIELDS = { + }; + + @Override + public IGUpcomingEvent parseResponse(String response, String header) throws APIException { + return IGUpcomingEvent.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public IGUpcomingEvent execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public IGUpcomingEvent 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 IGUpcomingEvent apply(ResponseWrapper result) { + try { + return APIRequestUpdate.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestUpdate(String nodeId, APIContext context) { + super(context, nodeId, "/", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestUpdate setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestUpdate setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestUpdate setEndTime (String endTime) { + this.setParam("end_time", endTime); + return this; + } + + public APIRequestUpdate setStartTime (String startTime) { + this.setParam("start_time", startTime); + return this; + } + + public APIRequestUpdate setTitle (String title) { + this.setParam("title", title); + return this; + } + + public APIRequestUpdate requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestUpdate requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestUpdate requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestUpdate requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestUpdate requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestUpdate requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + + + synchronized /*package*/ static Gson getGson() { + if (gson != null) { + return gson; + } else { + gson = new GsonBuilder() + .excludeFieldsWithModifiers(Modifier.STATIC) + .excludeFieldsWithModifiers(Modifier.PROTECTED) + .disableHtmlEscaping() + .create(); + } + return gson; + } + + public IGUpcomingEvent copyFrom(IGUpcomingEvent instance) { + this.mEndTime = instance.mEndTime; + this.mId = instance.mId; + this.mStartTime = instance.mStartTime; + this.mTitle = instance.mTitle; + this.context = instance.context; + this.rawValue = instance.rawValue; + return this; + } + + public static APIRequest.ResponseParser getParser() { + return new APIRequest.ResponseParser() { + public APINodeList parseResponse(String response, APIContext context, APIRequest request, String header) throws MalformedResponseException { + return IGUpcomingEvent.parseResponse(response, context, request, header); + } + }; + } +} diff --git a/src/main/java/com/facebook/ads/sdk/InstagramUser.java b/src/main/java/com/facebook/ads/sdk/InstagramUser.java index 5e594aef..21114c47 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramUser.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramUser.java @@ -292,6 +292,10 @@ public APIRequestGetUpcomingEvents getUpcomingEvents() { return new APIRequestGetUpcomingEvents(this.getPrefixedId().toString(), context); } + public APIRequestCreateUpcomingEvent createUpcomingEvent() { + return new APIRequestCreateUpcomingEvent(this.getPrefixedId().toString(), context); + } + public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } @@ -748,6 +752,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -968,6 +973,13 @@ public APIRequestGetAuthorizedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAuthorizedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAuthorizedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAuthorizedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -1507,45 +1519,49 @@ public APIRequestCreateAuthorizedAdAccount requestField (String field, boolean v } - public static class APIRequestGetUpcomingEvents extends APIRequest { + public static class APIRequestGetUpcomingEvents extends APIRequest { - APINodeList lastResponse = null; + APINodeList lastResponse = null; @Override - public APINodeList getLastResponse() { + public APINodeList getLastResponse() { return lastResponse; } public static final String[] PARAMS = { }; public static final String[] FIELDS = { + "end_time", + "id", + "start_time", + "title", }; @Override - public APINodeList parseResponse(String response, String header) throws APIException { - return APINode.parseResponse(response, getContext(), this, header); + public APINodeList parseResponse(String response, String header) throws APIException { + return IGUpcomingEvent.parseResponse(response, getContext(), this, header); } @Override - public APINodeList execute() throws APIException { + public APINodeList execute() throws APIException { return execute(new HashMap()); } @Override - public APINodeList execute(Map extraParams) throws APIException { + public APINodeList execute(Map extraParams) throws APIException { ResponseWrapper rw = executeInternal(extraParams); lastResponse = parseResponse(rw.getBody(),rw.getHeader()); return lastResponse; } - public ListenableFuture> executeAsync() throws APIException { + public ListenableFuture> executeAsync() throws APIException { return executeAsync(new HashMap()); }; - public ListenableFuture> executeAsync(Map extraParams) throws APIException { + public ListenableFuture> executeAsync(Map extraParams) throws APIException { return Futures.transform( executeAsyncInternal(extraParams), - new Function>() { - public APINodeList apply(ResponseWrapper result) { + new Function>() { + public APINodeList apply(ResponseWrapper result) { try { return APIRequestGetUpcomingEvents.this.parseResponse(result.getBody(), result.getHeader()); } catch (Exception e) { @@ -1610,6 +1626,157 @@ public APIRequestGetUpcomingEvents requestField (String field, boolean value) { return this; } + public APIRequestGetUpcomingEvents requestEndTimeField () { + return this.requestEndTimeField(true); + } + public APIRequestGetUpcomingEvents requestEndTimeField (boolean value) { + this.requestField("end_time", value); + return this; + } + public APIRequestGetUpcomingEvents requestIdField () { + return this.requestIdField(true); + } + public APIRequestGetUpcomingEvents requestIdField (boolean value) { + this.requestField("id", value); + return this; + } + public APIRequestGetUpcomingEvents requestStartTimeField () { + return this.requestStartTimeField(true); + } + public APIRequestGetUpcomingEvents requestStartTimeField (boolean value) { + this.requestField("start_time", value); + return this; + } + public APIRequestGetUpcomingEvents requestTitleField () { + return this.requestTitleField(true); + } + public APIRequestGetUpcomingEvents requestTitleField (boolean value) { + this.requestField("title", value); + return this; + } + } + + public static class APIRequestCreateUpcomingEvent extends APIRequest { + + IGUpcomingEvent lastResponse = null; + @Override + public IGUpcomingEvent getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "end_time", + "start_time", + "title", + }; + + public static final String[] FIELDS = { + }; + + @Override + public IGUpcomingEvent parseResponse(String response, String header) throws APIException { + return IGUpcomingEvent.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public IGUpcomingEvent execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public IGUpcomingEvent 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 IGUpcomingEvent apply(ResponseWrapper result) { + try { + return APIRequestCreateUpcomingEvent.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateUpcomingEvent(String nodeId, APIContext context) { + super(context, nodeId, "/upcoming_events", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateUpcomingEvent setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateUpcomingEvent setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateUpcomingEvent setEndTime (String endTime) { + this.setParam("end_time", endTime); + return this; + } + + public APIRequestCreateUpcomingEvent setStartTime (String startTime) { + this.setParam("start_time", startTime); + return this; + } + + public APIRequestCreateUpcomingEvent setTitle (String title) { + this.setParam("title", title); + return this; + } + + public APIRequestCreateUpcomingEvent requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateUpcomingEvent requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateUpcomingEvent requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateUpcomingEvent requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateUpcomingEvent requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateUpcomingEvent requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + } public static class APIRequestGet extends APIRequest { diff --git a/src/main/java/com/facebook/ads/sdk/LiveVideo.java b/src/main/java/com/facebook/ads/sdk/LiveVideo.java index 374cd29e..25bc3cae 100644 --- a/src/main/java/com/facebook/ads/sdk/LiveVideo.java +++ b/src/main/java/com/facebook/ads/sdk/LiveVideo.java @@ -1377,6 +1377,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -2033,6 +2034,13 @@ public APIRequestGetCrosspostSharedPages requestIsEligibleForDisableConnectIgBtn this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetCrosspostSharedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetCrosspostSharedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetCrosspostSharedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/LocalServiceBusiness.java b/src/main/java/com/facebook/ads/sdk/LocalServiceBusiness.java index e19bf93e..dc45a870 100644 --- a/src/main/java/com/facebook/ads/sdk/LocalServiceBusiness.java +++ b/src/main/java/com/facebook/ads/sdk/LocalServiceBusiness.java @@ -109,6 +109,8 @@ public class LocalServiceBusiness extends APINode { private List mSanitizedImages = null; @SerializedName("size") private String mSize = null; + @SerializedName("tags") + private List mTags = null; @SerializedName("title") private String mTitle = null; @SerializedName("unit_price") @@ -479,6 +481,10 @@ public String getFieldSize() { return mSize; } + public List getFieldTags() { + return mTags; + } + public String getFieldTitle() { return mTitle; } @@ -667,6 +673,7 @@ public LocalServiceBusiness getLastResponse() { "retailer_category", "sanitized_images", "size", + "tags", "title", "unit_price", "url", @@ -1002,6 +1009,13 @@ public APIRequestGet requestSizeField (boolean value) { this.requestField("size", value); return this; } + public APIRequestGet requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGet requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGet requestTitleField () { return this.requestTitleField(true); } @@ -1194,6 +1208,7 @@ public LocalServiceBusiness copyFrom(LocalServiceBusiness instance) { this.mRetailerCategory = instance.mRetailerCategory; this.mSanitizedImages = instance.mSanitizedImages; this.mSize = instance.mSize; + this.mTags = instance.mTags; this.mTitle = instance.mTitle; this.mUnitPrice = instance.mUnitPrice; this.mUrl = instance.mUrl; diff --git a/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java b/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java index aacece15..6565f319 100644 --- a/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java +++ b/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java @@ -542,6 +542,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -762,6 +763,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -2712,6 +2720,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -2941,6 +2950,13 @@ public APIRequestGetSharedAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetSharedAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetSharedAccounts requestBusinessField () { return this.requestBusinessField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/Page.java b/src/main/java/com/facebook/ads/sdk/Page.java index 76ce784c..55162754 100644 --- a/src/main/java/com/facebook/ads/sdk/Page.java +++ b/src/main/java/com/facebook/ads/sdk/Page.java @@ -179,6 +179,8 @@ public class Page extends APINode { private Boolean mIsEligibleForBrandedContent = null; @SerializedName("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web") private Boolean mIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb = null; + @SerializedName("is_eligible_for_live_boosting_expansion") + private Boolean mIsEligibleForLiveBoostingExpansion = null; @SerializedName("is_messenger_bot_get_started_enabled") private Boolean mIsMessengerBotGetStartedEnabled = null; @SerializedName("is_messenger_platform_bot") @@ -646,10 +648,6 @@ public APIRequestCreateChatPlugin createChatPlugin() { return new APIRequestCreateChatPlugin(this.getPrefixedId().toString(), context); } - public APIRequestGetCommerceEligibility getCommerceEligibility() { - return new APIRequestGetCommerceEligibility(this.getPrefixedId().toString(), context); - } - public APIRequestGetCommerceMerchantSettings getCommerceMerchantSettings() { return new APIRequestGetCommerceMerchantSettings(this.getPrefixedId().toString(), context); } @@ -1336,6 +1334,10 @@ public Boolean getFieldIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb() { return mIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb; } + public Boolean getFieldIsEligibleForLiveBoostingExpansion() { + return mIsEligibleForLiveBoostingExpansion; + } + public Boolean getFieldIsMessengerBotGetStartedEnabled() { return mIsMessengerBotGetStartedEnabled; } @@ -6304,127 +6306,6 @@ public APIRequestCreateChatPlugin requestField (String field, boolean value) { } - public static class APIRequestGetCommerceEligibility extends APIRequest { - - APINodeList lastResponse = null; - @Override - public APINodeList getLastResponse() { - return lastResponse; - } - public static final String[] PARAMS = { - }; - - public static final String[] FIELDS = { - "offsite", - "onsite", - }; - - @Override - public APINodeList parseResponse(String response, String header) throws APIException { - return PageCommerceEligibility.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 APIRequestGetCommerceEligibility.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestGetCommerceEligibility(String nodeId, APIContext context) { - super(context, nodeId, "/commerce_eligibility", "GET", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestGetCommerceEligibility setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestGetCommerceEligibility setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestGetCommerceEligibility requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestGetCommerceEligibility requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetCommerceEligibility requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestGetCommerceEligibility requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestGetCommerceEligibility requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestGetCommerceEligibility requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - public APIRequestGetCommerceEligibility requestOffsiteField () { - return this.requestOffsiteField(true); - } - public APIRequestGetCommerceEligibility requestOffsiteField (boolean value) { - this.requestField("offsite", value); - return this; - } - public APIRequestGetCommerceEligibility requestOnsiteField () { - return this.requestOnsiteField(true); - } - public APIRequestGetCommerceEligibility requestOnsiteField (boolean value) { - this.requestField("onsite", value); - return this; - } - } - public static class APIRequestGetCommerceMerchantSettings extends APIRequest { APINodeList lastResponse = null; @@ -6460,7 +6341,6 @@ public APINodeList getLastResponse() { "supported_card_types", "terms", "terms_url_by_locale", - "whatsapp_channel", }; @Override @@ -6721,13 +6601,6 @@ public APIRequestGetCommerceMerchantSettings requestTermsUrlByLocaleField (boole this.requestField("terms_url_by_locale", value); return this; } - public APIRequestGetCommerceMerchantSettings requestWhatsappChannelField () { - return this.requestWhatsappChannelField(true); - } - public APIRequestGetCommerceMerchantSettings requestWhatsappChannelField (boolean value) { - this.requestField("whatsapp_channel", value); - return this; - } } public static class APIRequestGetCommerceOrders extends APIRequest { @@ -7843,6 +7716,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -8499,6 +8373,13 @@ public APIRequestGetCrosspostWhitelistedPages requestIsEligibleForDisableConnect this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetCrosspostWhitelistedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetCrosspostWhitelistedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetCrosspostWhitelistedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -12133,6 +12014,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -12789,6 +12671,13 @@ public APIRequestGetGlobalBrandChildren requestIsEligibleForDisableConnectIgBtnF this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetGlobalBrandChildren requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetGlobalBrandChildren requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetGlobalBrandChildren requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -15531,6 +15420,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -16192,6 +16082,13 @@ public APIRequestGetLikes requestIsEligibleForDisableConnectIgBtnForNonPageAdmin this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetLikes requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetLikes requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetLikes requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -17636,6 +17533,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -18292,6 +18190,13 @@ public APIRequestGetLocations requestIsEligibleForDisableConnectIgBtnForNonPageA this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetLocations requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetLocations requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetLocations requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -35005,6 +34910,7 @@ public Page getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -35666,6 +35572,13 @@ public APIRequestGet requestIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGet requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGet requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGet requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -37761,6 +37674,8 @@ public static enum EnumSubscribedFields { VALUE_RATINGS("ratings"), @SerializedName("registration") VALUE_REGISTRATION("registration"), + @SerializedName("response_feedback") + VALUE_RESPONSE_FEEDBACK("response_feedback"), @SerializedName("send_cart") VALUE_SEND_CART("send_cart"), @SerializedName("standby") @@ -38076,6 +37991,7 @@ public Page copyFrom(Page instance) { this.mIsCommunityPage = instance.mIsCommunityPage; this.mIsEligibleForBrandedContent = instance.mIsEligibleForBrandedContent; this.mIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb = instance.mIsEligibleForDisableConnectIgBtnForNonPageAdminAmWeb; + this.mIsEligibleForLiveBoostingExpansion = instance.mIsEligibleForLiveBoostingExpansion; this.mIsMessengerBotGetStartedEnabled = instance.mIsMessengerBotGetStartedEnabled; this.mIsMessengerPlatformBot = instance.mIsMessengerPlatformBot; this.mIsOwned = instance.mIsOwned; diff --git a/src/main/java/com/facebook/ads/sdk/PageCommerceEligibility.java b/src/main/java/com/facebook/ads/sdk/PageCommerceEligibility.java deleted file mode 100644 index 8c2529f5..00000000 --- a/src/main/java/com/facebook/ads/sdk/PageCommerceEligibility.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.ads.sdk; - -import java.io.File; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.common.base.Function; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.common.util.concurrent.SettableFuture; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; - -import com.facebook.ads.sdk.APIException.MalformedResponseException; - -/** - * This class is auto-generated. - * - * For any issues or feature requests related to this class, please let us know - * on github and we'll fix in our codegen framework. We'll not be able to accept - * pull request for this class. - * - */ -public class PageCommerceEligibility extends APINode { - @SerializedName("offsite") - private Object mOffsite = null; - @SerializedName("onsite") - private Object mOnsite = null; - protected static Gson gson = null; - - public PageCommerceEligibility() { - } - - public String getId() { - return null; - } - public static PageCommerceEligibility loadJSON(String json, APIContext context, String header) { - PageCommerceEligibility pageCommerceEligibility = getGson().fromJson(json, PageCommerceEligibility.class); - if (context.isDebug()) { - JsonParser parser = new JsonParser(); - JsonElement o1 = parser.parse(json); - JsonElement o2 = parser.parse(pageCommerceEligibility.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); - } - } - pageCommerceEligibility.context = context; - pageCommerceEligibility.rawValue = json; - pageCommerceEligibility.header = header; - return pageCommerceEligibility; - } - - public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { - APINodeList pageCommerceEligibilitys = 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++) { - pageCommerceEligibilitys.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); - }; - return pageCommerceEligibilitys; - } 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; - pageCommerceEligibilitys.setCursors(before, after); - } - String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; - String next = paging.has("next") ? paging.get("next").getAsString() : null; - pageCommerceEligibilitys.setPaging(previous, next); - if (context.hasAppSecret()) { - pageCommerceEligibilitys.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++) { - pageCommerceEligibilitys.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()) { - pageCommerceEligibilitys.add(loadJSON(entry.getValue().toString(), context, header)); - } - break; - } - } - if (!isRedownload) { - pageCommerceEligibilitys.add(loadJSON(obj.toString(), context, header)); - } - } - return pageCommerceEligibilitys; - } 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()) { - pageCommerceEligibilitys.add(loadJSON(entry.getValue().toString(), context, header)); - } - return pageCommerceEligibilitys; - } 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) - ) { - pageCommerceEligibilitys.add(loadJSON(value.toString(), context, header)); - } else { - isIdIndexedArray = false; - break; - } - } - if (isIdIndexedArray) { - return pageCommerceEligibilitys; - } - - // Sixth, check if it's pure JsonObject - pageCommerceEligibilitys.clear(); - pageCommerceEligibilitys.add(loadJSON(json, context, header)); - return pageCommerceEligibilitys; - } - } - } 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 Object getFieldOffsite() { - return mOffsite; - } - - public PageCommerceEligibility setFieldOffsite(Object value) { - this.mOffsite = value; - return this; - } - - public Object getFieldOnsite() { - return mOnsite; - } - - public PageCommerceEligibility setFieldOnsite(Object value) { - this.mOnsite = value; - return this; - } - - - - - synchronized /*package*/ static Gson getGson() { - if (gson != null) { - return gson; - } else { - gson = new GsonBuilder() - .excludeFieldsWithModifiers(Modifier.STATIC) - .excludeFieldsWithModifiers(Modifier.PROTECTED) - .disableHtmlEscaping() - .create(); - } - return gson; - } - - public PageCommerceEligibility copyFrom(PageCommerceEligibility instance) { - this.mOffsite = instance.mOffsite; - this.mOnsite = instance.mOnsite; - this.context = instance.context; - this.rawValue = instance.rawValue; - return this; - } - - public static APIRequest.ResponseParser getParser() { - return new APIRequest.ResponseParser() { - public APINodeList parseResponse(String response, APIContext context, APIRequest request, String header) throws MalformedResponseException { - return PageCommerceEligibility.parseResponse(response, context, request, header); - } - }; - } -} diff --git a/src/main/java/com/facebook/ads/sdk/PagePost.java b/src/main/java/com/facebook/ads/sdk/PagePost.java index 21c9bade..3ff7dcd8 100644 --- a/src/main/java/com/facebook/ads/sdk/PagePost.java +++ b/src/main/java/com/facebook/ads/sdk/PagePost.java @@ -2977,6 +2977,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -3633,6 +3634,13 @@ public APIRequestGetSponsorTags requestIsEligibleForDisableConnectIgBtnForNonPag this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetSponsorTags requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/Photo.java b/src/main/java/com/facebook/ads/sdk/Photo.java index 14a7908c..f27a8557 100644 --- a/src/main/java/com/facebook/ads/sdk/Photo.java +++ b/src/main/java/com/facebook/ads/sdk/Photo.java @@ -1592,6 +1592,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -2248,6 +2249,13 @@ public APIRequestGetSponsorTags requestIsEligibleForDisableConnectIgBtnForNonPag this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetSponsorTags requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/Post.java b/src/main/java/com/facebook/ads/sdk/Post.java index ff4c2f60..63f18d22 100644 --- a/src/main/java/com/facebook/ads/sdk/Post.java +++ b/src/main/java/com/facebook/ads/sdk/Post.java @@ -2822,6 +2822,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -3478,6 +3479,13 @@ public APIRequestGetSponsorTags requestIsEligibleForDisableConnectIgBtnForNonPag this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetSponsorTags requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetSponsorTags requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ProductCatalog.java b/src/main/java/com/facebook/ads/sdk/ProductCatalog.java index dfdd7304..11aad25e 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductCatalog.java +++ b/src/main/java/com/facebook/ads/sdk/ProductCatalog.java @@ -472,6 +472,10 @@ public APIRequestCreateVehicle createVehicle() { return new APIRequestCreateVehicle(this.getPrefixedId().toString(), context); } + public APIRequestCreateVersionItemsBatch createVersionItemsBatch() { + return new APIRequestCreateVersionItemsBatch(this.getPrefixedId().toString(), context); + } + public APIRequestDelete delete() { return new APIRequestDelete(this.getPrefixedId().toString(), context); } @@ -3326,6 +3330,7 @@ public APINodeList getLastResponse() { "price", "price_change", "sanitized_images", + "tags", "types", "unit_price", "url", @@ -3531,6 +3536,13 @@ public APIRequestGetDestinations requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetDestinations requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetDestinations requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetDestinations requestTypesField () { return this.requestTypesField(true); } @@ -4395,6 +4407,7 @@ public APINodeList getLastResponse() { "origin_city", "price", "sanitized_images", + "tags", "unit_price", "url", "visibility", @@ -4620,6 +4633,13 @@ public APIRequestGetFlights requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetFlights requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetFlights requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetFlights requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -5688,6 +5708,7 @@ public APINodeList getLastResponse() { "sale_price", "sanitized_images", "star_rating", + "tags", "unit_price", "url", "visibility", @@ -5941,6 +5962,13 @@ public APIRequestGetHotels requestStarRatingField (boolean value) { this.requestField("star_rating", value); return this; } + public APIRequestGetHotels requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetHotels requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetHotels requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -10803,6 +10831,153 @@ public APIRequestCreateVehicle requestField (String field, boolean value) { } + public static class APIRequestCreateVersionItemsBatch extends APIRequest { + + ProductCatalog lastResponse = null; + @Override + public ProductCatalog getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "allow_upsert", + "item_type", + "item_version", + "requests", + "version", + }; + + public static final String[] FIELDS = { + }; + + @Override + public ProductCatalog parseResponse(String response, String header) throws APIException { + return ProductCatalog.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public ProductCatalog execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public ProductCatalog 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 ProductCatalog apply(ResponseWrapper result) { + try { + return APIRequestCreateVersionItemsBatch.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateVersionItemsBatch(String nodeId, APIContext context) { + super(context, nodeId, "/version_items_batch", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateVersionItemsBatch setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateVersionItemsBatch setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateVersionItemsBatch setAllowUpsert (Boolean allowUpsert) { + this.setParam("allow_upsert", allowUpsert); + return this; + } + public APIRequestCreateVersionItemsBatch setAllowUpsert (String allowUpsert) { + this.setParam("allow_upsert", allowUpsert); + return this; + } + + public APIRequestCreateVersionItemsBatch setItemType (String itemType) { + this.setParam("item_type", itemType); + return this; + } + + public APIRequestCreateVersionItemsBatch setItemVersion (String itemVersion) { + this.setParam("item_version", itemVersion); + return this; + } + + public APIRequestCreateVersionItemsBatch setRequests (Map requests) { + this.setParam("requests", requests); + return this; + } + public APIRequestCreateVersionItemsBatch setRequests (String requests) { + this.setParam("requests", requests); + return this; + } + + public APIRequestCreateVersionItemsBatch setVersion (Long version) { + this.setParam("version", version); + return this; + } + public APIRequestCreateVersionItemsBatch setVersion (String version) { + this.setParam("version", version); + return this; + } + + public APIRequestCreateVersionItemsBatch requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateVersionItemsBatch requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateVersionItemsBatch requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateVersionItemsBatch requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateVersionItemsBatch requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateVersionItemsBatch requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestDelete extends APIRequest { APINode lastResponse = null; diff --git a/src/main/java/com/facebook/ads/sdk/ProductFeed.java b/src/main/java/com/facebook/ads/sdk/ProductFeed.java index 16fc869e..1921bf1f 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductFeed.java +++ b/src/main/java/com/facebook/ads/sdk/ProductFeed.java @@ -849,6 +849,7 @@ public APINodeList getLastResponse() { "price", "price_change", "sanitized_images", + "tags", "types", "unit_price", "url", @@ -1054,6 +1055,13 @@ public APIRequestGetDestinations requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetDestinations requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetDestinations requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetDestinations requestTypesField () { return this.requestTypesField(true); } @@ -1113,6 +1121,7 @@ public APINodeList getLastResponse() { "origin_city", "price", "sanitized_images", + "tags", "unit_price", "url", "visibility", @@ -1338,6 +1347,13 @@ public APIRequestGetFlights requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetFlights requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetFlights requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetFlights requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -1887,6 +1903,7 @@ public APINodeList getLastResponse() { "sale_price", "sanitized_images", "star_rating", + "tags", "unit_price", "url", "visibility", @@ -2140,6 +2157,13 @@ public APIRequestGetHotels requestStarRatingField (boolean value) { this.requestField("star_rating", value); return this; } + public APIRequestGetHotels requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetHotels requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetHotels requestUnitPriceField () { return this.requestUnitPriceField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ProductItem.java b/src/main/java/com/facebook/ads/sdk/ProductItem.java index 8106b1c4..33fc3651 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductItem.java +++ b/src/main/java/com/facebook/ads/sdk/ProductItem.java @@ -3403,6 +3403,8 @@ public static enum EnumErrorType { VALUE_EXTERNAL_MERCHANT_ID_MISMATCH("EXTERNAL_MERCHANT_ID_MISMATCH"), @SerializedName("GENERIC_INVALID_FIELD") VALUE_GENERIC_INVALID_FIELD("GENERIC_INVALID_FIELD"), + @SerializedName("GROUPS_DISABLED_BY_USER") + VALUE_GROUPS_DISABLED_BY_USER("GROUPS_DISABLED_BY_USER"), @SerializedName("HIDDEN_UNTIL_PRODUCT_LAUNCH") VALUE_HIDDEN_UNTIL_PRODUCT_LAUNCH("HIDDEN_UNTIL_PRODUCT_LAUNCH"), @SerializedName("IMAGE_FETCH_FAILED") diff --git a/src/main/java/com/facebook/ads/sdk/ProductSet.java b/src/main/java/com/facebook/ads/sdk/ProductSet.java index 0fc904c3..aaa23148 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductSet.java +++ b/src/main/java/com/facebook/ads/sdk/ProductSet.java @@ -755,6 +755,7 @@ public APINodeList getLastResponse() { "price", "price_change", "sanitized_images", + "tags", "types", "unit_price", "url", @@ -960,6 +961,13 @@ public APIRequestGetDestinations requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetDestinations requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetDestinations requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetDestinations requestTypesField () { return this.requestTypesField(true); } @@ -1019,6 +1027,7 @@ public APINodeList getLastResponse() { "origin_city", "price", "sanitized_images", + "tags", "unit_price", "url", "visibility", @@ -1244,6 +1253,13 @@ public APIRequestGetFlights requestSanitizedImagesField (boolean value) { this.requestField("sanitized_images", value); return this; } + public APIRequestGetFlights requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetFlights requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetFlights requestUnitPriceField () { return this.requestUnitPriceField(true); } @@ -1793,6 +1809,7 @@ public APINodeList getLastResponse() { "sale_price", "sanitized_images", "star_rating", + "tags", "unit_price", "url", "visibility", @@ -2046,6 +2063,13 @@ public APIRequestGetHotels requestStarRatingField (boolean value) { this.requestField("star_rating", value); return this; } + public APIRequestGetHotels requestTagsField () { + return this.requestTagsField(true); + } + public APIRequestGetHotels requestTagsField (boolean value) { + this.requestField("tags", value); + return this; + } public APIRequestGetHotels requestUnitPriceField () { return this.requestUnitPriceField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/SystemUser.java b/src/main/java/com/facebook/ads/sdk/SystemUser.java index 792dbbc6..20a955ce 100644 --- a/src/main/java/com/facebook/ads/sdk/SystemUser.java +++ b/src/main/java/com/facebook/ads/sdk/SystemUser.java @@ -332,6 +332,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -547,6 +548,13 @@ public APIRequestGetAssignedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAssignedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -1185,6 +1193,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -1850,6 +1859,13 @@ public APIRequestGetAssignedPages requestIsEligibleForDisableConnectIgBtnForNonP this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetAssignedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/TargetingGeoLocation.java b/src/main/java/com/facebook/ads/sdk/TargetingGeoLocation.java index 71b56d3d..2b0a1730 100644 --- a/src/main/java/com/facebook/ads/sdk/TargetingGeoLocation.java +++ b/src/main/java/com/facebook/ads/sdk/TargetingGeoLocation.java @@ -57,8 +57,6 @@ public class TargetingGeoLocation extends APINode { private List mLargeGeoAreas = null; @SerializedName("location_cluster_ids") private List mLocationClusterIds = null; - @SerializedName("location_expansion") - private TargetingGeoLocationLocationExpansion mLocationExpansion = null; @SerializedName("location_types") private List mLocationTypes = null; @SerializedName("medium_geo_areas") @@ -334,20 +332,6 @@ public TargetingGeoLocation setFieldLocationClusterIds(String value) { this.mLocationClusterIds = TargetingGeoLocationLocationCluster.getGson().fromJson(value, type); return this; } - public TargetingGeoLocationLocationExpansion getFieldLocationExpansion() { - return mLocationExpansion; - } - - public TargetingGeoLocation setFieldLocationExpansion(TargetingGeoLocationLocationExpansion value) { - this.mLocationExpansion = value; - return this; - } - - public TargetingGeoLocation setFieldLocationExpansion(String value) { - Type type = new TypeToken(){}.getType(); - this.mLocationExpansion = TargetingGeoLocationLocationExpansion.getGson().fromJson(value, type); - return this; - } public List getFieldLocationTypes() { return mLocationTypes; } @@ -522,7 +506,6 @@ public TargetingGeoLocation copyFrom(TargetingGeoLocation instance) { this.mGeoMarkets = instance.mGeoMarkets; this.mLargeGeoAreas = instance.mLargeGeoAreas; this.mLocationClusterIds = instance.mLocationClusterIds; - this.mLocationExpansion = instance.mLocationExpansion; this.mLocationTypes = instance.mLocationTypes; this.mMediumGeoAreas = instance.mMediumGeoAreas; this.mMetroAreas = instance.mMetroAreas; diff --git a/src/main/java/com/facebook/ads/sdk/TargetingGeoLocationLocationExpansion.java b/src/main/java/com/facebook/ads/sdk/TargetingGeoLocationLocationExpansion.java deleted file mode 100644 index fb52a8d8..00000000 --- a/src/main/java/com/facebook/ads/sdk/TargetingGeoLocationLocationExpansion.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * All rights reserved. - * - * This source code is licensed under the license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.ads.sdk; - -import java.io.File; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.common.base.Function; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.common.util.concurrent.SettableFuture; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; - -import com.facebook.ads.sdk.APIException.MalformedResponseException; - -/** - * This class is auto-generated. - * - * For any issues or feature requests related to this class, please let us know - * on github and we'll fix in our codegen framework. We'll not be able to accept - * pull request for this class. - * - */ -public class TargetingGeoLocationLocationExpansion extends APINode { - @SerializedName("allowed") - private Boolean mAllowed = null; - protected static Gson gson = null; - - public TargetingGeoLocationLocationExpansion() { - } - - public String getId() { - return null; - } - public static TargetingGeoLocationLocationExpansion loadJSON(String json, APIContext context, String header) { - TargetingGeoLocationLocationExpansion targetingGeoLocationLocationExpansion = getGson().fromJson(json, TargetingGeoLocationLocationExpansion.class); - if (context.isDebug()) { - JsonParser parser = new JsonParser(); - JsonElement o1 = parser.parse(json); - JsonElement o2 = parser.parse(targetingGeoLocationLocationExpansion.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); - } - } - targetingGeoLocationLocationExpansion.context = context; - targetingGeoLocationLocationExpansion.rawValue = json; - targetingGeoLocationLocationExpansion.header = header; - return targetingGeoLocationLocationExpansion; - } - - public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { - APINodeList targetingGeoLocationLocationExpansions = 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++) { - targetingGeoLocationLocationExpansions.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); - }; - return targetingGeoLocationLocationExpansions; - } 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; - targetingGeoLocationLocationExpansions.setCursors(before, after); - } - String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; - String next = paging.has("next") ? paging.get("next").getAsString() : null; - targetingGeoLocationLocationExpansions.setPaging(previous, next); - if (context.hasAppSecret()) { - targetingGeoLocationLocationExpansions.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++) { - targetingGeoLocationLocationExpansions.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()) { - targetingGeoLocationLocationExpansions.add(loadJSON(entry.getValue().toString(), context, header)); - } - break; - } - } - if (!isRedownload) { - targetingGeoLocationLocationExpansions.add(loadJSON(obj.toString(), context, header)); - } - } - return targetingGeoLocationLocationExpansions; - } 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()) { - targetingGeoLocationLocationExpansions.add(loadJSON(entry.getValue().toString(), context, header)); - } - return targetingGeoLocationLocationExpansions; - } 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) - ) { - targetingGeoLocationLocationExpansions.add(loadJSON(value.toString(), context, header)); - } else { - isIdIndexedArray = false; - break; - } - } - if (isIdIndexedArray) { - return targetingGeoLocationLocationExpansions; - } - - // Sixth, check if it's pure JsonObject - targetingGeoLocationLocationExpansions.clear(); - targetingGeoLocationLocationExpansions.add(loadJSON(json, context, header)); - return targetingGeoLocationLocationExpansions; - } - } - } 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 Boolean getFieldAllowed() { - return mAllowed; - } - - public TargetingGeoLocationLocationExpansion setFieldAllowed(Boolean value) { - this.mAllowed = value; - return this; - } - - - - - synchronized /*package*/ static Gson getGson() { - if (gson != null) { - return gson; - } else { - gson = new GsonBuilder() - .excludeFieldsWithModifiers(Modifier.STATIC) - .excludeFieldsWithModifiers(Modifier.PROTECTED) - .disableHtmlEscaping() - .create(); - } - return gson; - } - - public TargetingGeoLocationLocationExpansion copyFrom(TargetingGeoLocationLocationExpansion instance) { - this.mAllowed = instance.mAllowed; - this.context = instance.context; - this.rawValue = instance.rawValue; - return this; - } - - public static APIRequest.ResponseParser getParser() { - return new APIRequest.ResponseParser() { - public APINodeList parseResponse(String response, APIContext context, APIRequest request, String header) throws MalformedResponseException { - return TargetingGeoLocationLocationExpansion.parseResponse(response, context, request, header); - } - }; - } -} diff --git a/src/main/java/com/facebook/ads/sdk/User.java b/src/main/java/com/facebook/ads/sdk/User.java index e7b7f6c1..55a98e30 100644 --- a/src/main/java/com/facebook/ads/sdk/User.java +++ b/src/main/java/com/facebook/ads/sdk/User.java @@ -1106,6 +1106,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -1780,6 +1781,13 @@ public APIRequestGetAccounts requestIsEligibleForDisableConnectIgBtnForNonPageAd this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetAccounts requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetAccounts requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetAccounts requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -3056,6 +3064,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -3271,6 +3280,13 @@ public APIRequestGetAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -4415,6 +4431,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -4630,6 +4647,13 @@ public APIRequestGetAssignedAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetAssignedAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetAssignedAdAccounts requestBusinessField () { return this.requestBusinessField(true); } @@ -5268,6 +5292,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -5933,6 +5958,13 @@ public APIRequestGetAssignedPages requestIsEligibleForDisableConnectIgBtnForNonP this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetAssignedPages requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetAssignedPages requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -11976,6 +12008,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -12637,6 +12670,13 @@ public APIRequestGetLikes requestIsEligibleForDisableConnectIgBtnForNonPageAdmin this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetLikes requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetLikes requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetLikes requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -14022,6 +14062,7 @@ public APINodeList getLastResponse() { "is_community_page", "is_eligible_for_branded_content", "is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", + "is_eligible_for_live_boosting_expansion", "is_messenger_bot_get_started_enabled", "is_messenger_platform_bot", "is_owned", @@ -14683,6 +14724,13 @@ public APIRequestGetMusic requestIsEligibleForDisableConnectIgBtnForNonPageAdmin this.requestField("is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web", value); return this; } + public APIRequestGetMusic requestIsEligibleForLiveBoostingExpansionField () { + return this.requestIsEligibleForLiveBoostingExpansionField(true); + } + public APIRequestGetMusic requestIsEligibleForLiveBoostingExpansionField (boolean value) { + this.requestField("is_eligible_for_live_boosting_expansion", value); + return this; + } public APIRequestGetMusic requestIsMessengerBotGetStartedEnabledField () { return this.requestIsMessengerBotGetStartedEnabledField(true); } @@ -16004,6 +16052,7 @@ public APINodeList getLastResponse() { "amount_spent", "attribution_spec", "balance", + "brand_safety_content_filter_levels", "business", "business_city", "business_country_code", @@ -16219,6 +16268,13 @@ public APIRequestGetPersonalAdAccounts requestBalanceField (boolean value) { this.requestField("balance", value); return this; } + public APIRequestGetPersonalAdAccounts requestBrandSafetyContentFilterLevelsField () { + return this.requestBrandSafetyContentFilterLevelsField(true); + } + public APIRequestGetPersonalAdAccounts requestBrandSafetyContentFilterLevelsField (boolean value) { + this.requestField("brand_safety_content_filter_levels", value); + return this; + } public APIRequestGetPersonalAdAccounts requestBusinessField () { return this.requestBusinessField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java index aec0c36d..d75331d7 100644 --- a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java +++ b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java @@ -370,6 +370,10 @@ public APIRequestGetSchedules getSchedules() { return new APIRequestGetSchedules(this.getPrefixedId().toString(), context); } + public APIRequestCreateSetOboMobilityIntent createSetOboMobilityIntent() { + return new APIRequestCreateSetOboMobilityIntent(this.getPrefixedId().toString(), context); + } + public APIRequestDeleteSubscribedApps deleteSubscribedApps() { return new APIRequestDeleteSubscribedApps(this.getPrefixedId().toString(), context); } @@ -3209,6 +3213,111 @@ public APIRequestGetSchedules requestField (String field, boolean value) { } + public static class APIRequestCreateSetOboMobilityIntent extends APIRequest { + + APINode lastResponse = null; + @Override + public APINode getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + }; + + public static final String[] FIELDS = { + }; + + @Override + public APINode parseResponse(String response, String header) throws APIException { + return APINode.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public APINode execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public APINode execute(Map extraParams) throws APIException { + ResponseWrapper rw = executeInternal(extraParams); + lastResponse = parseResponse(rw.getBody(), rw.getHeader()); + return lastResponse; + } + + public ListenableFuture executeAsync() throws APIException { + return executeAsync(new HashMap()); + }; + + public ListenableFuture executeAsync(Map extraParams) throws APIException { + return Futures.transform( + executeAsyncInternal(extraParams), + new Function() { + public APINode apply(ResponseWrapper result) { + try { + return APIRequestCreateSetOboMobilityIntent.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateSetOboMobilityIntent(String nodeId, APIContext context) { + super(context, nodeId, "/set_obo_mobility_intent", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateSetOboMobilityIntent setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateSetOboMobilityIntent setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateSetOboMobilityIntent requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateSetOboMobilityIntent requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateSetOboMobilityIntent requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateSetOboMobilityIntent requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateSetOboMobilityIntent requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateSetOboMobilityIntent requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestDeleteSubscribedApps extends APIRequest { APINodeList lastResponse = null; @@ -4386,8 +4495,6 @@ public String toString() { } public static enum EnumSubCategory { - @SerializedName("CUSTOM") - VALUE_CUSTOM("CUSTOM"), @SerializedName("ORDER_DETAILS") VALUE_ORDER_DETAILS("ORDER_DETAILS"), @SerializedName("ORDER_STATUS") @@ -4409,6 +4516,10 @@ public String toString() { public static enum EnumConversationCategories { @SerializedName("AUTHENTICATION") VALUE_AUTHENTICATION("AUTHENTICATION"), + @SerializedName("AUTHENTICATION_INTERNATIONAL") + VALUE_AUTHENTICATION_INTERNATIONAL("AUTHENTICATION_INTERNATIONAL"), + @SerializedName("FIXED_TEMPLATE_NOTIFY") + VALUE_FIXED_TEMPLATE_NOTIFY("FIXED_TEMPLATE_NOTIFY"), @SerializedName("MARKETING") VALUE_MARKETING("MARKETING"), @SerializedName("MARKETING_OPTIMIZED_DELIVERY") diff --git a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java index 3bfed1d4..e742ed05 100644 --- a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java +++ b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java @@ -46,7 +46,7 @@ public class WhatsAppBusinessPartnerClientVerificationSubmission extends APINode @SerializedName("id") private String mId = null; @SerializedName("rejection_reasons") - private List mRejectionReasons = null; + private List mRejectionReasons = null; @SerializedName("submitted_info") private Object mSubmittedInfo = null; @SerializedName("submitted_time") @@ -54,7 +54,7 @@ public class WhatsAppBusinessPartnerClientVerificationSubmission extends APINode @SerializedName("update_time") private String mUpdateTime = null; @SerializedName("verification_status") - private String mVerificationStatus = null; + private EnumVerificationStatus mVerificationStatus = null; protected static Gson gson = null; public WhatsAppBusinessPartnerClientVerificationSubmission() { @@ -224,11 +224,11 @@ public WhatsAppBusinessPartnerClientVerificationSubmission setFieldId(String val return this; } - public List getFieldRejectionReasons() { + public List getFieldRejectionReasons() { return mRejectionReasons; } - public WhatsAppBusinessPartnerClientVerificationSubmission setFieldRejectionReasons(List value) { + public WhatsAppBusinessPartnerClientVerificationSubmission setFieldRejectionReasons(List value) { this.mRejectionReasons = value; return this; } @@ -260,17 +260,61 @@ public WhatsAppBusinessPartnerClientVerificationSubmission setFieldUpdateTime(St return this; } - public String getFieldVerificationStatus() { + public EnumVerificationStatus getFieldVerificationStatus() { return mVerificationStatus; } - public WhatsAppBusinessPartnerClientVerificationSubmission setFieldVerificationStatus(String value) { + public WhatsAppBusinessPartnerClientVerificationSubmission setFieldVerificationStatus(EnumVerificationStatus value) { this.mVerificationStatus = value; return this; } + public static enum EnumRejectionReasons { + @SerializedName("ADDRESS_NOT_MATCHING") + VALUE_ADDRESS_NOT_MATCHING("ADDRESS_NOT_MATCHING"), + @SerializedName("LEGAL_NAME_NOT_MATCHING") + VALUE_LEGAL_NAME_NOT_MATCHING("LEGAL_NAME_NOT_MATCHING"), + @SerializedName("NONE") + VALUE_NONE("NONE"), + @SerializedName("WEBSITE_NOT_MATCHING") + VALUE_WEBSITE_NOT_MATCHING("WEBSITE_NOT_MATCHING"), + ; + + private String value; + + private EnumRejectionReasons(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + + public static enum EnumVerificationStatus { + @SerializedName("APPROVED") + VALUE_APPROVED("APPROVED"), + @SerializedName("FAILED") + VALUE_FAILED("FAILED"), + @SerializedName("PENDING") + VALUE_PENDING("PENDING"), + ; + + private String value; + + private EnumVerificationStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + synchronized /*package*/ static Gson getGson() { if (gson != null) {