def get_remoteadb_url(environment: str, enterprise_id: str, device_id: str,
    remoteadb_id: str=None) ->str:
    """
    Build and return remoteadb url for scapi endpoint
    :param environment:
    :param enterprise_id:
    :param device_id:
    :param remoteadb_id:
    :return:
    """
    host = f'https://{environment}-api.shoonyacloud.com'
    url = (
        f'{host}/api/v0/enterprise/{enterprise_id}/device/{device_id}/remoteadb/'
        )
    if remoteadb_id:
        url = f'{url}{remoteadb_id}'
    return url
