def main(client, activity_group_id):
  # Initialize appropriate service.
  activity_service = client.GetService('ActivityService', version='v201505')

  # Create a daily visits activity.
  daily_visits_activity = {
      'name': 'Activity #%s' % uuid.uuid4(),
      'activityGroupId': activity_group_id,
      'type': 'DAILY_VISITS'
  }

  # Create a custom activity.
  custom_activity = {
      'name': 'Activity #%s' % uuid.uuid4(),
      'activityGroupId': activity_group_id,
      'type': 'CUSTOM'
  }

  # Create the activities on the server.
  activities = activity_service.createActivities([
      daily_visits_activity, custom_activity])

  # Display results.
  for activity in activities:
    print ('An activity with ID \'%s\', name \'%s\', and type \'%s\' was '
           'created.' % (activity['id'], activity['name'], activity['type']))
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201505/activity_service/create_activities.py/main/original