- Integrated centralized logging system in all modules. - Extracted all IDs and ProgIds into a separate . - Refactored and for cleaner dependency management. - Included updated discovery and inspection utilities. - Verified end-to-end workflow stability.
25 lines
860 B
Python
25 lines
860 B
Python
import json
|
|
from config import Config
|
|
from logging_config import setup_logging
|
|
from auth_handler import AuthHandler
|
|
from superoffice_client import SuperOfficeClient
|
|
|
|
logger = setup_logging("inspector")
|
|
|
|
def inspect_person(person_id):
|
|
auth = AuthHandler()
|
|
client = SuperOfficeClient(auth)
|
|
logger.info(f"Fetching Person with ID {person_id} to inspect structure...")
|
|
url = client._get_url(f"v1/Person/{person_id}")
|
|
try:
|
|
resp = client.session.get(url, headers=client._get_headers())
|
|
resp.raise_for_status()
|
|
person_data = resp.json()
|
|
print(f"\n--- PERSON STRUCTURE (ID: {person_id}) ---")
|
|
print(json.dumps(person_data, indent=2))
|
|
except Exception as e:
|
|
logger.error(f"Failed to fetch person data: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
target_person_id = 9
|
|
inspect_person(target_person_id) |