wallaroo.user_type
1from enum import Enum 2 3 4class UserType(str, Enum): 5 """Represents a workspace user's role.""" 6 7 OWNER = "owner" 8 COLLABORATOR = "collaborator" 9 10 @staticmethod 11 def from_str(label: str): 12 """Creates a UserType from a str""" 13 label = label.lower() 14 if label == "collaborator": 15 return UserType.COLLABORATOR 16 elif label == "owner": 17 return UserType.OWNER 18 else: 19 raise NotImplementedError
class
UserType(builtins.str, enum.Enum):
5class UserType(str, Enum): 6 """Represents a workspace user's role.""" 7 8 OWNER = "owner" 9 COLLABORATOR = "collaborator" 10 11 @staticmethod 12 def from_str(label: str): 13 """Creates a UserType from a str""" 14 label = label.lower() 15 if label == "collaborator": 16 return UserType.COLLABORATOR 17 elif label == "owner": 18 return UserType.OWNER 19 else: 20 raise NotImplementedError
Represents a workspace user's role.
OWNER = <UserType.OWNER: 'owner'>
COLLABORATOR = <UserType.COLLABORATOR: 'collaborator'>
@staticmethod
def
from_str(label: str):
11 @staticmethod 12 def from_str(label: str): 13 """Creates a UserType from a str""" 14 label = label.lower() 15 if label == "collaborator": 16 return UserType.COLLABORATOR 17 elif label == "owner": 18 return UserType.OWNER 19 else: 20 raise NotImplementedError
Creates a UserType from a str
Inherited Members
- enum.Enum
- name
- value
- builtins.str
- encode
- replace
- split
- rsplit
- join
- capitalize
- casefold
- title
- center
- count
- expandtabs
- find
- partition
- index
- ljust
- lower
- lstrip
- rfind
- rindex
- rjust
- rstrip
- rpartition
- splitlines
- strip
- swapcase
- translate
- upper
- startswith
- endswith
- removeprefix
- removesuffix
- isascii
- islower
- isupper
- istitle
- isspace
- isdecimal
- isdigit
- isnumeric
- isalpha
- isalnum
- isidentifier
- isprintable
- zfill
- format
- format_map
- maketrans