snowflake.core.role.Role¶
- class snowflake.core.role.Role(name: str, comment: str | None = None, created_on: datetime | None = None, owner: str | None = None, is_default: bool | None = None, is_current: bool | None = None, is_inherited: bool | None = None, assigned_to_users: int | None = None, granted_to_roles: int | None = None, granted_roles: int | None = None)¶
Bases:
object
A model object representing the Role resource.
Constructs an object of type Role with the provided properties.
- Parameters:
name (str) – Name of the role.
comment (str, optional) – Comment of the role.
created_on (datetime, optional) – Date and time when the role was created.
owner (str, optional) – Specifies the role that owns this role.
is_default (bool, optional) – Specifies whether the role being fetched is the user’s default role.
is_current (bool, optional) – Specifies whether the role being fetched is the user’s current role.
is_inherited (bool, optional) – Specifies whether the role used to run the command inherits the specified role.
assigned_to_users (int, optional) – The number of users to whom this role has been assigned.
granted_to_roles (int, optional) – The number of roles to which this role has been granted.
granted_roles (int, optional) – The number of roles that have been granted to this role.
Methods
- classmethod from_dict(obj: dict) RoleModel ¶
Creates an instance of Role from a dict.
This method constructs a Role object from a dictionary with the key-value pairs of its properties.
- Parameters:
obj (dict) – A dictionary whose keys and values correspond to the properties of the resource object.
- Returns:
A Role object created using the input dictionary; this will fail if the required properties are missing.
- Return type:
- to_dict()¶
Creates a dictionary of the properties from a Role.
This method constructs a dictionary with the key-value entries corresponding to the properties of the Role object.
- Returns:
A dictionary object created using the input model.
- Return type:
dict