From 6307192addb98adcaf0353ffc890ffc82fe7d354 Mon Sep 17 00:00:00 2001 From: leavesster <11785335+leavesster@users.noreply.github.com> Date: Sat, 31 Jan 2026 14:21:06 +0800 Subject: [PATCH] refactor: convert CredentialInput to dataclass The CredentialInput class was a plain class with a simple __init__. Converting to dataclass provides: - Automatic __repr__ and __eq__ methods - Consistent with other data classes in the codebase - frozen=True makes it immutable for safety - Added docstring and __all__ export --- oocana/oocana/credential.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/oocana/oocana/credential.py b/oocana/oocana/credential.py index fdb3268..d6750c7 100644 --- a/oocana/oocana/credential.py +++ b/oocana/oocana/credential.py @@ -1,4 +1,16 @@ +from dataclasses import dataclass + +__all__ = ["CredentialInput"] + + +@dataclass(frozen=True) class CredentialInput: - def __init__(self, type: str, id: str): - self.type = type - self.id = id \ No newline at end of file + """ + Represents a credential input for authentication queries. + + Attributes: + type: The type of credential (e.g., 'oauth', 'api_key') + id: The unique identifier for the credential + """ + type: str + id: str