def METHOD_NAME(
    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.METHOD_NAME(
            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"] = str(e)
    return r