def definition_to_api_parameters(definition):
    if 'parameters' not in definition:
        return None
    parameter_objects = []
    for element in definition['parameters']:
        try:
            parameter_id = element.pop('id')
        except __HOLE__:
            raise PipelineDefinitionError('Missing "id" key of parameter: %s' %
                                          json.dumps(element), definition)
        parameter_object = {'id': parameter_id}
        # Now we need the attribute list.  Each element in the attribute list
        # is a dict with a 'key', 'stringValue'
        attributes = []
        for key, value in sorted(element.items()):
            attributes.extend(_parse_each_field(key, value))
        parameter_object['attributes'] = attributes
        parameter_objects.append(parameter_object)
    return parameter_objects
dataset/ETHPy150Open aws/aws-cli/awscli/customizations/datapipeline/translator.py/definition_to_api_parameters