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: D56033281

fbshipit-source-id: 9d9b948a023d9240558521b975ad6bea44caef14
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Apr 15, 2024
1 parent ff8c1c6 commit 063d440
Show file tree
Hide file tree
Showing 42 changed files with 440 additions and 266 deletions.
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostAdSetCreateCpa.py
Expand Up @@ -35,8 +35,8 @@
'name': 'A CPA Ad Set',
'campaign_id': '<adCampaignLinkClicksID>',
'daily_budget': '5000',
'start_time': '2024-03-20T14:31:58-0700',
'end_time': '2024-03-27T14:31:58-0700',
'start_time': '2024-04-08T11:26:05-0700',
'end_time': '2024-04-15T11:26:05-0700',
'billing_event': 'IMPRESSIONS',
'optimization_goal': 'REACH',
'bid_amount': '1000',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py
Expand Up @@ -35,8 +35,8 @@
'name': 'A CPA Ad Set optimized for App Events',
'campaign_id': '<adCampaignAppInstallsID>',
'daily_budget': '300',
'start_time': '2024-03-20T14:32:42-0700',
'end_time': '2024-03-27T14:32:42-0700',
'start_time': '2024-04-08T11:26:49-0700',
'end_time': '2024-04-15T11:26:49-0700',
'billing_event': 'IMPRESSIONS',
'optimization_goal': 'OFFSITE_CONVERSIONS',
'bid_amount': '100',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostCreateAdSet.py
Expand Up @@ -34,8 +34,8 @@
params = {
'name': 'My First AdSet',
'lifetime_budget': '20000',
'start_time': '2024-03-20T14:31:13-0700',
'end_time': '2024-03-27T14:31:13-0700',
'start_time': '2024-04-08T11:25:19-0700',
'end_time': '2024-04-15T11:25:19-0700',
'campaign_id': '<adCampaignLinkClicksID>',
'bid_amount': '500',
'billing_event': 'IMPRESSIONS',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostDailyBudget20.py
Expand Up @@ -34,8 +34,8 @@
params = {
'name': 'My First Adset',
'daily_budget': '2000',
'start_time': '2024-03-13T14:32:15-0700',
'end_time': '2024-03-20T14:32:15-0700',
'start_time': '2024-04-01T11:26:23-0700',
'end_time': '2024-04-08T11:26:23-0700',
'campaign_id': '<adCampaignLinkClicksID>',
'bid_amount': '100',
'billing_event': 'LINK_CLICKS',
Expand Down
Expand Up @@ -34,8 +34,8 @@
params = {
'name': 'My First Adset',
'lifetime_budget': '20000',
'start_time': '2024-03-13T14:32:24-0700',
'end_time': '2024-03-23T14:32:24-0700',
'start_time': '2024-04-01T11:26:32-0700',
'end_time': '2024-04-11T11:26:32-0700',
'campaign_id': '<adCampaignLinkClicksID>',
'bid_amount': '100',
'billing_event': 'LINK_CLICKS',
Expand Down
4 changes: 2 additions & 2 deletions examples/AdAccountAdSetsPostOptimizePostEngagement.py
Expand Up @@ -34,8 +34,8 @@
params = {
'name': 'My First Adset',
'lifetime_budget': '20000',
'start_time': '2024-03-13T14:32:33-0700',
'end_time': '2024-03-23T14:32:33-0700',
'start_time': '2024-04-01T11:26:40-0700',
'end_time': '2024-04-11T11:26:40-0700',
'campaign_id': '<adCampaignLinkClicksID>',
'bid_amount': '500',
'billing_event': 'IMPRESSIONS',
Expand Down
2 changes: 1 addition & 1 deletion examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py
Expand Up @@ -32,7 +32,7 @@
fields = [
]
params = {
'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1681144509}],
'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1711391704}],
}
print Ad(id).get_leads(
fields=fields,
Expand Down
2 changes: 1 addition & 1 deletion examples/AdsPixelEventsPost.py
Expand Up @@ -31,7 +31,7 @@
fields = [
]
params = {
'data': [{'event_name':'PageView','event_time':1681748568,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
'data': [{'event_name':'PageView','event_time':1711995835,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
}
print AdsPixel(id).create_event(
fields=fields,
Expand Down
2 changes: 1 addition & 1 deletion facebook_business/__init__.py
Expand Up @@ -7,7 +7,7 @@
from facebook_business.session import FacebookSession
from facebook_business.api import FacebookAdsApi

__version__ = '19.0.2'
__version__ = '19.0.3'
__all__ = [
'session',
'objects',
Expand Down
96 changes: 96 additions & 0 deletions facebook_business/adobjects/adaccount.py
Expand Up @@ -40,6 +40,7 @@ class Field(AbstractObject.Field):
amount_spent = 'amount_spent'
attribution_spec = 'attribution_spec'
balance = 'balance'
brand_safety_content_filter_levels = 'brand_safety_content_filter_levels'
business = 'business'
business_city = 'business_city'
business_country_code = 'business_country_code'
Expand Down Expand Up @@ -187,6 +188,7 @@ class ContentType:
automotive_model = 'AUTOMOTIVE_MODEL'
destination = 'DESTINATION'
flight = 'FLIGHT'
generic = 'GENERIC'
home_listing = 'HOME_LISTING'
hotel = 'HOTEL'
job = 'JOB'
Expand All @@ -205,6 +207,7 @@ class Subtype:
claim = 'CLAIM'
custom = 'CUSTOM'
engagement = 'ENGAGEMENT'
exclusion = 'EXCLUSION'
fox = 'FOX'
lookalike = 'LOOKALIKE'
managed = 'MANAGED'
Expand Down Expand Up @@ -2154,6 +2157,36 @@ def create_async_ad_request_set(self, fields=None, params=None, batch=None, succ
self.assure_call()
return request.execute()

def get_audience_funnel(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
}
enums = {
}
request = FacebookRequest(
node_id=self['id'],
method='GET',
endpoint='/audience_funnel',
api=self._api,
param_checker=TypeChecker(param_types, enums),
target_class=AbstractCrudObject,
api_type='EDGE',
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
)
request.add_params(params)
request.add_fields(fields)

if batch is not None:
request.add_to_batch(batch, success=success, failure=failure)
return request
elif pending:
return request
else:
self.assure_call()
return request.execute()

def create_block_list_draft(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
Expand Down Expand Up @@ -2510,6 +2543,36 @@ def get_conversion_goals(self, fields=None, params=None, batch=None, success=Non
self.assure_call()
return request.execute()

def get_cpa_guidance(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
}
enums = {
}
request = FacebookRequest(
node_id=self['id'],
method='GET',
endpoint='/cpa_guidance',
api=self._api,
param_checker=TypeChecker(param_types, enums),
target_class=AbstractCrudObject,
api_type='EDGE',
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
)
request.add_params(params)
request.add_fields(fields)

if batch is not None:
request.add_to_batch(batch, success=success, failure=failure)
return request
elif pending:
return request
else:
self.assure_call()
return request.execute()

def get_custom_audiences(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
Expand Down Expand Up @@ -3818,6 +3881,8 @@ def get_targeting_search(self, fields=None, params=None, batch=None, success=Non
'allow_only_fat_head_interests': 'bool',
'app_store': 'app_store_enum',
'countries': 'list<string>',
'is_account_level_brand_safety_exclusion': 'bool',
'is_account_level_employer_exclusion': 'bool',
'is_exclusion': 'bool',
'limit_type': 'limit_type_enum',
'objective': 'objective_enum',
Expand Down Expand Up @@ -4104,6 +4169,36 @@ def delete_users_of_any_audience(self, fields=None, params=None, batch=None, suc
self.assure_call()
return request.execute()

def get_value_adjustment_rule_collections(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
}
enums = {
}
request = FacebookRequest(
node_id=self['id'],
method='GET',
endpoint='/value_adjustment_rule_collections',
api=self._api,
param_checker=TypeChecker(param_types, enums),
target_class=AbstractCrudObject,
api_type='EDGE',
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
)
request.add_params(params)
request.add_fields(fields)

if batch is not None:
request.add_to_batch(batch, success=success, failure=failure)
return request
elif pending:
return request
else:
self.assure_call()
return request.execute()

def get_value_adjustment_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
Expand Down Expand Up @@ -4144,6 +4239,7 @@ def get_value_adjustment_rules(self, fields=None, params=None, batch=None, succe
'amount_spent': 'string',
'attribution_spec': 'list<AttributionSpec>',
'balance': 'string',
'brand_safety_content_filter_levels': 'list<string>',
'business': 'Business',
'business_city': 'string',
'business_country_code': 'string',
Expand Down
5 changes: 5 additions & 0 deletions facebook_business/adobjects/adaccountadvolume.py
Expand Up @@ -65,6 +65,7 @@ class RecommendationType:
asc_budget_optimization = 'ASC_BUDGET_OPTIMIZATION'
asc_budget_optimization_pfr = 'ASC_BUDGET_OPTIMIZATION_PFR'
asc_creation_package = 'ASC_CREATION_PACKAGE'
asc_fragmentation_v2 = 'ASC_FRAGMENTATION_V2'
aspect_ratio = 'ASPECT_RATIO'
atleast_6_placements = 'ATLEAST_6_PLACEMENTS'
auction_overlap = 'AUCTION_OVERLAP'
Expand All @@ -82,6 +83,7 @@ class RecommendationType:
capi_performance_match_key = 'CAPI_PERFORMANCE_MATCH_KEY'
capi_performance_match_key_v2 = 'CAPI_PERFORMANCE_MATCH_KEY_V2'
cash_rewards_opt_in = 'CASH_REWARDS_OPT_IN'
connected_sources = 'CONNECTED_SOURCES'
connect_facebook_page_to_instagram = 'CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM'
connect_facebook_page_to_whatsapp = 'CONNECT_FACEBOOK_PAGE_TO_WHATSAPP'
conversion_lead_ads = 'CONVERSION_LEAD_ADS'
Expand All @@ -101,8 +103,10 @@ class RecommendationType:
creator_ads_pa_conversion = 'CREATOR_ADS_PA_CONVERSION'
cta = 'CTA'
ctx_budget_optimization = 'CTX_BUDGET_OPTIMIZATION'
ctx_creation_package = 'CTX_CREATION_PACKAGE'
ctx_guidance = 'CTX_GUIDANCE'
da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS'
da_duplication_product_tags = 'DA_DUPLICATION_PRODUCT_TAGS'
dead_link = 'DEAD_LINK'
dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET'
ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY'
Expand Down Expand Up @@ -133,6 +137,7 @@ class RecommendationType:
pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT'
predictive_creative_limited = 'PREDICTIVE_CREATIVE_LIMITED'
predictive_creative_limited_hourly = 'PREDICTIVE_CREATIVE_LIMITED_HOURLY'
preparing_status = 'PREPARING_STATUS'
rapid_learning_limited = 'RAPID_LEARNING_LIMITED'
rapid_learning_phase = 'RAPID_LEARNING_PHASE'
reels_duplication_upsell = 'REELS_DUPLICATION_UPSELL'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adaccounttargetingunified.py
Expand Up @@ -430,6 +430,7 @@ class WhitelistedTypes:
location_categories = 'location_categories'
location_cluster_ids = 'location_cluster_ids'
location_expansion = 'location_expansion'
marketing_message_channels = 'marketing_message_channels'
marketing_message_targeting = 'marketing_message_targeting'
marketplace_product_categories = 'marketplace_product_categories'
messenger_positions = 'messenger_positions'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adactivity.py
Expand Up @@ -119,6 +119,7 @@ class EventType:
update_campaign_name = 'update_campaign_name'
update_campaign_run_status = 'update_campaign_run_status'
update_campaign_schedule = 'update_campaign_schedule'
update_campaign_value_adjustment_rule = 'update_campaign_value_adjustment_rule'
update_delivery_type_cross_level_shift = 'update_delivery_type_cross_level_shift'

class Category:
Expand Down
9 changes: 9 additions & 0 deletions facebook_business/adobjects/adassetfeedspec.py
Expand Up @@ -42,6 +42,7 @@ class Field(AbstractObject.Field):
message_extensions = 'message_extensions'
onsite_destinations = 'onsite_destinations'
optimization_type = 'optimization_type'
promotional_metadata = 'promotional_metadata'
reasons_to_shop = 'reasons_to_shop'
shops_bundle = 'shops_bundle'
titles = 'titles'
Expand All @@ -50,15 +51,20 @@ class Field(AbstractObject.Field):
class CallToActionTypes:
add_to_cart = 'ADD_TO_CART'
apply_now = 'APPLY_NOW'
ask_about_services = 'ASK_ABOUT_SERVICES'
ask_for_more_info = 'ASK_FOR_MORE_INFO'
audio_call = 'AUDIO_CALL'
book_a_consultation = 'BOOK_A_CONSULTATION'
book_now = 'BOOK_NOW'
book_travel = 'BOOK_TRAVEL'
buy = 'BUY'
buy_now = 'BUY_NOW'
buy_tickets = 'BUY_TICKETS'
buy_via_message = 'BUY_VIA_MESSAGE'
call = 'CALL'
call_me = 'CALL_ME'
call_now = 'CALL_NOW'
chat_with_us = 'CHAT_WITH_US'
confirm = 'CONFIRM'
contact = 'CONTACT'
contact_us = 'CONTACT_US'
Expand All @@ -71,6 +77,7 @@ class CallToActionTypes:
follow_news_storyline = 'FOLLOW_NEWS_STORYLINE'
follow_page = 'FOLLOW_PAGE'
follow_user = 'FOLLOW_USER'
get_a_quote = 'GET_A_QUOTE'
get_directions = 'GET_DIRECTIONS'
get_offer = 'GET_OFFER'
get_offer_view = 'GET_OFFER_VIEW'
Expand All @@ -86,6 +93,7 @@ class CallToActionTypes:
like_page = 'LIKE_PAGE'
listen_music = 'LISTEN_MUSIC'
listen_now = 'LISTEN_NOW'
make_an_appointment = 'MAKE_AN_APPOINTMENT'
message_page = 'MESSAGE_PAGE'
mobile_download = 'MOBILE_DOWNLOAD'
no_button = 'NO_BUTTON'
Expand Down Expand Up @@ -144,6 +152,7 @@ class CallToActionTypes:
'message_extensions': 'list<AdAssetMessageExtensions>',
'onsite_destinations': 'list<AdAssetOnsiteDestinations>',
'optimization_type': 'string',
'promotional_metadata': 'Object',
'reasons_to_shop': 'bool',
'shops_bundle': 'bool',
'titles': 'list<AdAssetFeedSpecTitle>',
Expand Down
7 changes: 7 additions & 0 deletions facebook_business/adobjects/adcreative.py
Expand Up @@ -102,15 +102,20 @@ class Field(AbstractObject.Field):
class CallToActionType:
add_to_cart = 'ADD_TO_CART'
apply_now = 'APPLY_NOW'
ask_about_services = 'ASK_ABOUT_SERVICES'
ask_for_more_info = 'ASK_FOR_MORE_INFO'
audio_call = 'AUDIO_CALL'
book_a_consultation = 'BOOK_A_CONSULTATION'
book_now = 'BOOK_NOW'
book_travel = 'BOOK_TRAVEL'
buy = 'BUY'
buy_now = 'BUY_NOW'
buy_tickets = 'BUY_TICKETS'
buy_via_message = 'BUY_VIA_MESSAGE'
call = 'CALL'
call_me = 'CALL_ME'
call_now = 'CALL_NOW'
chat_with_us = 'CHAT_WITH_US'
confirm = 'CONFIRM'
contact = 'CONTACT'
contact_us = 'CONTACT_US'
Expand All @@ -123,6 +128,7 @@ class CallToActionType:
follow_news_storyline = 'FOLLOW_NEWS_STORYLINE'
follow_page = 'FOLLOW_PAGE'
follow_user = 'FOLLOW_USER'
get_a_quote = 'GET_A_QUOTE'
get_directions = 'GET_DIRECTIONS'
get_offer = 'GET_OFFER'
get_offer_view = 'GET_OFFER_VIEW'
Expand All @@ -138,6 +144,7 @@ class CallToActionType:
like_page = 'LIKE_PAGE'
listen_music = 'LISTEN_MUSIC'
listen_now = 'LISTEN_NOW'
make_an_appointment = 'MAKE_AN_APPOINTMENT'
message_page = 'MESSAGE_PAGE'
mobile_download = 'MOBILE_DOWNLOAD'
no_button = 'NO_BUTTON'
Expand Down

0 comments on commit 063d440

Please sign in to comment.