def METHOD_NAME(btpUsecase):
    result = None
    if btpUsecase.subdomain is not None and btpUsecase.subdomain != "":
        result = btpUsecase.subdomain.strip()
    else:
        result = (
            btpUsecase.accountMetadata["subaccount"]
            + "-"
            + shortuuid.ShortUUID().random(length=10)
        )
    result = re.sub(r"[^\w\s]", "-", result)
    result = result.replace(" ", "-")
    result = result.replace("_", "-")
    result = result.replace("--", "-")
    if result[len(result) - 1] == "-":
        result = result[:-1]
    result = result[:60].lower()
    btpUsecase.accountMetadata = addKeyValuePair(
        btpUsecase.accountMetadata, "subdomain", result
    )
    return result