Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Update the creative sets on the server.
creative_sets = creative_set_service.updateCreativeSet(updated_created_sets)
# Display results.
for creative_set in creative_sets:
print(('Creative set with ID "%s", master creative ID "%s", and '
'companion creative IDs {%s} was updated.')
% (creative_set['id'], creative_set['masterCreativeId'],
','.join(creative_set['companionCreativeIds'])))
else:
print('No creative sets found to update.')
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, CREATIVE_SET_ID, COMPANION_CREATIVE_ID)
for reconciliation_report in response['results']:
# Print out some information for each reconciliation report.
print(
'Reconciliation report with ID "%d" and start date "%s" was found.'
'\n' % (reconciliation_report['id'],
last_month.strftime('%Y-%m-01')))
statement.offset += statement.limit
else:
break
print('\nNumber of results found: %s' % response['totalResultSetSize'])
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client)
# Print out some information for each value.
print(('CMS metadata value with Id %d and name "%s", associated with '
'the CmsMetadataKey with id %d and name "%s", was found.\n') %
(cms_metadata_value['cmsMetadataValueId'],
cms_metadata_value['valueName'], cms_metadata_value['key']['id'],
cms_metadata_value['key']['name']))
statement.offset += statement.limit
else:
break
print('\nNumber of results found: %s' % response['totalResultSetSize'])
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, CMS_METADATA_KEY_NAME)
'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.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client)
if 'results' in response and len(response['results']):
for suggested_ad_unit in response['results']:
# Print out some information for each suggested ad unit.
print(
'Suggested ad unit with ID "%s" and num requests "%d" was found.\n'
% (suggested_ad_unit['id'], suggested_ad_unit['numRequests']))
statement.offset += statement.limit
else:
break
print '\nNumber of results found: %s' % response['totalResultSetSize']
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, NUM_REQUESTS)
# Display results.
for value in values:
print('Custom targeting value with id "%s", name "%s", and display'
' name "%s" was updated.'
% (value['id'], value['name'], value['displayName']))
statement.offset += statement.limit
else:
break
if response['totalResultSetSize'] == 0:
print('No custom targeting values were updated.')
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, CUSTOM_TARGETING_KEY_ID)
contending_line_items = getattr(forecast, 'contentingLineItems', [])
# Display results.
print('%s %s matched.' % (matched, forecast['unitType'].lower()))
print('%s%% %s available.' % (
available_percent, forecast['unitType'].lower()))
print('%d contending line items.' % len(contending_line_items))
if 'possibleUnits' in forecast and matched:
possible_percent = (int(forecast['possibleUnits'])/float(matched)) * 100.
print('%s%% %s possible' % (possible_percent, forecast['unitType'].lower()))
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, LINE_ITEM_ID)
# Display results.
if proposals:
for proposal in proposals:
print('Proposal with id "%s", name "%s", and '
'notes "%s" was updated.'
% (proposal['id'], proposal['name'], proposal['internalNotes']))
else:
print('No proposals were updated.')
else:
print('No proposals found to update.')
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, PROPOSAL_ID)
int(date_time_value['date']['day']),
int(date_time_value['hour']),
int(date_time_value['minute']),
int(date_time_value['second']))
date_time_str = pytz.timezone(
date_time_value['timeZoneId']).localize(date_time_obj).isoformat()
if date_time_str[-5:] == '00:00':
return date_time_str[:-6] + 'Z'
else:
return date_time_str
if __name__ == '__main__':
# Initialize client object.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_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.
ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client)