def BuildCampaignOperations(batch_job_helper,
                            budget_operations, number_of_campaigns, campaign_names):
  """Builds the operations needed to create a new Campaign.

  Note: When the Campaigns are created, they will have a different Id than those
  generated here as a temporary Id. This is just used to identify them in the
  BatchJobService.

  Args:
    batch_job_helper: a BatchJobHelper instance.
    budget_operations: a list containing the operation that will add the budget
      used by these Campaigns.
    number_of_campaigns: an int number defining the number of campaigns to be
      created.

  Returns:
    a list containing the operations to create the desired number of Campaigns.
  """
  # Grab the temporary budgetId to associate with the new Campaigns.
  budget_id = budget_operations[0]['operand']['budgetId']

  campaign_operations = [
      {
          # The xsi_type of the operation can usually be guessed by the API
          # because a given service only handles one type of operation.
          # However, batch jobs process operations of different types, so
          # the xsi_type must always be explicitly defined for these
          # operations.
          'xsi_type': 'CampaignOperation',
          'operand': {
              'name': campaign_names[x],
              # Recommendation: Set the campaign to PAUSED when creating it to
              # stop the ads from immediately serving. Set to ENABLED once
              # you've added targeting and the ads are ready to serve.
              'status': 'PAUSED',
              # This is a temporary Id used by the BatchJobService to identify
              # the Campaigns for operations that require a campaignId.
              'id': batch_job_helper.GetId(),
              'advertisingChannelType': 'SEARCH',
              'trackingUrlTemplate': '{lpurl}?vr_source=google&vr_medium=cpc&vr_campaignid={campaignid}&vr_adgroupid={adgroupid}',
              # Note that only the budgetId is required
              'budget': {
                  'budgetId': budget_id
              },
              'networkSetting': {
                  'targetGoogleSearch': 'true',
                  'targetSearchNetwork': 'false',
                  'targetContentNetwork': 'false',
                  'targetPartnerSearchNetwork': 'false'
              },
              'biddingStrategyConfiguration': {
                  'biddingStrategyType': 'MANUAL_CPC'
              }
          },
          'operator': 'ADD'
      }
      for x in range(number_of_campaigns)]

  return campaign_operations