From df8fc8ea16bf2c55b63236365ae4686a76e62c98 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005295453 Date: Tue, 26 Sep 2023 10:22:55 -0700 Subject: [PATCH] Auto-generated python SDK code update Summary: ignore-conflict-markers Reviewed By: stcheng Differential Revision: D49642827 fbshipit-source-id: ba922064472a2f7c0aa53d000fca81e54a3396a6 --- facebook_business/__init__.py | 2 +- .../adobjects/adaccountadvolume.py | 1 + facebook_business/adobjects/adactivity.py | 4 + facebook_business/adobjects/adcreative.py | 2 + .../adcreativedegreesoffreedomspec.py | 2 +- .../adobjects/adcreativefeaturedetails.py | 37 +++++ .../adobjects/adcreativefeaturesspec.py | 89 ++++++++++++ .../adobjects/adcreativesourcingspec.py | 37 +++++ facebook_business/adobjects/adpreview.py | 1 + .../adobjects/adpromotedobject.py | 2 + facebook_business/adobjects/adrule.py | 2 + facebook_business/adobjects/adsinsights.py | 6 + facebook_business/adobjects/advideo.py | 2 + facebook_business/adobjects/application.py | 62 ++++++++ .../adobjects/automotivemodel.py | 5 +- facebook_business/adobjects/campaign.py | 2 + .../adobjects/commercemerchantsettings.py | 2 - .../contentpublishinglimitresponse.py | 39 +++++ facebook_business/adobjects/destination.py | 5 +- .../adobjects/dynamicvideometadata.py | 76 ++++++++++ facebook_business/adobjects/flight.py | 5 +- facebook_business/adobjects/homelisting.py | 5 +- facebook_business/adobjects/hotel.py | 5 +- facebook_business/adobjects/igcomment.py | 2 +- .../adobjects/igcommentfromuser.py | 42 ++++++ .../adobjects/igshoppingproductappeal.py | 45 ++++++ facebook_business/adobjects/iguser.py | 30 ++-- .../instagramshoppingmerchantreviewmessage.py | 39 +++++ facebook_business/adobjects/mediatitle.py | 5 +- facebook_business/adobjects/page.py | 4 + .../adobjects/pagepostexperiment.py | 2 + facebook_business/adobjects/productitem.py | 16 ++- .../adobjects/shadowighashtag.py | 136 ++++++++++++++++++ .../adobjects/shadowigmediabuilder.py | 74 ++++++++++ .../shadowigusercatalogproductsearch.py | 51 +++++++ .../shadowigusercatalogproductvariant.py | 39 +++++ facebook_business/adobjects/stories.py | 7 + .../adobjects/useravailablecatalogs.py | 43 ++++++ facebook_business/adobjects/vehicle.py | 5 +- facebook_business/adobjects/vehicleoffer.py | 5 +- .../adobjects/whatsappbusinessaccount.py | 77 +++++++++- facebook_business/apiconfig.py | 2 +- setup.py | 2 +- 43 files changed, 981 insertions(+), 38 deletions(-) create mode 100644 facebook_business/adobjects/adcreativefeaturedetails.py create mode 100644 facebook_business/adobjects/adcreativefeaturesspec.py create mode 100644 facebook_business/adobjects/adcreativesourcingspec.py create mode 100644 facebook_business/adobjects/contentpublishinglimitresponse.py create mode 100644 facebook_business/adobjects/dynamicvideometadata.py create mode 100644 facebook_business/adobjects/igcommentfromuser.py create mode 100644 facebook_business/adobjects/igshoppingproductappeal.py create mode 100644 facebook_business/adobjects/instagramshoppingmerchantreviewmessage.py create mode 100644 facebook_business/adobjects/shadowighashtag.py create mode 100644 facebook_business/adobjects/shadowigmediabuilder.py create mode 100644 facebook_business/adobjects/shadowigusercatalogproductsearch.py create mode 100644 facebook_business/adobjects/shadowigusercatalogproductvariant.py create mode 100644 facebook_business/adobjects/useravailablecatalogs.py diff --git a/facebook_business/__init__.py b/facebook_business/__init__.py index d94dc6da..3b33e11b 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.0' +__version__ = '18.0.1' __all__ = [ 'session', 'objects', diff --git a/facebook_business/adobjects/adaccountadvolume.py b/facebook_business/adobjects/adaccountadvolume.py index b8d8a2ae..a5838ab0 100644 --- a/facebook_business/adobjects/adaccountadvolume.py +++ b/facebook_business/adobjects/adaccountadvolume.py @@ -54,6 +54,7 @@ class RecommendationType: auction_overlap = 'AUCTION_OVERLAP' auction_overlap_consolidation = 'AUCTION_OVERLAP_CONSOLIDATION' audience_expansion = 'AUDIENCE_EXPANSION' + audience_expansion_retargeting = 'AUDIENCE_EXPANSION_RETARGETING' autoflow_opt_in = 'AUTOFLOW_OPT_IN' autoflow_opt_in_fallback_duplication_flow = 'AUTOFLOW_OPT_IN_FALLBACK_DUPLICATION_FLOW' automatic_placements = 'AUTOMATIC_PLACEMENTS' diff --git a/facebook_business/adobjects/adactivity.py b/facebook_business/adobjects/adactivity.py index f11a9807..c0c96b84 100644 --- a/facebook_business/adobjects/adactivity.py +++ b/facebook_business/adobjects/adactivity.py @@ -107,10 +107,14 @@ class EventType: update_campaign_ad_scheduling = 'update_campaign_ad_scheduling' 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_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' update_campaign_group_delivery_type = 'update_campaign_group_delivery_type' + update_campaign_group_high_demand_periods = 'update_campaign_group_high_demand_periods' update_campaign_group_spend_cap = 'update_campaign_group_spend_cap' + update_campaign_high_demand_periods = 'update_campaign_high_demand_periods' update_campaign_name = 'update_campaign_name' update_campaign_run_status = 'update_campaign_run_status' update_campaign_schedule = 'update_campaign_schedule' diff --git a/facebook_business/adobjects/adcreative.py b/facebook_business/adobjects/adcreative.py index d7189037..db7e5689 100644 --- a/facebook_business/adobjects/adcreative.py +++ b/facebook_business/adobjects/adcreative.py @@ -44,6 +44,7 @@ class Field(AbstractObject.Field): categorization_criteria = 'categorization_criteria' category_media_source = 'category_media_source' collaborative_ads_lsb_image_bank_id = 'collaborative_ads_lsb_image_bank_id' + creative_sourcing_spec = 'creative_sourcing_spec' degrees_of_freedom_spec = 'degrees_of_freedom_spec' destination_set_id = 'destination_set_id' dynamic_ad_voice = 'dynamic_ad_voice' @@ -462,6 +463,7 @@ def get_previews(self, fields=None, params=None, batch=None, success=None, failu 'categorization_criteria': 'string', 'category_media_source': 'string', 'collaborative_ads_lsb_image_bank_id': 'string', + 'creative_sourcing_spec': 'AdCreativeSourcingSpec', 'degrees_of_freedom_spec': 'AdCreativeDegreesOfFreedomSpec', 'destination_set_id': 'string', 'dynamic_ad_voice': 'string', diff --git a/facebook_business/adobjects/adcreativedegreesoffreedomspec.py b/facebook_business/adobjects/adcreativedegreesoffreedomspec.py index 6bea9c94..51559d6f 100644 --- a/facebook_business/adobjects/adcreativedegreesoffreedomspec.py +++ b/facebook_business/adobjects/adcreativedegreesoffreedomspec.py @@ -35,7 +35,7 @@ class Field(AbstractObject.Field): _field_types = { 'ad_handle_type': 'string', - 'creative_features_spec': 'Object', + 'creative_features_spec': 'AdCreativeFeaturesSpec', 'degrees_of_freedom_type': 'string', 'image_transformation_types': 'list', 'multi_media_transformation_type': 'string', diff --git a/facebook_business/adobjects/adcreativefeaturedetails.py b/facebook_business/adobjects/adcreativefeaturedetails.py new file mode 100644 index 00000000..bf7cccec --- /dev/null +++ b/facebook_business/adobjects/adcreativefeaturedetails.py @@ -0,0 +1,37 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +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 AdCreativeFeatureDetails( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeFeatureDetails, self).__init__() + self._isAdCreativeFeatureDetails = True + self._api = api + + class Field(AbstractObject.Field): + enroll_status = 'enroll_status' + + _field_types = { + 'enroll_status': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/adcreativefeaturesspec.py b/facebook_business/adobjects/adcreativefeaturesspec.py new file mode 100644 index 00000000..cf539855 --- /dev/null +++ b/facebook_business/adobjects/adcreativefeaturesspec.py @@ -0,0 +1,89 @@ +# 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 AdCreativeFeaturesSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeFeaturesSpec, self).__init__() + self._isAdCreativeFeaturesSpec = True + self._api = api + + class Field(AbstractObject.Field): + advantage_plus_creative = 'advantage_plus_creative' + audio = 'audio' + carousel_to_video = 'carousel_to_video' + cv_transformation = 'cv_transformation' + description_automation = 'description_automation' + dha_optimization = 'dha_optimization' + ig_glados_feed = 'ig_glados_feed' + image_auto_crop = 'image_auto_crop' + image_background_gen = 'image_background_gen' + image_enhancement = 'image_enhancement' + image_templates = 'image_templates' + image_touchups = 'image_touchups' + image_uncrop = 'image_uncrop' + inline_comment = 'inline_comment' + media_liquidity_animated_image = 'media_liquidity_animated_image' + media_order = 'media_order' + media_type_automation = 'media_type_automation' + product_extensions = 'product_extensions' + product_metadata_automation = 'product_metadata_automation' + product_tags = 'product_tags' + profile_card = 'profile_card' + standard_enhancements = 'standard_enhancements' + standard_enhancements_catalog = 'standard_enhancements_catalog' + text_generation = 'text_generation' + text_optimizations = 'text_optimizations' + video_auto_crop = 'video_auto_crop' + video_highlight = 'video_highlight' + + _field_types = { + 'advantage_plus_creative': 'AdCreativeFeatureDetails', + 'audio': 'AdCreativeFeatureDetails', + 'carousel_to_video': 'AdCreativeFeatureDetails', + 'cv_transformation': 'AdCreativeFeatureDetails', + 'description_automation': 'AdCreativeFeatureDetails', + 'dha_optimization': 'AdCreativeFeatureDetails', + 'ig_glados_feed': 'AdCreativeFeatureDetails', + 'image_auto_crop': 'AdCreativeFeatureDetails', + 'image_background_gen': 'AdCreativeFeatureDetails', + 'image_enhancement': 'AdCreativeFeatureDetails', + 'image_templates': 'AdCreativeFeatureDetails', + 'image_touchups': 'AdCreativeFeatureDetails', + 'image_uncrop': 'AdCreativeFeatureDetails', + 'inline_comment': 'AdCreativeFeatureDetails', + 'media_liquidity_animated_image': 'AdCreativeFeatureDetails', + 'media_order': 'AdCreativeFeatureDetails', + 'media_type_automation': 'AdCreativeFeatureDetails', + 'product_extensions': 'AdCreativeFeatureDetails', + 'product_metadata_automation': 'AdCreativeFeatureDetails', + 'product_tags': 'AdCreativeFeatureDetails', + 'profile_card': 'AdCreativeFeatureDetails', + 'standard_enhancements': 'AdCreativeFeatureDetails', + 'standard_enhancements_catalog': 'AdCreativeFeatureDetails', + 'text_generation': 'AdCreativeFeatureDetails', + 'text_optimizations': 'AdCreativeFeatureDetails', + 'video_auto_crop': 'AdCreativeFeatureDetails', + 'video_highlight': 'AdCreativeFeatureDetails', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/adcreativesourcingspec.py b/facebook_business/adobjects/adcreativesourcingspec.py new file mode 100644 index 00000000..3b535f4e --- /dev/null +++ b/facebook_business/adobjects/adcreativesourcingspec.py @@ -0,0 +1,37 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +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 AdCreativeSourcingSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeSourcingSpec, self).__init__() + self._isAdCreativeSourcingSpec = True + self._api = api + + class Field(AbstractObject.Field): + associated_product_set_id = 'associated_product_set_id' + + _field_types = { + 'associated_product_set_id': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/adpreview.py b/facebook_business/adobjects/adpreview.py index aecc50dc..62953ea6 100644 --- a/facebook_business/adobjects/adpreview.py +++ b/facebook_business/adobjects/adpreview.py @@ -87,6 +87,7 @@ class AdFormat: watch_feed_mobile = 'WATCH_FEED_MOBILE' class CreativeFeature: + product_metadata_automation = 'product_metadata_automation' profile_card = 'profile_card' standard_enhancements_catalog = 'standard_enhancements_catalog' diff --git a/facebook_business/adobjects/adpromotedobject.py b/facebook_business/adobjects/adpromotedobject.py index 33b02ded..cab888a7 100644 --- a/facebook_business/adobjects/adpromotedobject.py +++ b/facebook_business/adobjects/adpromotedobject.py @@ -47,6 +47,7 @@ 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' @@ -102,6 +103,7 @@ 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/adrule.py b/facebook_business/adobjects/adrule.py index 14292996..daf180c6 100644 --- a/facebook_business/adobjects/adrule.py +++ b/facebook_business/adobjects/adrule.py @@ -60,6 +60,8 @@ class UiCreationSource: am_rule_landing_page_banner = 'AM_RULE_LANDING_PAGE_BANNER' am_syd_resolution_flow = 'AM_SYD_RESOLUTION_FLOW' am_syd_resolution_flow_modal = 'AM_SYD_RESOLUTION_FLOW_MODAL' + am_table_delivery_column_popover = 'AM_TABLE_DELIVERY_COLUMN_POPOVER' + am_table_toggle_popover = 'AM_TABLE_TOGGLE_POPOVER' am_toolbar_create_rule_dropdown = 'AM_TOOLBAR_CREATE_RULE_DROPDOWN' pe_campaign_structure_menu = 'PE_CAMPAIGN_STRUCTURE_MENU' pe_editor_card = 'PE_EDITOR_CARD' diff --git a/facebook_business/adobjects/adsinsights.py b/facebook_business/adobjects/adsinsights.py index 1c695fa2..8c233c70 100644 --- a/facebook_business/adobjects/adsinsights.py +++ b/facebook_business/adobjects/adsinsights.py @@ -212,6 +212,12 @@ class Breakdowns: is_conversion_id_modeled = 'is_conversion_id_modeled' link_url_asset = 'link_url_asset' marketing_messages_btn_name = 'marketing_messages_btn_name' + media_asset_url = 'media_asset_url' + media_creator = 'media_creator' + media_destination_url = 'media_destination_url' + media_format = 'media_format' + media_origin_url = 'media_origin_url' + media_text_content = 'media_text_content' mmm = 'mmm' place_page_id = 'place_page_id' platform_position = 'platform_position' diff --git a/facebook_business/adobjects/advideo.py b/facebook_business/adobjects/advideo.py index 23023258..3401d59e 100644 --- a/facebook_business/adobjects/advideo.py +++ b/facebook_business/adobjects/advideo.py @@ -35,6 +35,7 @@ class Field(AbstractObject.Field): content_category = 'content_category' content_tags = 'content_tags' copyright = 'copyright' + copyright_check_information = 'copyright_check_information' copyright_monitoring_status = 'copyright_monitoring_status' created_time = 'created_time' custom_labels = 'custom_labels' @@ -1171,6 +1172,7 @@ def get_video_insights(self, fields=None, params=None, batch=None, success=None, 'content_category': 'string', 'content_tags': 'list', 'copyright': 'VideoCopyright', + 'copyright_check_information': 'Object', 'copyright_monitoring_status': 'string', 'created_time': 'datetime', 'custom_labels': 'list', diff --git a/facebook_business/adobjects/application.py b/facebook_business/adobjects/application.py index 09ba7d42..129e1c2d 100644 --- a/facebook_business/adobjects/application.py +++ b/facebook_business/adobjects/application.py @@ -1402,6 +1402,37 @@ def get_events(self, fields=None, params=None, batch=None, success=None, failure 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): + api_utils.warning('`success` and `failure` callback only work for batch call.') + param_types = { + 'order_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/iap_purchases', + 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_insights_push_schedule(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): @@ -1669,6 +1700,37 @@ def get_object_types(self, fields=None, params=None, batch=None, success=None, f self.assure_call() return request.execute() + def get_objects(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.nullnode import NullNode + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/objects', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=NullNode, + api_type='EDGE', + response_parser=ObjectParser(target_class=NullNode, 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_occludes_popup(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/automotivemodel.py b/facebook_business/adobjects/automotivemodel.py index 1eb7e6aa..98790835 100644 --- a/facebook_business/adobjects/automotivemodel.py +++ b/facebook_business/adobjects/automotivemodel.py @@ -165,6 +165,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -175,9 +176,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/campaign.py b/facebook_business/adobjects/campaign.py index 51ff48b9..b393f9c4 100644 --- a/facebook_business/adobjects/campaign.py +++ b/facebook_business/adobjects/campaign.py @@ -39,6 +39,7 @@ class Field(AbstractObject.Field): budget_rebalance_flag = 'budget_rebalance_flag' budget_remaining = 'budget_remaining' buying_type = 'buying_type' + campaign_group_active_time = 'campaign_group_active_time' can_create_brand_lift_study = 'can_create_brand_lift_study' can_use_spend_cap = 'can_use_spend_cap' configured_status = 'configured_status' @@ -963,6 +964,7 @@ def get_insights_async(self, fields=None, params=None, batch=None, success=None, 'budget_rebalance_flag': 'bool', 'budget_remaining': 'string', 'buying_type': 'string', + 'campaign_group_active_time': 'string', 'can_create_brand_lift_study': 'bool', 'can_use_spend_cap': 'bool', 'configured_status': 'ConfiguredStatus', diff --git a/facebook_business/adobjects/commercemerchantsettings.py b/facebook_business/adobjects/commercemerchantsettings.py index 54c56163..de38827a 100644 --- a/facebook_business/adobjects/commercemerchantsettings.py +++ b/facebook_business/adobjects/commercemerchantsettings.py @@ -29,7 +29,6 @@ def __init__(self, fbid=None, parent_id=None, api=None): class Field(AbstractObject.Field): braintree_merchant_id = 'braintree_merchant_id' checkout_message = 'checkout_message' - commerce_store = 'commerce_store' contact_email = 'contact_email' cta = 'cta' disable_checkout_urls = 'disable_checkout_urls' @@ -613,7 +612,6 @@ def create_whatsapp_channel(self, fields=None, params=None, batch=None, success= _field_types = { 'braintree_merchant_id': 'string', 'checkout_message': 'string', - 'commerce_store': 'Object', 'contact_email': 'string', 'cta': 'string', 'disable_checkout_urls': 'bool', diff --git a/facebook_business/adobjects/contentpublishinglimitresponse.py b/facebook_business/adobjects/contentpublishinglimitresponse.py new file mode 100644 index 00000000..bdcabfe0 --- /dev/null +++ b/facebook_business/adobjects/contentpublishinglimitresponse.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 ContentPublishingLimitResponse( + AbstractObject, +): + + def __init__(self, api=None): + super(ContentPublishingLimitResponse, self).__init__() + self._isContentPublishingLimitResponse = True + self._api = api + + class Field(AbstractObject.Field): + config = 'config' + quota_usage = 'quota_usage' + + _field_types = { + 'config': 'Object', + 'quota_usage': 'int', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/destination.py b/facebook_business/adobjects/destination.py index f56b5a3d..c95c7ac3 100644 --- a/facebook_business/adobjects/destination.py +++ b/facebook_business/adobjects/destination.py @@ -152,6 +152,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -162,9 +163,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/dynamicvideometadata.py b/facebook_business/adobjects/dynamicvideometadata.py new file mode 100644 index 00000000..849ccb25 --- /dev/null +++ b/facebook_business/adobjects/dynamicvideometadata.py @@ -0,0 +1,76 @@ +# 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 DynamicVideoMetadata( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isDynamicVideoMetadata = True + super(DynamicVideoMetadata, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + id = 'id' + tags = 'tags' + url = 'url' + video = 'video' + + 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=DynamicVideoMetadata, + 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 = { + 'id': 'string', + 'tags': 'list', + 'url': 'string', + 'video': 'AdVideo', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/flight.py b/facebook_business/adobjects/flight.py index af0f9e48..00722916 100644 --- a/facebook_business/adobjects/flight.py +++ b/facebook_business/adobjects/flight.py @@ -193,6 +193,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -203,9 +204,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/homelisting.py b/facebook_business/adobjects/homelisting.py index 5e1b2463..2096480c 100644 --- a/facebook_business/adobjects/homelisting.py +++ b/facebook_business/adobjects/homelisting.py @@ -265,6 +265,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -275,9 +276,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/hotel.py b/facebook_business/adobjects/hotel.py index 348cc202..0f779174 100644 --- a/facebook_business/adobjects/hotel.py +++ b/facebook_business/adobjects/hotel.py @@ -272,6 +272,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -282,9 +283,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/igcomment.py b/facebook_business/adobjects/igcomment.py index a7e573f2..04f46fe3 100644 --- a/facebook_business/adobjects/igcomment.py +++ b/facebook_business/adobjects/igcomment.py @@ -191,7 +191,7 @@ def create_reply(self, fields=None, params=None, batch=None, success=None, failu return request.execute() _field_types = { - 'from': 'Object', + 'from': 'IGCommentFromUser', 'hidden': 'bool', 'id': 'string', 'like_count': 'int', diff --git a/facebook_business/adobjects/igcommentfromuser.py b/facebook_business/adobjects/igcommentfromuser.py new file mode 100644 index 00000000..e6ff45ce --- /dev/null +++ b/facebook_business/adobjects/igcommentfromuser.py @@ -0,0 +1,42 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +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 IGCommentFromUser( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isIGCommentFromUser = True + super(IGCommentFromUser, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + id = 'id' + username = 'username' + + _field_types = { + 'id': 'string', + 'username': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/igshoppingproductappeal.py b/facebook_business/adobjects/igshoppingproductappeal.py new file mode 100644 index 00000000..12f18783 --- /dev/null +++ b/facebook_business/adobjects/igshoppingproductappeal.py @@ -0,0 +1,45 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +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 IGShoppingProductAppeal( + AbstractObject, +): + + def __init__(self, api=None): + super(IGShoppingProductAppeal, self).__init__() + self._isIGShoppingProductAppeal = True + self._api = api + + class Field(AbstractObject.Field): + eligible_for_appeal = 'eligible_for_appeal' + product_appeal_status = 'product_appeal_status' + product_id = 'product_id' + rejection_reasons = 'rejection_reasons' + review_status = 'review_status' + + _field_types = { + 'eligible_for_appeal': 'bool', + 'product_appeal_status': 'string', + 'product_id': 'int', + 'rejection_reasons': 'list', + 'review_status': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/iguser.py b/facebook_business/adobjects/iguser.py index cba31714..202a454c 100644 --- a/facebook_business/adobjects/iguser.py +++ b/facebook_business/adobjects/iguser.py @@ -79,6 +79,7 @@ def get_available_catalogs(self, fields=None, params=None, batch=None, success=N 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.useravailablecatalogs import UserAvailableCatalogs param_types = { } enums = { @@ -89,9 +90,9 @@ def get_available_catalogs(self, fields=None, params=None, batch=None, success=N endpoint='/available_catalogs', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=UserAvailableCatalogs, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=UserAvailableCatalogs, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -109,6 +110,7 @@ def get_catalog_product_search(self, fields=None, params=None, batch=None, succe 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.shadowigusercatalogproductsearch import ShadowIGUserCatalogProductSearch param_types = { 'catalog_id': 'string', 'q': 'string', @@ -121,9 +123,9 @@ def get_catalog_product_search(self, fields=None, params=None, batch=None, succe endpoint='/catalog_product_search', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=ShadowIGUserCatalogProductSearch, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=ShadowIGUserCatalogProductSearch, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -141,6 +143,7 @@ def get_content_publishing_limit(self, fields=None, params=None, batch=None, suc 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.contentpublishinglimitresponse import ContentPublishingLimitResponse param_types = { 'since': 'datetime', } @@ -152,9 +155,9 @@ def get_content_publishing_limit(self, fields=None, params=None, batch=None, suc endpoint='/content_publishing_limit', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=ContentPublishingLimitResponse, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=ContentPublishingLimitResponse, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -456,6 +459,7 @@ def get_product_appeal(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.igshoppingproductappeal import IGShoppingProductAppeal param_types = { 'product_id': 'string', } @@ -467,9 +471,9 @@ def get_product_appeal(self, fields=None, params=None, batch=None, success=None, endpoint='/product_appeal', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=IGShoppingProductAppeal, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=IGShoppingProductAppeal, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -487,6 +491,7 @@ def create_product_appeal(self, fields=None, params=None, batch=None, success=No 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.igshoppingproductappeal import IGShoppingProductAppeal param_types = { 'appeal_reason': 'string', 'product_id': 'string', @@ -499,9 +504,9 @@ def create_product_appeal(self, fields=None, params=None, batch=None, success=No endpoint='/product_appeal', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=IGShoppingProductAppeal, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=IGShoppingProductAppeal, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -519,6 +524,7 @@ def get_recently_searched_hashtags(self, fields=None, params=None, batch=None, s 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.shadowighashtag import ShadowIGHashtag param_types = { } enums = { @@ -529,9 +535,9 @@ def get_recently_searched_hashtags(self, fields=None, params=None, batch=None, s endpoint='/recently_searched_hashtags', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=ShadowIGHashtag, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=ShadowIGHashtag, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/instagramshoppingmerchantreviewmessage.py b/facebook_business/adobjects/instagramshoppingmerchantreviewmessage.py new file mode 100644 index 00000000..6bd83e63 --- /dev/null +++ b/facebook_business/adobjects/instagramshoppingmerchantreviewmessage.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 InstagramShoppingMerchantReviewMessage( + AbstractObject, +): + + def __init__(self, api=None): + super(InstagramShoppingMerchantReviewMessage, self).__init__() + self._isInstagramShoppingMerchantReviewMessage = True + self._api = api + + class Field(AbstractObject.Field): + help_url = 'help_url' + message = 'message' + + _field_types = { + 'help_url': 'string', + 'message': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/mediatitle.py b/facebook_business/adobjects/mediatitle.py index b23d334c..c0de7e59 100644 --- a/facebook_business/adobjects/mediatitle.py +++ b/facebook_business/adobjects/mediatitle.py @@ -234,6 +234,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -244,9 +245,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/page.py b/facebook_business/adobjects/page.py index 0aa7c8ba..af29863d 100644 --- a/facebook_business/adobjects/page.py +++ b/facebook_business/adobjects/page.py @@ -4144,8 +4144,12 @@ def get_stories(self, fields=None, params=None, batch=None, success=None, failur api_utils.warning('`success` and `failure` callback only work for batch call.') from facebook_business.adobjects.stories import Stories param_types = { + 'since': 'datetime', + 'status': 'list', + 'until': 'datetime', } enums = { + 'status_enum': Stories.Status.__dict__.values(), } request = FacebookRequest( node_id=self['id'], diff --git a/facebook_business/adobjects/pagepostexperiment.py b/facebook_business/adobjects/pagepostexperiment.py index 63885bf8..0e438187 100644 --- a/facebook_business/adobjects/pagepostexperiment.py +++ b/facebook_business/adobjects/pagepostexperiment.py @@ -39,6 +39,7 @@ class Field(AbstractObject.Field): insight_snapshots = 'insight_snapshots' name = 'name' optimization_goal = 'optimization_goal' + post_variant_fields = 'post_variant_fields' publish_status = 'publish_status' publish_time = 'publish_time' scheduled_experiment_timestamp = 'scheduled_experiment_timestamp' @@ -117,6 +118,7 @@ def get_video_insights(self, fields=None, params=None, batch=None, success=None, 'insight_snapshots': 'list>>>', 'name': 'string', 'optimization_goal': 'string', + 'post_variant_fields': 'list', 'publish_status': 'string', 'publish_time': 'datetime', 'scheduled_experiment_timestamp': 'datetime', diff --git a/facebook_business/adobjects/productitem.py b/facebook_business/adobjects/productitem.py index 5ba388cc..759c7a25 100644 --- a/facebook_business/adobjects/productitem.py +++ b/facebook_business/adobjects/productitem.py @@ -98,6 +98,7 @@ class Field(AbstractObject.Field): size = 'size' start_date = 'start_date' url = 'url' + video_fetch_status = 'video_fetch_status' visibility = 'visibility' wa_compliance_category = 'wa_compliance_category' additional_uploaded_image_ids = 'additional_uploaded_image_ids' @@ -178,6 +179,14 @@ class ShippingWeightUnit: lb = 'lb' oz = 'oz' + class VideoFetchStatus: + direct_upload = 'DIRECT_UPLOAD' + fetched = 'FETCHED' + fetch_failed = 'FETCH_FAILED' + no_status = 'NO_STATUS' + outdated = 'OUTDATED' + partial_fetch = 'PARTIAL_FETCH' + class Visibility: published = 'published' staging = 'staging' @@ -1005,6 +1014,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -1015,9 +1025,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -1103,6 +1113,7 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None 'size': 'string', 'start_date': 'string', 'url': 'string', + 'video_fetch_status': 'VideoFetchStatus', 'visibility': 'Visibility', 'wa_compliance_category': 'string', 'additional_uploaded_image_ids': 'list', @@ -1140,6 +1151,7 @@ def _get_field_enum_info(cls): field_enum_info['ImageFetchStatus'] = ProductItem.ImageFetchStatus.__dict__.values() field_enum_info['ReviewStatus'] = ProductItem.ReviewStatus.__dict__.values() field_enum_info['ShippingWeightUnit'] = ProductItem.ShippingWeightUnit.__dict__.values() + field_enum_info['VideoFetchStatus'] = ProductItem.VideoFetchStatus.__dict__.values() field_enum_info['Visibility'] = ProductItem.Visibility.__dict__.values() field_enum_info['CommerceTaxCategory'] = ProductItem.CommerceTaxCategory.__dict__.values() field_enum_info['ErrorPriority'] = ProductItem.ErrorPriority.__dict__.values() diff --git a/facebook_business/adobjects/shadowighashtag.py b/facebook_business/adobjects/shadowighashtag.py new file mode 100644 index 00000000..52be31dc --- /dev/null +++ b/facebook_business/adobjects/shadowighashtag.py @@ -0,0 +1,136 @@ +# 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 ShadowIGHashtag( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isShadowIGHashtag = True + super(ShadowIGHashtag, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + id = 'id' + name = 'name' + + 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=ShadowIGHashtag, + 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 get_recent_media(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.igmedia import IGMedia + param_types = { + 'user_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/recent_media', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=IGMedia, + api_type='EDGE', + response_parser=ObjectParser(target_class=IGMedia, 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_top_media(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.igmedia import IGMedia + param_types = { + 'user_id': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/top_media', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=IGMedia, + api_type='EDGE', + response_parser=ObjectParser(target_class=IGMedia, 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 = { + 'id': 'string', + 'name': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/shadowigmediabuilder.py b/facebook_business/adobjects/shadowigmediabuilder.py new file mode 100644 index 00000000..d72be530 --- /dev/null +++ b/facebook_business/adobjects/shadowigmediabuilder.py @@ -0,0 +1,74 @@ +# 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 ShadowIGMediaBuilder( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isShadowIGMediaBuilder = True + super(ShadowIGMediaBuilder, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + id = 'id' + status = 'status' + status_code = 'status_code' + + 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=ShadowIGMediaBuilder, + 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 = { + 'id': 'string', + 'status': 'string', + 'status_code': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/shadowigusercatalogproductsearch.py b/facebook_business/adobjects/shadowigusercatalogproductsearch.py new file mode 100644 index 00000000..5aacd8f8 --- /dev/null +++ b/facebook_business/adobjects/shadowigusercatalogproductsearch.py @@ -0,0 +1,51 @@ +# 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 ShadowIGUserCatalogProductSearch( + AbstractObject, +): + + def __init__(self, api=None): + super(ShadowIGUserCatalogProductSearch, self).__init__() + self._isShadowIGUserCatalogProductSearch = True + self._api = api + + class Field(AbstractObject.Field): + image_url = 'image_url' + is_checkout_flow = 'is_checkout_flow' + merchant_id = 'merchant_id' + product_id = 'product_id' + product_name = 'product_name' + product_variants = 'product_variants' + retailer_id = 'retailer_id' + review_status = 'review_status' + + _field_types = { + 'image_url': 'string', + 'is_checkout_flow': 'bool', + 'merchant_id': 'int', + 'product_id': 'int', + 'product_name': 'string', + 'product_variants': 'list', + 'retailer_id': 'string', + 'review_status': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/shadowigusercatalogproductvariant.py b/facebook_business/adobjects/shadowigusercatalogproductvariant.py new file mode 100644 index 00000000..d65d778b --- /dev/null +++ b/facebook_business/adobjects/shadowigusercatalogproductvariant.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 ShadowIGUserCatalogProductVariant( + AbstractObject, +): + + def __init__(self, api=None): + super(ShadowIGUserCatalogProductVariant, self).__init__() + self._isShadowIGUserCatalogProductVariant = True + self._api = api + + class Field(AbstractObject.Field): + product_id = 'product_id' + variant_name = 'variant_name' + + _field_types = { + 'product_id': 'int', + 'variant_name': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/stories.py b/facebook_business/adobjects/stories.py index 469a428c..d77d22a0 100644 --- a/facebook_business/adobjects/stories.py +++ b/facebook_business/adobjects/stories.py @@ -25,13 +25,19 @@ def __init__(self, api=None): class Field(AbstractObject.Field): creation_time = 'creation_time' + media_id = 'media_id' media_type = 'media_type' post_id = 'post_id' status = 'status' url = 'url' + class Status: + archived = 'ARCHIVED' + published = 'PUBLISHED' + _field_types = { 'creation_time': 'string', + 'media_id': 'string', 'media_type': 'string', 'post_id': 'string', 'status': 'string', @@ -40,6 +46,7 @@ class Field(AbstractObject.Field): @classmethod def _get_field_enum_info(cls): field_enum_info = {} + field_enum_info['Status'] = Stories.Status.__dict__.values() return field_enum_info diff --git a/facebook_business/adobjects/useravailablecatalogs.py b/facebook_business/adobjects/useravailablecatalogs.py new file mode 100644 index 00000000..a89e692c --- /dev/null +++ b/facebook_business/adobjects/useravailablecatalogs.py @@ -0,0 +1,43 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. + +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. + +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 UserAvailableCatalogs( + AbstractObject, +): + + def __init__(self, api=None): + super(UserAvailableCatalogs, self).__init__() + self._isUserAvailableCatalogs = True + self._api = api + + class Field(AbstractObject.Field): + catalog_id = 'catalog_id' + catalog_name = 'catalog_name' + product_count = 'product_count' + shop_name = 'shop_name' + + _field_types = { + 'catalog_id': 'string', + 'catalog_name': 'string', + 'product_count': 'int', + 'shop_name': 'string', + } + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info + + diff --git a/facebook_business/adobjects/vehicle.py b/facebook_business/adobjects/vehicle.py index e35b314b..6013e60d 100644 --- a/facebook_business/adobjects/vehicle.py +++ b/facebook_business/adobjects/vehicle.py @@ -340,6 +340,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -350,9 +351,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/vehicleoffer.py b/facebook_business/adobjects/vehicleoffer.py index 17697782..31d1966e 100644 --- a/facebook_business/adobjects/vehicleoffer.py +++ b/facebook_business/adobjects/vehicleoffer.py @@ -180,6 +180,7 @@ def get_videos_metadata(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.dynamicvideometadata import DynamicVideoMetadata param_types = { } enums = { @@ -190,9 +191,9 @@ def get_videos_metadata(self, fields=None, params=None, batch=None, success=None endpoint='/videos_metadata', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=DynamicVideoMetadata, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=DynamicVideoMetadata, api=self._api), ) request.add_params(params) request.add_fields(fields) diff --git a/facebook_business/adobjects/whatsappbusinessaccount.py b/facebook_business/adobjects/whatsappbusinessaccount.py index 34bec010..db5ea7d5 100644 --- a/facebook_business/adobjects/whatsappbusinessaccount.py +++ b/facebook_business/adobjects/whatsappbusinessaccount.py @@ -58,6 +58,11 @@ class Category: marketing = 'MARKETING' utility = 'UTILITY' + class SubCategory: + custom = 'CUSTOM' + order_details = 'ORDER_DETAILS' + order_status = 'ORDER_STATUS' + 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): @@ -352,6 +357,40 @@ def get_extensions(self, fields=None, params=None, batch=None, success=None, fai self.assure_call() return request.execute() + def create_extension(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 = { + 'clone_extension_id': 'string', + 'clone_template': 'string', + 'data_channel_uri': 'string', + 'name': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/extensions', + 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_flows(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): @@ -382,6 +421,40 @@ def get_flows(self, fields=None, params=None, batch=None, success=None, failure= self.assure_call() return request.execute() + def create_flow(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 = { + 'clone_flow_id': 'string', + 'clone_template': 'string', + 'data_channel_uri': 'string', + 'name': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/flows', + 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_message_campaigns(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): @@ -552,10 +625,11 @@ def create_message_template(self, fields=None, params=None, batch=None, success= 'language': 'string', 'message_send_ttl_seconds': 'unsigned int', 'name': 'string', - 'sub_category': 'Object', + 'sub_category': 'sub_category_enum', } enums = { 'category_enum': WhatsAppBusinessAccount.Category.__dict__.values(), + 'sub_category_enum': WhatsAppBusinessAccount.SubCategory.__dict__.values(), } request = FacebookRequest( node_id=self['id'], @@ -1029,6 +1103,7 @@ def _get_field_enum_info(cls): field_enum_info = {} field_enum_info['Tasks'] = WhatsAppBusinessAccount.Tasks.__dict__.values() field_enum_info['Category'] = WhatsAppBusinessAccount.Category.__dict__.values() + field_enum_info['SubCategory'] = WhatsAppBusinessAccount.SubCategory.__dict__.values() return field_enum_info diff --git a/facebook_business/apiconfig.py b/facebook_business/apiconfig.py index cd579a6f..f127fd22 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.0', + 'SDK_VERSION': 'v18.0.1', 'STRICT_MODE': False } diff --git a/setup.py b/setup.py index cd0bcc02..c80d2bf6 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.0' +PACKAGE_VERSION = '18.0.1' PACKAGE_AUTHOR = 'Facebook' PACKAGE_AUTHOR_EMAIL = '' PACKAGE_URL = 'https://github.com/facebook/facebook-python-business-sdk'