From 3330d4674944b98df29cffb11ce7db59bc2a2d58 Mon Sep 17 00:00:00 2001 From: Satwika Reddy Maddi Date: Wed, 13 Nov 2024 16:57:56 -0800 Subject: [PATCH 1/3] Auto-generated java SDK code update Summary: ignore-conflict-markers Reviewed By: liliarizona Differential Revision: D65913471 fbshipit-source-id: bf9ffbe67e7bb8ae0637d749f975107a7a202a09 --- examples/AdAccountAdCreativesEdge.java | 27 ++++++ examples/AdAccountAdCreativesPost.java | 28 ++++++ ...ccountAdCreativesPostCreateAdCreative.java | 27 ++++++ ...AdCreativesPostCreateAdCreativeCanvas.java | 41 ++++++++ ...CreateAdCreativeCustomizationCanvasDV.java | 53 ++++++++++ ...ateAdCreativeCustomizationCanvasImage.java | 53 ++++++++++ ...ateAdCreativeCustomizationCanvasVideo.java | 47 +++++++++ .../AdAccountAdCreativesPostEnrollStatus.java | 39 ++++++++ examples/AdAccountAdLabelsPost.java | 27 ++++++ examples/AdAccountAdSetsEdge.java | 29 ++++++ .../AdAccountAdSetsPostAdSetCreateCpa.java | 46 +++++++++ ...ountAdSetsPostAdSetCreateCpaAppEvents.java | 45 +++++++++ .../AdAccountAdSetsPostBehaviorTargeting.java | 49 ++++++++++ .../AdAccountAdSetsPostBidMultiplier.java | 43 +++++++++ examples/AdAccountAdSetsPostCreateAdSet.java | 72 ++++++++++++++ ...ccountAdSetsPostCreateAudienceNetwork.java | 42 ++++++++ examples/AdAccountAdSetsPostCreateMAIA.java | 45 +++++++++ .../AdAccountAdSetsPostDailyBudget20.java | 43 +++++++++ ...AccountAdSetsPostDemographicTargeting.java | 72 ++++++++++++++ .../AdAccountAdSetsPostInterestTargeting.java | 65 +++++++++++++ ...tsPostLifetimeBudget200Duration10Days.java | 44 +++++++++ ...countAdSetsPostOptimizePostEngagement.java | 68 +++++++++++++ examples/AdAccountAdSetsPostPageLikes.java | 42 ++++++++ ...AdAccountAdSetsPostPlacementTargeting.java | 42 ++++++++ examples/AdAccountAdSetsPostReach.java | 49 ++++++++++ examples/AdAccountAdVideosPost.java | 27 ++++++ examples/AdAccountAdsEdge.java | 28 ++++++ .../AdAccountAdsPixelEdgeGetPixelCode.java | 27 ++++++ examples/AdAccountAdsPixelsPost.java | 27 ++++++ examples/AdAccountAdsPost.java | 33 +++++++ examples/AdAccountAdsPostAdsRedownload.java | 34 +++++++ ...AdAccountAdsPostAuthorizationCategory.java | 34 +++++++ ...dAccountAdsPostTrackingPostEngagement.java | 34 +++++++ examples/AdAccountCampaignsEdge.java | 29 ++++++ examples/AdAccountCampaignsPost.java | 96 +++++++++++++++++++ .../AdAccountCampaignsPostCategories.java | 32 +++++++ .../AdAccountCampaignsPostDailyBudget.java | 31 ++++++ examples/AdAccountCampaignsPostLeadGen.java | 30 ++++++ .../AdAccountCampaignsPostLinkClicks.java | 30 ++++++ .../AdAccountCampaignsPostLocalAwareness.java | 30 ++++++ examples/AdAccountCampaignsPostMAIA.java | 30 ++++++ examples/AdAccountCampaignsPostMAIDPA.java | 30 ++++++ examples/AdAccountCampaignsPostPageLikes.java | 30 ++++++ .../AdAccountCampaignsPostPostEngagement.java | 30 ++++++ .../AdAccountCampaignsPostVideoViews.java | 30 ++++++ examples/AdAccountCustomAudiencesEdge.java | 27 ++++++ ...tCustomAudiencesEdgeDataSourceSubtype.java | 28 ++++++ ...stomAudiencesPostCreateCustomAudience.java | 30 ++++++ ...ventValueBasedLookalikeCustomAudience.java | 29 ++++++ ...amicValueBasedLookalikeCustomAudience.java | 29 ++++++ ...cesPostPlatformCustomAudienceMACARule.java | 29 ++++++ ...tomAudiencesPostPlatformECAExclusions.java | 29 ++++++ ...mAudiencesPostPlatformECAMultiFilters.java | 29 ++++++ ...tomAudiencesPostPlatformECAMultiPages.java | 29 ++++++ ...sPostPlatformEngagementCustomAudience.java | 29 ++++++ ...ncesPostPlatformWebsiteCustomAudience.java | 29 ++++++ ...AudiencesPostValueBasedCustomAudience.java | 30 ++++++ ...PostValueBasedLookalikeCustomAudience.java | 30 ++++++ examples/AdAccountGeneratePreviewsEdge.java | 30 ++++++ ...eneratePreviewsEdgeDesktopWithStoryId.java | 31 ++++++ ...eneratePreviewsEdgeInstagramStandards.java | 50 ++++++++++ ...tePreviewsEdgeMaiaWithObjectStorySpec.java | 50 ++++++++++ examples/AdAccountNode.java | 27 ++++++ ...ductAudiencesPostIphoneViewNoPurchase.java | 30 ++++++ ...AccountProductAudiencesPostNoPurchase.java | 30 ++++++ examples/AdAccountReachEstimate.java | 35 +++++++ examples/AdCampaignAdsEdge.java | 28 ++++++ examples/AdCampaignGroupAdsEdge.java | 27 ++++++ ...roupAdsEdgeAdgroupsWithStatusArchived.java | 28 ++++++ examples/AdCampaignGroupAdsetsEdge.java | 31 ++++++ examples/AdCampaignNode.java | 27 ++++++ examples/AdCampaignNodeRead.java | 28 ++++++ examples/AdCampaignNodeReadFormatUNIX.java | 31 ++++++ examples/AdCampaignPost.java | 27 ++++++ examples/AdCampaignPostAdsetUpdateCpa.java | 37 +++++++ examples/AdCreativeNode.java | 27 ++++++ examples/AdCreativeNodeRead.java | 28 ++++++ ...CreativeNodeReadInstagramPermalinkUrl.java | 27 ++++++ examples/AdCreativePreviewsEdge.java | 28 ++++++ examples/AdCreativePreviewsEdgePreview.java | 27 ++++++ ...CreativePreviewsEdgePreviewDynamicAds.java | 28 ++++++ ...gePreviewDynamicAdsWithCustomizations.java | 29 ++++++ examples/AdSetsDelete.java | 26 +++++ examples/AdgroupDelete.java | 26 +++++ examples/AdgroupLeadsEdgeAdgroupLeads.java | 26 +++++ examples/AdgroupLeadsEdgeAdgroupLeadsDPA.java | 28 ++++++ .../AdgroupLeadsEdgeAdgroupLeadsFiltered.java | 27 ++++++ examples/AdgroupNode.java | 28 ++++++ examples/AdgroupPost.java | 27 ++++++ examples/AdgroupPostAddLabel.java | 28 ++++++ examples/AdgroupPostUpdateStatus.java | 27 ++++++ .../AdsInsightsEdgeAdCampaignInsights.java | 28 ++++++ examples/AdsInsightsEdgeAdGroupInsights.java | 28 ++++++ ...ightsEdgeCampaignGroupAdLevelInsights.java | 29 ++++++ .../AdsInsightsEdgeCampaignGroupInsights.java | 28 ++++++ examples/AdsPixelEventsPost.java | 27 ++++++ examples/AdsPixelEventsPostCustom.java | 68 +++++++++++++ examples/AdsPixelSharedAccountsEdge.java | 27 ++++++ examples/AdsPixelSharedAccountsPost.java | 28 ++++++ examples/AdsPixelSharedAgenciesEdge.java | 26 +++++ examples/CampaignsDelete.java | 26 +++++ examples/CustomAudienceDelete.java | 26 +++++ examples/CustomAudienceNode.java | 26 +++++ examples/CustomAudienceNodeReadRule.java | 28 ++++++ examples/CustomAudiencePost.java | 27 ++++++ examples/CustomAudienceUsersPost.java | 27 ++++++ .../CustomAudienceUsersPostCrossPlatform.java | 27 ++++++ examples/MULTIPost.java | 31 ++++++ examples/MULTIPostOne.java | 27 ++++++ examples/MULTIPostTwo.java | 27 ++++++ .../OfflineConversionsCreateOfflineSet.java | 28 ++++++ examples/PageFeedEdge.java | 26 +++++ examples/PageFeedPost.java | 27 ++++++ examples/PageFeedPostFeedImageDeepLink.java | 28 ++++++ examples/PageNode.java | 30 ++++++ examples/PageNodePageSearch.java | 29 ++++++ examples/PagePhotosEdge.java | 26 +++++ examples/PagePhotosPost.java | 28 ++++++ examples/PagePictureEdge.java | 27 ++++++ examples/PagePostCommentsPost.java | 27 ++++++ examples/PagePostDelete.java | 26 +++++ examples/PagePostNode.java | 26 +++++ examples/PagePostPost.java | 27 ++++++ examples/PagePostsEdge.java | 26 +++++ .../PagePostsEdgePagePostCreateCarousel.java | 31 ++++++ examples/PageRolesEdge.java | 26 +++++ examples/PageSubscribedAppsPost.java | 27 ++++++ examples/ProductCatalogEventStatsEdge.java | 26 +++++ examples/ProductCatalogHotelsPost.java | 36 +++++++ ...HotelsPostUpdateHotelsCatalogSettings.java | 26 +++++ ...uctCatalogProductFeedsPostProductFeed.java | 28 ++++++ ...ProductCatalogProductSetsPostHotelSet.java | 28 ++++++ ...oductCatalogProductSetsPostProductSet.java | 28 ++++++ examples/UserAccountsEdge.java | 26 +++++ examples/UserAdAccountsEdge.java | 26 +++++ examples/UserLeadGenInfoNode.java | 26 +++++ examples/UserNode.java | 26 +++++ examples/VideoThumbnailsEdge.java | 26 +++++ pom.xml | 2 +- .../sdk/AdCreativeFeatureCustomizations.java | 11 +++ 140 files changed, 4511 insertions(+), 1 deletion(-) create mode 100644 examples/AdAccountAdCreativesEdge.java create mode 100644 examples/AdAccountAdCreativesPost.java create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreative.java create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.java create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.java create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.java create mode 100644 examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.java create mode 100644 examples/AdAccountAdCreativesPostEnrollStatus.java create mode 100644 examples/AdAccountAdLabelsPost.java create mode 100644 examples/AdAccountAdSetsEdge.java create mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpa.java create mode 100644 examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java create mode 100644 examples/AdAccountAdSetsPostBehaviorTargeting.java create mode 100644 examples/AdAccountAdSetsPostBidMultiplier.java create mode 100644 examples/AdAccountAdSetsPostCreateAdSet.java create mode 100644 examples/AdAccountAdSetsPostCreateAudienceNetwork.java create mode 100644 examples/AdAccountAdSetsPostCreateMAIA.java create mode 100644 examples/AdAccountAdSetsPostDailyBudget20.java create mode 100644 examples/AdAccountAdSetsPostDemographicTargeting.java create mode 100644 examples/AdAccountAdSetsPostInterestTargeting.java create mode 100644 examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java create mode 100644 examples/AdAccountAdSetsPostOptimizePostEngagement.java create mode 100644 examples/AdAccountAdSetsPostPageLikes.java create mode 100644 examples/AdAccountAdSetsPostPlacementTargeting.java create mode 100644 examples/AdAccountAdSetsPostReach.java create mode 100644 examples/AdAccountAdVideosPost.java create mode 100644 examples/AdAccountAdsEdge.java create mode 100644 examples/AdAccountAdsPixelEdgeGetPixelCode.java create mode 100644 examples/AdAccountAdsPixelsPost.java create mode 100644 examples/AdAccountAdsPost.java create mode 100644 examples/AdAccountAdsPostAdsRedownload.java create mode 100644 examples/AdAccountAdsPostAuthorizationCategory.java create mode 100644 examples/AdAccountAdsPostTrackingPostEngagement.java create mode 100644 examples/AdAccountCampaignsEdge.java create mode 100644 examples/AdAccountCampaignsPost.java create mode 100644 examples/AdAccountCampaignsPostCategories.java create mode 100644 examples/AdAccountCampaignsPostDailyBudget.java create mode 100644 examples/AdAccountCampaignsPostLeadGen.java create mode 100644 examples/AdAccountCampaignsPostLinkClicks.java create mode 100644 examples/AdAccountCampaignsPostLocalAwareness.java create mode 100644 examples/AdAccountCampaignsPostMAIA.java create mode 100644 examples/AdAccountCampaignsPostMAIDPA.java create mode 100644 examples/AdAccountCampaignsPostPageLikes.java create mode 100644 examples/AdAccountCampaignsPostPostEngagement.java create mode 100644 examples/AdAccountCampaignsPostVideoViews.java create mode 100644 examples/AdAccountCustomAudiencesEdge.java create mode 100644 examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.java create mode 100644 examples/AdAccountCustomAudiencesPostCreateCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAExclusions.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.java create mode 100644 examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.java create mode 100644 examples/AdAccountGeneratePreviewsEdge.java create mode 100644 examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.java create mode 100644 examples/AdAccountGeneratePreviewsEdgeInstagramStandards.java create mode 100644 examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.java create mode 100644 examples/AdAccountNode.java create mode 100644 examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.java create mode 100644 examples/AdAccountProductAudiencesPostNoPurchase.java create mode 100644 examples/AdAccountReachEstimate.java create mode 100644 examples/AdCampaignAdsEdge.java create mode 100644 examples/AdCampaignGroupAdsEdge.java create mode 100644 examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.java create mode 100644 examples/AdCampaignGroupAdsetsEdge.java create mode 100644 examples/AdCampaignNode.java create mode 100644 examples/AdCampaignNodeRead.java create mode 100644 examples/AdCampaignNodeReadFormatUNIX.java create mode 100644 examples/AdCampaignPost.java create mode 100644 examples/AdCampaignPostAdsetUpdateCpa.java create mode 100644 examples/AdCreativeNode.java create mode 100644 examples/AdCreativeNodeRead.java create mode 100644 examples/AdCreativeNodeReadInstagramPermalinkUrl.java create mode 100644 examples/AdCreativePreviewsEdge.java create mode 100644 examples/AdCreativePreviewsEdgePreview.java create mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAds.java create mode 100644 examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.java create mode 100644 examples/AdSetsDelete.java create mode 100644 examples/AdgroupDelete.java create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeads.java create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsDPA.java create mode 100644 examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java create mode 100644 examples/AdgroupNode.java create mode 100644 examples/AdgroupPost.java create mode 100644 examples/AdgroupPostAddLabel.java create mode 100644 examples/AdgroupPostUpdateStatus.java create mode 100644 examples/AdsInsightsEdgeAdCampaignInsights.java create mode 100644 examples/AdsInsightsEdgeAdGroupInsights.java create mode 100644 examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.java create mode 100644 examples/AdsInsightsEdgeCampaignGroupInsights.java create mode 100644 examples/AdsPixelEventsPost.java create mode 100644 examples/AdsPixelEventsPostCustom.java create mode 100644 examples/AdsPixelSharedAccountsEdge.java create mode 100644 examples/AdsPixelSharedAccountsPost.java create mode 100644 examples/AdsPixelSharedAgenciesEdge.java create mode 100644 examples/CampaignsDelete.java create mode 100644 examples/CustomAudienceDelete.java create mode 100644 examples/CustomAudienceNode.java create mode 100644 examples/CustomAudienceNodeReadRule.java create mode 100644 examples/CustomAudiencePost.java create mode 100644 examples/CustomAudienceUsersPost.java create mode 100644 examples/CustomAudienceUsersPostCrossPlatform.java create mode 100644 examples/MULTIPost.java create mode 100644 examples/MULTIPostOne.java create mode 100644 examples/MULTIPostTwo.java create mode 100644 examples/OfflineConversionsCreateOfflineSet.java create mode 100644 examples/PageFeedEdge.java create mode 100644 examples/PageFeedPost.java create mode 100644 examples/PageFeedPostFeedImageDeepLink.java create mode 100644 examples/PageNode.java create mode 100644 examples/PageNodePageSearch.java create mode 100644 examples/PagePhotosEdge.java create mode 100644 examples/PagePhotosPost.java create mode 100644 examples/PagePictureEdge.java create mode 100644 examples/PagePostCommentsPost.java create mode 100644 examples/PagePostDelete.java create mode 100644 examples/PagePostNode.java create mode 100644 examples/PagePostPost.java create mode 100644 examples/PagePostsEdge.java create mode 100644 examples/PagePostsEdgePagePostCreateCarousel.java create mode 100644 examples/PageRolesEdge.java create mode 100644 examples/PageSubscribedAppsPost.java create mode 100644 examples/ProductCatalogEventStatsEdge.java create mode 100644 examples/ProductCatalogHotelsPost.java create mode 100644 examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.java create mode 100644 examples/ProductCatalogProductFeedsPostProductFeed.java create mode 100644 examples/ProductCatalogProductSetsPostHotelSet.java create mode 100644 examples/ProductCatalogProductSetsPostProductSet.java create mode 100644 examples/UserAccountsEdge.java create mode 100644 examples/UserAdAccountsEdge.java create mode 100644 examples/UserLeadGenInfoNode.java create mode 100644 examples/UserNode.java create mode 100644 examples/VideoThumbnailsEdge.java diff --git a/examples/AdAccountAdCreativesEdge.java b/examples/AdAccountAdCreativesEdge.java new file mode 100644 index 00000000..5c5c2940 --- /dev/null +++ b/examples/AdAccountAdCreativesEdge.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getAdCreatives() + .requestNameField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPost.java b/examples/AdAccountAdCreativesPost.java new file mode 100644 index 00000000..a4b7048a --- /dev/null +++ b/examples/AdAccountAdCreativesPost.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setName("Sample Promoted Post") + .setObjectStoryId("_") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreative.java b/examples/AdAccountAdCreativesPostCreateAdCreative.java new file mode 100644 index 00000000..d5f313dd --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreative.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostCreateAdCreative { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setObjectStoryId("_") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.java b/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.java new file mode 100644 index 00000000..d951044b --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCanvas.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostCreateAdCreativeCanvas { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setImageHash("") + .setObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldLinkData( + new AdCreativeLinkData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE) + ) + .setFieldImageHash("") + .setFieldLink("") + .setFieldName("Creative message") + ) + .setFieldPageId("") + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.java b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.java new file mode 100644 index 00000000..8a353b1b --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV.java @@ -0,0 +1,53 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasDV { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldPageId("") + .setFieldTemplateData( + new AdCreativeLinkData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE) + ) + .setFieldCustomizationRulesSpec(Arrays.asList( + new AdCustomizationRuleSpec() + .setFieldCustomizationSpec("{\"language\":\"en_XX\"}") + , + new AdCustomizationRuleSpec() + .setFieldCustomizationSpec("{\"language\":\"fr_XX\"}") + .setFieldLink("") + .setFieldMessage("French Creative message") + .setFieldName("French Creative title") + )) + .setFieldFormatOption(AdCreativeLinkData.EnumFormatOption.VALUE_COLLECTION_VIDEO) + .setFieldLink("") + .setFieldMessage("English Creative message") + .setFieldName("English Creative title") + .setFieldRetailerItemIds(Arrays.asList(0L, 0L, 0L, 0L)) + ) + ) + .setProductSetId("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.java b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.java new file mode 100644 index 00000000..6289f1a3 --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage.java @@ -0,0 +1,53 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasImage { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldLinkData( + new AdCreativeLinkData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE) + ) + .setFieldCustomizationRulesSpec(Arrays.asList( + new AdCustomizationRuleSpec() + .setFieldCustomizationSpec("{\"language\":\"en_XX\"}") + , + new AdCustomizationRuleSpec() + .setFieldCustomizationSpec("{\"language\":\"fr_XX\"}") + .setFieldLink("") + .setFieldMessage("French Creative message") + .setFieldName("French Creative title") + )) + .setFieldLink("") + .setFieldMessage("English Creative message") + .setFieldName("English Creative title") + .setFieldPicture("") + .setFieldRetailerItemIds(Arrays.asList(0L, 0L, 0L, 0L)) + ) + .setFieldPageId("") + ) + .setProductSetId("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.java b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.java new file mode 100644 index 00000000..2907e44a --- /dev/null +++ b/examples/AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo.java @@ -0,0 +1,47 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostCreateAdCreativeCustomizationCanvasVideo { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldPageId("") + .setFieldVideoData( + new AdCreativeVideoData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE) + .setFieldValue( + new AdCreativeLinkDataCallToActionValue() + .setFieldLink("") + ) + ) + .setFieldImageUrl("") + .setFieldMessage("English Creative message") + .setFieldRetailerItemIds(Arrays.asList(0L, 0L, 0L, 0L)) + .setFieldTitle("English Creative title") + .setFieldVideoId("") + ) + ) + .setProductSetId("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdCreativesPostEnrollStatus.java b/examples/AdAccountAdCreativesPostEnrollStatus.java new file mode 100644 index 00000000..1a526c8e --- /dev/null +++ b/examples/AdAccountAdCreativesPostEnrollStatus.java @@ -0,0 +1,39 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdCreativesPostEnrollStatus { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdCreative() + .setName("Sample Promoted") + .setObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldLinkData( + new AdCreativeLinkData() + .setFieldImageHash("") + .setFieldLink("") + .setFieldMessage("try it out") + ) + .setFieldPageId("") + ) + .setParam("degrees_of_freedom_spec", "{\"creative_features_spec\":\"{\"standard_enhancements\":\"{\\"enroll_status\\":\\"OPT_IN\\"}\"}\"}") + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdLabelsPost.java b/examples/AdAccountAdLabelsPost.java new file mode 100644 index 00000000..1ca20b64 --- /dev/null +++ b/examples/AdAccountAdLabelsPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdLabelsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdLabel() + .setName("My Label") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsEdge.java b/examples/AdAccountAdSetsEdge.java new file mode 100644 index 00000000..5434062c --- /dev/null +++ b/examples/AdAccountAdSetsEdge.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getAdSets() + .requestNameField() + .requestIdField() + .requestStatusField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpa.java b/examples/AdAccountAdSetsPostAdSetCreateCpa.java new file mode 100644 index 00000000..068de898 --- /dev/null +++ b/examples/AdAccountAdSetsPostAdSetCreateCpa.java @@ -0,0 +1,46 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostAdSetCreateCpa { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("A CPA Ad Set") + .setCampaignId("") + .setDailyBudget(5000L) + .setStartTime("2024-07-27T00:47:13-0700") + .setEndTime("2024-08-03T00:47:13-0700") + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setBidAmount(1000L) + .setPromotedObject("{\"page_id\":\"\"}") + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .setParam("user_os", "iOS") + .setParam("publisher_platforms", "facebook") + .setParam("device_platforms", "mobile") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java new file mode 100644 index 00000000..e734d3e8 --- /dev/null +++ b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostAdSetCreateCpaAppEvents { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("A CPA Ad Set optimized for App Events") + .setCampaignId("") + .setDailyBudget(300L) + .setStartTime("2024-08-05T17:55:15-0700") + .setEndTime("2024-08-12T17:55:15-0700") + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS) + .setBidAmount(100L) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .setPromotedObject("{\"application_id\":\"\",\"object_store_url\":\"\",\"custom_event_type\":\"PURCHASE\"}") + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + .setFieldUserOs(Arrays.asList("iOS")) + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBehaviorTargeting.java b/examples/AdAccountAdSetsPostBehaviorTargeting.java new file mode 100644 index 00000000..a4515ac7 --- /dev/null +++ b/examples/AdAccountAdSetsPostBehaviorTargeting.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostBehaviorTargeting { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My AdSet") + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setBidAmount(2L) + .setDailyBudget(1000L) + .setCampaignId("") + .setTargeting( + new Targeting() + .setFieldBehaviors(Arrays.asList( + new IDName() + .setFieldId(6007101597783L) + .setFieldName("Business Travelers") + , + new IDName() + .setFieldId(6004386044572L) + .setFieldName("Android Owners (All)") + )) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostBidMultiplier.java b/examples/AdAccountAdSetsPostBidMultiplier.java new file mode 100644 index 00000000..8e49879b --- /dev/null +++ b/examples/AdAccountAdSetsPostBidMultiplier.java @@ -0,0 +1,43 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostBidMultiplier { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My Adset with bid multiplier") + .setCampaignId("") + .setDailyBudget(3000L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS) + .setBidAmount(500L) + .setBidAdjustments("{\"user_groups\":{\"gender\":{\"male\":0.8,\"female\":1}}}") + .setPromotedObject("{\"product_set_id\":\"\",\"custom_event_type\":\"ADD_TO_CART\"}") + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAdSet.java b/examples/AdAccountAdSetsPostCreateAdSet.java new file mode 100644 index 00000000..d44929ca --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateAdSet.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostCreateAdSet { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First AdSet") + .setLifetimeBudget(20000L) + .setStartTime("2024-07-27T00:46:29-0700") + .setEndTime("2024-08-03T00:46:29-0700") + .setCampaignId("") + .setBidAmount(500L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_POST_ENGAGEMENT) + .setTargeting( + new Targeting() + .setFieldAgeMax(24L) + .setFieldAgeMin(20L) + .setFieldBehaviors(Arrays.asList( + new IDName() + .setFieldId(6002714895372L) + .setFieldName("All travelers") + )) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGenders(Arrays.asList(1L)) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCities(Arrays.asList( + new TargetingGeoLocationCity() + .setFieldDistanceUnit("mile") + .setFieldKey("777934") + .setFieldRadius(10L) + )) + .setFieldCountries(Arrays.asList("US")) + .setFieldRegions(Arrays.asList( + new TargetingGeoLocationRegion() + .setFieldKey("4081") + )) + ) + .setFieldInterests(Arrays.asList( + new IDName() + .setFieldId("") + .setFieldName("") + )) + .setFieldLifeEvents(Arrays.asList( + new IDName() + .setFieldId(6002714398172L) + .setFieldName("Newlywed (1 year)") + )) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateAudienceNetwork.java b/examples/AdAccountAdSetsPostCreateAudienceNetwork.java new file mode 100644 index 00000000..9dc1abff --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateAudienceNetwork.java @@ -0,0 +1,42 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostCreateAudienceNetwork { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My Ad Set") + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) + .setBidAmount(2L) + .setDailyBudget(1000L) + .setCampaignId("") + .setTargeting( + new Targeting() + .setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_MOBILE)) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostCreateMAIA.java b/examples/AdAccountAdSetsPostCreateMAIA.java new file mode 100644 index 00000000..9a6bc561 --- /dev/null +++ b/examples/AdAccountAdSetsPostCreateMAIA.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostCreateMAIA { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("Mobile App Installs Ad Set") + .setDailyBudget(1000L) + .setBidAmount(2L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_APP_INSTALLS) + .setCampaignId("") + .setPromotedObject("{\"application_id\":\"\",\"object_store_url\":\"\"}") + .setTargeting( + new Targeting() + .setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_MOBILE)) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + .setFieldUserOs(Arrays.asList("IOS")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDailyBudget20.java b/examples/AdAccountAdSetsPostDailyBudget20.java new file mode 100644 index 00000000..3652ef68 --- /dev/null +++ b/examples/AdAccountAdSetsPostDailyBudget20.java @@ -0,0 +1,43 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostDailyBudget20 { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First Adset") + .setDailyBudget(2000L) + .setStartTime("2024-07-29T17:54:47-0700") + .setEndTime("2024-08-05T17:54:47-0700") + .setCampaignId("") + .setBidAmount(100L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostDemographicTargeting.java b/examples/AdAccountAdSetsPostDemographicTargeting.java new file mode 100644 index 00000000..f61a328e --- /dev/null +++ b/examples/AdAccountAdSetsPostDemographicTargeting.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostDemographicTargeting { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First AdSet") + .setDailyBudget(10000L) + .setBidAmount(300L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setCampaignId("") + .setPromotedObject("{\"page_id\":\"\"}") + .setTargeting( + new Targeting() + .setFieldAgeMax(24L) + .setFieldAgeMin(20L) + .setFieldBehaviors(Arrays.asList( + new IDName() + .setFieldId(6002714895372L) + .setFieldName("All travelers") + )) + .setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_MOBILE)) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGenders(Arrays.asList(1L)) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCities(Arrays.asList( + new TargetingGeoLocationCity() + .setFieldDistanceUnit("mile") + .setFieldKey(777934L) + .setFieldRadius(10L) + )) + .setFieldCountries(Arrays.asList("US")) + .setFieldRegions(Arrays.asList( + new TargetingGeoLocationRegion() + .setFieldKey("4081") + )) + ) + .setFieldInterests(Arrays.asList( + new IDName() + .setFieldId("") + .setFieldName("") + )) + .setFieldLifeEvents(Arrays.asList( + new IDName() + .setFieldId(6002714398172L) + .setFieldName("Newlywed (1 year)") + )) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostInterestTargeting.java b/examples/AdAccountAdSetsPostInterestTargeting.java new file mode 100644 index 00000000..85fc16e4 --- /dev/null +++ b/examples/AdAccountAdSetsPostInterestTargeting.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostInterestTargeting { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First AdSet") + .setDailyBudget(10000L) + .setBidAmount(300L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setCampaignId("") + .setPromotedObject("{\"page_id\":\"\"}") + .setTargeting( + new Targeting() + .setFieldAgeMax(24L) + .setFieldAgeMin(20L) + .setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_MOBILE)) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldFlexibleSpec(Arrays.asList( + new FlexibleTargeting() + .setFieldInterests(Arrays.asList( + new IDName() + .setFieldId("") + .setFieldName("") + )) + )) + .setFieldGenders(Arrays.asList(1L)) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCities(Arrays.asList( + new TargetingGeoLocationCity() + .setFieldDistanceUnit("mile") + .setFieldKey(777934L) + .setFieldRadius(10L) + )) + .setFieldCountries(Arrays.asList("US")) + .setFieldRegions(Arrays.asList( + new TargetingGeoLocationRegion() + .setFieldKey("4081") + )) + ) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java new file mode 100644 index 00000000..f95042d7 --- /dev/null +++ b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.java @@ -0,0 +1,44 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostLifetimeBudget200Duration10Days { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First Adset") + .setLifetimeBudget(20000L) + .setStartTime("2024-07-29T17:54:57-0700") + .setEndTime("2024-08-08T17:54:57-0700") + .setCampaignId("") + .setBidAmount(100L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + .setFieldPublisherPlatforms(Arrays.asList("facebook", "audience_network")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostOptimizePostEngagement.java b/examples/AdAccountAdSetsPostOptimizePostEngagement.java new file mode 100644 index 00000000..21611117 --- /dev/null +++ b/examples/AdAccountAdSetsPostOptimizePostEngagement.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostOptimizePostEngagement { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My First Adset") + .setLifetimeBudget(20000L) + .setStartTime("2024-07-29T17:55:06-0700") + .setEndTime("2024-08-08T17:55:06-0700") + .setCampaignId("") + .setBidAmount(500L) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_POST_ENGAGEMENT) + .setTargeting( + new Targeting() + .setFieldAgeMax(24L) + .setFieldAgeMin(20L) + .setFieldBehaviors(Arrays.asList( + new IDName() + .setFieldId(6002714895372L) + .setFieldName("All travelers") + )) + .setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_DESKTOP)) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGenders(Arrays.asList(1L)) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCities(Arrays.asList( + new TargetingGeoLocationCity() + .setFieldDistanceUnit("mile") + .setFieldKey(777934L) + .setFieldRadius(10L) + )) + .setFieldCountries(Arrays.asList("US")) + .setFieldRegions(Arrays.asList( + new TargetingGeoLocationRegion() + .setFieldKey("4081") + )) + ) + .setFieldLifeEvents(Arrays.asList( + new IDName() + .setFieldId(6002714398172L) + .setFieldName("Newlywed (1 year)") + )) + .setFieldPublisherPlatforms(Arrays.asList("facebook")) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPageLikes.java b/examples/AdAccountAdSetsPostPageLikes.java new file mode 100644 index 00000000..d271271a --- /dev/null +++ b/examples/AdAccountAdSetsPostPageLikes.java @@ -0,0 +1,42 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostPageLikes { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My Reach Ad Set") + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setBidAmount(2L) + .setDailyBudget(1000L) + .setCampaignId("") + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .setPromotedObject("{\"page_id\":\"\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostPlacementTargeting.java b/examples/AdAccountAdSetsPostPlacementTargeting.java new file mode 100644 index 00000000..ca26f3ff --- /dev/null +++ b/examples/AdAccountAdSetsPostPlacementTargeting.java @@ -0,0 +1,42 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostPlacementTargeting { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My AdSet") + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setBidAmount(2L) + .setDailyBudget(1000L) + .setCampaignId("") + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + .setFieldPublisherPlatforms(Arrays.asList("facebook")) + ) + .setPromotedObject("{\"page_id\":\"\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdSetsPostReach.java b/examples/AdAccountAdSetsPostReach.java new file mode 100644 index 00000000..8d1176d1 --- /dev/null +++ b/examples/AdAccountAdSetsPostReach.java @@ -0,0 +1,49 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdSetsPostReach { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdSet() + .setName("My Reach Ad Set") + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_REACH) + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setBidAmount(2L) + .setDailyBudget(1000L) + .setCampaignId("") + .setTargeting( + new Targeting() + .setFieldExcludedGeoLocations( + new TargetingGeoLocation() + .setFieldRegions(Arrays.asList( + new TargetingGeoLocationRegion() + .setFieldKey("3847") + )) + ) + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .setStatus(AdSet.EnumStatus.VALUE_PAUSED) + .setPromotedObject("{\"page_id\":\"\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdVideosPost.java b/examples/AdAccountAdVideosPost.java new file mode 100644 index 00000000..fa4eadf1 --- /dev/null +++ b/examples/AdAccountAdVideosPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdVideosPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdVideo() + .setSource("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsEdge.java b/examples/AdAccountAdsEdge.java new file mode 100644 index 00000000..822b8e1d --- /dev/null +++ b/examples/AdAccountAdsEdge.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getAds() + .requestNameField() + .requestIdField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPixelEdgeGetPixelCode.java b/examples/AdAccountAdsPixelEdgeGetPixelCode.java new file mode 100644 index 00000000..5a4b58c7 --- /dev/null +++ b/examples/AdAccountAdsPixelEdgeGetPixelCode.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPixelEdgeGetPixelCode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdsPixel(id, context).get() + .requestCodeField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPixelsPost.java b/examples/AdAccountAdsPixelsPost.java new file mode 100644 index 00000000..26f9d909 --- /dev/null +++ b/examples/AdAccountAdsPixelsPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPixelsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdsPixel() + .setName("My WCA Pixel") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPost.java b/examples/AdAccountAdsPost.java new file mode 100644 index 00000000..f91c4627 --- /dev/null +++ b/examples/AdAccountAdsPost.java @@ -0,0 +1,33 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAd() + .setName("My Ad") + .setAdsetId(L) + .setCreative( + new AdCreative() + .setFieldId("") + ) + .setStatus(Ad.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPostAdsRedownload.java b/examples/AdAccountAdsPostAdsRedownload.java new file mode 100644 index 00000000..dd62ceb4 --- /dev/null +++ b/examples/AdAccountAdsPostAdsRedownload.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPostAdsRedownload { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAd() + .setName("My AdGroup with Redownload") + .setAdsetId(L) + .setCreative( + new AdCreative() + .setFieldId("") + ) + .setParam("redownload", "1") + .setStatus(Ad.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPostAuthorizationCategory.java b/examples/AdAccountAdsPostAuthorizationCategory.java new file mode 100644 index 00000000..2f6d9f2b --- /dev/null +++ b/examples/AdAccountAdsPostAuthorizationCategory.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPostAuthorizationCategory { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAd() + .setName("My AdGroup") + .setAdsetId(L) + .setCreative( + new AdCreative() + .setFieldId("") + ) + .setStatus(Ad.EnumStatus.VALUE_PAUSED) + .setParam("authorization_category", "POLITICAL") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountAdsPostTrackingPostEngagement.java b/examples/AdAccountAdsPostTrackingPostEngagement.java new file mode 100644 index 00000000..d6e3cf3b --- /dev/null +++ b/examples/AdAccountAdsPostTrackingPostEngagement.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountAdsPostTrackingPostEngagement { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAd() + .setName("My First Ad") + .setAdsetId(L) + .setCreative( + new AdCreative() + .setFieldId("") + ) + .setTrackingSpecs("{\"action.type\":\"post_engagement\",\"post\":\"\",\"page\":\"\"}") + .setStatus(Ad.EnumStatus.VALUE_PAUSED) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsEdge.java b/examples/AdAccountCampaignsEdge.java new file mode 100644 index 00000000..a2fbb88f --- /dev/null +++ b/examples/AdAccountCampaignsEdge.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getCampaigns() + .setEffectiveStatus(Arrays.asList(Campaign.EnumEffectiveStatus.VALUE_ACTIVE,Campaign.EnumEffectiveStatus.VALUE_PAUSED)) + .requestNameField() + .requestObjectiveField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPost.java b/examples/AdAccountCampaignsPost.java new file mode 100644 index 00000000..5794d942 --- /dev/null +++ b/examples/AdAccountCampaignsPost.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_TRAFFIC) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("Lead generation campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("Local ad campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_AWARENESS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("Mobile App Installs Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_APP_PROMOTION) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("App Installs Campaign with Dynamic Product Ads") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_APP_PROMOTION) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("Video Views campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign with daily budget") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setDailyBudget(1000L) + .setParam("special_ad_categories", "[]") + .execute(); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign with special ad categories") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setDailyBudget(1000L) + .setParam("special_ad_categories", "[]") + .setParam("special_ad_category_country", "[\"MX\"]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostCategories.java b/examples/AdAccountCampaignsPostCategories.java new file mode 100644 index 00000000..562d5d17 --- /dev/null +++ b/examples/AdAccountCampaignsPostCategories.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostCategories { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign with special ad categories") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setDailyBudget(1000L) + .setParam("special_ad_categories", "[]") + .setParam("special_ad_category_country", "[\"MX\"]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostDailyBudget.java b/examples/AdAccountCampaignsPostDailyBudget.java new file mode 100644 index 00000000..feac9a84 --- /dev/null +++ b/examples/AdAccountCampaignsPostDailyBudget.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostDailyBudget { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign with daily budget") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setDailyBudget(1000L) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLeadGen.java b/examples/AdAccountCampaignsPostLeadGen.java new file mode 100644 index 00000000..0e79237b --- /dev/null +++ b/examples/AdAccountCampaignsPostLeadGen.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostLeadGen { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("Lead generation campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_LEADS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLinkClicks.java b/examples/AdAccountCampaignsPostLinkClicks.java new file mode 100644 index 00000000..8346f9c0 --- /dev/null +++ b/examples/AdAccountCampaignsPostLinkClicks.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostLinkClicks { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_TRAFFIC) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostLocalAwareness.java b/examples/AdAccountCampaignsPostLocalAwareness.java new file mode 100644 index 00000000..a2ed266c --- /dev/null +++ b/examples/AdAccountCampaignsPostLocalAwareness.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostLocalAwareness { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("Local ad campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_AWARENESS) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostMAIA.java b/examples/AdAccountCampaignsPostMAIA.java new file mode 100644 index 00000000..0baa5740 --- /dev/null +++ b/examples/AdAccountCampaignsPostMAIA.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostMAIA { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("Mobile App Installs Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_APP_PROMOTION) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostMAIDPA.java b/examples/AdAccountCampaignsPostMAIDPA.java new file mode 100644 index 00000000..9096f170 --- /dev/null +++ b/examples/AdAccountCampaignsPostMAIDPA.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostMAIDPA { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("App Installs Campaign with Dynamic Product Ads") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_APP_PROMOTION) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostPageLikes.java b/examples/AdAccountCampaignsPostPageLikes.java new file mode 100644 index 00000000..47b19377 --- /dev/null +++ b/examples/AdAccountCampaignsPostPageLikes.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostPageLikes { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostPostEngagement.java b/examples/AdAccountCampaignsPostPostEngagement.java new file mode 100644 index 00000000..023831dc --- /dev/null +++ b/examples/AdAccountCampaignsPostPostEngagement.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostPostEngagement { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("My First Campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCampaignsPostVideoViews.java b/examples/AdAccountCampaignsPostVideoViews.java new file mode 100644 index 00000000..d81eaaa2 --- /dev/null +++ b/examples/AdAccountCampaignsPostVideoViews.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCampaignsPostVideoViews { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCampaign() + .setName("Video Views campaign") + .setObjective(Campaign.EnumObjective.VALUE_OUTCOME_ENGAGEMENT) + .setStatus(Campaign.EnumStatus.VALUE_PAUSED) + .setParam("special_ad_categories", "[]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdge.java b/examples/AdAccountCustomAudiencesEdge.java new file mode 100644 index 00000000..680d59f6 --- /dev/null +++ b/examples/AdAccountCustomAudiencesEdge.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getCustomAudiences() + .requestField("id") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.java b/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.java new file mode 100644 index 00000000..0b8e202d --- /dev/null +++ b/examples/AdAccountCustomAudiencesEdgeDataSourceSubtype.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesEdgeDataSourceSubtype { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getCustomAudiences() + .requestField("data_source") + .requestField("subtype") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostCreateCustomAudience.java b/examples/AdAccountCustomAudiencesPostCreateCustomAudience.java new file mode 100644 index 00000000..d19a072b --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostCreateCustomAudience.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostCreateCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My new Custom Audience") + .setSubtype(CustomAudience.EnumSubtype.VALUE_CUSTOM) + .setDescription("People who purchased on my website") + .setCustomerFileSource(CustomAudience.EnumCustomerFileSource.VALUE_USER_PROVIDED_ONLY) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.java b/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.java new file mode 100644 index 00000000..eec79536 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostDynamicEventValueBasedLookalikeCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("Test Value-Based lookalike from Pixel") + .setSubtype(CustomAudience.EnumSubtype.VALUE_LOOKALIKE) + .setLookalikeSpec("{\"origin_event_sources\":[{\"id\":\"\",\"event_names\":[\"AddToCart\"]}],\"type\":\"custom_ratio\",\"ratio\":0.01,\"country\":\"US\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.java b/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.java new file mode 100644 index 00000000..5a1f77c8 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostDynamicValueBasedLookalikeCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("Test Value-Based lookalike from Pixel") + .setSubtype(CustomAudience.EnumSubtype.VALUE_LOOKALIKE) + .setLookalikeSpec("{\"origin_event_sources\":[{\"id\":\"\"}],\"type\":\"custom_ratio\",\"ratio\":0.01,\"country\":\"US\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.java b/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.java new file mode 100644 index 00000000..21884b42 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformCustomAudienceMACARule { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Website Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"app\"}],\"retention_seconds\":8400,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"fb_mobile_purchase\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.java b/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.java new file mode 100644 index 00000000..6151b4d1 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAExclusions.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformECAExclusions { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Engagement Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"page\"}],\"retention_seconds\":31536000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_engaged\"}]}}]},\"exclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"page\"}],\"retention_seconds\":31536000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_cta_clicked\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.java b/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.java new file mode 100644 index 00000000..c592d4a0 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAMultiFilters.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformECAMultiFilters { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Engagement Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"page\"}],\"retention_seconds\":31536000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_engaged\"},{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_engaged\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.java b/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.java new file mode 100644 index 00000000..04bb4304 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformECAMultiPages.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformECAMultiPages { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Engagement Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"page\"},{\"id\":\"\",\"type\":\"page\"}],\"retention_seconds\":31536000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_engaged\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.java b/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.java new file mode 100644 index 00000000..c3171200 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformEngagementCustomAudience.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformEngagementCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Engagement Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"page\"}],\"retention_seconds\":31536000,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"event\",\"operator\":\"eq\",\"value\":\"page_engaged\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.java b/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.java new file mode 100644 index 00000000..65d945f3 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostPlatformWebsiteCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("My Test Website Custom Audience") + .setRule("{\"inclusions\":{\"operator\":\"or\",\"rules\":[{\"event_sources\":[{\"id\":\"\",\"type\":\"pixel\"}],\"retention_seconds\":8400,\"filter\":{\"operator\":\"and\",\"filters\":[{\"field\":\"url\",\"operator\":\"i_contains\",\"value\":\"shoes\"}]}}]}}") + .setPrefill(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.java b/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.java new file mode 100644 index 00000000..327392ec --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostValueBasedCustomAudience.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostValueBasedCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("Value-Based Custom Audience") + .setSubtype(CustomAudience.EnumSubtype.VALUE_CUSTOM) + .setIsValueBased(true) + .setCustomerFileSource(CustomAudience.EnumCustomerFileSource.VALUE_PARTNER_PROVIDED_ONLY) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.java b/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.java new file mode 100644 index 00000000..c5a46a74 --- /dev/null +++ b/examples/AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountCustomAudiencesPostValueBasedLookalikeCustomAudience { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createCustomAudience() + .setName("Value-Based lookalike") + .setSubtype(CustomAudience.EnumSubtype.VALUE_LOOKALIKE) + .setOriginAudienceId("") + .setLookalikeSpec("{\"type\":\"custom_ratio\",\"ratio\":0.01,\"country\":\"US\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdge.java b/examples/AdAccountGeneratePreviewsEdge.java new file mode 100644 index 00000000..b9fda81d --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdge.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountGeneratePreviewsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getGeneratePreviews() + .setCreative( + new AdCreative() + ) + .setAdFormat(AdPreview.EnumAdFormat.VALUE_) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.java b/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.java new file mode 100644 index 00000000..cf859fc0 --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeDesktopWithStoryId.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountGeneratePreviewsEdgeDesktopWithStoryId { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getGeneratePreviews() + .setCreative( + new AdCreative() + .setFieldObjectStoryId("_") + ) + .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.java b/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.java new file mode 100644 index 00000000..b0a2962b --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeInstagramStandards.java @@ -0,0 +1,50 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountGeneratePreviewsEdgeInstagramStandards { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getGeneratePreviews() + .setCreative( + new AdCreative() + .setFieldInstagramActorId("") + .setFieldObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldLinkData( + new AdCreativeLinkData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_LEARN_MORE) + .setFieldValue( + new AdCreativeLinkDataCallToActionValue() + .setFieldLink("") + ) + ) + .setFieldCaption("www.example.com") + .setFieldImageHash("") + .setFieldLink("") + .setFieldMessage("Message") + ) + .setFieldPageId("") + ) + ) + .setAdFormat(AdPreview.EnumAdFormat.VALUE_INSTAGRAM_STANDARD) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.java b/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.java new file mode 100644 index 00000000..9e3719f1 --- /dev/null +++ b/examples/AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec.java @@ -0,0 +1,50 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountGeneratePreviewsEdgeMaiaWithObjectStorySpec { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getGeneratePreviews() + .setCreative( + new AdCreative() + .setFieldObjectStorySpec( + new AdCreativeObjectStorySpec() + .setFieldLinkData( + new AdCreativeLinkData() + .setFieldCallToAction( + new AdCreativeLinkDataCallToAction() + .setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_USE_APP) + .setFieldValue( + new AdCreativeLinkDataCallToActionValue() + .setFieldLink("") + ) + ) + .setFieldDescription("Description") + .setFieldLink("") + .setFieldMessage("Message") + .setFieldName("Name") + .setFieldPicture("") + ) + .setFieldPageId("") + ) + ) + .setAdFormat(AdPreview.EnumAdFormat.VALUE_MOBILE_FEED_STANDARD) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountNode.java b/examples/AdAccountNode.java new file mode 100644 index 00000000..dc599581 --- /dev/null +++ b/examples/AdAccountNode.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).get() + .requestNameField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.java b/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.java new file mode 100644 index 00000000..0958ec18 --- /dev/null +++ b/examples/AdAccountProductAudiencesPostIphoneViewNoPurchase.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountProductAudiencesPostIphoneViewNoPurchase { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createProductAudience() + .setName("Test Iphone Product Audience") + .setProductSetId("") + .setInclusions("[{\"retention_seconds\":86400,\"rule\":{\"and\":[{\"event\":{\"eq\":\"AddToCart\"}},{\"userAgent\":{\"i_contains\":\"iPhone\"}}]}}]") + .setExclusions("[{\"retention_seconds\":172800,\"rule\":{\"event\":{\"eq\":\"Purchase\"}}}]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountProductAudiencesPostNoPurchase.java b/examples/AdAccountProductAudiencesPostNoPurchase.java new file mode 100644 index 00000000..7a1a0fdd --- /dev/null +++ b/examples/AdAccountProductAudiencesPostNoPurchase.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountProductAudiencesPostNoPurchase { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createProductAudience() + .setName("Test Product Audience") + .setProductSetId("") + .setInclusions("[{\"retention_seconds\":86400,\"rule\":{\"event\":{\"eq\":\"AddToCart\"}}},{\"retention_seconds\":72000,\"rule\":{\"event\":{\"eq\":\"ViewContent\"}}}]") + .setExclusions("[{\"retention_seconds\":172800,\"rule\":{\"event\":{\"eq\":\"Purchase\"}}}]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdAccountReachEstimate.java b/examples/AdAccountReachEstimate.java new file mode 100644 index 00000000..64bc8672 --- /dev/null +++ b/examples/AdAccountReachEstimate.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdAccountReachEstimate { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).getReachEstimate() + .setTargetingSpec( + new Targeting() + .setFieldAgeMax(40L) + .setFieldAgeMin(20L) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignAdsEdge.java b/examples/AdCampaignAdsEdge.java new file mode 100644 index 00000000..7484054c --- /dev/null +++ b/examples/AdCampaignAdsEdge.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignAdsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).getAds() + .requestNameField() + .requestIdField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdge.java b/examples/AdCampaignGroupAdsEdge.java new file mode 100644 index 00000000..7582c10d --- /dev/null +++ b/examples/AdCampaignGroupAdsEdge.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignGroupAdsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).getAds() + .requestNameField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.java b/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.java new file mode 100644 index 00000000..b395e3bb --- /dev/null +++ b/examples/AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignGroupAdsEdgeAdgroupsWithStatusArchived { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).getAds() + .setEffectiveStatus("[\"ARCHIVED\"]") + .requestNameField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignGroupAdsetsEdge.java b/examples/AdCampaignGroupAdsetsEdge.java new file mode 100644 index 00000000..4cda135f --- /dev/null +++ b/examples/AdCampaignGroupAdsetsEdge.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignGroupAdsetsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).getAdSets() + .requestNameField() + .requestStartTimeField() + .requestEndTimeField() + .requestDailyBudgetField() + .requestLifetimeBudgetField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignNode.java b/examples/AdCampaignNode.java new file mode 100644 index 00000000..98a22c6e --- /dev/null +++ b/examples/AdCampaignNode.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).get() + .requestAdsetScheduleField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignNodeRead.java b/examples/AdCampaignNodeRead.java new file mode 100644 index 00000000..d0afa075 --- /dev/null +++ b/examples/AdCampaignNodeRead.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignNodeRead { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).get() + .requestNameField() + .requestStatusField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignNodeReadFormatUNIX.java b/examples/AdCampaignNodeReadFormatUNIX.java new file mode 100644 index 00000000..eae6117d --- /dev/null +++ b/examples/AdCampaignNodeReadFormatUNIX.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignNodeReadFormatUNIX { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).get() + .setParam("date_format", "U") + .requestIdField() + .requestNameField() + .requestStartTimeField() + .requestEndTimeField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignPost.java b/examples/AdCampaignPost.java new file mode 100644 index 00000000..db8034a9 --- /dev/null +++ b/examples/AdCampaignPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).update() + .setBidAdjustments("{\"user_groups\":{\"user_bucket\":{\"event_sources\":[\"\",\"\"],\"1\":0.1,\"2\":0.2,\"3\":0.3,\"default\":{\"gender\":{\"male\":0.99,\"female\":0.12}}}}}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCampaignPostAdsetUpdateCpa.java b/examples/AdCampaignPostAdsetUpdateCpa.java new file mode 100644 index 00000000..9a7de073 --- /dev/null +++ b/examples/AdCampaignPostAdsetUpdateCpa.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCampaignPostAdsetUpdateCpa { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).update() + .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) + .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) + .setBidAmount(200L) + .setTargeting( + new Targeting() + .setFieldFacebookPositions(Arrays.asList("feed")) + .setFieldGeoLocations( + new TargetingGeoLocation() + .setFieldCountries(Arrays.asList("US")) + ) + ) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativeNode.java b/examples/AdCreativeNode.java new file mode 100644 index 00000000..a761008d --- /dev/null +++ b/examples/AdCreativeNode.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativeNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).get() + .requestAssetFeedSpecField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativeNodeRead.java b/examples/AdCreativeNodeRead.java new file mode 100644 index 00000000..e7d77b75 --- /dev/null +++ b/examples/AdCreativeNodeRead.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativeNodeRead { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).get() + .requestNameField() + .requestObjectStoryIdField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativeNodeReadInstagramPermalinkUrl.java b/examples/AdCreativeNodeReadInstagramPermalinkUrl.java new file mode 100644 index 00000000..e23086d5 --- /dev/null +++ b/examples/AdCreativeNodeReadInstagramPermalinkUrl.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativeNodeReadInstagramPermalinkUrl { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).get() + .requestInstagramPermalinkUrlField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdge.java b/examples/AdCreativePreviewsEdge.java new file mode 100644 index 00000000..7d0dcc27 --- /dev/null +++ b/examples/AdCreativePreviewsEdge.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativePreviewsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).getPreviews() + .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) + .setProductItemIds("[\"\"]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreview.java b/examples/AdCreativePreviewsEdgePreview.java new file mode 100644 index 00000000..e460081f --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreview.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativePreviewsEdgePreview { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).getPreviews() + .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAds.java b/examples/AdCreativePreviewsEdgePreviewDynamicAds.java new file mode 100644 index 00000000..bbf6fa29 --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreviewDynamicAds.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativePreviewsEdgePreviewDynamicAds { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).getPreviews() + .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) + .setProductItemIds("[\"\"]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.java b/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.java new file mode 100644 index 00000000..cd1eeb1f --- /dev/null +++ b/examples/AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdCreativePreviewsEdgePreviewDynamicAdsWithCustomizations { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdCreative(id, context).getPreviews() + .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) + .setProductItemIds("[\"\"]") + .setDynamicCustomization("{\"language\":\"fr_XX\",\"country\":\"FR\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdSetsDelete.java b/examples/AdSetsDelete.java new file mode 100644 index 00000000..7c81dedf --- /dev/null +++ b/examples/AdSetsDelete.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdSetsDelete { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).delete() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupDelete.java b/examples/AdgroupDelete.java new file mode 100644 index 00000000..e7320e85 --- /dev/null +++ b/examples/AdgroupDelete.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupDelete { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).delete() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeads.java b/examples/AdgroupLeadsEdgeAdgroupLeads.java new file mode 100644 index 00000000..3157d6f4 --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeads.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupLeadsEdgeAdgroupLeads { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).getLeads() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.java b/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.java new file mode 100644 index 00000000..f8fc0ef2 --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsDPA.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupLeadsEdgeAdgroupLeadsDPA { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).getLeads() + .requestFieldDataField() + .requestRetailerItemIdField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java new file mode 100644 index 00000000..b7239dfa --- /dev/null +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupLeadsEdgeAdgroupLeadsFiltered { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).getLeads() + .setParam("filtering", "[{\"field\":\"time_created\",\"operator\":\"GREATER_THAN\",\"value\":1721709809}]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupNode.java b/examples/AdgroupNode.java new file mode 100644 index 00000000..79b9a3ce --- /dev/null +++ b/examples/AdgroupNode.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).get() + .requestIdField() + .requestNameField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupPost.java b/examples/AdgroupPost.java new file mode 100644 index 00000000..72a40a54 --- /dev/null +++ b/examples/AdgroupPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).update() + .setName("My New Ad") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupPostAddLabel.java b/examples/AdgroupPostAddLabel.java new file mode 100644 index 00000000..42807d71 --- /dev/null +++ b/examples/AdgroupPostAddLabel.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupPostAddLabel { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).update() + .setName("My New Ad with Label") + .setAdlabels("[{\"id\":\"\",\"name\":\"My Label\"}]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdgroupPostUpdateStatus.java b/examples/AdgroupPostUpdateStatus.java new file mode 100644 index 00000000..9c45e416 --- /dev/null +++ b/examples/AdgroupPostUpdateStatus.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdgroupPostUpdateStatus { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).update() + .setParam("adgroup_status", "PAUSED") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsInsightsEdgeAdCampaignInsights.java b/examples/AdsInsightsEdgeAdCampaignInsights.java new file mode 100644 index 00000000..c00a074e --- /dev/null +++ b/examples/AdsInsightsEdgeAdCampaignInsights.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsInsightsEdgeAdCampaignInsights { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdSet(id, context).getInsights() + .setParam("breakdown", "publisher_platform") + .requestField("impressions") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsInsightsEdgeAdGroupInsights.java b/examples/AdsInsightsEdgeAdGroupInsights.java new file mode 100644 index 00000000..9ff9dbbd --- /dev/null +++ b/examples/AdsInsightsEdgeAdGroupInsights.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsInsightsEdgeAdGroupInsights { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Ad(id, context).getInsights() + .setDatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_7D) + .requestField("impressions") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.java b/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.java new file mode 100644 index 00000000..1940f29d --- /dev/null +++ b/examples/AdsInsightsEdgeCampaignGroupAdLevelInsights.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsInsightsEdgeCampaignGroupAdLevelInsights { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).getInsights() + .setLevel(AdsInsights.EnumLevel.VALUE_AD) + .requestField("impressions") + .requestField("ad_id") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsInsightsEdgeCampaignGroupInsights.java b/examples/AdsInsightsEdgeCampaignGroupInsights.java new file mode 100644 index 00000000..d25d24a1 --- /dev/null +++ b/examples/AdsInsightsEdgeCampaignGroupInsights.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsInsightsEdgeCampaignGroupInsights { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).getInsights() + .setDatePreset(AdsInsights.EnumDatePreset.VALUE_LAST_3D) + .requestField("impressions") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsPixelEventsPost.java b/examples/AdsPixelEventsPost.java new file mode 100644 index 00000000..37dbf755 --- /dev/null +++ b/examples/AdsPixelEventsPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsPixelEventsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdsPixel(id, context).createEvent() + .setData("[{\"event_name\":\"PageView\",\"event_time\":1721461428,\"user_data\":{\"fbc\":\"fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890\",\"fbp\":\"fb.1.1558571054389.1098115397\",\"em\":\"309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd\"}}]") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsPixelEventsPostCustom.java b/examples/AdsPixelEventsPostCustom.java new file mode 100644 index 00000000..c6fe7698 --- /dev/null +++ b/examples/AdsPixelEventsPostCustom.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.APIContext; +import com.facebook.ads.sdk.APIException; +import com.facebook.ads.sdk.serverside.ActionSource; +import com.facebook.ads.sdk.serverside.Content; +import com.facebook.ads.sdk.serverside.CustomData; +import com.facebook.ads.sdk.serverside.DeliveryCategory; +import com.facebook.ads.sdk.serverside.Event; +import com.facebook.ads.sdk.serverside.EventRequest; +import com.facebook.ads.sdk.serverside.EventResponse; +import com.facebook.ads.sdk.serverside.UserData; + +import java.util.Arrays; + +public class ServerSideApiExample { + + public static final String ACCESS_TOKEN = ""; + public static final String PIXEL_ID = ""; + + public static void main(String[] args) { + APIContext context = new APIContext(ACCESS_TOKEN).enableDebug(true); + context.setLogger(System.out); + + UserData userData = new UserData() + .emails(Arrays.asList("joe@eg.com")) + .phones(Arrays.asList("12345678901", "14251234567")) + // It is recommended to send Client IP and User Agent for Conversions API Events. + .clientIpAddress(clientIpAddress) + .clientUserAgent(clientUserAgent) + .fbc("fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890") + .fbp("fb.1.1558571054389.1098115397"); + + Content content = new Content() + .productId("product123") + .quantity(1L) + .deliveryCategory(DeliveryCategory.home_delivery); + + CustomData customData = new CustomData() + .addContent(content) + .currency("usd") + .value(123.45F); + + Event purchaseEvent = new Event(); + purchaseEvent.eventName("Purchase") + .eventTime(System.currentTimeMillis() / 1000L) + .userData(userData) + .customData(customData) + .eventSourceUrl("http://jaspers-market.com/product/123") + .actionSource(ActionSource.website); + + EventRequest eventRequest = new EventRequest(PIXEL_ID, context); + eventRequest.addDataItem(purchaseEvent); + + try { + EventResponse response = eventRequest.execute(); + System.out.println(String.format("Standard API response : %s ", response)); + } catch (APIException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsEdge.java b/examples/AdsPixelSharedAccountsEdge.java new file mode 100644 index 00000000..c3e3fde2 --- /dev/null +++ b/examples/AdsPixelSharedAccountsEdge.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsPixelSharedAccountsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdsPixel(id, context).getSharedAccounts() + .setBusiness("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsPixelSharedAccountsPost.java b/examples/AdsPixelSharedAccountsPost.java new file mode 100644 index 00000000..793c22b4 --- /dev/null +++ b/examples/AdsPixelSharedAccountsPost.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsPixelSharedAccountsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdsPixel(id, context).createSharedAccount() + .setAccountId("") + .setBusiness("") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/AdsPixelSharedAgenciesEdge.java b/examples/AdsPixelSharedAgenciesEdge.java new file mode 100644 index 00000000..ceeebf6c --- /dev/null +++ b/examples/AdsPixelSharedAgenciesEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class AdsPixelSharedAgenciesEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdsPixel(id, context).getSharedAgencies() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CampaignsDelete.java b/examples/CampaignsDelete.java new file mode 100644 index 00000000..61c9ad25 --- /dev/null +++ b/examples/CampaignsDelete.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CampaignsDelete { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Campaign(id, context).delete() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudienceDelete.java b/examples/CustomAudienceDelete.java new file mode 100644 index 00000000..2a2819c9 --- /dev/null +++ b/examples/CustomAudienceDelete.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudienceDelete { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).delete() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudienceNode.java b/examples/CustomAudienceNode.java new file mode 100644 index 00000000..541f1a0c --- /dev/null +++ b/examples/CustomAudienceNode.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudienceNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).get() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudienceNodeReadRule.java b/examples/CustomAudienceNodeReadRule.java new file mode 100644 index 00000000..0731a641 --- /dev/null +++ b/examples/CustomAudienceNodeReadRule.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudienceNodeReadRule { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).get() + .requestNameField() + .requestRuleField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudiencePost.java b/examples/CustomAudiencePost.java new file mode 100644 index 00000000..24d13749 --- /dev/null +++ b/examples/CustomAudiencePost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudiencePost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).update() + .setName("Updated Name for CA") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudienceUsersPost.java b/examples/CustomAudienceUsersPost.java new file mode 100644 index 00000000..ed89ede5 --- /dev/null +++ b/examples/CustomAudienceUsersPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudienceUsersPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).createUser() + .setPayload("{\"schema\":[\"EMAIL\",\"LOOKALIKE_VALUE\"],\"data\":[[\"9b431636bd164765d63c573c346708846af4f68fe3701a77a3bdd7e7e5166254\",44.5],[\"8cc62c145cd0c6dc444168eaeb1b61b351f9b1809a579cc9b4c9e9d7213a39ee\",140],[\"4eaf70b1f7a797962b9d2a533f122c8039012b31e0a52b34a426729319cb792a\",0],[\"98df8d46f118f8bef552b0ec0a3d729466a912577830212a844b73960777ac56\",0.9]]}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/CustomAudienceUsersPostCrossPlatform.java b/examples/CustomAudienceUsersPostCrossPlatform.java new file mode 100644 index 00000000..6797324b --- /dev/null +++ b/examples/CustomAudienceUsersPostCrossPlatform.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class CustomAudienceUsersPostCrossPlatform { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new CustomAudience(id, context).createUser() + .setPayload("{\"schema\":[\"EMAIL\",\"MADID\",\"APPUID\",\"LOOKALIKE_VALUE\"],\"app_ids\":[\"\"],\"data\":[[\"b36a83701f1c3191e19722d6f90274bc1b5501fe69ebf33313e440fe4b0fe210\",\"6032d997-3ab0-4de0-aa16-8af0e5b482fb\",\"1234567890\",\"0.9\"],[\"2b3b2b9ce842ab8b6a6c614cb1f9604bb8a0d502d1af49c526b72b10894e95b5\",\"B67385F8-9A82-4670-8C0A-6F9EA7513F5F\",\"\",\"0\"],[\"898628e28890f937bdf009391def42879c401a4bcf1b5fd24e738d9f5da8cbbb\",\"\",\"9876543210\",\"0.4\"]]}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/MULTIPost.java b/examples/MULTIPost.java new file mode 100644 index 00000000..854f20b2 --- /dev/null +++ b/examples/MULTIPost.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class MULTIPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdLabel() + .setName("My Label 1") + .execute(); + + new AdAccount(id, context).createAdLabel() + .setName("My Label 2") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/MULTIPostOne.java b/examples/MULTIPostOne.java new file mode 100644 index 00000000..d0d6b111 --- /dev/null +++ b/examples/MULTIPostOne.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class MULTIPostOne { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdLabel() + .setName("My Label 1") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/MULTIPostTwo.java b/examples/MULTIPostTwo.java new file mode 100644 index 00000000..148f6f72 --- /dev/null +++ b/examples/MULTIPostTwo.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class MULTIPostTwo { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdAccount(id, context).createAdLabel() + .setName("My Label 2") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/OfflineConversionsCreateOfflineSet.java b/examples/OfflineConversionsCreateOfflineSet.java new file mode 100644 index 00000000..e3ff77ea --- /dev/null +++ b/examples/OfflineConversionsCreateOfflineSet.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class OfflineConversionsCreateOfflineSet { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Business(id, context).createOfflineConversionDataSet() + .setName("offline_event_set") + .setDescription("conversion data used for superbowl campaign") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageFeedEdge.java b/examples/PageFeedEdge.java new file mode 100644 index 00000000..9f060514 --- /dev/null +++ b/examples/PageFeedEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageFeedEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getFeed() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageFeedPost.java b/examples/PageFeedPost.java new file mode 100644 index 00000000..a0c00ea7 --- /dev/null +++ b/examples/PageFeedPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageFeedPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).createFeed() + .setMessage("This is a test value") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageFeedPostFeedImageDeepLink.java b/examples/PageFeedPostFeedImageDeepLink.java new file mode 100644 index 00000000..42102c2f --- /dev/null +++ b/examples/PageFeedPostFeedImageDeepLink.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageFeedPostFeedImageDeepLink { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).createFeed() + .setMessage("This is a test message") + .setCallToAction("{\"type\":\"BUY_NOW\",\"value\":{\"link\":\"\",\"app_link\":\"\"}}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageNode.java b/examples/PageNode.java new file mode 100644 index 00000000..fa355b20 --- /dev/null +++ b/examples/PageNode.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getLocations() + .setParam("limit", "30000") + .requestField("location{latitude") + .requestField("longitude}") + .requestIsPermanentlyClosedField() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageNodePageSearch.java b/examples/PageNodePageSearch.java new file mode 100644 index 00000000..7f017772 --- /dev/null +++ b/examples/PageNodePageSearch.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageNodePageSearch { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).get() + .setParam("type", "adradiussuggestion") + .setParam("latitude", "51.5152253") + .setParam("longitude", "-0.1423029") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePhotosEdge.java b/examples/PagePhotosEdge.java new file mode 100644 index 00000000..8d348618 --- /dev/null +++ b/examples/PagePhotosEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePhotosEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getPhotos() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePhotosPost.java b/examples/PagePhotosPost.java new file mode 100644 index 00000000..99459493 --- /dev/null +++ b/examples/PagePhotosPost.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePhotosPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).createPhoto() + .setUrl("https://www.facebook.com/images/fb_icon_325x325.png") + .setPublished(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePictureEdge.java b/examples/PagePictureEdge.java new file mode 100644 index 00000000..1b350b4a --- /dev/null +++ b/examples/PagePictureEdge.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePictureEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getPicture() + .setRedirect(true) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostCommentsPost.java b/examples/PagePostCommentsPost.java new file mode 100644 index 00000000..f3364cfc --- /dev/null +++ b/examples/PagePostCommentsPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostCommentsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new PagePost(id, context).createComment() + .setMessage("This is a test value") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostDelete.java b/examples/PagePostDelete.java new file mode 100644 index 00000000..f9106bb8 --- /dev/null +++ b/examples/PagePostDelete.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostDelete { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new PagePost(id, context).delete() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostNode.java b/examples/PagePostNode.java new file mode 100644 index 00000000..7ff45415 --- /dev/null +++ b/examples/PagePostNode.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new PagePost(id, context).get() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostPost.java b/examples/PagePostPost.java new file mode 100644 index 00000000..6a8b50a7 --- /dev/null +++ b/examples/PagePostPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new PagePost(id, context).update() + .setMessage("This is a test value") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostsEdge.java b/examples/PagePostsEdge.java new file mode 100644 index 00000000..bfca2c98 --- /dev/null +++ b/examples/PagePostsEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getPosts() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PagePostsEdgePagePostCreateCarousel.java b/examples/PagePostsEdgePagePostCreateCarousel.java new file mode 100644 index 00000000..08d97777 --- /dev/null +++ b/examples/PagePostsEdgePagePostCreateCarousel.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PagePostsEdgePagePostCreateCarousel { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getPosts() + .setParam("message", "Browse our latest products") + .setParam("published", "0") + .setParam("child_attachments", "[{\"link\":\"\",\"name\":\"Product 1\",\"description\":\"$4.99\",\"image_hash\":\"\"},{\"link\":\"\",\"name\":\"Product 2\",\"description\":\"$4.99\",\"image_hash\":\"\"},{\"link\":\"\",\"name\":\"Product 3\",\"description\":\"$4.99\",\"image_hash\":\"\"},{\"link\":\"\",\"name\":\"Product 4\",\"description\":\"$4.99\",\"image_hash\":\"\"}]") + .setParam("caption", "WWW.EXAMPLE.COM") + .setParam("link", "http://www.example.com/products") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageRolesEdge.java b/examples/PageRolesEdge.java new file mode 100644 index 00000000..f94fccad --- /dev/null +++ b/examples/PageRolesEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageRolesEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).getRoles() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/PageSubscribedAppsPost.java b/examples/PageSubscribedAppsPost.java new file mode 100644 index 00000000..f046270f --- /dev/null +++ b/examples/PageSubscribedAppsPost.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class PageSubscribedAppsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Page(id, context).createSubscribedApp() + .setSubscribedFields(Arrays.asList(Page.EnumSubscribedFields.VALUE_LEADGEN)) + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogEventStatsEdge.java b/examples/ProductCatalogEventStatsEdge.java new file mode 100644 index 00000000..28791318 --- /dev/null +++ b/examples/ProductCatalogEventStatsEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogEventStatsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).getEventStats() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPost.java b/examples/ProductCatalogHotelsPost.java new file mode 100644 index 00000000..3cab693d --- /dev/null +++ b/examples/ProductCatalogHotelsPost.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogHotelsPost { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).createHotel() + .setHotelId("h_1") + .setName("Sample Hotel") + .setDescription("hotel description") + .setBrand("hotel brand") + .setUrl("http://www.example.com/samplehotel") + .setImages("[{\"image_url\":\"https://www.example.com/pic1.jpg\",\"tags\":[\"front view\",\"balcony\"]},{\"image_url\":\"http://www.example.com/pic2.jpg\",\"tags\":[\"lobby view\"]}]") + .setAddress("{\"street_address\":\"1 Hacker Way\",\"city\":\"Menlo Park\",\"region\":\"California\",\"country\":\"United States\",\"postal_code\":\"94025\",\"neighborhoods\":[\"Palo Alto\",\"Menlo Park\"],\"latitude\":37.484116,\"longitude\":-122.148244}") + .setGuestRatings("[{\"score\":7.8,\"max_score\":10,\"rating_system\":\"sample_rating\",\"number_of_raters\":780}]") + .setStarRating((double) 4) + .setPhone("+351234123456") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.java b/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.java new file mode 100644 index 00000000..ae223576 --- /dev/null +++ b/examples/ProductCatalogHotelsPostUpdateHotelsCatalogSettings.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogHotelsPostUpdateHotelsCatalogSettings { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).update() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogProductFeedsPostProductFeed.java b/examples/ProductCatalogProductFeedsPostProductFeed.java new file mode 100644 index 00000000..ac1aedb9 --- /dev/null +++ b/examples/ProductCatalogProductFeedsPostProductFeed.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogProductFeedsPostProductFeed { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).createProductFeed() + .setName("Test Feed") + .setSchedule("{\"interval\":\"DAILY\",\"url\":\"http://www.example.com/sample_feed.tsv\",\"hour\":\"22\"}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostHotelSet.java b/examples/ProductCatalogProductSetsPostHotelSet.java new file mode 100644 index 00000000..e8a99d62 --- /dev/null +++ b/examples/ProductCatalogProductSetsPostHotelSet.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogProductSetsPostHotelSet { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).createProductSet() + .setName("Test Hotel Set") + .setFilter("{\"brand\":{\"i_contains\":\"sample brand\"}}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/ProductCatalogProductSetsPostProductSet.java b/examples/ProductCatalogProductSetsPostProductSet.java new file mode 100644 index 00000000..bf0d864f --- /dev/null +++ b/examples/ProductCatalogProductSetsPostProductSet.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class ProductCatalogProductSetsPostProductSet { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new ProductCatalog(id, context).createProductSet() + .setName("Test Set") + .setFilter("{\"product_type\":{\"i_contains\":\"shirt\"}}") + .execute(); + + } +} \ No newline at end of file diff --git a/examples/UserAccountsEdge.java b/examples/UserAccountsEdge.java new file mode 100644 index 00000000..97841a74 --- /dev/null +++ b/examples/UserAccountsEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class UserAccountsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new User(id, context).getAccounts() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/UserAdAccountsEdge.java b/examples/UserAdAccountsEdge.java new file mode 100644 index 00000000..f4e3287e --- /dev/null +++ b/examples/UserAdAccountsEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class UserAdAccountsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new User(id, context).getAdAccounts() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/UserLeadGenInfoNode.java b/examples/UserLeadGenInfoNode.java new file mode 100644 index 00000000..318b9714 --- /dev/null +++ b/examples/UserLeadGenInfoNode.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class UserLeadGenInfoNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new Lead(id, context).get() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/UserNode.java b/examples/UserNode.java new file mode 100644 index 00000000..9a357f7f --- /dev/null +++ b/examples/UserNode.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class UserNode { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new User(id, context).get() + .execute(); + + } +} \ No newline at end of file diff --git a/examples/VideoThumbnailsEdge.java b/examples/VideoThumbnailsEdge.java new file mode 100644 index 00000000..56ef623b --- /dev/null +++ b/examples/VideoThumbnailsEdge.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + + import com.facebook.ads.sdk.*; +import java.io.File; +import java.util.Arrays; + +public class VideoThumbnailsEdge { + public static void main (String args[]) throws APIException { + + String access_token = ""; + String app_secret = ""; + String app_id = ""; + String id = ""; + APIContext context = new APIContext(access_token).enableDebug(true); + + new AdVideo(id, context).getThumbnails() + .execute(); + + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index db1e6542..7c657a85 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.facebook.business.sdk facebook-java-business-sdk jar - 21.0.0 + 21.0.1 ${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/AdCreativeFeatureCustomizations.java b/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java index 93de90f0..87f5e5b9 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java @@ -41,6 +41,8 @@ * */ public class AdCreativeFeatureCustomizations extends APINode { + @SerializedName("image_crop_style") + private String mImageCropStyle = null; @SerializedName("showcase_card_display") private String mShowcaseCardDisplay = null; protected static Gson gson = null; @@ -193,6 +195,14 @@ public String toString() { return getGson().toJson(this); } + public String getFieldImageCropStyle() { + return mImageCropStyle; + } + + public AdCreativeFeatureCustomizations setFieldImageCropStyle(String value) { + this.mImageCropStyle = value; + return this; + } public String getFieldShowcaseCardDisplay() { return mShowcaseCardDisplay; @@ -220,6 +230,7 @@ public AdCreativeFeatureCustomizations setFieldShowcaseCardDisplay(String value) } public AdCreativeFeatureCustomizations copyFrom(AdCreativeFeatureCustomizations instance) { + this.mImageCropStyle = instance.mImageCropStyle; this.mShowcaseCardDisplay = instance.mShowcaseCardDisplay; this.context = instance.context; this.rawValue = instance.rawValue; From 0644d68463a1e62c5827a7290da55aa1ee892cf0 Mon Sep 17 00:00:00 2001 From: Satwika Reddy Maddi Date: Fri, 15 Nov 2024 13:32:40 -0800 Subject: [PATCH 2/3] add new words Summary: unblock business sdk release Reviewed By: liliarizona Differential Revision: D66021719 fbshipit-source-id: 48702414deabf76c4f78ffe6c5be348ea5c4d189 --- .../java/com/facebook/ads/sdk/APIConfig.java | 2 +- src/main/java/com/facebook/ads/sdk/Ad.java | 16 + .../java/com/facebook/ads/sdk/AdAccount.java | 179 +++- .../facebook/ads/sdk/AdAccountAdVolume.java | 8 + .../ads/sdk/AdAccountCreationRequest.java | 8 + .../ads/sdk/AdAccountUserSettings.java | 15 + .../ads/sdk/AdAssetFeedSpecLinkURL.java | 12 + .../java/com/facebook/ads/sdk/AdCreative.java | 50 + .../sdk/AdCreativeFeatureCustomizations.java | 1 + .../ads/sdk/AdCreativeFeaturesSpec.java | 17 + .../facebook/ads/sdk/AdCreativeLinkData.java | 12 + .../java/com/facebook/ads/sdk/AdLabel.java | 16 + .../ads/sdk/AdMonetizationProperty.java | 18 +- .../AdNetworkAnalyticsAsyncQueryExport.java | 12 - .../AdNetworkAnalyticsAsyncQueryResult.java | 12 - .../com/facebook/ads/sdk/AdReportRun.java | 88 ++ .../java/com/facebook/ads/sdk/AdRule.java | 2 + src/main/java/com/facebook/ads/sdk/AdSet.java | 18 + .../com/facebook/ads/sdk/AdStudyCell.java | 8 + .../facebook/ads/sdk/AdStudyObjective.java | 8 + .../com/facebook/ads/sdk/AdsInsights.java | 117 +++ .../java/com/facebook/ads/sdk/AdsPixel.java | 72 ++ .../com/facebook/ads/sdk/AdsUserSettings.java | 45 + .../sdk/AdsValueAdjustmentRuleCollection.java | 15 + .../ads/sdk/AnalyticsFunnelQueryResult.java | 24 - .../ads/sdk/AnalyticsQueryResult.java | 36 - .../com/facebook/ads/sdk/Application.java | 47 +- .../java/com/facebook/ads/sdk/Business.java | 481 ++++++++- .../facebook/ads/sdk/BusinessAssetGroup.java | 24 + .../com/facebook/ads/sdk/BusinessUser.java | 8 + .../ads/sdk/CPASBusinessSetupConfig.java | 8 + .../ads/sdk/CatalogAdvertiserInsight.java | 248 +++++ .../sdk/CatalogWebsiteOnboardingSettings.java | 15 + .../ads/sdk/CommerceMerchantSettings.java | 8 + .../com/facebook/ads/sdk/CommerceOrder.java | 155 --- .../facebook/ads/sdk/ContentBlockList.java | 16 + .../com/facebook/ads/sdk/CustomAudience.java | 24 + .../facebook/ads/sdk/CustomAudienceSalts.java | 24 + .../com/facebook/ads/sdk/Destination.java | 90 ++ src/main/java/com/facebook/ads/sdk/Event.java | 2 + .../facebook/ads/sdk/EventSourceGroup.java | 8 + .../com/facebook/ads/sdk/ExtendedCredit.java | 22 +- .../ads/sdk/ExtendedCreditInvoiceGroup.java | 8 + .../ads/sdk/FundingSourceDetailsCoupon.java | 12 + src/main/java/com/facebook/ads/sdk/Group.java | 28 +- .../java/com/facebook/ads/sdk/IGComment.java | 23 + .../java/com/facebook/ads/sdk/IGMedia.java | 31 + .../java/com/facebook/ads/sdk/IGUser.java | 225 ++++ ...ult.java => IGUserSubscribedAppsData.java} | 116 +-- .../facebook/ads/sdk/InstagramCarousel.java | 23 + .../facebook/ads/sdk/InstagramComment.java | 23 + .../ads/sdk/InstagramInsightsResult.java | 12 - .../com/facebook/ads/sdk/InstagramMedia.java | 23 + .../com/facebook/ads/sdk/InstagramUser.java | 23 + .../ads/sdk/LeadGenFormPreviewDetails.java | 24 + .../java/com/facebook/ads/sdk/LiveVideo.java | 16 + .../ads/sdk/LiveVideoAdCampaignConfig.java | 422 ++++++++ .../ads/sdk/MessengerBusinessTemplate.java | 154 +++ .../ads/sdk/MessengerCallSettings.java | 12 + .../ads/sdk/OfflineConversionDataSet.java | 16 + .../ads/sdk/OpenBridgeConfiguration.java | 151 +++ src/main/java/com/facebook/ads/sdk/Page.java | 985 +++++++++++------- .../ads/sdk/PartnershipAdsIdentity.java | 12 + .../com/facebook/ads/sdk/ProductCatalog.java | 58 +- .../com/facebook/ads/sdk/ProductFeed.java | 56 + .../com/facebook/ads/sdk/ProductGroup.java | 8 + .../com/facebook/ads/sdk/ProductItem.java | 29 + .../java/com/facebook/ads/sdk/ProductSet.java | 56 + .../ads/sdk/ReachFrequencyPrediction.java | 15 + .../ads/sdk/RegionalRegulationIdentities.java | 24 + .../com/facebook/ads/sdk/ShadowIGHashtag.java | 16 + .../java/com/facebook/ads/sdk/SystemUser.java | 8 + src/main/java/com/facebook/ads/sdk/User.java | 93 +- .../ads/sdk/WhatsAppBusinessAccount.java | 76 +- ...ssPartnerClientVerificationSubmission.java | 2 + .../java/com/facebook/ads/sdk/WorkSkill.java | 16 + 76 files changed, 4017 insertions(+), 770 deletions(-) create mode 100644 src/main/java/com/facebook/ads/sdk/CatalogAdvertiserInsight.java rename src/main/java/com/facebook/ads/sdk/{AnalyticsCohortQueryResult.java => IGUserSubscribedAppsData.java} (62%) create mode 100644 src/main/java/com/facebook/ads/sdk/LiveVideoAdCampaignConfig.java diff --git a/src/main/java/com/facebook/ads/sdk/APIConfig.java b/src/main/java/com/facebook/ads/sdk/APIConfig.java index d20adebc..de63fff1 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 = "v21.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-v21.0.0"; + public static final String USER_AGENT = "fbbizsdk-java-v21.0.1"; }; diff --git a/src/main/java/com/facebook/ads/sdk/Ad.java b/src/main/java/com/facebook/ads/sdk/Ad.java index e453a7b7..5f3198db 100644 --- a/src/main/java/com/facebook/ads/sdk/Ad.java +++ b/src/main/java/com/facebook/ads/sdk/Ad.java @@ -564,6 +564,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -618,6 +619,7 @@ public APINodeList getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -736,6 +738,13 @@ public APIRequestGetAdCreatives requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGetAdCreatives requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -1114,6 +1123,13 @@ public APIRequestGetAdCreatives requestPortraitCustomizationsField (boolean valu this.requestField("portrait_customizations", value); return this; } + public APIRequestGetAdCreatives requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGetAdCreatives requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGetAdCreatives requestProductSetIdField () { return this.requestProductSetIdField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdAccount.java b/src/main/java/com/facebook/ads/sdk/AdAccount.java index 3628bdf6..a00feb51 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccount.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccount.java @@ -99,6 +99,8 @@ public class AdAccount extends APINode { private String mEndAdvertiserName = null; @SerializedName("existing_customers") private List mExistingCustomers = null; + @SerializedName("expired_funding_source_details") + private FundingSourceDetails mExpiredFundingSourceDetails = null; @SerializedName("extended_credit_invoice_group") private ExtendedCreditInvoiceGroup mExtendedCreditInvoiceGroup = null; @SerializedName("failed_delivery_checks") @@ -960,6 +962,10 @@ public List getFieldExistingCustomers() { return mExistingCustomers; } + public FundingSourceDetails getFieldExpiredFundingSourceDetails() { + return mExpiredFundingSourceDetails; + } + public ExtendedCreditInvoiceGroup getFieldExtendedCreditInvoiceGroup() { if (mExtendedCreditInvoiceGroup != null) { mExtendedCreditInvoiceGroup.context = getContext(); @@ -2682,6 +2688,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -2736,6 +2743,7 @@ public APINodeList getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -2854,6 +2862,13 @@ public APIRequestGetAdCreatives requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGetAdCreatives requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -3232,6 +3247,13 @@ public APIRequestGetAdCreatives requestPortraitCustomizationsField (boolean valu this.requestField("portrait_customizations", value); return this; } + public APIRequestGetAdCreatives requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGetAdCreatives requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGetAdCreatives requestProductSetIdField () { return this.requestProductSetIdField(true); } @@ -3327,6 +3349,7 @@ public AdCreative getLastResponse() { } public static final String[] PARAMS = { "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -3339,6 +3362,7 @@ public AdCreative getLastResponse() { "categorization_criteria", "category_media_source", "contextual_multi_ads", + "creative_sourcing_spec", "degrees_of_freedom_spec", "destination_set_id", "dynamic_ad_voice", @@ -3445,6 +3469,15 @@ public APIRequestCreateAdCreative setActorId (String actorId) { return this; } + public APIRequestCreateAdCreative setAdDisclaimerSpec (Map adDisclaimerSpec) { + this.setParam("ad_disclaimer_spec", adDisclaimerSpec); + return this; + } + public APIRequestCreateAdCreative setAdDisclaimerSpec (String adDisclaimerSpec) { + this.setParam("ad_disclaimer_spec", adDisclaimerSpec); + return this; + } + public APIRequestCreateAdCreative setAdlabels (List adlabels) { this.setParam("adlabels", adlabels); return this; @@ -3541,6 +3574,15 @@ public APIRequestCreateAdCreative setContextualMultiAds (String contextualMultiA return this; } + public APIRequestCreateAdCreative setCreativeSourcingSpec (Map creativeSourcingSpec) { + this.setParam("creative_sourcing_spec", creativeSourcingSpec); + return this; + } + public APIRequestCreateAdCreative setCreativeSourcingSpec (String creativeSourcingSpec) { + this.setParam("creative_sourcing_spec", creativeSourcingSpec); + return this; + } + public APIRequestCreateAdCreative setDegreesOfFreedomSpec (Map degreesOfFreedomSpec) { this.setParam("degrees_of_freedom_spec", degreesOfFreedomSpec); return this; @@ -3844,6 +3886,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -3898,6 +3941,7 @@ public APINodeList getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -4034,6 +4078,13 @@ public APIRequestGetAdCreativesByLabels requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGetAdCreativesByLabels requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGetAdCreativesByLabels requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGetAdCreativesByLabels requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -4412,6 +4463,13 @@ public APIRequestGetAdCreativesByLabels requestPortraitCustomizationsField (bool this.requestField("portrait_customizations", value); return this; } + public APIRequestGetAdCreativesByLabels requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGetAdCreativesByLabels requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGetAdCreativesByLabels requestProductSetIdField () { return this.requestProductSetIdField(true); } @@ -10339,6 +10397,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -10804,6 +10863,13 @@ public APIRequestGetAdvertisableApplications requestDescriptionField (boolean va this.requestField("description", value); return this; } + public APIRequestGetAdvertisableApplications requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetAdvertisableApplications requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetAdvertisableApplications requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -11971,7 +12037,6 @@ public AdVideo getLastResponse() { "start_offset", "swap_mode", "text_format_metadata", - "throwback_camera_roll_media", "thumb", "time_since_original_post", "title", @@ -12432,11 +12497,6 @@ public APIRequestCreateAdVideo setTextFormatMetadata (String textFormatMetadata) return this; } - public APIRequestCreateAdVideo setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateAdVideo setThumb (File thumb) { this.setParam("thumb", thumb); return this; @@ -13748,6 +13808,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -14203,6 +14264,13 @@ public APIRequestGetApplications requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetApplications requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetApplications requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetApplications requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -17782,6 +17850,7 @@ public APINodeList getLastResponse() { "follows_count", "id", "ig_id", + "legacy_instagram_user_id", "media_count", "mentioned_comment", "mentioned_media", @@ -17926,6 +17995,13 @@ public APIRequestGetConnectedInstagramAccounts requestIgIdField (boolean value) this.requestField("ig_id", value); return this; } + public APIRequestGetConnectedInstagramAccounts requestLegacyInstagramUserIdField () { + return this.requestLegacyInstagramUserIdField(true); + } + public APIRequestGetConnectedInstagramAccounts requestLegacyInstagramUserIdField (boolean value) { + this.requestField("legacy_instagram_user_id", value); + return this; + } public APIRequestGetConnectedInstagramAccounts requestMediaCountField () { return this.requestMediaCountField(true); } @@ -18014,6 +18090,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -18146,6 +18223,13 @@ public APIRequestGetConnectedInstagramAccountsWithIabp requestIdField (boolean v this.requestField("id", value); return this; } + public APIRequestGetConnectedInstagramAccountsWithIabp requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetConnectedInstagramAccountsWithIabp requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetConnectedInstagramAccountsWithIabp requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -21809,6 +21893,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -21936,6 +22021,13 @@ public APIRequestGetInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -25151,6 +25243,7 @@ public APINodeList getLastResponse() { "optimization_goal", "optimization_goal_name", "pause_periods", + "percent_reach_at_target_frequency", "placement_breakdown", "placement_breakdown_map", "plan_name", @@ -25725,6 +25818,13 @@ public APIRequestGetReachFrequencyPredictions requestPausePeriodsField (boolean this.requestField("pause_periods", value); return this; } + public APIRequestGetReachFrequencyPredictions requestPercentReachAtTargetFrequencyField () { + return this.requestPercentReachAtTargetFrequencyField(true); + } + public APIRequestGetReachFrequencyPredictions requestPercentReachAtTargetFrequencyField (boolean value) { + this.requestField("percent_reach_at_target_frequency", value); + return this; + } public APIRequestGetReachFrequencyPredictions requestPlacementBreakdownField () { return this.requestPlacementBreakdownField(true); } @@ -26481,7 +26581,12 @@ public AdAccountRecommendations getLastResponse() { return lastResponse; } public static final String[] PARAMS = { + "asc_fragmentation_parameters", + "autoflow_parameters", + "fragmentation_parameters", + "music_parameters", "recommendation_signature", + "scale_good_campaign_parameters", }; public static final String[] FIELDS = { @@ -26541,11 +26646,56 @@ public APIRequestCreateRecommendation setParams(Map params) { } + public APIRequestCreateRecommendation setAscFragmentationParameters (Map ascFragmentationParameters) { + this.setParam("asc_fragmentation_parameters", ascFragmentationParameters); + return this; + } + public APIRequestCreateRecommendation setAscFragmentationParameters (String ascFragmentationParameters) { + this.setParam("asc_fragmentation_parameters", ascFragmentationParameters); + return this; + } + + public APIRequestCreateRecommendation setAutoflowParameters (Map autoflowParameters) { + this.setParam("autoflow_parameters", autoflowParameters); + return this; + } + public APIRequestCreateRecommendation setAutoflowParameters (String autoflowParameters) { + this.setParam("autoflow_parameters", autoflowParameters); + return this; + } + + public APIRequestCreateRecommendation setFragmentationParameters (Map fragmentationParameters) { + this.setParam("fragmentation_parameters", fragmentationParameters); + return this; + } + public APIRequestCreateRecommendation setFragmentationParameters (String fragmentationParameters) { + this.setParam("fragmentation_parameters", fragmentationParameters); + return this; + } + + public APIRequestCreateRecommendation setMusicParameters (Map musicParameters) { + this.setParam("music_parameters", musicParameters); + return this; + } + public APIRequestCreateRecommendation setMusicParameters (String musicParameters) { + this.setParam("music_parameters", musicParameters); + return this; + } + public APIRequestCreateRecommendation setRecommendationSignature (String recommendationSignature) { this.setParam("recommendation_signature", recommendationSignature); return this; } + public APIRequestCreateRecommendation setScaleGoodCampaignParameters (Map scaleGoodCampaignParameters) { + this.setParam("scale_good_campaign_parameters", scaleGoodCampaignParameters); + return this; + } + public APIRequestCreateRecommendation setScaleGoodCampaignParameters (String scaleGoodCampaignParameters) { + this.setParam("scale_good_campaign_parameters", scaleGoodCampaignParameters); + return this; + } + public APIRequestCreateRecommendation requestAllFields () { return this.requestAllFields(true); } @@ -29366,6 +29516,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "id", + "is_default_setting", "name", }; @@ -29466,6 +29617,13 @@ public APIRequestGetValueRuleSet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetValueRuleSet requestIsDefaultSettingField () { + return this.requestIsDefaultSettingField(true); + } + public APIRequestGetValueRuleSet requestIsDefaultSettingField (boolean value) { + this.requestField("is_default_setting", value); + return this; + } public APIRequestGetValueRuleSet requestNameField () { return this.requestNameField(true); } @@ -29999,6 +30157,7 @@ public AdAccount getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -30329,6 +30488,13 @@ public APIRequestGet requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGet requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGet requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGet requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -31357,6 +31523,7 @@ public AdAccount copyFrom(AdAccount instance) { this.mEndAdvertiser = instance.mEndAdvertiser; this.mEndAdvertiserName = instance.mEndAdvertiserName; this.mExistingCustomers = instance.mExistingCustomers; + this.mExpiredFundingSourceDetails = instance.mExpiredFundingSourceDetails; this.mExtendedCreditInvoiceGroup = instance.mExtendedCreditInvoiceGroup; this.mFailedDeliveryChecks = instance.mFailedDeliveryChecks; this.mFbEntity = instance.mFbEntity; diff --git a/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java b/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java index fe2a44b0..0af5e5c3 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java @@ -339,6 +339,8 @@ public static enum EnumRecommendationType { VALUE_AAC_CREATION_PACKAGE("AAC_CREATION_PACKAGE"), @SerializedName("AB_TEST") VALUE_AB_TEST("AB_TEST"), + @SerializedName("ACCOUNT_ERROR") + VALUE_ACCOUNT_ERROR("ACCOUNT_ERROR"), @SerializedName("ACCOUNT_NEEDS_CREDIT") VALUE_ACCOUNT_NEEDS_CREDIT("ACCOUNT_NEEDS_CREDIT"), @SerializedName("ACCOUNT_SPEND_LIMIT") @@ -349,6 +351,8 @@ public static enum EnumRecommendationType { VALUE_ACO_TOGGLE("ACO_TOGGLE"), @SerializedName("ADS_REPORTING") VALUE_ADS_REPORTING("ADS_REPORTING"), + @SerializedName("ADS_STATUS") + VALUE_ADS_STATUS("ADS_STATUS"), @SerializedName("ADVANCED_CAMPAIGN_BUDGET") VALUE_ADVANCED_CAMPAIGN_BUDGET("ADVANCED_CAMPAIGN_BUDGET"), @SerializedName("ADVANTAGE_APP_CAMPAIGN") @@ -587,6 +591,8 @@ public static enum EnumRecommendationType { VALUE_HISTORICAL_BENCHMARK("HISTORICAL_BENCHMARK"), @SerializedName("IG_MULTI_ADS") VALUE_IG_MULTI_ADS("IG_MULTI_ADS"), + @SerializedName("IG_SURFACES_MANUAL_PLACEMENTS") + VALUE_IG_SURFACES_MANUAL_PLACEMENTS("IG_SURFACES_MANUAL_PLACEMENTS"), @SerializedName("LANDING_PAGE_VIEW") VALUE_LANDING_PAGE_VIEW("LANDING_PAGE_VIEW"), @SerializedName("LANDING_PAGE_VIEW_OPTIMIZATION_GOAL") @@ -733,6 +739,8 @@ public static enum EnumRecommendationType { VALUE_SIGNALS_GROWTH_CAPI_V2("SIGNALS_GROWTH_CAPI_V2"), @SerializedName("SIMILAR_ADVERTISER_BUDGET_RECOMMENDATION") VALUE_SIMILAR_ADVERTISER_BUDGET_RECOMMENDATION("SIMILAR_ADVERTISER_BUDGET_RECOMMENDATION"), + @SerializedName("SITE_EXTENSIONS_DUPLICATION") + VALUE_SITE_EXTENSIONS_DUPLICATION("SITE_EXTENSIONS_DUPLICATION"), @SerializedName("SIX_PLUS_MANUAL_PLACEMENTS") VALUE_SIX_PLUS_MANUAL_PLACEMENTS("SIX_PLUS_MANUAL_PLACEMENTS"), @SerializedName("SIX_PLUS_PLACEMENTS_DUPLICATION") diff --git a/src/main/java/com/facebook/ads/sdk/AdAccountCreationRequest.java b/src/main/java/com/facebook/ads/sdk/AdAccountCreationRequest.java index b6cfac8c..9b2dfc2f 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccountCreationRequest.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccountCreationRequest.java @@ -522,6 +522,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -852,6 +853,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdAccountUserSettings.java b/src/main/java/com/facebook/ads/sdk/AdAccountUserSettings.java index 5959fbcf..bb016f61 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAccountUserSettings.java +++ b/src/main/java/com/facebook/ads/sdk/AdAccountUserSettings.java @@ -131,6 +131,8 @@ public class AdAccountUserSettings extends APINode { private Boolean mShouldDefaultTextSwappingOptimization = null; @SerializedName("should_logout_of_3p_sourcing") private Boolean mShouldLogoutOf3pSourcing = null; + @SerializedName("should_show_shops_ads_metrics_onboarding_tour") + private Boolean mShouldShowShopsAdsMetricsOnboardingTour = null; @SerializedName("show_archived_data") private Boolean mShowArchivedData = null; @SerializedName("show_text_variation_nux_tooltip") @@ -548,6 +550,10 @@ public Boolean getFieldShouldLogoutOf3pSourcing() { return mShouldLogoutOf3pSourcing; } + public Boolean getFieldShouldShowShopsAdsMetricsOnboardingTour() { + return mShouldShowShopsAdsMetricsOnboardingTour; + } + public Boolean getFieldShowArchivedData() { return mShowArchivedData; } @@ -649,6 +655,7 @@ public AdAccountUserSettings getLastResponse() { "should_default_instagram_profile_card_optimization", "should_default_text_swapping_optimization", "should_logout_of_3p_sourcing", + "should_show_shops_ads_metrics_onboarding_tour", "show_archived_data", "show_text_variation_nux_tooltip", "syd_campaign_trends_activemetric", @@ -1066,6 +1073,13 @@ public APIRequestGet requestShouldLogoutOf3pSourcingField (boolean value) { this.requestField("should_logout_of_3p_sourcing", value); return this; } + public APIRequestGet requestShouldShowShopsAdsMetricsOnboardingTourField () { + return this.requestShouldShowShopsAdsMetricsOnboardingTourField(true); + } + public APIRequestGet requestShouldShowShopsAdsMetricsOnboardingTourField (boolean value) { + this.requestField("should_show_shops_ads_metrics_onboarding_tour", value); + return this; + } public APIRequestGet requestShowArchivedDataField () { return this.requestShowArchivedDataField(true); } @@ -1255,6 +1269,7 @@ public AdAccountUserSettings copyFrom(AdAccountUserSettings instance) { this.mShouldDefaultInstagramProfileCardOptimization = instance.mShouldDefaultInstagramProfileCardOptimization; this.mShouldDefaultTextSwappingOptimization = instance.mShouldDefaultTextSwappingOptimization; this.mShouldLogoutOf3pSourcing = instance.mShouldLogoutOf3pSourcing; + this.mShouldShowShopsAdsMetricsOnboardingTour = instance.mShouldShowShopsAdsMetricsOnboardingTour; this.mShowArchivedData = instance.mShowArchivedData; this.mShowTextVariationNuxTooltip = instance.mShowTextVariationNuxTooltip; this.mSydCampaignTrendsActivemetric = instance.mSydCampaignTrendsActivemetric; diff --git a/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpecLinkURL.java b/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpecLinkURL.java index 792228f3..cdec1834 100644 --- a/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpecLinkURL.java +++ b/src/main/java/com/facebook/ads/sdk/AdAssetFeedSpecLinkURL.java @@ -49,6 +49,8 @@ public class AdAssetFeedSpecLinkURL extends APINode { private String mDeeplinkUrl = null; @SerializedName("display_url") private String mDisplayUrl = null; + @SerializedName("object_store_urls") + private List mObjectStoreUrls = null; @SerializedName("url_tags") private String mUrlTags = null; @SerializedName("website_url") @@ -245,6 +247,15 @@ public AdAssetFeedSpecLinkURL setFieldDisplayUrl(String value) { return this; } + public List getFieldObjectStoreUrls() { + return mObjectStoreUrls; + } + + public AdAssetFeedSpecLinkURL setFieldObjectStoreUrls(List value) { + this.mObjectStoreUrls = value; + return this; + } + public String getFieldUrlTags() { return mUrlTags; } @@ -284,6 +295,7 @@ public AdAssetFeedSpecLinkURL copyFrom(AdAssetFeedSpecLinkURL instance) { this.mCarouselSeeMoreUrl = instance.mCarouselSeeMoreUrl; this.mDeeplinkUrl = instance.mDeeplinkUrl; this.mDisplayUrl = instance.mDisplayUrl; + this.mObjectStoreUrls = instance.mObjectStoreUrls; this.mUrlTags = instance.mUrlTags; this.mWebsiteUrl = instance.mWebsiteUrl; this.context = instance.context; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreative.java b/src/main/java/com/facebook/ads/sdk/AdCreative.java index 85b2f0df..745b92da 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreative.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreative.java @@ -45,6 +45,8 @@ public class AdCreative extends APINode { private String mAccountId = null; @SerializedName("actor_id") private String mActorId = null; + @SerializedName("ad_disclaimer_spec") + private AdCreativeAdDisclaimer mAdDisclaimerSpec = null; @SerializedName("adlabels") private List mAdlabels = null; @SerializedName("applink_treatment") @@ -153,6 +155,8 @@ public class AdCreative extends APINode { private String mPlayableAssetId = null; @SerializedName("portrait_customizations") private AdCreativePortraitCustomizations mPortraitCustomizations = null; + @SerializedName("product_data") + private List mProductData = null; @SerializedName("product_set_id") private String mProductSetId = null; @SerializedName("recommender_settings") @@ -434,6 +438,20 @@ public AdCreative setFieldActorId(String value) { return this; } + public AdCreativeAdDisclaimer getFieldAdDisclaimerSpec() { + return mAdDisclaimerSpec; + } + + public AdCreative setFieldAdDisclaimerSpec(AdCreativeAdDisclaimer value) { + this.mAdDisclaimerSpec = value; + return this; + } + + public AdCreative setFieldAdDisclaimerSpec(String value) { + Type type = new TypeToken(){}.getType(); + this.mAdDisclaimerSpec = AdCreativeAdDisclaimer.getGson().fromJson(value, type); + return this; + } public List getFieldAdlabels() { return mAdlabels; } @@ -991,6 +1009,20 @@ public AdCreative setFieldPortraitCustomizations(String value) { this.mPortraitCustomizations = AdCreativePortraitCustomizations.getGson().fromJson(value, type); return this; } + public List getFieldProductData() { + return mProductData; + } + + public AdCreative setFieldProductData(List value) { + this.mProductData = value; + return this; + } + + public AdCreative setFieldProductData(String value) { + Type type = new TypeToken>(){}.getType(); + this.mProductData = AdCreativeProductData.getGson().fromJson(value, type); + return this; + } public String getFieldProductSetId() { return mProductSetId; } @@ -1736,6 +1768,7 @@ public AdCreative getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -1790,6 +1823,7 @@ public AdCreative getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -1926,6 +1960,13 @@ public APIRequestGet requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGet requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGet requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGet requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -2304,6 +2345,13 @@ public APIRequestGet requestPortraitCustomizationsField (boolean value) { this.requestField("portrait_customizations", value); return this; } + public APIRequestGet requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGet requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGet requestProductSetIdField () { return this.requestProductSetIdField(true); } @@ -2919,6 +2967,7 @@ public String toString() { public AdCreative copyFrom(AdCreative instance) { this.mAccountId = instance.mAccountId; this.mActorId = instance.mActorId; + this.mAdDisclaimerSpec = instance.mAdDisclaimerSpec; this.mAdlabels = instance.mAdlabels; this.mApplinkTreatment = instance.mApplinkTreatment; this.mAssetFeedSpec = instance.mAssetFeedSpec; @@ -2973,6 +3022,7 @@ public AdCreative copyFrom(AdCreative instance) { this.mPlatformCustomizations = instance.mPlatformCustomizations; this.mPlayableAssetId = instance.mPlayableAssetId; this.mPortraitCustomizations = instance.mPortraitCustomizations; + this.mProductData = instance.mProductData; this.mProductSetId = instance.mProductSetId; this.mRecommenderSettings = instance.mRecommenderSettings; this.mSourceInstagramMediaId = instance.mSourceInstagramMediaId; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java b/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java index 87f5e5b9..61981eba 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeFeatureCustomizations.java @@ -195,6 +195,7 @@ public String toString() { return getGson().toJson(this); } + public String getFieldImageCropStyle() { return mImageCropStyle; } diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java b/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java index 77728532..0992905c 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeFeaturesSpec.java @@ -111,6 +111,8 @@ public class AdCreativeFeaturesSpec extends APINode { private AdCreativeFeatureDetails mMediaOrder = null; @SerializedName("media_type_automation") private AdCreativeFeatureDetails mMediaTypeAutomation = null; + @SerializedName("multi_photo_to_video") + private AdCreativeFeatureDetails mMultiPhotoToVideo = null; @SerializedName("pac_relaxation") private AdCreativeFeatureDetails mPacRelaxation = null; @SerializedName("product_extensions") @@ -780,6 +782,20 @@ public AdCreativeFeaturesSpec setFieldMediaTypeAutomation(String value) { this.mMediaTypeAutomation = AdCreativeFeatureDetails.getGson().fromJson(value, type); return this; } + public AdCreativeFeatureDetails getFieldMultiPhotoToVideo() { + return mMultiPhotoToVideo; + } + + public AdCreativeFeaturesSpec setFieldMultiPhotoToVideo(AdCreativeFeatureDetails value) { + this.mMultiPhotoToVideo = value; + return this; + } + + public AdCreativeFeaturesSpec setFieldMultiPhotoToVideo(String value) { + Type type = new TypeToken(){}.getType(); + this.mMultiPhotoToVideo = AdCreativeFeatureDetails.getGson().fromJson(value, type); + return this; + } public AdCreativeFeatureDetails getFieldPacRelaxation() { return mPacRelaxation; } @@ -1028,6 +1044,7 @@ public AdCreativeFeaturesSpec copyFrom(AdCreativeFeaturesSpec instance) { this.mMediaLiquidityAnimatedImage = instance.mMediaLiquidityAnimatedImage; this.mMediaOrder = instance.mMediaOrder; this.mMediaTypeAutomation = instance.mMediaTypeAutomation; + this.mMultiPhotoToVideo = instance.mMultiPhotoToVideo; this.mPacRelaxation = instance.mPacRelaxation; this.mProductExtensions = instance.mProductExtensions; this.mProductMetadataAutomation = instance.mProductMetadataAutomation; diff --git a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java index d2620262..b7decb94 100644 --- a/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java +++ b/src/main/java/com/facebook/ads/sdk/AdCreativeLinkData.java @@ -51,6 +51,8 @@ public class AdCreativeLinkData extends APINode { private String mAttachmentStyle = null; @SerializedName("automated_product_tags") private Boolean mAutomatedProductTags = null; + @SerializedName("boosted_product_set_id") + private String mBoostedProductSetId = null; @SerializedName("branded_content_shared_to_sponsor_status") private String mBrandedContentSharedToSponsorStatus = null; @SerializedName("branded_content_sponsor_page_id") @@ -312,6 +314,15 @@ public AdCreativeLinkData setFieldAutomatedProductTags(Boolean value) { return this; } + public String getFieldBoostedProductSetId() { + return mBoostedProductSetId; + } + + public AdCreativeLinkData setFieldBoostedProductSetId(String value) { + this.mBoostedProductSetId = value; + return this; + } + public String getFieldBrandedContentSharedToSponsorStatus() { return mBrandedContentSharedToSponsorStatus; } @@ -676,6 +687,7 @@ public AdCreativeLinkData copyFrom(AdCreativeLinkData instance) { this.mAppLinkSpec = instance.mAppLinkSpec; this.mAttachmentStyle = instance.mAttachmentStyle; this.mAutomatedProductTags = instance.mAutomatedProductTags; + this.mBoostedProductSetId = instance.mBoostedProductSetId; this.mBrandedContentSharedToSponsorStatus = instance.mBrandedContentSharedToSponsorStatus; this.mBrandedContentSponsorPageId = instance.mBrandedContentSponsorPageId; this.mCallToAction = instance.mCallToAction; diff --git a/src/main/java/com/facebook/ads/sdk/AdLabel.java b/src/main/java/com/facebook/ads/sdk/AdLabel.java index 221e9387..e61988b2 100644 --- a/src/main/java/com/facebook/ads/sdk/AdLabel.java +++ b/src/main/java/com/facebook/ads/sdk/AdLabel.java @@ -327,6 +327,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -381,6 +382,7 @@ public APINodeList getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -499,6 +501,13 @@ public APIRequestGetAdCreatives requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGetAdCreatives requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -877,6 +886,13 @@ public APIRequestGetAdCreatives requestPortraitCustomizationsField (boolean valu this.requestField("portrait_customizations", value); return this; } + public APIRequestGetAdCreatives requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGetAdCreatives requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGetAdCreatives requestProductSetIdField () { return this.requestProductSetIdField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdMonetizationProperty.java b/src/main/java/com/facebook/ads/sdk/AdMonetizationProperty.java index 48a06e0d..ece5d674 100644 --- a/src/main/java/com/facebook/ads/sdk/AdMonetizationProperty.java +++ b/src/main/java/com/facebook/ads/sdk/AdMonetizationProperty.java @@ -299,6 +299,7 @@ public APINodeList getLastResponse() { "metrics", "ordering_column", "ordering_type", + "should_include_until", "since", "until", }; @@ -426,6 +427,15 @@ public APIRequestGetAdNetworkAnalytics setOrderingType (String orderingType) { return this; } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (Boolean shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (String shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setSince (String since) { this.setParam("since", since); return this; @@ -695,7 +705,6 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "data", - "error", "omitted_results", "query_id", "results", @@ -808,13 +817,6 @@ public APIRequestGetAdNetworkAnalyticsResults requestDataField (boolean value) { this.requestField("data", value); return this; } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField () { - return this.requestErrorField(true); - } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField (boolean value) { - this.requestField("error", value); - return this; - } public APIRequestGetAdNetworkAnalyticsResults requestOmittedResultsField () { return this.requestOmittedResultsField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryExport.java b/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryExport.java index 4af13328..cb352396 100644 --- a/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryExport.java +++ b/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryExport.java @@ -41,8 +41,6 @@ * */ public class AdNetworkAnalyticsAsyncQueryExport extends APINode { - @SerializedName("error") - private Object mError = null; @SerializedName("export_link") private String mExportLink = null; @SerializedName("query_id") @@ -200,15 +198,6 @@ public String toString() { } - public Object getFieldError() { - return mError; - } - - public AdNetworkAnalyticsAsyncQueryExport setFieldError(Object value) { - this.mError = value; - return this; - } - public String getFieldExportLink() { return mExportLink; } @@ -253,7 +242,6 @@ public AdNetworkAnalyticsAsyncQueryExport setFieldStatus(String value) { } public AdNetworkAnalyticsAsyncQueryExport copyFrom(AdNetworkAnalyticsAsyncQueryExport instance) { - this.mError = instance.mError; this.mExportLink = instance.mExportLink; this.mQueryId = instance.mQueryId; this.mStatus = instance.mStatus; diff --git a/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryResult.java b/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryResult.java index a294f27c..2b31e465 100644 --- a/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryResult.java +++ b/src/main/java/com/facebook/ads/sdk/AdNetworkAnalyticsAsyncQueryResult.java @@ -43,8 +43,6 @@ public class AdNetworkAnalyticsAsyncQueryResult extends APINode { @SerializedName("data") private Object mData = null; - @SerializedName("error") - private Object mError = null; @SerializedName("omitted_results") private List mOmittedResults = null; @SerializedName("query_id") @@ -213,15 +211,6 @@ public AdNetworkAnalyticsAsyncQueryResult setFieldData(Object value) { return this; } - public Object getFieldError() { - return mError; - } - - public AdNetworkAnalyticsAsyncQueryResult setFieldError(Object value) { - this.mError = value; - return this; - } - public List getFieldOmittedResults() { return mOmittedResults; } @@ -276,7 +265,6 @@ public AdNetworkAnalyticsAsyncQueryResult setFieldStatus(String value) { public AdNetworkAnalyticsAsyncQueryResult copyFrom(AdNetworkAnalyticsAsyncQueryResult instance) { this.mData = instance.mData; - this.mError = instance.mError; this.mOmittedResults = instance.mOmittedResults; this.mQueryId = instance.mQueryId; this.mResults = instance.mResults; diff --git a/src/main/java/com/facebook/ads/sdk/AdReportRun.java b/src/main/java/com/facebook/ads/sdk/AdReportRun.java index ffc0da6c..f3fa0205 100644 --- a/src/main/java/com/facebook/ads/sdk/AdReportRun.java +++ b/src/main/java/com/facebook/ads/sdk/AdReportRun.java @@ -45,6 +45,8 @@ public class AdReportRun extends APINode { private String mAccountId = null; @SerializedName("async_percent_completion") private Long mAsyncPercentCompletion = null; + @SerializedName("async_report_url") + private String mAsyncReportUrl = null; @SerializedName("async_status") private String mAsyncStatus = null; @SerializedName("date_start") @@ -57,6 +59,8 @@ public class AdReportRun extends APINode { private String mFriendlyName = null; @SerializedName("id") private String mId = null; + @SerializedName("is_async_export") + private Long mIsAsyncExport = null; @SerializedName("is_bookmarked") private Boolean mIsBookmarked = null; @SerializedName("is_running") @@ -302,6 +306,10 @@ public Long getFieldAsyncPercentCompletion() { return mAsyncPercentCompletion; } + public String getFieldAsyncReportUrl() { + return mAsyncReportUrl; + } + public String getFieldAsyncStatus() { return mAsyncStatus; } @@ -326,6 +334,10 @@ public String getFieldId() { return mId; } + public Long getFieldIsAsyncExport() { + return mIsAsyncExport; + } + public Boolean getFieldIsBookmarked() { return mIsBookmarked; } @@ -445,6 +457,12 @@ public APINodeList getLastResponse() { "location", "marketing_messages_cost_per_delivered", "marketing_messages_cost_per_link_btn_click", + "marketing_messages_delivery_rate", + "marketing_messages_link_btn_click_rate", + "marketing_messages_media_view_rate", + "marketing_messages_phone_call_btn_click_rate", + "marketing_messages_quick_reply_btn_click_rate", + "marketing_messages_read_rate", "marketing_messages_spend", "marketing_messages_website_purchase_values", "mobile_app_purchase_roas", @@ -1189,6 +1207,48 @@ public APIRequestGetInsights requestMarketingMessagesCostPerLinkBtnClickField (b this.requestField("marketing_messages_cost_per_link_btn_click", value); return this; } + public APIRequestGetInsights requestMarketingMessagesDeliveryRateField () { + return this.requestMarketingMessagesDeliveryRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesDeliveryRateField (boolean value) { + this.requestField("marketing_messages_delivery_rate", value); + return this; + } + public APIRequestGetInsights requestMarketingMessagesLinkBtnClickRateField () { + return this.requestMarketingMessagesLinkBtnClickRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesLinkBtnClickRateField (boolean value) { + this.requestField("marketing_messages_link_btn_click_rate", value); + return this; + } + public APIRequestGetInsights requestMarketingMessagesMediaViewRateField () { + return this.requestMarketingMessagesMediaViewRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesMediaViewRateField (boolean value) { + this.requestField("marketing_messages_media_view_rate", value); + return this; + } + public APIRequestGetInsights requestMarketingMessagesPhoneCallBtnClickRateField () { + return this.requestMarketingMessagesPhoneCallBtnClickRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesPhoneCallBtnClickRateField (boolean value) { + this.requestField("marketing_messages_phone_call_btn_click_rate", value); + return this; + } + public APIRequestGetInsights requestMarketingMessagesQuickReplyBtnClickRateField () { + return this.requestMarketingMessagesQuickReplyBtnClickRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesQuickReplyBtnClickRateField (boolean value) { + this.requestField("marketing_messages_quick_reply_btn_click_rate", value); + return this; + } + public APIRequestGetInsights requestMarketingMessagesReadRateField () { + return this.requestMarketingMessagesReadRateField(true); + } + public APIRequestGetInsights requestMarketingMessagesReadRateField (boolean value) { + this.requestField("marketing_messages_read_rate", value); + return this; + } public APIRequestGetInsights requestMarketingMessagesSpendField () { return this.requestMarketingMessagesSpendField(true); } @@ -1554,12 +1614,14 @@ public AdReportRun getLastResponse() { public static final String[] FIELDS = { "account_id", "async_percent_completion", + "async_report_url", "async_status", "date_start", "date_stop", "emails", "friendly_name", "id", + "is_async_export", "is_bookmarked", "is_running", "schedule_id", @@ -1671,6 +1733,13 @@ public APIRequestGet requestAsyncPercentCompletionField (boolean value) { this.requestField("async_percent_completion", value); return this; } + public APIRequestGet requestAsyncReportUrlField () { + return this.requestAsyncReportUrlField(true); + } + public APIRequestGet requestAsyncReportUrlField (boolean value) { + this.requestField("async_report_url", value); + return this; + } public APIRequestGet requestAsyncStatusField () { return this.requestAsyncStatusField(true); } @@ -1713,6 +1782,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIsAsyncExportField () { + return this.requestIsAsyncExportField(true); + } + public APIRequestGet requestIsAsyncExportField (boolean value) { + this.requestField("is_async_export", value); + return this; + } public APIRequestGet requestIsBookmarkedField () { return this.requestIsBookmarkedField(true); } @@ -1952,6 +2028,16 @@ public static enum EnumBreakdowns { VALUE_SKAN_CONVERSION_ID("skan_conversion_id"), @SerializedName("skan_version") VALUE_SKAN_VERSION("skan_version"), + @SerializedName("sot_attribution_model_type") + VALUE_SOT_ATTRIBUTION_MODEL_TYPE("sot_attribution_model_type"), + @SerializedName("sot_attribution_window") + VALUE_SOT_ATTRIBUTION_WINDOW("sot_attribution_window"), + @SerializedName("sot_channel") + VALUE_SOT_CHANNEL("sot_channel"), + @SerializedName("sot_event_type") + VALUE_SOT_EVENT_TYPE("sot_event_type"), + @SerializedName("sot_source") + VALUE_SOT_SOURCE("sot_source"), @SerializedName("standard_event_content_type") VALUE_STANDARD_EVENT_CONTENT_TYPE("standard_event_content_type"), @SerializedName("title_asset") @@ -2116,12 +2202,14 @@ public String toString() { public AdReportRun copyFrom(AdReportRun instance) { this.mAccountId = instance.mAccountId; this.mAsyncPercentCompletion = instance.mAsyncPercentCompletion; + this.mAsyncReportUrl = instance.mAsyncReportUrl; this.mAsyncStatus = instance.mAsyncStatus; this.mDateStart = instance.mDateStart; this.mDateStop = instance.mDateStop; this.mEmails = instance.mEmails; this.mFriendlyName = instance.mFriendlyName; this.mId = instance.mId; + this.mIsAsyncExport = instance.mIsAsyncExport; this.mIsBookmarked = instance.mIsBookmarked; this.mIsRunning = instance.mIsRunning; this.mScheduleId = instance.mScheduleId; diff --git a/src/main/java/com/facebook/ads/sdk/AdRule.java b/src/main/java/com/facebook/ads/sdk/AdRule.java index 62dd6168..ad328be1 100644 --- a/src/main/java/com/facebook/ads/sdk/AdRule.java +++ b/src/main/java/com/facebook/ads/sdk/AdRule.java @@ -1260,6 +1260,8 @@ public static enum EnumUiCreationSource { VALUE_AM_SYD_RESOLUTION_FLOW_MODAL("AM_SYD_RESOLUTION_FLOW_MODAL"), @SerializedName("AM_TABLE_DELIVERY_COLUMN_POPOVER") VALUE_AM_TABLE_DELIVERY_COLUMN_POPOVER("AM_TABLE_DELIVERY_COLUMN_POPOVER"), + @SerializedName("AM_TABLE_MORE_RULES_DROPDOWN") + VALUE_AM_TABLE_MORE_RULES_DROPDOWN("AM_TABLE_MORE_RULES_DROPDOWN"), @SerializedName("AM_TABLE_TOGGLE_POPOVER") VALUE_AM_TABLE_TOGGLE_POPOVER("AM_TABLE_TOGGLE_POPOVER"), @SerializedName("AM_TOOLBAR_CREATE_RULE_DROPDOWN") diff --git a/src/main/java/com/facebook/ads/sdk/AdSet.java b/src/main/java/com/facebook/ads/sdk/AdSet.java index 03e527ab..c40bbcea 100644 --- a/src/main/java/com/facebook/ads/sdk/AdSet.java +++ b/src/main/java/com/facebook/ads/sdk/AdSet.java @@ -1642,6 +1642,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "account_id", "actor_id", + "ad_disclaimer_spec", "adlabels", "applink_treatment", "asset_feed_spec", @@ -1696,6 +1697,7 @@ public APINodeList getLastResponse() { "platform_customizations", "playable_asset_id", "portrait_customizations", + "product_data", "product_set_id", "recommender_settings", "source_instagram_media_id", @@ -1814,6 +1816,13 @@ public APIRequestGetAdCreatives requestActorIdField (boolean value) { this.requestField("actor_id", value); return this; } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField () { + return this.requestAdDisclaimerSpecField(true); + } + public APIRequestGetAdCreatives requestAdDisclaimerSpecField (boolean value) { + this.requestField("ad_disclaimer_spec", value); + return this; + } public APIRequestGetAdCreatives requestAdlabelsField () { return this.requestAdlabelsField(true); } @@ -2192,6 +2201,13 @@ public APIRequestGetAdCreatives requestPortraitCustomizationsField (boolean valu this.requestField("portrait_customizations", value); return this; } + public APIRequestGetAdCreatives requestProductDataField () { + return this.requestProductDataField(true); + } + public APIRequestGetAdCreatives requestProductDataField (boolean value) { + this.requestField("product_data", value); + return this; + } public APIRequestGetAdCreatives requestProductSetIdField () { return this.requestProductSetIdField(true); } @@ -7245,6 +7261,8 @@ public static enum EnumRegionalRegulatedCategories { VALUE_1("1"), @SerializedName("2") VALUE_2("2"), + @SerializedName("3") + VALUE_3("3"), ; private String value; diff --git a/src/main/java/com/facebook/ads/sdk/AdStudyCell.java b/src/main/java/com/facebook/ads/sdk/AdStudyCell.java index f7ad03b0..52b4cc15 100644 --- a/src/main/java/com/facebook/ads/sdk/AdStudyCell.java +++ b/src/main/java/com/facebook/ads/sdk/AdStudyCell.java @@ -342,6 +342,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -672,6 +673,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdStudyObjective.java b/src/main/java/com/facebook/ads/sdk/AdStudyObjective.java index 17b1b2cc..f54c981d 100644 --- a/src/main/java/com/facebook/ads/sdk/AdStudyObjective.java +++ b/src/main/java/com/facebook/ads/sdk/AdStudyObjective.java @@ -756,6 +756,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -1211,6 +1212,13 @@ public APIRequestGetApplications requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetApplications requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetApplications requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetApplications requestFinancialIdField () { return this.requestFinancialIdField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdsInsights.java b/src/main/java/com/facebook/ads/sdk/AdsInsights.java index 0049fbc5..30ab6e13 100644 --- a/src/main/java/com/facebook/ads/sdk/AdsInsights.java +++ b/src/main/java/com/facebook/ads/sdk/AdsInsights.java @@ -213,6 +213,18 @@ public class AdsInsights extends APINode { private String mMarketingMessagesCostPerDelivered = null; @SerializedName("marketing_messages_cost_per_link_btn_click") private String mMarketingMessagesCostPerLinkBtnClick = null; + @SerializedName("marketing_messages_delivery_rate") + private String mMarketingMessagesDeliveryRate = null; + @SerializedName("marketing_messages_link_btn_click_rate") + private String mMarketingMessagesLinkBtnClickRate = null; + @SerializedName("marketing_messages_media_view_rate") + private String mMarketingMessagesMediaViewRate = null; + @SerializedName("marketing_messages_phone_call_btn_click_rate") + private String mMarketingMessagesPhoneCallBtnClickRate = null; + @SerializedName("marketing_messages_quick_reply_btn_click_rate") + private String mMarketingMessagesQuickReplyBtnClickRate = null; + @SerializedName("marketing_messages_read_rate") + private String mMarketingMessagesReadRate = null; @SerializedName("marketing_messages_spend") private String mMarketingMessagesSpend = null; @SerializedName("marketing_messages_website_purchase_values") @@ -404,6 +416,16 @@ public class AdsInsights extends APINode { private String mSkanConversionId = null; @SerializedName("skan_version") private String mSkanVersion = null; + @SerializedName("sot_attribution_model_type") + private String mSotAttributionModelType = null; + @SerializedName("sot_attribution_window") + private String mSotAttributionWindow = null; + @SerializedName("sot_channel") + private String mSotChannel = null; + @SerializedName("sot_event_type") + private String mSotEventType = null; + @SerializedName("sot_source") + private String mSotSource = null; @SerializedName("standard_event_content_type") private String mStandardEventContentType = null; @SerializedName("title_asset") @@ -1474,6 +1496,60 @@ public AdsInsights setFieldMarketingMessagesCostPerLinkBtnClick(String value) { return this; } + public String getFieldMarketingMessagesDeliveryRate() { + return mMarketingMessagesDeliveryRate; + } + + public AdsInsights setFieldMarketingMessagesDeliveryRate(String value) { + this.mMarketingMessagesDeliveryRate = value; + return this; + } + + public String getFieldMarketingMessagesLinkBtnClickRate() { + return mMarketingMessagesLinkBtnClickRate; + } + + public AdsInsights setFieldMarketingMessagesLinkBtnClickRate(String value) { + this.mMarketingMessagesLinkBtnClickRate = value; + return this; + } + + public String getFieldMarketingMessagesMediaViewRate() { + return mMarketingMessagesMediaViewRate; + } + + public AdsInsights setFieldMarketingMessagesMediaViewRate(String value) { + this.mMarketingMessagesMediaViewRate = value; + return this; + } + + public String getFieldMarketingMessagesPhoneCallBtnClickRate() { + return mMarketingMessagesPhoneCallBtnClickRate; + } + + public AdsInsights setFieldMarketingMessagesPhoneCallBtnClickRate(String value) { + this.mMarketingMessagesPhoneCallBtnClickRate = value; + return this; + } + + public String getFieldMarketingMessagesQuickReplyBtnClickRate() { + return mMarketingMessagesQuickReplyBtnClickRate; + } + + public AdsInsights setFieldMarketingMessagesQuickReplyBtnClickRate(String value) { + this.mMarketingMessagesQuickReplyBtnClickRate = value; + return this; + } + + public String getFieldMarketingMessagesReadRate() { + return mMarketingMessagesReadRate; + } + + public AdsInsights setFieldMarketingMessagesReadRate(String value) { + this.mMarketingMessagesReadRate = value; + return this; + } + public String getFieldMarketingMessagesSpend() { return mMarketingMessagesSpend; } @@ -2259,6 +2335,26 @@ public String getFieldSkanVersion() { return mSkanVersion; } + public String getFieldSotAttributionModelType() { + return mSotAttributionModelType; + } + + public String getFieldSotAttributionWindow() { + return mSotAttributionWindow; + } + + public String getFieldSotChannel() { + return mSotChannel; + } + + public String getFieldSotEventType() { + return mSotEventType; + } + + public String getFieldSotSource() { + return mSotSource; + } + public String getFieldStandardEventContentType() { return mStandardEventContentType; } @@ -2483,6 +2579,16 @@ public static enum EnumBreakdowns { VALUE_SKAN_CONVERSION_ID("skan_conversion_id"), @SerializedName("skan_version") VALUE_SKAN_VERSION("skan_version"), + @SerializedName("sot_attribution_model_type") + VALUE_SOT_ATTRIBUTION_MODEL_TYPE("sot_attribution_model_type"), + @SerializedName("sot_attribution_window") + VALUE_SOT_ATTRIBUTION_WINDOW("sot_attribution_window"), + @SerializedName("sot_channel") + VALUE_SOT_CHANNEL("sot_channel"), + @SerializedName("sot_event_type") + VALUE_SOT_EVENT_TYPE("sot_event_type"), + @SerializedName("sot_source") + VALUE_SOT_SOURCE("sot_source"), @SerializedName("standard_event_content_type") VALUE_STANDARD_EVENT_CONTENT_TYPE("standard_event_content_type"), @SerializedName("title_asset") @@ -2731,6 +2837,12 @@ public AdsInsights copyFrom(AdsInsights instance) { this.mLocation = instance.mLocation; this.mMarketingMessagesCostPerDelivered = instance.mMarketingMessagesCostPerDelivered; this.mMarketingMessagesCostPerLinkBtnClick = instance.mMarketingMessagesCostPerLinkBtnClick; + this.mMarketingMessagesDeliveryRate = instance.mMarketingMessagesDeliveryRate; + this.mMarketingMessagesLinkBtnClickRate = instance.mMarketingMessagesLinkBtnClickRate; + this.mMarketingMessagesMediaViewRate = instance.mMarketingMessagesMediaViewRate; + this.mMarketingMessagesPhoneCallBtnClickRate = instance.mMarketingMessagesPhoneCallBtnClickRate; + this.mMarketingMessagesQuickReplyBtnClickRate = instance.mMarketingMessagesQuickReplyBtnClickRate; + this.mMarketingMessagesReadRate = instance.mMarketingMessagesReadRate; this.mMarketingMessagesSpend = instance.mMarketingMessagesSpend; this.mMarketingMessagesWebsitePurchaseValues = instance.mMarketingMessagesWebsitePurchaseValues; this.mMobileAppPurchaseRoas = instance.mMobileAppPurchaseRoas; @@ -2826,6 +2938,11 @@ public AdsInsights copyFrom(AdsInsights instance) { this.mSkanCampaignId = instance.mSkanCampaignId; this.mSkanConversionId = instance.mSkanConversionId; this.mSkanVersion = instance.mSkanVersion; + this.mSotAttributionModelType = instance.mSotAttributionModelType; + this.mSotAttributionWindow = instance.mSotAttributionWindow; + this.mSotChannel = instance.mSotChannel; + this.mSotEventType = instance.mSotEventType; + this.mSotSource = instance.mSotSource; this.mStandardEventContentType = instance.mStandardEventContentType; this.mTitleAsset = instance.mTitleAsset; this.mUserPersonaId = instance.mUserPersonaId; diff --git a/src/main/java/com/facebook/ads/sdk/AdsPixel.java b/src/main/java/com/facebook/ads/sdk/AdsPixel.java index 14f35578..7a3e3e74 100644 --- a/src/main/java/com/facebook/ads/sdk/AdsPixel.java +++ b/src/main/java/com/facebook/ads/sdk/AdsPixel.java @@ -582,6 +582,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -917,6 +918,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -2722,13 +2730,20 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "active", + "cloud_provider", + "cloud_region", + "destination_id", "endpoint", "fallback_domain", "fallback_domain_enabled", + "first_party_domain", "host_business_id", "host_external_id", "id", "instance_id", + "instance_version", + "is_sgw_instance", + "partner_name", "pixel_id", }; @@ -2829,6 +2844,27 @@ public APIRequestGetOpenBridgeConfigurations requestActiveField (boolean value) this.requestField("active", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestCloudProviderField () { + return this.requestCloudProviderField(true); + } + public APIRequestGetOpenBridgeConfigurations requestCloudProviderField (boolean value) { + this.requestField("cloud_provider", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestCloudRegionField () { + return this.requestCloudRegionField(true); + } + public APIRequestGetOpenBridgeConfigurations requestCloudRegionField (boolean value) { + this.requestField("cloud_region", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestDestinationIdField () { + return this.requestDestinationIdField(true); + } + public APIRequestGetOpenBridgeConfigurations requestDestinationIdField (boolean value) { + this.requestField("destination_id", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestEndpointField () { return this.requestEndpointField(true); } @@ -2850,6 +2886,13 @@ public APIRequestGetOpenBridgeConfigurations requestFallbackDomainEnabledField ( this.requestField("fallback_domain_enabled", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestFirstPartyDomainField () { + return this.requestFirstPartyDomainField(true); + } + public APIRequestGetOpenBridgeConfigurations requestFirstPartyDomainField (boolean value) { + this.requestField("first_party_domain", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestHostBusinessIdField () { return this.requestHostBusinessIdField(true); } @@ -2878,6 +2921,27 @@ public APIRequestGetOpenBridgeConfigurations requestInstanceIdField (boolean val this.requestField("instance_id", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestInstanceVersionField () { + return this.requestInstanceVersionField(true); + } + public APIRequestGetOpenBridgeConfigurations requestInstanceVersionField (boolean value) { + this.requestField("instance_version", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestIsSgwInstanceField () { + return this.requestIsSgwInstanceField(true); + } + public APIRequestGetOpenBridgeConfigurations requestIsSgwInstanceField (boolean value) { + this.requestField("is_sgw_instance", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestPartnerNameField () { + return this.requestPartnerNameField(true); + } + public APIRequestGetOpenBridgeConfigurations requestPartnerNameField (boolean value) { + this.requestField("partner_name", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestPixelIdField () { return this.requestPixelIdField(true); } @@ -3149,6 +3213,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -3484,6 +3549,13 @@ public APIRequestGetSharedAccounts requestExistingCustomersField (boolean value) this.requestField("existing_customers", value); return this; } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetSharedAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/AdsUserSettings.java b/src/main/java/com/facebook/ads/sdk/AdsUserSettings.java index 87d1996f..c9f5a1c9 100644 --- a/src/main/java/com/facebook/ads/sdk/AdsUserSettings.java +++ b/src/main/java/com/facebook/ads/sdk/AdsUserSettings.java @@ -79,6 +79,8 @@ public class AdsUserSettings extends APINode { private String mConnectedSourcesCatalogOptInStatus = null; @SerializedName("default_creation_mode") private String mDefaultCreationMode = null; + @SerializedName("enhance_cta_text_extraction_opt_in_status") + private String mEnhanceCtaTextExtractionOptInStatus = null; @SerializedName("export_format_default") private String mExportFormatDefault = null; @SerializedName("focus_mode_default") @@ -147,6 +149,10 @@ public class AdsUserSettings extends APINode { private String mStickySettingAfterDefaultOn = null; @SerializedName("syd_campaign_trends_metric") private String mSydCampaignTrendsMetric = null; + @SerializedName("text_optimizations_text_extraction_opt_in_status") + private String mTextOptimizationsTextExtractionOptInStatus = null; + @SerializedName("text_variations_sticky_opt_in_status") + private String mTextVariationsStickyOptInStatus = null; @SerializedName("total_coupon_syd_dismissals") private Long mTotalCouponSydDismissals = null; @SerializedName("total_coupon_upsell_dismissals") @@ -449,6 +455,10 @@ public String getFieldDefaultCreationMode() { return mDefaultCreationMode; } + public String getFieldEnhanceCtaTextExtractionOptInStatus() { + return mEnhanceCtaTextExtractionOptInStatus; + } + public String getFieldExportFormatDefault() { return mExportFormatDefault; } @@ -591,6 +601,14 @@ public String getFieldSydCampaignTrendsMetric() { return mSydCampaignTrendsMetric; } + public String getFieldTextOptimizationsTextExtractionOptInStatus() { + return mTextOptimizationsTextExtractionOptInStatus; + } + + public String getFieldTextVariationsStickyOptInStatus() { + return mTextVariationsStickyOptInStatus; + } + public Long getFieldTotalCouponSydDismissals() { return mTotalCouponSydDismissals; } @@ -650,6 +668,7 @@ public AdsUserSettings getLastResponse() { "carousel_to_video_opt_in_status", "connected_sources_catalog_opt_in_status", "default_creation_mode", + "enhance_cta_text_extraction_opt_in_status", "export_format_default", "focus_mode_default", "gen_ai_alpha_test_status", @@ -684,6 +703,8 @@ public AdsUserSettings getLastResponse() { "static_ad_product_extensions_opt_in", "sticky_setting_after_default_on", "syd_campaign_trends_metric", + "text_optimizations_text_extraction_opt_in_status", + "text_variations_sticky_opt_in_status", "total_coupon_syd_dismissals", "total_coupon_upsell_dismissals", "url_prefill_removal_timestamp", @@ -915,6 +936,13 @@ public APIRequestGet requestDefaultCreationModeField (boolean value) { this.requestField("default_creation_mode", value); return this; } + public APIRequestGet requestEnhanceCtaTextExtractionOptInStatusField () { + return this.requestEnhanceCtaTextExtractionOptInStatusField(true); + } + public APIRequestGet requestEnhanceCtaTextExtractionOptInStatusField (boolean value) { + this.requestField("enhance_cta_text_extraction_opt_in_status", value); + return this; + } public APIRequestGet requestExportFormatDefaultField () { return this.requestExportFormatDefaultField(true); } @@ -1153,6 +1181,20 @@ public APIRequestGet requestSydCampaignTrendsMetricField (boolean value) { this.requestField("syd_campaign_trends_metric", value); return this; } + public APIRequestGet requestTextOptimizationsTextExtractionOptInStatusField () { + return this.requestTextOptimizationsTextExtractionOptInStatusField(true); + } + public APIRequestGet requestTextOptimizationsTextExtractionOptInStatusField (boolean value) { + this.requestField("text_optimizations_text_extraction_opt_in_status", value); + return this; + } + public APIRequestGet requestTextVariationsStickyOptInStatusField () { + return this.requestTextVariationsStickyOptInStatusField(true); + } + public APIRequestGet requestTextVariationsStickyOptInStatusField (boolean value) { + this.requestField("text_variations_sticky_opt_in_status", value); + return this; + } public APIRequestGet requestTotalCouponSydDismissalsField () { return this.requestTotalCouponSydDismissalsField(true); } @@ -1231,6 +1273,7 @@ public AdsUserSettings copyFrom(AdsUserSettings instance) { this.mCarouselToVideoOptInStatus = instance.mCarouselToVideoOptInStatus; this.mConnectedSourcesCatalogOptInStatus = instance.mConnectedSourcesCatalogOptInStatus; this.mDefaultCreationMode = instance.mDefaultCreationMode; + this.mEnhanceCtaTextExtractionOptInStatus = instance.mEnhanceCtaTextExtractionOptInStatus; this.mExportFormatDefault = instance.mExportFormatDefault; this.mFocusModeDefault = instance.mFocusModeDefault; this.mGenAiAlphaTestStatus = instance.mGenAiAlphaTestStatus; @@ -1265,6 +1308,8 @@ public AdsUserSettings copyFrom(AdsUserSettings instance) { this.mStaticAdProductExtensionsOptIn = instance.mStaticAdProductExtensionsOptIn; this.mStickySettingAfterDefaultOn = instance.mStickySettingAfterDefaultOn; this.mSydCampaignTrendsMetric = instance.mSydCampaignTrendsMetric; + this.mTextOptimizationsTextExtractionOptInStatus = instance.mTextOptimizationsTextExtractionOptInStatus; + this.mTextVariationsStickyOptInStatus = instance.mTextVariationsStickyOptInStatus; this.mTotalCouponSydDismissals = instance.mTotalCouponSydDismissals; this.mTotalCouponUpsellDismissals = instance.mTotalCouponUpsellDismissals; this.mUrlPrefillRemovalTimestamp = instance.mUrlPrefillRemovalTimestamp; diff --git a/src/main/java/com/facebook/ads/sdk/AdsValueAdjustmentRuleCollection.java b/src/main/java/com/facebook/ads/sdk/AdsValueAdjustmentRuleCollection.java index 45c3640c..bf8b8966 100644 --- a/src/main/java/com/facebook/ads/sdk/AdsValueAdjustmentRuleCollection.java +++ b/src/main/java/com/facebook/ads/sdk/AdsValueAdjustmentRuleCollection.java @@ -43,6 +43,8 @@ public class AdsValueAdjustmentRuleCollection extends APINode { @SerializedName("id") private String mId = null; + @SerializedName("is_default_setting") + private Boolean mIsDefaultSetting = null; @SerializedName("name") private String mName = null; protected static Gson gson = null; @@ -267,6 +269,10 @@ public String getFieldId() { return mId; } + public Boolean getFieldIsDefaultSetting() { + return mIsDefaultSetting; + } + public String getFieldName() { return mName; } @@ -390,6 +396,7 @@ public AdsValueAdjustmentRuleCollection getLastResponse() { public static final String[] FIELDS = { "id", + "is_default_setting", "name", }; @@ -490,6 +497,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIsDefaultSettingField () { + return this.requestIsDefaultSettingField(true); + } + public APIRequestGet requestIsDefaultSettingField (boolean value) { + this.requestField("is_default_setting", value); + return this; + } public APIRequestGet requestNameField () { return this.requestNameField(true); } @@ -515,6 +529,7 @@ public APIRequestGet requestNameField (boolean value) { public AdsValueAdjustmentRuleCollection copyFrom(AdsValueAdjustmentRuleCollection instance) { this.mId = instance.mId; + this.mIsDefaultSetting = instance.mIsDefaultSetting; this.mName = instance.mName; this.context = instance.context; this.rawValue = instance.rawValue; diff --git a/src/main/java/com/facebook/ads/sdk/AnalyticsFunnelQueryResult.java b/src/main/java/com/facebook/ads/sdk/AnalyticsFunnelQueryResult.java index 1b37abd3..a7a257b3 100644 --- a/src/main/java/com/facebook/ads/sdk/AnalyticsFunnelQueryResult.java +++ b/src/main/java/com/facebook/ads/sdk/AnalyticsFunnelQueryResult.java @@ -41,10 +41,6 @@ * */ public class AnalyticsFunnelQueryResult extends APINode { - @SerializedName("data") - private Object mData = null; - @SerializedName("error") - private Object mError = null; @SerializedName("query_id") private String mQueryId = null; @SerializedName("status") @@ -200,24 +196,6 @@ public String toString() { } - public Object getFieldData() { - return mData; - } - - public AnalyticsFunnelQueryResult setFieldData(Object value) { - this.mData = value; - return this; - } - - public Object getFieldError() { - return mError; - } - - public AnalyticsFunnelQueryResult setFieldError(Object value) { - this.mError = value; - return this; - } - public String getFieldQueryId() { return mQueryId; } @@ -253,8 +231,6 @@ public AnalyticsFunnelQueryResult setFieldStatus(String value) { } public AnalyticsFunnelQueryResult copyFrom(AnalyticsFunnelQueryResult instance) { - this.mData = instance.mData; - this.mError = instance.mError; this.mQueryId = instance.mQueryId; this.mStatus = instance.mStatus; this.context = instance.context; diff --git a/src/main/java/com/facebook/ads/sdk/AnalyticsQueryResult.java b/src/main/java/com/facebook/ads/sdk/AnalyticsQueryResult.java index d7a56f31..f0576140 100644 --- a/src/main/java/com/facebook/ads/sdk/AnalyticsQueryResult.java +++ b/src/main/java/com/facebook/ads/sdk/AnalyticsQueryResult.java @@ -41,12 +41,6 @@ * */ public class AnalyticsQueryResult extends APINode { - @SerializedName("columns") - private Object mColumns = null; - @SerializedName("datapoints") - private List mDatapoints = null; - @SerializedName("error") - private Object mError = null; @SerializedName("query_id") private String mQueryId = null; @SerializedName("status") @@ -202,33 +196,6 @@ public String toString() { } - public Object getFieldColumns() { - return mColumns; - } - - public AnalyticsQueryResult setFieldColumns(Object value) { - this.mColumns = value; - return this; - } - - public List getFieldDatapoints() { - return mDatapoints; - } - - public AnalyticsQueryResult setFieldDatapoints(List value) { - this.mDatapoints = value; - return this; - } - - public Object getFieldError() { - return mError; - } - - public AnalyticsQueryResult setFieldError(Object value) { - this.mError = value; - return this; - } - public String getFieldQueryId() { return mQueryId; } @@ -264,9 +231,6 @@ public AnalyticsQueryResult setFieldStatus(String value) { } public AnalyticsQueryResult copyFrom(AnalyticsQueryResult instance) { - this.mColumns = instance.mColumns; - this.mDatapoints = instance.mDatapoints; - this.mError = instance.mError; this.mQueryId = instance.mQueryId; this.mStatus = instance.mStatus; this.context = instance.context; diff --git a/src/main/java/com/facebook/ads/sdk/Application.java b/src/main/java/com/facebook/ads/sdk/Application.java index bb70bb81..cf262db8 100644 --- a/src/main/java/com/facebook/ads/sdk/Application.java +++ b/src/main/java/com/facebook/ads/sdk/Application.java @@ -127,6 +127,8 @@ public class Application extends APINode { private String mDefaultShareMode = null; @SerializedName("description") private String mDescription = null; + @SerializedName("enigma_config") + private Object mEnigmaConfig = null; @SerializedName("financial_id") private String mFinancialId = null; @SerializedName("gdpv4_chrome_custom_tabs_enabled") @@ -876,6 +878,10 @@ public String getFieldDescription() { return mDescription; } + public Object getFieldEnigmaConfig() { + return mEnigmaConfig; + } + public String getFieldFinancialId() { return mFinancialId; } @@ -2258,6 +2264,7 @@ public APINodeList getLastResponse() { "metrics", "ordering_column", "ordering_type", + "should_include_until", "since", "until", }; @@ -2385,6 +2392,15 @@ public APIRequestGetAdNetworkAnalytics setOrderingType (String orderingType) { return this; } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (Boolean shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (String shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setSince (String since) { this.setParam("since", since); return this; @@ -2654,7 +2670,6 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "data", - "error", "omitted_results", "query_id", "results", @@ -2767,13 +2782,6 @@ public APIRequestGetAdNetworkAnalyticsResults requestDataField (boolean value) { this.requestField("data", value); return this; } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField () { - return this.requestErrorField(true); - } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField (boolean value) { - this.requestField("error", value); - return this; - } public APIRequestGetAdNetworkAnalyticsResults requestOmittedResultsField () { return this.requestOmittedResultsField(true); } @@ -5094,6 +5102,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -5429,6 +5438,13 @@ public APIRequestGetAuthorizedAdAccounts requestExistingCustomersField (boolean this.requestField("existing_customers", value); return this; } + public APIRequestGetAuthorizedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAuthorizedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAuthorizedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -10128,6 +10144,7 @@ public Application getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -10588,6 +10605,13 @@ public APIRequestGet requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGet requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGet requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGet requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -11039,7 +11063,6 @@ public Application getLastResponse() { "app_type", "auth_dialog_headline", "auth_dialog_perms_explanation", - "auth_referral_default_activity_privacy", "auth_referral_enabled", "auth_referral_extended_perms", "auth_referral_friend_perms", @@ -11173,11 +11196,6 @@ public APIRequestUpdate setAuthDialogPermsExplanation (String authDialogPermsExp return this; } - public APIRequestUpdate setAuthReferralDefaultActivityPrivacy (String authReferralDefaultActivityPrivacy) { - this.setParam("auth_referral_default_activity_privacy", authReferralDefaultActivityPrivacy); - return this; - } - public APIRequestUpdate setAuthReferralEnabled (Boolean authReferralEnabled) { this.setParam("auth_referral_enabled", authReferralEnabled); return this; @@ -11753,6 +11771,7 @@ public Application copyFrom(Application instance) { this.mDeauthCallbackUrl = instance.mDeauthCallbackUrl; this.mDefaultShareMode = instance.mDefaultShareMode; this.mDescription = instance.mDescription; + this.mEnigmaConfig = instance.mEnigmaConfig; this.mFinancialId = instance.mFinancialId; this.mGdpv4ChromeCustomTabsEnabled = instance.mGdpv4ChromeCustomTabsEnabled; this.mGdpv4Enabled = instance.mGdpv4Enabled; diff --git a/src/main/java/com/facebook/ads/sdk/Business.java b/src/main/java/com/facebook/ads/sdk/Business.java index 07262503..3c913c30 100644 --- a/src/main/java/com/facebook/ads/sdk/Business.java +++ b/src/main/java/com/facebook/ads/sdk/Business.java @@ -80,7 +80,7 @@ public class Business extends APINode { @SerializedName("user_access_expire_time") private String mUserAccessExpireTime = null; @SerializedName("verification_status") - private String mVerificationStatus = null; + private EnumVerificationStatus mVerificationStatus = null; @SerializedName("vertical") private String mVertical = null; @SerializedName("vertical_id") @@ -682,6 +682,10 @@ public APIRequestGetSelfCertifiedWhatsAppBusinessSubmissions getSelfCertifiedWha return new APIRequestGetSelfCertifiedWhatsAppBusinessSubmissions(this.getPrefixedId().toString(), context); } + public APIRequestCreateSelfCertifyWhatsAppBusiness createSelfCertifyWhatsAppBusiness() { + return new APIRequestCreateSelfCertifyWhatsAppBusiness(this.getPrefixedId().toString(), context); + } + public APIRequestCreateSetupManagedPartnerAdAccount createSetupManagedPartnerAdAccount() { return new APIRequestCreateSetupManagedPartnerAdAccount(this.getPrefixedId().toString(), context); } @@ -802,7 +806,7 @@ public String getFieldUserAccessExpireTime() { return mUserAccessExpireTime; } - public String getFieldVerificationStatus() { + public EnumVerificationStatus getFieldVerificationStatus() { return mVerificationStatus; } @@ -2276,6 +2280,7 @@ public APINodeList getLastResponse() { "metrics", "ordering_column", "ordering_type", + "should_include_until", "since", "until", }; @@ -2403,6 +2408,15 @@ public APIRequestGetAdNetworkAnalytics setOrderingType (String orderingType) { return this; } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (Boolean shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setShouldIncludeUntil (String shouldIncludeUntil) { + this.setParam("should_include_until", shouldIncludeUntil); + return this; + } + public APIRequestGetAdNetworkAnalytics setSince (String since) { this.setParam("since", since); return this; @@ -2672,7 +2686,6 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "data", - "error", "omitted_results", "query_id", "results", @@ -2785,13 +2798,6 @@ public APIRequestGetAdNetworkAnalyticsResults requestDataField (boolean value) { this.requestField("data", value); return this; } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField () { - return this.requestErrorField(true); - } - public APIRequestGetAdNetworkAnalyticsResults requestErrorField (boolean value) { - this.requestField("error", value); - return this; - } public APIRequestGetAdNetworkAnalyticsResults requestOmittedResultsField () { return this.requestOmittedResultsField(true); } @@ -5537,6 +5543,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -5872,6 +5879,13 @@ public APIRequestGetClientAdAccounts requestExistingCustomersField (boolean valu this.requestField("existing_customers", value); return this; } + public APIRequestGetClientAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetClientAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetClientAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -6222,6 +6236,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -6677,6 +6692,13 @@ public APIRequestGetClientApps requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetClientApps requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetClientApps requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetClientApps requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -13289,6 +13311,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -13416,6 +13439,13 @@ public APIRequestGetInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -13484,6 +13514,7 @@ public APINodeList getLastResponse() { "follows_count", "id", "ig_id", + "legacy_instagram_user_id", "media_count", "mentioned_comment", "mentioned_media", @@ -13628,6 +13659,13 @@ public APIRequestGetInstagramBusinessAccounts requestIgIdField (boolean value) { this.requestField("ig_id", value); return this; } + public APIRequestGetInstagramBusinessAccounts requestLegacyInstagramUserIdField () { + return this.requestLegacyInstagramUserIdField(true); + } + public APIRequestGetInstagramBusinessAccounts requestLegacyInstagramUserIdField (boolean value) { + this.requestField("legacy_instagram_user_id", value); + return this; + } public APIRequestGetInstagramBusinessAccounts requestMediaCountField () { return this.requestMediaCountField(true); } @@ -14754,13 +14792,20 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "active", + "cloud_provider", + "cloud_region", + "destination_id", "endpoint", "fallback_domain", "fallback_domain_enabled", + "first_party_domain", "host_business_id", "host_external_id", "id", "instance_id", + "instance_version", + "is_sgw_instance", + "partner_name", "pixel_id", }; @@ -14861,6 +14906,27 @@ public APIRequestGetOpenBridgeConfigurations requestActiveField (boolean value) this.requestField("active", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestCloudProviderField () { + return this.requestCloudProviderField(true); + } + public APIRequestGetOpenBridgeConfigurations requestCloudProviderField (boolean value) { + this.requestField("cloud_provider", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestCloudRegionField () { + return this.requestCloudRegionField(true); + } + public APIRequestGetOpenBridgeConfigurations requestCloudRegionField (boolean value) { + this.requestField("cloud_region", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestDestinationIdField () { + return this.requestDestinationIdField(true); + } + public APIRequestGetOpenBridgeConfigurations requestDestinationIdField (boolean value) { + this.requestField("destination_id", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestEndpointField () { return this.requestEndpointField(true); } @@ -14882,6 +14948,13 @@ public APIRequestGetOpenBridgeConfigurations requestFallbackDomainEnabledField ( this.requestField("fallback_domain_enabled", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestFirstPartyDomainField () { + return this.requestFirstPartyDomainField(true); + } + public APIRequestGetOpenBridgeConfigurations requestFirstPartyDomainField (boolean value) { + this.requestField("first_party_domain", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestHostBusinessIdField () { return this.requestHostBusinessIdField(true); } @@ -14910,6 +14983,27 @@ public APIRequestGetOpenBridgeConfigurations requestInstanceIdField (boolean val this.requestField("instance_id", value); return this; } + public APIRequestGetOpenBridgeConfigurations requestInstanceVersionField () { + return this.requestInstanceVersionField(true); + } + public APIRequestGetOpenBridgeConfigurations requestInstanceVersionField (boolean value) { + this.requestField("instance_version", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestIsSgwInstanceField () { + return this.requestIsSgwInstanceField(true); + } + public APIRequestGetOpenBridgeConfigurations requestIsSgwInstanceField (boolean value) { + this.requestField("is_sgw_instance", value); + return this; + } + public APIRequestGetOpenBridgeConfigurations requestPartnerNameField () { + return this.requestPartnerNameField(true); + } + public APIRequestGetOpenBridgeConfigurations requestPartnerNameField (boolean value) { + this.requestField("partner_name", value); + return this; + } public APIRequestGetOpenBridgeConfigurations requestPixelIdField () { return this.requestPixelIdField(true); } @@ -14928,12 +15022,19 @@ public OpenBridgeConfiguration getLastResponse() { } public static final String[] PARAMS = { "active", + "cloud_provider", + "cloud_region", + "destination_id", "endpoint", "fallback_domain", "fallback_domain_enabled", + "first_party_domain", "host_business_id", "host_external_id", "instance_id", + "instance_version", + "is_sgw_instance", + "partner_name", "pixel_id", }; @@ -15003,6 +15104,21 @@ public APIRequestCreateOpenBridgeConfiguration setActive (String active) { return this; } + public APIRequestCreateOpenBridgeConfiguration setCloudProvider (String cloudProvider) { + this.setParam("cloud_provider", cloudProvider); + return this; + } + + public APIRequestCreateOpenBridgeConfiguration setCloudRegion (String cloudRegion) { + this.setParam("cloud_region", cloudRegion); + return this; + } + + public APIRequestCreateOpenBridgeConfiguration setDestinationId (String destinationId) { + this.setParam("destination_id", destinationId); + return this; + } + public APIRequestCreateOpenBridgeConfiguration setEndpoint (String endpoint) { this.setParam("endpoint", endpoint); return this; @@ -15022,6 +15138,11 @@ public APIRequestCreateOpenBridgeConfiguration setFallbackDomainEnabled (String return this; } + public APIRequestCreateOpenBridgeConfiguration setFirstPartyDomain (String firstPartyDomain) { + this.setParam("first_party_domain", firstPartyDomain); + return this; + } + public APIRequestCreateOpenBridgeConfiguration setHostBusinessId (Long hostBusinessId) { this.setParam("host_business_id", hostBusinessId); return this; @@ -15041,6 +15162,25 @@ public APIRequestCreateOpenBridgeConfiguration setInstanceId (String instanceId) return this; } + public APIRequestCreateOpenBridgeConfiguration setInstanceVersion (String instanceVersion) { + this.setParam("instance_version", instanceVersion); + return this; + } + + public APIRequestCreateOpenBridgeConfiguration setIsSgwInstance (Boolean isSgwInstance) { + this.setParam("is_sgw_instance", isSgwInstance); + return this; + } + public APIRequestCreateOpenBridgeConfiguration setIsSgwInstance (String isSgwInstance) { + this.setParam("is_sgw_instance", isSgwInstance); + return this; + } + + public APIRequestCreateOpenBridgeConfiguration setPartnerName (String partnerName) { + this.setParam("partner_name", partnerName); + return this; + } + public APIRequestCreateOpenBridgeConfiguration setPixelId (Long pixelId) { this.setParam("pixel_id", pixelId); return this; @@ -15128,6 +15268,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -15463,6 +15604,13 @@ public APIRequestGetOwnedAdAccounts requestExistingCustomersField (boolean value this.requestField("existing_customers", value); return this; } + public APIRequestGetOwnedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetOwnedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetOwnedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -15924,6 +16072,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -16379,6 +16528,13 @@ public APIRequestGetOwnedApps requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetOwnedApps requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetOwnedApps requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetOwnedApps requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -17544,6 +17700,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -17671,6 +17828,13 @@ public APIRequestGetOwnedInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetOwnedInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetOwnedInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetOwnedInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -22919,6 +23083,189 @@ public APIRequestGetSelfCertifiedWhatsAppBusinessSubmissions requestVerification } } + public static class APIRequestCreateSelfCertifyWhatsAppBusiness extends APIRequest { + + Business lastResponse = null; + @Override + public Business getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "average_monthly_revenue_spend_with_partner", + "business_documents", + "business_vertical", + "end_business_address", + "end_business_id", + "end_business_legal_name", + "end_business_trade_names", + "end_business_website", + "num_billing_cycles_with_partner", + }; + + public static final String[] FIELDS = { + }; + + @Override + public Business parseResponse(String response, String header) throws APIException { + return Business.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public Business execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public Business execute(Map extraParams) throws APIException { + ResponseWrapper rw = executeInternal(extraParams); + lastResponse = parseResponse(rw.getBody(), rw.getHeader()); + return lastResponse; + } + + public ListenableFuture executeAsync() throws APIException { + return executeAsync(new HashMap()); + }; + + public ListenableFuture executeAsync(Map extraParams) throws APIException { + return Futures.transform( + executeAsyncInternal(extraParams), + new Function() { + public Business apply(ResponseWrapper result) { + try { + return APIRequestCreateSelfCertifyWhatsAppBusiness.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateSelfCertifyWhatsAppBusiness(String nodeId, APIContext context) { + super(context, nodeId, "/self_certify_whatsapp_business", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateSelfCertifyWhatsAppBusiness setAverageMonthlyRevenueSpendWithPartner (Map averageMonthlyRevenueSpendWithPartner) { + this.setParam("average_monthly_revenue_spend_with_partner", averageMonthlyRevenueSpendWithPartner); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setAverageMonthlyRevenueSpendWithPartner (String averageMonthlyRevenueSpendWithPartner) { + this.setParam("average_monthly_revenue_spend_with_partner", averageMonthlyRevenueSpendWithPartner); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setBusinessDocuments (List businessDocuments) { + this.setParam("business_documents", businessDocuments); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setBusinessDocuments (String businessDocuments) { + this.setParam("business_documents", businessDocuments); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setBusinessVertical (Business.EnumBusinessVertical businessVertical) { + this.setParam("business_vertical", businessVertical); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setBusinessVertical (String businessVertical) { + this.setParam("business_vertical", businessVertical); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessAddress (Map endBusinessAddress) { + this.setParam("end_business_address", endBusinessAddress); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessAddress (String endBusinessAddress) { + this.setParam("end_business_address", endBusinessAddress); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessId (String endBusinessId) { + this.setParam("end_business_id", endBusinessId); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessLegalName (String endBusinessLegalName) { + this.setParam("end_business_legal_name", endBusinessLegalName); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessTradeNames (List endBusinessTradeNames) { + this.setParam("end_business_trade_names", endBusinessTradeNames); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessTradeNames (String endBusinessTradeNames) { + this.setParam("end_business_trade_names", endBusinessTradeNames); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setEndBusinessWebsite (String endBusinessWebsite) { + this.setParam("end_business_website", endBusinessWebsite); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness setNumBillingCyclesWithPartner (Long numBillingCyclesWithPartner) { + this.setParam("num_billing_cycles_with_partner", numBillingCyclesWithPartner); + return this; + } + public APIRequestCreateSelfCertifyWhatsAppBusiness setNumBillingCyclesWithPartner (String numBillingCyclesWithPartner) { + this.setParam("num_billing_cycles_with_partner", numBillingCyclesWithPartner); + return this; + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateSelfCertifyWhatsAppBusiness requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateSelfCertifyWhatsAppBusiness requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestCreateSetupManagedPartnerAdAccount extends APIRequest { Business lastResponse = null; @@ -23942,7 +24289,6 @@ public AdVideo getLastResponse() { "start_offset", "swap_mode", "text_format_metadata", - "throwback_camera_roll_media", "thumb", "time_since_original_post", "title", @@ -24393,11 +24739,6 @@ public APIRequestCreateVideo setTextFormatMetadata (String textFormatMetadata) { return this; } - public APIRequestCreateVideo setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateVideo setThumb (File thumb) { this.setParam("thumb", thumb); return this; @@ -24951,6 +25292,41 @@ public APIRequestUpdate requestField (String field, boolean value) { } + public static enum EnumVerificationStatus { + @SerializedName("expired") + VALUE_EXPIRED("expired"), + @SerializedName("failed") + VALUE_FAILED("failed"), + @SerializedName("ineligible") + VALUE_INELIGIBLE("ineligible"), + @SerializedName("not_verified") + VALUE_NOT_VERIFIED("not_verified"), + @SerializedName("pending") + VALUE_PENDING("pending"), + @SerializedName("pending_need_more_info") + VALUE_PENDING_NEED_MORE_INFO("pending_need_more_info"), + @SerializedName("pending_submission") + VALUE_PENDING_SUBMISSION("pending_submission"), + @SerializedName("rejected") + VALUE_REJECTED("rejected"), + @SerializedName("revoked") + VALUE_REVOKED("revoked"), + @SerializedName("verified") + VALUE_VERIFIED("verified"), + ; + + private String value; + + private EnumVerificationStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + public static enum EnumTwoFactorType { @SerializedName("admin_required") VALUE_ADMIN_REQUIRED("admin_required"), @@ -26163,6 +26539,79 @@ public String toString() { } } + public static enum EnumBusinessVertical { + @SerializedName("ADULT_PRODUCTS_AND_SERVICES") + VALUE_ADULT_PRODUCTS_AND_SERVICES("ADULT_PRODUCTS_AND_SERVICES"), + @SerializedName("ALCOHOL_AND_TOBACCO") + VALUE_ALCOHOL_AND_TOBACCO("ALCOHOL_AND_TOBACCO"), + @SerializedName("AUTOMOTIVE_DEALERS") + VALUE_AUTOMOTIVE_DEALERS("AUTOMOTIVE_DEALERS"), + @SerializedName("BODY_PARTS_FLUIDS") + VALUE_BODY_PARTS_FLUIDS("BODY_PARTS_FLUIDS"), + @SerializedName("BUSINESS_AND_UTILITY") + VALUE_BUSINESS_AND_UTILITY("BUSINESS_AND_UTILITY"), + @SerializedName("CONTENT_AND_APPS") + VALUE_CONTENT_AND_APPS("CONTENT_AND_APPS"), + @SerializedName("CREATORS_AND_CELEBRITIES") + VALUE_CREATORS_AND_CELEBRITIES("CREATORS_AND_CELEBRITIES"), + @SerializedName("DATING") + VALUE_DATING("DATING"), + @SerializedName("DRUGS") + VALUE_DRUGS("DRUGS"), + @SerializedName("ENDANGERED_SPECIES") + VALUE_ENDANGERED_SPECIES("ENDANGERED_SPECIES"), + @SerializedName("FIREARMS") + VALUE_FIREARMS("FIREARMS"), + @SerializedName("FRAUDULENT_MISLEADING_OFFENSIVE") + VALUE_FRAUDULENT_MISLEADING_OFFENSIVE("FRAUDULENT_MISLEADING_OFFENSIVE"), + @SerializedName("GAMBLING") + VALUE_GAMBLING("GAMBLING"), + @SerializedName("GROCERY_AND_CONVENIENCE_STORE") + VALUE_GROCERY_AND_CONVENIENCE_STORE("GROCERY_AND_CONVENIENCE_STORE"), + @SerializedName("HAZARDOUS_GOODS_AND_MATERIALS") + VALUE_HAZARDOUS_GOODS_AND_MATERIALS("HAZARDOUS_GOODS_AND_MATERIALS"), + @SerializedName("HOME") + VALUE_HOME("HOME"), + @SerializedName("HOME_AND_AUTO_MANUFACTURING") + VALUE_HOME_AND_AUTO_MANUFACTURING("HOME_AND_AUTO_MANUFACTURING"), + @SerializedName("LIFESTYLE") + VALUE_LIFESTYLE("LIFESTYLE"), + @SerializedName("LIVE_NON_ENDANGERED_SPECIES") + VALUE_LIVE_NON_ENDANGERED_SPECIES("LIVE_NON_ENDANGERED_SPECIES"), + @SerializedName("LOANS_DEBT_COLLECTION_BAIL_BONDS") + VALUE_LOANS_DEBT_COLLECTION_BAIL_BONDS("LOANS_DEBT_COLLECTION_BAIL_BONDS"), + @SerializedName("LOCAL_EVENTS") + VALUE_LOCAL_EVENTS("LOCAL_EVENTS"), + @SerializedName("MEDICAL_HEALTHCARE") + VALUE_MEDICAL_HEALTHCARE("MEDICAL_HEALTHCARE"), + @SerializedName("MULTILEVEL_MARKETING") + VALUE_MULTILEVEL_MARKETING("MULTILEVEL_MARKETING"), + @SerializedName("NON_PROFIT_AND_RELIGIOUS_ORGS") + VALUE_NON_PROFIT_AND_RELIGIOUS_ORGS("NON_PROFIT_AND_RELIGIOUS_ORGS"), + @SerializedName("PROFESSIONAL") + VALUE_PROFESSIONAL("PROFESSIONAL"), + @SerializedName("REAL_VIRTUAL_FAKE_CURRENCY") + VALUE_REAL_VIRTUAL_FAKE_CURRENCY("REAL_VIRTUAL_FAKE_CURRENCY"), + @SerializedName("RESTAURANTS") + VALUE_RESTAURANTS("RESTAURANTS"), + @SerializedName("RETAIL") + VALUE_RETAIL("RETAIL"), + @SerializedName("TRANSPORTATION_AND_ACCOMMODATION") + VALUE_TRANSPORTATION_AND_ACCOMMODATION("TRANSPORTATION_AND_ACCOMMODATION"), + ; + + private String value; + + private EnumBusinessVertical(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + public static enum EnumSubverticalV2 { @SerializedName("ACCOUNTING_AND_TAX") VALUE_ACCOUNTING_AND_TAX("ACCOUNTING_AND_TAX"), diff --git a/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java b/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java index ab5ad1c9..4803e8d9 100644 --- a/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java +++ b/src/main/java/com/facebook/ads/sdk/BusinessAssetGroup.java @@ -941,6 +941,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -1271,6 +1272,13 @@ public APIRequestGetContainedAdAccounts requestExistingCustomersField (boolean v this.requestField("existing_customers", value); return this; } + public APIRequestGetContainedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetContainedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetContainedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -1843,6 +1851,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -2298,6 +2307,13 @@ public APIRequestGetContainedApplications requestDescriptionField (boolean value this.requestField("description", value); return this; } + public APIRequestGetContainedApplications requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetContainedApplications requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetContainedApplications requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -3450,6 +3466,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -3577,6 +3594,13 @@ public APIRequestGetContainedInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetContainedInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetContainedInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetContainedInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/BusinessUser.java b/src/main/java/com/facebook/ads/sdk/BusinessUser.java index 03cc3a03..a795c23b 100644 --- a/src/main/java/com/facebook/ads/sdk/BusinessUser.java +++ b/src/main/java/com/facebook/ads/sdk/BusinessUser.java @@ -410,6 +410,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -740,6 +741,13 @@ public APIRequestGetAssignedAdAccounts requestExistingCustomersField (boolean va this.requestField("existing_customers", value); return this; } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAssignedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java b/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java index 462691a8..9a86b177 100644 --- a/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java +++ b/src/main/java/com/facebook/ads/sdk/CPASBusinessSetupConfig.java @@ -333,6 +333,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -663,6 +664,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CatalogAdvertiserInsight.java b/src/main/java/com/facebook/ads/sdk/CatalogAdvertiserInsight.java new file mode 100644 index 00000000..1c2e5176 --- /dev/null +++ b/src/main/java/com/facebook/ads/sdk/CatalogAdvertiserInsight.java @@ -0,0 +1,248 @@ +/* + * 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 CatalogAdvertiserInsight extends APINode { + @SerializedName("category") + private String mCategory = null; + @SerializedName("country") + private String mCountry = null; + protected static Gson gson = null; + + public CatalogAdvertiserInsight() { + } + + public String getId() { + return null; + } + public static CatalogAdvertiserInsight loadJSON(String json, APIContext context, String header) { + CatalogAdvertiserInsight catalogAdvertiserInsight = getGson().fromJson(json, CatalogAdvertiserInsight.class); + if (context.isDebug()) { + JsonParser parser = new JsonParser(); + JsonElement o1 = parser.parse(json); + JsonElement o2 = parser.parse(catalogAdvertiserInsight.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); + } + } + catalogAdvertiserInsight.context = context; + catalogAdvertiserInsight.rawValue = json; + catalogAdvertiserInsight.header = header; + return catalogAdvertiserInsight; + } + + public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { + APINodeList catalogAdvertiserInsights = 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++) { + catalogAdvertiserInsights.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); + }; + return catalogAdvertiserInsights; + } 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; + catalogAdvertiserInsights.setCursors(before, after); + } + String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; + String next = paging.has("next") ? paging.get("next").getAsString() : null; + catalogAdvertiserInsights.setPaging(previous, next); + if (context.hasAppSecret()) { + catalogAdvertiserInsights.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++) { + catalogAdvertiserInsights.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()) { + catalogAdvertiserInsights.add(loadJSON(entry.getValue().toString(), context, header)); + } + break; + } + } + if (!isRedownload) { + catalogAdvertiserInsights.add(loadJSON(obj.toString(), context, header)); + } + } + return catalogAdvertiserInsights; + } 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()) { + catalogAdvertiserInsights.add(loadJSON(entry.getValue().toString(), context, header)); + } + return catalogAdvertiserInsights; + } 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) + ) { + catalogAdvertiserInsights.add(loadJSON(value.toString(), context, header)); + } else { + isIdIndexedArray = false; + break; + } + } + if (isIdIndexedArray) { + return catalogAdvertiserInsights; + } + + // Sixth, check if it's pure JsonObject + catalogAdvertiserInsights.clear(); + catalogAdvertiserInsights.add(loadJSON(json, context, header)); + return catalogAdvertiserInsights; + } + } + } 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 String getFieldCategory() { + return mCategory; + } + + public CatalogAdvertiserInsight setFieldCategory(String value) { + this.mCategory = value; + return this; + } + + public String getFieldCountry() { + return mCountry; + } + + public CatalogAdvertiserInsight setFieldCountry(String value) { + this.mCountry = 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 CatalogAdvertiserInsight copyFrom(CatalogAdvertiserInsight instance) { + this.mCategory = instance.mCategory; + this.mCountry = instance.mCountry; + 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 CatalogAdvertiserInsight.parseResponse(response, context, request, header); + } + }; + } +} diff --git a/src/main/java/com/facebook/ads/sdk/CatalogWebsiteOnboardingSettings.java b/src/main/java/com/facebook/ads/sdk/CatalogWebsiteOnboardingSettings.java index 61565540..aaae8a30 100644 --- a/src/main/java/com/facebook/ads/sdk/CatalogWebsiteOnboardingSettings.java +++ b/src/main/java/com/facebook/ads/sdk/CatalogWebsiteOnboardingSettings.java @@ -43,6 +43,8 @@ public class CatalogWebsiteOnboardingSettings extends APINode { @SerializedName("id") private String mId = null; + @SerializedName("quality_band") + private String mQualityBand = null; @SerializedName("status") private String mStatus = null; protected static Gson gson = null; @@ -263,6 +265,10 @@ public String getFieldId() { return mId; } + public String getFieldQualityBand() { + return mQualityBand; + } + public String getFieldStatus() { return mStatus; } @@ -281,6 +287,7 @@ public CatalogWebsiteOnboardingSettings getLastResponse() { public static final String[] FIELDS = { "id", + "quality_band", "status", }; @@ -381,6 +388,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestQualityBandField () { + return this.requestQualityBandField(true); + } + public APIRequestGet requestQualityBandField (boolean value) { + this.requestField("quality_band", value); + return this; + } public APIRequestGet requestStatusField () { return this.requestStatusField(true); } @@ -406,6 +420,7 @@ public APIRequestGet requestStatusField (boolean value) { public CatalogWebsiteOnboardingSettings copyFrom(CatalogWebsiteOnboardingSettings instance) { this.mId = instance.mId; + this.mQualityBand = instance.mQualityBand; this.mStatus = instance.mStatus; this.context = instance.context; this.rawValue = instance.rawValue; diff --git a/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java b/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java index f011d25d..fb71d2a5 100644 --- a/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java +++ b/src/main/java/com/facebook/ads/sdk/CommerceMerchantSettings.java @@ -1220,6 +1220,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -1675,6 +1676,13 @@ public APIRequestGetOrderManagementApps requestDescriptionField (boolean value) this.requestField("description", value); return this; } + public APIRequestGetOrderManagementApps requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetOrderManagementApps requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetOrderManagementApps requestFinancialIdField () { return this.requestFinancialIdField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CommerceOrder.java b/src/main/java/com/facebook/ads/sdk/CommerceOrder.java index 7d342718..a0a918ee 100644 --- a/src/main/java/com/facebook/ads/sdk/CommerceOrder.java +++ b/src/main/java/com/facebook/ads/sdk/CommerceOrder.java @@ -340,10 +340,6 @@ 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); } @@ -2280,157 +2276,6 @@ 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/ContentBlockList.java b/src/main/java/com/facebook/ads/sdk/ContentBlockList.java index 9e9eb5cd..d1606971 100644 --- a/src/main/java/com/facebook/ads/sdk/ContentBlockList.java +++ b/src/main/java/com/facebook/ads/sdk/ContentBlockList.java @@ -329,6 +329,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -659,6 +660,13 @@ public APIRequestGetAppliedAdAccounts requestExistingCustomersField (boolean val this.requestField("existing_customers", value); return this; } + public APIRequestGetAppliedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAppliedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAppliedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -1079,6 +1087,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -1237,6 +1246,13 @@ public APIRequestGetInstagramContent requestIsSharedToFeedField (boolean value) this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetInstagramContent requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetInstagramContent requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetInstagramContent requestLikeCountField () { return this.requestLikeCountField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/CustomAudience.java b/src/main/java/com/facebook/ads/sdk/CustomAudience.java index eb594789..29031aa7 100644 --- a/src/main/java/com/facebook/ads/sdk/CustomAudience.java +++ b/src/main/java/com/facebook/ads/sdk/CustomAudience.java @@ -704,6 +704,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -1039,6 +1040,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -1927,6 +1935,8 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "app_id", "public_key", + "salts", + "user_id", }; @Override @@ -2042,6 +2052,20 @@ public APIRequestGetSalts requestPublicKeyField (boolean value) { this.requestField("public_key", value); return this; } + public APIRequestGetSalts requestSaltsField () { + return this.requestSaltsField(true); + } + public APIRequestGetSalts requestSaltsField (boolean value) { + this.requestField("salts", value); + return this; + } + public APIRequestGetSalts requestUserIdField () { + return this.requestUserIdField(true); + } + public APIRequestGetSalts requestUserIdField (boolean value) { + this.requestField("user_id", value); + return this; + } } public static class APIRequestCreateSalt extends APIRequest { diff --git a/src/main/java/com/facebook/ads/sdk/CustomAudienceSalts.java b/src/main/java/com/facebook/ads/sdk/CustomAudienceSalts.java index c8311233..5f35f883 100644 --- a/src/main/java/com/facebook/ads/sdk/CustomAudienceSalts.java +++ b/src/main/java/com/facebook/ads/sdk/CustomAudienceSalts.java @@ -45,6 +45,10 @@ public class CustomAudienceSalts extends APINode { private Long mAppId = null; @SerializedName("public_key") private String mPublicKey = null; + @SerializedName("salts") + private List mSalts = null; + @SerializedName("user_id") + private Long mUserId = null; protected static Gson gson = null; public CustomAudienceSalts() { @@ -214,6 +218,24 @@ public CustomAudienceSalts setFieldPublicKey(String value) { return this; } + public List getFieldSalts() { + return mSalts; + } + + public CustomAudienceSalts setFieldSalts(List value) { + this.mSalts = value; + return this; + } + + public Long getFieldUserId() { + return mUserId; + } + + public CustomAudienceSalts setFieldUserId(Long value) { + this.mUserId = value; + return this; + } + @@ -233,6 +255,8 @@ public CustomAudienceSalts setFieldPublicKey(String value) { public CustomAudienceSalts copyFrom(CustomAudienceSalts instance) { this.mAppId = instance.mAppId; this.mPublicKey = instance.mPublicKey; + this.mSalts = instance.mSalts; + this.mUserId = instance.mUserId; this.context = instance.context; this.rawValue = instance.rawValue; return this; diff --git a/src/main/java/com/facebook/ads/sdk/Destination.java b/src/main/java/com/facebook/ads/sdk/Destination.java index 89d9e6cb..f55f7099 100644 --- a/src/main/java/com/facebook/ads/sdk/Destination.java +++ b/src/main/java/com/facebook/ads/sdk/Destination.java @@ -49,6 +49,18 @@ public class Destination extends APINode { private CatalogSubVerticalList mCategorySpecificFields = null; @SerializedName("currency") private String mCurrency = null; + @SerializedName("custom_label_0") + private String mCustomLabel0 = null; + @SerializedName("custom_label_1") + private String mCustomLabel1 = null; + @SerializedName("custom_label_2") + private String mCustomLabel2 = null; + @SerializedName("custom_number_0") + private Long mCustomNumber0 = null; + @SerializedName("custom_number_1") + private Long mCustomNumber1 = null; + @SerializedName("custom_number_2") + private Long mCustomNumber2 = null; @SerializedName("description") private String mDescription = null; @SerializedName("destination_id") @@ -319,6 +331,30 @@ public String getFieldCurrency() { return mCurrency; } + public String getFieldCustomLabel0() { + return mCustomLabel0; + } + + public String getFieldCustomLabel1() { + return mCustomLabel1; + } + + public String getFieldCustomLabel2() { + return mCustomLabel2; + } + + public Long getFieldCustomNumber0() { + return mCustomNumber0; + } + + public Long getFieldCustomNumber1() { + return mCustomNumber1; + } + + public Long getFieldCustomNumber2() { + return mCustomNumber2; + } + public String getFieldDescription() { return mDescription; } @@ -799,6 +835,12 @@ public Destination getLastResponse() { "applinks", "category_specific_fields", "currency", + "custom_label_0", + "custom_label_1", + "custom_label_2", + "custom_number_0", + "custom_number_1", + "custom_number_2", "description", "destination_id", "id", @@ -933,6 +975,48 @@ public APIRequestGet requestCurrencyField (boolean value) { this.requestField("currency", value); return this; } + public APIRequestGet requestCustomLabel0Field () { + return this.requestCustomLabel0Field(true); + } + public APIRequestGet requestCustomLabel0Field (boolean value) { + this.requestField("custom_label_0", value); + return this; + } + public APIRequestGet requestCustomLabel1Field () { + return this.requestCustomLabel1Field(true); + } + public APIRequestGet requestCustomLabel1Field (boolean value) { + this.requestField("custom_label_1", value); + return this; + } + public APIRequestGet requestCustomLabel2Field () { + return this.requestCustomLabel2Field(true); + } + public APIRequestGet requestCustomLabel2Field (boolean value) { + this.requestField("custom_label_2", value); + return this; + } + public APIRequestGet requestCustomNumber0Field () { + return this.requestCustomNumber0Field(true); + } + public APIRequestGet requestCustomNumber0Field (boolean value) { + this.requestField("custom_number_0", value); + return this; + } + public APIRequestGet requestCustomNumber1Field () { + return this.requestCustomNumber1Field(true); + } + public APIRequestGet requestCustomNumber1Field (boolean value) { + this.requestField("custom_number_1", value); + return this; + } + public APIRequestGet requestCustomNumber2Field () { + return this.requestCustomNumber2Field(true); + } + public APIRequestGet requestCustomNumber2Field (boolean value) { + this.requestField("custom_number_2", value); + return this; + } public APIRequestGet requestDescriptionField () { return this.requestDescriptionField(true); } @@ -1098,6 +1182,12 @@ public Destination copyFrom(Destination instance) { this.mApplinks = instance.mApplinks; this.mCategorySpecificFields = instance.mCategorySpecificFields; this.mCurrency = instance.mCurrency; + this.mCustomLabel0 = instance.mCustomLabel0; + this.mCustomLabel1 = instance.mCustomLabel1; + this.mCustomLabel2 = instance.mCustomLabel2; + this.mCustomNumber0 = instance.mCustomNumber0; + this.mCustomNumber1 = instance.mCustomNumber1; + this.mCustomNumber2 = instance.mCustomNumber2; this.mDescription = instance.mDescription; this.mDestinationId = instance.mDestinationId; this.mId = instance.mId; diff --git a/src/main/java/com/facebook/ads/sdk/Event.java b/src/main/java/com/facebook/ads/sdk/Event.java index a2db563c..bd9c8872 100644 --- a/src/main/java/com/facebook/ads/sdk/Event.java +++ b/src/main/java/com/facebook/ads/sdk/Event.java @@ -2446,6 +2446,8 @@ public String toString() { public static enum EnumOnlineEventFormat { @SerializedName("fb_live") VALUE_FB_LIVE("fb_live"), + @SerializedName("horizon_world") + VALUE_HORIZON_WORLD("horizon_world"), @SerializedName("messenger_room") VALUE_MESSENGER_ROOM("messenger_room"), @SerializedName("none") diff --git a/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java b/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java index 23c5158b..3aac732d 100644 --- a/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java +++ b/src/main/java/com/facebook/ads/sdk/EventSourceGroup.java @@ -344,6 +344,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -674,6 +675,13 @@ public APIRequestGetSharedAccounts requestExistingCustomersField (boolean value) this.requestField("existing_customers", value); return this; } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetSharedAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ExtendedCredit.java b/src/main/java/com/facebook/ads/sdk/ExtendedCredit.java index 7e532de7..b141d9c5 100644 --- a/src/main/java/com/facebook/ads/sdk/ExtendedCredit.java +++ b/src/main/java/com/facebook/ads/sdk/ExtendedCredit.java @@ -1282,11 +1282,11 @@ public APIRequestCreateWhatsAppCreditSharing requestField (String field, boolean } - public static class APIRequestCreateWhatsAppCreditSharingAndAttach extends APIRequest { + public static class APIRequestCreateWhatsAppCreditSharingAndAttach extends APIRequest { - APINode lastResponse = null; + ExtendedCreditAllocationConfig lastResponse = null; @Override - public APINode getLastResponse() { + public ExtendedCreditAllocationConfig getLastResponse() { return lastResponse; } public static final String[] PARAMS = { @@ -1298,31 +1298,31 @@ public APINode getLastResponse() { }; @Override - public APINode parseResponse(String response, String header) throws APIException { - return APINode.parseResponse(response, getContext(), this, header).head(); + public ExtendedCreditAllocationConfig parseResponse(String response, String header) throws APIException { + return ExtendedCreditAllocationConfig.parseResponse(response, getContext(), this, header).head(); } @Override - public APINode execute() throws APIException { + public ExtendedCreditAllocationConfig execute() throws APIException { return execute(new HashMap()); } @Override - public APINode execute(Map extraParams) throws APIException { + public ExtendedCreditAllocationConfig 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 APINode apply(ResponseWrapper result) { + new Function() { + public ExtendedCreditAllocationConfig apply(ResponseWrapper result) { try { return APIRequestCreateWhatsAppCreditSharingAndAttach.this.parseResponse(result.getBody(), result.getHeader()); } catch (Exception e) { diff --git a/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java b/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java index 803f5a65..fa05246e 100644 --- a/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java +++ b/src/main/java/com/facebook/ads/sdk/ExtendedCreditInvoiceGroup.java @@ -490,6 +490,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -820,6 +821,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/FundingSourceDetailsCoupon.java b/src/main/java/com/facebook/ads/sdk/FundingSourceDetailsCoupon.java index d052ecbd..c5ff5f1a 100644 --- a/src/main/java/com/facebook/ads/sdk/FundingSourceDetailsCoupon.java +++ b/src/main/java/com/facebook/ads/sdk/FundingSourceDetailsCoupon.java @@ -57,6 +57,8 @@ public class FundingSourceDetailsCoupon extends APINode { private Long mOriginalAmount = null; @SerializedName("original_display_amount") private String mOriginalDisplayAmount = null; + @SerializedName("start_date") + private String mStartDate = null; protected static Gson gson = null; public FundingSourceDetailsCoupon() { @@ -280,6 +282,15 @@ public FundingSourceDetailsCoupon setFieldOriginalDisplayAmount(String value) { return this; } + public String getFieldStartDate() { + return mStartDate; + } + + public FundingSourceDetailsCoupon setFieldStartDate(String value) { + this.mStartDate = value; + return this; + } + @@ -305,6 +316,7 @@ public FundingSourceDetailsCoupon copyFrom(FundingSourceDetailsCoupon instance) this.mExpiration = instance.mExpiration; this.mOriginalAmount = instance.mOriginalAmount; this.mOriginalDisplayAmount = instance.mOriginalDisplayAmount; + this.mStartDate = instance.mStartDate; this.context = instance.context; this.rawValue = instance.rawValue; return this; diff --git a/src/main/java/com/facebook/ads/sdk/Group.java b/src/main/java/com/facebook/ads/sdk/Group.java index bb65969a..fd26af9e 100644 --- a/src/main/java/com/facebook/ads/sdk/Group.java +++ b/src/main/java/com/facebook/ads/sdk/Group.java @@ -2217,7 +2217,6 @@ public Post getLastResponse() { "text_format_metadata", "text_format_preset_id", "text_only_place", - "throwback_camera_roll_media", "thumbnail", "time_since_original_post", "title", @@ -2958,11 +2957,6 @@ public APIRequestCreateFeed setTextOnlyPlace (String textOnlyPlace) { return this; } - public APIRequestCreateFeed setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateFeed setThumbnail (File thumbnail) { this.setParam("thumbnail", thumbnail); return this; @@ -4553,6 +4547,7 @@ public APINodeList getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -4573,6 +4568,7 @@ public APINodeList getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -4796,6 +4792,13 @@ public APIRequestGetOptedInMembers requestInspirationalPeopleField (boolean valu this.requestField("inspirational_people", value); return this; } + public APIRequestGetOptedInMembers requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGetOptedInMembers requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGetOptedInMembers requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -4936,6 +4939,13 @@ public APIRequestGetOptedInMembers requestRelationshipStatusField (boolean value this.requestField("relationship_status", value); return this; } + public APIRequestGetOptedInMembers requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGetOptedInMembers requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGetOptedInMembers requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } @@ -6306,7 +6316,6 @@ public AdVideo getLastResponse() { "start_offset", "swap_mode", "text_format_metadata", - "throwback_camera_roll_media", "thumb", "time_since_original_post", "title", @@ -6773,11 +6782,6 @@ public APIRequestCreateVideo setTextFormatMetadata (String textFormatMetadata) { return this; } - public APIRequestCreateVideo setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateVideo setThumb (File thumb) { this.setParam("thumb", thumb); return this; diff --git a/src/main/java/com/facebook/ads/sdk/IGComment.java b/src/main/java/com/facebook/ads/sdk/IGComment.java index f18a17ea..9700de78 100644 --- a/src/main/java/com/facebook/ads/sdk/IGComment.java +++ b/src/main/java/com/facebook/ads/sdk/IGComment.java @@ -47,6 +47,8 @@ public class IGComment extends APINode { private Boolean mHidden = null; @SerializedName("id") private String mId = null; + @SerializedName("legacy_instagram_comment_id") + private String mLegacyInstagramCommentId = null; @SerializedName("like_count") private Long mLikeCount = null; @SerializedName("media") @@ -303,6 +305,10 @@ public String getFieldId() { return mId; } + public String getFieldLegacyInstagramCommentId() { + return mLegacyInstagramCommentId; + } + public Long getFieldLikeCount() { return mLikeCount; } @@ -353,6 +359,7 @@ public APINodeList getLastResponse() { "from", "hidden", "id", + "legacy_instagram_comment_id", "like_count", "media", "parent_id", @@ -473,6 +480,13 @@ public APIRequestGetReplies requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetReplies requestLegacyInstagramCommentIdField () { + return this.requestLegacyInstagramCommentIdField(true); + } + public APIRequestGetReplies requestLegacyInstagramCommentIdField (boolean value) { + this.requestField("legacy_instagram_comment_id", value); + return this; + } public APIRequestGetReplies requestLikeCountField () { return this.requestLikeCountField(true); } @@ -754,6 +768,7 @@ public IGComment getLastResponse() { "from", "hidden", "id", + "legacy_instagram_comment_id", "like_count", "media", "parent_id", @@ -874,6 +889,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestLegacyInstagramCommentIdField () { + return this.requestLegacyInstagramCommentIdField(true); + } + public APIRequestGet requestLegacyInstagramCommentIdField (boolean value) { + this.requestField("legacy_instagram_comment_id", value); + return this; + } public APIRequestGet requestLikeCountField () { return this.requestLikeCountField(true); } @@ -1058,6 +1080,7 @@ public IGComment copyFrom(IGComment instance) { this.mFrom = instance.mFrom; this.mHidden = instance.mHidden; this.mId = instance.mId; + this.mLegacyInstagramCommentId = instance.mLegacyInstagramCommentId; this.mLikeCount = instance.mLikeCount; this.mMedia = instance.mMedia; this.mParentId = instance.mParentId; diff --git a/src/main/java/com/facebook/ads/sdk/IGMedia.java b/src/main/java/com/facebook/ads/sdk/IGMedia.java index aa004ae0..210828ec 100644 --- a/src/main/java/com/facebook/ads/sdk/IGMedia.java +++ b/src/main/java/com/facebook/ads/sdk/IGMedia.java @@ -57,6 +57,8 @@ public class IGMedia extends APINode { private Boolean mIsCommentEnabled = null; @SerializedName("is_shared_to_feed") private Boolean mIsSharedToFeed = null; + @SerializedName("legacy_instagram_media_id") + private String mLegacyInstagramMediaId = null; @SerializedName("like_count") private Long mLikeCount = null; @SerializedName("media_product_type") @@ -378,6 +380,10 @@ public Boolean getFieldIsSharedToFeed() { return mIsSharedToFeed; } + public String getFieldLegacyInstagramMediaId() { + return mLegacyInstagramMediaId; + } + public Long getFieldLikeCount() { return mLikeCount; } @@ -809,6 +815,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -967,6 +974,13 @@ public APIRequestGetChildren requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetChildren requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetChildren requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetChildren requestLikeCountField () { return this.requestLikeCountField(true); } @@ -1182,6 +1196,7 @@ public APINodeList getLastResponse() { "from", "hidden", "id", + "legacy_instagram_comment_id", "like_count", "media", "parent_id", @@ -1302,6 +1317,13 @@ public APIRequestGetComments requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetComments requestLegacyInstagramCommentIdField () { + return this.requestLegacyInstagramCommentIdField(true); + } + public APIRequestGetComments requestLegacyInstagramCommentIdField (boolean value) { + this.requestField("legacy_instagram_comment_id", value); + return this; + } public APIRequestGetComments requestLikeCountField () { return this.requestLikeCountField(true); } @@ -2208,6 +2230,7 @@ public IGMedia getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -2400,6 +2423,13 @@ public APIRequestGet requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGet requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGet requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGet requestLikeCountField () { return this.requestLikeCountField(true); } @@ -2610,6 +2640,7 @@ public IGMedia copyFrom(IGMedia instance) { this.mIgId = instance.mIgId; this.mIsCommentEnabled = instance.mIsCommentEnabled; this.mIsSharedToFeed = instance.mIsSharedToFeed; + this.mLegacyInstagramMediaId = instance.mLegacyInstagramMediaId; this.mLikeCount = instance.mLikeCount; this.mMediaProductType = instance.mMediaProductType; this.mMediaType = instance.mMediaType; diff --git a/src/main/java/com/facebook/ads/sdk/IGUser.java b/src/main/java/com/facebook/ads/sdk/IGUser.java index ac03f371..47f9896e 100644 --- a/src/main/java/com/facebook/ads/sdk/IGUser.java +++ b/src/main/java/com/facebook/ads/sdk/IGUser.java @@ -53,6 +53,8 @@ public class IGUser extends APINode { private String mId = null; @SerializedName("ig_id") private Long mIgId = null; + @SerializedName("legacy_instagram_user_id") + private String mLegacyInstagramUserId = null; @SerializedName("media_count") private Long mMediaCount = null; @SerializedName("mentioned_comment") @@ -374,6 +376,10 @@ public APIRequestGetTags getTags() { return new APIRequestGetTags(this.getPrefixedId().toString(), context); } + public APIRequestCreateUpcomingEvent createUpcomingEvent() { + return new APIRequestCreateUpcomingEvent(this.getPrefixedId().toString(), context); + } + public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } @@ -406,6 +412,10 @@ public Long getFieldIgId() { return mIgId; } + public String getFieldLegacyInstagramUserId() { + return mLegacyInstagramUserId; + } + public Long getFieldMediaCount() { return mMediaCount; } @@ -2164,6 +2174,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -2332,6 +2343,13 @@ public APIRequestGetLiveMedia requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetLiveMedia requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetLiveMedia requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetLiveMedia requestLikeCountField () { return this.requestLikeCountField(true); } @@ -2425,6 +2443,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -2593,6 +2612,13 @@ public APIRequestGetMedia requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetMedia requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetMedia requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetMedia requestLikeCountField () { return this.requestLikeCountField(true); } @@ -3723,6 +3749,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -3881,6 +3908,13 @@ public APIRequestGetStories requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetStories requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetStories requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetStories requestLikeCountField () { return this.requestLikeCountField(true); } @@ -3972,6 +4006,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -4130,6 +4165,13 @@ public APIRequestGetTags requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetTags requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetTags requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetTags requestLikeCountField () { return this.requestLikeCountField(true); } @@ -4202,6 +4244,139 @@ public APIRequestGetTags requestUsernameField (boolean value) { } } + public static class APIRequestCreateUpcomingEvent extends APIRequest { + + APINode lastResponse = null; + @Override + public APINode getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "end_time", + "notification_subtypes", + "start_time", + "title", + }; + + 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 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 setNotificationSubtypes (List notificationSubtypes) { + this.setParam("notification_subtypes", notificationSubtypes); + return this; + } + public APIRequestCreateUpcomingEvent setNotificationSubtypes (String notificationSubtypes) { + this.setParam("notification_subtypes", notificationSubtypes); + 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 { IGUser lastResponse = null; @@ -4220,6 +4395,7 @@ public IGUser getLastResponse() { "follows_count", "id", "ig_id", + "legacy_instagram_user_id", "media_count", "mentioned_comment", "mentioned_media", @@ -4369,6 +4545,13 @@ public APIRequestGet requestIgIdField (boolean value) { this.requestField("ig_id", value); return this; } + public APIRequestGet requestLegacyInstagramUserIdField () { + return this.requestLegacyInstagramUserIdField(true); + } + public APIRequestGet requestLegacyInstagramUserIdField (boolean value) { + this.requestField("legacy_instagram_user_id", value); + return this; + } public APIRequestGet requestMediaCountField () { return this.requestMediaCountField(true); } @@ -4441,6 +4624,47 @@ public APIRequestGet requestWebsiteField (boolean value) { } } + public static enum EnumNotificationSubtypes { + @SerializedName("AFTER_EVENT_1DAY") + VALUE_AFTER_EVENT_1DAY("AFTER_EVENT_1DAY"), + @SerializedName("AFTER_EVENT_2DAY") + VALUE_AFTER_EVENT_2DAY("AFTER_EVENT_2DAY"), + @SerializedName("AFTER_EVENT_3DAY") + VALUE_AFTER_EVENT_3DAY("AFTER_EVENT_3DAY"), + @SerializedName("AFTER_EVENT_4DAY") + VALUE_AFTER_EVENT_4DAY("AFTER_EVENT_4DAY"), + @SerializedName("AFTER_EVENT_5DAY") + VALUE_AFTER_EVENT_5DAY("AFTER_EVENT_5DAY"), + @SerializedName("AFTER_EVENT_6DAY") + VALUE_AFTER_EVENT_6DAY("AFTER_EVENT_6DAY"), + @SerializedName("AFTER_EVENT_7DAY") + VALUE_AFTER_EVENT_7DAY("AFTER_EVENT_7DAY"), + @SerializedName("BEFORE_EVENT_15MIN") + VALUE_BEFORE_EVENT_15MIN("BEFORE_EVENT_15MIN"), + @SerializedName("BEFORE_EVENT_1DAY") + VALUE_BEFORE_EVENT_1DAY("BEFORE_EVENT_1DAY"), + @SerializedName("BEFORE_EVENT_1HOUR") + VALUE_BEFORE_EVENT_1HOUR("BEFORE_EVENT_1HOUR"), + @SerializedName("BEFORE_EVENT_2DAY") + VALUE_BEFORE_EVENT_2DAY("BEFORE_EVENT_2DAY"), + @SerializedName("EVENT_START") + VALUE_EVENT_START("EVENT_START"), + @SerializedName("RESCHEDULED") + VALUE_RESCHEDULED("RESCHEDULED"), + ; + + private String value; + + private EnumNotificationSubtypes(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + synchronized /*package*/ static Gson getGson() { if (gson != null) { @@ -4462,6 +4686,7 @@ public IGUser copyFrom(IGUser instance) { this.mFollowsCount = instance.mFollowsCount; this.mId = instance.mId; this.mIgId = instance.mIgId; + this.mLegacyInstagramUserId = instance.mLegacyInstagramUserId; this.mMediaCount = instance.mMediaCount; this.mMentionedComment = instance.mMentionedComment; this.mMentionedMedia = instance.mMentionedMedia; diff --git a/src/main/java/com/facebook/ads/sdk/AnalyticsCohortQueryResult.java b/src/main/java/com/facebook/ads/sdk/IGUserSubscribedAppsData.java similarity index 62% rename from src/main/java/com/facebook/ads/sdk/AnalyticsCohortQueryResult.java rename to src/main/java/com/facebook/ads/sdk/IGUserSubscribedAppsData.java index 9fc66d9c..4075fe36 100644 --- a/src/main/java/com/facebook/ads/sdk/AnalyticsCohortQueryResult.java +++ b/src/main/java/com/facebook/ads/sdk/IGUserSubscribedAppsData.java @@ -40,29 +40,25 @@ * pull request for this class. * */ -public class AnalyticsCohortQueryResult extends APINode { - @SerializedName("data") - private Object mData = null; - @SerializedName("error") - private Object mError = null; - @SerializedName("query_id") - private String mQueryId = null; - @SerializedName("status") - private String mStatus = null; +public class IGUserSubscribedAppsData extends APINode { + @SerializedName("app_id") + private String mAppId = null; + @SerializedName("subscribed_fields") + private List mSubscribedFields = null; protected static Gson gson = null; - public AnalyticsCohortQueryResult() { + public IGUserSubscribedAppsData() { } public String getId() { return null; } - public static AnalyticsCohortQueryResult loadJSON(String json, APIContext context, String header) { - AnalyticsCohortQueryResult analyticsCohortQueryResult = getGson().fromJson(json, AnalyticsCohortQueryResult.class); + public static IGUserSubscribedAppsData loadJSON(String json, APIContext context, String header) { + IGUserSubscribedAppsData igUserSubscribedAppsData = getGson().fromJson(json, IGUserSubscribedAppsData.class); if (context.isDebug()) { JsonParser parser = new JsonParser(); JsonElement o1 = parser.parse(json); - JsonElement o2 = parser.parse(analyticsCohortQueryResult.toString()); + JsonElement o2 = parser.parse(igUserSubscribedAppsData.toString()); if (o1.getAsJsonObject().get("__fb_trace_id__") != null) { o2.getAsJsonObject().add("__fb_trace_id__", o1.getAsJsonObject().get("__fb_trace_id__")); } @@ -72,14 +68,14 @@ public static AnalyticsCohortQueryResult loadJSON(String json, APIContext contex context.log("[Object]" + o2); } } - analyticsCohortQueryResult.context = context; - analyticsCohortQueryResult.rawValue = json; - analyticsCohortQueryResult.header = header; - return analyticsCohortQueryResult; + igUserSubscribedAppsData.context = context; + igUserSubscribedAppsData.rawValue = json; + igUserSubscribedAppsData.header = header; + return igUserSubscribedAppsData; } - public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { - APINodeList analyticsCohortQueryResults = new APINodeList(request, json, header); + public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { + APINodeList igUserSubscribedAppsDatas = new APINodeList(request, json, header); JsonArray arr; JsonObject obj; JsonParser parser = new JsonParser(); @@ -90,9 +86,9 @@ public static APINodeList parseResponse(String json, // First, check if it's a pure JSON Array arr = result.getAsJsonArray(); for (int i = 0; i < arr.size(); i++) { - analyticsCohortQueryResults.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); + igUserSubscribedAppsDatas.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); }; - return analyticsCohortQueryResults; + return igUserSubscribedAppsDatas; } else if (result.isJsonObject()) { obj = result.getAsJsonObject(); if (obj.has("data")) { @@ -102,20 +98,20 @@ public static APINodeList parseResponse(String json, 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; - analyticsCohortQueryResults.setCursors(before, after); + igUserSubscribedAppsDatas.setCursors(before, after); } String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; String next = paging.has("next") ? paging.get("next").getAsString() : null; - analyticsCohortQueryResults.setPaging(previous, next); + igUserSubscribedAppsDatas.setPaging(previous, next); if (context.hasAppSecret()) { - analyticsCohortQueryResults.setAppSecret(context.getAppSecretProof()); + igUserSubscribedAppsDatas.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++) { - analyticsCohortQueryResults.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); + igUserSubscribedAppsDatas.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" @@ -126,23 +122,23 @@ public static APINodeList parseResponse(String json, isRedownload = true; obj = obj.getAsJsonObject(s); for (Map.Entry entry : obj.entrySet()) { - analyticsCohortQueryResults.add(loadJSON(entry.getValue().toString(), context, header)); + igUserSubscribedAppsDatas.add(loadJSON(entry.getValue().toString(), context, header)); } break; } } if (!isRedownload) { - analyticsCohortQueryResults.add(loadJSON(obj.toString(), context, header)); + igUserSubscribedAppsDatas.add(loadJSON(obj.toString(), context, header)); } } - return analyticsCohortQueryResults; + return igUserSubscribedAppsDatas; } 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()) { - analyticsCohortQueryResults.add(loadJSON(entry.getValue().toString(), context, header)); + igUserSubscribedAppsDatas.add(loadJSON(entry.getValue().toString(), context, header)); } - return analyticsCohortQueryResults; + return igUserSubscribedAppsDatas; } else { // Fifth, check if it's an array of objects indexed by id boolean isIdIndexedArray = true; @@ -159,20 +155,20 @@ public static APINodeList parseResponse(String json, value.getAsJsonObject().get("id") != null && value.getAsJsonObject().get("id").getAsString().equals(key) ) { - analyticsCohortQueryResults.add(loadJSON(value.toString(), context, header)); + igUserSubscribedAppsDatas.add(loadJSON(value.toString(), context, header)); } else { isIdIndexedArray = false; break; } } if (isIdIndexedArray) { - return analyticsCohortQueryResults; + return igUserSubscribedAppsDatas; } // Sixth, check if it's pure JsonObject - analyticsCohortQueryResults.clear(); - analyticsCohortQueryResults.add(loadJSON(json, context, header)); - return analyticsCohortQueryResults; + igUserSubscribedAppsDatas.clear(); + igUserSubscribedAppsDatas.add(loadJSON(json, context, header)); + return igUserSubscribedAppsDatas; } } } catch (Exception e) { @@ -200,39 +196,21 @@ public String toString() { } - public Object getFieldData() { - return mData; + public String getFieldAppId() { + return mAppId; } - public AnalyticsCohortQueryResult setFieldData(Object value) { - this.mData = value; + public IGUserSubscribedAppsData setFieldAppId(String value) { + this.mAppId = value; return this; } - public Object getFieldError() { - return mError; + public List getFieldSubscribedFields() { + return mSubscribedFields; } - public AnalyticsCohortQueryResult setFieldError(Object value) { - this.mError = value; - return this; - } - - public String getFieldQueryId() { - return mQueryId; - } - - public AnalyticsCohortQueryResult setFieldQueryId(String value) { - this.mQueryId = value; - return this; - } - - public String getFieldStatus() { - return mStatus; - } - - public AnalyticsCohortQueryResult setFieldStatus(String value) { - this.mStatus = value; + public IGUserSubscribedAppsData setFieldSubscribedFields(List value) { + this.mSubscribedFields = value; return this; } @@ -252,20 +230,18 @@ public AnalyticsCohortQueryResult setFieldStatus(String value) { return gson; } - public AnalyticsCohortQueryResult copyFrom(AnalyticsCohortQueryResult instance) { - this.mData = instance.mData; - this.mError = instance.mError; - this.mQueryId = instance.mQueryId; - this.mStatus = instance.mStatus; + public IGUserSubscribedAppsData copyFrom(IGUserSubscribedAppsData instance) { + this.mAppId = instance.mAppId; + this.mSubscribedFields = instance.mSubscribedFields; 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 AnalyticsCohortQueryResult.parseResponse(response, context, request, header); + public static APIRequest.ResponseParser getParser() { + return new APIRequest.ResponseParser() { + public APINodeList parseResponse(String response, APIContext context, APIRequest request, String header) throws MalformedResponseException { + return IGUserSubscribedAppsData.parseResponse(response, context, request, header); } }; } diff --git a/src/main/java/com/facebook/ads/sdk/InstagramCarousel.java b/src/main/java/com/facebook/ads/sdk/InstagramCarousel.java index eacaf420..bd145651 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramCarousel.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramCarousel.java @@ -51,6 +51,8 @@ public class InstagramCarousel extends APINode { private String mDisplayUrl = null; @SerializedName("id") private String mId = null; + @SerializedName("ig_media_id") + private String mIgMediaId = null; @SerializedName("like_count") private Long mLikeCount = null; @SerializedName("owner_instagram_user") @@ -303,6 +305,10 @@ public String getFieldId() { return mId; } + public String getFieldIgMediaId() { + return mIgMediaId; + } + public Long getFieldLikeCount() { return mLikeCount; } @@ -342,6 +348,7 @@ public APINodeList getLastResponse() { "comment_type", "created_at", "id", + "ig_comment_id", "instagram_comment_id", "instagram_user", "mentioned_instagram_users", @@ -460,6 +467,13 @@ public APIRequestGetComments requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetComments requestIgCommentIdField () { + return this.requestIgCommentIdField(true); + } + public APIRequestGetComments requestIgCommentIdField (boolean value) { + this.requestField("ig_comment_id", value); + return this; + } public APIRequestGetComments requestInstagramCommentIdField () { return this.requestInstagramCommentIdField(true); } @@ -630,6 +644,7 @@ public InstagramCarousel getLastResponse() { "content_type", "display_url", "id", + "ig_media_id", "like_count", "owner_instagram_user", "permalink", @@ -762,6 +777,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIgMediaIdField () { + return this.requestIgMediaIdField(true); + } + public APIRequestGet requestIgMediaIdField (boolean value) { + this.requestField("ig_media_id", value); + return this; + } public APIRequestGet requestLikeCountField () { return this.requestLikeCountField(true); } @@ -819,6 +841,7 @@ public InstagramCarousel copyFrom(InstagramCarousel instance) { this.mContentType = instance.mContentType; this.mDisplayUrl = instance.mDisplayUrl; this.mId = instance.mId; + this.mIgMediaId = instance.mIgMediaId; this.mLikeCount = instance.mLikeCount; this.mOwnerInstagramUser = instance.mOwnerInstagramUser; this.mPermalink = instance.mPermalink; diff --git a/src/main/java/com/facebook/ads/sdk/InstagramComment.java b/src/main/java/com/facebook/ads/sdk/InstagramComment.java index 61348fe3..9e82f2ba 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramComment.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramComment.java @@ -47,6 +47,8 @@ public class InstagramComment extends APINode { private String mCreatedAt = null; @SerializedName("id") private String mId = null; + @SerializedName("ig_comment_id") + private String mIgCommentId = null; @SerializedName("instagram_comment_id") private String mInstagramCommentId = null; @SerializedName("instagram_user") @@ -299,6 +301,10 @@ public String getFieldId() { return mId; } + public String getFieldIgCommentId() { + return mIgCommentId; + } + public String getFieldInstagramCommentId() { return mInstagramCommentId; } @@ -338,6 +344,7 @@ public APINodeList getLastResponse() { "comment_type", "created_at", "id", + "ig_comment_id", "instagram_comment_id", "instagram_user", "mentioned_instagram_users", @@ -456,6 +463,13 @@ public APIRequestGetReplies requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetReplies requestIgCommentIdField () { + return this.requestIgCommentIdField(true); + } + public APIRequestGetReplies requestIgCommentIdField (boolean value) { + this.requestField("ig_comment_id", value); + return this; + } public APIRequestGetReplies requestInstagramCommentIdField () { return this.requestInstagramCommentIdField(true); } @@ -735,6 +749,7 @@ public InstagramComment getLastResponse() { "comment_type", "created_at", "id", + "ig_comment_id", "instagram_comment_id", "instagram_user", "mentioned_instagram_users", @@ -853,6 +868,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIgCommentIdField () { + return this.requestIgCommentIdField(true); + } + public APIRequestGet requestIgCommentIdField (boolean value) { + this.requestField("ig_comment_id", value); + return this; + } public APIRequestGet requestInstagramCommentIdField () { return this.requestInstagramCommentIdField(true); } @@ -1029,6 +1051,7 @@ public InstagramComment copyFrom(InstagramComment instance) { this.mCommentType = instance.mCommentType; this.mCreatedAt = instance.mCreatedAt; this.mId = instance.mId; + this.mIgCommentId = instance.mIgCommentId; this.mInstagramCommentId = instance.mInstagramCommentId; this.mInstagramUser = instance.mInstagramUser; this.mMentionedInstagramUsers = instance.mMentionedInstagramUsers; diff --git a/src/main/java/com/facebook/ads/sdk/InstagramInsightsResult.java b/src/main/java/com/facebook/ads/sdk/InstagramInsightsResult.java index 7ca7c51c..186f64d8 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramInsightsResult.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramInsightsResult.java @@ -318,36 +318,24 @@ public static enum EnumMetric { VALUE_LIKES("likes"), @SerializedName("navigation") VALUE_NAVIGATION("navigation"), - @SerializedName("peak_concurrent_viewers") - VALUE_PEAK_CONCURRENT_VIEWERS("peak_concurrent_viewers"), @SerializedName("plays") VALUE_PLAYS("plays"), @SerializedName("profile_activity") VALUE_PROFILE_ACTIVITY("profile_activity"), @SerializedName("profile_visits") VALUE_PROFILE_VISITS("profile_visits"), - @SerializedName("quotes") - VALUE_QUOTES("quotes"), @SerializedName("reach") VALUE_REACH("reach"), @SerializedName("replies") VALUE_REPLIES("replies"), - @SerializedName("reposts") - VALUE_REPOSTS("reposts"), @SerializedName("saved") VALUE_SAVED("saved"), @SerializedName("shares") VALUE_SHARES("shares"), - @SerializedName("thread_replies") - VALUE_THREAD_REPLIES("thread_replies"), - @SerializedName("thread_shares") - VALUE_THREAD_SHARES("thread_shares"), @SerializedName("total_interactions") VALUE_TOTAL_INTERACTIONS("total_interactions"), @SerializedName("video_views") VALUE_VIDEO_VIEWS("video_views"), - @SerializedName("views") - VALUE_VIEWS("views"), ; private String value; diff --git a/src/main/java/com/facebook/ads/sdk/InstagramMedia.java b/src/main/java/com/facebook/ads/sdk/InstagramMedia.java index ede6f21d..0d873bf9 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramMedia.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramMedia.java @@ -53,6 +53,8 @@ public class InstagramMedia extends APINode { private String mFilterName = null; @SerializedName("id") private String mId = null; + @SerializedName("ig_media_id") + private String mIgMediaId = null; @SerializedName("latitude") private Double mLatitude = null; @SerializedName("like_count") @@ -317,6 +319,10 @@ public String getFieldId() { return mId; } + public String getFieldIgMediaId() { + return mIgMediaId; + } + public Double getFieldLatitude() { return mLatitude; } @@ -372,6 +378,7 @@ public APINodeList getLastResponse() { "comment_type", "created_at", "id", + "ig_comment_id", "instagram_comment_id", "instagram_user", "mentioned_instagram_users", @@ -490,6 +497,13 @@ public APIRequestGetComments requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetComments requestIgCommentIdField () { + return this.requestIgCommentIdField(true); + } + public APIRequestGetComments requestIgCommentIdField (boolean value) { + this.requestField("ig_comment_id", value); + return this; + } public APIRequestGetComments requestInstagramCommentIdField () { return this.requestInstagramCommentIdField(true); } @@ -661,6 +675,7 @@ public InstagramMedia getLastResponse() { "display_url", "filter_name", "id", + "ig_media_id", "latitude", "like_count", "location", @@ -804,6 +819,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIgMediaIdField () { + return this.requestIgMediaIdField(true); + } + public APIRequestGet requestIgMediaIdField (boolean value) { + this.requestField("ig_media_id", value); + return this; + } public APIRequestGet requestLatitudeField () { return this.requestLatitudeField(true); } @@ -890,6 +912,7 @@ public InstagramMedia copyFrom(InstagramMedia instance) { this.mDisplayUrl = instance.mDisplayUrl; this.mFilterName = instance.mFilterName; this.mId = instance.mId; + this.mIgMediaId = instance.mIgMediaId; this.mLatitude = instance.mLatitude; this.mLikeCount = instance.mLikeCount; this.mLocation = instance.mLocation; diff --git a/src/main/java/com/facebook/ads/sdk/InstagramUser.java b/src/main/java/com/facebook/ads/sdk/InstagramUser.java index 72180abd..0d8501a8 100644 --- a/src/main/java/com/facebook/ads/sdk/InstagramUser.java +++ b/src/main/java/com/facebook/ads/sdk/InstagramUser.java @@ -49,6 +49,8 @@ public class InstagramUser extends APINode { private Boolean mHasProfilePicture = null; @SerializedName("id") private String mId = null; + @SerializedName("ig_user_id") + private String mIgUserId = null; @SerializedName("is_private") private Boolean mIsPrivate = null; @SerializedName("is_published") @@ -317,6 +319,10 @@ public String getFieldId() { return mId; } + public String getFieldIgUserId() { + return mIgUserId; + } + public Boolean getFieldIsPrivate() { return mIsPrivate; } @@ -819,6 +825,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -1154,6 +1161,13 @@ public APIRequestGetAuthorizedAdAccounts requestExistingCustomersField (boolean this.requestField("existing_customers", value); return this; } + public APIRequestGetAuthorizedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAuthorizedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAuthorizedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -1879,6 +1893,7 @@ public InstagramUser getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -2011,6 +2026,13 @@ public APIRequestGet requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGet requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGet requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGet requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -2081,6 +2103,7 @@ public InstagramUser copyFrom(InstagramUser instance) { this.mFollowedByCount = instance.mFollowedByCount; this.mHasProfilePicture = instance.mHasProfilePicture; this.mId = instance.mId; + this.mIgUserId = instance.mIgUserId; this.mIsPrivate = instance.mIsPrivate; this.mIsPublished = instance.mIsPublished; this.mMediaCount = instance.mMediaCount; diff --git a/src/main/java/com/facebook/ads/sdk/LeadGenFormPreviewDetails.java b/src/main/java/com/facebook/ads/sdk/LeadGenFormPreviewDetails.java index 6c7ff8b2..2c23a824 100644 --- a/src/main/java/com/facebook/ads/sdk/LeadGenFormPreviewDetails.java +++ b/src/main/java/com/facebook/ads/sdk/LeadGenFormPreviewDetails.java @@ -45,6 +45,10 @@ public class LeadGenFormPreviewDetails extends APINode { private String mCallBusinessText = null; @SerializedName("call_to_action_title") private String mCallToActionTitle = null; + @SerializedName("chat_on_messenger_text") + private String mChatOnMessengerText = null; + @SerializedName("chat_on_whatsapp_text") + private String mChatOnWhatsappText = null; @SerializedName("contact_information_text") private String mContactInformationText = null; @SerializedName("creatives_overview_default_text") @@ -284,6 +288,24 @@ public LeadGenFormPreviewDetails setFieldCallToActionTitle(String value) { return this; } + public String getFieldChatOnMessengerText() { + return mChatOnMessengerText; + } + + public LeadGenFormPreviewDetails setFieldChatOnMessengerText(String value) { + this.mChatOnMessengerText = value; + return this; + } + + public String getFieldChatOnWhatsappText() { + return mChatOnWhatsappText; + } + + public LeadGenFormPreviewDetails setFieldChatOnWhatsappText(String value) { + this.mChatOnWhatsappText = value; + return this; + } + public String getFieldContactInformationText() { return mContactInformationText; } @@ -618,6 +640,8 @@ public LeadGenFormPreviewDetails setFieldViewFileText(String value) { public LeadGenFormPreviewDetails copyFrom(LeadGenFormPreviewDetails instance) { this.mCallBusinessText = instance.mCallBusinessText; this.mCallToActionTitle = instance.mCallToActionTitle; + this.mChatOnMessengerText = instance.mChatOnMessengerText; + this.mChatOnWhatsappText = instance.mChatOnWhatsappText; this.mContactInformationText = instance.mContactInformationText; this.mCreativesOverviewDefaultText = instance.mCreativesOverviewDefaultText; this.mDataPrivacyPolicySettingDescription = instance.mDataPrivacyPolicySettingDescription; diff --git a/src/main/java/com/facebook/ads/sdk/LiveVideo.java b/src/main/java/com/facebook/ads/sdk/LiveVideo.java index a6ee3373..347a8b1a 100644 --- a/src/main/java/com/facebook/ads/sdk/LiveVideo.java +++ b/src/main/java/com/facebook/ads/sdk/LiveVideo.java @@ -498,6 +498,7 @@ public APINodeList getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -518,6 +519,7 @@ public APINodeList getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -746,6 +748,13 @@ public APIRequestGetBlockedUsers requestInspirationalPeopleField (boolean value) this.requestField("inspirational_people", value); return this; } + public APIRequestGetBlockedUsers requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGetBlockedUsers requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGetBlockedUsers requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -886,6 +895,13 @@ public APIRequestGetBlockedUsers requestRelationshipStatusField (boolean value) this.requestField("relationship_status", value); return this; } + public APIRequestGetBlockedUsers requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGetBlockedUsers requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGetBlockedUsers requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/LiveVideoAdCampaignConfig.java b/src/main/java/com/facebook/ads/sdk/LiveVideoAdCampaignConfig.java new file mode 100644 index 00000000..6fd39d16 --- /dev/null +++ b/src/main/java/com/facebook/ads/sdk/LiveVideoAdCampaignConfig.java @@ -0,0 +1,422 @@ +/* + * 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 LiveVideoAdCampaignConfig extends APINode { + @SerializedName("id") + private String mId = null; + @SerializedName("live_video_ad_type") + private String mLiveVideoAdType = null; + protected static Gson gson = null; + + LiveVideoAdCampaignConfig() { + } + + public LiveVideoAdCampaignConfig(Long id, APIContext context) { + this(id.toString(), context); + } + + public LiveVideoAdCampaignConfig(String id, APIContext context) { + this.mId = id; + + this.context = context; + } + + public LiveVideoAdCampaignConfig fetch() throws APIException{ + LiveVideoAdCampaignConfig newInstance = fetchById(this.getPrefixedId().toString(), this.context); + this.copyFrom(newInstance); + return this; + } + + public static LiveVideoAdCampaignConfig 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 LiveVideoAdCampaignConfig 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", LiveVideoAdCampaignConfig.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", LiveVideoAdCampaignConfig.getParser()) + .setParam("ids", APIRequest.joinStringList(ids)) + .requestFields(fields) + .executeAsyncBase(); + } + + private String getPrefixedId() { + return getId(); + } + + public String getId() { + return getFieldId().toString(); + } + public static LiveVideoAdCampaignConfig loadJSON(String json, APIContext context, String header) { + LiveVideoAdCampaignConfig liveVideoAdCampaignConfig = getGson().fromJson(json, LiveVideoAdCampaignConfig.class); + if (context.isDebug()) { + JsonParser parser = new JsonParser(); + JsonElement o1 = parser.parse(json); + JsonElement o2 = parser.parse(liveVideoAdCampaignConfig.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); + } + } + liveVideoAdCampaignConfig.context = context; + liveVideoAdCampaignConfig.rawValue = json; + liveVideoAdCampaignConfig.header = header; + return liveVideoAdCampaignConfig; + } + + public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException { + APINodeList liveVideoAdCampaignConfigs = 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++) { + liveVideoAdCampaignConfigs.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header)); + }; + return liveVideoAdCampaignConfigs; + } 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; + liveVideoAdCampaignConfigs.setCursors(before, after); + } + String previous = paging.has("previous") ? paging.get("previous").getAsString() : null; + String next = paging.has("next") ? paging.get("next").getAsString() : null; + liveVideoAdCampaignConfigs.setPaging(previous, next); + if (context.hasAppSecret()) { + liveVideoAdCampaignConfigs.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++) { + liveVideoAdCampaignConfigs.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()) { + liveVideoAdCampaignConfigs.add(loadJSON(entry.getValue().toString(), context, header)); + } + break; + } + } + if (!isRedownload) { + liveVideoAdCampaignConfigs.add(loadJSON(obj.toString(), context, header)); + } + } + return liveVideoAdCampaignConfigs; + } 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()) { + liveVideoAdCampaignConfigs.add(loadJSON(entry.getValue().toString(), context, header)); + } + return liveVideoAdCampaignConfigs; + } 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) + ) { + liveVideoAdCampaignConfigs.add(loadJSON(value.toString(), context, header)); + } else { + isIdIndexedArray = false; + break; + } + } + if (isIdIndexedArray) { + return liveVideoAdCampaignConfigs; + } + + // Sixth, check if it's pure JsonObject + liveVideoAdCampaignConfigs.clear(); + liveVideoAdCampaignConfigs.add(loadJSON(json, context, header)); + return liveVideoAdCampaignConfigs; + } + } + } 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 String getFieldId() { + return mId; + } + + public String getFieldLiveVideoAdType() { + return mLiveVideoAdType; + } + + + + public static class APIRequestGet extends APIRequest { + + LiveVideoAdCampaignConfig lastResponse = null; + @Override + public LiveVideoAdCampaignConfig getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + }; + + public static final String[] FIELDS = { + "id", + "live_video_ad_type", + }; + + @Override + public LiveVideoAdCampaignConfig parseResponse(String response, String header) throws APIException { + return LiveVideoAdCampaignConfig.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public LiveVideoAdCampaignConfig execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public LiveVideoAdCampaignConfig 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 LiveVideoAdCampaignConfig 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 requestIdField () { + return this.requestIdField(true); + } + public APIRequestGet requestIdField (boolean value) { + this.requestField("id", value); + return this; + } + public APIRequestGet requestLiveVideoAdTypeField () { + return this.requestLiveVideoAdTypeField(true); + } + public APIRequestGet requestLiveVideoAdTypeField (boolean value) { + this.requestField("live_video_ad_type", 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 LiveVideoAdCampaignConfig copyFrom(LiveVideoAdCampaignConfig instance) { + this.mId = instance.mId; + this.mLiveVideoAdType = instance.mLiveVideoAdType; + 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 LiveVideoAdCampaignConfig.parseResponse(response, context, request, header); + } + }; + } +} diff --git a/src/main/java/com/facebook/ads/sdk/MessengerBusinessTemplate.java b/src/main/java/com/facebook/ads/sdk/MessengerBusinessTemplate.java index 19e0a489..5ceee929 100644 --- a/src/main/java/com/facebook/ads/sdk/MessengerBusinessTemplate.java +++ b/src/main/java/com/facebook/ads/sdk/MessengerBusinessTemplate.java @@ -276,6 +276,10 @@ public APIRequestGet get() { return new APIRequestGet(this.getPrefixedId().toString(), context); } + public APIRequestUpdate update() { + return new APIRequestUpdate(this.getPrefixedId().toString(), context); + } + public String getFieldCategory() { return mCategory; @@ -516,6 +520,156 @@ public APIRequestGet requestStatusField (boolean value) { } } + public static class APIRequestUpdate extends APIRequest { + + MessengerBusinessTemplate lastResponse = null; + @Override + public MessengerBusinessTemplate getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "components", + }; + + public static final String[] FIELDS = { + }; + + @Override + public MessengerBusinessTemplate parseResponse(String response, String header) throws APIException { + return MessengerBusinessTemplate.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public MessengerBusinessTemplate execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public MessengerBusinessTemplate 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 MessengerBusinessTemplate 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 setComponents (List> components) { + this.setParam("components", components); + return this; + } + public APIRequestUpdate setComponents (String components) { + this.setParam("components", components); + 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; + } + + } + + public static enum EnumStatus { + @SerializedName("APPROVED") + VALUE_APPROVED("APPROVED"), + @SerializedName("ARCHIVED") + VALUE_ARCHIVED("ARCHIVED"), + @SerializedName("DELETED") + VALUE_DELETED("DELETED"), + @SerializedName("DISABLED") + VALUE_DISABLED("DISABLED"), + @SerializedName("IN_APPEAL") + VALUE_IN_APPEAL("IN_APPEAL"), + @SerializedName("LIMIT_EXCEEDED") + VALUE_LIMIT_EXCEEDED("LIMIT_EXCEEDED"), + @SerializedName("PAUSED") + VALUE_PAUSED("PAUSED"), + @SerializedName("PENDING") + VALUE_PENDING("PENDING"), + @SerializedName("PENDING_DELETION") + VALUE_PENDING_DELETION("PENDING_DELETION"), + @SerializedName("REJECTED") + VALUE_REJECTED("REJECTED"), + ; + + private String value; + + private EnumStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + synchronized /*package*/ static Gson getGson() { if (gson != null) { diff --git a/src/main/java/com/facebook/ads/sdk/MessengerCallSettings.java b/src/main/java/com/facebook/ads/sdk/MessengerCallSettings.java index 709d4585..80aa2651 100644 --- a/src/main/java/com/facebook/ads/sdk/MessengerCallSettings.java +++ b/src/main/java/com/facebook/ads/sdk/MessengerCallSettings.java @@ -43,6 +43,8 @@ public class MessengerCallSettings extends APINode { @SerializedName("audio_enabled") private Boolean mAudioEnabled = null; + @SerializedName("icon_enabled") + private Boolean mIconEnabled = null; protected static Gson gson = null; public MessengerCallSettings() { @@ -203,6 +205,15 @@ public MessengerCallSettings setFieldAudioEnabled(Boolean value) { return this; } + public Boolean getFieldIconEnabled() { + return mIconEnabled; + } + + public MessengerCallSettings setFieldIconEnabled(Boolean value) { + this.mIconEnabled = value; + return this; + } + @@ -221,6 +232,7 @@ public MessengerCallSettings setFieldAudioEnabled(Boolean value) { public MessengerCallSettings copyFrom(MessengerCallSettings instance) { this.mAudioEnabled = instance.mAudioEnabled; + this.mIconEnabled = instance.mIconEnabled; this.context = instance.context; this.rawValue = instance.rawValue; return this; diff --git a/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java b/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java index de6de406..9a6bed34 100644 --- a/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java +++ b/src/main/java/com/facebook/ads/sdk/OfflineConversionDataSet.java @@ -537,6 +537,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -872,6 +873,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -2451,6 +2459,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -2795,6 +2804,13 @@ public APIRequestGetSharedAccounts requestExistingCustomersField (boolean value) this.requestField("existing_customers", value); return this; } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetSharedAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetSharedAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/OpenBridgeConfiguration.java b/src/main/java/com/facebook/ads/sdk/OpenBridgeConfiguration.java index 9bdf31b0..54bef2f0 100644 --- a/src/main/java/com/facebook/ads/sdk/OpenBridgeConfiguration.java +++ b/src/main/java/com/facebook/ads/sdk/OpenBridgeConfiguration.java @@ -43,12 +43,20 @@ public class OpenBridgeConfiguration extends APINode { @SerializedName("active") private Boolean mActive = null; + @SerializedName("cloud_provider") + private String mCloudProvider = null; + @SerializedName("cloud_region") + private String mCloudRegion = null; + @SerializedName("destination_id") + private String mDestinationId = null; @SerializedName("endpoint") private String mEndpoint = null; @SerializedName("fallback_domain") private String mFallbackDomain = null; @SerializedName("fallback_domain_enabled") private Boolean mFallbackDomainEnabled = null; + @SerializedName("first_party_domain") + private String mFirstPartyDomain = null; @SerializedName("host_business_id") private String mHostBusinessId = null; @SerializedName("host_external_id") @@ -57,6 +65,12 @@ public class OpenBridgeConfiguration extends APINode { private String mId = null; @SerializedName("instance_id") private String mInstanceId = null; + @SerializedName("instance_version") + private String mInstanceVersion = null; + @SerializedName("is_sgw_instance") + private Boolean mIsSgwInstance = null; + @SerializedName("partner_name") + private String mPartnerName = null; @SerializedName("pixel_id") private String mPixelId = null; protected static Gson gson = null; @@ -285,6 +299,18 @@ public Boolean getFieldActive() { return mActive; } + public String getFieldCloudProvider() { + return mCloudProvider; + } + + public String getFieldCloudRegion() { + return mCloudRegion; + } + + public String getFieldDestinationId() { + return mDestinationId; + } + public String getFieldEndpoint() { return mEndpoint; } @@ -297,6 +323,10 @@ public Boolean getFieldFallbackDomainEnabled() { return mFallbackDomainEnabled; } + public String getFieldFirstPartyDomain() { + return mFirstPartyDomain; + } + public String getFieldHostBusinessId() { return mHostBusinessId; } @@ -313,6 +343,18 @@ public String getFieldInstanceId() { return mInstanceId; } + public String getFieldInstanceVersion() { + return mInstanceVersion; + } + + public Boolean getFieldIsSgwInstance() { + return mIsSgwInstance; + } + + public String getFieldPartnerName() { + return mPartnerName; + } + public String getFieldPixelId() { return mPixelId; } @@ -436,13 +478,20 @@ public OpenBridgeConfiguration getLastResponse() { public static final String[] FIELDS = { "active", + "cloud_provider", + "cloud_region", + "destination_id", "endpoint", "fallback_domain", "fallback_domain_enabled", + "first_party_domain", "host_business_id", "host_external_id", "id", "instance_id", + "instance_version", + "is_sgw_instance", + "partner_name", "pixel_id", }; @@ -543,6 +592,27 @@ public APIRequestGet requestActiveField (boolean value) { this.requestField("active", value); return this; } + public APIRequestGet requestCloudProviderField () { + return this.requestCloudProviderField(true); + } + public APIRequestGet requestCloudProviderField (boolean value) { + this.requestField("cloud_provider", value); + return this; + } + public APIRequestGet requestCloudRegionField () { + return this.requestCloudRegionField(true); + } + public APIRequestGet requestCloudRegionField (boolean value) { + this.requestField("cloud_region", value); + return this; + } + public APIRequestGet requestDestinationIdField () { + return this.requestDestinationIdField(true); + } + public APIRequestGet requestDestinationIdField (boolean value) { + this.requestField("destination_id", value); + return this; + } public APIRequestGet requestEndpointField () { return this.requestEndpointField(true); } @@ -564,6 +634,13 @@ public APIRequestGet requestFallbackDomainEnabledField (boolean value) { this.requestField("fallback_domain_enabled", value); return this; } + public APIRequestGet requestFirstPartyDomainField () { + return this.requestFirstPartyDomainField(true); + } + public APIRequestGet requestFirstPartyDomainField (boolean value) { + this.requestField("first_party_domain", value); + return this; + } public APIRequestGet requestHostBusinessIdField () { return this.requestHostBusinessIdField(true); } @@ -592,6 +669,27 @@ public APIRequestGet requestInstanceIdField (boolean value) { this.requestField("instance_id", value); return this; } + public APIRequestGet requestInstanceVersionField () { + return this.requestInstanceVersionField(true); + } + public APIRequestGet requestInstanceVersionField (boolean value) { + this.requestField("instance_version", value); + return this; + } + public APIRequestGet requestIsSgwInstanceField () { + return this.requestIsSgwInstanceField(true); + } + public APIRequestGet requestIsSgwInstanceField (boolean value) { + this.requestField("is_sgw_instance", value); + return this; + } + public APIRequestGet requestPartnerNameField () { + return this.requestPartnerNameField(true); + } + public APIRequestGet requestPartnerNameField (boolean value) { + this.requestField("partner_name", value); + return this; + } public APIRequestGet requestPixelIdField () { return this.requestPixelIdField(true); } @@ -610,12 +708,19 @@ public OpenBridgeConfiguration getLastResponse() { } public static final String[] PARAMS = { "active", + "cloud_provider", + "cloud_region", + "destination_id", "endpoint", "fallback_domain", "fallback_domain_enabled", + "first_party_domain", "host_business_id", "host_external_id", "instance_id", + "instance_version", + "is_sgw_instance", + "partner_name", }; public static final String[] FIELDS = { @@ -684,6 +789,21 @@ public APIRequestUpdate setActive (String active) { return this; } + public APIRequestUpdate setCloudProvider (String cloudProvider) { + this.setParam("cloud_provider", cloudProvider); + return this; + } + + public APIRequestUpdate setCloudRegion (String cloudRegion) { + this.setParam("cloud_region", cloudRegion); + return this; + } + + public APIRequestUpdate setDestinationId (String destinationId) { + this.setParam("destination_id", destinationId); + return this; + } + public APIRequestUpdate setEndpoint (String endpoint) { this.setParam("endpoint", endpoint); return this; @@ -703,6 +823,11 @@ public APIRequestUpdate setFallbackDomainEnabled (String fallbackDomainEnabled) return this; } + public APIRequestUpdate setFirstPartyDomain (String firstPartyDomain) { + this.setParam("first_party_domain", firstPartyDomain); + return this; + } + public APIRequestUpdate setHostBusinessId (Long hostBusinessId) { this.setParam("host_business_id", hostBusinessId); return this; @@ -722,6 +847,25 @@ public APIRequestUpdate setInstanceId (String instanceId) { return this; } + public APIRequestUpdate setInstanceVersion (String instanceVersion) { + this.setParam("instance_version", instanceVersion); + return this; + } + + public APIRequestUpdate setIsSgwInstance (Boolean isSgwInstance) { + this.setParam("is_sgw_instance", isSgwInstance); + return this; + } + public APIRequestUpdate setIsSgwInstance (String isSgwInstance) { + this.setParam("is_sgw_instance", isSgwInstance); + return this; + } + + public APIRequestUpdate setPartnerName (String partnerName) { + this.setParam("partner_name", partnerName); + return this; + } + public APIRequestUpdate requestAllFields () { return this.requestAllFields(true); } @@ -776,13 +920,20 @@ public APIRequestUpdate requestField (String field, boolean value) { public OpenBridgeConfiguration copyFrom(OpenBridgeConfiguration instance) { this.mActive = instance.mActive; + this.mCloudProvider = instance.mCloudProvider; + this.mCloudRegion = instance.mCloudRegion; + this.mDestinationId = instance.mDestinationId; this.mEndpoint = instance.mEndpoint; this.mFallbackDomain = instance.mFallbackDomain; this.mFallbackDomainEnabled = instance.mFallbackDomainEnabled; + this.mFirstPartyDomain = instance.mFirstPartyDomain; this.mHostBusinessId = instance.mHostBusinessId; this.mHostExternalId = instance.mHostExternalId; this.mId = instance.mId; this.mInstanceId = instance.mInstanceId; + this.mInstanceVersion = instance.mInstanceVersion; + this.mIsSgwInstance = instance.mIsSgwInstance; + this.mPartnerName = instance.mPartnerName; this.mPixelId = instance.mPixelId; this.context = instance.context; this.rawValue = instance.rawValue; diff --git a/src/main/java/com/facebook/ads/sdk/Page.java b/src/main/java/com/facebook/ads/sdk/Page.java index f19db64c..0484de06 100644 --- a/src/main/java/com/facebook/ads/sdk/Page.java +++ b/src/main/java/com/facebook/ads/sdk/Page.java @@ -648,10 +648,6 @@ public APIRequestGetChatPlugin getChatPlugin() { return new APIRequestGetChatPlugin(this.getPrefixedId().toString(), context); } - public APIRequestCreateChatPlugin createChatPlugin() { - return new APIRequestCreateChatPlugin(this.getPrefixedId().toString(), context); - } - public APIRequestGetCommerceMerchantSettings getCommerceMerchantSettings() { return new APIRequestGetCommerceMerchantSettings(this.getPrefixedId().toString(), context); } @@ -800,6 +796,18 @@ public APIRequestCreateMessageAttachment createMessageAttachment() { return new APIRequestCreateMessageAttachment(this.getPrefixedId().toString(), context); } + public APIRequestDeleteMessageTemplates deleteMessageTemplates() { + return new APIRequestDeleteMessageTemplates(this.getPrefixedId().toString(), context); + } + + public APIRequestGetMessageTemplates getMessageTemplates() { + return new APIRequestGetMessageTemplates(this.getPrefixedId().toString(), context); + } + + public APIRequestCreateMessageTemplate createMessageTemplate() { + return new APIRequestCreateMessageTemplate(this.getPrefixedId().toString(), context); + } + public APIRequestCreateMessage createMessage() { return new APIRequestCreateMessage(this.getPrefixedId().toString(), context); } @@ -6348,223 +6356,6 @@ public APIRequestGetChatPlugin requestWelcomeScreenGreetingField (boolean value) } } - public static class APIRequestCreateChatPlugin extends APIRequest { - - Page lastResponse = null; - @Override - public Page getLastResponse() { - return lastResponse; - } - public static final String[] PARAMS = { - "alignment", - "desktop_bottom_spacing", - "desktop_side_spacing", - "entry_point_icon", - "entry_point_label", - "greeting_dialog_display", - "guest_chat_mode", - "mobile_bottom_spacing", - "mobile_chat_display", - "mobile_side_spacing", - "theme_color", - "welcome_screen_greeting", - }; - - public static final String[] FIELDS = { - }; - - @Override - public Page parseResponse(String response, String header) throws APIException { - return Page.parseResponse(response, getContext(), this, header).head(); - } - - @Override - public Page execute() throws APIException { - return execute(new HashMap()); - } - - @Override - public Page 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 Page apply(ResponseWrapper result) { - try { - return APIRequestCreateChatPlugin.this.parseResponse(result.getBody(), result.getHeader()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }, - MoreExecutors.directExecutor() - ); - }; - - public APIRequestCreateChatPlugin(String nodeId, APIContext context) { - super(context, nodeId, "/chat_plugin", "POST", Arrays.asList(PARAMS)); - } - - @Override - public APIRequestCreateChatPlugin setParam(String param, Object value) { - setParamInternal(param, value); - return this; - } - - @Override - public APIRequestCreateChatPlugin setParams(Map params) { - setParamsInternal(params); - return this; - } - - - public APIRequestCreateChatPlugin setAlignment (Page.EnumAlignment alignment) { - this.setParam("alignment", alignment); - return this; - } - public APIRequestCreateChatPlugin setAlignment (String alignment) { - this.setParam("alignment", alignment); - return this; - } - - public APIRequestCreateChatPlugin setDesktopBottomSpacing (Long desktopBottomSpacing) { - this.setParam("desktop_bottom_spacing", desktopBottomSpacing); - return this; - } - public APIRequestCreateChatPlugin setDesktopBottomSpacing (String desktopBottomSpacing) { - this.setParam("desktop_bottom_spacing", desktopBottomSpacing); - return this; - } - - public APIRequestCreateChatPlugin setDesktopSideSpacing (Long desktopSideSpacing) { - this.setParam("desktop_side_spacing", desktopSideSpacing); - return this; - } - public APIRequestCreateChatPlugin setDesktopSideSpacing (String desktopSideSpacing) { - this.setParam("desktop_side_spacing", desktopSideSpacing); - return this; - } - - public APIRequestCreateChatPlugin setEntryPointIcon (Page.EnumEntryPointIcon entryPointIcon) { - this.setParam("entry_point_icon", entryPointIcon); - return this; - } - public APIRequestCreateChatPlugin setEntryPointIcon (String entryPointIcon) { - this.setParam("entry_point_icon", entryPointIcon); - return this; - } - - public APIRequestCreateChatPlugin setEntryPointLabel (Page.EnumEntryPointLabel entryPointLabel) { - this.setParam("entry_point_label", entryPointLabel); - return this; - } - public APIRequestCreateChatPlugin setEntryPointLabel (String entryPointLabel) { - this.setParam("entry_point_label", entryPointLabel); - return this; - } - - public APIRequestCreateChatPlugin setGreetingDialogDisplay (Page.EnumGreetingDialogDisplay greetingDialogDisplay) { - this.setParam("greeting_dialog_display", greetingDialogDisplay); - return this; - } - public APIRequestCreateChatPlugin setGreetingDialogDisplay (String greetingDialogDisplay) { - this.setParam("greeting_dialog_display", greetingDialogDisplay); - return this; - } - - public APIRequestCreateChatPlugin setGuestChatMode (Page.EnumGuestChatMode guestChatMode) { - this.setParam("guest_chat_mode", guestChatMode); - return this; - } - public APIRequestCreateChatPlugin setGuestChatMode (String guestChatMode) { - this.setParam("guest_chat_mode", guestChatMode); - return this; - } - - public APIRequestCreateChatPlugin setMobileBottomSpacing (Long mobileBottomSpacing) { - this.setParam("mobile_bottom_spacing", mobileBottomSpacing); - return this; - } - public APIRequestCreateChatPlugin setMobileBottomSpacing (String mobileBottomSpacing) { - this.setParam("mobile_bottom_spacing", mobileBottomSpacing); - return this; - } - - public APIRequestCreateChatPlugin setMobileChatDisplay (Page.EnumMobileChatDisplay mobileChatDisplay) { - this.setParam("mobile_chat_display", mobileChatDisplay); - return this; - } - public APIRequestCreateChatPlugin setMobileChatDisplay (String mobileChatDisplay) { - this.setParam("mobile_chat_display", mobileChatDisplay); - return this; - } - - public APIRequestCreateChatPlugin setMobileSideSpacing (Long mobileSideSpacing) { - this.setParam("mobile_side_spacing", mobileSideSpacing); - return this; - } - public APIRequestCreateChatPlugin setMobileSideSpacing (String mobileSideSpacing) { - this.setParam("mobile_side_spacing", mobileSideSpacing); - return this; - } - - public APIRequestCreateChatPlugin setThemeColor (String themeColor) { - this.setParam("theme_color", themeColor); - return this; - } - - public APIRequestCreateChatPlugin setWelcomeScreenGreeting (String welcomeScreenGreeting) { - this.setParam("welcome_screen_greeting", welcomeScreenGreeting); - return this; - } - - public APIRequestCreateChatPlugin requestAllFields () { - return this.requestAllFields(true); - } - - public APIRequestCreateChatPlugin requestAllFields (boolean value) { - for (String field : FIELDS) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateChatPlugin requestFields (List fields) { - return this.requestFields(fields, true); - } - - @Override - public APIRequestCreateChatPlugin requestFields (List fields, boolean value) { - for (String field : fields) { - this.requestField(field, value); - } - return this; - } - - @Override - public APIRequestCreateChatPlugin requestField (String field) { - this.requestField(field, true); - return this; - } - - @Override - public APIRequestCreateChatPlugin requestField (String field, boolean value) { - this.requestFieldInternal(field, value); - return this; - } - - } - public static class APIRequestGetCommerceMerchantSettings extends APIRequest { APINodeList lastResponse = null; @@ -11505,7 +11296,6 @@ public Page getLastResponse() { "text_format_metadata", "text_format_preset_id", "text_only_place", - "throwback_camera_roll_media", "thumbnail", "time_since_original_post", "title", @@ -12255,11 +12045,6 @@ public APIRequestCreateFeed setTextOnlyPlace (String textOnlyPlace) { return this; } - public APIRequestCreateFeed setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateFeed setThumbnail (File thumbnail) { this.setParam("thumbnail", thumbnail); return this; @@ -14793,6 +14578,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -14920,6 +14706,13 @@ public APIRequestGetInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -15283,6 +15076,7 @@ public LeadgenForm getLastResponse() { "questions", "thank_you_page", "tracking_parameters", + "upload_gated_file", }; public static final String[] FIELDS = { @@ -15465,6 +15259,15 @@ public APIRequestCreateLeadGenForm setTrackingParameters (String trackingParamet return this; } + public APIRequestCreateLeadGenForm setUploadGatedFile (File uploadGatedFile) { + this.setParam("upload_gated_file", uploadGatedFile); + return this; + } + public APIRequestCreateLeadGenForm setUploadGatedFile (String uploadGatedFile) { + this.setParam("upload_gated_file", uploadGatedFile); + return this; + } + public APIRequestCreateLeadGenForm requestAllFields () { return this.requestAllFields(true); } @@ -19638,6 +19441,527 @@ public APIRequestCreateMessageAttachment requestField (String field, boolean val } + public static class APIRequestDeleteMessageTemplates extends APIRequest { + + APINodeList lastResponse = null; + @Override + public APINodeList getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "name", + "template_id", + }; + + public static final String[] FIELDS = { + }; + + @Override + public APINodeList parseResponse(String response, String header) throws APIException { + return APINode.parseResponse(response, getContext(), this, header); + } + + @Override + public APINodeList execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public APINodeList execute(Map extraParams) throws APIException { + ResponseWrapper rw = executeInternal(extraParams); + lastResponse = parseResponse(rw.getBody(),rw.getHeader()); + return lastResponse; + } + + public ListenableFuture> executeAsync() throws APIException { + return executeAsync(new HashMap()); + }; + + public ListenableFuture> executeAsync(Map extraParams) throws APIException { + return Futures.transform( + executeAsyncInternal(extraParams), + new Function>() { + public APINodeList apply(ResponseWrapper result) { + try { + return APIRequestDeleteMessageTemplates.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestDeleteMessageTemplates(String nodeId, APIContext context) { + super(context, nodeId, "/message_templates", "DELETE", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestDeleteMessageTemplates setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestDeleteMessageTemplates setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestDeleteMessageTemplates setName (String name) { + this.setParam("name", name); + return this; + } + + public APIRequestDeleteMessageTemplates setTemplateId (String templateId) { + this.setParam("template_id", templateId); + return this; + } + + public APIRequestDeleteMessageTemplates requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestDeleteMessageTemplates requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestDeleteMessageTemplates requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestDeleteMessageTemplates requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestDeleteMessageTemplates requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestDeleteMessageTemplates requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + + public static class APIRequestGetMessageTemplates extends APIRequest { + + APINodeList lastResponse = null; + @Override + public APINodeList getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "category", + "content", + "language", + "name", + "name_or_content", + "status", + }; + + public static final String[] FIELDS = { + "category", + "components", + "creation_time", + "id", + "language", + "language_count", + "last_updated_time", + "library_template_name", + "name", + "rejected_reason", + "status", + }; + + @Override + public APINodeList parseResponse(String response, String header) throws APIException { + return MessengerBusinessTemplate.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 APIRequestGetMessageTemplates.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestGetMessageTemplates(String nodeId, APIContext context) { + super(context, nodeId, "/message_templates", "GET", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestGetMessageTemplates setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestGetMessageTemplates setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestGetMessageTemplates setCategory (List category) { + this.setParam("category", category); + return this; + } + public APIRequestGetMessageTemplates setCategory (String category) { + this.setParam("category", category); + return this; + } + + public APIRequestGetMessageTemplates setContent (String content) { + this.setParam("content", content); + return this; + } + + public APIRequestGetMessageTemplates setLanguage (List language) { + this.setParam("language", language); + return this; + } + public APIRequestGetMessageTemplates setLanguage (String language) { + this.setParam("language", language); + return this; + } + + public APIRequestGetMessageTemplates setName (String name) { + this.setParam("name", name); + return this; + } + + public APIRequestGetMessageTemplates setNameOrContent (String nameOrContent) { + this.setParam("name_or_content", nameOrContent); + return this; + } + + public APIRequestGetMessageTemplates setStatus (List status) { + this.setParam("status", status); + return this; + } + public APIRequestGetMessageTemplates setStatus (String status) { + this.setParam("status", status); + return this; + } + + public APIRequestGetMessageTemplates requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestGetMessageTemplates requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetMessageTemplates requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestGetMessageTemplates requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestGetMessageTemplates requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestGetMessageTemplates requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + public APIRequestGetMessageTemplates requestCategoryField () { + return this.requestCategoryField(true); + } + public APIRequestGetMessageTemplates requestCategoryField (boolean value) { + this.requestField("category", value); + return this; + } + public APIRequestGetMessageTemplates requestComponentsField () { + return this.requestComponentsField(true); + } + public APIRequestGetMessageTemplates requestComponentsField (boolean value) { + this.requestField("components", value); + return this; + } + public APIRequestGetMessageTemplates requestCreationTimeField () { + return this.requestCreationTimeField(true); + } + public APIRequestGetMessageTemplates requestCreationTimeField (boolean value) { + this.requestField("creation_time", value); + return this; + } + public APIRequestGetMessageTemplates requestIdField () { + return this.requestIdField(true); + } + public APIRequestGetMessageTemplates requestIdField (boolean value) { + this.requestField("id", value); + return this; + } + public APIRequestGetMessageTemplates requestLanguageField () { + return this.requestLanguageField(true); + } + public APIRequestGetMessageTemplates requestLanguageField (boolean value) { + this.requestField("language", value); + return this; + } + public APIRequestGetMessageTemplates requestLanguageCountField () { + return this.requestLanguageCountField(true); + } + public APIRequestGetMessageTemplates requestLanguageCountField (boolean value) { + this.requestField("language_count", value); + return this; + } + public APIRequestGetMessageTemplates requestLastUpdatedTimeField () { + return this.requestLastUpdatedTimeField(true); + } + public APIRequestGetMessageTemplates requestLastUpdatedTimeField (boolean value) { + this.requestField("last_updated_time", value); + return this; + } + public APIRequestGetMessageTemplates requestLibraryTemplateNameField () { + return this.requestLibraryTemplateNameField(true); + } + public APIRequestGetMessageTemplates requestLibraryTemplateNameField (boolean value) { + this.requestField("library_template_name", value); + return this; + } + public APIRequestGetMessageTemplates requestNameField () { + return this.requestNameField(true); + } + public APIRequestGetMessageTemplates requestNameField (boolean value) { + this.requestField("name", value); + return this; + } + public APIRequestGetMessageTemplates requestRejectedReasonField () { + return this.requestRejectedReasonField(true); + } + public APIRequestGetMessageTemplates requestRejectedReasonField (boolean value) { + this.requestField("rejected_reason", value); + return this; + } + public APIRequestGetMessageTemplates requestStatusField () { + return this.requestStatusField(true); + } + public APIRequestGetMessageTemplates requestStatusField (boolean value) { + this.requestField("status", value); + return this; + } + } + + public static class APIRequestCreateMessageTemplate extends APIRequest { + + Page lastResponse = null; + @Override + public Page getLastResponse() { + return lastResponse; + } + public static final String[] PARAMS = { + "category", + "components", + "example", + "language", + "library_template_button_inputs", + "library_template_name", + "name", + }; + + public static final String[] FIELDS = { + }; + + @Override + public Page parseResponse(String response, String header) throws APIException { + return Page.parseResponse(response, getContext(), this, header).head(); + } + + @Override + public Page execute() throws APIException { + return execute(new HashMap()); + } + + @Override + public Page 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 Page apply(ResponseWrapper result) { + try { + return APIRequestCreateMessageTemplate.this.parseResponse(result.getBody(), result.getHeader()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }, + MoreExecutors.directExecutor() + ); + }; + + public APIRequestCreateMessageTemplate(String nodeId, APIContext context) { + super(context, nodeId, "/message_templates", "POST", Arrays.asList(PARAMS)); + } + + @Override + public APIRequestCreateMessageTemplate setParam(String param, Object value) { + setParamInternal(param, value); + return this; + } + + @Override + public APIRequestCreateMessageTemplate setParams(Map params) { + setParamsInternal(params); + return this; + } + + + public APIRequestCreateMessageTemplate setCategory (Page.EnumCategory category) { + this.setParam("category", category); + return this; + } + public APIRequestCreateMessageTemplate setCategory (String category) { + this.setParam("category", category); + return this; + } + + public APIRequestCreateMessageTemplate setComponents (List> components) { + this.setParam("components", components); + return this; + } + public APIRequestCreateMessageTemplate setComponents (String components) { + this.setParam("components", components); + return this; + } + + public APIRequestCreateMessageTemplate setExample (Map example) { + this.setParam("example", example); + return this; + } + public APIRequestCreateMessageTemplate setExample (String example) { + this.setParam("example", example); + return this; + } + + public APIRequestCreateMessageTemplate setLanguage (String language) { + this.setParam("language", language); + return this; + } + + public APIRequestCreateMessageTemplate setLibraryTemplateButtonInputs (List> libraryTemplateButtonInputs) { + this.setParam("library_template_button_inputs", libraryTemplateButtonInputs); + return this; + } + public APIRequestCreateMessageTemplate setLibraryTemplateButtonInputs (String libraryTemplateButtonInputs) { + this.setParam("library_template_button_inputs", libraryTemplateButtonInputs); + return this; + } + + public APIRequestCreateMessageTemplate setLibraryTemplateName (String libraryTemplateName) { + this.setParam("library_template_name", libraryTemplateName); + return this; + } + + public APIRequestCreateMessageTemplate setName (String name) { + this.setParam("name", name); + return this; + } + + public APIRequestCreateMessageTemplate requestAllFields () { + return this.requestAllFields(true); + } + + public APIRequestCreateMessageTemplate requestAllFields (boolean value) { + for (String field : FIELDS) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateMessageTemplate requestFields (List fields) { + return this.requestFields(fields, true); + } + + @Override + public APIRequestCreateMessageTemplate requestFields (List fields, boolean value) { + for (String field : fields) { + this.requestField(field, value); + } + return this; + } + + @Override + public APIRequestCreateMessageTemplate requestField (String field) { + this.requestField(field, true); + return this; + } + + @Override + public APIRequestCreateMessageTemplate requestField (String field, boolean value) { + this.requestFieldInternal(field, value); + return this; + } + + } + public static class APIRequestCreateMessage extends APIRequest { Page lastResponse = null; @@ -19968,6 +20292,7 @@ public APINodeList getLastResponse() { public static final String[] FIELDS = { "audio_enabled", + "icon_enabled", }; @Override @@ -20067,6 +20392,13 @@ public APIRequestGetMessengerCallSettings requestAudioEnabledField (boolean valu this.requestField("audio_enabled", value); return this; } + public APIRequestGetMessengerCallSettings requestIconEnabledField () { + return this.requestIconEnabledField(true); + } + public APIRequestGetMessengerCallSettings requestIconEnabledField (boolean value) { + this.requestField("icon_enabled", value); + return this; + } } public static class APIRequestCreateMessengerCallSetting extends APIRequest { @@ -20078,6 +20410,7 @@ public Page getLastResponse() { } public static final String[] PARAMS = { "audio_enabled", + "icon_enabled", }; public static final String[] FIELDS = { @@ -20146,6 +20479,15 @@ public APIRequestCreateMessengerCallSetting setAudioEnabled (String audioEnabled return this; } + public APIRequestCreateMessengerCallSetting setIconEnabled (Boolean iconEnabled) { + this.setParam("icon_enabled", iconEnabled); + return this; + } + public APIRequestCreateMessengerCallSetting setIconEnabled (String iconEnabled) { + this.setParam("icon_enabled", iconEnabled); + return this; + } + public APIRequestCreateMessengerCallSetting requestAllFields () { return this.requestAllFields(true); } @@ -21585,6 +21927,7 @@ public APINodeList getLastResponse() { "followed_by_count", "has_profile_picture", "id", + "ig_user_id", "is_private", "is_published", "media_count", @@ -21712,6 +22055,13 @@ public APIRequestGetPageBackedInstagramAccounts requestIdField (boolean value) { this.requestField("id", value); return this; } + public APIRequestGetPageBackedInstagramAccounts requestIgUserIdField () { + return this.requestIgUserIdField(true); + } + public APIRequestGetPageBackedInstagramAccounts requestIgUserIdField (boolean value) { + this.requestField("ig_user_id", value); + return this; + } public APIRequestGetPageBackedInstagramAccounts requestIsPrivateField () { return this.requestIsPrivateField(true); } @@ -25912,6 +26262,7 @@ public APINodeList getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -25932,6 +26283,7 @@ public APINodeList getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -26173,6 +26525,13 @@ public APIRequestGetRoles requestInspirationalPeopleField (boolean value) { this.requestField("inspirational_people", value); return this; } + public APIRequestGetRoles requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGetRoles requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGetRoles requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -26313,6 +26672,13 @@ public APIRequestGetRoles requestRelationshipStatusField (boolean value) { this.requestField("relationship_status", value); return this; } + public APIRequestGetRoles requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGetRoles requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGetRoles requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } @@ -27192,6 +27558,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -27656,6 +28023,13 @@ public APIRequestGetSecondaryReceivers requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetSecondaryReceivers requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetSecondaryReceivers requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetSecondaryReceivers requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -28823,6 +29197,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -29278,6 +29653,13 @@ public APIRequestGetSubscribedApps requestDescriptionField (boolean value) { this.requestField("description", value); return this; } + public APIRequestGetSubscribedApps requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetSubscribedApps requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetSubscribedApps requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -33425,7 +33807,6 @@ public AdVideo getLastResponse() { "swap_mode", "targeting", "text_format_metadata", - "throwback_camera_roll_media", "thumb", "time_since_original_post", "title", @@ -34044,11 +34425,6 @@ public APIRequestCreateVideo setTextFormatMetadata (String textFormatMetadata) { return this; } - public APIRequestCreateVideo setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateVideo setThumb (File thumb) { this.setParam("thumb", thumb); return this; @@ -37413,130 +37789,6 @@ public String toString() { } } - public static enum EnumAlignment { - @SerializedName("LEFT") - VALUE_LEFT("LEFT"), - @SerializedName("RIGHT") - VALUE_RIGHT("RIGHT"), - ; - - private String value; - - private EnumAlignment(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - - public static enum EnumEntryPointIcon { - @SerializedName("CHAT_ANGULAR_ICON") - VALUE_CHAT_ANGULAR_ICON("CHAT_ANGULAR_ICON"), - @SerializedName("CHAT_ROUND_ICON") - VALUE_CHAT_ROUND_ICON("CHAT_ROUND_ICON"), - @SerializedName("MESSENGER_ICON") - VALUE_MESSENGER_ICON("MESSENGER_ICON"), - @SerializedName("NONE") - VALUE_NONE("NONE"), - ; - - private String value; - - private EnumEntryPointIcon(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - - public static enum EnumEntryPointLabel { - @SerializedName("ASK_US") - VALUE_ASK_US("ASK_US"), - @SerializedName("CHAT") - VALUE_CHAT("CHAT"), - @SerializedName("HELP") - VALUE_HELP("HELP"), - @SerializedName("NONE") - VALUE_NONE("NONE"), - ; - - private String value; - - private EnumEntryPointLabel(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - - public static enum EnumGreetingDialogDisplay { - @SerializedName("HIDE") - VALUE_HIDE("HIDE"), - @SerializedName("SHOW") - VALUE_SHOW("SHOW"), - @SerializedName("WELCOME_MESSAGE") - VALUE_WELCOME_MESSAGE("WELCOME_MESSAGE"), - ; - - private String value; - - private EnumGreetingDialogDisplay(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - - public static enum EnumGuestChatMode { - @SerializedName("DISABLED") - VALUE_DISABLED("DISABLED"), - @SerializedName("ENABLED") - VALUE_ENABLED("ENABLED"), - ; - - private String value; - - private EnumGuestChatMode(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - - public static enum EnumMobileChatDisplay { - @SerializedName("APP_SWITCH") - VALUE_APP_SWITCH("APP_SWITCH"), - @SerializedName("CHAT_TAB") - VALUE_CHAT_TAB("CHAT_TAB"), - ; - - private String value; - - private EnumMobileChatDisplay(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } - } - public static enum EnumBackdatedTimeGranularity { @SerializedName("day") VALUE_DAY("day"), @@ -37694,6 +37946,23 @@ public String toString() { } } + public static enum EnumCategory { + @SerializedName("UTILITY") + VALUE_UTILITY("UTILITY"), + ; + + private String value; + + private EnumCategory(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + public static enum EnumMessagingType { @SerializedName("MESSAGE_TAG") VALUE_MESSAGE_TAG("MESSAGE_TAG"), @@ -38014,8 +38283,6 @@ public static enum EnumSubscribedFields { VALUE_MISSION("mission"), @SerializedName("name") VALUE_NAME("name"), - @SerializedName("otp_verification") - VALUE_OTP_VERIFICATION("otp_verification"), @SerializedName("page_about_story") VALUE_PAGE_ABOUT_STORY("page_about_story"), @SerializedName("page_change_proposal") diff --git a/src/main/java/com/facebook/ads/sdk/PartnershipAdsIdentity.java b/src/main/java/com/facebook/ads/sdk/PartnershipAdsIdentity.java index bd78abe1..0b3d13da 100644 --- a/src/main/java/com/facebook/ads/sdk/PartnershipAdsIdentity.java +++ b/src/main/java/com/facebook/ads/sdk/PartnershipAdsIdentity.java @@ -41,6 +41,8 @@ * */ public class PartnershipAdsIdentity extends APINode { + @SerializedName("is_saved") + private Boolean mIsSaved = null; @SerializedName("post_types") private List mPostTypes = null; @SerializedName("secondary_identities") @@ -196,6 +198,15 @@ public String toString() { } + public Boolean getFieldIsSaved() { + return mIsSaved; + } + + public PartnershipAdsIdentity setFieldIsSaved(Boolean value) { + this.mIsSaved = value; + return this; + } + public List getFieldPostTypes() { return mPostTypes; } @@ -231,6 +242,7 @@ public PartnershipAdsIdentity setFieldSecondaryIdentities(List value) { } public PartnershipAdsIdentity copyFrom(PartnershipAdsIdentity instance) { + this.mIsSaved = instance.mIsSaved; this.mPostTypes = instance.mPostTypes; this.mSecondaryIdentities = instance.mSecondaryIdentities; this.context = instance.context; diff --git a/src/main/java/com/facebook/ads/sdk/ProductCatalog.java b/src/main/java/com/facebook/ads/sdk/ProductCatalog.java index 1c8f1912..c1a67dd7 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductCatalog.java +++ b/src/main/java/com/facebook/ads/sdk/ProductCatalog.java @@ -3373,6 +3373,12 @@ public APINodeList getLastResponse() { "applinks", "category_specific_fields", "currency", + "custom_label_0", + "custom_label_1", + "custom_label_2", + "custom_number_0", + "custom_number_1", + "custom_number_2", "description", "destination_id", "id", @@ -3525,6 +3531,48 @@ public APIRequestGetDestinations requestCurrencyField (boolean value) { this.requestField("currency", value); return this; } + public APIRequestGetDestinations requestCustomLabel0Field () { + return this.requestCustomLabel0Field(true); + } + public APIRequestGetDestinations requestCustomLabel0Field (boolean value) { + this.requestField("custom_label_0", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel1Field () { + return this.requestCustomLabel1Field(true); + } + public APIRequestGetDestinations requestCustomLabel1Field (boolean value) { + this.requestField("custom_label_1", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel2Field () { + return this.requestCustomLabel2Field(true); + } + public APIRequestGetDestinations requestCustomLabel2Field (boolean value) { + this.requestField("custom_label_2", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber0Field () { + return this.requestCustomNumber0Field(true); + } + public APIRequestGetDestinations requestCustomNumber0Field (boolean value) { + this.requestField("custom_number_0", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber1Field () { + return this.requestCustomNumber1Field(true); + } + public APIRequestGetDestinations requestCustomNumber1Field (boolean value) { + this.requestField("custom_number_1", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber2Field () { + return this.requestCustomNumber2Field(true); + } + public APIRequestGetDestinations requestCustomNumber2Field (boolean value) { + this.requestField("custom_number_2", value); + return this; + } public APIRequestGetDestinations requestDescriptionField () { return this.requestDescriptionField(true); } @@ -8384,6 +8432,7 @@ public APINodeList getLastResponse() { "start_date", "tags", "url", + "vendor_id", "video_fetch_status", "visibility", "wa_compliance_category", @@ -9049,6 +9098,13 @@ public APIRequestGetProducts requestUrlField (boolean value) { this.requestField("url", value); return this; } + public APIRequestGetProducts requestVendorIdField () { + return this.requestVendorIdField(true); + } + public APIRequestGetProducts requestVendorIdField (boolean value) { + this.requestField("vendor_id", value); + return this; + } public APIRequestGetProducts requestVideoFetchStatusField () { return this.requestVideoFetchStatusField(true); } @@ -12114,8 +12170,6 @@ public static enum EnumSegmentUseCases { VALUE_COLLAB_ADS_FOR_MARKETPLACE_PARTNER("COLLAB_ADS_FOR_MARKETPLACE_PARTNER"), @SerializedName("COLLAB_ADS_SEGMENT_WITHOUT_SEGMENT_SYNCING") VALUE_COLLAB_ADS_SEGMENT_WITHOUT_SEGMENT_SYNCING("COLLAB_ADS_SEGMENT_WITHOUT_SEGMENT_SYNCING"), - @SerializedName("CREATORS_AS_SELLERS") - VALUE_CREATORS_AS_SELLERS("CREATORS_AS_SELLERS"), @SerializedName("DIGITAL_CIRCULARS") VALUE_DIGITAL_CIRCULARS("DIGITAL_CIRCULARS"), @SerializedName("FB_LIVE_SHOPPING") diff --git a/src/main/java/com/facebook/ads/sdk/ProductFeed.java b/src/main/java/com/facebook/ads/sdk/ProductFeed.java index 109e9c77..a43bdd48 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductFeed.java +++ b/src/main/java/com/facebook/ads/sdk/ProductFeed.java @@ -840,6 +840,12 @@ public APINodeList getLastResponse() { "applinks", "category_specific_fields", "currency", + "custom_label_0", + "custom_label_1", + "custom_label_2", + "custom_number_0", + "custom_number_1", + "custom_number_2", "description", "destination_id", "id", @@ -992,6 +998,48 @@ public APIRequestGetDestinations requestCurrencyField (boolean value) { this.requestField("currency", value); return this; } + public APIRequestGetDestinations requestCustomLabel0Field () { + return this.requestCustomLabel0Field(true); + } + public APIRequestGetDestinations requestCustomLabel0Field (boolean value) { + this.requestField("custom_label_0", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel1Field () { + return this.requestCustomLabel1Field(true); + } + public APIRequestGetDestinations requestCustomLabel1Field (boolean value) { + this.requestField("custom_label_1", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel2Field () { + return this.requestCustomLabel2Field(true); + } + public APIRequestGetDestinations requestCustomLabel2Field (boolean value) { + this.requestField("custom_label_2", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber0Field () { + return this.requestCustomNumber0Field(true); + } + public APIRequestGetDestinations requestCustomNumber0Field (boolean value) { + this.requestField("custom_number_0", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber1Field () { + return this.requestCustomNumber1Field(true); + } + public APIRequestGetDestinations requestCustomNumber1Field (boolean value) { + this.requestField("custom_number_1", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber2Field () { + return this.requestCustomNumber2Field(true); + } + public APIRequestGetDestinations requestCustomNumber2Field (boolean value) { + this.requestField("custom_number_2", value); + return this; + } public APIRequestGetDestinations requestDescriptionField () { return this.requestDescriptionField(true); } @@ -2610,6 +2658,7 @@ public APINodeList getLastResponse() { "start_date", "tags", "url", + "vendor_id", "video_fetch_status", "visibility", "wa_compliance_category", @@ -3266,6 +3315,13 @@ public APIRequestGetProducts requestUrlField (boolean value) { this.requestField("url", value); return this; } + public APIRequestGetProducts requestVendorIdField () { + return this.requestVendorIdField(true); + } + public APIRequestGetProducts requestVendorIdField (boolean value) { + this.requestField("vendor_id", value); + return this; + } public APIRequestGetProducts requestVideoFetchStatusField () { return this.requestVideoFetchStatusField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ProductGroup.java b/src/main/java/com/facebook/ads/sdk/ProductGroup.java index e96aa431..a5ef1fc3 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductGroup.java +++ b/src/main/java/com/facebook/ads/sdk/ProductGroup.java @@ -386,6 +386,7 @@ public APINodeList getLastResponse() { "start_date", "tags", "url", + "vendor_id", "video_fetch_status", "visibility", "wa_compliance_category", @@ -1006,6 +1007,13 @@ public APIRequestGetProducts requestUrlField (boolean value) { this.requestField("url", value); return this; } + public APIRequestGetProducts requestVendorIdField () { + return this.requestVendorIdField(true); + } + public APIRequestGetProducts requestVendorIdField (boolean value) { + this.requestField("vendor_id", value); + return this; + } public APIRequestGetProducts requestVideoFetchStatusField () { return this.requestVideoFetchStatusField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ProductItem.java b/src/main/java/com/facebook/ads/sdk/ProductItem.java index b7bd6a02..d2db26ff 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductItem.java +++ b/src/main/java/com/facebook/ads/sdk/ProductItem.java @@ -191,6 +191,8 @@ public class ProductItem extends APINode { private List mTags = null; @SerializedName("url") private String mUrl = null; + @SerializedName("vendor_id") + private String mVendorId = null; @SerializedName("video_fetch_status") private EnumVideoFetchStatus mVideoFetchStatus = null; @SerializedName("visibility") @@ -747,6 +749,10 @@ public String getFieldUrl() { return mUrl; } + public String getFieldVendorId() { + return mVendorId; + } + public EnumVideoFetchStatus getFieldVideoFetchStatus() { return mVideoFetchStatus; } @@ -1549,6 +1555,7 @@ public ProductItem getLastResponse() { "start_date", "tags", "url", + "vendor_id", "video_fetch_status", "visibility", "wa_compliance_category", @@ -2202,6 +2209,13 @@ public APIRequestGet requestUrlField (boolean value) { this.requestField("url", value); return this; } + public APIRequestGet requestVendorIdField () { + return this.requestVendorIdField(true); + } + public APIRequestGet requestVendorIdField (boolean value) { + this.requestField("vendor_id", value); + return this; + } public APIRequestGet requestVideoFetchStatusField () { return this.requestVideoFetchStatusField(true); } @@ -3771,6 +3785,20 @@ public static enum EnumErrorType { VALUE_ITEM_STALE_OUT_OF_STOCK("ITEM_STALE_OUT_OF_STOCK"), @SerializedName("MARKETPLACE_DISABLED_BY_USER") VALUE_MARKETPLACE_DISABLED_BY_USER("MARKETPLACE_DISABLED_BY_USER"), + @SerializedName("MARKETPLACE_PARTNER_LISTING_LIMIT_EXCEEDED") + VALUE_MARKETPLACE_PARTNER_LISTING_LIMIT_EXCEEDED("MARKETPLACE_PARTNER_LISTING_LIMIT_EXCEEDED"), + @SerializedName("MARKETPLACE_PARTNER_NOT_LOCAL_ITEM") + VALUE_MARKETPLACE_PARTNER_NOT_LOCAL_ITEM("MARKETPLACE_PARTNER_NOT_LOCAL_ITEM"), + @SerializedName("MARKETPLACE_PARTNER_NOT_SHIPPED_ITEM") + VALUE_MARKETPLACE_PARTNER_NOT_SHIPPED_ITEM("MARKETPLACE_PARTNER_NOT_SHIPPED_ITEM"), + @SerializedName("MARKETPLACE_PARTNER_POLICY_VIOLATION") + VALUE_MARKETPLACE_PARTNER_POLICY_VIOLATION("MARKETPLACE_PARTNER_POLICY_VIOLATION"), + @SerializedName("MARKETPLACE_PARTNER_RULE_LISTING_LIMIT_EXCEEDED") + VALUE_MARKETPLACE_PARTNER_RULE_LISTING_LIMIT_EXCEEDED("MARKETPLACE_PARTNER_RULE_LISTING_LIMIT_EXCEEDED"), + @SerializedName("MARKETPLACE_PARTNER_SELLER_BANNED") + VALUE_MARKETPLACE_PARTNER_SELLER_BANNED("MARKETPLACE_PARTNER_SELLER_BANNED"), + @SerializedName("MARKETPLACE_PARTNER_SELLER_NOT_VALID") + VALUE_MARKETPLACE_PARTNER_SELLER_NOT_VALID("MARKETPLACE_PARTNER_SELLER_NOT_VALID"), @SerializedName("MINI_SHOPS_DISABLED_BY_USER") VALUE_MINI_SHOPS_DISABLED_BY_USER("MINI_SHOPS_DISABLED_BY_USER"), @SerializedName("MISSING_CHECKOUT") @@ -4568,6 +4596,7 @@ public ProductItem copyFrom(ProductItem instance) { this.mStartDate = instance.mStartDate; this.mTags = instance.mTags; this.mUrl = instance.mUrl; + this.mVendorId = instance.mVendorId; this.mVideoFetchStatus = instance.mVideoFetchStatus; this.mVisibility = instance.mVisibility; this.mWaComplianceCategory = instance.mWaComplianceCategory; diff --git a/src/main/java/com/facebook/ads/sdk/ProductSet.java b/src/main/java/com/facebook/ads/sdk/ProductSet.java index 77dc2d00..49d5e1e3 100644 --- a/src/main/java/com/facebook/ads/sdk/ProductSet.java +++ b/src/main/java/com/facebook/ads/sdk/ProductSet.java @@ -746,6 +746,12 @@ public APINodeList getLastResponse() { "applinks", "category_specific_fields", "currency", + "custom_label_0", + "custom_label_1", + "custom_label_2", + "custom_number_0", + "custom_number_1", + "custom_number_2", "description", "destination_id", "id", @@ -898,6 +904,48 @@ public APIRequestGetDestinations requestCurrencyField (boolean value) { this.requestField("currency", value); return this; } + public APIRequestGetDestinations requestCustomLabel0Field () { + return this.requestCustomLabel0Field(true); + } + public APIRequestGetDestinations requestCustomLabel0Field (boolean value) { + this.requestField("custom_label_0", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel1Field () { + return this.requestCustomLabel1Field(true); + } + public APIRequestGetDestinations requestCustomLabel1Field (boolean value) { + this.requestField("custom_label_1", value); + return this; + } + public APIRequestGetDestinations requestCustomLabel2Field () { + return this.requestCustomLabel2Field(true); + } + public APIRequestGetDestinations requestCustomLabel2Field (boolean value) { + this.requestField("custom_label_2", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber0Field () { + return this.requestCustomNumber0Field(true); + } + public APIRequestGetDestinations requestCustomNumber0Field (boolean value) { + this.requestField("custom_number_0", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber1Field () { + return this.requestCustomNumber1Field(true); + } + public APIRequestGetDestinations requestCustomNumber1Field (boolean value) { + this.requestField("custom_number_1", value); + return this; + } + public APIRequestGetDestinations requestCustomNumber2Field () { + return this.requestCustomNumber2Field(true); + } + public APIRequestGetDestinations requestCustomNumber2Field (boolean value) { + this.requestField("custom_number_2", value); + return this; + } public APIRequestGetDestinations requestDescriptionField () { return this.requestDescriptionField(true); } @@ -2516,6 +2564,7 @@ public APINodeList getLastResponse() { "start_date", "tags", "url", + "vendor_id", "video_fetch_status", "visibility", "wa_compliance_category", @@ -3172,6 +3221,13 @@ public APIRequestGetProducts requestUrlField (boolean value) { this.requestField("url", value); return this; } + public APIRequestGetProducts requestVendorIdField () { + return this.requestVendorIdField(true); + } + public APIRequestGetProducts requestVendorIdField (boolean value) { + this.requestField("vendor_id", value); + return this; + } public APIRequestGetProducts requestVideoFetchStatusField () { return this.requestVideoFetchStatusField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/ReachFrequencyPrediction.java b/src/main/java/com/facebook/ads/sdk/ReachFrequencyPrediction.java index ee9be136..83f9c5b2 100644 --- a/src/main/java/com/facebook/ads/sdk/ReachFrequencyPrediction.java +++ b/src/main/java/com/facebook/ads/sdk/ReachFrequencyPrediction.java @@ -173,6 +173,8 @@ public class ReachFrequencyPrediction extends APINode { private String mOptimizationGoalName = null; @SerializedName("pause_periods") private List mPausePeriods = null; + @SerializedName("percent_reach_at_target_frequency") + private Long mPercentReachAtTargetFrequency = null; @SerializedName("placement_breakdown") private ReachFrequencyEstimatesPlacementBreakdown mPlacementBreakdown = null; @SerializedName("placement_breakdown_map") @@ -691,6 +693,10 @@ public List getFieldPausePeriods() { return mPausePeriods; } + public Long getFieldPercentReachAtTargetFrequency() { + return mPercentReachAtTargetFrequency; + } + public ReachFrequencyEstimatesPlacementBreakdown getFieldPlacementBreakdown() { return mPlacementBreakdown; } @@ -850,6 +856,7 @@ public ReachFrequencyPrediction getLastResponse() { "optimization_goal", "optimization_goal_name", "pause_periods", + "percent_reach_at_target_frequency", "placement_breakdown", "placement_breakdown_map", "plan_name", @@ -1424,6 +1431,13 @@ public APIRequestGet requestPausePeriodsField (boolean value) { this.requestField("pause_periods", value); return this; } + public APIRequestGet requestPercentReachAtTargetFrequencyField () { + return this.requestPercentReachAtTargetFrequencyField(true); + } + public APIRequestGet requestPercentReachAtTargetFrequencyField (boolean value) { + this.requestField("percent_reach_at_target_frequency", value); + return this; + } public APIRequestGet requestPlacementBreakdownField () { return this.requestPlacementBreakdownField(true); } @@ -1740,6 +1754,7 @@ public ReachFrequencyPrediction copyFrom(ReachFrequencyPrediction instance) { this.mOptimizationGoal = instance.mOptimizationGoal; this.mOptimizationGoalName = instance.mOptimizationGoalName; this.mPausePeriods = instance.mPausePeriods; + this.mPercentReachAtTargetFrequency = instance.mPercentReachAtTargetFrequency; this.mPlacementBreakdown = instance.mPlacementBreakdown; this.mPlacementBreakdownMap = instance.mPlacementBreakdownMap; this.mPlanName = instance.mPlanName; diff --git a/src/main/java/com/facebook/ads/sdk/RegionalRegulationIdentities.java b/src/main/java/com/facebook/ads/sdk/RegionalRegulationIdentities.java index 2f58178d..f80bb3b3 100644 --- a/src/main/java/com/facebook/ads/sdk/RegionalRegulationIdentities.java +++ b/src/main/java/com/facebook/ads/sdk/RegionalRegulationIdentities.java @@ -41,6 +41,10 @@ * */ public class RegionalRegulationIdentities extends APINode { + @SerializedName("australia_finserv_beneficiary") + private String mAustraliaFinservBeneficiary = null; + @SerializedName("australia_finserv_payer") + private String mAustraliaFinservPayer = null; @SerializedName("taiwan_finserv_beneficiary") private String mTaiwanFinservBeneficiary = null; @SerializedName("taiwan_finserv_payer") @@ -196,6 +200,24 @@ public String toString() { } + public String getFieldAustraliaFinservBeneficiary() { + return mAustraliaFinservBeneficiary; + } + + public RegionalRegulationIdentities setFieldAustraliaFinservBeneficiary(String value) { + this.mAustraliaFinservBeneficiary = value; + return this; + } + + public String getFieldAustraliaFinservPayer() { + return mAustraliaFinservPayer; + } + + public RegionalRegulationIdentities setFieldAustraliaFinservPayer(String value) { + this.mAustraliaFinservPayer = value; + return this; + } + public String getFieldTaiwanFinservBeneficiary() { return mTaiwanFinservBeneficiary; } @@ -231,6 +253,8 @@ public RegionalRegulationIdentities setFieldTaiwanFinservPayer(String value) { } public RegionalRegulationIdentities copyFrom(RegionalRegulationIdentities instance) { + this.mAustraliaFinservBeneficiary = instance.mAustraliaFinservBeneficiary; + this.mAustraliaFinservPayer = instance.mAustraliaFinservPayer; this.mTaiwanFinservBeneficiary = instance.mTaiwanFinservBeneficiary; this.mTaiwanFinservPayer = instance.mTaiwanFinservPayer; this.context = instance.context; diff --git a/src/main/java/com/facebook/ads/sdk/ShadowIGHashtag.java b/src/main/java/com/facebook/ads/sdk/ShadowIGHashtag.java index ea9ccd80..ab1ddb4c 100644 --- a/src/main/java/com/facebook/ads/sdk/ShadowIGHashtag.java +++ b/src/main/java/com/facebook/ads/sdk/ShadowIGHashtag.java @@ -297,6 +297,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -460,6 +461,13 @@ public APIRequestGetRecentMedia requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetRecentMedia requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetRecentMedia requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetRecentMedia requestLikeCountField () { return this.requestLikeCountField(true); } @@ -552,6 +560,7 @@ public APINodeList getLastResponse() { "ig_id", "is_comment_enabled", "is_shared_to_feed", + "legacy_instagram_media_id", "like_count", "media_product_type", "media_type", @@ -715,6 +724,13 @@ public APIRequestGetTopMedia requestIsSharedToFeedField (boolean value) { this.requestField("is_shared_to_feed", value); return this; } + public APIRequestGetTopMedia requestLegacyInstagramMediaIdField () { + return this.requestLegacyInstagramMediaIdField(true); + } + public APIRequestGetTopMedia requestLegacyInstagramMediaIdField (boolean value) { + this.requestField("legacy_instagram_media_id", value); + return this; + } public APIRequestGetTopMedia requestLikeCountField () { return this.requestLikeCountField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/SystemUser.java b/src/main/java/com/facebook/ads/sdk/SystemUser.java index 8ef7afd4..b9d32a75 100644 --- a/src/main/java/com/facebook/ads/sdk/SystemUser.java +++ b/src/main/java/com/facebook/ads/sdk/SystemUser.java @@ -351,6 +351,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -681,6 +682,13 @@ public APIRequestGetAssignedAdAccounts requestExistingCustomersField (boolean va this.requestField("existing_customers", value); return this; } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAssignedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } diff --git a/src/main/java/com/facebook/ads/sdk/User.java b/src/main/java/com/facebook/ads/sdk/User.java index a6815189..d7ba6f6b 100644 --- a/src/main/java/com/facebook/ads/sdk/User.java +++ b/src/main/java/com/facebook/ads/sdk/User.java @@ -75,6 +75,8 @@ public class User extends APINode { private String mIdForAvatars = null; @SerializedName("inspirational_people") private List mInspirationalPeople = null; + @SerializedName("instagram_user_self_asset") + private InstagramUser mInstagramUserSelfAsset = null; @SerializedName("install_type") private String mInstallType = null; @SerializedName("installed") @@ -115,6 +117,8 @@ public class User extends APINode { private String mQuotes = null; @SerializedName("relationship_status") private String mRelationshipStatus = null; + @SerializedName("religion") + private String mReligion = null; @SerializedName("shared_login_upgrade_required_by") private String mSharedLoginUpgradeRequiredBy = null; @SerializedName("short_name") @@ -642,6 +646,13 @@ public List getFieldInspirationalPeople() { return mInspirationalPeople; } + public InstagramUser getFieldInstagramUserSelfAsset() { + if (mInstagramUserSelfAsset != null) { + mInstagramUserSelfAsset.context = getContext(); + } + return mInstagramUserSelfAsset; + } + public String getFieldInstallType() { return mInstallType; } @@ -725,6 +736,10 @@ public String getFieldRelationshipStatus() { return mRelationshipStatus; } + public String getFieldReligion() { + return mReligion; + } + public String getFieldSharedLoginUpgradeRequiredBy() { return mSharedLoginUpgradeRequiredBy; } @@ -3085,6 +3100,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -3415,6 +3431,13 @@ public APIRequestGetAdAccounts requestExistingCustomersField (boolean value) { this.requestField("existing_customers", value); return this; } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -4452,6 +4475,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -4782,6 +4806,13 @@ public APIRequestGetAssignedAdAccounts requestExistingCustomersField (boolean va this.requestField("existing_customers", value); return this; } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetAssignedAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetAssignedAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -5132,6 +5163,7 @@ public APINodeList getLastResponse() { "deauth_callback_url", "default_share_mode", "description", + "enigma_config", "financial_id", "gdpv4_chrome_custom_tabs_enabled", "gdpv4_enabled", @@ -5587,6 +5619,13 @@ public APIRequestGetAssignedApplications requestDescriptionField (boolean value) this.requestField("description", value); return this; } + public APIRequestGetAssignedApplications requestEnigmaConfigField () { + return this.requestEnigmaConfigField(true); + } + public APIRequestGetAssignedApplications requestEnigmaConfigField (boolean value) { + this.requestField("enigma_config", value); + return this; + } public APIRequestGetAssignedApplications requestFinancialIdField () { return this.requestFinancialIdField(true); } @@ -10193,7 +10232,6 @@ public Post getLastResponse() { "text_format_metadata", "text_format_preset_id", "text_only_place", - "throwback_camera_roll_media", "thumbnail", "time_since_original_post", "title", @@ -10934,11 +10972,6 @@ public APIRequestCreateFeed setTextOnlyPlace (String textOnlyPlace) { return this; } - public APIRequestCreateFeed setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateFeed setThumbnail (File thumbnail) { this.setParam("thumbnail", thumbnail); return this; @@ -11079,6 +11112,7 @@ public APINodeList getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -11099,6 +11133,7 @@ public APINodeList getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -11331,6 +11366,13 @@ public APIRequestGetFriends requestInspirationalPeopleField (boolean value) { this.requestField("inspirational_people", value); return this; } + public APIRequestGetFriends requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGetFriends requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGetFriends requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -11471,6 +11513,13 @@ public APIRequestGetFriends requestRelationshipStatusField (boolean value) { this.requestField("relationship_status", value); return this; } + public APIRequestGetFriends requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGetFriends requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGetFriends requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } @@ -16857,6 +16906,7 @@ public APINodeList getLastResponse() { "end_advertiser", "end_advertiser_name", "existing_customers", + "expired_funding_source_details", "extended_credit_invoice_group", "failed_delivery_checks", "fb_entity", @@ -17187,6 +17237,13 @@ public APIRequestGetPersonalAdAccounts requestExistingCustomersField (boolean va this.requestField("existing_customers", value); return this; } + public APIRequestGetPersonalAdAccounts requestExpiredFundingSourceDetailsField () { + return this.requestExpiredFundingSourceDetailsField(true); + } + public APIRequestGetPersonalAdAccounts requestExpiredFundingSourceDetailsField (boolean value) { + this.requestField("expired_funding_source_details", value); + return this; + } public APIRequestGetPersonalAdAccounts requestExtendedCreditInvoiceGroupField () { return this.requestExtendedCreditInvoiceGroupField(true); } @@ -20187,7 +20244,6 @@ public AdVideo getLastResponse() { "start_offset", "swap_mode", "text_format_metadata", - "throwback_camera_roll_media", "thumb", "time_since_original_post", "title", @@ -20664,11 +20720,6 @@ public APIRequestCreateVideo setTextFormatMetadata (String textFormatMetadata) { return this; } - public APIRequestCreateVideo setThrowbackCameraRollMedia (String throwbackCameraRollMedia) { - this.setParam("throwback_camera_roll_media", throwbackCameraRollMedia); - return this; - } - public APIRequestCreateVideo setThumb (File thumb) { this.setParam("thumb", thumb); return this; @@ -20920,6 +20971,7 @@ public User getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -20940,6 +20992,7 @@ public User getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -21163,6 +21216,13 @@ public APIRequestGet requestInspirationalPeopleField (boolean value) { this.requestField("inspirational_people", value); return this; } + public APIRequestGet requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGet requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGet requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -21303,6 +21363,13 @@ public APIRequestGet requestRelationshipStatusField (boolean value) { this.requestField("relationship_status", value); return this; } + public APIRequestGet requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGet requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGet requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } @@ -21658,6 +21725,7 @@ public User copyFrom(User instance) { this.mId = instance.mId; this.mIdForAvatars = instance.mIdForAvatars; this.mInspirationalPeople = instance.mInspirationalPeople; + this.mInstagramUserSelfAsset = instance.mInstagramUserSelfAsset; this.mInstallType = instance.mInstallType; this.mInstalled = instance.mInstalled; this.mIsGuestUser = instance.mIsGuestUser; @@ -21678,6 +21746,7 @@ public User copyFrom(User instance) { this.mProfilePic = instance.mProfilePic; this.mQuotes = instance.mQuotes; this.mRelationshipStatus = instance.mRelationshipStatus; + this.mReligion = instance.mReligion; this.mSharedLoginUpgradeRequiredBy = instance.mSharedLoginUpgradeRequiredBy; this.mShortName = instance.mShortName; this.mSignificantOther = instance.mSignificantOther; diff --git a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java index f723036d..f80e4a2d 100644 --- a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java +++ b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessAccount.java @@ -48,7 +48,7 @@ public class WhatsAppBusinessAccount extends APINode { @SerializedName("auth_international_rate_eligibility") private Object mAuthInternationalRateEligibility = null; @SerializedName("business_verification_status") - private String mBusinessVerificationStatus = null; + private EnumBusinessVerificationStatus mBusinessVerificationStatus = null; @SerializedName("country") private String mCountry = null; @SerializedName("creation_time") @@ -475,7 +475,7 @@ public Object getFieldAuthInternationalRateEligibility() { return mAuthInternationalRateEligibility; } - public String getFieldBusinessVerificationStatus() { + public EnumBusinessVerificationStatus getFieldBusinessVerificationStatus() { return mBusinessVerificationStatus; } @@ -2793,6 +2793,7 @@ public WhatsAppBusinessAccount getLastResponse() { "library_template_name", "message_send_ttl_seconds", "name", + "parameter_format", "sub_category", }; @@ -2940,6 +2941,15 @@ public APIRequestCreateMessageTemplate setName (String name) { return this; } + public APIRequestCreateMessageTemplate setParameterFormat (WhatsAppBusinessAccount.EnumParameterFormat parameterFormat) { + this.setParam("parameter_format", parameterFormat); + return this; + } + public APIRequestCreateMessageTemplate setParameterFormat (String parameterFormat) { + this.setParam("parameter_format", parameterFormat); + return this; + } + public APIRequestCreateMessageTemplate setSubCategory (WhatsAppBusinessAccount.EnumSubCategory subCategory) { this.setParam("sub_category", subCategory); return this; @@ -6203,6 +6213,41 @@ public APIRequestUpdate requestField (String field, boolean value) { } + public static enum EnumBusinessVerificationStatus { + @SerializedName("expired") + VALUE_EXPIRED("expired"), + @SerializedName("failed") + VALUE_FAILED("failed"), + @SerializedName("ineligible") + VALUE_INELIGIBLE("ineligible"), + @SerializedName("not_verified") + VALUE_NOT_VERIFIED("not_verified"), + @SerializedName("pending") + VALUE_PENDING("pending"), + @SerializedName("pending_need_more_info") + VALUE_PENDING_NEED_MORE_INFO("pending_need_more_info"), + @SerializedName("pending_submission") + VALUE_PENDING_SUBMISSION("pending_submission"), + @SerializedName("rejected") + VALUE_REJECTED("rejected"), + @SerializedName("revoked") + VALUE_REVOKED("revoked"), + @SerializedName("verified") + VALUE_VERIFIED("verified"), + ; + + private String value; + + private EnumBusinessVerificationStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + public static enum EnumTasks { @SerializedName("DEVELOP") VALUE_DEVELOP("DEVELOP"), @@ -6276,6 +6321,25 @@ public String toString() { } } + public static enum EnumParameterFormat { + @SerializedName("NAMED") + VALUE_NAMED("NAMED"), + @SerializedName("POSITIONAL") + VALUE_POSITIONAL("POSITIONAL"), + ; + + private String value; + + private EnumParameterFormat(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + } + public static enum EnumSubCategory { @SerializedName("ORDER_DETAILS") VALUE_ORDER_DETAILS("ORDER_DETAILS"), @@ -6415,16 +6479,12 @@ public static enum EnumConversationCategories { VALUE_AUTHENTICATION_INTERNATIONAL("AUTHENTICATION_INTERNATIONAL"), @SerializedName("MARKETING") VALUE_MARKETING("MARKETING"), - @SerializedName("MARKETING_OPTIMIZED_DELIVERY") - VALUE_MARKETING_OPTIMIZED_DELIVERY("MARKETING_OPTIMIZED_DELIVERY"), + @SerializedName("MARKETING_LITE") + VALUE_MARKETING_LITE("MARKETING_LITE"), @SerializedName("SERVICE") VALUE_SERVICE("SERVICE"), - @SerializedName("UNKNOWN") - VALUE_UNKNOWN("UNKNOWN"), @SerializedName("UTILITY") VALUE_UTILITY("UTILITY"), - @SerializedName("UTILITY_FIXED_TEMPLATE") - VALUE_UTILITY_FIXED_TEMPLATE("UTILITY_FIXED_TEMPLATE"), ; private String value; diff --git a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java index 95b96312..3a9265b5 100644 --- a/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java +++ b/src/main/java/com/facebook/ads/sdk/WhatsAppBusinessPartnerClientVerificationSubmission.java @@ -280,6 +280,8 @@ public static enum EnumRejectionReasons { VALUE_LEGAL_NAME_NOT_FOUND_IN_DOCUMENTS("LEGAL_NAME_NOT_FOUND_IN_DOCUMENTS"), @SerializedName("LEGAL_NAME_NOT_MATCHING") VALUE_LEGAL_NAME_NOT_MATCHING("LEGAL_NAME_NOT_MATCHING"), + @SerializedName("MALFORMED_DOCUMENTS") + VALUE_MALFORMED_DOCUMENTS("MALFORMED_DOCUMENTS"), @SerializedName("NONE") VALUE_NONE("NONE"), @SerializedName("WEBSITE_NOT_MATCHING") diff --git a/src/main/java/com/facebook/ads/sdk/WorkSkill.java b/src/main/java/com/facebook/ads/sdk/WorkSkill.java index 0f81d9d3..93aaa6b6 100644 --- a/src/main/java/com/facebook/ads/sdk/WorkSkill.java +++ b/src/main/java/com/facebook/ads/sdk/WorkSkill.java @@ -301,6 +301,7 @@ public APINodeList getLastResponse() { "id", "id_for_avatars", "inspirational_people", + "instagram_user_self_asset", "install_type", "installed", "is_guest_user", @@ -321,6 +322,7 @@ public APINodeList getLastResponse() { "profile_pic", "quotes", "relationship_status", + "religion", "shared_login_upgrade_required_by", "short_name", "significant_other", @@ -544,6 +546,13 @@ public APIRequestGetUsers requestInspirationalPeopleField (boolean value) { this.requestField("inspirational_people", value); return this; } + public APIRequestGetUsers requestInstagramUserSelfAssetField () { + return this.requestInstagramUserSelfAssetField(true); + } + public APIRequestGetUsers requestInstagramUserSelfAssetField (boolean value) { + this.requestField("instagram_user_self_asset", value); + return this; + } public APIRequestGetUsers requestInstallTypeField () { return this.requestInstallTypeField(true); } @@ -684,6 +693,13 @@ public APIRequestGetUsers requestRelationshipStatusField (boolean value) { this.requestField("relationship_status", value); return this; } + public APIRequestGetUsers requestReligionField () { + return this.requestReligionField(true); + } + public APIRequestGetUsers requestReligionField (boolean value) { + this.requestField("religion", value); + return this; + } public APIRequestGetUsers requestSharedLoginUpgradeRequiredByField () { return this.requestSharedLoginUpgradeRequiredByField(true); } From 49398afbf27b5be571da01ddea59a1bce4bc903f Mon Sep 17 00:00:00 2001 From: Satwika Reddy Maddi Date: Fri, 15 Nov 2024 16:11:35 -0800 Subject: [PATCH 3/3] Bump version by 0.0.1 Summary: Bump version by 0.0.1 Reviewed By: liliarizona Differential Revision: D66039445 fbshipit-source-id: f4a1d7ed08df4dc4c5f994f04e205f23b18a21ec --- pom.xml | 2 +- src/main/java/com/facebook/ads/sdk/APIConfig.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7c657a85..63f10a84 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.facebook.business.sdk facebook-java-business-sdk jar - 21.0.1 + 21.0.2 ${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 de63fff1..7c76c2db 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 = "v21.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-v21.0.1"; + public static final String USER_AGENT = "fbbizsdk-java-v21.0.2"; };