Skip to content

Commit c907eb8

Browse files
satwikareddy3facebook-github-bot
authored andcommitted
Auto-generated python SDK code update
Summary: ignore-conflict-markers Reviewed By: honz, liliarizona Differential Revision: D76757337 fbshipit-source-id: 08f5610cf418edfe99a77a8748ccbcf3f425fc6f
1 parent 1dc7070 commit c907eb8

File tree

101 files changed

+2535
-993
lines changed

Some content is hidden

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

101 files changed

+2535
-993
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
## v23.0.0
8+
9+
710
### Added
811
- Added classes for tech providers
912
-- CRUD operations for ThirdPartyAccountManager
@@ -133,3 +136,4 @@ All notable changes to this project will be documented in this file.
133136
### Deprecated
134137
- `parent_id` in `AbstractCrudObject`.
135138
- Function `remote_create`, `remote_read`, `remote_update` and `remote_delete` for `AbstractCrudObject`. Check out our [recommended way](https://github.com/facebook/facebook-python-business-sdk#exploring-the-graph) to make API call with python SDK.
139+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
4+
# This source code is licensed under the license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
import time
8+
9+
from facebook_business.adobjects.serverside.action_source import ActionSource
10+
from facebook_business.adobjects.serverside.content import Content
11+
from facebook_business.adobjects.serverside.custom_data import CustomData
12+
from facebook_business.adobjects.serverside.event import Event
13+
from facebook_business.adobjects.serverside.event_request import EventRequest
14+
from facebook_business.adobjects.serverside.user_data import UserData
15+
from facebook_business.api import FacebookAdsApi
16+
17+
access_token = '<ACCESS_TOKEN>'
18+
pixel_id = 'ADS_PIXEL_ID>'
19+
20+
FacebookAdsApi.init(access_token=access_token)
21+
22+
user_data = UserData(
23+
emails=['[email protected]'],
24+
phones=['12345678901', '14251234567'],
25+
lead_id=['525645896321548'],
26+
27+
)
28+
29+
custom_data = CustomData(
30+
custom_properties={'lead_event_source': 'Salesforce'},
31+
)
32+
33+
event = Event(
34+
event_name='QualifiedLead',
35+
event_time=int(time.time()),
36+
user_data=user_data,
37+
custom_data=custom_data,
38+
action_source=ActionSource.SYSTEM_GENERATED,
39+
)
40+
41+
events = [event]
42+
43+
event_request = EventRequest(
44+
events=events,
45+
pixel_id=pixel_id,
46+
)
47+
48+
event_response = event_request.execute()
49+
print(event_response)

facebook_business/__init__.py

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

10-
__version__ = '22.0.5'
10+
__version__ = '23.0.0'
1111
__all__ = ['session', 'api']

facebook_business/adobjects/ad.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ def create_copy(self, fields=None, params=None, batch=None, success=None, failur
429429
api_utils.warning('`success` and `failure` callback only work for batch call.')
430430
param_types = {
431431
'adset_id': 'string',
432+
'creative_parameters': 'AdCreative',
432433
'rename_options': 'Object',
433434
'status_option': 'status_option_enum',
434435
}
@@ -477,6 +478,7 @@ def get_insights(self, fields=None, params=None, is_async=False, batch=None, suc
477478
'fields': 'list<string>',
478479
'filtering': 'list<Object>',
479480
'level': 'level_enum',
481+
'limit': 'int',
480482
'product_id_limit': 'int',
481483
'sort': 'list<string>',
482484
'summary': 'list<string>',
@@ -538,6 +540,7 @@ def get_insights_async(self, fields=None, params=None, batch=None, success=None,
538540
'fields': 'list<string>',
539541
'filtering': 'list<Object>',
540542
'level': 'level_enum',
543+
'limit': 'int',
541544
'product_id_limit': 'int',
542545
'sort': 'list<string>',
543546
'summary': 'list<string>',

0 commit comments

Comments
 (0)