pyrelukko.relukko_dto module¶
Pyrelukko module for the dataclass RelukkoDTO
- class pyrelukko.relukko_dto.RelukkoDTO(id, lock_name, creator, ip, expires_at, created_at, updated_at)¶
Bases:
objectData Transfer Object representing a Relukko lock.
Contains all metadata associated with a lock including identifiers, creator information, network details, and timestamps. Instances are immutable once created and support dict-like access patterns.
- Parameters:
id (UUID)
lock_name (str)
creator (str)
ip (str)
expires_at (datetime)
created_at (datetime)
updated_at (datetime)
- created_at: datetime¶
- creator: str¶
- expires_at: datetime¶
- classmethod from_dict(data)¶
Create a RelukkoDTO instance from a dictionary.
- Parameters:
data (dict) – Dictionary containing lock data from the API
- Returns:
RelukkoDTO instance
- Return type:
- get(key, default=None)¶
Get field value with optional default.
- Parameters:
key (str) – Field name to access
default (Any) – Default value if key doesn’t exist
- Returns:
Field value or default
- Return type:
Any
- id: UUID¶
- ip: str¶
- lock_name: str¶
- to_dict()¶
Convert the RelukkoDTO instance to a dictionary.
- Returns:
Dictionary representation of the lock data with string representations
- Return type:
dict
- updated_at: datetime¶