Resource ID

ResourceId

ResourceId is a NewType wrapping str. It represents a unique identifier for a resource.

Valid resource IDs match the regex [\w@-]+ (word characters, @ and -).

Functions

  • parse_resource_id(raw: str) -> ResourceId — parses a raw string into a validated ResourceId. Raises ResourceIdParseError if the string is invalid.

  • is_resource_id(raw: str) -> TypeGuard[ResourceId] — returns True if the string is a valid resource ID (can be used as a type guard).