Skip to content

Commit 063d440

Browse files
generatedunixname89002005295453facebook-github-bot
generatedunixname89002005295453
authored andcommitted
Auto-generated python SDK code update
Summary: ignore-conflict-markers Reviewed By: stcheng Differential Revision: D56033281 fbshipit-source-id: 9d9b948a023d9240558521b975ad6bea44caef14
1 parent ff8c1c6 commit 063d440

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+440
-266
lines changed

examples/AdAccountAdSetsPostAdSetCreateCpa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
'name': 'A CPA Ad Set',
3636
'campaign_id': '<adCampaignLinkClicksID>',
3737
'daily_budget': '5000',
38-
'start_time': '2024-03-20T14:31:58-0700',
39-
'end_time': '2024-03-27T14:31:58-0700',
38+
'start_time': '2024-04-08T11:26:05-0700',
39+
'end_time': '2024-04-15T11:26:05-0700',
4040
'billing_event': 'IMPRESSIONS',
4141
'optimization_goal': 'REACH',
4242
'bid_amount': '1000',

examples/AdAccountAdSetsPostAdSetCreateCpaAppEvents.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
'name': 'A CPA Ad Set optimized for App Events',
3636
'campaign_id': '<adCampaignAppInstallsID>',
3737
'daily_budget': '300',
38-
'start_time': '2024-03-20T14:32:42-0700',
39-
'end_time': '2024-03-27T14:32:42-0700',
38+
'start_time': '2024-04-08T11:26:49-0700',
39+
'end_time': '2024-04-15T11:26:49-0700',
4040
'billing_event': 'IMPRESSIONS',
4141
'optimization_goal': 'OFFSITE_CONVERSIONS',
4242
'bid_amount': '100',

examples/AdAccountAdSetsPostCreateAdSet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
params = {
3535
'name': 'My First AdSet',
3636
'lifetime_budget': '20000',
37-
'start_time': '2024-03-20T14:31:13-0700',
38-
'end_time': '2024-03-27T14:31:13-0700',
37+
'start_time': '2024-04-08T11:25:19-0700',
38+
'end_time': '2024-04-15T11:25:19-0700',
3939
'campaign_id': '<adCampaignLinkClicksID>',
4040
'bid_amount': '500',
4141
'billing_event': 'IMPRESSIONS',

examples/AdAccountAdSetsPostDailyBudget20.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
params = {
3535
'name': 'My First Adset',
3636
'daily_budget': '2000',
37-
'start_time': '2024-03-13T14:32:15-0700',
38-
'end_time': '2024-03-20T14:32:15-0700',
37+
'start_time': '2024-04-01T11:26:23-0700',
38+
'end_time': '2024-04-08T11:26:23-0700',
3939
'campaign_id': '<adCampaignLinkClicksID>',
4040
'bid_amount': '100',
4141
'billing_event': 'LINK_CLICKS',

examples/AdAccountAdSetsPostLifetimeBudget200Duration10Days.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
params = {
3535
'name': 'My First Adset',
3636
'lifetime_budget': '20000',
37-
'start_time': '2024-03-13T14:32:24-0700',
38-
'end_time': '2024-03-23T14:32:24-0700',
37+
'start_time': '2024-04-01T11:26:32-0700',
38+
'end_time': '2024-04-11T11:26:32-0700',
3939
'campaign_id': '<adCampaignLinkClicksID>',
4040
'bid_amount': '100',
4141
'billing_event': 'LINK_CLICKS',

examples/AdAccountAdSetsPostOptimizePostEngagement.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
params = {
3535
'name': 'My First Adset',
3636
'lifetime_budget': '20000',
37-
'start_time': '2024-03-13T14:32:33-0700',
38-
'end_time': '2024-03-23T14:32:33-0700',
37+
'start_time': '2024-04-01T11:26:40-0700',
38+
'end_time': '2024-04-11T11:26:40-0700',
3939
'campaign_id': '<adCampaignLinkClicksID>',
4040
'bid_amount': '500',
4141
'billing_event': 'IMPRESSIONS',

examples/AdgroupLeadsEdgeAdgroupLeadsFiltered.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
fields = [
3333
]
3434
params = {
35-
'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1681144509}],
35+
'filtering': [{'field':'time_created','operator':'GREATER_THAN','value':1711391704}],
3636
}
3737
print Ad(id).get_leads(
3838
fields=fields,

examples/AdsPixelEventsPost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
fields = [
3232
]
3333
params = {
34-
'data': [{'event_name':'PageView','event_time':1681748568,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
34+
'data': [{'event_name':'PageView','event_time':1711995835,'user_data':{'fbc':'fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890','fbp':'fb.1.1558571054389.1098115397','em':'309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd'}}],
3535
}
3636
print AdsPixel(id).create_event(
3737
fields=fields,

facebook_business/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from facebook_business.session import FacebookSession
88
from facebook_business.api import FacebookAdsApi
99

10-
__version__ = '19.0.2'
10+
__version__ = '19.0.3'
1111
__all__ = [
1212
'session',
1313
'objects',

facebook_business/adobjects/adaccount.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Field(AbstractObject.Field):
4040
amount_spent = 'amount_spent'
4141
attribution_spec = 'attribution_spec'
4242
balance = 'balance'
43+
brand_safety_content_filter_levels = 'brand_safety_content_filter_levels'
4344
business = 'business'
4445
business_city = 'business_city'
4546
business_country_code = 'business_country_code'
@@ -187,6 +188,7 @@ class ContentType:
187188
automotive_model = 'AUTOMOTIVE_MODEL'
188189
destination = 'DESTINATION'
189190
flight = 'FLIGHT'
191+
generic = 'GENERIC'
190192
home_listing = 'HOME_LISTING'
191193
hotel = 'HOTEL'
192194
job = 'JOB'
@@ -205,6 +207,7 @@ class Subtype:
205207
claim = 'CLAIM'
206208
custom = 'CUSTOM'
207209
engagement = 'ENGAGEMENT'
210+
exclusion = 'EXCLUSION'
208211
fox = 'FOX'
209212
lookalike = 'LOOKALIKE'
210213
managed = 'MANAGED'
@@ -2154,6 +2157,36 @@ def create_async_ad_request_set(self, fields=None, params=None, batch=None, succ
21542157
self.assure_call()
21552158
return request.execute()
21562159

2160+
def get_audience_funnel(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
2161+
from facebook_business.utils import api_utils
2162+
if batch is None and (success is not None or failure is not None):
2163+
api_utils.warning('`success` and `failure` callback only work for batch call.')
2164+
param_types = {
2165+
}
2166+
enums = {
2167+
}
2168+
request = FacebookRequest(
2169+
node_id=self['id'],
2170+
method='GET',
2171+
endpoint='/audience_funnel',
2172+
api=self._api,
2173+
param_checker=TypeChecker(param_types, enums),
2174+
target_class=AbstractCrudObject,
2175+
api_type='EDGE',
2176+
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
2177+
)
2178+
request.add_params(params)
2179+
request.add_fields(fields)
2180+
2181+
if batch is not None:
2182+
request.add_to_batch(batch, success=success, failure=failure)
2183+
return request
2184+
elif pending:
2185+
return request
2186+
else:
2187+
self.assure_call()
2188+
return request.execute()
2189+
21572190
def create_block_list_draft(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
21582191
from facebook_business.utils import api_utils
21592192
if batch is None and (success is not None or failure is not None):
@@ -2510,6 +2543,36 @@ def get_conversion_goals(self, fields=None, params=None, batch=None, success=Non
25102543
self.assure_call()
25112544
return request.execute()
25122545

2546+
def get_cpa_guidance(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
2547+
from facebook_business.utils import api_utils
2548+
if batch is None and (success is not None or failure is not None):
2549+
api_utils.warning('`success` and `failure` callback only work for batch call.')
2550+
param_types = {
2551+
}
2552+
enums = {
2553+
}
2554+
request = FacebookRequest(
2555+
node_id=self['id'],
2556+
method='GET',
2557+
endpoint='/cpa_guidance',
2558+
api=self._api,
2559+
param_checker=TypeChecker(param_types, enums),
2560+
target_class=AbstractCrudObject,
2561+
api_type='EDGE',
2562+
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
2563+
)
2564+
request.add_params(params)
2565+
request.add_fields(fields)
2566+
2567+
if batch is not None:
2568+
request.add_to_batch(batch, success=success, failure=failure)
2569+
return request
2570+
elif pending:
2571+
return request
2572+
else:
2573+
self.assure_call()
2574+
return request.execute()
2575+
25132576
def get_custom_audiences(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
25142577
from facebook_business.utils import api_utils
25152578
if batch is None and (success is not None or failure is not None):
@@ -3818,6 +3881,8 @@ def get_targeting_search(self, fields=None, params=None, batch=None, success=Non
38183881
'allow_only_fat_head_interests': 'bool',
38193882
'app_store': 'app_store_enum',
38203883
'countries': 'list<string>',
3884+
'is_account_level_brand_safety_exclusion': 'bool',
3885+
'is_account_level_employer_exclusion': 'bool',
38213886
'is_exclusion': 'bool',
38223887
'limit_type': 'limit_type_enum',
38233888
'objective': 'objective_enum',
@@ -4104,6 +4169,36 @@ def delete_users_of_any_audience(self, fields=None, params=None, batch=None, suc
41044169
self.assure_call()
41054170
return request.execute()
41064171

4172+
def get_value_adjustment_rule_collections(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
4173+
from facebook_business.utils import api_utils
4174+
if batch is None and (success is not None or failure is not None):
4175+
api_utils.warning('`success` and `failure` callback only work for batch call.')
4176+
param_types = {
4177+
}
4178+
enums = {
4179+
}
4180+
request = FacebookRequest(
4181+
node_id=self['id'],
4182+
method='GET',
4183+
endpoint='/value_adjustment_rule_collections',
4184+
api=self._api,
4185+
param_checker=TypeChecker(param_types, enums),
4186+
target_class=AbstractCrudObject,
4187+
api_type='EDGE',
4188+
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
4189+
)
4190+
request.add_params(params)
4191+
request.add_fields(fields)
4192+
4193+
if batch is not None:
4194+
request.add_to_batch(batch, success=success, failure=failure)
4195+
return request
4196+
elif pending:
4197+
return request
4198+
else:
4199+
self.assure_call()
4200+
return request.execute()
4201+
41074202
def get_value_adjustment_rules(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
41084203
from facebook_business.utils import api_utils
41094204
if batch is None and (success is not None or failure is not None):
@@ -4144,6 +4239,7 @@ def get_value_adjustment_rules(self, fields=None, params=None, batch=None, succe
41444239
'amount_spent': 'string',
41454240
'attribution_spec': 'list<AttributionSpec>',
41464241
'balance': 'string',
4242+
'brand_safety_content_filter_levels': 'list<string>',
41474243
'business': 'Business',
41484244
'business_city': 'string',
41494245
'business_country_code': 'string',

facebook_business/adobjects/adaccountadvolume.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class RecommendationType:
6565
asc_budget_optimization = 'ASC_BUDGET_OPTIMIZATION'
6666
asc_budget_optimization_pfr = 'ASC_BUDGET_OPTIMIZATION_PFR'
6767
asc_creation_package = 'ASC_CREATION_PACKAGE'
68+
asc_fragmentation_v2 = 'ASC_FRAGMENTATION_V2'
6869
aspect_ratio = 'ASPECT_RATIO'
6970
atleast_6_placements = 'ATLEAST_6_PLACEMENTS'
7071
auction_overlap = 'AUCTION_OVERLAP'
@@ -82,6 +83,7 @@ class RecommendationType:
8283
capi_performance_match_key = 'CAPI_PERFORMANCE_MATCH_KEY'
8384
capi_performance_match_key_v2 = 'CAPI_PERFORMANCE_MATCH_KEY_V2'
8485
cash_rewards_opt_in = 'CASH_REWARDS_OPT_IN'
86+
connected_sources = 'CONNECTED_SOURCES'
8587
connect_facebook_page_to_instagram = 'CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM'
8688
connect_facebook_page_to_whatsapp = 'CONNECT_FACEBOOK_PAGE_TO_WHATSAPP'
8789
conversion_lead_ads = 'CONVERSION_LEAD_ADS'
@@ -101,8 +103,10 @@ class RecommendationType:
101103
creator_ads_pa_conversion = 'CREATOR_ADS_PA_CONVERSION'
102104
cta = 'CTA'
103105
ctx_budget_optimization = 'CTX_BUDGET_OPTIMIZATION'
106+
ctx_creation_package = 'CTX_CREATION_PACKAGE'
104107
ctx_guidance = 'CTX_GUIDANCE'
105108
da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS'
109+
da_duplication_product_tags = 'DA_DUPLICATION_PRODUCT_TAGS'
106110
dead_link = 'DEAD_LINK'
107111
dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET'
108112
ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY'
@@ -133,6 +137,7 @@ class RecommendationType:
133137
pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT'
134138
predictive_creative_limited = 'PREDICTIVE_CREATIVE_LIMITED'
135139
predictive_creative_limited_hourly = 'PREDICTIVE_CREATIVE_LIMITED_HOURLY'
140+
preparing_status = 'PREPARING_STATUS'
136141
rapid_learning_limited = 'RAPID_LEARNING_LIMITED'
137142
rapid_learning_phase = 'RAPID_LEARNING_PHASE'
138143
reels_duplication_upsell = 'REELS_DUPLICATION_UPSELL'

facebook_business/adobjects/adaccounttargetingunified.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ class WhitelistedTypes:
430430
location_categories = 'location_categories'
431431
location_cluster_ids = 'location_cluster_ids'
432432
location_expansion = 'location_expansion'
433+
marketing_message_channels = 'marketing_message_channels'
433434
marketing_message_targeting = 'marketing_message_targeting'
434435
marketplace_product_categories = 'marketplace_product_categories'
435436
messenger_positions = 'messenger_positions'

facebook_business/adobjects/adactivity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class EventType:
119119
update_campaign_name = 'update_campaign_name'
120120
update_campaign_run_status = 'update_campaign_run_status'
121121
update_campaign_schedule = 'update_campaign_schedule'
122+
update_campaign_value_adjustment_rule = 'update_campaign_value_adjustment_rule'
122123
update_delivery_type_cross_level_shift = 'update_delivery_type_cross_level_shift'
123124

124125
class Category:

facebook_business/adobjects/adassetfeedspec.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Field(AbstractObject.Field):
4242
message_extensions = 'message_extensions'
4343
onsite_destinations = 'onsite_destinations'
4444
optimization_type = 'optimization_type'
45+
promotional_metadata = 'promotional_metadata'
4546
reasons_to_shop = 'reasons_to_shop'
4647
shops_bundle = 'shops_bundle'
4748
titles = 'titles'
@@ -50,15 +51,20 @@ class Field(AbstractObject.Field):
5051
class CallToActionTypes:
5152
add_to_cart = 'ADD_TO_CART'
5253
apply_now = 'APPLY_NOW'
54+
ask_about_services = 'ASK_ABOUT_SERVICES'
55+
ask_for_more_info = 'ASK_FOR_MORE_INFO'
5356
audio_call = 'AUDIO_CALL'
57+
book_a_consultation = 'BOOK_A_CONSULTATION'
5458
book_now = 'BOOK_NOW'
5559
book_travel = 'BOOK_TRAVEL'
5660
buy = 'BUY'
5761
buy_now = 'BUY_NOW'
5862
buy_tickets = 'BUY_TICKETS'
63+
buy_via_message = 'BUY_VIA_MESSAGE'
5964
call = 'CALL'
6065
call_me = 'CALL_ME'
6166
call_now = 'CALL_NOW'
67+
chat_with_us = 'CHAT_WITH_US'
6268
confirm = 'CONFIRM'
6369
contact = 'CONTACT'
6470
contact_us = 'CONTACT_US'
@@ -71,6 +77,7 @@ class CallToActionTypes:
7177
follow_news_storyline = 'FOLLOW_NEWS_STORYLINE'
7278
follow_page = 'FOLLOW_PAGE'
7379
follow_user = 'FOLLOW_USER'
80+
get_a_quote = 'GET_A_QUOTE'
7481
get_directions = 'GET_DIRECTIONS'
7582
get_offer = 'GET_OFFER'
7683
get_offer_view = 'GET_OFFER_VIEW'
@@ -86,6 +93,7 @@ class CallToActionTypes:
8693
like_page = 'LIKE_PAGE'
8794
listen_music = 'LISTEN_MUSIC'
8895
listen_now = 'LISTEN_NOW'
96+
make_an_appointment = 'MAKE_AN_APPOINTMENT'
8997
message_page = 'MESSAGE_PAGE'
9098
mobile_download = 'MOBILE_DOWNLOAD'
9199
no_button = 'NO_BUTTON'
@@ -144,6 +152,7 @@ class CallToActionTypes:
144152
'message_extensions': 'list<AdAssetMessageExtensions>',
145153
'onsite_destinations': 'list<AdAssetOnsiteDestinations>',
146154
'optimization_type': 'string',
155+
'promotional_metadata': 'Object',
147156
'reasons_to_shop': 'bool',
148157
'shops_bundle': 'bool',
149158
'titles': 'list<AdAssetFeedSpecTitle>',

facebook_business/adobjects/adcreative.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,20 @@ class Field(AbstractObject.Field):
102102
class CallToActionType:
103103
add_to_cart = 'ADD_TO_CART'
104104
apply_now = 'APPLY_NOW'
105+
ask_about_services = 'ASK_ABOUT_SERVICES'
106+
ask_for_more_info = 'ASK_FOR_MORE_INFO'
105107
audio_call = 'AUDIO_CALL'
108+
book_a_consultation = 'BOOK_A_CONSULTATION'
106109
book_now = 'BOOK_NOW'
107110
book_travel = 'BOOK_TRAVEL'
108111
buy = 'BUY'
109112
buy_now = 'BUY_NOW'
110113
buy_tickets = 'BUY_TICKETS'
114+
buy_via_message = 'BUY_VIA_MESSAGE'
111115
call = 'CALL'
112116
call_me = 'CALL_ME'
113117
call_now = 'CALL_NOW'
118+
chat_with_us = 'CHAT_WITH_US'
114119
confirm = 'CONFIRM'
115120
contact = 'CONTACT'
116121
contact_us = 'CONTACT_US'
@@ -123,6 +128,7 @@ class CallToActionType:
123128
follow_news_storyline = 'FOLLOW_NEWS_STORYLINE'
124129
follow_page = 'FOLLOW_PAGE'
125130
follow_user = 'FOLLOW_USER'
131+
get_a_quote = 'GET_A_QUOTE'
126132
get_directions = 'GET_DIRECTIONS'
127133
get_offer = 'GET_OFFER'
128134
get_offer_view = 'GET_OFFER_VIEW'
@@ -138,6 +144,7 @@ class CallToActionType:
138144
like_page = 'LIKE_PAGE'
139145
listen_music = 'LISTEN_MUSIC'
140146
listen_now = 'LISTEN_NOW'
147+
make_an_appointment = 'MAKE_AN_APPOINTMENT'
141148
message_page = 'MESSAGE_PAGE'
142149
mobile_download = 'MOBILE_DOWNLOAD'
143150
no_button = 'NO_BUTTON'

0 commit comments

Comments
 (0)