Add a new protocol class that can be used to uniquely identify a resource
within a given store namespace. The idea is to use this key class where
a resource can be ID'd by either one metadata field or by two allowing
more common interfaces and fewer special code paths.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
d5fb7f8c2ba84ac9ecfc38365027f2c3a6531130)
FindParams = Dict[str, Any]
+class ResourceKey(Protocol):
+ """An object representing a key for a singular object in a store.
+ This key may be comprised of one or more input values.
+ """
+
+ def __str__(self) -> str:
+ ... # pragma: no cover
+
+
class ConfigEntry(Protocol):
"""A protocol for describing a configuration object that can be kept within
a configuration store. Has the ability to identify itself either by a