Creates a budget and returns its budgetId.

  Args:
    client: An AdWordsClient instance.

  Returns:
    An int budgetId for the created Budget.

def CreateBudget(client):
  """Creates a budget and returns its budgetId.

  Args:
    client: An AdWordsClient instance.

  Returns:
    An int budgetId for the created Budget.
  """
  budget_service = client.GetService('BudgetService', version='v201809')

  # Create a budget.
  budget = {
      'name': 'Interplanetary Cruise App Budget #%s' % uuid.uuid4(),
      'amount': {
          'microAmount': '50000000'
      },
      'deliveryMethod': 'STANDARD',
      'isExplicitlyShared': False
  }

  budget_operations = [{
      'operator': 'ADD',
      'operand': budget
  }]

  # Create the budget and return its ID.
  budget_id = budget_service.mutate(budget_operations)['value'][0]['budgetId']

  return budget_id