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

Differential Revision: D50280442

fbshipit-source-id: 8e546cc44e1c2e6bcfbbb82a290f46c289c2be0b
  • Loading branch information
stcheng authored and facebook-github-bot committed Oct 15, 2023
1 parent 7d087b3 commit 9b0bf1d
Show file tree
Hide file tree
Showing 33 changed files with 220 additions and 188 deletions.
1 change: 1 addition & 0 deletions examples/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
config_filename = os.path.join(this_dir, 'config.json')
with open(config_filename) as config_file:
config = json.load(config_file)

api = FacebookAdsApi.init(access_token=config['access_token'])
account_id = config['act_id']

Expand Down
1 change: 1 addition & 0 deletions examples/batch_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

### Setup session and api objects
session = FacebookSession(
config['app_id'],
Expand Down
1 change: 1 addition & 0 deletions examples/batch_pause.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

### Setup session and api objects
session = FacebookSession(
config['app_id'],
Expand Down
1 change: 1 addition & 0 deletions examples/custom_audience_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

auth_info = (
config['app_id'],
config['app_secret'],
Expand Down
1 change: 1 addition & 0 deletions examples/dpa-update/dpa_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.productcatalog import ProductCatalog
from facebook_business.adobjects.productitem import ProductItem
Expand Down
1 change: 1 addition & 0 deletions examples/dpa-update/dpa_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.productcatalog import ProductCatalog
from facebook_business.adobjects.productitem import ProductItem
Expand Down
1 change: 1 addition & 0 deletions examples/read_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

### Setup session and api objects
session = FacebookSession(
config['app_id'],
Expand Down
1 change: 1 addition & 0 deletions examples/simple_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

### Setup session and api objects
session = FacebookSession(
config['app_id'],
Expand Down
1 change: 1 addition & 0 deletions examples/upload_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

with open(config_filename) as config_file:
config = json.load(config_file)

### Setup session and api objects
session = FacebookSession(
config['app_id'],
Expand Down
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.2'
__version__ = '18.0.3'
__all__ = [
'session',
'objects',
Expand Down
104 changes: 0 additions & 104 deletions facebook_business/adobjects/adaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,110 +1189,6 @@ def create_ad(self, fields=None, params=None, batch=None, success=None, failure=
self.assure_call()
return request.execute()

def create_ads_conversion_goal(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
'conversion_event_value_source': 'conversion_event_value_source_enum',
'description': 'string',
'goal_creation_method': 'goal_creation_method_enum',
'goal_name': 'string',
'performance_goal': 'performance_goal_enum',
'single_channel_conversion_events': 'list<map>',
'value_adjustment_rule': 'map',
}
enums = {
'conversion_event_value_source_enum': [
'DATA_SOURCE',
'VALUE_RULE',
],
'goal_creation_method_enum': [
'ADVERTISER_CREATED_UI',
'AUTO_MIGRATION',
'L2_ENHANCE_API_MIGRATION',
],
'performance_goal_enum': [
'AD_OPTIMIZATION_GOAL_AD_RECALL_LIFT',
'AD_OPTIMIZATION_GOAL_APP_DOWNLOADS',
'AD_OPTIMIZATION_GOAL_APP_INSTALLS',
'AD_OPTIMIZATION_GOAL_APP_INSTALLS_AND_OFFSITE_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_BRAND_AWARENESS',
'AD_OPTIMIZATION_GOAL_CLICKS',
'AD_OPTIMIZATION_GOAL_COMPLETED_VIDEO_VIEWS',
'AD_OPTIMIZATION_GOAL_CONVERSATIONS',
'AD_OPTIMIZATION_GOAL_DERIVED_EVENTS',
'AD_OPTIMIZATION_GOAL_DWELLS',
'AD_OPTIMIZATION_GOAL_ENGAGED_REACH',
'AD_OPTIMIZATION_GOAL_ENGAGED_USERS',
'AD_OPTIMIZATION_GOAL_EVENT_RESPONSES',
'AD_OPTIMIZATION_GOAL_EXTERNAL',
'AD_OPTIMIZATION_GOAL_IMPRESSIONS',
'AD_OPTIMIZATION_GOAL_INCREMENTAL_OFFSITE_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_IN_APP_VALUE',
'AD_OPTIMIZATION_GOAL_JOB_APPLICATIONS',
'AD_OPTIMIZATION_GOAL_LANDING_PAGE_VIEWS',
'AD_OPTIMIZATION_GOAL_LEAD_GENERATION',
'AD_OPTIMIZATION_GOAL_MEDIA_DOWNLOADS',
'AD_OPTIMIZATION_GOAL_MESSAGING_APPOINTMENT_CONVERSION',
'AD_OPTIMIZATION_GOAL_MESSAGING_DEEP_CONVERSATION_AND_FOLLOW',
'AD_OPTIMIZATION_GOAL_MESSAGING_DEEP_CONVERSATION_AND_REPLY',
'AD_OPTIMIZATION_GOAL_MESSAGING_PURCHASE_CONVERSION',
'AD_OPTIMIZATION_GOAL_MID_FUNNEL_EVENT',
'AD_OPTIMIZATION_GOAL_MRC_VIDEO_VIEWS',
'AD_OPTIMIZATION_GOAL_MULTI_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_NONE',
'AD_OPTIMIZATION_GOAL_OFFER_CLAIMS',
'AD_OPTIMIZATION_GOAL_OFFLINE_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_OFFSITE_CLICKS',
'AD_OPTIMIZATION_GOAL_OFFSITE_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_ONSITE_CONVERSIONS',
'AD_OPTIMIZATION_GOAL_PAGE_ENGAGEMENT',
'AD_OPTIMIZATION_GOAL_PAGE_FOLLOWS',
'AD_OPTIMIZATION_GOAL_PAGE_LIKES',
'AD_OPTIMIZATION_GOAL_POST_ENGAGEMENT',
'AD_OPTIMIZATION_GOAL_QUALITY_CALL',
'AD_OPTIMIZATION_GOAL_QUALITY_LEAD',
'AD_OPTIMIZATION_GOAL_REACH',
'AD_OPTIMIZATION_GOAL_REMINDERS_SET',
'AD_OPTIMIZATION_GOAL_REPLIES',
'AD_OPTIMIZATION_GOAL_RESEARCH_POLL_RESPONSES',
'AD_OPTIMIZATION_GOAL_RETENTION',
'AD_OPTIMIZATION_GOAL_RETURN_ON_AD_SPEND',
'AD_OPTIMIZATION_GOAL_SOCIAL_IMPRESSIONS',
'AD_OPTIMIZATION_GOAL_STORE_VISITS',
'AD_OPTIMIZATION_GOAL_SUBSCRIBERS',
'AD_OPTIMIZATION_GOAL_TICKET_PURCHASE',
'AD_OPTIMIZATION_GOAL_VALUE',
'AD_OPTIMIZATION_GOAL_VIDEO_LONG_VIEWS',
'AD_OPTIMIZATION_GOAL_VIDEO_VIEWS',
'AD_OPTIMIZATION_GOAL_VIDEO_VIEWS_15S',
'AD_OPTIMIZATION_GOAL_VISIT_INSTAGRAM_PROFILE',
'AD_OPTIMIZATION_GOAL_VISIT_INSTAGRAM_PROFILE_AND_PROFILE_ACTIONS',
],
}
request = FacebookRequest(
node_id=self['id'],
method='POST',
endpoint='/ads_conversion_goal',
api=self._api,
param_checker=TypeChecker(param_types, enums),
target_class=AbstractCrudObject,
api_type='EDGE',
response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api),
)
request.add_params(params)
request.add_fields(fields)

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

def get_ads_reporting_mmm_reports(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
Expand Down
8 changes: 7 additions & 1 deletion facebook_business/adobjects/adaccountadvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class RecommendationType:
aco_toggle = 'ACO_TOGGLE'
ads_reporting = 'ADS_REPORTING'
advanced_campaign_budget = 'ADVANCED_CAMPAIGN_BUDGET'
advantage_custom_audience_upsell = 'ADVANTAGE_CUSTOM_AUDIENCE_UPSELL'
advantage_plus_audience_friction = 'ADVANTAGE_PLUS_AUDIENCE_FRICTION'
advantage_plus_audience_toggle = 'ADVANTAGE_PLUS_AUDIENCE_TOGGLE'
advantage_plus_creative = 'ADVANTAGE_PLUS_CREATIVE'
advantage_plus_creative_catalog = 'ADVANTAGE_PLUS_CREATIVE_CATALOG'
advantage_shopping_campaign = 'ADVANTAGE_SHOPPING_CAMPAIGN'
Expand Down Expand Up @@ -77,21 +80,24 @@ class RecommendationType:
creative_limited_hourly = 'CREATIVE_LIMITED_HOURLY'
creator_ads_pa_conversion = 'CREATOR_ADS_PA_CONVERSION'
cta = 'CTA'
da_advantage_plus_creative_info_labels = 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS'
dead_link = 'DEAD_LINK'
dynamic_advantage_campaign_budget = 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET'
ecosystem_bid_reduce_l1_cardinality = 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY'
fragmentation = 'FRAGMENTATION'
ges_test = 'GES_TEST'
guidance_center_code_gen = 'GUIDANCE_CENTER_CODE_GEN'
learning_limited = 'LEARNING_LIMITED'
learning_pause_friction = 'LEARNING_PAUSE_FRICTION'
low_outcome = 'LOW_OUTCOME'
merlin_guidance = 'MERLIN_GUIDANCE'
mixed_pa_combine_adsets = 'MIXED_PA_COMBINE_ADSETS'
mmt_carousel_to_video = 'MMT_CAROUSEL_TO_VIDEO'
mobile_first_video = 'MOBILE_FIRST_VIDEO'
mr_aemv2sub_kconsolidation = 'MR_AEMV2SUB_KCONSOLIDATION'
multi_text = 'MULTI_TEXT'
music = 'MUSIC'
optimal_spend = 'OPTIMAL_SPEND'
optimal_bau = 'OPTIMAL_BAU'
payment_method = 'PAYMENT_METHOD'
performant_creative_reels_opt_in = 'PERFORMANT_CREATIVE_REELS_OPT_IN'
pfr_l1_inline_mmt = 'PFR_L1_INLINE_MMT'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class EventType:
update_campaign_budget = 'update_campaign_budget'
update_campaign_budget_optimization_toggling_status = 'update_campaign_budget_optimization_toggling_status'
update_campaign_budget_scheduling_state = 'update_campaign_budget_scheduling_state'
update_campaign_conversion_goal = 'update_campaign_conversion_goal'
update_campaign_delivery_type = 'update_campaign_delivery_type'
update_campaign_group_ad_scheduling = 'update_campaign_group_ad_scheduling'
update_campaign_group_budget_scheduling_state = 'update_campaign_group_budget_scheduling_state'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adassetfeedspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CallToActionTypes:
call = 'CALL'
call_me = 'CALL_ME'
call_now = 'CALL_NOW'
confirm = 'CONFIRM'
contact = 'CONTACT'
contact_us = 'CONTACT_US'
donate = 'DONATE'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adcreative.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class CallToActionType:
call = 'CALL'
call_me = 'CALL_ME'
call_now = 'CALL_NOW'
confirm = 'CONFIRM'
contact = 'CONTACT'
contact_us = 'CONTACT_US'
donate = 'DONATE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Type:
call = 'CALL'
call_me = 'CALL_ME'
call_now = 'CALL_NOW'
confirm = 'CONFIRM'
contact = 'CONTACT'
contact_us = 'CONTACT_US'
donate = 'DONATE'
Expand Down
2 changes: 0 additions & 2 deletions facebook_business/adobjects/adpromotedobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Field(AbstractObject.Field):
product_item_id = 'product_item_id'
product_set_id = 'product_set_id'
retention_days = 'retention_days'
whats_app_business_phone_number_id = 'whats_app_business_phone_number_id'

class CustomEventType:
achievement_unlocked = 'ACHIEVEMENT_UNLOCKED'
Expand Down Expand Up @@ -103,7 +102,6 @@ class CustomEventType:
'product_item_id': 'string',
'product_set_id': 'string',
'retention_days': 'string',
'whats_app_business_phone_number_id': 'Object',
}
@classmethod
def _get_field_enum_info(cls):
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adsinsights.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class Breakdowns:
is_conversion_id_modeled = 'is_conversion_id_modeled'
link_url_asset = 'link_url_asset'
marketing_messages_btn_name = 'marketing_messages_btn_name'
mdsa_landing_destination = 'mdsa_landing_destination'
media_asset_url = 'media_asset_url'
media_creator = 'media_creator'
media_destination_url = 'media_destination_url'
Expand Down
31 changes: 31 additions & 0 deletions facebook_business/adobjects/adspixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,37 @@ def get_agencies(self, fields=None, params=None, batch=None, success=None, failu
self.assure_call()
return request.execute()

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

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

def get_assigned_users(self, fields=None, params=None, batch=None, success=None, failure=None, pending=False):
from facebook_business.utils import api_utils
if batch is None and (success is not None or failure is not None):
Expand Down
4 changes: 4 additions & 0 deletions facebook_business/adobjects/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure
if batch is None and (success is not None or failure is not None):
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
'entry_point': 'string',
'name': 'string',
'primary_page': 'string',
'timezone_id': 'unsigned int',
Expand Down Expand Up @@ -2590,6 +2591,8 @@ def create_open_bridge_configuration(self, fields=None, params=None, batch=None,
'access_key': 'string',
'active': 'bool',
'endpoint': 'string',
'fallback_domain': 'string',
'fallback_domain_enabled': 'bool',
'host_business_id': 'unsigned int',
'host_external_id': 'string',
'pixel_id': 'unsigned int',
Expand Down Expand Up @@ -2947,6 +2950,7 @@ def create_owned_page(self, fields=None, params=None, batch=None, success=None,
api_utils.warning('`success` and `failure` callback only work for batch call.')
param_types = {
'code': 'string',
'entry_point': 'string',
'page_id': 'int',
}
enums = {
Expand Down

0 comments on commit 9b0bf1d

Please sign in to comment.