Skip to content

Commit 06c2125

Browse files
committed
update to version 11.12.4
1 parent e1dc96b commit 06c2125

File tree

14 files changed

+875
-819
lines changed

14 files changed

+875
-819
lines changed

HISTORY.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
.. :changelog:
22
33
Release History
4+
-----------
5+
11.12.4(2018-07-10)
6+
* Added a mapping for the Domain column in the Bulk file to the BulkExpandedTextAd object.
7+
* Limited the scope to bingads.manage for access token requests. Previously the default scope was used, which can vary if a user granted your app permissions to multiple scopes. The Bing Ads SDKs only support the bingads.manage scope.
8+
* Updated the Customer Management proxies to support LinkedAccountIds for agencies. For agency users the customer role can contain a list of linked accounts that the user can access as an agency on behalf of another customer.
9+
410
-----------
511
11.12.3(2018-06-10)
6-
Added support for Cooperative bidding e.g., added mappings for "Bid Boost Value", "Bid Option" and "Maximum Bid" fields via the BulkAdGroup.
7-
8-
Added mappings for the 'MSCLKID Auto Tagging Enabled" and "Tracking Tempalte" fields via the BulkAccount.
12+
* Added support for Cooperative bidding e.g., added mappings for "Bid Boost Value", "Bid Option" and "Maximum Bid" fields via the BulkAdGroup.
13+
* Added mappings for the 'MSCLKID Auto Tagging Enabled" and "Tracking Tempalte" fields via the BulkAccount.
914

1015
-----------
1116
11.12.2(2018-05-15)

bingads/authorization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ def request_oauth_tokens_by_refresh_token(self, refresh_token):
431431
grant_type='refresh_token',
432432
refresh_token=refresh_token,
433433
environment=self.environment,
434+
scope='bingads.manage',
434435
)
435436
if self.token_refreshed_callback is not None:
436437
self.token_refreshed_callback(self.oauth_tokens) # invoke the callback when token refreshed.

bingads/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
VERSION = '11.12.3'
2+
VERSION = '11.12.4'
33
BULK_FORMAT_VERSION_5 = '5.0'
44
BULK_FORMAT_VERSION_6 = '6.0'
55
WORKING_NAME = 'BingAdsSDKPython'

bingads/v11/bulk/bulk_service_manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ def submit_upload(self, submit_upload_parameters):
250250
request_id = response.RequestId
251251
upload_url = response.UploadUrl
252252

253+
if submit_upload_parameters.rename_upload_file_to_match_request_id:
254+
import os
255+
dir = os.path.dirname(submit_upload_parameters.upload_file_path)
256+
new_file_to_upload = os.path.join(dir, 'upload_' + request_id + '.csv')
257+
os.rename(submit_upload_parameters.upload_file_path, new_file_to_upload)
258+
submit_upload_parameters.upload_file_path = new_file_to_upload
259+
253260
self._upload_file_by_url(
254261
url=upload_url,
255262
upload_file_path=submit_upload_parameters.upload_file_path,

bingads/v11/bulk/entities/bulk_ads.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,19 @@ def expanded_text_ad(self, expanded_text_ad):
462462
),
463463
_SimpleBulkMapping(
464464
header=_StringTable.Path1,
465-
field_to_csv=lambda c: c.expanded_text_ad.Path1,
465+
field_to_csv=lambda c: bulk_optional_str(c.expanded_text_ad.Path1),
466466
csv_to_field=lambda c, v: setattr(c.expanded_text_ad, 'Path1', v)
467467
),
468468
_SimpleBulkMapping(
469469
header=_StringTable.Path2,
470-
field_to_csv=lambda c: c.expanded_text_ad.Path2,
470+
field_to_csv=lambda c: bulk_optional_str(c.expanded_text_ad.Path2),
471471
csv_to_field=lambda c, v: setattr(c.expanded_text_ad, 'Path2', v)
472472
),
473+
_SimpleBulkMapping(
474+
header=_StringTable.DisplayUrl,
475+
field_to_csv=lambda c: bulk_optional_str(c.expanded_text_ad.DisplayUrl),
476+
csv_to_field=lambda c, v: setattr(c.expanded_text_ad, 'DisplayUrl', v)
477+
),
473478
]
474479

475480
def process_mappings_from_row_values(self, row_values):

bingads/v11/bulk/upload_parameters.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def __init__(self,
1111
overwrite_result_file=False,
1212
compress_upload_file=True,
1313
response_mode='ErrorsAndResults',
14-
timeout_in_milliseconds=None):
14+
timeout_in_milliseconds=None,
15+
rename_upload_file_to_match_request_id=True):
1516
""" Initialize a new instance of this class.
1617
1718
:param result_file_directory: The directory where the file will be downloaded.
@@ -43,6 +44,7 @@ def __init__(self,
4344
upload_file_path=upload_file_path,
4445
compress_upload_file=compress_upload_file,
4546
response_mode=response_mode,
47+
rename_upload_file_to_match_request_id=rename_upload_file_to_match_request_id
4648
)
4749
self._timeout_in_milliseconds=timeout_in_milliseconds
4850

@@ -142,7 +144,8 @@ def __init__(self,
142144
upload_file_path,
143145
compress_upload_file=True,
144146
response_mode='ErrorsAndResults',
145-
timeout_in_milliseconds=None):
147+
timeout_in_milliseconds=None,
148+
rename_upload_file_to_match_request_id=True):
146149
""" Initialize a new instance of this class.
147150
148151
:param upload_file_path: The fully qualified local path of the upload file.
@@ -160,6 +163,15 @@ def __init__(self,
160163
self._compress_upload_file = compress_upload_file
161164
self._response_mode = response_mode
162165
self._timeout_in_milliseconds = timeout_in_milliseconds
166+
self._rename_upload_file_to_match_request_id=rename_upload_file_to_match_request_id
167+
168+
@property
169+
def rename_upload_file_to_match_request_id(self):
170+
""" rename the upload file to request id or not.
171+
172+
:rtype: boolean
173+
"""
174+
return self._rename_upload_file_to_match_request_id
163175

164176
@property
165177
def upload_file_path(self):

0 commit comments

Comments
 (0)