Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dimensions['FULL']['height'],
dimensions['FULL']['width'],
image['mimeType']))
elif image['type'] == 'VIDEO':
print ('%s with id "%s" was found.' % (image['type'],
image['mediaId']))
else:
print 'No images/videos were found.'
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
}
}
]
ad_params = ad_param_service.mutate(operations)
# Display results.
for ad_param in ad_params:
print('Ad parameter with text "%s" was successfully set for criterion '
'with id "%s" and ad group id "%s".'
% (ad_param['insertionText'], ad_param['criterionId'],
ad_param['adGroupId']))
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID, CRITERION_ID)
# Display results.
if 'entries' in page:
for ad_group in page['entries']:
print ('Ad group with name "%s", id "%s" and status "%s" was '
'found.' % (ad_group['name'], ad_group['id'],
ad_group['status']))
else:
print 'No ad groups were found.'
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, CAMPAIGN_ID)
try:
while True:
chunk = stream_data.read(CHUNK_SIZE)
if not chunk: break
report_data.write(chunk.decode() if sys.version_info[0] == 3
and getattr(report_data, 'mode', 'w') == 'w' else chunk)
print report_data.getvalue()
finally:
report_data.close()
stream_data.close()
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client)
'points was found:'
% (bid_landscape['adGroupId'], bid_landscape['criterionId'],
bid_landscape['startDate'], bid_landscape['endDate']))
for bid_landscape_point in bid_landscape['landscapePoints']:
print (' bid: %s => clicks: %s, cost: %s, impressions: %s'
% (bid_landscape_point['bid']['microAmount'],
bid_landscape_point['clicks'],
bid_landscape_point['cost']['microAmount'],
bid_landscape_point['impressions']))
else:
print 'No bid landscapes found.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID, CRITERION_ID)
media = media_service.upload(media)[0]
# Display results.
if media:
dimensions = dict([(entry['key'], entry['value'])
for entry in media['dimensions']])
print ('Image with id "%s", dimensions \'%sx%s\', and MimeType "%s" was'
' uploaded.' % (media['mediaId'], dimensions['FULL']['height'],
dimensions['FULL']['width'], media['mimeType']))
else:
print 'No images were uploaded.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, IMAGE_FILENAME)
def main(key_file, service_account_user, developer_token, user_agent,
client_customer_id):
oauth2_client = oauth2.GoogleServiceAccountClient(
key_file, oauth2.GetAPIScope('adwords'), sub=service_account_user)
adwords_client = adwords.AdWordsClient(
developer_token, oauth2_client, user_agent,
client_customer_id=client_customer_id)
customer_service = adwords_client.GetService('CustomerService',
version='v201702')
customers = customer_service.getCustomers()
print('You are logged in as a user with access to the following customers:')
for customer in customers:
print('\t%s' % customer['customerId'])
'labelId': label_id,
}
}
]
result = campaign_service.mutateLabel(operations)
# Display results.
for label in result['value']:
print ('CampaignLabel with campaignId \'%s\' and labelId \'%s\' was added.'
% (label['campaignId'], label['labelId']))
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, CAMPAIGN_ID1, CAMPAIGN_ID2, LABEL_ID)
client.validate_only = False
if operations:
response = ad_group_ad_service.mutate(operations)
if response and response['value']:
ads = response['value']
print 'Added %s ad(s) to ad group %s.' % (len(ads), ad_group_id)
for ad in ads:
print (' Ad id is %s, type is %s and status is \'%s\'.' %
(ad['ad']['id'], ad['ad']['Ad.Type'], ad['status']))
else:
print 'No ads were added.'
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, AD_GROUP_ID)
if 'entries' in page:
for campaign in page['entries']:
print ('Campaign found with Id \'%s\', name \'%s\', and labels: %s'
% (campaign['id'], campaign['name'], campaign['labels']))
else:
print 'No campaigns were found.'
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])
time.sleep(1)
if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, LABEL_ID)