def BuildCampaignOperations(batch_job_helper, budget_operations, campaigns):
budget_id = budget_operations[0]['operand']['budgetId']
campaign_operations = [
{
'xsi_type': 'CampaignOperation',
'operand': {
'name': i[0],
'status': i[2],
'id': batch_job_helper.GetId(),
'advertisingChannelType': 'SEARCH',
'budget': {
'budgetId': budget_id
},
'networkSetting': {
'targetGoogleSearch': True,
'targetSearchNetwork': True,
'targetContentNetwork': False,
'targetPartnerSearchNetwork': False,
},
'biddingStrategyConfiguration': {
'biddingStrategyType': 'MANUAL_CPC'
}
#'biddingStrategyConfiguration': {
# 'biddingStrategyType': 'TARGET_CPA',
# 'biddingScheme': {
# 'xsi_type': 'TargetCpaBiddingScheme',
# 'targetCpa': {
# 'microAmount': 1000000,
# }
# }
#}
},
'operator': 'ADD'
}
for i in campaigns]
return campaign_operations