import uuid


def CreateCampaignWithBiddingStrategy(client, bidding_strategy_id, budget_id):
  """Create a Campaign with a Shared Bidding Strategy.

  Args:
    client: AdWordsClient the client to run the example with.
    bidding_strategy_id: string the bidding strategy ID to use.
    budget_id: string the shared budget ID to use.

  Returns:
    dict An object representing a campaign.
  """
  # Initialize appropriate service.
  campaign_service = client.GetService('CampaignService', version='v201601')

  # Create campaign.
  campaign = {
      'name': 'Interplanetary Cruise #%s' % uuid.uuid4(),
      'budget': {
          'budgetId': budget_id
      },
      'biddingStrategyConfiguration': {
          'biddingStrategyId': bidding_strategy_id
      },
      'advertisingChannelType': 'SEARCH',
      'networkSetting': {
          'targetGoogleSearch': 'true',
          'targetSearchNetwork': 'true',
          'targetContentNetwork': 'true'
      }
  }

  # Create operation.
  operation = {
      'operator': 'ADD',
      'operand': campaign
  }

  response = campaign_service.mutate([operation])
  new_campaign = response['value'][0]

  print ('Campaign with name \'%s\', ID \'%s\' and bidding scheme ID \'%s\' '
         'was created.' %
         (new_campaign['name'], new_campaign['id'],
          new_campaign['biddingStrategyConfiguration']['biddingStrategyId']))

  return new_campaign