Skip to content

Conversation

@rzwink
Copy link

@rzwink rzwink commented Sep 19, 2025

This PR enhances the SimplePassObject to fully represent all fields returned by the API. Previously, the class only exposed url, serialNumber, and passType. The following improvements were made:

  • Added urls property to store the entire urls object from the API.

  • Added support for additional fields:

    • id
    • issuedDate
    • installedDate
    • status
  • Preserved existing attributes (url, serialNumber, passType) to maintain backward compatibility.

  • Added safe lookups (data.get(...)) to avoid runtime errors when fields are missing.

Rationale:
The API response includes additional useful attributes (id, issuedDate, installedDate, status), but the SDK did not expose them. This change makes these values available to client code and prevents silent data loss.

Example:

# Before
obj = SimplePassObject(data)
print(obj.id)  # AttributeError

# After
obj = SimplePassObject(data)
print(obj.id)  # Prints value from API if present

This improves developer experience and brings the Python SDK in line with the full API response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant