from typing import List


def get_curl_dataset_payload(dataset_id: int, pipeline_steps: List[str]) -> str:
    """
    returns a "curl-passable" payload for requesting data from a dataset under the given OPAL pipeline_steps

    :param dataset_id: the id of the dataset to query
    :param pipeline_steps: the list of OPAL commands to perform to shape / filter the dataset's data. Commands are to be
        passed as individual strings in this list.

    :return: a payload that can be passed to curl
    """
    payload = {'query': {'stages': [{'stageID': 'first', 'input': [{'inputName': 'in', 'datasetId': f'{dataset_id}'}],
                                     'pipeline': " | ".join(pipeline_steps)}], 'outputStage': 'first'}}
    payload = "-d '{}'".format(str(payload).replace('"', '\\"').replace("'", "\""))
    return payload