def METHOD_NAME(user_query: user_query_domain.UserQuery) -> str:
    """Save the user query into the datastore.
    Args:
        user_query: UserQuery. The user query to save.
    Returns:
        str. The ID of the user query that was saved.
    """
    user_query.validate()
    user_query_dict = {
        'submitter_id': user_query.submitter_id,
        'query_status': user_query.status,
        'user_ids': user_query.user_ids,
        'sent_email_model_id': user_query.sent_email_model_id,
        'deleted': user_query.deleted
    }
    user_query_dict.update(dict(user_query.params._asdict()))
    user_query_model = (
        user_models.UserQueryModel.get(user_query.id, strict=False))
    if user_query_model is not None:
        user_query_model.populate(**user_query_dict)
    else:
        user_query_dict['id'] = user_query.id
        user_query_model = user_models.UserQueryModel(**user_query_dict)
    user_query_model.update_timestamps()
    user_query_model.put()
    return user_query_model.id