<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def put_pipeline_definition(pipeline_id, pipeline_objects, parameter_objects=None,
                            parameter_values=None, region=None, key=None, keyid=None, profile=None):
    '''
    Add tasks, schedules, and preconditions to the specified pipeline. This function is
    idempotent and will replace an existing definition.

    CLI example:

    .. code-block:: bash

        salt myminion boto_datapipeline.put_pipeline_definition my_pipeline_id my_pipeline_objects
    '''
    parameter_objects = parameter_objects or []
    parameter_values = parameter_values or []
    client = _get_client(region, key, keyid, profile)
    r = {}
    try:
        response = client.put_pipeline_definition(
            pipelineId=pipeline_id,
            pipelineObjects=pipeline_objects,
            parameterObjects=parameter_objects,
            parameterValues=parameter_values,
        )
        if response['errored']:
            r['error'] = response['validationErrors']
        else:
            r['result'] = response
    except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
        r['error'] = six.text_type(e)
    return r