Skip to content

Commit

Permalink
Auto-generated python SDK code update
Browse files Browse the repository at this point in the history
Summary: ignore-conflict-markers

Reviewed By: stcheng

Differential Revision: D49642827

fbshipit-source-id: ba922064472a2f7c0aa53d000fca81e54a3396a6
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Sep 26, 2023
1 parent fb26887 commit df8fc8e
Show file tree
Hide file tree
Showing 43 changed files with 981 additions and 38 deletions.
2 changes: 1 addition & 1 deletion facebook_business/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adaccountadvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions facebook_business/adobjects/adactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/adcreative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>',
'multi_media_transformation_type': 'string',
Expand Down
37 changes: 37 additions & 0 deletions facebook_business/adobjects/adcreativefeaturedetails.py
Original file line number Diff line number Diff line change
@@ -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


89 changes: 89 additions & 0 deletions facebook_business/adobjects/adcreativefeaturesspec.py
Original file line number Diff line number Diff line change
@@ -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


37 changes: 37 additions & 0 deletions facebook_business/adobjects/adcreativesourcingspec.py
Original file line number Diff line number Diff line change
@@ -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


1 change: 1 addition & 0 deletions facebook_business/adobjects/adpreview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/adpromotedobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/adrule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions facebook_business/adobjects/adsinsights.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/advideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -1171,6 +1172,7 @@ def get_video_insights(self, fields=None, params=None, batch=None, success=None,
'content_category': 'string',
'content_tags': 'list<string>',
'copyright': 'VideoCopyright',
'copyright_check_information': 'Object',
'copyright_monitoring_status': 'string',
'created_time': 'datetime',
'custom_labels': 'list<string>',
Expand Down
62 changes: 62 additions & 0 deletions facebook_business/adobjects/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 3 additions & 2 deletions facebook_business/adobjects/automotivemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand Down
Loading

0 comments on commit df8fc8e

Please sign in to comment.