"""Read application identity only. Keep resolve_api_connection.py alongside this file."""
from resolve_api_connection import connect


def inspect_application(resolve):
    product = resolve.GetProductName()
    version = resolve.GetVersionString()
    if not product or not version:
        raise RuntimeError("Application identity could not be read")
    return {"product": product, "version": version}


def main():
    import json
    result = inspect_application(connect())
    print(json.dumps(result, ensure_ascii=False, indent=2))
    # No project is required. A successful read is NOT permission for later writes.


if __name__ == "__main__":
    main()
