From 2665b711e8ac51e5d18303f9b8ae7fc1a4f1d15d Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Wed, 8 Nov 2017 02:36:24 -0800 Subject: [PATCH] Ads SDK v2.11 Release --- facebookads/__init__.py | 2 +- facebookads/adobjects/ad.py | 1 + facebookads/adobjects/adaccount.py | 121 ++++++- .../adobjects/adaccountadruleshistory.py | 66 ++++ .../adobjects/adaccountdeliveryestimate.py | 1 + .../adobjects/adaccounttargetingunified.py | 5 + facebookads/adobjects/adactivity.py | 1 + facebookads/adobjects/adassetfeedspec.py | 114 ++++++ .../adobjects/adassetfeedspecassetlabel.py | 55 +++ facebookads/adobjects/adassetfeedspecbody.py | 54 +++ .../adobjects/adassetfeedspeccaption.py | 54 +++ .../adobjects/adassetfeedspecdescription.py | 54 +++ .../adobjects/adassetfeedspecgrouprule.py | 62 ++++ facebookads/adobjects/adassetfeedspecimage.py | 58 ++++ .../adobjects/adassetfeedspeclinkurl.py | 58 ++++ .../adobjects/adassetfeedspectargetrule.py | 66 ++++ facebookads/adobjects/adassetfeedspectitle.py | 54 +++ facebookads/adobjects/adassetfeedspecvideo.py | 58 ++++ .../adobjects/adcampaigndeliveryestimate.py | 1 + facebookads/adobjects/adcreative.py | 11 + .../adcreativecollectionthumbnailinfo.py | 54 +++ facebookads/adobjects/adcreativelinkdata.py | 16 + .../adcreativelinkdatacalltoaction.py | 4 + .../adcreativelinkdataimageoverlayspec.py | 113 ++++++ facebookads/adobjects/adcreativephotodata.py | 2 + facebookads/adobjects/adcreativeplacedata.py | 2 + .../adcreativepostclickconfiguration.py | 52 +++ facebookads/adobjects/adcreativevideodata.py | 6 + facebookads/adobjects/adrule.py | 206 +++++++++++ facebookads/adobjects/adruleevaluationspec.py | 59 ++++ .../adobjects/adruleexecutionoptions.py | 59 ++++ facebookads/adobjects/adruleexecutionspec.py | 63 ++++ facebookads/adobjects/adrulefilters.py | 70 ++++ facebookads/adobjects/adrulehistory.py | 78 +++++ facebookads/adobjects/adrulehistoryresult.py | 60 ++++ .../adobjects/adrulehistoryresultaction.py | 56 +++ facebookads/adobjects/adruleschedule.py | 54 +++ facebookads/adobjects/adruleschedulespec.py | 52 +++ facebookads/adobjects/adruletrigger.py | 79 +++++ facebookads/adobjects/adsactionstats.py | 2 + facebookads/adobjects/adset.py | 30 +- facebookads/adobjects/adsinsights.py | 4 +- facebookads/adobjects/business.py | 320 ++--------------- facebookads/adobjects/campaign.py | 6 + .../adobjects/conversionactionquery.py | 2 - facebookads/adobjects/customaudience.py | 5 + .../adobjects/customaudiencedatasource.py | 8 + facebookads/adobjects/customconversion.py | 4 +- facebookads/adobjects/event.py | 4 + facebookads/adobjects/leadgenform.py | 8 +- facebookads/adobjects/leadgenquestion.py | 42 ++- .../adobjects/offlineconversiondataset.py | 326 ++++++++++++++++++ facebookads/adobjects/productcatalog.py | 84 ++++- facebookads/adobjects/productfeed.py | 3 + facebookads/adobjects/productfeedupload.py | 2 + facebookads/adobjects/productgroup.py | 28 -- facebookads/adobjects/productset.py | 28 -- facebookads/adobjects/reachestimate.py | 1 + .../adobjects/reachfrequencyprediction.py | 2 +- facebookads/adobjects/targeting.py | 4 +- facebookads/apiconfig.py | 4 +- setup.py | 2 +- 62 files changed, 2502 insertions(+), 398 deletions(-) create mode 100644 facebookads/adobjects/adaccountadruleshistory.py create mode 100644 facebookads/adobjects/adassetfeedspec.py create mode 100644 facebookads/adobjects/adassetfeedspecassetlabel.py create mode 100644 facebookads/adobjects/adassetfeedspecbody.py create mode 100644 facebookads/adobjects/adassetfeedspeccaption.py create mode 100644 facebookads/adobjects/adassetfeedspecdescription.py create mode 100644 facebookads/adobjects/adassetfeedspecgrouprule.py create mode 100644 facebookads/adobjects/adassetfeedspecimage.py create mode 100644 facebookads/adobjects/adassetfeedspeclinkurl.py create mode 100644 facebookads/adobjects/adassetfeedspectargetrule.py create mode 100644 facebookads/adobjects/adassetfeedspectitle.py create mode 100644 facebookads/adobjects/adassetfeedspecvideo.py create mode 100644 facebookads/adobjects/adcreativecollectionthumbnailinfo.py create mode 100644 facebookads/adobjects/adcreativelinkdataimageoverlayspec.py create mode 100644 facebookads/adobjects/adcreativepostclickconfiguration.py create mode 100644 facebookads/adobjects/adrule.py create mode 100644 facebookads/adobjects/adruleevaluationspec.py create mode 100644 facebookads/adobjects/adruleexecutionoptions.py create mode 100644 facebookads/adobjects/adruleexecutionspec.py create mode 100644 facebookads/adobjects/adrulefilters.py create mode 100644 facebookads/adobjects/adrulehistory.py create mode 100644 facebookads/adobjects/adrulehistoryresult.py create mode 100644 facebookads/adobjects/adrulehistoryresultaction.py create mode 100644 facebookads/adobjects/adruleschedule.py create mode 100644 facebookads/adobjects/adruleschedulespec.py create mode 100644 facebookads/adobjects/adruletrigger.py create mode 100644 facebookads/adobjects/offlineconversiondataset.py diff --git a/facebookads/__init__.py b/facebookads/__init__.py index 079e2656..ce08d312 100644 --- a/facebookads/__init__.py +++ b/facebookads/__init__.py @@ -21,7 +21,7 @@ from facebookads.session import FacebookSession from facebookads.api import FacebookAdsApi -__version__ = '2.10.1' +__version__ = '2.11.1' __all__ = [ 'session', 'objects', diff --git a/facebookads/adobjects/ad.py b/facebookads/adobjects/ad.py index 57e58444..e3a99cd7 100644 --- a/facebookads/adobjects/ad.py +++ b/facebookads/adobjects/ad.py @@ -505,6 +505,7 @@ def get_previews(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.adpreview import AdPreview param_types = { 'ad_format': 'ad_format_enum', + 'dynamic_creative_spec': 'Object', 'end_date': 'datetime', 'height': 'unsigned int', 'locale': 'string', diff --git a/facebookads/adobjects/adaccount.py b/facebookads/adobjects/adaccount.py index 9467fa5e..d2911b2c 100644 --- a/facebookads/adobjects/adaccount.py +++ b/facebookads/adobjects/adaccount.py @@ -74,6 +74,7 @@ class Field(AbstractObject.Field): id = 'id' io_number = 'io_number' is_attribution_spec_system_default = 'is_attribution_spec_system_default' + is_direct_deals_enabled = 'is_direct_deals_enabled' is_notifications_enabled = 'is_notifications_enabled' is_personal = 'is_personal' is_prepay_account = 'is_prepay_account' @@ -83,6 +84,7 @@ class Field(AbstractObject.Field): min_campaign_group_spend_cap = 'min_campaign_group_spend_cap' min_daily_budget = 'min_daily_budget' name = 'name' + next_bill_date = 'next_bill_date' offsite_pixels_tos_accepted = 'offsite_pixels_tos_accepted' owner = 'owner' partner = 'partner' @@ -99,18 +101,6 @@ class Field(AbstractObject.Field): tos_accepted = 'tos_accepted' user_role = 'user_role' - class AccessType: - owner = 'OWNER' - agency = 'AGENCY' - - class PermittedRoles: - admin = 'ADMIN' - general_user = 'GENERAL_USER' - reports_only = 'REPORTS_ONLY' - instagram_advertiser = 'INSTAGRAM_ADVERTISER' - instagram_manager = 'INSTAGRAM_MANAGER' - fb_employee_dso_advertiser = 'FB_EMPLOYEE_DSO_ADVERTISER' - # @deprecated get_endpoint function is deprecated @classmethod def get_endpoint(cls): @@ -278,6 +268,33 @@ def create_ad_place_page_set(self, fields=None, params=None, batch=None, pending self.assure_call() return request.execute() + def get_ad_asset_feeds(self, fields=None, params=None, batch=None, pending=False): + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/adasset_feeds', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_ad_creatives(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.adcreative import AdCreative param_types = { @@ -313,6 +330,7 @@ def create_ad_creative(self, fields=None, params=None, batch=None, pending=False 'adlabels': 'list', 'applink_treatment': 'applink_treatment_enum', 'body': 'string', + 'branded_content_sponsor_page_id': 'string', 'call_to_action': 'Object', 'dynamic_ad_voice': 'dynamic_ad_voice_enum', 'image_crops': 'map', @@ -332,6 +350,7 @@ def create_ad_creative(self, fields=None, params=None, batch=None, pending=False 'object_url': 'string', 'platform_customizations': 'Object', 'product_set_id': 'string', + 'recommender_settings': 'map', 'template_url': 'string', 'template_url_spec': 'Object', 'thumbnail_url': 'string', @@ -602,6 +621,70 @@ def get_ad_report_schedules(self, fields=None, params=None, batch=None, pending= self.assure_call() return request.execute() + def get_ad_rules_history(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.adaccountadruleshistory import AdAccountAdRulesHistory + param_types = { + 'hide_no_changes': 'bool', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/adrules_history', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdAccountAdRulesHistory, + api_type='EDGE', + response_parser=ObjectParser(target_class=AdAccountAdRulesHistory, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_ad_rules_library(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.adrule import AdRule + param_types = { + 'account_id': 'string', + 'evaluation_spec': 'Object', + 'execution_spec': 'Object', + 'name': 'string', + 'schedule_spec': 'Object', + 'status': 'status_enum', + } + enums = { + 'status_enum': AdRule.Status.__dict__.values(), + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/adrules_library', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdRule, + api_type='EDGE', + response_parser=ObjectParser(target_class=AdRule, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_ads(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.ad import Ad param_types = { @@ -760,6 +843,7 @@ def create_ad_set(self, fields=None, params=None, batch=None, pending=False): 'creative_sequence': 'list', 'daily_budget': 'unsigned int', 'daily_imps': 'unsigned int', + 'destination_type': 'destination_type_enum', 'end_time': 'datetime', 'execution_options': 'list', 'frequency_control_specs': 'list', @@ -781,6 +865,7 @@ def create_ad_set(self, fields=None, params=None, batch=None, pending=False): } enums = { 'billing_event_enum': AdSet.BillingEvent.__dict__.values(), + 'destination_type_enum': AdSet.DestinationType.__dict__.values(), 'execution_options_enum': AdSet.ExecutionOptions.__dict__.values(), 'optimization_goal_enum': AdSet.OptimizationGoal.__dict__.values(), 'status_enum': AdSet.Status.__dict__.values(), @@ -981,6 +1066,7 @@ def create_ad_video(self, fields=None, params=None, batch=None, pending=False): 'original_projection_type_enum': [ 'equirectangular', 'cubemap', + 'equiangular_cubemap', ], 'unpublished_content_type_enum': [ 'SCHEDULED', @@ -1311,6 +1397,7 @@ def get_custom_audiences(self, fields=None, params=None, batch=None, pending=Fal def create_custom_audience(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.customaudience import CustomAudience param_types = { + 'allowed_domains': 'list', 'claim_objective': 'claim_objective_enum', 'content_type': 'content_type_enum', 'dataset_id': 'string', @@ -1457,6 +1544,7 @@ def get_generate_previews(self, fields=None, params=None, batch=None, pending=Fa param_types = { 'ad_format': 'ad_format_enum', 'creative': 'AdCreative', + 'dynamic_creative_spec': 'Object', 'end_date': 'datetime', 'height': 'unsigned int', 'locale': 'string', @@ -1694,6 +1782,7 @@ def get_minimum_budgets(self, fields=None, params=None, batch=None, pending=Fals return request.execute() def get_offline_conversion_data_sets(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.offlineconversiondataset import OfflineConversionDataSet param_types = { } enums = { @@ -1704,9 +1793,9 @@ def get_offline_conversion_data_sets(self, fields=None, params=None, batch=None, endpoint='/offline_conversion_data_sets', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=OfflineConversionDataSet, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=OfflineConversionDataSet, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -2416,6 +2505,7 @@ def get_users(self, fields=None, params=None, batch=None, pending=False): 'id': 'string', 'io_number': 'string', 'is_attribution_spec_system_default': 'bool', + 'is_direct_deals_enabled': 'bool', 'is_notifications_enabled': 'bool', 'is_personal': 'unsigned int', 'is_prepay_account': 'bool', @@ -2425,6 +2515,7 @@ def get_users(self, fields=None, params=None, batch=None, pending=False): 'min_campaign_group_spend_cap': 'string', 'min_daily_budget': 'unsigned int', 'name': 'string', + 'next_bill_date': 'datetime', 'offsite_pixels_tos_accepted': 'bool', 'owner': 'string', 'partner': 'string', @@ -2445,6 +2536,4 @@ def get_users(self, fields=None, params=None, batch=None, pending=False): @classmethod def _get_field_enum_info(cls): field_enum_info = {} - field_enum_info['AccessType'] = AdAccount.AccessType.__dict__.values() - field_enum_info['PermittedRoles'] = AdAccount.PermittedRoles.__dict__.values() return field_enum_info diff --git a/facebookads/adobjects/adaccountadruleshistory.py b/facebookads/adobjects/adaccountadruleshistory.py new file mode 100644 index 00000000..cd1afe84 --- /dev/null +++ b/facebookads/adobjects/adaccountadruleshistory.py @@ -0,0 +1,66 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAccountAdRulesHistory( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAccountAdRulesHistory, self).__init__() + self._isAdAccountAdRulesHistory = True + self._api = api + + class Field(AbstractObject.Field): + evaluation_spec = 'evaluation_spec' + exception_code = 'exception_code' + exception_message = 'exception_message' + execution_spec = 'execution_spec' + is_manual = 'is_manual' + results = 'results' + rule_id = 'rule_id' + schedule_spec = 'schedule_spec' + timestamp = 'timestamp' + + _field_types = { + 'evaluation_spec': 'AdRuleEvaluationSpec', + 'exception_code': 'int', + 'exception_message': 'string', + 'execution_spec': 'AdRuleExecutionSpec', + 'is_manual': 'bool', + 'results': 'list', + 'rule_id': 'int', + 'schedule_spec': 'AdRuleScheduleSpec', + 'timestamp': 'datetime', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adaccountdeliveryestimate.py b/facebookads/adobjects/adaccountdeliveryestimate.py index cdf8497f..e5a188a8 100644 --- a/facebookads/adobjects/adaccountdeliveryestimate.py +++ b/facebookads/adobjects/adaccountdeliveryestimate.py @@ -48,6 +48,7 @@ class OptimizationGoal: none = 'NONE' app_installs = 'APP_INSTALLS' brand_awareness = 'BRAND_AWARENESS' + ad_recall_lift = 'AD_RECALL_LIFT' clicks = 'CLICKS' engaged_users = 'ENGAGED_USERS' event_responses = 'EVENT_RESPONSES' diff --git a/facebookads/adobjects/adaccounttargetingunified.py b/facebookads/adobjects/adaccounttargetingunified.py index 6fa3c543..db5994da 100644 --- a/facebookads/adobjects/adaccounttargetingunified.py +++ b/facebookads/adobjects/adaccounttargetingunified.py @@ -146,6 +146,11 @@ class LimitType: format = 'format' trending = 'trending' gatekeepers = 'gatekeepers' + follow_profiles = 'follow_profiles' + follow_profiles_negative = 'follow_profiles_negative' + location_categories = 'location_categories' + user_page_threads = 'user_page_threads' + user_page_threads_excluded = 'user_page_threads_excluded' _field_types = { 'audience_size': 'unsigned int', diff --git a/facebookads/adobjects/adactivity.py b/facebookads/adobjects/adactivity.py index a154dc62..90a35f9f 100644 --- a/facebookads/adobjects/adactivity.py +++ b/facebookads/adobjects/adactivity.py @@ -74,6 +74,7 @@ class EventType: update_campaign_name = 'update_campaign_name' update_campaign_run_status = 'update_campaign_run_status' update_campaign_group_spend_cap = 'update_campaign_group_spend_cap' + campaign_ended = 'campaign_ended' create_campaign = 'create_campaign' create_campaign_legacy = 'create_campaign_legacy' update_campaign_budget = 'update_campaign_budget' diff --git a/facebookads/adobjects/adassetfeedspec.py b/facebookads/adobjects/adassetfeedspec.py new file mode 100644 index 00000000..e0d600f1 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspec.py @@ -0,0 +1,114 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpec, self).__init__() + self._isAdAssetFeedSpec = True + self._api = api + + class Field(AbstractObject.Field): + ad_formats = 'ad_formats' + bodies = 'bodies' + call_to_action_types = 'call_to_action_types' + captions = 'captions' + descriptions = 'descriptions' + groups = 'groups' + images = 'images' + link_urls = 'link_urls' + optimization_type = 'optimization_type' + target_rules = 'target_rules' + titles = 'titles' + videos = 'videos' + + class CallToActionTypes: + open_link = 'OPEN_LINK' + like_page = 'LIKE_PAGE' + shop_now = 'SHOP_NOW' + play_game = 'PLAY_GAME' + install_app = 'INSTALL_APP' + use_app = 'USE_APP' + install_mobile_app = 'INSTALL_MOBILE_APP' + use_mobile_app = 'USE_MOBILE_APP' + book_travel = 'BOOK_TRAVEL' + listen_music = 'LISTEN_MUSIC' + learn_more = 'LEARN_MORE' + sign_up = 'SIGN_UP' + download = 'DOWNLOAD' + watch_more = 'WATCH_MORE' + no_button = 'NO_BUTTON' + call_now = 'CALL_NOW' + apply_now = 'APPLY_NOW' + buy_now = 'BUY_NOW' + get_offer = 'GET_OFFER' + get_offer_view = 'GET_OFFER_VIEW' + get_directions = 'GET_DIRECTIONS' + message_page = 'MESSAGE_PAGE' + message_user = 'MESSAGE_USER' + subscribe = 'SUBSCRIBE' + sell_now = 'SELL_NOW' + donate_now = 'DONATE_NOW' + get_quote = 'GET_QUOTE' + contact_us = 'CONTACT_US' + start_order = 'START_ORDER' + record_now = 'RECORD_NOW' + vote_now = 'VOTE_NOW' + register_now = 'REGISTER_NOW' + request_time = 'REQUEST_TIME' + see_menu = 'SEE_MENU' + email_now = 'EMAIL_NOW' + get_showtimes = 'GET_SHOWTIMES' + try_it = 'TRY_IT' + listen_now = 'LISTEN_NOW' + open_movies = 'OPEN_MOVIES' + + _field_types = { + 'ad_formats': 'list', + 'bodies': 'list', + 'call_to_action_types': 'list', + 'captions': 'list', + 'descriptions': 'list', + 'groups': 'list', + 'images': 'list', + 'link_urls': 'list', + 'optimization_type': 'string', + 'target_rules': 'list', + 'titles': 'list', + 'videos': 'list', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['CallToActionTypes'] = AdAssetFeedSpec.CallToActionTypes.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecassetlabel.py b/facebookads/adobjects/adassetfeedspecassetlabel.py new file mode 100644 index 00000000..17f35c38 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecassetlabel.py @@ -0,0 +1,55 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.adobjects.abstractobject import AbstractObject +from facebookads.adobjects.abstractcrudobject import AbstractCrudObject +from facebookads.adobjects.objectparser import ObjectParser +from facebookads.api import FacebookRequest +from facebookads.typechecker import TypeChecker + +""" +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 AdAssetFeedSpecAssetLabel( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isAdAssetFeedSpecAssetLabel = True + super(AdAssetFeedSpecAssetLabel, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + id = 'id' + name = 'name' + + _field_types = { + 'id': 'string', + 'name': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecbody.py b/facebookads/adobjects/adassetfeedspecbody.py new file mode 100644 index 00000000..fd22efe1 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecbody.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecBody( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecBody, self).__init__() + self._isAdAssetFeedSpecBody = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + text = 'text' + url_tags = 'url_tags' + + _field_types = { + 'adlabels': 'list', + 'text': 'string', + 'url_tags': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspeccaption.py b/facebookads/adobjects/adassetfeedspeccaption.py new file mode 100644 index 00000000..3442cd40 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspeccaption.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecCaption( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecCaption, self).__init__() + self._isAdAssetFeedSpecCaption = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + text = 'text' + url_tags = 'url_tags' + + _field_types = { + 'adlabels': 'list', + 'text': 'string', + 'url_tags': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecdescription.py b/facebookads/adobjects/adassetfeedspecdescription.py new file mode 100644 index 00000000..2f6835e4 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecdescription.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecDescription( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecDescription, self).__init__() + self._isAdAssetFeedSpecDescription = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + text = 'text' + url_tags = 'url_tags' + + _field_types = { + 'adlabels': 'list', + 'text': 'string', + 'url_tags': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecgrouprule.py b/facebookads/adobjects/adassetfeedspecgrouprule.py new file mode 100644 index 00000000..6b23eb86 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecgrouprule.py @@ -0,0 +1,62 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecGroupRule( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecGroupRule, self).__init__() + self._isAdAssetFeedSpecGroupRule = True + self._api = api + + class Field(AbstractObject.Field): + body_label = 'body_label' + caption_label = 'caption_label' + description_label = 'description_label' + image_label = 'image_label' + link_url_label = 'link_url_label' + title_label = 'title_label' + video_label = 'video_label' + + _field_types = { + 'body_label': 'AdAssetFeedSpecAssetLabel', + 'caption_label': 'AdAssetFeedSpecAssetLabel', + 'description_label': 'AdAssetFeedSpecAssetLabel', + 'image_label': 'AdAssetFeedSpecAssetLabel', + 'link_url_label': 'AdAssetFeedSpecAssetLabel', + 'title_label': 'AdAssetFeedSpecAssetLabel', + 'video_label': 'AdAssetFeedSpecAssetLabel', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecimage.py b/facebookads/adobjects/adassetfeedspecimage.py new file mode 100644 index 00000000..d92186f9 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecimage.py @@ -0,0 +1,58 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecImage( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecImage, self).__init__() + self._isAdAssetFeedSpecImage = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + hash = 'hash' + image_crops = 'image_crops' + url = 'url' + url_tags = 'url_tags' + + _field_types = { + 'adlabels': 'list', + 'hash': 'string', + 'image_crops': 'AdsImageCrops', + 'url': 'string', + 'url_tags': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspeclinkurl.py b/facebookads/adobjects/adassetfeedspeclinkurl.py new file mode 100644 index 00000000..34d14043 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspeclinkurl.py @@ -0,0 +1,58 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecLinkURL( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecLinkURL, self).__init__() + self._isAdAssetFeedSpecLinkURL = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + deeplink_url = 'deeplink_url' + display_url = 'display_url' + url_tags = 'url_tags' + website_url = 'website_url' + + _field_types = { + 'adlabels': 'list', + 'deeplink_url': 'string', + 'display_url': 'string', + 'url_tags': 'string', + 'website_url': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspectargetrule.py b/facebookads/adobjects/adassetfeedspectargetrule.py new file mode 100644 index 00000000..13952be8 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspectargetrule.py @@ -0,0 +1,66 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecTargetRule( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecTargetRule, self).__init__() + self._isAdAssetFeedSpecTargetRule = True + self._api = api + + class Field(AbstractObject.Field): + body_label = 'body_label' + call_to_action_type_label = 'call_to_action_type_label' + caption_label = 'caption_label' + description_label = 'description_label' + image_label = 'image_label' + link_url_label = 'link_url_label' + targeting = 'targeting' + title_label = 'title_label' + video_label = 'video_label' + + _field_types = { + 'body_label': 'AdAssetFeedSpecAssetLabel', + 'call_to_action_type_label': 'AdAssetFeedSpecAssetLabel', + 'caption_label': 'AdAssetFeedSpecAssetLabel', + 'description_label': 'AdAssetFeedSpecAssetLabel', + 'image_label': 'AdAssetFeedSpecAssetLabel', + 'link_url_label': 'AdAssetFeedSpecAssetLabel', + 'targeting': 'Object', + 'title_label': 'AdAssetFeedSpecAssetLabel', + 'video_label': 'AdAssetFeedSpecAssetLabel', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspectitle.py b/facebookads/adobjects/adassetfeedspectitle.py new file mode 100644 index 00000000..8017ba04 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspectitle.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecTitle( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecTitle, self).__init__() + self._isAdAssetFeedSpecTitle = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + text = 'text' + url_tags = 'url_tags' + + _field_types = { + 'adlabels': 'list', + 'text': 'string', + 'url_tags': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adassetfeedspecvideo.py b/facebookads/adobjects/adassetfeedspecvideo.py new file mode 100644 index 00000000..4bf551e2 --- /dev/null +++ b/facebookads/adobjects/adassetfeedspecvideo.py @@ -0,0 +1,58 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdAssetFeedSpecVideo( + AbstractObject, +): + + def __init__(self, api=None): + super(AdAssetFeedSpecVideo, self).__init__() + self._isAdAssetFeedSpecVideo = True + self._api = api + + class Field(AbstractObject.Field): + adlabels = 'adlabels' + caption_ids = 'caption_ids' + thumbnail_url = 'thumbnail_url' + url_tags = 'url_tags' + video_id = 'video_id' + + _field_types = { + 'adlabels': 'list', + 'caption_ids': 'list', + 'thumbnail_url': 'string', + 'url_tags': 'string', + 'video_id': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adcampaigndeliveryestimate.py b/facebookads/adobjects/adcampaigndeliveryestimate.py index c8eca38c..d6d7e896 100644 --- a/facebookads/adobjects/adcampaigndeliveryestimate.py +++ b/facebookads/adobjects/adcampaigndeliveryestimate.py @@ -48,6 +48,7 @@ class OptimizationGoal: none = 'NONE' app_installs = 'APP_INSTALLS' brand_awareness = 'BRAND_AWARENESS' + ad_recall_lift = 'AD_RECALL_LIFT' clicks = 'CLICKS' engaged_users = 'ENGAGED_USERS' event_responses = 'EVENT_RESPONSES' diff --git a/facebookads/adobjects/adcreative.py b/facebookads/adobjects/adcreative.py index e7eaaf83..a86db209 100644 --- a/facebookads/adobjects/adcreative.py +++ b/facebookads/adobjects/adcreative.py @@ -47,7 +47,9 @@ class Field(AbstractObject.Field): actor_id = 'actor_id' adlabels = 'adlabels' applink_treatment = 'applink_treatment' + asset_feed_spec = 'asset_feed_spec' body = 'body' + branded_content_sponsor_page_id = 'branded_content_sponsor_page_id' call_to_action_type = 'call_to_action_type' effective_instagram_story_id = 'effective_instagram_story_id' effective_object_story_id = 'effective_object_story_id' @@ -68,6 +70,7 @@ class Field(AbstractObject.Field): object_url = 'object_url' platform_customizations = 'platform_customizations' product_set_id = 'product_set_id' + recommender_settings = 'recommender_settings' status = 'status' template_url = 'template_url' template_url_spec = 'template_url_spec' @@ -114,12 +117,16 @@ class CallToActionType: donate_now = 'DONATE_NOW' get_quote = 'GET_QUOTE' contact_us = 'CONTACT_US' + start_order = 'START_ORDER' record_now = 'RECORD_NOW' vote_now = 'VOTE_NOW' register_now = 'REGISTER_NOW' request_time = 'REQUEST_TIME' see_menu = 'SEE_MENU' email_now = 'EMAIL_NOW' + get_showtimes = 'GET_SHOWTIMES' + try_it = 'TRY_IT' + listen_now = 'LISTEN_NOW' open_movies = 'OPEN_MOVIES' class ObjectType: @@ -310,6 +317,7 @@ def get_previews(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.adpreview import AdPreview param_types = { 'ad_format': 'ad_format_enum', + 'dynamic_creative_spec': 'Object', 'end_date': 'datetime', 'height': 'unsigned int', 'locale': 'string', @@ -349,7 +357,9 @@ def get_previews(self, fields=None, params=None, batch=None, pending=False): 'actor_id': 'string', 'adlabels': 'list', 'applink_treatment': 'ApplinkTreatment', + 'asset_feed_spec': 'AdAssetFeedSpec', 'body': 'string', + 'branded_content_sponsor_page_id': 'string', 'call_to_action_type': 'CallToActionType', 'effective_instagram_story_id': 'string', 'effective_object_story_id': 'string', @@ -370,6 +380,7 @@ def get_previews(self, fields=None, params=None, batch=None, pending=False): 'object_url': 'string', 'platform_customizations': 'Object', 'product_set_id': 'string', + 'recommender_settings': 'Object', 'status': 'Status', 'template_url': 'string', 'template_url_spec': 'Object', diff --git a/facebookads/adobjects/adcreativecollectionthumbnailinfo.py b/facebookads/adobjects/adcreativecollectionthumbnailinfo.py new file mode 100644 index 00000000..781ce0c7 --- /dev/null +++ b/facebookads/adobjects/adcreativecollectionthumbnailinfo.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdCreativeCollectionThumbnailInfo( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeCollectionThumbnailInfo, self).__init__() + self._isAdCreativeCollectionThumbnailInfo = True + self._api = api + + class Field(AbstractObject.Field): + element_child_index = 'element_child_index' + element_crops = 'element_crops' + element_id = 'element_id' + + _field_types = { + 'element_child_index': 'int', + 'element_crops': 'AdsImageCrops', + 'element_id': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adcreativelinkdata.py b/facebookads/adobjects/adcreativelinkdata.py index 8524e0b8..be5e4aa1 100644 --- a/facebookads/adobjects/adcreativelinkdata.py +++ b/facebookads/adobjects/adcreativelinkdata.py @@ -41,16 +41,20 @@ class Field(AbstractObject.Field): additional_image_index = 'additional_image_index' app_link_spec = 'app_link_spec' attachment_style = 'attachment_style' + branded_content_shared_to_sponsor_status = 'branded_content_shared_to_sponsor_status' branded_content_sponsor_page_id = 'branded_content_sponsor_page_id' branded_content_sponsor_relationship = 'branded_content_sponsor_relationship' call_to_action = 'call_to_action' caption = 'caption' child_attachments = 'child_attachments' + collection_thumbnails = 'collection_thumbnails' description = 'description' event_id = 'event_id' force_single_link = 'force_single_link' + format_option = 'format_option' image_crops = 'image_crops' image_hash = 'image_hash' + image_overlay_spec = 'image_overlay_spec' link = 'link' message = 'message' multi_share_end_card = 'multi_share_end_card' @@ -59,6 +63,7 @@ class Field(AbstractObject.Field): offer_id = 'offer_id' page_welcome_message = 'page_welcome_message' picture = 'picture' + post_click_configuration = 'post_click_configuration' retailer_item_ids = 'retailer_item_ids' show_multiple_images = 'show_multiple_images' @@ -66,20 +71,29 @@ class AttachmentStyle: link = 'link' value_default = 'default' + class FormatOption: + carousel_images_multi_items = 'carousel_images_multi_items' + carousel_images_single_item = 'carousel_images_single_item' + single_image = 'single_image' + _field_types = { 'additional_image_index': 'int', 'app_link_spec': 'AdCreativeLinkDataAppLinkSpec', 'attachment_style': 'AttachmentStyle', + 'branded_content_shared_to_sponsor_status': 'string', 'branded_content_sponsor_page_id': 'string', 'branded_content_sponsor_relationship': 'string', 'call_to_action': 'AdCreativeLinkDataCallToAction', 'caption': 'string', 'child_attachments': 'list', + 'collection_thumbnails': 'list', 'description': 'string', 'event_id': 'string', 'force_single_link': 'bool', + 'format_option': 'FormatOption', 'image_crops': 'AdsImageCrops', 'image_hash': 'string', + 'image_overlay_spec': 'AdCreativeLinkDataImageOverlaySpec', 'link': 'string', 'message': 'string', 'multi_share_end_card': 'bool', @@ -88,6 +102,7 @@ class AttachmentStyle: 'offer_id': 'string', 'page_welcome_message': 'string', 'picture': 'string', + 'post_click_configuration': 'AdCreativePostClickConfiguration', 'retailer_item_ids': 'list', 'show_multiple_images': 'bool', } @@ -96,4 +111,5 @@ class AttachmentStyle: def _get_field_enum_info(cls): field_enum_info = {} field_enum_info['AttachmentStyle'] = AdCreativeLinkData.AttachmentStyle.__dict__.values() + field_enum_info['FormatOption'] = AdCreativeLinkData.FormatOption.__dict__.values() return field_enum_info diff --git a/facebookads/adobjects/adcreativelinkdatacalltoaction.py b/facebookads/adobjects/adcreativelinkdatacalltoaction.py index ffb48209..4426ecb5 100644 --- a/facebookads/adobjects/adcreativelinkdatacalltoaction.py +++ b/facebookads/adobjects/adcreativelinkdatacalltoaction.py @@ -70,12 +70,16 @@ class Type: donate_now = 'DONATE_NOW' get_quote = 'GET_QUOTE' contact_us = 'CONTACT_US' + start_order = 'START_ORDER' record_now = 'RECORD_NOW' vote_now = 'VOTE_NOW' register_now = 'REGISTER_NOW' request_time = 'REQUEST_TIME' see_menu = 'SEE_MENU' email_now = 'EMAIL_NOW' + get_showtimes = 'GET_SHOWTIMES' + try_it = 'TRY_IT' + listen_now = 'LISTEN_NOW' open_movies = 'OPEN_MOVIES' _field_types = { diff --git a/facebookads/adobjects/adcreativelinkdataimageoverlayspec.py b/facebookads/adobjects/adcreativelinkdataimageoverlayspec.py new file mode 100644 index 00000000..27ca745d --- /dev/null +++ b/facebookads/adobjects/adcreativelinkdataimageoverlayspec.py @@ -0,0 +1,113 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdCreativeLinkDataImageOverlaySpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativeLinkDataImageOverlaySpec, self).__init__() + self._isAdCreativeLinkDataImageOverlaySpec = True + self._api = api + + class Field(AbstractObject.Field): + float_with_margin = 'float_with_margin' + overlay_template = 'overlay_template' + position = 'position' + text_font = 'text_font' + text_template_tags = 'text_template_tags' + text_type = 'text_type' + theme_color = 'theme_color' + + class OverlayTemplate: + pill_with_text = 'pill_with_text' + circle_with_text = 'circle_with_text' + triangle_with_text = 'triangle_with_text' + + class Position: + top_left = 'top_left' + top_right = 'top_right' + bottom_left = 'bottom_left' + bottom_right = 'bottom_right' + + class TextFont: + droid_serif_regular = 'droid_serif_regular' + lato_regular = 'lato_regular' + nunito_sans_bold = 'nunito_sans_bold' + open_sans_bold = 'open_sans_bold' + open_sans_condensed_bold = 'open_sans_condensed_bold' + pt_serif_bold = 'pt_serif_bold' + roboto_medium = 'roboto_medium' + roboto_condensed_regular = 'roboto_condensed_regular' + noto_sans_regular = 'noto_sans_regular' + dynads_hybrid_bold = 'dynads_hybrid_bold' + + class TextType: + price = 'price' + strikethrough_price = 'strikethrough_price' + percentage_off = 'percentage_off' + + class ThemeColor: + background_e50900_text_ffffff = 'background_e50900_text_ffffff' + background_f78400_text_ffffff = 'background_f78400_text_ffffff' + background_00af4c_text_ffffff = 'background_00af4c_text_ffffff' + background_0090ff_text_ffffff = 'background_0090ff_text_ffffff' + background_755dde_text_ffffff = 'background_755dde_text_ffffff' + background_f23474_text_ffffff = 'background_f23474_text_ffffff' + background_595959_text_ffffff = 'background_595959_text_ffffff' + background_000000_text_ffffff = 'background_000000_text_ffffff' + background_ffffff_text_c91b00 = 'background_ffffff_text_c91b00' + background_ffffff_text_f78400 = 'background_ffffff_text_f78400' + background_ffffff_text_009c2a = 'background_ffffff_text_009c2a' + background_ffffff_text_007ad0 = 'background_ffffff_text_007ad0' + background_ffffff_text_755dde = 'background_ffffff_text_755dde' + background_ffffff_text_f23474 = 'background_ffffff_text_f23474' + background_ffffff_text_646464 = 'background_ffffff_text_646464' + background_ffffff_text_000000 = 'background_ffffff_text_000000' + + _field_types = { + 'float_with_margin': 'bool', + 'overlay_template': 'OverlayTemplate', + 'position': 'Position', + 'text_font': 'TextFont', + 'text_template_tags': 'list', + 'text_type': 'TextType', + 'theme_color': 'ThemeColor', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['OverlayTemplate'] = AdCreativeLinkDataImageOverlaySpec.OverlayTemplate.__dict__.values() + field_enum_info['Position'] = AdCreativeLinkDataImageOverlaySpec.Position.__dict__.values() + field_enum_info['TextFont'] = AdCreativeLinkDataImageOverlaySpec.TextFont.__dict__.values() + field_enum_info['TextType'] = AdCreativeLinkDataImageOverlaySpec.TextType.__dict__.values() + field_enum_info['ThemeColor'] = AdCreativeLinkDataImageOverlaySpec.ThemeColor.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adcreativephotodata.py b/facebookads/adobjects/adcreativephotodata.py index fe467505..15bd717a 100644 --- a/facebookads/adobjects/adcreativephotodata.py +++ b/facebookads/adobjects/adcreativephotodata.py @@ -38,6 +38,7 @@ def __init__(self, api=None): self._api = api class Field(AbstractObject.Field): + branded_content_shared_to_sponsor_status = 'branded_content_shared_to_sponsor_status' branded_content_sponsor_page_id = 'branded_content_sponsor_page_id' branded_content_sponsor_relationship = 'branded_content_sponsor_relationship' caption = 'caption' @@ -46,6 +47,7 @@ class Field(AbstractObject.Field): url = 'url' _field_types = { + 'branded_content_shared_to_sponsor_status': 'string', 'branded_content_sponsor_page_id': 'string', 'branded_content_sponsor_relationship': 'string', 'caption': 'string', diff --git a/facebookads/adobjects/adcreativeplacedata.py b/facebookads/adobjects/adcreativeplacedata.py index 1e883dcd..2a1d9c37 100644 --- a/facebookads/adobjects/adcreativeplacedata.py +++ b/facebookads/adobjects/adcreativeplacedata.py @@ -41,6 +41,7 @@ class Field(AbstractObject.Field): address_string = 'address_string' label = 'label' latitude = 'latitude' + location_source_id = 'location_source_id' longitude = 'longitude' type = 'type' @@ -48,6 +49,7 @@ class Field(AbstractObject.Field): 'address_string': 'string', 'label': 'string', 'latitude': 'float', + 'location_source_id': 'string', 'longitude': 'float', 'type': 'string', } diff --git a/facebookads/adobjects/adcreativepostclickconfiguration.py b/facebookads/adobjects/adcreativepostclickconfiguration.py new file mode 100644 index 00000000..3bdeadca --- /dev/null +++ b/facebookads/adobjects/adcreativepostclickconfiguration.py @@ -0,0 +1,52 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdCreativePostClickConfiguration( + AbstractObject, +): + + def __init__(self, api=None): + super(AdCreativePostClickConfiguration, self).__init__() + self._isAdCreativePostClickConfiguration = True + self._api = api + + class Field(AbstractObject.Field): + post_click_item_description = 'post_click_item_description' + post_click_item_headline = 'post_click_item_headline' + + _field_types = { + 'post_click_item_description': 'string', + 'post_click_item_headline': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adcreativevideodata.py b/facebookads/adobjects/adcreativevideodata.py index b9aab537..744e46be 100644 --- a/facebookads/adobjects/adcreativevideodata.py +++ b/facebookads/adobjects/adcreativevideodata.py @@ -39,15 +39,18 @@ def __init__(self, api=None): class Field(AbstractObject.Field): additional_image_index = 'additional_image_index' + branded_content_shared_to_sponsor_status = 'branded_content_shared_to_sponsor_status' branded_content_sponsor_page_id = 'branded_content_sponsor_page_id' branded_content_sponsor_relationship = 'branded_content_sponsor_relationship' call_to_action = 'call_to_action' + collection_thumbnails = 'collection_thumbnails' image_hash = 'image_hash' image_url = 'image_url' link_description = 'link_description' message = 'message' offer_id = 'offer_id' page_welcome_message = 'page_welcome_message' + post_click_configuration = 'post_click_configuration' retailer_item_ids = 'retailer_item_ids' targeting = 'targeting' title = 'title' @@ -55,15 +58,18 @@ class Field(AbstractObject.Field): _field_types = { 'additional_image_index': 'int', + 'branded_content_shared_to_sponsor_status': 'string', 'branded_content_sponsor_page_id': 'string', 'branded_content_sponsor_relationship': 'string', 'call_to_action': 'AdCreativeLinkDataCallToAction', + 'collection_thumbnails': 'list', 'image_hash': 'string', 'image_url': 'string', 'link_description': 'string', 'message': 'string', 'offer_id': 'string', 'page_welcome_message': 'string', + 'post_click_configuration': 'AdCreativePostClickConfiguration', 'retailer_item_ids': 'list', 'targeting': 'Targeting', 'title': 'string', diff --git a/facebookads/adobjects/adrule.py b/facebookads/adobjects/adrule.py new file mode 100644 index 00000000..b4bc77e0 --- /dev/null +++ b/facebookads/adobjects/adrule.py @@ -0,0 +1,206 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.adobjects.abstractobject import AbstractObject +from facebookads.adobjects.abstractcrudobject import AbstractCrudObject +from facebookads.adobjects.objectparser import ObjectParser +from facebookads.api import FacebookRequest +from facebookads.typechecker import TypeChecker + +""" +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 AdRule( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isAdRule = True + super(AdRule, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + account_id = 'account_id' + created_by = 'created_by' + created_time = 'created_time' + evaluation_spec = 'evaluation_spec' + execution_spec = 'execution_spec' + id = 'id' + name = 'name' + schedule_spec = 'schedule_spec' + status = 'status' + updated_time = 'updated_time' + + class Status: + enabled = 'ENABLED' + disabled = 'DISABLED' + deleted = 'DELETED' + + # @deprecated get_endpoint function is deprecated + @classmethod + def get_endpoint(cls): + return 'adrules_library' + + def api_create(self, parent_id, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.adaccount import AdAccount + return AdAccount(api=self._api, fbid=parent_id).create_ad_rules_library(fields, params, batch, pending) + + def api_delete(self, fields=None, params=None, batch=None, pending=False): + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='DELETE', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AbstractCrudObject, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def api_get(self, fields=None, params=None, batch=None, pending=False): + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdRule, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def api_update(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'evaluation_spec': 'Object', + 'execution_spec': 'Object', + 'name': 'string', + 'reset_period': 'int', + 'schedule_spec': 'Object', + 'status': 'status_enum', + } + enums = { + 'status_enum': AdRule.Status.__dict__.values(), + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdRule, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_history(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.adrulehistory import AdRuleHistory + param_types = { + 'action': 'action_enum', + 'hide_no_changes': 'bool', + 'object_id': 'string', + } + enums = { + 'action_enum': AdRuleHistory.Action.__dict__.values(), + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/history', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdRuleHistory, + api_type='EDGE', + response_parser=ObjectParser(target_class=AdRuleHistory, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + _field_types = { + 'account_id': 'string', + 'created_by': 'User', + 'created_time': 'datetime', + 'evaluation_spec': 'AdRuleEvaluationSpec', + 'execution_spec': 'AdRuleExecutionSpec', + 'id': 'string', + 'name': 'string', + 'schedule_spec': 'AdRuleScheduleSpec', + 'status': 'string', + 'updated_time': 'datetime', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['Status'] = AdRule.Status.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adruleevaluationspec.py b/facebookads/adobjects/adruleevaluationspec.py new file mode 100644 index 00000000..e2a6e1b6 --- /dev/null +++ b/facebookads/adobjects/adruleevaluationspec.py @@ -0,0 +1,59 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleEvaluationSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleEvaluationSpec, self).__init__() + self._isAdRuleEvaluationSpec = True + self._api = api + + class Field(AbstractObject.Field): + evaluation_type = 'evaluation_type' + filters = 'filters' + trigger = 'trigger' + + class EvaluationType: + schedule = 'SCHEDULE' + trigger = 'TRIGGER' + + _field_types = { + 'evaluation_type': 'EvaluationType', + 'filters': 'list', + 'trigger': 'AdRuleTrigger', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['EvaluationType'] = AdRuleEvaluationSpec.EvaluationType.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adruleexecutionoptions.py b/facebookads/adobjects/adruleexecutionoptions.py new file mode 100644 index 00000000..7ad4768f --- /dev/null +++ b/facebookads/adobjects/adruleexecutionoptions.py @@ -0,0 +1,59 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleExecutionOptions( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleExecutionOptions, self).__init__() + self._isAdRuleExecutionOptions = True + self._api = api + + class Field(AbstractObject.Field): + field = 'field' + operator = 'operator' + value = 'value' + + class Operator: + equal = 'EQUAL' + in = 'IN' + + _field_types = { + 'field': 'string', + 'operator': 'Operator', + 'value': 'Object', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['Operator'] = AdRuleExecutionOptions.Operator.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adruleexecutionspec.py b/facebookads/adobjects/adruleexecutionspec.py new file mode 100644 index 00000000..8b42a383 --- /dev/null +++ b/facebookads/adobjects/adruleexecutionspec.py @@ -0,0 +1,63 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleExecutionSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleExecutionSpec, self).__init__() + self._isAdRuleExecutionSpec = True + self._api = api + + class Field(AbstractObject.Field): + execution_options = 'execution_options' + execution_type = 'execution_type' + + class ExecutionType: + ping_endpoint = 'PING_ENDPOINT' + notification = 'NOTIFICATION' + pause = 'PAUSE' + rebalance_budget = 'REBALANCE_BUDGET' + change_budget = 'CHANGE_BUDGET' + change_bid = 'CHANGE_BID' + rotate = 'ROTATE' + unpause = 'UNPAUSE' + + _field_types = { + 'execution_options': 'list', + 'execution_type': 'ExecutionType', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['ExecutionType'] = AdRuleExecutionSpec.ExecutionType.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adrulefilters.py b/facebookads/adobjects/adrulefilters.py new file mode 100644 index 00000000..53819366 --- /dev/null +++ b/facebookads/adobjects/adrulefilters.py @@ -0,0 +1,70 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleFilters( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleFilters, self).__init__() + self._isAdRuleFilters = True + self._api = api + + class Field(AbstractObject.Field): + field = 'field' + operator = 'operator' + value = 'value' + + class Operator: + greater_than = 'GREATER_THAN' + less_than = 'LESS_THAN' + equal = 'EQUAL' + not_equal = 'NOT_EQUAL' + in_range = 'IN_RANGE' + not_in_range = 'NOT_IN_RANGE' + in = 'IN' + not_in = 'NOT_IN' + contain = 'CONTAIN' + not_contain = 'NOT_CONTAIN' + any = 'ANY' + all = 'ALL' + none = 'NONE' + + _field_types = { + 'field': 'string', + 'operator': 'Operator', + 'value': 'Object', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['Operator'] = AdRuleFilters.Operator.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adrulehistory.py b/facebookads/adobjects/adrulehistory.py new file mode 100644 index 00000000..21a88392 --- /dev/null +++ b/facebookads/adobjects/adrulehistory.py @@ -0,0 +1,78 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleHistory( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleHistory, self).__init__() + self._isAdRuleHistory = True + self._api = api + + class Field(AbstractObject.Field): + evaluation_spec = 'evaluation_spec' + exception_code = 'exception_code' + exception_message = 'exception_message' + execution_spec = 'execution_spec' + is_manual = 'is_manual' + results = 'results' + schedule_spec = 'schedule_spec' + timestamp = 'timestamp' + + class Action: + budget_not_redistributed = 'BUDGET_NOT_REDISTRIBUTED' + changed_bid = 'CHANGED_BID' + changed_budget = 'CHANGED_BUDGET' + email = 'EMAIL' + endpoint_pinged = 'ENDPOINT_PINGED' + error = 'ERROR' + facebook_notification_sent = 'FACEBOOK_NOTIFICATION_SENT' + message_sent = 'MESSAGE_SENT' + not_changed = 'NOT_CHANGED' + paused = 'PAUSED' + unpaused = 'UNPAUSED' + + _field_types = { + 'evaluation_spec': 'AdRuleEvaluationSpec', + 'exception_code': 'int', + 'exception_message': 'string', + 'execution_spec': 'AdRuleExecutionSpec', + 'is_manual': 'bool', + 'results': 'list', + 'schedule_spec': 'AdRuleScheduleSpec', + 'timestamp': 'datetime', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['Action'] = AdRuleHistory.Action.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adrulehistoryresult.py b/facebookads/adobjects/adrulehistoryresult.py new file mode 100644 index 00000000..16d6fc70 --- /dev/null +++ b/facebookads/adobjects/adrulehistoryresult.py @@ -0,0 +1,60 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleHistoryResult( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleHistoryResult, self).__init__() + self._isAdRuleHistoryResult = True + self._api = api + + class Field(AbstractObject.Field): + actions = 'actions' + object_id = 'object_id' + object_type = 'object_type' + + class ObjectType: + campaign = 'CAMPAIGN' + adset = 'ADSET' + ad = 'AD' + + _field_types = { + 'actions': 'list', + 'object_id': 'string', + 'object_type': 'ObjectType', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['ObjectType'] = AdRuleHistoryResult.ObjectType.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adrulehistoryresultaction.py b/facebookads/adobjects/adrulehistoryresultaction.py new file mode 100644 index 00000000..4cd3c919 --- /dev/null +++ b/facebookads/adobjects/adrulehistoryresultaction.py @@ -0,0 +1,56 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleHistoryResultAction( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleHistoryResultAction, self).__init__() + self._isAdRuleHistoryResultAction = True + self._api = api + + class Field(AbstractObject.Field): + action = 'action' + field = 'field' + new_value = 'new_value' + old_value = 'old_value' + + _field_types = { + 'action': 'string', + 'field': 'string', + 'new_value': 'string', + 'old_value': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adruleschedule.py b/facebookads/adobjects/adruleschedule.py new file mode 100644 index 00000000..8a58319a --- /dev/null +++ b/facebookads/adobjects/adruleschedule.py @@ -0,0 +1,54 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleSchedule( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleSchedule, self).__init__() + self._isAdRuleSchedule = True + self._api = api + + class Field(AbstractObject.Field): + days = 'days' + end_minute = 'end_minute' + start_minute = 'start_minute' + + _field_types = { + 'days': 'list', + 'end_minute': 'int', + 'start_minute': 'int', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adruleschedulespec.py b/facebookads/adobjects/adruleschedulespec.py new file mode 100644 index 00000000..5359380d --- /dev/null +++ b/facebookads/adobjects/adruleschedulespec.py @@ -0,0 +1,52 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleScheduleSpec( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleScheduleSpec, self).__init__() + self._isAdRuleScheduleSpec = True + self._api = api + + class Field(AbstractObject.Field): + schedule = 'schedule' + schedule_type = 'schedule_type' + + _field_types = { + 'schedule': 'list', + 'schedule_type': 'string', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/adruletrigger.py b/facebookads/adobjects/adruletrigger.py new file mode 100644 index 00000000..2e3f020b --- /dev/null +++ b/facebookads/adobjects/adruletrigger.py @@ -0,0 +1,79 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.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 AdRuleTrigger( + AbstractObject, +): + + def __init__(self, api=None): + super(AdRuleTrigger, self).__init__() + self._isAdRuleTrigger = True + self._api = api + + class Field(AbstractObject.Field): + field = 'field' + operator = 'operator' + type = 'type' + value = 'value' + + class Operator: + greater_than = 'GREATER_THAN' + less_than = 'LESS_THAN' + equal = 'EQUAL' + not_equal = 'NOT_EQUAL' + in_range = 'IN_RANGE' + not_in_range = 'NOT_IN_RANGE' + in = 'IN' + not_in = 'NOT_IN' + contain = 'CONTAIN' + not_contain = 'NOT_CONTAIN' + any = 'ANY' + all = 'ALL' + none = 'NONE' + + class Type: + metadata_creation = 'METADATA_CREATION' + metadata_update = 'METADATA_UPDATE' + stats_milestone = 'STATS_MILESTONE' + stats_change = 'STATS_CHANGE' + + _field_types = { + 'field': 'string', + 'operator': 'Operator', + 'type': 'Type', + 'value': 'Object', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + field_enum_info['Operator'] = AdRuleTrigger.Operator.__dict__.values() + field_enum_info['Type'] = AdRuleTrigger.Type.__dict__.values() + return field_enum_info diff --git a/facebookads/adobjects/adsactionstats.py b/facebookads/adobjects/adsactionstats.py index 5232fcec..f7801905 100644 --- a/facebookads/adobjects/adsactionstats.py +++ b/facebookads/adobjects/adsactionstats.py @@ -55,6 +55,7 @@ class Field(AbstractObject.Field): action_type = 'action_type' action_video_sound = 'action_video_sound' action_video_type = 'action_video_type' + inline = 'inline' value = 'value' _field_types = { @@ -75,6 +76,7 @@ class Field(AbstractObject.Field): 'action_type': 'string', 'action_video_sound': 'string', 'action_video_type': 'string', + 'inline': 'string', 'value': 'string', } diff --git a/facebookads/adobjects/adset.py b/facebookads/adobjects/adset.py index ecff5a54..0c9a8a40 100644 --- a/facebookads/adobjects/adset.py +++ b/facebookads/adobjects/adset.py @@ -59,16 +59,16 @@ class Field(AbstractObject.Field): created_time = 'created_time' creative_sequence = 'creative_sequence' daily_budget = 'daily_budget' + destination_type = 'destination_type' effective_status = 'effective_status' end_time = 'end_time' - frequency_cap = 'frequency_cap' - frequency_cap_reset_period = 'frequency_cap_reset_period' frequency_control_specs = 'frequency_control_specs' + full_funnel_exploration_mode = 'full_funnel_exploration_mode' id = 'id' + instagram_actor_id = 'instagram_actor_id' is_autobid = 'is_autobid' is_average_price_pacing = 'is_average_price_pacing' lifetime_budget = 'lifetime_budget' - lifetime_frequency_cap = 'lifetime_frequency_cap' lifetime_imps = 'lifetime_imps' name = 'name' optimization_goal = 'optimization_goal' @@ -103,6 +103,7 @@ class BillingEvent: video_views = 'VIDEO_VIEWS' mrc_video_views = 'MRC_VIDEO_VIEWS' completed_video_views = 'COMPLETED_VIDEO_VIEWS' + video_views_15s = 'VIDEO_VIEWS_15S' class ConfiguredStatus: active = 'ACTIVE' @@ -126,6 +127,7 @@ class OptimizationGoal: none = 'NONE' app_installs = 'APP_INSTALLS' brand_awareness = 'BRAND_AWARENESS' + ad_recall_lift = 'AD_RECALL_LIFT' clicks = 'CLICKS' engaged_users = 'ENGAGED_USERS' event_responses = 'EVENT_RESPONSES' @@ -170,6 +172,13 @@ class DatePreset: this_week_sun_today = 'this_week_sun_today' this_year = 'this_year' + class DestinationType: + undefined = 'UNDEFINED' + website = 'WEBSITE' + app = 'APP' + messenger = 'MESSENGER' + applinks_automatic = 'APPLINKS_AUTOMATIC' + class ExecutionOptions: validate_only = 'validate_only' include_recommendations = 'include_recommendations' @@ -178,6 +187,11 @@ class Operator: all = 'ALL' any = 'ANY' + class FullFunnelExplorationMode: + none_exploration = 'NONE_EXPLORATION' + limited_exploration = 'LIMITED_EXPLORATION' + extended_exploration = 'EXTENDED_EXPLORATION' + # @deprecated get_endpoint function is deprecated @classmethod def get_endpoint(cls): @@ -252,6 +266,7 @@ def api_update(self, fields=None, params=None, batch=None, pending=False): 'creative_sequence': 'list', 'daily_budget': 'unsigned int', 'daily_imps': 'unsigned int', + 'destination_type': 'destination_type_enum', 'end_time': 'datetime', 'execution_options': 'list', 'is_autobid': 'bool', @@ -272,6 +287,7 @@ def api_update(self, fields=None, params=None, batch=None, pending=False): } enums = { 'billing_event_enum': AdSet.BillingEvent.__dict__.values(), + 'destination_type_enum': AdSet.DestinationType.__dict__.values(), 'execution_options_enum': AdSet.ExecutionOptions.__dict__.values(), 'optimization_goal_enum': AdSet.OptimizationGoal.__dict__.values(), 'status_enum': AdSet.Status.__dict__.values(), @@ -712,16 +728,16 @@ def get_targeting_sentence_lines(self, fields=None, params=None, batch=None, pen 'created_time': 'datetime', 'creative_sequence': 'list', 'daily_budget': 'string', + 'destination_type': 'string', 'effective_status': 'EffectiveStatus', 'end_time': 'datetime', - 'frequency_cap': 'unsigned int', - 'frequency_cap_reset_period': 'unsigned int', 'frequency_control_specs': 'list', + 'full_funnel_exploration_mode': 'string', 'id': 'string', + 'instagram_actor_id': 'string', 'is_autobid': 'bool', 'is_average_price_pacing': 'bool', 'lifetime_budget': 'string', - 'lifetime_frequency_cap': 'unsigned int', 'lifetime_imps': 'int', 'name': 'string', 'optimization_goal': 'OptimizationGoal', @@ -755,6 +771,8 @@ def _get_field_enum_info(cls): field_enum_info['OptimizationGoal'] = AdSet.OptimizationGoal.__dict__.values() field_enum_info['Status'] = AdSet.Status.__dict__.values() field_enum_info['DatePreset'] = AdSet.DatePreset.__dict__.values() + field_enum_info['DestinationType'] = AdSet.DestinationType.__dict__.values() field_enum_info['ExecutionOptions'] = AdSet.ExecutionOptions.__dict__.values() field_enum_info['Operator'] = AdSet.Operator.__dict__.values() + field_enum_info['FullFunnelExplorationMode'] = AdSet.FullFunnelExplorationMode.__dict__.values() return field_enum_info diff --git a/facebookads/adobjects/adsinsights.py b/facebookads/adobjects/adsinsights.py index 0fcf75dd..bd42e5fb 100644 --- a/facebookads/adobjects/adsinsights.py +++ b/facebookads/adobjects/adsinsights.py @@ -40,6 +40,7 @@ def __init__(self, api=None): self._api = api class Field(AbstractObject.Field): + account_currency = 'account_currency' account_id = 'account_id' account_name = 'account_name' action_values = 'action_values' @@ -105,7 +106,6 @@ class Field(AbstractObject.Field): unique_outbound_clicks_ctr = 'unique_outbound_clicks_ctr' unique_social_clicks = 'unique_social_clicks' video_10_sec_watched_actions = 'video_10_sec_watched_actions' - video_15_sec_watched_actions = 'video_15_sec_watched_actions' video_30_sec_watched_actions = 'video_30_sec_watched_actions' video_avg_percent_watched_actions = 'video_avg_percent_watched_actions' video_avg_time_watched_actions = 'video_avg_time_watched_actions' @@ -220,6 +220,7 @@ def get_endpoint(cls): return 'insights' _field_types = { + 'account_currency': 'string', 'account_id': 'string', 'account_name': 'string', 'action_values': 'list', @@ -285,7 +286,6 @@ def get_endpoint(cls): 'unique_outbound_clicks_ctr': 'list', 'unique_social_clicks': 'string', 'video_10_sec_watched_actions': 'list', - 'video_15_sec_watched_actions': 'list', 'video_30_sec_watched_actions': 'list', 'video_avg_percent_watched_actions': 'list', 'video_avg_time_watched_actions': 'list', diff --git a/facebookads/adobjects/business.py b/facebookads/adobjects/business.py index d504543c..a3ac6b38 100644 --- a/facebookads/adobjects/business.py +++ b/facebookads/adobjects/business.py @@ -163,39 +163,6 @@ def create_ad_account(self, fields=None, params=None, batch=None, pending=False) self.assure_call() return request.execute() - def create_ad_accounts(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.adaccount import AdAccount - param_types = { - 'access_type': 'access_type_enum', - 'adaccount_id': 'string', - 'permitted_roles': 'list', - } - enums = { - 'access_type_enum': AdAccount.AccessType.__dict__.values(), - 'permitted_roles_enum': AdAccount.PermittedRoles.__dict__.values(), - } - request = FacebookRequest( - node_id=self['id'], - method='POST', - endpoint='/adaccounts', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=AdAccount, - api_type='EDGE', - response_parser=ObjectParser(target_class=AdAccount, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_ads_pixels(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.adspixel import AdsPixel param_types = { @@ -283,123 +250,6 @@ def delete_apps(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() - def get_assigned_ad_accounts(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.adaccount import AdAccount - param_types = { - 'email': 'string', - 'user_id': 'int', - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/assigned_ad_accounts', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=AdAccount, - api_type='EDGE', - response_parser=ObjectParser(target_class=AdAccount, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - - def get_assigned_pages(self, fields=None, params=None, batch=None, pending=False): - param_types = { - 'email': 'string', - 'user_id': 'int', - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/assigned_pages', - 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) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - - def get_assigned_product_catalogs(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.productcatalog import ProductCatalog - param_types = { - 'email': 'string', - 'user_id': 'int', - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/assigned_product_catalogs', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=ProductCatalog, - api_type='EDGE', - response_parser=ObjectParser(target_class=ProductCatalog, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - - def get_client_ad_account_requests(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.businessadaccountrequest import BusinessAdAccountRequest - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/client_ad_account_requests', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=BusinessAdAccountRequest, - api_type='EDGE', - response_parser=ObjectParser(target_class=BusinessAdAccountRequest, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_client_ad_accounts(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.adaccount import AdAccount param_types = { @@ -428,34 +278,6 @@ def get_client_ad_accounts(self, fields=None, params=None, batch=None, pending=F self.assure_call() return request.execute() - def get_client_page_requests(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.businesspagerequest import BusinessPageRequest - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/client_page_requests', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=BusinessPageRequest, - api_type='EDGE', - response_parser=ObjectParser(target_class=BusinessPageRequest, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_client_pages(self, fields=None, params=None, batch=None, pending=False): param_types = { } @@ -609,6 +431,7 @@ def get_measurement_reports(self, fields=None, params=None, batch=None, pending= 'video_metrics_report', 'fruit_rollup_report', 'third_party_mta_report', + 'partner_lift_study_report', ], } request = FacebookRequest( @@ -644,6 +467,7 @@ def create_measurement_report(self, fields=None, params=None, batch=None, pendin 'video_metrics_report', 'fruit_rollup_report', 'third_party_mta_report', + 'partner_lift_study_report', ], } request = FacebookRequest( @@ -669,6 +493,7 @@ def create_measurement_report(self, fields=None, params=None, batch=None, pendin return request.execute() def get_offline_conversion_data_sets(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.offlineconversiondataset import OfflineConversionDataSet param_types = { } enums = { @@ -679,9 +504,9 @@ def get_offline_conversion_data_sets(self, fields=None, params=None, batch=None, endpoint='/offline_conversion_data_sets', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=OfflineConversionDataSet, api_type='EDGE', - response_parser=ObjectParser(target_class=AbstractCrudObject, api=self._api), + response_parser=ObjectParser(target_class=OfflineConversionDataSet, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -696,6 +521,7 @@ def get_offline_conversion_data_sets(self, fields=None, params=None, batch=None, return request.execute() def create_offline_conversion_data_set(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.offlineconversiondataset import OfflineConversionDataSet param_types = { 'auto_assign_to_new_accounts_only': 'bool', 'description': 'string', @@ -710,37 +536,9 @@ def create_offline_conversion_data_set(self, fields=None, params=None, batch=Non endpoint='/offline_conversion_data_sets', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=AbstractCrudObject, + target_class=OfflineConversionDataSet, 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) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - - def get_owned_ad_account_requests(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.legacybusinessadaccountrequest import LegacyBusinessAdAccountRequest - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/owned_ad_account_requests', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=LegacyBusinessAdAccountRequest, - api_type='EDGE', - response_parser=ObjectParser(target_class=LegacyBusinessAdAccountRequest, api=self._api), + response_parser=ObjectParser(target_class=OfflineConversionDataSet, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -809,34 +607,6 @@ def get_owned_instagram_accounts(self, fields=None, params=None, batch=None, pen self.assure_call() return request.execute() - def get_owned_page_requests(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.businesspagerequest import BusinessPageRequest - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/owned_page_requests', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=BusinessPageRequest, - api_type='EDGE', - response_parser=ObjectParser(target_class=BusinessPageRequest, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_owned_pages(self, fields=None, params=None, batch=None, pending=False): param_types = { } @@ -892,26 +662,21 @@ def get_owned_pixels(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() - def get_picture(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.profilepicturesource import ProfilePictureSource + def get_pending_client_ad_accounts(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.businessadaccountrequest import BusinessAdAccountRequest param_types = { - 'height': 'int', - 'redirect': 'bool', - 'type': 'type_enum', - 'width': 'int', } enums = { - 'type_enum': ProfilePictureSource.Type.__dict__.values(), } request = FacebookRequest( node_id=self['id'], method='GET', - endpoint='/picture', + endpoint='/pending_client_ad_accounts', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=ProfilePictureSource, + target_class=BusinessAdAccountRequest, api_type='EDGE', - response_parser=ObjectParser(target_class=ProfilePictureSource, api=self._api), + response_parser=ObjectParser(target_class=BusinessAdAccountRequest, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -925,8 +690,8 @@ def get_picture(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() - def get_product_catalogs(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.productcatalog import ProductCatalog + def get_pending_owned_ad_accounts(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.legacybusinessadaccountrequest import LegacyBusinessAdAccountRequest param_types = { } enums = { @@ -934,12 +699,12 @@ def get_product_catalogs(self, fields=None, params=None, batch=None, pending=Fal request = FacebookRequest( node_id=self['id'], method='GET', - endpoint='/product_catalogs', + endpoint='/pending_owned_ad_accounts', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=ProductCatalog, + target_class=LegacyBusinessAdAccountRequest, api_type='EDGE', - response_parser=ObjectParser(target_class=ProductCatalog, api=self._api), + response_parser=ObjectParser(target_class=LegacyBusinessAdAccountRequest, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -953,26 +718,26 @@ def get_product_catalogs(self, fields=None, params=None, batch=None, pending=Fal self.assure_call() return request.execute() - def create_product_catalog(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.productcatalog import ProductCatalog + def get_picture(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.profilepicturesource import ProfilePictureSource param_types = { - 'da_display_settings': 'Object', - 'flight_catalog_settings': 'map', - 'name': 'string', - 'vertical': 'vertical_enum', + 'height': 'int', + 'redirect': 'bool', + 'type': 'type_enum', + 'width': 'int', } enums = { - 'vertical_enum': ProductCatalog.Vertical.__dict__.values(), + 'type_enum': ProfilePictureSource.Type.__dict__.values(), } request = FacebookRequest( node_id=self['id'], - method='POST', - endpoint='/product_catalogs', + method='GET', + endpoint='/picture', api=self._api, param_checker=TypeChecker(param_types, enums), - target_class=ProductCatalog, + target_class=ProfilePictureSource, api_type='EDGE', - response_parser=ObjectParser(target_class=ProductCatalog, api=self._api), + response_parser=ObjectParser(target_class=ProfilePictureSource, api=self._api), ) request.add_params(params) request.add_fields(fields) @@ -1042,33 +807,6 @@ def get_shared_audience_permissions(self, fields=None, params=None, batch=None, self.assure_call() return request.execute() - def get_system_users(self, fields=None, params=None, batch=None, pending=False): - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/system_users', - 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) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def create_user_permission(self, fields=None, params=None, batch=None, pending=False): param_types = { 'email': 'string', diff --git a/facebookads/adobjects/campaign.py b/facebookads/adobjects/campaign.py index 52b8d3c7..02b481ac 100644 --- a/facebookads/adobjects/campaign.py +++ b/facebookads/adobjects/campaign.py @@ -47,6 +47,7 @@ def __init__(self, fbid=None, parent_id=None, api=None): class Field(AbstractObject.Field): account_id = 'account_id' adlabels = 'adlabels' + boosted_object_id = 'boosted_object_id' brand_lift_studies = 'brand_lift_studies' budget_rebalance_flag = 'budget_rebalance_flag' buying_type = 'buying_type' @@ -56,6 +57,8 @@ class Field(AbstractObject.Field): created_time = 'created_time' effective_status = 'effective_status' id = 'id' + kpi_custom_conversion_id = 'kpi_custom_conversion_id' + kpi_type = 'kpi_type' name = 'name' objective = 'objective' recommendations = 'recommendations' @@ -528,6 +531,7 @@ def get_insights_async(self, fields=None, params=None, batch=None, pending=False _field_types = { 'account_id': 'string', 'adlabels': 'list', + 'boosted_object_id': 'string', 'brand_lift_studies': 'list', 'budget_rebalance_flag': 'bool', 'buying_type': 'string', @@ -537,6 +541,8 @@ def get_insights_async(self, fields=None, params=None, batch=None, pending=False 'created_time': 'datetime', 'effective_status': 'EffectiveStatus', 'id': 'string', + 'kpi_custom_conversion_id': 'string', + 'kpi_type': 'string', 'name': 'string', 'objective': 'string', 'recommendations': 'list', diff --git a/facebookads/adobjects/conversionactionquery.py b/facebookads/adobjects/conversionactionquery.py index 3c75f433..55d0eaca 100644 --- a/facebookads/adobjects/conversionactionquery.py +++ b/facebookads/adobjects/conversionactionquery.py @@ -60,7 +60,6 @@ class Field(AbstractObject.Field): field_post_object = 'post.object' field_post_object_wall = 'post.object.wall' field_post_wall = 'post.wall' - product_set_id = 'product_set_id' question = 'question' field_question_creator = 'question.creator' response = 'response' @@ -89,7 +88,6 @@ class Field(AbstractObject.Field): 'post.object': 'list', 'post.object.wall': 'list', 'post.wall': 'list', - 'product_set_id': 'list', 'question': 'list', 'question.creator': 'list', 'response': 'list', diff --git a/facebookads/adobjects/customaudience.py b/facebookads/adobjects/customaudience.py index f607b3c8..37992aa1 100644 --- a/facebookads/adobjects/customaudience.py +++ b/facebookads/adobjects/customaudience.py @@ -65,6 +65,7 @@ class Field(AbstractObject.Field): time_content_updated = 'time_content_updated' time_created = 'time_created' time_updated = 'time_updated' + allowed_domains = 'allowed_domains' claim_objective = 'claim_objective' content_type = 'content_type' dataset_id = 'dataset_id' @@ -85,6 +86,7 @@ class ClaimObjective: home_listing = 'HOME_LISTING' product = 'PRODUCT' travel = 'TRAVEL' + vehicle = 'VEHICLE' class ContentType: auto_offer = 'AUTO_OFFER' @@ -92,6 +94,7 @@ class ContentType: flight = 'FLIGHT' home_listing = 'HOME_LISTING' hotel = 'HOTEL' + vehicle = 'VEHICLE' class Subtype: custom = 'CUSTOM' @@ -198,6 +201,7 @@ def api_get(self, fields=None, params=None, batch=None, pending=False): def api_update(self, fields=None, params=None, batch=None, pending=False): param_types = { + 'allowed_domains': 'list', 'claim_objective': 'claim_objective_enum', 'content_type': 'content_type_enum', 'description': 'string', @@ -495,6 +499,7 @@ def create_user(self, fields=None, params=None, batch=None, pending=False): 'time_content_updated': 'unsigned int', 'time_created': 'unsigned int', 'time_updated': 'unsigned int', + 'allowed_domains': 'list', 'claim_objective': 'ClaimObjective', 'content_type': 'ContentType', 'dataset_id': 'string', diff --git a/facebookads/adobjects/customaudiencedatasource.py b/facebookads/adobjects/customaudiencedatasource.py index 29fa58c3..5034f2be 100644 --- a/facebookads/adobjects/customaudiencedatasource.py +++ b/facebookads/adobjects/customaudiencedatasource.py @@ -60,6 +60,11 @@ class SubType: video_events = 'VIDEO_EVENTS' web_pixel_combination_events = 'WEB_PIXEL_COMBINATION_EVENTS' platform = 'PLATFORM' + multi_data_events = 'MULTI_DATA_EVENTS' + ig_business_events = 'IG_BUSINESS_EVENTS' + store_visit_events = 'STORE_VISIT_EVENTS' + instant_article_events = 'INSTANT_ARTICLE_EVENTS' + fb_event_signals = 'FB_EVENT_SIGNALS' engagement_event_users = 'ENGAGEMENT_EVENT_USERS' custom_audience_users = 'CUSTOM_AUDIENCE_USERS' page_fans = 'PAGE_FANS' @@ -82,10 +87,13 @@ class SubType: page_smart_audience = 'PAGE_SMART_AUDIENCE' multicountry_combination = 'MULTICOUNTRY_COMBINATION' platform_users = 'PLATFORM_USERS' + multi_event_source = 'MULTI_EVENT_SOURCE' + smart_audience = 'SMART_AUDIENCE' mail_chimp_email_hashes = 'MAIL_CHIMP_EMAIL_HASHES' constant_contacts_email_hashes = 'CONSTANT_CONTACTS_EMAIL_HASHES' copy_paste_email_hashes = 'COPY_PASTE_EMAIL_HASHES' contact_importer = 'CONTACT_IMPORTER' + data_file = 'DATA_FILE' class Type: unknown = 'UNKNOWN' diff --git a/facebookads/adobjects/customconversion.py b/facebookads/adobjects/customconversion.py index 00985b08..9fab8efe 100644 --- a/facebookads/adobjects/customconversion.py +++ b/facebookads/adobjects/customconversion.py @@ -45,6 +45,7 @@ class Field(AbstractObject.Field): aggregation_rule = 'aggregation_rule' creation_time = 'creation_time' custom_event_type = 'custom_event_type' + data_sources = 'data_sources' default_conversion_value = 'default_conversion_value' description = 'description' event_source_type = 'event_source_type' @@ -292,6 +293,7 @@ def get_stats(self, fields=None, params=None, batch=None, pending=False): 'aggregation_rule': 'string', 'creation_time': 'datetime', 'custom_event_type': 'CustomEventType', + 'data_sources': 'list', 'default_conversion_value': 'int', 'description': 'string', 'event_source_type': 'string', @@ -300,7 +302,7 @@ def get_stats(self, fields=None, params=None, batch=None, pending=False): 'is_archived': 'bool', 'last_fired_time': 'datetime', 'name': 'string', - 'offline_conversion_data_set': 'Object', + 'offline_conversion_data_set': 'OfflineConversionDataSet', 'pixel': 'AdsPixel', 'retention_days': 'unsigned int', 'rule': 'string', diff --git a/facebookads/adobjects/event.py b/facebookads/adobjects/event.py index 48f3eaa2..82496636 100644 --- a/facebookads/adobjects/event.py +++ b/facebookads/adobjects/event.py @@ -49,6 +49,7 @@ class Field(AbstractObject.Field): declined_count = 'declined_count' description = 'description' end_time = 'end_time' + event_times = 'event_times' guest_list_enabled = 'guest_list_enabled' id = 'id' interested_count = 'interested_count' @@ -62,6 +63,7 @@ class Field(AbstractObject.Field): owner = 'owner' parent_group = 'parent_group' place = 'place' + scheduled_publish_time = 'scheduled_publish_time' start_time = 'start_time' ticket_uri = 'ticket_uri' ticketing_privacy_uri = 'ticketing_privacy_uri' @@ -145,6 +147,7 @@ def get_picture(self, fields=None, params=None, batch=None, pending=False): 'declined_count': 'int', 'description': 'string', 'end_time': 'string', + 'event_times': 'list', 'guest_list_enabled': 'bool', 'id': 'string', 'interested_count': 'int', @@ -158,6 +161,7 @@ def get_picture(self, fields=None, params=None, batch=None, pending=False): 'owner': 'Object', 'parent_group': 'Object', 'place': 'Object', + 'scheduled_publish_time': 'string', 'start_time': 'string', 'ticket_uri': 'string', 'ticketing_privacy_uri': 'string', diff --git a/facebookads/adobjects/leadgenform.py b/facebookads/adobjects/leadgenform.py index 8808b561..3d94c3b9 100644 --- a/facebookads/adobjects/leadgenform.py +++ b/facebookads/adobjects/leadgenform.py @@ -44,12 +44,12 @@ class Field(AbstractObject.Field): allow_organic_lead = 'allow_organic_lead' block_display_for_non_targeted_viewer = 'block_display_for_non_targeted_viewer' context_card = 'context_card' - continued_flow_request_method = 'continued_flow_request_method' created_time = 'created_time' creator = 'creator' creator_id = 'creator_id' cusomized_tcpa_content = 'cusomized_tcpa_content' expired_leads_count = 'expired_leads_count' + extra_details = 'extra_details' follow_up_action_text = 'follow_up_action_text' follow_up_action_url = 'follow_up_action_url' id = 'id' @@ -65,9 +65,11 @@ class Field(AbstractObject.Field): page_id = 'page_id' privacy_policy_url = 'privacy_policy_url' qualifiers = 'qualifiers' + question_page_custom_headline = 'question_page_custom_headline' questions = 'questions' status = 'status' tcpa_compliance = 'tcpa_compliance' + thank_you_page = 'thank_you_page' # @deprecated get_endpoint function is deprecated @classmethod @@ -189,12 +191,12 @@ def create_test_lead(self, fields=None, params=None, batch=None, pending=False): 'allow_organic_lead': 'bool', 'block_display_for_non_targeted_viewer': 'bool', 'context_card': 'Object', - 'continued_flow_request_method': 'string', 'created_time': 'datetime', 'creator': 'User', 'creator_id': 'int', 'cusomized_tcpa_content': 'string', 'expired_leads_count': 'unsigned int', + 'extra_details': 'list', 'follow_up_action_text': 'string', 'follow_up_action_url': 'string', 'id': 'string', @@ -210,9 +212,11 @@ def create_test_lead(self, fields=None, params=None, batch=None, pending=False): 'page_id': 'string', 'privacy_policy_url': 'string', 'qualifiers': 'list', + 'question_page_custom_headline': 'string', 'questions': 'list', 'status': 'string', 'tcpa_compliance': 'bool', + 'thank_you_page': 'Object', } @classmethod diff --git a/facebookads/adobjects/leadgenquestion.py b/facebookads/adobjects/leadgenquestion.py index fd8ef644..6eb29c97 100644 --- a/facebookads/adobjects/leadgenquestion.py +++ b/facebookads/adobjects/leadgenquestion.py @@ -19,6 +19,10 @@ # DEALINGS IN THE SOFTWARE. from facebookads.adobjects.abstractobject import AbstractObject +from facebookads.adobjects.abstractcrudobject import AbstractCrudObject +from facebookads.adobjects.objectparser import ObjectParser +from facebookads.api import FacebookRequest +from facebookads.typechecker import TypeChecker """ This class is auto-generated. @@ -29,27 +33,57 @@ """ class LeadGenQuestion( - AbstractObject, + AbstractCrudObject, ): - def __init__(self, api=None): - super(LeadGenQuestion, self).__init__() + def __init__(self, fbid=None, parent_id=None, api=None): self._isLeadGenQuestion = True - self._api = api + super(LeadGenQuestion, self).__init__(fbid, parent_id, api) class Field(AbstractObject.Field): conditional_questions_choices = 'conditional_questions_choices' conditional_questions_group_id = 'conditional_questions_group_id' dependent_conditional_questions = 'dependent_conditional_questions' + id = 'id' + inline_context = 'inline_context' key = 'key' label = 'label' options = 'options' type = 'type' + def api_get(self, fields=None, params=None, batch=None, pending=False): + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=LeadGenQuestion, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + _field_types = { 'conditional_questions_choices': 'list', 'conditional_questions_group_id': 'string', 'dependent_conditional_questions': 'list', + 'id': 'string', + 'inline_context': 'string', 'key': 'string', 'label': 'string', 'options': 'list', diff --git a/facebookads/adobjects/offlineconversiondataset.py b/facebookads/adobjects/offlineconversiondataset.py new file mode 100644 index 00000000..2ac9d240 --- /dev/null +++ b/facebookads/adobjects/offlineconversiondataset.py @@ -0,0 +1,326 @@ +# Copyright 2014 Facebook, Inc. + +# You are hereby granted a non-exclusive, worldwide, royalty-free license to +# use, copy, modify, and distribute this software in source code or binary +# form for use in connection with the web services and APIs provided by +# Facebook. + +# As with any software that integrates with the Facebook platform, your use +# of this software is subject to the Facebook Developer Principles and +# Policies [http://developers.facebook.com/policy/]. This copyright notice +# shall be included in all copies or substantial portions of the software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + +from facebookads.adobjects.abstractobject import AbstractObject +from facebookads.adobjects.abstractcrudobject import AbstractCrudObject +from facebookads.adobjects.objectparser import ObjectParser +from facebookads.api import FacebookRequest +from facebookads.typechecker import TypeChecker + +""" +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 OfflineConversionDataSet( + AbstractCrudObject, +): + + def __init__(self, fbid=None, parent_id=None, api=None): + self._isOfflineConversionDataSet = True + super(OfflineConversionDataSet, self).__init__(fbid, parent_id, api) + + class Field(AbstractObject.Field): + attribute_stats = 'attribute_stats' + business = 'business' + config = 'config' + creation_time = 'creation_time' + description = 'description' + duplicate_entries = 'duplicate_entries' + enable_auto_assign_to_accounts = 'enable_auto_assign_to_accounts' + event_stats = 'event_stats' + event_time_max = 'event_time_max' + event_time_min = 'event_time_min' + id = 'id' + is_restricted_use = 'is_restricted_use' + last_upload_app = 'last_upload_app' + matched_entries = 'matched_entries' + matched_unique_users = 'matched_unique_users' + name = 'name' + usage = 'usage' + valid_entries = 'valid_entries' + auto_assign_to_new_accounts_only = 'auto_assign_to_new_accounts_only' + + # @deprecated get_endpoint function is deprecated + @classmethod + def get_endpoint(cls): + return 'offline_conversion_data_sets' + + def api_create(self, parent_id, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.business import Business + return Business(api=self._api, fbid=parent_id).create_offline_conversion_data_set(fields, params, batch, pending) + + def api_get(self, fields=None, params=None, batch=None, pending=False): + param_types = { + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=OfflineConversionDataSet, + api_type='NODE', + response_parser=ObjectParser(reuse_object=self), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_activities(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'business_id': 'string', + 'end_time': 'datetime', + 'event_type': 'event_type_enum', + 'start_time': 'datetime', + } + enums = { + 'event_type_enum': [ + 'dataset_assign_to_adacct', + 'dataset_autotrack_on_adacct', + 'dataset_disable_autotrack_on_adacct', + 'dataset_unassign_from_adacct', + 'add_dataset_to_business', + 'add_user_to_dataset', + 'remove_user_from_dataset', + 'update_user_role_on_dataset', + 'create_custom_conversion', + 'update_custom_conversion', + 'create_custom_audience', + 'share_custom_audience', + 'unshare_custom_audience', + ], + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/activities', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_ad_accounts(self, fields=None, params=None, batch=None, pending=False): + from facebookads.adobjects.adaccount import AdAccount + param_types = { + 'business': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/adaccounts', + api=self._api, + param_checker=TypeChecker(param_types, enums), + target_class=AdAccount, + api_type='EDGE', + response_parser=ObjectParser(target_class=AdAccount, api=self._api), + ) + request.add_params(params) + request.add_fields(fields) + + if batch is not None: + request.add_to_batch(batch) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_ad_account(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'account_id': 'string', + 'auto_track_for_ads': 'bool', + 'business': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/adaccounts', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_event(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'data': 'list', + 'namespace_id': 'string', + 'progress': 'Object', + 'upload_id': 'string', + 'upload_tag': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/events', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_stats(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'aggr_time': 'aggr_time_enum', + 'end': 'int', + 'skip_empty_values': 'bool', + 'start': 'int', + 'user_timezone_id': 'unsigned int', + } + enums = { + 'aggr_time_enum': [ + 'upload_time', + 'event_time', + ], + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/stats', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def get_uploads(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'upload_tag': 'string', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/uploads', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + _field_types = { + 'attribute_stats': 'string', + 'business': 'Business', + 'config': 'string', + 'creation_time': 'datetime', + 'description': 'string', + 'duplicate_entries': 'int', + 'enable_auto_assign_to_accounts': 'bool', + 'event_stats': 'string', + 'event_time_max': 'int', + 'event_time_min': 'int', + 'id': 'string', + 'is_restricted_use': 'bool', + 'last_upload_app': 'string', + 'matched_entries': 'int', + 'matched_unique_users': 'int', + 'name': 'string', + 'usage': 'Object', + 'valid_entries': 'int', + 'auto_assign_to_new_accounts_only': 'bool', + } + + @classmethod + def _get_field_enum_info(cls): + field_enum_info = {} + return field_enum_info diff --git a/facebookads/adobjects/productcatalog.py b/facebookads/adobjects/productcatalog.py index c2b60699..cfbb63f1 100644 --- a/facebookads/adobjects/productcatalog.py +++ b/facebookads/adobjects/productcatalog.py @@ -57,21 +57,11 @@ class Field(AbstractObject.Field): qualified_product_count = 'qualified_product_count' vertical = 'vertical' - class Vertical: - commerce = 'commerce' - destinations = 'destinations' - flights = 'flights' - hotels = 'hotels' - # @deprecated get_endpoint function is deprecated @classmethod def get_endpoint(cls): return 'product_catalogs' - def api_create(self, parent_id, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.business import Business - return Business(api=self._api, fbid=parent_id).create_product_catalog(fields, params, batch, pending) - def api_delete(self, fields=None, params=None, batch=None, pending=False): param_types = { } @@ -358,6 +348,77 @@ def get_flights(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() + def get_home_listings(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'bulk_pagination': 'bool', + 'filter': 'Object', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='GET', + endpoint='/home_listings', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + + def create_home_listing(self, fields=None, params=None, batch=None, pending=False): + param_types = { + 'address': 'Object', + 'availability': 'string', + 'currency': 'string', + 'description': 'string', + 'home_listing_id': 'string', + 'images': 'list', + 'listing_type': 'string', + 'name': 'string', + 'num_baths': 'float', + 'num_beds': 'float', + 'num_units': 'float', + 'price': 'float', + 'property_type': 'string', + 'url': 'string', + 'year_built': 'unsigned int', + } + enums = { + } + request = FacebookRequest( + node_id=self['id'], + method='POST', + endpoint='/home_listings', + 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) + return request + elif pending: + return request + else: + self.assure_call() + return request.execute() + def get_hotel_rooms_batch(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.productcataloghotelroomsbatch import ProductCatalogHotelRoomsBatch param_types = { @@ -596,6 +657,7 @@ def create_product_feed(self, fields=None, params=None, batch=None, pending=Fals 'quoted_fields_mode': 'quoted_fields_mode_enum', 'rules': 'list', 'schedule': 'string', + 'update_schedule': 'string', } enums = { 'delimiter_enum': ProductFeed.Delimiter.__dict__.values(), @@ -939,6 +1001,7 @@ def create_video(self, fields=None, params=None, batch=None, pending=False): 'original_projection_type_enum': [ 'equirectangular', 'cubemap', + 'equiangular_cubemap', ], 'swap_mode_enum': [ 'replace', @@ -996,5 +1059,4 @@ def create_video(self, fields=None, params=None, batch=None, pending=False): @classmethod def _get_field_enum_info(cls): field_enum_info = {} - field_enum_info['Vertical'] = ProductCatalog.Vertical.__dict__.values() return field_enum_info diff --git a/facebookads/adobjects/productfeed.py b/facebookads/adobjects/productfeed.py index db7dde76..7ceec586 100644 --- a/facebookads/adobjects/productfeed.py +++ b/facebookads/adobjects/productfeed.py @@ -55,6 +55,7 @@ class Field(AbstractObject.Field): qualified_product_count = 'qualified_product_count' quoted_fields_mode = 'quoted_fields_mode' schedule = 'schedule' + update_schedule = 'update_schedule' rules = 'rules' class Delimiter: @@ -151,6 +152,7 @@ def api_update(self, fields=None, params=None, batch=None, pending=False): 'name': 'string', 'quoted_fields_mode': 'quoted_fields_mode_enum', 'schedule': 'string', + 'update_schedule': 'string', } enums = { 'delimiter_enum': ProductFeed.Delimiter.__dict__.values(), @@ -285,6 +287,7 @@ def create_upload(self, fields=None, params=None, batch=None, pending=False): 'qualified_product_count': 'unsigned int', 'quoted_fields_mode': 'QuotedFieldsMode', 'schedule': 'ProductFeedSchedule', + 'update_schedule': 'ProductFeedSchedule', 'rules': 'list', } diff --git a/facebookads/adobjects/productfeedupload.py b/facebookads/adobjects/productfeedupload.py index ea5e9089..ec70464d 100644 --- a/facebookads/adobjects/productfeedupload.py +++ b/facebookads/adobjects/productfeedupload.py @@ -50,6 +50,8 @@ class Field(AbstractObject.Field): class InputMethod: manual_upload = 'Manual Upload' server_fetch = 'Server Fetch' + reupload_last_file = 'Reupload Last File' + user_initiated_server_fetch = 'User initiated server fetch' # @deprecated get_endpoint function is deprecated @classmethod diff --git a/facebookads/adobjects/productgroup.py b/facebookads/adobjects/productgroup.py index e23b8a51..d14d765f 100644 --- a/facebookads/adobjects/productgroup.py +++ b/facebookads/adobjects/productgroup.py @@ -137,34 +137,6 @@ def api_update(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() - def get_product_sets(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.productset import ProductSet - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/product_sets', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=ProductSet, - api_type='EDGE', - response_parser=ObjectParser(target_class=ProductSet, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_products(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.productitem import ProductItem param_types = { diff --git a/facebookads/adobjects/productset.py b/facebookads/adobjects/productset.py index ddec817f..f87b2089 100644 --- a/facebookads/adobjects/productset.py +++ b/facebookads/adobjects/productset.py @@ -140,34 +140,6 @@ def api_update(self, fields=None, params=None, batch=None, pending=False): self.assure_call() return request.execute() - def get_product_groups(self, fields=None, params=None, batch=None, pending=False): - from facebookads.adobjects.productgroup import ProductGroup - param_types = { - } - enums = { - } - request = FacebookRequest( - node_id=self['id'], - method='GET', - endpoint='/product_groups', - api=self._api, - param_checker=TypeChecker(param_types, enums), - target_class=ProductGroup, - api_type='EDGE', - response_parser=ObjectParser(target_class=ProductGroup, api=self._api), - ) - request.add_params(params) - request.add_fields(fields) - - if batch is not None: - request.add_to_batch(batch) - return request - elif pending: - return request - else: - self.assure_call() - return request.execute() - def get_products(self, fields=None, params=None, batch=None, pending=False): from facebookads.adobjects.productitem import ProductItem param_types = { diff --git a/facebookads/adobjects/reachestimate.py b/facebookads/adobjects/reachestimate.py index e69771d6..9cd9db8b 100644 --- a/facebookads/adobjects/reachestimate.py +++ b/facebookads/adobjects/reachestimate.py @@ -46,6 +46,7 @@ class OptimizeFor: none = 'NONE' app_installs = 'APP_INSTALLS' brand_awareness = 'BRAND_AWARENESS' + ad_recall_lift = 'AD_RECALL_LIFT' clicks = 'CLICKS' engaged_users = 'ENGAGED_USERS' event_responses = 'EVENT_RESPONSES' diff --git a/facebookads/adobjects/reachfrequencyprediction.py b/facebookads/adobjects/reachfrequencyprediction.py index d2c97692..3d2be645 100644 --- a/facebookads/adobjects/reachfrequencyprediction.py +++ b/facebookads/adobjects/reachfrequencyprediction.py @@ -161,7 +161,7 @@ def api_get(self, fields=None, params=None, batch=None, pending=False): 'interval_frequency_cap': 'unsigned int', 'interval_frequency_cap_reset_period': 'unsigned int', 'name': 'string', - 'pause_periods': 'string', + 'pause_periods': 'list', 'placement_breakdown': 'Object', 'prediction_mode': 'unsigned int', 'prediction_progress': 'unsigned int', diff --git a/facebookads/adobjects/targeting.py b/facebookads/adobjects/targeting.py index 6bb90fd5..9f312399 100644 --- a/facebookads/adobjects/targeting.py +++ b/facebookads/adobjects/targeting.py @@ -54,6 +54,7 @@ class Field(AbstractObject.Field): country_groups = 'country_groups' custom_audiences = 'custom_audiences' device_platforms = 'device_platforms' + direct_install_devices = 'direct_install_devices' dynamic_audience_ids = 'dynamic_audience_ids' education_majors = 'education_majors' education_schools = 'education_schools' @@ -102,7 +103,6 @@ class Field(AbstractObject.Field): moms = 'moms' net_worth = 'net_worth' office_type = 'office_type' - page_types = 'page_types' place_page_set_ids = 'place_page_set_ids' political_views = 'political_views' politics = 'politics' @@ -151,6 +151,7 @@ class EffectiveDevicePlatforms: 'country_groups': 'list', 'custom_audiences': 'list', 'device_platforms': 'list', + 'direct_install_devices': 'bool', 'dynamic_audience_ids': 'list', 'education_majors': 'list', 'education_schools': 'list', @@ -199,7 +200,6 @@ class EffectiveDevicePlatforms: 'moms': 'list', 'net_worth': 'list', 'office_type': 'list', - 'page_types': 'list', 'place_page_set_ids': 'list', 'political_views': 'list', 'politics': 'list', diff --git a/facebookads/apiconfig.py b/facebookads/apiconfig.py index 1eab3c03..881cbd95 100644 --- a/facebookads/apiconfig.py +++ b/facebookads/apiconfig.py @@ -19,7 +19,7 @@ # DEALINGS IN THE SOFTWARE. ads_api_config = { - 'API_VERSION': 'v2.10', - 'SDK_VERSION': 'v2.10.1', + 'API_VERSION': 'v2.11', + 'SDK_VERSION': 'v2.11.1', 'STRICT_MODE': False } diff --git a/setup.py b/setup.py index 25f0fcbc..43f5c6ed 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ requirements_filename = os.path.join(this_dir, 'requirements.txt') PACKAGE_NAME = 'facebookads' -PACKAGE_VERSION = '2.10.1' +PACKAGE_VERSION = '2.11.1' PACKAGE_AUTHOR = 'Facebook' PACKAGE_AUTHOR_EMAIL = '' PACKAGE_URL = 'https://github.com/facebook/facebook-python-ads-sdk'