Skip to content

Commit

Permalink
v201602 support for DFP
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Chen committed Feb 23, 2016
1 parent c5d3f7c commit 7465430
Show file tree
Hide file tree
Showing 215 changed files with 876 additions and 329 deletions.
20 changes: 20 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
3.13.0 -- 2/23/2016
* Added support for DFP v201602.
* Removed support for DFP v201411.
* Removed examples for DFP v201502.
* The library now applies a temporary patch to the suds-jurko dependency that
resolves multiple issues. This patch will be removed when the suds-jurko
library publicly exposes its 0.7 release. Thanks to GitHub user adiharush for
suggesting the patch!
* The LoadFromStorage function can now load credentials for either the
installed application or service account (.p12 files only) OAuth 2.0 flows.
* The googleads.yaml configuration file has been updated to reflect the changes
to the LoadFromStorage function.
* Resolved Issues:
Issue #58: https://github.com/googleads/googleads-python-lib/issues/58
Issue #62: https://github.com/googleads/googleads-python-lib/issues/62
Issue #63: https://github.com/googleads/googleads-python-lib/issues/63
Issue #68: https://github.com/googleads/googleads-python-lib/issues/68
Issue #78: https://github.com/googleads/googleads-python-lib/issues/78

3.12.0 -- 02/01/2016
* Removed DoubleClick Ad Exchange content. This API has been sunset.
* Added support for AdWords v201601.
Expand All @@ -11,6 +30,7 @@
* The AdWords BatchJobHelper and IncrementalUploadHelper utilities now
initialize URLs for v201601 and up.
* The AdWords IncrementalUploadHelper is now serializable.
>>>>>>> a4bf1f889e4cecee17f2e27a10d593452904cb8b

3.11.0 -- 11/24/2015
* Removed support for AdWords v201502.
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ and DoubleClick for Publishers. The library provides easy ways to store your
authentication and create SOAP web service clients. It also contains example
code to help you get started integrating with our APIs.

####Important Note Regarding DFP
If you are using v201502 and newer in the DFP API, then performing actions on
objects will fail with an 'args NULL' error due to a bug in the underlying SOAP
client, more details here: https://github.com/googleads/googleads-python-lib/issues/58.

While the fix has been accepted and merged into the source, you will need to download
the source files yourself and install them directly. The source can be located here:
https://bitbucket.org/jurko/suds/downloads

##How do I get started?
####Installing the library
Install or update the library from PyPI. If you're using pip, this is as easy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main(client, campaign_id):

while page['totalNumEntries'] > offset:
page = shared_criterion_service.get(selector)
if page['entries']:
if 'entries' in page:
for shared_criterion in page['entries']:
if shared_criterion['criterion']['type'] == 'KEYWORD':
print ('Shared negative keyword with ID %d and text "%s" was'
Expand All @@ -129,21 +129,22 @@ def main(client, campaign_id):
selector['paging']['startIndex'] = offset

# Finally, remove the criteria.
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
if criterion_ids:
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
else:
print 'No shared criteria were removed.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main(client, campaign_id):

while page['totalNumEntries'] > offset:
page = shared_criterion_service.get(selector)
if page['entries']:
if 'entries' in page:
for shared_criterion in page['entries']:
if shared_criterion['criterion']['type'] == 'KEYWORD':
print ('Shared negative keyword with ID %d and text "%s" was'
Expand All @@ -129,21 +129,22 @@ def main(client, campaign_id):
selector['paging']['startIndex'] = offset

# Finally, remove the criteria.
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
if criterion_ids:
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
else:
print 'No shared criteria were removed.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def main(client, campaign_id):

while page['totalNumEntries'] > offset:
page = shared_criterion_service.get(selector)
if page['entries']:
if 'entries' in page:
for shared_criterion in page['entries']:
if shared_criterion['criterion']['type'] == 'KEYWORD':
print ('Shared negative keyword with ID %d and text "%s" was'
Expand All @@ -129,21 +129,22 @@ def main(client, campaign_id):
selector['paging']['startIndex'] = offset

# Finally, remove the criteria.
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
if criterion_ids:
operations = [
{
'operator': 'REMOVE',
'operand': {
'criterion': {'id': criterion['criterionId']},
'sharedSetId': criterion['sharedSetId']
}
} for criterion in criterion_ids
]

response = shared_criterion_service.mutate(operations)
if 'value' in response:
for criterion in response['value']:
print ('Criterion ID %d was successfully removed from shared set ID'
'%d.' % (criterion['criterion']['id'], criterion['sharedSetId']))
else:
print 'No shared criteria were removed.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
def main(client, advertiser_company_id):
# Initialize appropriate service.
activity_group_service = client.GetService('ActivityGroupService',
version='v201502')
version='v201602')

# Create a short-term activity group.
short_term_activity_group = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
def main(client):
# Initialize appropriate service.
activity_group_service = client.GetService('ActivityGroupService',
version='v201502')
version='v201602')

# Create statement object to only select active activity groups.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
def main(client):
# Initialize appropriate service.
activity_group_service = client.GetService('ActivityGroupService',
version='v201502')
version='v201602')

# Create a filter statement.
statement = dfp.FilterStatement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
def main(client, activity_group_id, advertiser_company_id):
# Initialize appropriate service.
activity_group_service = client.GetService('ActivityGroupService',
version='v201502')
version='v201602')

# Create statement object to select a single activity groups by ID.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def main(client, activity_group_id):
# Initialize appropriate service.
activity_service = client.GetService('ActivityService', version='v201502')
activity_service = client.GetService('ActivityService', version='v201602')

# Create a daily visits activity.
daily_visits_activity = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def main(client):
# Initialize appropriate service.
activity_service = client.GetService('ActivityService', version='v201502')
activity_service = client.GetService('ActivityService', version='v201602')

# Create statement object to only select active activities.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def main(client):
# Initialize appropriate service.
activity_service = client.GetService('ActivityService', version='v201502')
activity_service = client.GetService('ActivityService', version='v201602')

# Create statement object to select only all activities.
statement = dfp.FilterStatement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def main(client, activity_id):
# Initialize appropriate service.
activity_service = client.GetService('ActivityService', version='v201502')
activity_service = client.GetService('ActivityService', version='v201602')

# Create statement object to select one activity by ID to update.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def main(client, custom_targeting_key_id, custom_targeting_value_id):

# Initialize appropriate services.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201502')
network_service = client.GetService('NetworkService', version='v201502')
'AudienceSegmentService', version='v201602')
network_service = client.GetService('NetworkService', version='v201602')

# Get the root ad unit ID used to target the entire network.
root_ad_unit_id = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main(client):

# Initialize appropriate service.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201502')
'AudienceSegmentService', version='v201602')

# Create statement object to select all audience segments.
statement = dfp.FilterStatement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main(client):

# Initialize appropriate service.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201502')
'AudienceSegmentService', version='v201602')

# Create statement object to only select first party audience segments.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main(client, audience_segment_id):

# Initialize appropriate service.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201502')
'AudienceSegmentService', version='v201602')

# Create statement object to get the specified first party audience segment.
values = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def main(client, audience_segment_id):

# Initialize appropriate service.
audience_segment_service = client.GetService(
'AudienceSegmentService', version='v201502')
'AudienceSegmentService', version='v201602')

# Create statement object to get the specified first party audience segment.
values = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def main(client, product_id, rate_card_id):
# Initialize appropriate service.
base_rate_service = client.GetService(
'BaseRateService', version='v201502')
'BaseRateService', version='v201602')

# Create a product base rate.
product_base_rate = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def main(client, product_template_id, rate_card_id):
# Initialize appropriate service.
base_rate_service = client.GetService(
'BaseRateService', version='v201502')
'BaseRateService', version='v201602')

# Create a product template base rate.
product_template_base_rate = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def main(client):
# Initialize appropriate service.
base_rate_service = client.GetService('BaseRateService', version='v201502')
base_rate_service = client.GetService('BaseRateService', version='v201602')

# Create a filter statement.
statement = dfp.FilterStatement('ORDER BY id ASC')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def main(client, rate_card_id):
# Initialize appropriate service.
base_rate_service = client.GetService('BaseRateService', version='v201502')
base_rate_service = client.GetService('BaseRateService', version='v201602')

# Create a filter statement for base rates for a single rate card.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def main(client, base_rate_id):
# Initialize appropriate service.
base_rate_service = client.GetService('BaseRateService', version='v201502')
base_rate_service = client.GetService('BaseRateService', version='v201602')

# Create a filter statement for base rates for a single rate card.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

def main(client):
# Initialize appropriate service.
company_service = client.GetService('CompanyService', version='v201502')
company_service = client.GetService('CompanyService', version='v201602')

# Create company objects.
companies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def main(client):
# Initialize appropriate service.
company_service = client.GetService('CompanyService', version='v201502')
company_service = client.GetService('CompanyService', version='v201602')

# Create statement object to only select companies that are advertisers.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

def main(client):
# Initialize appropriate service.
company_service = client.GetService('CompanyService', version='v201502')
company_service = client.GetService('CompanyService', version='v201602')

# Create statement object to select all companies.
statement = dfp.FilterStatement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def main(client, company_id):
# Initialize appropriate service.
company_service = client.GetService('CompanyService', version='v201502')
company_service = client.GetService('CompanyService', version='v201602')

# Create statement object to only select a single company by ID.
values = [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

def main(client, advertiser_company_id, agency_company_id):
# Initialize appropriate service.
contact_service = client.GetService('ContactService', version='v201502')
contact_service = client.GetService('ContactService', version='v201602')

# Create an advertiser contact.
advertiser_contact = {
Expand Down
Loading

0 comments on commit 7465430

Please sign in to comment.