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

fbshipit-source-id: fa4c1e519bea44ace49bd9d87149f30fcd757234
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Nov 2, 2023
1 parent 9b0bf1d commit be38bc6
Show file tree
Hide file tree
Showing 29 changed files with 476 additions and 93 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.3'
__version__ = '18.0.4'
__all__ = [
'session',
'objects',
Expand Down
9 changes: 0 additions & 9 deletions facebook_business/adobjects/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Field(AbstractObject.Field):
id = 'id'
issues_info = 'issues_info'
last_updated_by_app_id = 'last_updated_by_app_id'
meta_reward_adgroup_status = 'meta_reward_adgroup_status'
name = 'name'
preview_shareable_link = 'preview_shareable_link'
priority = 'priority'
Expand Down Expand Up @@ -135,10 +134,6 @@ class ExecutionOptions:
synchronous_ad_review = 'synchronous_ad_review'
validate_only = 'validate_only'

class MetaRewardAdgroupStatus:
active = 'ACTIVE'
inactive = 'INACTIVE'

class Operator:
all = 'ALL'
any = 'ANY'
Expand Down Expand Up @@ -263,15 +258,13 @@ def api_update(self, fields=None, params=None, batch=None, success=None, failure
'engagement_audience': 'bool',
'execution_options': 'list<execution_options_enum>',
'include_demolink_hashes': 'bool',
'meta_reward_adgroup_status': 'meta_reward_adgroup_status_enum',
'name': 'string',
'priority': 'unsigned int',
'status': 'status_enum',
'tracking_specs': 'Object',
}
enums = {
'execution_options_enum': Ad.ExecutionOptions.__dict__.values(),
'meta_reward_adgroup_status_enum': Ad.MetaRewardAdgroupStatus.__dict__.values(),
'status_enum': Ad.Status.__dict__.values(),
}
request = FacebookRequest(
Expand Down Expand Up @@ -725,7 +718,6 @@ def get_targeting_sentence_lines(self, fields=None, params=None, batch=None, suc
'id': 'string',
'issues_info': 'list<AdgroupIssuesInfo>',
'last_updated_by_app_id': 'string',
'meta_reward_adgroup_status': 'string',
'name': 'string',
'preview_shareable_link': 'string',
'priority': 'unsigned int',
Expand Down Expand Up @@ -754,7 +746,6 @@ def _get_field_enum_info(cls):
field_enum_info['Status'] = Ad.Status.__dict__.values()
field_enum_info['DatePreset'] = Ad.DatePreset.__dict__.values()
field_enum_info['ExecutionOptions'] = Ad.ExecutionOptions.__dict__.values()
field_enum_info['MetaRewardAdgroupStatus'] = Ad.MetaRewardAdgroupStatus.__dict__.values()
field_enum_info['Operator'] = Ad.Operator.__dict__.values()
field_enum_info['StatusOption'] = Ad.StatusOption.__dict__.values()
return field_enum_info
Expand Down
3 changes: 1 addition & 2 deletions facebook_business/adobjects/adaccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,6 @@ def create_ad(self, fields=None, params=None, batch=None, success=None, failure=
'engagement_audience': 'bool',
'execution_options': 'list<execution_options_enum>',
'include_demolink_hashes': 'bool',
'meta_reward_adgroup_status': 'meta_reward_adgroup_status_enum',
'name': 'string',
'priority': 'unsigned int',
'source_ad_id': 'string',
Expand All @@ -1163,7 +1162,6 @@ def create_ad(self, fields=None, params=None, batch=None, success=None, failure=
}
enums = {
'execution_options_enum': Ad.ExecutionOptions.__dict__.values(),
'meta_reward_adgroup_status_enum': Ad.MetaRewardAdgroupStatus.__dict__.values(),
'status_enum': Ad.Status.__dict__.values(),
}
request = FacebookRequest(
Expand Down Expand Up @@ -2517,6 +2515,7 @@ def create_custom_audience(self, fields=None, params=None, batch=None, success=N
'subtype': 'subtype_enum',
'use_in_campaigns': 'bool',
'video_group_ids': 'list<string>',
'whats_app_business_phone_number_id': 'string',
}
enums = {
'claim_objective_enum': CustomAudience.ClaimObjective.__dict__.values(),
Expand Down
21 changes: 21 additions & 0 deletions facebook_business/adobjects/adaccountadvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ class Field(AbstractObject.Field):

class RecommendationType:
ab_test = 'AB_TEST'
account_spend_limit = 'ACCOUNT_SPEND_LIMIT'
aco_toggle = 'ACO_TOGGLE'
ads_reporting = 'ADS_REPORTING'
advanced_campaign_budget = 'ADVANCED_CAMPAIGN_BUDGET'
advantage_custom_audience = 'ADVANTAGE_CUSTOM_AUDIENCE'
advantage_custom_audience_upsell = 'ADVANTAGE_CUSTOM_AUDIENCE_UPSELL'
advantage_plus_audience_friction = 'ADVANTAGE_PLUS_AUDIENCE_FRICTION'
advantage_plus_audience_toggle = 'ADVANTAGE_PLUS_AUDIENCE_TOGGLE'
Expand All @@ -54,10 +56,16 @@ class RecommendationType:
aggregated_bid_limited = 'AGGREGATED_BID_LIMITED'
aggregated_budget_limited = 'AGGREGATED_BUDGET_LIMITED'
aggregated_cost_limited = 'AGGREGATED_COST_LIMITED'
app_aem_v2_installation_promotion = 'APP_AEM_V2_INSTALLATION_PROMOTION'
asc_budget_optimization = 'ASC_BUDGET_OPTIMIZATION'
asc_budget_optimization_pfr = 'ASC_BUDGET_OPTIMIZATION_PFR'
aspect_ratio = 'ASPECT_RATIO'
atleast_6_placements = 'ATLEAST_6_PLACEMENTS'
auction_overlap = 'AUCTION_OVERLAP'
auction_overlap_consolidation = 'AUCTION_OVERLAP_CONSOLIDATION'
audience_expansion = 'AUDIENCE_EXPANSION'
audience_expansion_retargeting = 'AUDIENCE_EXPANSION_RETARGETING'
audience_learning_limited = 'AUDIENCE_LEARNING_LIMITED'
autoflow_opt_in = 'AUTOFLOW_OPT_IN'
autoflow_opt_in_fallback_duplication_flow = 'AUTOFLOW_OPT_IN_FALLBACK_DUPLICATION_FLOW'
automatic_placements = 'AUTOMATIC_PLACEMENTS'
Expand All @@ -73,7 +81,9 @@ class RecommendationType:
cost_goal_cpa_limited = 'COST_GOAL_CPA_LIMITED'
cost_per_result = 'COST_PER_RESULT'
creation_package_upgrade_to_asc = 'CREATION_PACKAGE_UPGRADE_TO_ASC'
creation_package_upgrade_to_tla = 'CREATION_PACKAGE_UPGRADE_TO_TLA'
creative_badge = 'CREATIVE_BADGE'
creative_diversity = 'CREATIVE_DIVERSITY'
creative_fatigue = 'CREATIVE_FATIGUE'
creative_fatigue_hourly = 'CREATIVE_FATIGUE_HOURLY'
creative_limited = 'CREATIVE_LIMITED'
Expand All @@ -87,8 +97,11 @@ class RecommendationType:
fragmentation = 'FRAGMENTATION'
ges_test = 'GES_TEST'
guidance_center_code_gen = 'GUIDANCE_CENTER_CODE_GEN'
high_cost = 'HIGH_COST'
historical_benchmark = 'HISTORICAL_BENCHMARK'
learning_limited = 'LEARNING_LIMITED'
learning_pause_friction = 'LEARNING_PAUSE_FRICTION'
learning_phase_budget_edits = 'LEARNING_PHASE_BUDGET_EDITS'
low_outcome = 'LOW_OUTCOME'
merlin_guidance = 'MERLIN_GUIDANCE'
mixed_pa_combine_adsets = 'MIXED_PA_COMBINE_ADSETS'
Expand All @@ -97,13 +110,16 @@ class RecommendationType:
mr_aemv2sub_kconsolidation = 'MR_AEMV2SUB_KCONSOLIDATION'
multi_text = 'MULTI_TEXT'
music = 'MUSIC'
not_applicable = 'NOT_APPLICABLE'
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'
predictive_creative_limited = 'PREDICTIVE_CREATIVE_LIMITED'
predictive_creative_limited_hourly = 'PREDICTIVE_CREATIVE_LIMITED_HOURLY'
rapid_learning_limited = 'RAPID_LEARNING_LIMITED'
rapid_learning_phase = 'RAPID_LEARNING_PHASE'
reels_duplication_upsell = 'REELS_DUPLICATION_UPSELL'
revert = 'REVERT'
scale_good_campaign = 'SCALE_GOOD_CAMPAIGN'
semantic_based_audience_expansion = 'SEMANTIC_BASED_AUDIENCE_EXPANSION'
Expand All @@ -116,10 +132,15 @@ class RecommendationType:
syd_test_mode = 'SYD_TEST_MODE'
top_adsets_with_ads_under_cap = 'TOP_ADSETS_WITH_ADS_UNDER_CAP'
top_campaigns_with_ads_under_cap = 'TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP'
two_p_guidance_card_aaa = 'TWO_P_GUIDANCE_CARD_AAA'
two_p_guidance_card_auto_placement = 'TWO_P_GUIDANCE_CARD_AUTO_PLACEMENT'
two_p_guidance_card_cbo_off = 'TWO_P_GUIDANCE_CARD_CBO_OFF'
two_p_guidance_card_ctm_preflight = 'TWO_P_GUIDANCE_CARD_CTM_PREFLIGHT'
uncrop_image = 'UNCROP_IMAGE'
uneconomical_ads_throttling = 'UNECONOMICAL_ADS_THROTTLING'
unused_budget = 'UNUSED_BUDGET'
video_length = 'VIDEO_LENGTH'
zero_conversion = 'ZERO_CONVERSION'
zero_impression = 'ZERO_IMPRESSION'

_field_types = {
Expand Down
7 changes: 6 additions & 1 deletion facebook_business/adobjects/adassetfeedspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class Field(AbstractObject.Field):
images = 'images'
link_urls = 'link_urls'
message_extensions = 'message_extensions'
onsite_destinations = 'onsite_destinations'
optimization_type = 'optimization_type'
reasons_to_shop = 'reasons_to_shop'
shops_bundle = 'shops_bundle'
titles = 'titles'
videos = 'videos'

Expand Down Expand Up @@ -84,7 +87,6 @@ class CallToActionTypes:
listen_now = 'LISTEN_NOW'
message_page = 'MESSAGE_PAGE'
mobile_download = 'MOBILE_DOWNLOAD'
moments = 'MOMENTS'
no_button = 'NO_BUTTON'
open_instant_app = 'OPEN_INSTANT_APP'
open_link = 'OPEN_LINK'
Expand Down Expand Up @@ -139,7 +141,10 @@ class CallToActionTypes:
'images': 'list<AdAssetFeedSpecImage>',
'link_urls': 'list<AdAssetFeedSpecLinkURL>',
'message_extensions': 'list<AdAssetMessageExtensions>',
'onsite_destinations': 'list<Object>',
'optimization_type': 'string',
'reasons_to_shop': 'bool',
'shops_bundle': 'bool',
'titles': 'list<AdAssetFeedSpecTitle>',
'videos': 'list<AdAssetFeedSpecVideo>',
}
Expand Down
3 changes: 2 additions & 1 deletion facebook_business/adobjects/adcreative.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Field(AbstractObject.Field):
object_type = 'object_type'
object_url = 'object_url'
omnichannel_link_spec = 'omnichannel_link_spec'
photo_album_source_object_story_id = 'photo_album_source_object_story_id'
place_page_set_id = 'place_page_set_id'
platform_customizations = 'platform_customizations'
playable_asset_id = 'playable_asset_id'
Expand Down Expand Up @@ -138,7 +139,6 @@ class CallToActionType:
listen_now = 'LISTEN_NOW'
message_page = 'MESSAGE_PAGE'
mobile_download = 'MOBILE_DOWNLOAD'
moments = 'MOMENTS'
no_button = 'NO_BUTTON'
open_instant_app = 'OPEN_INSTANT_APP'
open_link = 'OPEN_LINK'
Expand Down Expand Up @@ -498,6 +498,7 @@ def get_previews(self, fields=None, params=None, batch=None, success=None, failu
'object_type': 'ObjectType',
'object_url': 'string',
'omnichannel_link_spec': 'AdCreativeOmnichannelLinkSpec',
'photo_album_source_object_story_id': 'string',
'place_page_set_id': 'string',
'platform_customizations': 'AdCreativePlatformCustomization',
'playable_asset_id': 'string',
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/adcreativebrandedcontentads.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ class Field(AbstractObject.Field):
ad_format = 'ad_format'
creator_ad_permission_type = 'creator_ad_permission_type'
instagram_boost_post_access_token = 'instagram_boost_post_access_token'
is_mca_internal = 'is_mca_internal'
partners = 'partners'
ui_version = 'ui_version'

_field_types = {
'ad_format': 'int',
'creator_ad_permission_type': 'string',
'instagram_boost_post_access_token': 'string',
'is_mca_internal': 'bool',
'partners': 'list<Object>',
'ui_version': 'int',
}
Expand Down
2 changes: 2 additions & 0 deletions facebook_business/adobjects/adcreativelinkdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Field(AbstractObject.Field):
additional_image_index = 'additional_image_index'
app_link_spec = 'app_link_spec'
attachment_style = 'attachment_style'
automated_product_tags = 'automated_product_tags'
branded_content_shared_to_sponsor_status = 'branded_content_shared_to_sponsor_status'
branded_content_sponsor_page_id = 'branded_content_sponsor_page_id'
call_to_action = 'call_to_action'
Expand Down Expand Up @@ -70,6 +71,7 @@ class FormatOption:
'additional_image_index': 'int',
'app_link_spec': 'AdCreativeLinkDataAppLinkSpec',
'attachment_style': 'string',
'automated_product_tags': 'bool',
'branded_content_shared_to_sponsor_status': 'string',
'branded_content_sponsor_page_id': 'string',
'call_to_action': 'AdCreativeLinkDataCallToAction',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class Type:
listen_now = 'LISTEN_NOW'
message_page = 'MESSAGE_PAGE'
mobile_download = 'MOBILE_DOWNLOAD'
moments = 'MOMENTS'
no_button = 'NO_BUTTON'
open_instant_app = 'OPEN_INSTANT_APP'
open_link = 'OPEN_LINK'
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/adpromotedobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class CustomEventType:
add_payment_info = 'ADD_PAYMENT_INFO'
add_to_cart = 'ADD_TO_CART'
add_to_wishlist = 'ADD_TO_WISHLIST'
ad_impression = 'AD_IMPRESSION'
complete_registration = 'COMPLETE_REGISTRATION'
contact = 'CONTACT'
content_view = 'CONTENT_VIEW'
Expand Down
36 changes: 36 additions & 0 deletions facebook_business/adobjects/adset.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,42 @@ def get_async_ad_requests(self, fields=None, params=None, batch=None, success=No
self.assure_call()
return request.execute()

def create_budget_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):
api_utils.warning('`success` and `failure` callback only work for batch call.')
from facebook_business.adobjects.highdemandperiod import HighDemandPeriod
param_types = {
'budget_value': 'unsigned int',
'budget_value_type': 'budget_value_type_enum',
'time_end': 'unsigned int',
'time_start': 'unsigned int',
}
enums = {
'budget_value_type_enum': HighDemandPeriod.BudgetValueType.__dict__.values(),
}
request = FacebookRequest(
node_id=self['id'],
method='POST',
endpoint='/budget_schedules',
api=self._api,
param_checker=TypeChecker(param_types, enums),
target_class=HighDemandPeriod,
api_type='EDGE',
response_parser=ObjectParser(target_class=HighDemandPeriod, 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_copies(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/adsinsights.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Field(AbstractObject.Field):
catalog_segment_value_omni_purchase_roas = 'catalog_segment_value_omni_purchase_roas'
catalog_segment_value_website_purchase_roas = 'catalog_segment_value_website_purchase_roas'
clicks = 'clicks'
conversion_lead_rate = 'conversion_lead_rate'
conversion_rate_ranking = 'conversion_rate_ranking'
conversion_values = 'conversion_values'
conversions = 'conversions'
Expand All @@ -65,6 +66,7 @@ class Field(AbstractObject.Field):
cost_per_action_type = 'cost_per_action_type'
cost_per_ad_click = 'cost_per_ad_click'
cost_per_conversion = 'cost_per_conversion'
cost_per_conversion_lead = 'cost_per_conversion_lead'
cost_per_dda_countby_convs = 'cost_per_dda_countby_convs'
cost_per_estimated_ad_recallers = 'cost_per_estimated_ad_recallers'
cost_per_inline_link_click = 'cost_per_inline_link_click'
Expand Down Expand Up @@ -310,6 +312,7 @@ def get_endpoint(cls):
'catalog_segment_value_omni_purchase_roas': 'list<AdsActionStats>',
'catalog_segment_value_website_purchase_roas': 'list<AdsActionStats>',
'clicks': 'string',
'conversion_lead_rate': 'string',
'conversion_rate_ranking': 'string',
'conversion_values': 'list<AdsActionStats>',
'conversions': 'list<AdsActionStats>',
Expand All @@ -320,6 +323,7 @@ def get_endpoint(cls):
'cost_per_action_type': 'list<AdsActionStats>',
'cost_per_ad_click': 'list<AdsActionStats>',
'cost_per_conversion': 'list<AdsActionStats>',
'cost_per_conversion_lead': 'string',
'cost_per_dda_countby_convs': 'string',
'cost_per_estimated_ad_recallers': 'string',
'cost_per_inline_link_click': 'string',
Expand Down
4 changes: 4 additions & 0 deletions facebook_business/adobjects/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class Field(AbstractObject.Field):
restrictions = 'restrictions'
restrictive_data_filter_params = 'restrictive_data_filter_params'
restrictive_data_filter_rules = 'restrictive_data_filter_rules'
sdk_auto_logging_default_value = 'sdk_auto_logging_default_value'
sdk_auto_logging_override_value = 'sdk_auto_logging_override_value'
sdk_update_message = 'sdk_update_message'
seamless_login = 'seamless_login'
secure_canvas_url = 'secure_canvas_url'
Expand Down Expand Up @@ -2304,6 +2306,8 @@ def create_upload(self, fields=None, params=None, batch=None, success=None, fail
'restrictions': 'Object',
'restrictive_data_filter_params': 'string',
'restrictive_data_filter_rules': 'string',
'sdk_auto_logging_default_value': 'bool',
'sdk_auto_logging_override_value': 'bool',
'sdk_update_message': 'string',
'seamless_login': 'int',
'secure_canvas_url': 'string',
Expand Down
1 change: 1 addition & 0 deletions facebook_business/adobjects/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,7 @@ def create_managed_partner_business(self, fields=None, params=None, batch=None,
'sales_rep_email': 'string',
'seller_external_website_url': 'string',
'seller_targeting_countries': 'list<string>',
'skip_partner_page_creation': 'bool',
'survey_business_type': 'survey_business_type_enum',
'survey_num_assets': 'unsigned int',
'survey_num_people': 'unsigned int',
Expand Down
Loading

0 comments on commit be38bc6

Please sign in to comment.