From 9b0bf1de0ab3f472479eb76c13d1753c4bac6a3a Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Sat, 14 Oct 2023 22:26:00 -0700 Subject: [PATCH] Auto-generated python SDK code update Summary: ignore-conflict-markers Reviewed By: mengxuanzhangz Differential Revision: D50280442 fbshipit-source-id: 8e546cc44e1c2e6bcfbbb82a290f46c289c2be0b --- examples/async.py | 1 + examples/batch_create.py | 1 + examples/batch_pause.py | 1 + examples/custom_audience_utils.py | 1 + examples/dpa-update/dpa_search.py | 1 + examples/dpa-update/dpa_update.py | 1 + examples/read_objects.py | 1 + examples/simple_create.py | 1 + examples/upload_video.py | 1 + facebook_business/__init__.py | 2 +- facebook_business/adobjects/adaccount.py | 104 ------------------ .../adobjects/adaccountadvolume.py | 8 +- facebook_business/adobjects/adactivity.py | 1 + .../adobjects/adassetfeedspec.py | 1 + facebook_business/adobjects/adcreative.py | 1 + .../adcreativelinkdatacalltoaction.py | 1 + .../adobjects/adpromotedobject.py | 2 - facebook_business/adobjects/adsinsights.py | 1 + facebook_business/adobjects/adspixel.py | 31 ++++++ facebook_business/adobjects/business.py | 4 + facebook_business/adobjects/group.py | 61 ---------- facebook_business/adobjects/igmedia.py | 33 ++++++ ...igvideocopyrightcheckmatchesinformation.py | 39 +++++++ .../adobjects/igvideocopyrightcheckstatus.py | 39 +++++++ .../adobjects/instagramcomment.py | 2 + .../adobjects/openbridgeconfiguration.py | 6 + facebook_business/adobjects/page.py | 10 +- facebook_business/adobjects/productfeed.py | 1 + .../adobjects/shadowigmediabuilder.py | 2 + ...ssage.py => shadowigmediacollaborators.py} | 20 ++-- .../adobjects/whatsappbusinessaccount.py | 26 +++++ facebook_business/apiconfig.py | 2 +- setup.py | 2 +- 33 files changed, 220 insertions(+), 188 deletions(-) create mode 100644 facebook_business/adobjects/igvideocopyrightcheckmatchesinformation.py create mode 100644 facebook_business/adobjects/igvideocopyrightcheckstatus.py rename facebook_business/adobjects/{messengerdestinationpagewelcomemessage.py => shadowigmediacollaborators.py} (61%) diff --git a/examples/async.py b/examples/async.py index e7d95569..de93f59d 100644 --- a/examples/async.py +++ b/examples/async.py @@ -35,6 +35,7 @@ config_filename = os.path.join(this_dir, 'config.json') with open(config_filename) as config_file: config = json.load(config_file) + api = FacebookAdsApi.init(access_token=config['access_token']) account_id = config['act_id'] diff --git a/examples/batch_create.py b/examples/batch_create.py index 225c3e55..bc20bf52 100644 --- a/examples/batch_create.py +++ b/examples/batch_create.py @@ -38,6 +38,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + ### Setup session and api objects session = FacebookSession( config['app_id'], diff --git a/examples/batch_pause.py b/examples/batch_pause.py index 71f87793..55fd6ec6 100644 --- a/examples/batch_pause.py +++ b/examples/batch_pause.py @@ -38,6 +38,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + ### Setup session and api objects session = FacebookSession( config['app_id'], diff --git a/examples/custom_audience_utils.py b/examples/custom_audience_utils.py index b38992d1..2823589d 100644 --- a/examples/custom_audience_utils.py +++ b/examples/custom_audience_utils.py @@ -41,6 +41,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + auth_info = ( config['app_id'], config['app_secret'], diff --git a/examples/dpa-update/dpa_search.py b/examples/dpa-update/dpa_search.py index 419ec76a..6e9deaa7 100644 --- a/examples/dpa-update/dpa_search.py +++ b/examples/dpa-update/dpa_search.py @@ -31,6 +31,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + from facebook_business.api import FacebookAdsApi from facebook_business.adobjects.productcatalog import ProductCatalog from facebook_business.adobjects.productitem import ProductItem diff --git a/examples/dpa-update/dpa_update.py b/examples/dpa-update/dpa_update.py index c2e45016..e79402f2 100644 --- a/examples/dpa-update/dpa_update.py +++ b/examples/dpa-update/dpa_update.py @@ -32,6 +32,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + from facebook_business.api import FacebookAdsApi from facebook_business.adobjects.productcatalog import ProductCatalog from facebook_business.adobjects.productitem import ProductItem diff --git a/examples/read_objects.py b/examples/read_objects.py index aceed992..b8f32594 100644 --- a/examples/read_objects.py +++ b/examples/read_objects.py @@ -38,6 +38,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + ### Setup session and api objects session = FacebookSession( config['app_id'], diff --git a/examples/simple_create.py b/examples/simple_create.py index e7d26f72..9f0d8825 100644 --- a/examples/simple_create.py +++ b/examples/simple_create.py @@ -39,6 +39,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + ### Setup session and api objects session = FacebookSession( config['app_id'], diff --git a/examples/upload_video.py b/examples/upload_video.py index 905c64bf..5ede3a4c 100644 --- a/examples/upload_video.py +++ b/examples/upload_video.py @@ -37,6 +37,7 @@ with open(config_filename) as config_file: config = json.load(config_file) + ### Setup session and api objects session = FacebookSession( config['app_id'], diff --git a/facebook_business/__init__.py b/facebook_business/__init__.py index f440d8bf..1da9f34b 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__ = '18.0.2' +__version__ = '18.0.3' __all__ = [ 'session', 'objects', diff --git a/facebook_business/adobjects/adaccount.py b/facebook_business/adobjects/adaccount.py index 004dcc97..b5057efd 100644 --- a/facebook_business/adobjects/adaccount.py +++ b/facebook_business/adobjects/adaccount.py @@ -1189,110 +1189,6 @@ def create_ad(self, fields=None, params=None, batch=None, success=None, failure= self.assure_call() return request.execute() - def create_ads_conversion_goal(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 = { - 'conversion_event_value_source': 'conversion_event_value_source_enum', - 'description': 'string', - 'goal_creation_method': 'goal_creation_method_enum', - 'goal_name': 'string', - 'performance_goal': 'performance_goal_enum', - 'single_channel_conversion_events': 'list', - 'value_adjustment_rule': 'map', - } - enums = { - 'conversion_event_value_source_enum': [ - 'DATA_SOURCE', - 'VALUE_RULE', - ], - 'goal_creation_method_enum': [ - 'ADVERTISER_CREATED_UI', - 'AUTO_MIGRATION', - 'L2_ENHANCE_API_MIGRATION', - ], - 'performance_goal_enum': [ - 'AD_OPTIMIZATION_GOAL_AD_RECALL_LIFT', - 'AD_OPTIMIZATION_GOAL_APP_DOWNLOADS', - 'AD_OPTIMIZATION_GOAL_APP_INSTALLS', - 'AD_OPTIMIZATION_GOAL_APP_INSTALLS_AND_OFFSITE_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_BRAND_AWARENESS', - 'AD_OPTIMIZATION_GOAL_CLICKS', - 'AD_OPTIMIZATION_GOAL_COMPLETED_VIDEO_VIEWS', - 'AD_OPTIMIZATION_GOAL_CONVERSATIONS', - 'AD_OPTIMIZATION_GOAL_DERIVED_EVENTS', - 'AD_OPTIMIZATION_GOAL_DWELLS', - 'AD_OPTIMIZATION_GOAL_ENGAGED_REACH', - 'AD_OPTIMIZATION_GOAL_ENGAGED_USERS', - 'AD_OPTIMIZATION_GOAL_EVENT_RESPONSES', - 'AD_OPTIMIZATION_GOAL_EXTERNAL', - 'AD_OPTIMIZATION_GOAL_IMPRESSIONS', - 'AD_OPTIMIZATION_GOAL_INCREMENTAL_OFFSITE_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_IN_APP_VALUE', - 'AD_OPTIMIZATION_GOAL_JOB_APPLICATIONS', - 'AD_OPTIMIZATION_GOAL_LANDING_PAGE_VIEWS', - 'AD_OPTIMIZATION_GOAL_LEAD_GENERATION', - 'AD_OPTIMIZATION_GOAL_MEDIA_DOWNLOADS', - 'AD_OPTIMIZATION_GOAL_MESSAGING_APPOINTMENT_CONVERSION', - 'AD_OPTIMIZATION_GOAL_MESSAGING_DEEP_CONVERSATION_AND_FOLLOW', - 'AD_OPTIMIZATION_GOAL_MESSAGING_DEEP_CONVERSATION_AND_REPLY', - 'AD_OPTIMIZATION_GOAL_MESSAGING_PURCHASE_CONVERSION', - 'AD_OPTIMIZATION_GOAL_MID_FUNNEL_EVENT', - 'AD_OPTIMIZATION_GOAL_MRC_VIDEO_VIEWS', - 'AD_OPTIMIZATION_GOAL_MULTI_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_NONE', - 'AD_OPTIMIZATION_GOAL_OFFER_CLAIMS', - 'AD_OPTIMIZATION_GOAL_OFFLINE_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_OFFSITE_CLICKS', - 'AD_OPTIMIZATION_GOAL_OFFSITE_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_ONSITE_CONVERSIONS', - 'AD_OPTIMIZATION_GOAL_PAGE_ENGAGEMENT', - 'AD_OPTIMIZATION_GOAL_PAGE_FOLLOWS', - 'AD_OPTIMIZATION_GOAL_PAGE_LIKES', - 'AD_OPTIMIZATION_GOAL_POST_ENGAGEMENT', - 'AD_OPTIMIZATION_GOAL_QUALITY_CALL', - 'AD_OPTIMIZATION_GOAL_QUALITY_LEAD', - 'AD_OPTIMIZATION_GOAL_REACH', - 'AD_OPTIMIZATION_GOAL_REMINDERS_SET', - 'AD_OPTIMIZATION_GOAL_REPLIES', - 'AD_OPTIMIZATION_GOAL_RESEARCH_POLL_RESPONSES', - 'AD_OPTIMIZATION_GOAL_RETENTION', - 'AD_OPTIMIZATION_GOAL_RETURN_ON_AD_SPEND', - 'AD_OPTIMIZATION_GOAL_SOCIAL_IMPRESSIONS', - 'AD_OPTIMIZATION_GOAL_STORE_VISITS', - 'AD_OPTIMIZATION_GOAL_SUBSCRIBERS', - 'AD_OPTIMIZATION_GOAL_TICKET_PURCHASE', - 'AD_OPTIMIZATION_GOAL_VALUE', - 'AD_OPTIMIZATION_GOAL_VIDEO_LONG_VIEWS', - 'AD_OPTIMIZATION_GOAL_VIDEO_VIEWS', - 'AD_OPTIMIZATION_GOAL_VIDEO_VIEWS_15S', - 'AD_OPTIMIZATION_GOAL_VISIT_INSTAGRAM_PROFILE', - 'AD_OPTIMIZATION_GOAL_VISIT_INSTAGRAM_PROFILE_AND_PROFILE_ACTIONS', - ], - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/ads_conversion_goal', - 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_ads_reporting_mmm_reports(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/adaccountadvolume.py b/facebook_business/adobjects/adaccountadvolume.py index a5838ab0..04fc55b6 100644 --- a/facebook_business/adobjects/adaccountadvolume.py +++ b/facebook_business/adobjects/adaccountadvolume.py @@ -42,6 +42,9 @@ class RecommendationType: aco_toggle = 'ACO_TOGGLE' ads_reporting = 'ADS_REPORTING' advanced_campaign_budget = 'ADVANCED_CAMPAIGN_BUDGET' + advantage_custom_audience_upsell = 'ADVANTAGE_CUSTOM_AUDIENCE_UPSELL' + advantage_plus_audience_friction = 'ADVANTAGE_PLUS_AUDIENCE_FRICTION' + advantage_plus_audience_toggle = 'ADVANTAGE_PLUS_AUDIENCE_TOGGLE' advantage_plus_creative = 'ADVANTAGE_PLUS_CREATIVE' advantage_plus_creative_catalog = 'ADVANTAGE_PLUS_CREATIVE_CATALOG' advantage_shopping_campaign = 'ADVANTAGE_SHOPPING_CAMPAIGN' @@ -77,6 +80,7 @@ class RecommendationType: creative_limited_hourly = 'CREATIVE_LIMITED_HOURLY' creator_ads_pa_conversion = 'CREATOR_ADS_PA_CONVERSION' cta = 'CTA' + da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS' dead_link = 'DEAD_LINK' dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET' ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY' @@ -84,14 +88,16 @@ class RecommendationType: ges_test = 'GES_TEST' guidance_center_code_gen = 'GUIDANCE_CENTER_CODE_GEN' learning_limited = 'LEARNING_LIMITED' + learning_pause_friction = 'LEARNING_PAUSE_FRICTION' low_outcome = 'LOW_OUTCOME' merlin_guidance = 'MERLIN_GUIDANCE' + mixed_pa_combine_adsets = 'MIXED_PA_COMBINE_ADSETS' mmt_carousel_to_video = 'MMT_CAROUSEL_TO_VIDEO' mobile_first_video = 'MOBILE_FIRST_VIDEO' mr_aemv2sub_kconsolidation = 'MR_AEMV2SUB_KCONSOLIDATION' multi_text = 'MULTI_TEXT' music = 'MUSIC' - optimal_spend = 'OPTIMAL_SPEND' + optimal_bau = 'OPTIMAL_BAU' payment_method = 'PAYMENT_METHOD' performant_creative_reels_opt_in = 'PERFORMANT_CREATIVE_REELS_OPT_IN' pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT' diff --git a/facebook_business/adobjects/adactivity.py b/facebook_business/adobjects/adactivity.py index c0c96b84..3765da23 100644 --- a/facebook_business/adobjects/adactivity.py +++ b/facebook_business/adobjects/adactivity.py @@ -108,6 +108,7 @@ class EventType: update_campaign_budget = 'update_campaign_budget' update_campaign_budget_optimization_toggling_status = 'update_campaign_budget_optimization_toggling_status' update_campaign_budget_scheduling_state = 'update_campaign_budget_scheduling_state' + update_campaign_conversion_goal = 'update_campaign_conversion_goal' update_campaign_delivery_type = 'update_campaign_delivery_type' update_campaign_group_ad_scheduling = 'update_campaign_group_ad_scheduling' update_campaign_group_budget_scheduling_state = 'update_campaign_group_budget_scheduling_state' diff --git a/facebook_business/adobjects/adassetfeedspec.py b/facebook_business/adobjects/adassetfeedspec.py index 53196a80..467e00bf 100644 --- a/facebook_business/adobjects/adassetfeedspec.py +++ b/facebook_business/adobjects/adassetfeedspec.py @@ -56,6 +56,7 @@ class CallToActionTypes: call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' donate = 'DONATE' diff --git a/facebook_business/adobjects/adcreative.py b/facebook_business/adobjects/adcreative.py index db7e5689..430656c0 100644 --- a/facebook_business/adobjects/adcreative.py +++ b/facebook_business/adobjects/adcreative.py @@ -110,6 +110,7 @@ class CallToActionType: call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' donate = 'DONATE' diff --git a/facebook_business/adobjects/adcreativelinkdatacalltoaction.py b/facebook_business/adobjects/adcreativelinkdatacalltoaction.py index 10c70da3..978abb38 100644 --- a/facebook_business/adobjects/adcreativelinkdatacalltoaction.py +++ b/facebook_business/adobjects/adcreativelinkdatacalltoaction.py @@ -39,6 +39,7 @@ class Type: call = 'CALL' call_me = 'CALL_ME' call_now = 'CALL_NOW' + confirm = 'CONFIRM' contact = 'CONTACT' contact_us = 'CONTACT_US' donate = 'DONATE' diff --git a/facebook_business/adobjects/adpromotedobject.py b/facebook_business/adobjects/adpromotedobject.py index cab888a7..33b02ded 100644 --- a/facebook_business/adobjects/adpromotedobject.py +++ b/facebook_business/adobjects/adpromotedobject.py @@ -47,7 +47,6 @@ class Field(AbstractObject.Field): product_item_id = 'product_item_id' product_set_id = 'product_set_id' retention_days = 'retention_days' - whats_app_business_phone_number_id = 'whats_app_business_phone_number_id' class CustomEventType: achievement_unlocked = 'ACHIEVEMENT_UNLOCKED' @@ -103,7 +102,6 @@ class CustomEventType: 'product_item_id': 'string', 'product_set_id': 'string', 'retention_days': 'string', - 'whats_app_business_phone_number_id': 'Object', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/adsinsights.py b/facebook_business/adobjects/adsinsights.py index 8c233c70..057ee0eb 100644 --- a/facebook_business/adobjects/adsinsights.py +++ b/facebook_business/adobjects/adsinsights.py @@ -212,6 +212,7 @@ class Breakdowns: is_conversion_id_modeled = 'is_conversion_id_modeled' link_url_asset = 'link_url_asset' marketing_messages_btn_name = 'marketing_messages_btn_name' + mdsa_landing_destination = 'mdsa_landing_destination' media_asset_url = 'media_asset_url' media_creator = 'media_creator' media_destination_url = 'media_destination_url' diff --git a/facebook_business/adobjects/adspixel.py b/facebook_business/adobjects/adspixel.py index 0879eb8e..2e8ff893 100644 --- a/facebook_business/adobjects/adspixel.py +++ b/facebook_business/adobjects/adspixel.py @@ -237,6 +237,37 @@ def get_agencies(self, fields=None, params=None, batch=None, success=None, failu self.assure_call() return request.execute() + def create_ahp_config(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 = { + 'applink_autosetup': 'bool', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/ahp_configs', + 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_assigned_users(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/business.py b/facebook_business/adobjects/business.py index d81a186e..7037601f 100644 --- a/facebook_business/adobjects/business.py +++ b/facebook_business/adobjects/business.py @@ -378,6 +378,7 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure 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 = { + 'entry_point': 'string', 'name': 'string', 'primary_page': 'string', 'timezone_id': 'unsigned int', @@ -2590,6 +2591,8 @@ def create_open_bridge_configuration(self, fields=None, params=None, batch=None, 'access_key': 'string', 'active': 'bool', 'endpoint': 'string', + 'fallback_domain': 'string', + 'fallback_domain_enabled': 'bool', 'host_business_id': 'unsigned int', 'host_external_id': 'string', 'pixel_id': 'unsigned int', @@ -2947,6 +2950,7 @@ def create_owned_page(self, fields=None, params=None, batch=None, success=None, api_utils.warning('`success` and `failure` callback only work for batch call.') param_types = { 'code': 'string', + 'entry_point': 'string', 'page_id': 'int', } enums = { diff --git a/facebook_business/adobjects/group.py b/facebook_business/adobjects/group.py index 69687c36..600aa4db 100644 --- a/facebook_business/adobjects/group.py +++ b/facebook_business/adobjects/group.py @@ -339,67 +339,6 @@ def create_album(self, fields=None, params=None, batch=None, success=None, failu self.assure_call() return request.execute() - def get_attachment_surfaces(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='/attachment_surfaces', - 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_attachment_surface(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 = { - 'title': 'map', - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/attachment_surfaces', - 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_docs(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/igmedia.py b/facebook_business/adobjects/igmedia.py index 181dfec0..8e78395f 100644 --- a/facebook_business/adobjects/igmedia.py +++ b/facebook_business/adobjects/igmedia.py @@ -29,6 +29,7 @@ def __init__(self, fbid=None, parent_id=None, api=None): class Field(AbstractObject.Field): caption = 'caption' comments_count = 'comments_count' + copyright_check_information = 'copyright_check_information' id = 'id' ig_id = 'ig_id' is_comment_enabled = 'is_comment_enabled' @@ -135,6 +136,37 @@ def get_children(self, fields=None, params=None, batch=None, success=None, failu self.assure_call() return request.execute() + def get_collaborators(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.shadowigmediacollaborators import ShadowIGMediaCollaborators + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/collaborators', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=ShadowIGMediaCollaborators, + api_type='EDGE', + response_parser=ObjectParser(target_class=ShadowIGMediaCollaborators, 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_comments(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): @@ -337,6 +369,7 @@ def create_product_tag(self, fields=None, params=None, batch=None, success=None, _field_types = { 'caption': 'string', 'comments_count': 'int', + 'copyright_check_information': 'IGVideoCopyrightCheckMatchesInformation', 'id': 'string', 'ig_id': 'string', 'is_comment_enabled': 'bool', diff --git a/facebook_business/adobjects/igvideocopyrightcheckmatchesinformation.py b/facebook_business/adobjects/igvideocopyrightcheckmatchesinformation.py new file mode 100644 index 00000000..64c478e0 --- /dev/null +++ b/facebook_business/adobjects/igvideocopyrightcheckmatchesinformation.py @@ -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. + +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 IGVideoCopyrightCheckMatchesInformation( + AbstractObject, +): + + def __init__(self, api=None): + super(IGVideoCopyrightCheckMatchesInformation, self).__init__() + self._isIGVideoCopyrightCheckMatchesInformation = True + self._api = api + + class Field(AbstractObject.Field): + copyright_matches = 'copyright_matches' + status = 'status' + + _field_types = { + 'copyright_matches': 'list', + 'status': 'IGVideoCopyrightCheckStatus', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/igvideocopyrightcheckstatus.py b/facebook_business/adobjects/igvideocopyrightcheckstatus.py new file mode 100644 index 00000000..a40f635f --- /dev/null +++ b/facebook_business/adobjects/igvideocopyrightcheckstatus.py @@ -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. + +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 IGVideoCopyrightCheckStatus( + AbstractObject, +): + + def __init__(self, api=None): + super(IGVideoCopyrightCheckStatus, self).__init__() + self._isIGVideoCopyrightCheckStatus = True + self._api = api + + class Field(AbstractObject.Field): + matches_found = 'matches_found' + status = 'status' + + _field_types = { + 'matches_found': 'bool', + 'status': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/instagramcomment.py b/facebook_business/adobjects/instagramcomment.py index abdbfcf7..035d9732 100644 --- a/facebook_business/adobjects/instagramcomment.py +++ b/facebook_business/adobjects/instagramcomment.py @@ -34,6 +34,7 @@ class Field(AbstractObject.Field): instagram_user = 'instagram_user' mentioned_instagram_users = 'mentioned_instagram_users' message = 'message' + username = 'username' def api_delete(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False): from facebook_business.utils import api_utils @@ -198,6 +199,7 @@ def create_reply(self, fields=None, params=None, batch=None, success=None, failu 'instagram_user': 'InstagramUser', 'mentioned_instagram_users': 'list', 'message': 'string', + 'username': 'string', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/openbridgeconfiguration.py b/facebook_business/adobjects/openbridgeconfiguration.py index bfb1c9d9..8b283894 100644 --- a/facebook_business/adobjects/openbridgeconfiguration.py +++ b/facebook_business/adobjects/openbridgeconfiguration.py @@ -30,6 +30,8 @@ class Field(AbstractObject.Field): access_key = 'access_key' active = 'active' endpoint = 'endpoint' + fallback_domain = 'fallback_domain' + fallback_domain_enabled = 'fallback_domain_enabled' host_business_id = 'host_business_id' host_external_id = 'host_external_id' id = 'id' @@ -113,6 +115,8 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure 'access_key': 'string', 'active': 'bool', 'endpoint': 'string', + 'fallback_domain': 'string', + 'fallback_domain_enabled': 'bool', 'host_business_id': 'unsigned int', 'host_external_id': 'string', } @@ -144,6 +148,8 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure 'access_key': 'string', 'active': 'bool', 'endpoint': 'string', + 'fallback_domain': 'string', + 'fallback_domain_enabled': 'bool', 'host_business_id': 'string', 'host_external_id': 'string', 'id': 'string', diff --git a/facebook_business/adobjects/page.py b/facebook_business/adobjects/page.py index af29863d..30d08cbe 100644 --- a/facebook_business/adobjects/page.py +++ b/facebook_business/adobjects/page.py @@ -64,6 +64,7 @@ class Field(AbstractObject.Field): directed_by = 'directed_by' display_subtext = 'display_subtext' displayed_message_response_time = 'displayed_message_response_time' + does_viewer_have_page_permission_link_ig = 'does_viewer_have_page_permission_link_ig' emails = 'emails' engagement = 'engagement' fan_count = 'fan_count' @@ -92,6 +93,7 @@ class Field(AbstractObject.Field): is_chain = 'is_chain' 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_messenger_bot_get_started_enabled = 'is_messenger_bot_get_started_enabled' is_messenger_platform_bot = 'is_messenger_platform_bot' is_owned = 'is_owned' @@ -111,7 +113,6 @@ class Field(AbstractObject.Field): merchant_review_status = 'merchant_review_status' messaging_feature_status = 'messaging_feature_status' messenger_ads_default_icebreakers = 'messenger_ads_default_icebreakers' - messenger_ads_default_page_welcome_message = 'messenger_ads_default_page_welcome_message' messenger_ads_default_quick_replies = 'messenger_ads_default_quick_replies' messenger_ads_quick_replies_type = 'messenger_ads_quick_replies_type' mini_shop_storefront = 'mini_shop_storefront' @@ -2664,8 +2665,8 @@ def delete_locations(self, fields=None, params=None, batch=None, success=None, f 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 = { - 'location_page_id': 'string', - 'store_number': 'unsigned int', + 'location_page_ids': 'list', + 'store_numbers': 'list', } enums = { } @@ -4998,6 +4999,7 @@ def get_welcome_message_flows(self, fields=None, params=None, batch=None, succes 'directed_by': 'string', 'display_subtext': 'string', 'displayed_message_response_time': 'string', + 'does_viewer_have_page_permission_link_ig': 'bool', 'emails': 'list', 'engagement': 'Engagement', 'fan_count': 'unsigned int', @@ -5026,6 +5028,7 @@ def get_welcome_message_flows(self, fields=None, params=None, batch=None, succes 'is_chain': 'bool', '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_messenger_bot_get_started_enabled': 'bool', 'is_messenger_platform_bot': 'bool', 'is_owned': 'bool', @@ -5045,7 +5048,6 @@ def get_welcome_message_flows(self, fields=None, params=None, batch=None, succes 'merchant_review_status': 'string', 'messaging_feature_status': 'MessagingFeatureStatus', 'messenger_ads_default_icebreakers': 'list', - 'messenger_ads_default_page_welcome_message': 'MessengerDestinationPageWelcomeMessage', 'messenger_ads_default_quick_replies': 'list', 'messenger_ads_quick_replies_type': 'string', 'mini_shop_storefront': 'Shop', diff --git a/facebook_business/adobjects/productfeed.py b/facebook_business/adobjects/productfeed.py index 9b03ecc6..fc5f39c3 100644 --- a/facebook_business/adobjects/productfeed.py +++ b/facebook_business/adobjects/productfeed.py @@ -129,6 +129,7 @@ class OverrideType: language = 'LANGUAGE' language_and_country = 'LANGUAGE_AND_COUNTRY' local = 'LOCAL' + smart_pixel_language_or_country = 'SMART_PIXEL_LANGUAGE_OR_COUNTRY' # @deprecated get_endpoint function is deprecated @classmethod diff --git a/facebook_business/adobjects/shadowigmediabuilder.py b/facebook_business/adobjects/shadowigmediabuilder.py index d72be530..d6204919 100644 --- a/facebook_business/adobjects/shadowigmediabuilder.py +++ b/facebook_business/adobjects/shadowigmediabuilder.py @@ -27,6 +27,7 @@ def __init__(self, fbid=None, parent_id=None, api=None): super(ShadowIGMediaBuilder, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): + copyright_check_status = 'copyright_check_status' id = 'id' status = 'status' status_code = 'status_code' @@ -62,6 +63,7 @@ def api_get(self, fields=None, params=None, batch=None, success=None, failure=No return request.execute() _field_types = { + 'copyright_check_status': 'IGVideoCopyrightCheckStatus', 'id': 'string', 'status': 'string', 'status_code': 'string', diff --git a/facebook_business/adobjects/messengerdestinationpagewelcomemessage.py b/facebook_business/adobjects/shadowigmediacollaborators.py similarity index 61% rename from facebook_business/adobjects/messengerdestinationpagewelcomemessage.py rename to facebook_business/adobjects/shadowigmediacollaborators.py index 2e455312..8099781d 100644 --- a/facebook_business/adobjects/messengerdestinationpagewelcomemessage.py +++ b/facebook_business/adobjects/shadowigmediacollaborators.py @@ -18,29 +18,23 @@ pull request for this class. """ -class MessengerDestinationPageWelcomeMessage( +class ShadowIGMediaCollaborators( AbstractCrudObject, ): def __init__(self, fbid=None, parent_id=None, api=None): - self._isMessengerDestinationPageWelcomeMessage = True - super(MessengerDestinationPageWelcomeMessage, self).__init__(fbid, parent_id, api) + self._isShadowIGMediaCollaborators = True + super(ShadowIGMediaCollaborators, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): id = 'id' - page_welcome_message_body = 'page_welcome_message_body' - page_welcome_message_type = 'page_welcome_message_type' - template_name = 'template_name' - time_created = 'time_created' - time_last_used = 'time_last_used' + invite_status = 'invite_status' + username = 'username' _field_types = { 'id': 'string', - 'page_welcome_message_body': 'string', - 'page_welcome_message_type': 'string', - 'template_name': 'string', - 'time_created': 'datetime', - 'time_last_used': 'datetime', + 'invite_status': 'string', + 'username': 'string', } @classmethod def _get_field_enum_info(cls): diff --git a/facebook_business/adobjects/whatsappbusinessaccount.py b/facebook_business/adobjects/whatsappbusinessaccount.py index db5ea7d5..a575460c 100644 --- a/facebook_business/adobjects/whatsappbusinessaccount.py +++ b/facebook_business/adobjects/whatsappbusinessaccount.py @@ -51,7 +51,11 @@ class Tasks: manage = 'MANAGE' manage_extensions = 'MANAGE_EXTENSIONS' manage_phone = 'MANAGE_PHONE' + manage_phone_assets = 'MANAGE_PHONE_ASSETS' + manage_templates = 'MANAGE_TEMPLATES' view_cost = 'VIEW_COST' + view_phone_assets = 'VIEW_PHONE_ASSETS' + view_templates = 'VIEW_TEMPLATES' class Category: authentication = 'AUTHENTICATION' @@ -362,12 +366,23 @@ def create_extension(self, fields=None, params=None, batch=None, success=None, f 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 = { + 'categories': 'list', 'clone_extension_id': 'string', 'clone_template': 'string', 'data_channel_uri': 'string', 'name': 'string', } enums = { + 'categories_enum': [ + 'APPOINTMENT_BOOKING', + 'CONTACT_US', + 'CUSTOMER_SUPPORT', + 'LEAD_GENERATION', + 'OTHER', + 'SIGN_IN', + 'SIGN_UP', + 'SURVEY', + ], } request = FacebookRequest( node_id=self['id'], @@ -426,12 +441,23 @@ def create_flow(self, fields=None, params=None, batch=None, success=None, failur 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 = { + 'categories': 'list', 'clone_flow_id': 'string', 'clone_template': 'string', 'data_channel_uri': 'string', 'name': 'string', } enums = { + 'categories_enum': [ + 'APPOINTMENT_BOOKING', + 'CONTACT_US', + 'CUSTOMER_SUPPORT', + 'LEAD_GENERATION', + 'OTHER', + 'SIGN_IN', + 'SIGN_UP', + 'SURVEY', + ], } request = FacebookRequest( node_id=self['id'], diff --git a/facebook_business/apiconfig.py b/facebook_business/apiconfig.py index c58ccfb1..b296800f 100644 --- a/facebook_business/apiconfig.py +++ b/facebook_business/apiconfig.py @@ -6,6 +6,6 @@ ads_api_config = { 'API_VERSION': 'v18.0', - 'SDK_VERSION': 'v18.0.2', + 'SDK_VERSION': 'v18.0.3', 'STRICT_MODE': False } diff --git a/setup.py b/setup.py index 85c0bdd0..dece0284 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 = '18.0.2' +PACKAGE_VERSION = '18.0.3' PACKAGE_AUTHOR = 'Facebook' PACKAGE_AUTHOR_EMAIL = 'shuotian@meta.com' PACKAGE_URL = 'https://github.com/facebook/facebook-python-business-sdk'