def METHOD_NAME(cls, values: Dict[str, Any]) -> Dict[str, Any]:
    """Mask sensitive values in the response."""
    if values.get("secrets") is None:
        return values
    connection_type = (
        values["saas_config"].type
        if values.get("connection_type") == ConnectionType.saas
        else values.get("connection_type").value  # type: ignore
    )
    try:
        secret_schema = get_connection_type_secret_schema(
            connection_type=connection_type
        )
    except NoSuchConnectionTypeSecretSchemaError as e:
        logger.error(e)
        # if there is no schema, we don't know what values to mask.
        # so all the secrets are removed.
        values["secrets"] = None
        return values
    values["secrets"] = mask_sensitive_fields(
        cast(dict, values.get("secrets")), secret_schema
    )
    return values