def SetCampaignTargetingCriteria(client, campaign):
 campaign_criterion_service = client.GetService('CampaignCriterionService')
 criteria = [{'xsi_type': 'Location', 'id': 21137}, {'xsi_type': 'Location', 'id': 2484}, {'xsi_type': 'Language', 'id': 1000}, {'xsi_type': 'Language', 'id': 1003}]
 operations = [{'operator': 'ADD', 'operand': {'campaignId': campaign['id'], 'criterion': criterion}} for criterion in criteria]
 response = campaign_criterion_service.mutate(operations)
 if (response and ('value' in response)):
  for criterion in response['value']:
   print ('Campaign criteria of type "%s" and id "%s" was added.' % (criterion['criterion']['type'], criterion['criterion']['id']))

def SetCampaignTargetingCriteria ( client , campaign ) : campaign_criterion_service = client . GetService ( 'CampaignCriterionService' ) criteria = [ { 'xsi_type' : 'Location' , 'id' : 21137 } , { 'xsi_type' : 'Location' , 'id' : 2484 } , { 'xsi_type' : 'Language' , 'id' : 1000 } , { 'xsi_type' : 'Language' , 'id' : 1003 } ] operations = [ { 'operator' : 'ADD' , 'operand' : { 'campaignId' : campaign [ 'id' ] , 'criterion' : criterion } } for criterion in criteria ] response = campaign_criterion_service . mutate ( operations ) if ( response and ( 'value' in response ) ) : for criterion in response [ 'value' ] : print ( 'Campaign criteria of type "%s" and id "%s" was added.' % ( criterion [ 'criterion' ] [ 'type' ] , criterion [ 'criterion' ] [ 'id' ] ) )
sets targeting criteria for the given campaign .