Skip to content

Commit

Permalink
version 12.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
qitia committed Apr 17, 2019
1 parent ec8e98f commit 8bf0280
Show file tree
Hide file tree
Showing 151 changed files with 28,867 additions and 422 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
.. :changelog:
Release History
-----------
12.13.1(2019-04-15)
+++++++++++++++++++
* Added support for Bing Ads API Version 13. For more information, see Migrating to Bing Ads API Version 13: https://docs.microsoft.com/en-us/bingads/guides/migration-guide?view=bingads-13.
* Updated version 12 service proxies to reflect recent interface changes. For details please see the Bing Ads API Release Notes: https://docs.microsoft.com/en-us/bingads/guides/release-notes?view=bingads-12.
* For both version 12 and 13, added a new Bulk property for Final Url Suffix i.e., added FinalUrlSuffix to the existing BulkAccount, BulkAdGroup, BulkCampaign, and BulkKeyword. For details about Final Url Suffix in the Bulk file, see the Release Notes:https://docs.microsoft.com/en-us/bingads/guides/release-notes?view=bingads-12#finalurlsuffix-march2019.

-----------
12.0.4(2019-03-15)
+++++++++++++++++++
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include *.rst *.py *.txt
include LICENSE

include bingads/v12/proxies/*xml
include bingads/v12/proxies/*xml
include bingads/v13/proxies/*xml
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bing Ads Python SDK
:target: https://pypi.python.org/pypi/bingads


The Bing Ads Python Software Development Kit (SDK) Version 12.0 enhances the experience of developing Bing Ads applications
The Bing Ads Python Software Development Kit (SDK) Version 12.13 enhances the experience of developing Bing Ads applications
with the Python programming language.
The SDK includes proxy classes for all Bing Ads API web services and abstracts the low level details of authentication with OAuth.
You can also read and write bulk files with the SDK BulkFileReader and BulkFileWriter,
Expand Down
2 changes: 1 addition & 1 deletion bingads/manifest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
VERSION = '12.0.4'
VERSION = '12.13.1'
BULK_FORMAT_VERSION_5 = '5.0'
BULK_FORMAT_VERSION_6 = '6.0'
WORKING_NAME = 'BingAdsSDKPython'
Expand Down
9 changes: 8 additions & 1 deletion bingads/service_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from suds.client import Client, Factory, WebFault, ObjectCache # noqa
from suds.client import Client, Factory, WebFault, ObjectCache # noqa

from .headerplugin import HeaderPlugin
from .authorization import *
Expand Down Expand Up @@ -198,6 +198,8 @@ def _format_version(version):
"""
if version == 'v12' or version == 12:
return 12
if version == 'v13' or version == 13:
return 13
raise ValueError(str.format('version error: [{0}] is not supported.', version))


Expand Down Expand Up @@ -297,6 +299,11 @@ def name(self):
_CAMPAIGN_OBJECT_FACTORY_V12 = _CAMPAIGN_MANAGEMENT_SERVICE_V12.factory
_CAMPAIGN_OBJECT_FACTORY_V12.object_cache = {}
_CAMPAIGN_OBJECT_FACTORY_V12.create_without_cache = _CAMPAIGN_OBJECT_FACTORY_V12.create
_CAMPAIGN_MANAGEMENT_SERVICE_V13 = Client(
'file:///' + pkg_resources.resource_filename('bingads', 'v13/proxies/campaign_management_service.xml'))
_CAMPAIGN_OBJECT_FACTORY_V13 = _CAMPAIGN_MANAGEMENT_SERVICE_V13.factory
_CAMPAIGN_OBJECT_FACTORY_V13.object_cache = {}
_CAMPAIGN_OBJECT_FACTORY_V13.create_without_cache = _CAMPAIGN_OBJECT_FACTORY_V13.create


def _suds_objects_deepcopy(origin):
Expand Down
87 changes: 86 additions & 1 deletion bingads/service_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def env(self):
@property
def url(self):
return self._url

@url.setter
def url(self, url):
self._url = url


def __init__(self, name, env, url):
self._name = name
Expand Down Expand Up @@ -97,4 +102,84 @@ def __init__(self, name, env, url):
for service_info in _SERVICE_INFO_LIST_V12:
SERVICE_INFO_DICT_V12[(service_info.name, service_info.env)] = service_info

SERVICE_INFO_DICT = {12: SERVICE_INFO_DICT_V12}
_SERVICE_INFO_LIST_V13 = [
# ad insight service
_ServiceInfo(
"adinsight",
"production",
"https://adinsight.api.bingads.microsoft.com/Api/Advertiser/AdInsight/V13/AdInsightService.svc?singleWsdl"
),
_ServiceInfo(
"adinsight",
"sandbox",
"https://adinsight.api.sandbox.bingads.microsoft.com/Api/Advertiser/AdInsight/V13/AdInsightService.svc?singleWsdl"
),

# bulk service
_ServiceInfo(
"bulk",
"production",
"https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/BulkService.svc?singleWsdl"
),
_ServiceInfo(
"bulk",
"sandbox",
"https://bulk.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/BulkService.svc?singleWsdl"
),

# campaign management
_ServiceInfo(
"campaignmanagement",
"production",
"https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?singleWsdl"
),
_ServiceInfo(
"campaignmanagement",
"sandbox",
"https://campaign.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?singleWsdl"
),

# customer billing
_ServiceInfo(
"customerbilling",
"production",
"https://clientcenter.api.bingads.microsoft.com/Api/Billing/v13/CustomerBillingService.svc?singleWsdl"
),
_ServiceInfo(
"customerbilling",
"sandbox",
"https://clientcenter.api.sandbox.bingads.microsoft.com/Api/Billing/v13/CustomerBillingService.svc?singleWsdl"
),

# customer management
_ServiceInfo(
"customermanagement",
"production",
"https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?singleWsdl"
),
_ServiceInfo(
"customermanagement",
"sandbox",
"https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?singleWsdl"
),

# reporting
_ServiceInfo(
"reporting",
"production",
"https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl"
),
_ServiceInfo(
"reporting",
"sandbox",
"https://reporting.api.sandbox.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl"
),
]


SERVICE_INFO_DICT_V13 = {}

for service_info in _SERVICE_INFO_LIST_V13:
SERVICE_INFO_DICT_V13[(service_info.name, service_info.env)] = service_info

SERVICE_INFO_DICT = {12: SERVICE_INFO_DICT_V12, 13: SERVICE_INFO_DICT_V13}
21 changes: 20 additions & 1 deletion bingads/v12/bulk/entities/bulk_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, account_id=None, customer_id=None, sync_time=None):
self._sync_time = sync_time
self._msclkid_auto_tagging_enabled = None
self._tracking_url_template = None
self._final_url_suffix = None

@property
def id(self):
Expand Down Expand Up @@ -78,7 +79,20 @@ def tracking_url_template(self):
:return: The tracking template of the account
:rtype: str
"""
return self._tracking_url_template
return self._tracking_url_template

@property
def final_url_suffix(self):
""" The final url suffix to use as a default for all URLs in your account.
:return: The tracking template of the account
:rtype: str
"""
return self._final_url_suffix

@final_url_suffix.setter
def final_url_suffix(self, v):
self._final_url_suffix = v

_MAPPINGS = [
_SimpleBulkMapping(
Expand Down Expand Up @@ -106,6 +120,11 @@ def tracking_url_template(self):
field_to_csv=lambda c: bulk_str(c.tracking_url_template),
csv_to_field=lambda c, v: setattr(c, '_tracking_url_template', v)
),
_SimpleBulkMapping(
header=_StringTable.FinalUrlSuffix,
field_to_csv=lambda c: bulk_optional_str(c.final_url_suffix, c.id),
csv_to_field=lambda c, v: setattr(c, '_final_url_suffix', v)
),
]

def process_mappings_from_row_values(self, row_values):
Expand Down
5 changes: 5 additions & 0 deletions bingads/v12/bulk/entities/bulk_ad_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ def performance_data(self):
),

_ComplexBulkMapping(coop_setting_to_csv, csv_to_coop_setting),
_SimpleBulkMapping(
header=_StringTable.FinalUrlSuffix,
field_to_csv=lambda c: bulk_optional_str(c.ad_group.FinalUrlSuffix, c.ad_group.Id),
csv_to_field=lambda c, v: setattr(c.ad_group, 'FinalUrlSuffix', v)
),
]

def process_mappings_from_row_values(self, row_values):
Expand Down
5 changes: 5 additions & 0 deletions bingads/v12/bulk/entities/bulk_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ def _write_website(c):
field_to_csv=lambda c: target_setting_to_csv(c.campaign),
csv_to_field=lambda c, v: csv_to_target_setting(c.campaign, v)
),
_SimpleBulkMapping(
header=_StringTable.FinalUrlSuffix,
field_to_csv=lambda c: bulk_optional_str(c.campaign.FinalUrlSuffix, c.campaign.Id),
csv_to_field=lambda c, v: setattr(c.campaign, 'FinalUrlSuffix', v)
),
]

def read_additional_data(self, stream_reader):
Expand Down
5 changes: 5 additions & 0 deletions bingads/v12/bulk/entities/bulk_keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ def bid_suggestions(self):
csv_to_field=lambda c, v: csv_to_field_UrlCustomParameters(c.keyword, v)
),
_ComplexBulkMapping(bidding_scheme_to_csv, csv_to_bidding_scheme),
_SimpleBulkMapping(
header=_StringTable.FinalUrlSuffix,
field_to_csv=lambda c: bulk_optional_str(c.keyword.FinalUrlSuffix, c.keyword.Id),
csv_to_field=lambda c, v: setattr(c.keyword, 'FinalUrlSuffix', v)
),
]

def process_mappings_to_row_values(self, row_values, exclude_readonly_data):
Expand Down
4 changes: 3 additions & 1 deletion bingads/v12/internal/bulk/csv_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ class _CsvHeaders:
_StringTable.MicrosoftClickId,

# Account
_StringTable.MSCLKIDAutoTaggingEnabled
_StringTable.MSCLKIDAutoTaggingEnabled,

_StringTable.FinalUrlSuffix,

]

Expand Down
2 changes: 2 additions & 0 deletions bingads/v12/internal/bulk/string_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,5 @@ class _StringTable:
CampaignCompanyNameCriterion = 'Campaign Company Name Criterion'
CampaignJobFunctionCriterion = 'Campaign Job Function Criterion'
CampaignIndustryCriterion = 'Campaign Industry Criterion'

FinalUrlSuffix = "Final Url Suffix"
Loading

0 comments on commit 8bf0280

Please sign in to comment.