def _create_ingest_input_stream_for_audio_track(encoding, input, input_path,
                                                position):
    # type: (Encoding, Input, str, int) -> IngestInputStream
    """
    Creates an IngestInputStream to select a specific audio strack in the input, and adds it to an
    encoding

    <p>The IngestInputStream is used to define where a file to read a stream from is located

    <p>API endpoint:
    https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsInputStreamsIngestByEncodingId

    :param encoding: The encoding to which the stream will be added
    :param input: The input resource providing the input file
    :param input_path: The path to the input file
    :param position: The relative position of the audio track to select in the input file
    """

    ingest_input_stream = IngestInputStream(
        input_id=input.id,
        input_path=input_path,
        selection_mode=StreamSelectionMode.AUDIO_RELATIVE,
        position=position)

    return bitmovin_api.encoding.encodings.input_streams.ingest.create(
        encoding_id=encoding.id, ingest_input_stream=ingest_input_stream)
def _create_ingest_input_stream(encoding, input, input_path):
    # type: (Encoding, Input, str) -> IngestInputStream
    """
    Creates an IngestInputStream and adds it to an encoding

    <p>The IngestInputStream is used to define where a file to read a stream from is located

    <p>API endpoint:
    https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsInputStreamsIngestByEncodingId

    :param encoding: The encoding to which the stream will be added
    :param input: The input resource providing the input file
    :param input_path: The path to the input file
    """

    ingest_input_stream = IngestInputStream(
        input_id=input.id,
        input_path=input_path,
        selection_mode=StreamSelectionMode.AUTO
    )

    return bitmovin_api.encoding.encodings.input_streams.ingest.create(
        encoding_id=encoding.id,
        ingest_input_stream=ingest_input_stream
    )
def _create_ingest_input_stream(encoding, input, input_path,
                                stream_selection_mode):
    # type: (Encoding, Input, str, StreamSelectionMode) -> IngestInputStream
    """
    Creates an IngestInputStream and adds it to an encoding.
    The IngestInputStream is used to define where a file to read a stream from is located.

    <p>API endpoints:
    https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsInputStreamsIngestByEncodingId

    :param encoding: The encoding to be started
    :param input: The input resource providing the input file
    :param input_path: The path to the input file
    :param stream_selection_mode: The algorithm how the stream in the input file will be selected
    """

    ingest_input_stream = IngestInputStream(
        input_id=input.id,
        input_path=input_path,
        selection_mode=stream_selection_mode)

    return bitmovin_api.encoding.encodings.input_streams.ingest.create(
        encoding_id=encoding.id, ingest_input_stream=ingest_input_stream)