From 063d440823be6fcbe9b1e3e6562a477c4baf0eb6 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005295453 Date: Mon, 15 Apr 2024 11:22:14 -0700 Subject: [PATCH] Auto-generated python SDK code update Summary: ignore-conflict-markers Reviewed By: stcheng Differential Revision: D56033281 fbshipit-source-id: 9d9b948a023d9240558521b975ad6bea44caef14 --- examples/AdAccountAdSetsPostAdSetCreateCpa.py | 4 +- ...ccountAdSetsPostAdSetCreateCpaAppEvents.py | 4 +- examples/AdAccountAdSetsPostCreateAdSet.py | 4 +- examples/AdAccountAdSetsPostDailyBudget20.py | 4 +- ...SetsPostLifetimeBudget200Duration10Days.py | 4 +- ...AccountAdSetsPostOptimizePostEngagement.py | 4 +- .../AdgroupLeadsEdgeAdgroupLeadsFiltered.py | 2 +- examples/AdsPixelEventsPost.py | 2 +- facebook_business/__init__.py | 2 +- facebook_business/adobjects/adaccount.py | 96 +++++++++++++++ .../adobjects/adaccountadvolume.py | 5 + .../adobjects/adaccounttargetingunified.py | 1 + facebook_business/adobjects/adactivity.py | 1 + .../adobjects/adassetfeedspec.py | 9 ++ facebook_business/adobjects/adcreative.py | 7 ++ .../adobjects/adcreativefeaturesspec.py | 8 ++ .../adobjects/adcreativelinkdata.py | 1 + .../adcreativelinkdatacalltoaction.py | 7 ++ .../adobjects/adcreativesourcingspec.py | 2 + facebook_business/adobjects/adpreview.py | 3 + facebook_business/adobjects/adset.py | 2 + facebook_business/adobjects/adspixel.py | 30 ----- facebook_business/adobjects/application.py | 35 +----- .../adobjects/commercemerchantsettings.py | 68 ----------- facebook_business/adobjects/commerceorder.py | 41 ++++++- facebook_business/adobjects/customaudience.py | 2 + facebook_business/adobjects/destination.py | 2 + facebook_business/adobjects/flight.py | 2 + facebook_business/adobjects/hotel.py | 2 + .../adobjects/igupcomingevent.py | 109 ++++++++++++++++++ facebook_business/adobjects/instagramuser.py | 39 ++++++- .../adobjects/localservicebusiness.py | 2 + facebook_business/adobjects/page.py | 34 +----- .../adobjects/pagecommerceeligibility.py | 39 ------- facebook_business/adobjects/productcatalog.py | 35 ++++++ facebook_business/adobjects/productitem.py | 1 + .../adobjects/targetinggeolocation.py | 2 - .../targetinggeolocationlocationexpansion.py | 37 ------ .../adobjects/whatsappbusinessaccount.py | 33 +++++- ...nesspartnerclientverificationsubmission.py | 17 ++- facebook_business/apiconfig.py | 2 +- setup.py | 2 +- 42 files changed, 440 insertions(+), 266 deletions(-) create mode 100644 facebook_business/adobjects/igupcomingevent.py delete mode 100644 facebook_business/adobjects/pagecommerceeligibility.py delete mode 100644 facebook_business/adobjects/targetinggeolocationlocationexpansion.py diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpa.py b/examples/AdAccountAdSetsPostAdSetCreateCpa.py index 35a69e30..0475eeb2 100644 --- a/examples/AdAccountAdSetsPostAdSetCreateCpa.py +++ b/examples/AdAccountAdSetsPostAdSetCreateCpa.py @@ -35,8 +35,8 @@ 'name': 'A CPA Ad Set', 'campaign_id': '', 'daily_budget': '5000', - 'start_time': '2024-03-20T14:31:58-0700', - 'end_time': '2024-03-27T14:31:58-0700', + 'start_time': '2024-04-08T11:26:05-0700', + 'end_time': '2024-04-15T11:26:05-0700', 'billing_event': 'IMPRESSIONS', 'optimization_goal': 'REACH', 'bid_amount': '1000', diff --git a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py index ddbb90d5..bf02ffe0 100644 --- a/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py +++ b/examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py @@ -35,8 +35,8 @@ 'name': 'A CPA Ad Set optimized for App Events', 'campaign_id': '', 'daily_budget': '300', - 'start_time': '2024-03-20T14:32:42-0700', - 'end_time': '2024-03-27T14:32:42-0700', + 'start_time': '2024-04-08T11:26:49-0700', + 'end_time': '2024-04-15T11:26:49-0700', 'billing_event': 'IMPRESSIONS', 'optimization_goal': 'OFFSITE_CONVERSIONS', 'bid_amount': '100', diff --git a/examples/AdAccountAdSetsPostCreateAdSet.py b/examples/AdAccountAdSetsPostCreateAdSet.py index cd64ca90..a4a7c5bf 100644 --- a/examples/AdAccountAdSetsPostCreateAdSet.py +++ b/examples/AdAccountAdSetsPostCreateAdSet.py @@ -34,8 +34,8 @@ params = { 'name': 'My First AdSet', 'lifetime_budget': '20000', - 'start_time': '2024-03-20T14:31:13-0700', - 'end_time': '2024-03-27T14:31:13-0700', + 'start_time': '2024-04-08T11:25:19-0700', + 'end_time': '2024-04-15T11:25:19-0700', 'campaign_id': '', 'bid_amount': '500', 'billing_event': 'IMPRESSIONS', diff --git a/examples/AdAccountAdSetsPostDailyBudget20.py b/examples/AdAccountAdSetsPostDailyBudget20.py index f0448c88..3ec34279 100644 --- a/examples/AdAccountAdSetsPostDailyBudget20.py +++ b/examples/AdAccountAdSetsPostDailyBudget20.py @@ -34,8 +34,8 @@ params = { 'name': 'My First Adset', 'daily_budget': '2000', - 'start_time': '2024-03-13T14:32:15-0700', - 'end_time': '2024-03-20T14:32:15-0700', + 'start_time': '2024-04-01T11:26:23-0700', + 'end_time': '2024-04-08T11:26:23-0700', 'campaign_id': '', 'bid_amount': '100', 'billing_event': 'LINK_CLICKS', diff --git a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py index 7c93dd11..08894aa0 100644 --- a/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py +++ b/examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py @@ -34,8 +34,8 @@ params = { 'name': 'My First Adset', 'lifetime_budget': '20000', - 'start_time': '2024-03-13T14:32:24-0700', - 'end_time': '2024-03-23T14:32:24-0700', + 'start_time': '2024-04-01T11:26:32-0700', + 'end_time': '2024-04-11T11:26:32-0700', 'campaign_id': '', 'bid_amount': '100', 'billing_event': 'LINK_CLICKS', diff --git a/examples/AdAccountAdSetsPostOptimizePostEngagement.py b/examples/AdAccountAdSetsPostOptimizePostEngagement.py index 6d4b4518..5d05eeb8 100644 --- a/examples/AdAccountAdSetsPostOptimizePostEngagement.py +++ b/examples/AdAccountAdSetsPostOptimizePostEngagement.py @@ -34,8 +34,8 @@ params = { 'name': 'My First Adset', 'lifetime_budget': '20000', - 'start_time': '2024-03-13T14:32:33-0700', - 'end_time': '2024-03-23T14:32:33-0700', + 'start_time': '2024-04-01T11:26:40-0700', + 'end_time': '2024-04-11T11:26:40-0700', 'campaign_id': '', 'bid_amount': '500', 'billing_event': 'IMPRESSIONS', diff --git a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py index 354a8472..6e041d8e 100644 --- a/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py +++ b/examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py @@ -32,7 +32,7 @@ fields = [ ] params = { - 'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1681144509}], + 'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1711391704}], } print Ad(id).get_leads( fields=fields, diff --git a/examples/AdsPixelEventsPost.py b/examples/AdsPixelEventsPost.py index 8c3d050b..4d607456 100644 --- a/examples/AdsPixelEventsPost.py +++ b/examples/AdsPixelEventsPost.py @@ -31,7 +31,7 @@ fields = [ ] params = { - 'data': [{'event_name':'PageView','event_time':1681748568,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}], + 'data': [{'event_name':'PageView','event_time':1711995835,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}], } print AdsPixel(id).create_event( fields=fields, diff --git a/facebook_business/__init__.py b/facebook_business/__init__.py index 382ec4ee..23ef9b19 100644 --- a/facebook_business/__init__.py +++ b/facebook_business/__init__.py @@ -7,7 +7,7 @@ from facebook_business.session import FacebookSession from facebook_business.api import FacebookAdsApi -__version__ = '19.0.2' +__version__ = '19.0.3' __all__ = [ 'session', 'objects', diff --git a/facebook_business/adobjects/adaccount.py b/facebook_business/adobjects/adaccount.py index 05a9c8ed..4c4f38b7 100644 --- a/facebook_business/adobjects/adaccount.py +++ b/facebook_business/adobjects/adaccount.py @@ -40,6 +40,7 @@ class Field(AbstractObject.Field): amount_spent = 'amount_spent' attribution_spec = 'attribution_spec' balance = 'balance' + brand_safety_content_filter_levels = 'brand_safety_content_filter_levels' business = 'business' business_city = 'business_city' business_country_code = 'business_country_code' @@ -187,6 +188,7 @@ class ContentType: automotive_model = 'AUTOMOTIVE_MODEL' destination = 'DESTINATION' flight = 'FLIGHT' + generic = 'GENERIC' home_listing = 'HOME_LISTING' hotel = 'HOTEL' job = 'JOB' @@ -205,6 +207,7 @@ class Subtype: claim = 'CLAIM' custom = 'CUSTOM' engagement = 'ENGAGEMENT' + exclusion = 'EXCLUSION' fox = 'FOX' lookalike = 'LOOKALIKE' managed = 'MANAGED' @@ -2154,6 +2157,36 @@ def create_async_ad_request_set(self, fields=None, params=None, batch=None, succ self.assure_call() return request.execute() + def get_audience_funnel(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/audience_funnel', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def create_block_list_draft(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -2510,6 +2543,36 @@ def get_conversion_goals(self, fields=None, params=None, batch=None, success=Non self.assure_call() return request.execute() + def get_cpa_guidance(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/cpa_guidance', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_custom_audiences(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -3818,6 +3881,8 @@ def get_targeting_search(self, fields=None, params=None, batch=None, success=Non 'allow_only_fat_head_interests': 'bool', 'app_store': 'app_store_enum', 'countries': 'list', + 'is_account_level_brand_safety_exclusion': 'bool', + 'is_account_level_employer_exclusion': 'bool', 'is_exclusion': 'bool', 'limit_type': 'limit_type_enum', 'objective': 'objective_enum', @@ -4104,6 +4169,36 @@ def delete_users_of_any_audience(self, fields=None, params=None, batch=None, suc self.assure_call() return request.execute() + def get_value_adjustment_rule_collections(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/value_adjustment_rule_collections', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_value_adjustment_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -4144,6 +4239,7 @@ def get_value_adjustment_rules(self, fields=None, params=None, batch=None, succe 'amount_spent': 'string', 'attribution_spec': 'list', 'balance': 'string', + 'brand_safety_content_filter_levels': 'list', 'business': 'Business', 'business_city': 'string', 'business_country_code': 'string', diff --git a/facebook_business/adobjects/adaccountadvolume.py b/facebook_business/adobjects/adaccountadvolume.py index 59a6d0d0..2296f404 100644 --- a/facebook_business/adobjects/adaccountadvolume.py +++ b/facebook_business/adobjects/adaccountadvolume.py @@ -65,6 +65,7 @@ class RecommendationType: asc_budget_optimization = 'ASC_BUDGET_OPTIMIZATION' asc_budget_optimization_pfr = 'ASC_BUDGET_OPTIMIZATION_PFR' asc_creation_package = 'ASC_CREATION_PACKAGE' + asc_fragmentation_v2 = 'ASC_FRAGMENTATION_V2' aspect_ratio = 'ASPECT_RATIO' atleast_6_placements = 'ATLEAST_6_PLACEMENTS' auction_overlap = 'AUCTION_OVERLAP' @@ -82,6 +83,7 @@ class RecommendationType: capi_performance_match_key = 'CAPI_PERFORMANCE_MATCH_KEY' capi_performance_match_key_v2 = 'CAPI_PERFORMANCE_MATCH_KEY_V2' cash_rewards_opt_in = 'CASH_REWARDS_OPT_IN' + connected_sources = 'CONNECTED_SOURCES' connect_facebook_page_to_instagram = 'CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM' connect_facebook_page_to_whatsapp = 'CONNECT_FACEBOOK_PAGE_TO_WHATSAPP' conversion_lead_ads = 'CONVERSION_LEAD_ADS' @@ -101,8 +103,10 @@ class RecommendationType: creator_ads_pa_conversion = 'CREATOR_ADS_PA_CONVERSION' cta = 'CTA' ctx_budget_optimization = 'CTX_BUDGET_OPTIMIZATION' + ctx_creation_package = 'CTX_CREATION_PACKAGE' ctx_guidance = 'CTX_GUIDANCE' da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS' + da_duplication_product_tags = 'DA_DUPLICATION_PRODUCT_TAGS' dead_link = 'DEAD_LINK' dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET' ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY' @@ -133,6 +137,7 @@ class RecommendationType: pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT' predictive_creative_limited = 'PREDICTIVE_CREATIVE_LIMITED' predictive_creative_limited_hourly = 'PREDICTIVE_CREATIVE_LIMITED_HOURLY' + preparing_status = 'PREPARING_STATUS' rapid_learning_limited = 'RAPID_LEARNING_LIMITED' rapid_learning_phase = 'RAPID_LEARNING_PHASE' reels_duplication_upsell = 'REELS_DUPLICATION_UPSELL' diff --git a/facebook_business/adobjects/adaccounttargetingunified.py b/facebook_business/adobjects/adaccounttargetingunified.py index a239966b..2a34ecfc 100644 --- a/facebook_business/adobjects/adaccounttargetingunified.py +++ b/facebook_business/adobjects/adaccounttargetingunified.py @@ -430,6 +430,7 @@ class WhitelistedTypes: location_categories = 'location_categories' location_cluster_ids = 'location_cluster_ids' location_expansion = 'location_expansion' + marketing_message_channels = 'marketing_message_channels' marketing_message_targeting = 'marketing_message_targeting' marketplace_product_categories = 'marketplace_product_categories' messenger_positions = 'messenger_positions' diff --git a/facebook_business/adobjects/adactivity.py b/facebook_business/adobjects/adactivity.py index 3765da23..43229500 100644 --- a/facebook_business/adobjects/adactivity.py +++ b/facebook_business/adobjects/adactivity.py @@ -119,6 +119,7 @@ class EventType: update_campaign_name = 'update_campaign_name' update_campaign_run_status = 'update_campaign_run_status' update_campaign_schedule = 'update_campaign_schedule' + update_campaign_value_adjustment_rule = 'update_campaign_value_adjustment_rule' update_delivery_type_cross_level_shift = 'update_delivery_type_cross_level_shift' class Category: diff --git a/facebook_business/adobjects/adassetfeedspec.py b/facebook_business/adobjects/adassetfeedspec.py index 6091700b..aca1ab96 100644 --- a/facebook_business/adobjects/adassetfeedspec.py +++ b/facebook_business/adobjects/adassetfeedspec.py @@ -42,6 +42,7 @@ class Field(AbstractObject.Field): message_extensions = 'message_extensions' onsite_destinations = 'onsite_destinations' optimization_type = 'optimization_type' + promotional_metadata = 'promotional_metadata' reasons_to_shop = 'reasons_to_shop' shops_bundle = 'shops_bundle' titles = 'titles' @@ -50,15 +51,20 @@ class Field(AbstractObject.Field): class CallToActionTypes: add_to_cart = 'ADD_TO_CART' apply_now = 'APPLY_NOW' + ask_about_services = 'ASK_ABOUT_SERVICES' + ask_for_more_info = 'ASK_FOR_MORE_INFO' audio_call = 'AUDIO_CALL' + book_a_consultation = 'BOOK_A_CONSULTATION' book_now = 'BOOK_NOW' book_travel = 'BOOK_TRAVEL' buy = 'BUY' buy_now = 'BUY_NOW' buy_tickets = 'BUY_TICKETS' + buy_via_message = 'BUY_VIA_MESSAGE' call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + chat_with_us = 'CHAT_WITH_US' confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' @@ -71,6 +77,7 @@ class CallToActionTypes: follow_news_storyline = 'FOLLOW_NEWS_STORYLINE' follow_page = 'FOLLOW_PAGE' follow_user = 'FOLLOW_USER' + get_a_quote = 'GET_A_QUOTE' get_directions = 'GET_DIRECTIONS' get_offer = 'GET_OFFER' get_offer_view = 'GET_OFFER_VIEW' @@ -86,6 +93,7 @@ class CallToActionTypes: like_page = 'LIKE_PAGE' listen_music = 'LISTEN_MUSIC' listen_now = 'LISTEN_NOW' + make_an_appointment = 'MAKE_AN_APPOINTMENT' message_page = 'MESSAGE_PAGE' mobile_download = 'MOBILE_DOWNLOAD' no_button = 'NO_BUTTON' @@ -144,6 +152,7 @@ class CallToActionTypes: 'message_extensions': 'list', 'onsite_destinations': 'list', 'optimization_type': 'string', + 'promotional_metadata': 'Object', 'reasons_to_shop': 'bool', 'shops_bundle': 'bool', 'titles': 'list', diff --git a/facebook_business/adobjects/adcreative.py b/facebook_business/adobjects/adcreative.py index 1aa9580a..657f8d6d 100644 --- a/facebook_business/adobjects/adcreative.py +++ b/facebook_business/adobjects/adcreative.py @@ -102,15 +102,20 @@ class Field(AbstractObject.Field): class CallToActionType: add_to_cart = 'ADD_TO_CART' apply_now = 'APPLY_NOW' + ask_about_services = 'ASK_ABOUT_SERVICES' + ask_for_more_info = 'ASK_FOR_MORE_INFO' audio_call = 'AUDIO_CALL' + book_a_consultation = 'BOOK_A_CONSULTATION' book_now = 'BOOK_NOW' book_travel = 'BOOK_TRAVEL' buy = 'BUY' buy_now = 'BUY_NOW' buy_tickets = 'BUY_TICKETS' + buy_via_message = 'BUY_VIA_MESSAGE' call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + chat_with_us = 'CHAT_WITH_US' confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' @@ -123,6 +128,7 @@ class CallToActionType: follow_news_storyline = 'FOLLOW_NEWS_STORYLINE' follow_page = 'FOLLOW_PAGE' follow_user = 'FOLLOW_USER' + get_a_quote = 'GET_A_QUOTE' get_directions = 'GET_DIRECTIONS' get_offer = 'GET_OFFER' get_offer_view = 'GET_OFFER_VIEW' @@ -138,6 +144,7 @@ class CallToActionType: like_page = 'LIKE_PAGE' listen_music = 'LISTEN_MUSIC' listen_now = 'LISTEN_NOW' + make_an_appointment = 'MAKE_AN_APPOINTMENT' message_page = 'MESSAGE_PAGE' mobile_download = 'MOBILE_DOWNLOAD' no_button = 'NO_BUTTON' diff --git a/facebook_business/adobjects/adcreativefeaturesspec.py b/facebook_business/adobjects/adcreativefeaturesspec.py index cf539855..dea13292 100644 --- a/facebook_business/adobjects/adcreativefeaturesspec.py +++ b/facebook_business/adobjects/adcreativefeaturesspec.py @@ -25,8 +25,11 @@ def __init__(self, api=None): class Field(AbstractObject.Field): advantage_plus_creative = 'advantage_plus_creative' + app_highlights = 'app_highlights' audio = 'audio' carousel_to_video = 'carousel_to_video' + catalog_feed_tag = 'catalog_feed_tag' + customize_product_recommendation = 'customize_product_recommendation' cv_transformation = 'cv_transformation' description_automation = 'description_automation' dha_optimization = 'dha_optimization' @@ -45,6 +48,7 @@ class Field(AbstractObject.Field): product_metadata_automation = 'product_metadata_automation' product_tags = 'product_tags' profile_card = 'profile_card' + site_extensions = 'site_extensions' standard_enhancements = 'standard_enhancements' standard_enhancements_catalog = 'standard_enhancements_catalog' text_generation = 'text_generation' @@ -54,8 +58,11 @@ class Field(AbstractObject.Field): _field_types = { 'advantage_plus_creative': 'AdCreativeFeatureDetails', + 'app_highlights': 'AdCreativeFeatureDetails', 'audio': 'AdCreativeFeatureDetails', 'carousel_to_video': 'AdCreativeFeatureDetails', + 'catalog_feed_tag': 'AdCreativeFeatureDetails', + 'customize_product_recommendation': 'AdCreativeFeatureDetails', 'cv_transformation': 'AdCreativeFeatureDetails', 'description_automation': 'AdCreativeFeatureDetails', 'dha_optimization': 'AdCreativeFeatureDetails', @@ -74,6 +81,7 @@ class Field(AbstractObject.Field): 'product_metadata_automation': 'AdCreativeFeatureDetails', 'product_tags': 'AdCreativeFeatureDetails', 'profile_card': 'AdCreativeFeatureDetails', + 'site_extensions': 'AdCreativeFeatureDetails', 'standard_enhancements': 'AdCreativeFeatureDetails', 'standard_enhancements_catalog': 'AdCreativeFeatureDetails', 'text_generation': 'AdCreativeFeatureDetails', diff --git a/facebook_business/adobjects/adcreativelinkdata.py b/facebook_business/adobjects/adcreativelinkdata.py index 6075357f..f241bfb7 100644 --- a/facebook_business/adobjects/adcreativelinkdata.py +++ b/facebook_business/adobjects/adcreativelinkdata.py @@ -64,6 +64,7 @@ class FormatOption: carousel_images_multi_items = 'carousel_images_multi_items' carousel_images_single_item = 'carousel_images_single_item' carousel_slideshows = 'carousel_slideshows' + collection_video = 'collection_video' single_image = 'single_image' _field_types = { diff --git a/facebook_business/adobjects/adcreativelinkdatacalltoaction.py b/facebook_business/adobjects/adcreativelinkdatacalltoaction.py index 2a9a7b8d..c3df95cc 100644 --- a/facebook_business/adobjects/adcreativelinkdatacalltoaction.py +++ b/facebook_business/adobjects/adcreativelinkdatacalltoaction.py @@ -30,15 +30,20 @@ class Field(AbstractObject.Field): class Type: add_to_cart = 'ADD_TO_CART' apply_now = 'APPLY_NOW' + ask_about_services = 'ASK_ABOUT_SERVICES' + ask_for_more_info = 'ASK_FOR_MORE_INFO' audio_call = 'AUDIO_CALL' + book_a_consultation = 'BOOK_A_CONSULTATION' book_now = 'BOOK_NOW' book_travel = 'BOOK_TRAVEL' buy = 'BUY' buy_now = 'BUY_NOW' buy_tickets = 'BUY_TICKETS' + buy_via_message = 'BUY_VIA_MESSAGE' call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + chat_with_us = 'CHAT_WITH_US' confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' @@ -51,6 +56,7 @@ class Type: follow_news_storyline = 'FOLLOW_NEWS_STORYLINE' follow_page = 'FOLLOW_PAGE' follow_user = 'FOLLOW_USER' + get_a_quote = 'GET_A_QUOTE' get_directions = 'GET_DIRECTIONS' get_offer = 'GET_OFFER' get_offer_view = 'GET_OFFER_VIEW' @@ -66,6 +72,7 @@ class Type: like_page = 'LIKE_PAGE' listen_music = 'LISTEN_MUSIC' listen_now = 'LISTEN_NOW' + make_an_appointment = 'MAKE_AN_APPOINTMENT' message_page = 'MESSAGE_PAGE' mobile_download = 'MOBILE_DOWNLOAD' no_button = 'NO_BUTTON' diff --git a/facebook_business/adobjects/adcreativesourcingspec.py b/facebook_business/adobjects/adcreativesourcingspec.py index 1bc965e8..3357d36c 100644 --- a/facebook_business/adobjects/adcreativesourcingspec.py +++ b/facebook_business/adobjects/adcreativesourcingspec.py @@ -27,11 +27,13 @@ class Field(AbstractObject.Field): associated_product_set_id = 'associated_product_set_id' promotion_metadata_spec = 'promotion_metadata_spec' site_links_spec = 'site_links_spec' + source_url = 'source_url' _field_types = { 'associated_product_set_id': 'string', 'promotion_metadata_spec': 'list', 'site_links_spec': 'list', + 'source_url': 'string', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/adpreview.py b/facebook_business/adobjects/adpreview.py index 0eb2e5c5..3bc35c44 100644 --- a/facebook_business/adobjects/adpreview.py +++ b/facebook_business/adobjects/adpreview.py @@ -65,9 +65,11 @@ class AdFormat: instant_article_recirculation_ad = 'INSTANT_ARTICLE_RECIRCULATION_AD' instant_article_standard = 'INSTANT_ARTICLE_STANDARD' instream_banner_desktop = 'INSTREAM_BANNER_DESKTOP' + instream_banner_fullscreen_mobile = 'INSTREAM_BANNER_FULLSCREEN_MOBILE' instream_banner_immersive_mobile = 'INSTREAM_BANNER_IMMERSIVE_MOBILE' instream_banner_mobile = 'INSTREAM_BANNER_MOBILE' instream_video_desktop = 'INSTREAM_VIDEO_DESKTOP' + instream_video_fullscreen_mobile = 'INSTREAM_VIDEO_FULLSCREEN_MOBILE' instream_video_image = 'INSTREAM_VIDEO_IMAGE' instream_video_immersive_mobile = 'INSTREAM_VIDEO_IMMERSIVE_MOBILE' instream_video_mobile = 'INSTREAM_VIDEO_MOBILE' @@ -85,6 +87,7 @@ class AdFormat: mobile_native = 'MOBILE_NATIVE' right_column_standard = 'RIGHT_COLUMN_STANDARD' suggested_video_desktop = 'SUGGESTED_VIDEO_DESKTOP' + suggested_video_fullscreen_mobile = 'SUGGESTED_VIDEO_FULLSCREEN_MOBILE' suggested_video_immersive_mobile = 'SUGGESTED_VIDEO_IMMERSIVE_MOBILE' suggested_video_mobile = 'SUGGESTED_VIDEO_MOBILE' watch_feed_home = 'WATCH_FEED_HOME' diff --git a/facebook_business/adobjects/adset.py b/facebook_business/adobjects/adset.py index 735bf369..ddc06bad 100644 --- a/facebook_business/adobjects/adset.py +++ b/facebook_business/adobjects/adset.py @@ -79,6 +79,7 @@ class Field(AbstractObject.Field): promoted_object = 'promoted_object' recommendations = 'recommendations' recurring_budget_semantics = 'recurring_budget_semantics' + regional_regulation_identities = 'regional_regulation_identities' review_feedback = 'review_feedback' rf_prediction_id = 'rf_prediction_id' source_adset = 'source_adset' @@ -1057,6 +1058,7 @@ def get_targeting_sentence_lines(self, fields=None, params=None, batch=None, suc 'promoted_object': 'AdPromotedObject', 'recommendations': 'list', 'recurring_budget_semantics': 'bool', + 'regional_regulation_identities': 'Object', 'review_feedback': 'string', 'rf_prediction_id': 'string', 'source_adset': 'AdSet', diff --git a/facebook_business/adobjects/adspixel.py b/facebook_business/adobjects/adspixel.py index 5829c340..8944ffc1 100644 --- a/facebook_business/adobjects/adspixel.py +++ b/facebook_business/adobjects/adspixel.py @@ -670,36 +670,6 @@ def get_stats(self, fields=None, params=None, batch=None, success=None, failure= self.assure_call() return request.execute() - def create_telemetry(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/telemetry', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, - api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - _field_types = { 'automatic_matching_fields': 'list', 'can_proxy': 'bool', diff --git a/facebook_business/adobjects/application.py b/facebook_business/adobjects/application.py index 37acf2a3..560a3b52 100644 --- a/facebook_business/adobjects/application.py +++ b/facebook_business/adobjects/application.py @@ -435,6 +435,7 @@ def create_activity(self, fields=None, params=None, batch=None, success=None, fa 'page_id': 'unsigned int', 'page_scoped_user_id': 'unsigned int', 'receipt_data': 'string', + 'sdk_version': 'string', 'ud': 'map', 'url_schemes': 'list', 'user_id': 'string', @@ -1338,40 +1339,6 @@ def get_da_checks(self, fields=None, params=None, batch=None, success=None, fail self.assure_call() return request.execute() - def get_events(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - from facebook_business.adobjects.event import Event - param_types = { - 'include_canceled': 'bool', - 'type': 'type_enum', - } - enums = { - 'type_enum': Event.Type.__dict__.values(), - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/events', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=Event, - api_type='EDGE', - response_parser=ObjectParser(target_class=Event, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_iap_purchases(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): diff --git a/facebook_business/adobjects/commercemerchantsettings.py b/facebook_business/adobjects/commercemerchantsettings.py index d71f526b..6c69fca6 100644 --- a/facebook_business/adobjects/commercemerchantsettings.py +++ b/facebook_business/adobjects/commercemerchantsettings.py @@ -51,7 +51,6 @@ class Field(AbstractObject.Field): supported_card_types = 'supported_card_types' terms = 'terms' terms_url_by_locale = 'terms_url_by_locale' - whatsapp_channel = 'whatsapp_channel' def api_get(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils @@ -352,36 +351,6 @@ def get_returns(self, fields=None, params=None, batch=None, success=None, failur self.assure_call() return request.execute() - def get_seller_issues(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/seller_issues', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, - api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_setup_status(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -541,42 +510,6 @@ def get_tax_settings(self, fields=None, params=None, batch=None, success=None, f self.assure_call() return request.execute() - def create_whatsapp_channel(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - param_types = { - 'op': 'op_enum', - 'whatsapp_business_accounts': 'list', - } - enums = { - 'op_enum': [ - 'ADD', - 'REMOVE', - ], - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/whatsapp_channel', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, - api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - _field_types = { 'braintree_merchant_id': 'string', 'checkout_message': 'string', @@ -602,7 +535,6 @@ def create_whatsapp_channel(self, fields=None, params=None, batch=None, success= 'supported_card_types': 'list', 'terms': 'string', 'terms_url_by_locale': 'list>', - 'whatsapp_channel': 'Object', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/commerceorder.py b/facebook_business/adobjects/commerceorder.py index 5c48c874..b1f51612 100644 --- a/facebook_business/adobjects/commerceorder.py +++ b/facebook_business/adobjects/commerceorder.py @@ -195,20 +195,20 @@ def create_cancellation(self, fields=None, params=None, batch=None, success=None self.assure_call() return request.execute() - def create_fulfill_order(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + def create_item_update(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') param_types = { - 'idempotency_key': 'string', 'items': 'list', + 'merchant_order_reference': 'string', } enums = { } request = FacebookRequest( node_id=self['id'], method='POST', - endpoint='/fulfill_order', + endpoint='/item_updates', api=self._api, param_checker=TypeChecker(param_types, enums), target_class=CommerceOrder, @@ -594,6 +594,41 @@ def create_update_shipment(self, fields=None, params=None, batch=None, success=N self.assure_call() return request.execute() + def create_update(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'cancel_amount': 'map', + 'fulfill_amount': 'map', + 'merchant_order_reference': 'string', + 'refund_amount': 'map', + 'total_amount': 'map', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/updates', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=CommerceOrder, + api_type='EDGE', + response_parser=ObjectParser(target_class=CommerceOrder, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + _field_types = { 'buyer_details': 'Object', 'channel': 'string', diff --git a/facebook_business/adobjects/customaudience.py b/facebook_business/adobjects/customaudience.py index aa5355fe..02e30de7 100644 --- a/facebook_business/adobjects/customaudience.py +++ b/facebook_business/adobjects/customaudience.py @@ -104,6 +104,7 @@ class ContentType: automotive_model = 'AUTOMOTIVE_MODEL' destination = 'DESTINATION' flight = 'FLIGHT' + generic = 'GENERIC' home_listing = 'HOME_LISTING' hotel = 'HOTEL' job = 'JOB' @@ -127,6 +128,7 @@ class Subtype: claim = 'CLAIM' custom = 'CUSTOM' engagement = 'ENGAGEMENT' + exclusion = 'EXCLUSION' fox = 'FOX' lookalike = 'LOOKALIKE' managed = 'MANAGED' diff --git a/facebook_business/adobjects/destination.py b/facebook_business/adobjects/destination.py index c95c7ac3..f618f492 100644 --- a/facebook_business/adobjects/destination.py +++ b/facebook_business/adobjects/destination.py @@ -40,6 +40,7 @@ class Field(AbstractObject.Field): price = 'price' price_change = 'price_change' sanitized_images = 'sanitized_images' + tags = 'tags' types = 'types' unit_price = 'unit_price' url = 'url' @@ -193,6 +194,7 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'price': 'string', 'price_change': 'string', 'sanitized_images': 'list', + 'tags': 'list', 'types': 'list', 'unit_price': 'Object', 'url': 'string', diff --git a/facebook_business/adobjects/flight.py b/facebook_business/adobjects/flight.py index 00722916..b559d160 100644 --- a/facebook_business/adobjects/flight.py +++ b/facebook_business/adobjects/flight.py @@ -43,6 +43,7 @@ class Field(AbstractObject.Field): origin_city = 'origin_city' price = 'price' sanitized_images = 'sanitized_images' + tags = 'tags' unit_price = 'unit_price' url = 'url' visibility = 'visibility' @@ -237,6 +238,7 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'origin_city': 'string', 'price': 'string', 'sanitized_images': 'list', + 'tags': 'list', 'unit_price': 'Object', 'url': 'string', 'visibility': 'Visibility', diff --git a/facebook_business/adobjects/hotel.py b/facebook_business/adobjects/hotel.py index 0f779174..726dbc2f 100644 --- a/facebook_business/adobjects/hotel.py +++ b/facebook_business/adobjects/hotel.py @@ -47,6 +47,7 @@ class Field(AbstractObject.Field): sale_price = 'sale_price' sanitized_images = 'sanitized_images' star_rating = 'star_rating' + tags = 'tags' unit_price = 'unit_price' url = 'url' visibility = 'visibility' @@ -320,6 +321,7 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'sale_price': 'string', 'sanitized_images': 'list', 'star_rating': 'float', + 'tags': 'list', 'unit_price': 'Object', 'url': 'string', 'visibility': 'Visibility', diff --git a/facebook_business/adobjects/igupcomingevent.py b/facebook_business/adobjects/igupcomingevent.py new file mode 100644 index 00000000..c6d332cc --- /dev/null +++ b/facebook_business/adobjects/igupcomingevent.py @@ -0,0 +1,109 @@ +# 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. + +from facebook_business.adobjects.abstractobject import AbstractObject +from facebook_business.adobjects.abstractcrudobject import AbstractCrudObject +from facebook_business.adobjects.objectparser import ObjectParser +from facebook_business.api import FacebookRequest +from facebook_business.typechecker import TypeChecker + +""" +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. +""" + +class IGUpcomingEvent( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isIGUpcomingEvent = True + super(IGUpcomingEvent, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + end_time = 'end_time' + id = 'id' + start_time = 'start_time' + title = 'title' + + def api_get(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=IGUpcomingEvent, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def api_update(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'end_time': 'datetime', + 'start_time': 'datetime', + 'title': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=IGUpcomingEvent, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + _field_types = { + 'end_time': 'datetime', + 'id': 'string', + 'start_time': 'datetime', + 'title': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/instagramuser.py b/facebook_business/adobjects/instagramuser.py index 9d85898b..b84e02d5 100644 --- a/facebook_business/adobjects/instagramuser.py +++ b/facebook_business/adobjects/instagramuser.py @@ -199,6 +199,7 @@ def get_upcoming_events(self, fields=None, params=None, batch=None, success=None from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): api_utils.warning('`success` and `failure` callback only work for batch call.') + from facebook_business.adobjects.igupcomingevent import IGUpcomingEvent param_types = { } enums = { @@ -209,9 +210,43 @@ def get_upcoming_events(self, fields=None, params=None, batch=None, success=None endpoint='/upcoming_events', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=IGUpcomingEvent, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=IGUpcomingEvent, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_upcoming_event(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + from facebook_business.adobjects.igupcomingevent import IGUpcomingEvent + param_types = { + 'end_time': 'datetime', + 'start_time': 'datetime', + 'title': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/upcoming_events', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=IGUpcomingEvent, + api_type='EDGE', + response_parser=ObjectParser(target_class=IGUpcomingEvent, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/localservicebusiness.py b/facebook_business/adobjects/localservicebusiness.py index eb5ed881..c688a7b7 100644 --- a/facebook_business/adobjects/localservicebusiness.py +++ b/facebook_business/adobjects/localservicebusiness.py @@ -61,6 +61,7 @@ class Field(AbstractObject.Field): retailer_category = 'retailer_category' sanitized_images = 'sanitized_images' size = 'size' + tags = 'tags' title = 'title' unit_price = 'unit_price' url = 'url' @@ -194,6 +195,7 @@ def get_channels_to_integrity_status(self, fields=None, params=None, batch=None, 'retailer_category': 'string', 'sanitized_images': 'list', 'size': 'string', + 'tags': 'list', 'title': 'string', 'unit_price': 'Object', 'url': 'string', diff --git a/facebook_business/adobjects/page.py b/facebook_business/adobjects/page.py index b476ff36..c1f0b192 100644 --- a/facebook_business/adobjects/page.py +++ b/facebook_business/adobjects/page.py @@ -96,6 +96,7 @@ class Field(AbstractObject.Field): is_community_page = 'is_community_page' is_eligible_for_branded_content = 'is_eligible_for_branded_content' is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web = 'is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web' + is_eligible_for_live_boosting_expansion = 'is_eligible_for_live_boosting_expansion' is_messenger_bot_get_started_enabled = 'is_messenger_bot_get_started_enabled' is_messenger_platform_bot = 'is_messenger_platform_bot' is_owned = 'is_owned' @@ -513,6 +514,7 @@ class SubscribedFields: publisher_subscriptions = 'publisher_subscriptions' ratings = 'ratings' registration = 'registration' + response_feedback = 'response_feedback' send_cart = 'send_cart' standby = 'standby' user_action = 'user_action' @@ -1460,37 +1462,6 @@ def create_chat_plugin(self, fields=None, params=None, batch=None, success=None, self.assure_call() return request.execute() - def get_commerce_eligibility(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): - from facebook_business.utils import api_utils - if batch is None and (success is not None or failure is not None): - api_utils.warning('`success` and `failure` callback only work for batch call.') - from facebook_business.adobjects.pagecommerceeligibility import PageCommerceEligibility - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/commerce_eligibility', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=PageCommerceEligibility, - api_type='EDGE', - response_parser=ObjectParser(target_class=PageCommerceEligibility, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch, success=success, failure=failure) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_commerce_merchant_settings(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): @@ -5154,6 +5125,7 @@ def create_welcome_message_flow(self, fields=None, params=None, batch=None, succ 'is_community_page': 'bool', 'is_eligible_for_branded_content': 'bool', 'is_eligible_for_disable_connect_ig_btn_for_non_page_admin_am_web': 'bool', + 'is_eligible_for_live_boosting_expansion': 'bool', 'is_messenger_bot_get_started_enabled': 'bool', 'is_messenger_platform_bot': 'bool', 'is_owned': 'bool', diff --git a/facebook_business/adobjects/pagecommerceeligibility.py b/facebook_business/adobjects/pagecommerceeligibility.py deleted file mode 100644 index b83bcb6b..00000000 --- a/facebook_business/adobjects/pagecommerceeligibility.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# This source code is licensed under the license found in the -# LICENSE file in the root directory of this source tree. - -from facebook_business.adobjects.abstractobject import AbstractObject - -""" -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. -""" - -class PageCommerceEligibility( - AbstractObject, -): - - def __init__(self, api=None): - super(PageCommerceEligibility, self).__init__() - self._isPageCommerceEligibility = True - self._api = api - - class Field(AbstractObject.Field): - offsite = 'offsite' - onsite = 'onsite' - - _field_types = { - 'offsite': 'Object', - 'onsite': 'Object', - } - @classmethod - def _get_field_enum_info(cls): - field_enum_info = {} - return field_enum_info - - diff --git a/facebook_business/adobjects/productcatalog.py b/facebook_business/adobjects/productcatalog.py index 20691dce..f42b317e 100644 --- a/facebook_business/adobjects/productcatalog.py +++ b/facebook_business/adobjects/productcatalog.py @@ -1939,6 +1939,41 @@ def create_vehicle(self, fields=None, params=None, batch=None, success=None, fai self.assure_call() return request.execute() + def create_version_items_batch(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'allow_upsert': 'bool', + 'item_type': 'string', + 'item_version': 'string', + 'requests': 'map', + 'version': 'unsigned int', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/version_items_batch', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=ProductCatalog, + api_type='EDGE', + response_parser=ObjectParser(target_class=ProductCatalog, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + _field_types = { 'ad_account_to_collaborative_ads_share_settings': 'CollaborativeAdsShareSettings', 'agency_collaborative_ads_share_settings': 'CollaborativeAdsShareSettings', diff --git a/facebook_business/adobjects/productitem.py b/facebook_business/adobjects/productitem.py index df4c026c..a898801a 100644 --- a/facebook_business/adobjects/productitem.py +++ b/facebook_business/adobjects/productitem.py @@ -426,6 +426,7 @@ class ErrorType: empty_title = 'EMPTY_TITLE' external_merchant_id_mismatch = 'EXTERNAL_MERCHANT_ID_MISMATCH' generic_invalid_field = 'GENERIC_INVALID_FIELD' + groups_disabled_by_user = 'GROUPS_DISABLED_BY_USER' hidden_until_product_launch = 'HIDDEN_UNTIL_PRODUCT_LAUNCH' image_fetch_failed = 'IMAGE_FETCH_FAILED' image_fetch_failed_bad_gateway = 'IMAGE_FETCH_FAILED_BAD_GATEWAY' diff --git a/facebook_business/adobjects/targetinggeolocation.py b/facebook_business/adobjects/targetinggeolocation.py index e69a266b..31af787c 100644 --- a/facebook_business/adobjects/targetinggeolocation.py +++ b/facebook_business/adobjects/targetinggeolocation.py @@ -32,7 +32,6 @@ class Field(AbstractObject.Field): geo_markets = 'geo_markets' large_geo_areas = 'large_geo_areas' location_cluster_ids = 'location_cluster_ids' - location_expansion = 'location_expansion' location_types = 'location_types' medium_geo_areas = 'medium_geo_areas' metro_areas = 'metro_areas' @@ -54,7 +53,6 @@ class Field(AbstractObject.Field): 'geo_markets': 'list', 'large_geo_areas': 'list', 'location_cluster_ids': 'list', - 'location_expansion': 'TargetingGeoLocationLocationExpansion', 'location_types': 'list', 'medium_geo_areas': 'list', 'metro_areas': 'list', diff --git a/facebook_business/adobjects/targetinggeolocationlocationexpansion.py b/facebook_business/adobjects/targetinggeolocationlocationexpansion.py deleted file mode 100644 index 045a660c..00000000 --- a/facebook_business/adobjects/targetinggeolocationlocationexpansion.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. - -# This source code is licensed under the license found in the -# LICENSE file in the root directory of this source tree. - -from facebook_business.adobjects.abstractobject import AbstractObject - -""" -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. -""" - -class TargetingGeoLocationLocationExpansion( - AbstractObject, -): - - def __init__(self, api=None): - super(TargetingGeoLocationLocationExpansion, self).__init__() - self._isTargetingGeoLocationLocationExpansion = True - self._api = api - - class Field(AbstractObject.Field): - allowed = 'allowed' - - _field_types = { - 'allowed': 'bool', - } - @classmethod - def _get_field_enum_info(cls): - field_enum_info = {} - return field_enum_info - - diff --git a/facebook_business/adobjects/whatsappbusinessaccount.py b/facebook_business/adobjects/whatsappbusinessaccount.py index e535ea8f..10189c9a 100644 --- a/facebook_business/adobjects/whatsappbusinessaccount.py +++ b/facebook_business/adobjects/whatsappbusinessaccount.py @@ -65,7 +65,6 @@ class Category: utility = 'UTILITY' class SubCategory: - custom = 'CUSTOM' order_details = 'ORDER_DETAILS' order_status = 'ORDER_STATUS' @@ -275,6 +274,8 @@ def get_conversation_analytics(self, fields=None, params=None, batch=None, succe enums = { 'conversation_categories_enum': [ 'AUTHENTICATION', + 'AUTHENTICATION_INTERNATIONAL', + 'FIXED_TEMPLATE_NOTIFY', 'MARKETING', 'MARKETING_OPTIMIZED_DELIVERY', 'SERVICE', @@ -858,6 +859,36 @@ def get_schedules(self, fields=None, params=None, batch=None, success=None, fail self.assure_call() return request.execute() + def create_set_obo_mobility_intent(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): + from facebook_business.utils import api_utils + if batch is None and (success is not None or failure is not None): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/set_obo_mobility_intent', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='EDGE', + response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch, success=success, failure=failure) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def delete_subscribed_apps(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils if batch is None and (success is not None or failure is not None): diff --git a/facebook_business/adobjects/whatsappbusinesspartnerclientverificationsubmission.py b/facebook_business/adobjects/whatsappbusinesspartnerclientverificationsubmission.py index 50adac3e..cd3fc120 100644 --- a/facebook_business/adobjects/whatsappbusinesspartnerclientverificationsubmission.py +++ b/facebook_business/adobjects/whatsappbusinesspartnerclientverificationsubmission.py @@ -35,18 +35,31 @@ class Field(AbstractObject.Field): update_time = 'update_time' verification_status = 'verification_status' + class RejectionReasons: + address_not_matching = 'ADDRESS_NOT_MATCHING' + legal_name_not_matching = 'LEGAL_NAME_NOT_MATCHING' + none = 'NONE' + website_not_matching = 'WEBSITE_NOT_MATCHING' + + class VerificationStatus: + approved = 'APPROVED' + failed = 'FAILED' + pending = 'PENDING' + _field_types = { 'client_business_id': 'string', 'id': 'string', - 'rejection_reasons': 'list', + 'rejection_reasons': 'list', 'submitted_info': 'Object', 'submitted_time': 'datetime', 'update_time': 'datetime', - 'verification_status': 'string', + 'verification_status': 'VerificationStatus', } @classmethod def _get_field_enum_info(cls): field_enum_info = {} + field_enum_info['RejectionReasons'] = WhatsAppBusinessPartnerClientVerificationSubmission.RejectionReasons.__dict__.values() + field_enum_info['VerificationStatus'] = WhatsAppBusinessPartnerClientVerificationSubmission.VerificationStatus.__dict__.values() return field_enum_info diff --git a/facebook_business/apiconfig.py b/facebook_business/apiconfig.py index 68a015b3..d60a3bef 100644 --- a/facebook_business/apiconfig.py +++ b/facebook_business/apiconfig.py @@ -6,6 +6,6 @@ ads_api_config = { 'API_VERSION': 'v19.0', - 'SDK_VERSION': 'v19.0.2', + 'SDK_VERSION': 'v19.0.3', 'STRICT_MODE': False } diff --git a/setup.py b/setup.py index 55c29b87..73618b6f 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ requirements_filename = os.path.join(this_dir, 'requirements.txt') PACKAGE_NAME = 'facebook_business' -PACKAGE_VERSION = '19.0.2' +PACKAGE_VERSION = '19.0.3' PACKAGE_AUTHOR = 'Facebook' PACKAGE_AUTHOR_EMAIL = 'shuotian@meta.com' PACKAGE_URL = 'https://github.com/facebook/facebook-python-business-sdk'