Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'type': 'ADVERTISER',
'companyId': advertiser_id
},
}
proposals = proposal_service.createProposals([proposal])
# Display results.
for proposal in proposals:
print('Programmatic proposal with id "%s" and name "%s" was created.' %
(proposal['id'], proposal['name']))
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, PROGRAMMATIC_BUYER_ID, PRIMARY_SALESPERSON_ID,
PRIMARY_TRAFFICKER_ID, ADVERTISER_ID)
team['description'] = 'this team is great!'
updated_teams.append(team)
# Update teams on the server.
teams = team_service.updateTeams(updated_teams)
# Display results.
for team in teams:
print ('Team with id "%s" and name "%s" was updated.'
% (team['id'], team['name']))
else:
print 'No teams found to update.'
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, TEAM_ID)
'hasAllInventory': 'false',
'teamAccessType': 'READ_WRITE'
}
teams.append(team)
# Add Teams.
teams = team_service.createTeams(teams)
# Display results.
for team in teams:
print ('Team with ID "%s" and name "%s" was created.'
% (team['id'], team['name']))
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)
creative['destinationUrl'] = 'http://news.google.com'
updated_creatives.append(creative)
# Update creatives remotely.
creatives = creative_service.updateCreatives(updated_creatives)
# Display results.
for creative in creatives:
print ('Image creative with id \'%s\' and destination URL \'%s\' was '
'updated.' % (creative['id'], creative['destinationUrl']))
else:
print 'No creatives found to update.'
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, IMAGE_CREATIVE_ID)
{'xsi_type': 'ApproveOrders'}, statement.ToStatement())
if result and int(result['numChanges']) > 0:
orders_approved += int(result['numChanges'])
statement.offset += dfp.SUGGESTED_PAGE_LIMIT
else:
break
# Display results.
if orders_approved > 0:
print 'Number of orders approved: %s' % orders_approved
else:
print 'No orders were approved.'
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)
statement.ToStatement())
if 'results' in response and len(response['results']):
for proposal_line_item in response['results']:
# Print out some information for each proposal line item.
print('Proposal line item with ID "%d" and name "%s" was found.\n' %
(proposal_line_item['id'], proposal_line_item['name']))
statement.offset += statement.limit
else:
break
print '\nNumber of results found: %s' % response['totalResultSetSize']
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)
'creativeRotationType': 'OPTIMIZED',
'discountType': 'PERCENTAGE',
'allowOverbook': 'true'
}
# Add line item.
line_item = line_item_service.createLineItem(line_item)
# Display results.
print ('Video line item with id "%s", belonging to order id "%s", and '
'named "%s" was created.' % (line_item['id'], line_item['orderId'],
line_item['name']))
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, ORDER_ID, TARGETED_VIDEO_AD_UNIT_ID,
CONTENT_CUSTOM_TARGETING_VALUE_ID)
# Print out some information for each exchange rate.
print(
'Exchange rate with ID "%d", currency code "%s", direction "%s", '
'and exchange rate "%d" was found.\n' %
(exchange_rate['id'], exchange_rate['currencyCode'],
exchange_rate['direction'], exchange_rate['exchangeRate']))
statement.offset += statement.limit
else:
break
print '\nNumber of results found: %s' % response['totalResultSetSize']
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)
report_file = tempfile.NamedTemporaryFile(suffix='.csv.gz', delete=False)
# Download report data.
report_downloader.DownloadReportToFile(
report_job_id, export_format, report_file)
report_file.close()
# Display results.
print 'Report job with id "%s" downloaded to:\n%s' % (
report_job_id, report_file.name)
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, ORDER_ID)
for premium_rate in response['results']:
# Print out some information for each premium rate.
print('Premium rate with ID "%d", premium feature "%s", and rate card '
'id "%d" was found.\n' % (premium_rate['id'],
dfp.DfpClassType(premium_rate),
premium_rate['rateCardId']))
statement.offset += statement.limit
else:
break
print '\nNumber of results found: %s' % response['totalResultSetSize']
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client)