def get_pipeline_url(environment: str, enterprise_id: str, pipeline_id: str
    =None) ->str:
    """
    Build and return pipeline url for scapi endpoint
    :param environment:
    :param enterprise_id:
    :param pipeline_id:
    :param stage_id:
    :param operation_id:
    :return: Url
    """
    url = (
        f'https://{environment}-api.esper.cloud/api/v1/enterprise/{enterprise_id}/pipeline/'
        )
    if pipeline_id:
        url += f'{pipeline_id}/'
    return url
