snowflake.core.user.UserΒΆ

class snowflake.core.user.User(name: str, password: str | None = None, login_name: str | None = None, display_name: str | None = None, first_name: str | None = None, middle_name: str | None = None, last_name: str | None = None, email: str | None = None, must_change_password: bool | None = None, disabled: bool | None = None, days_to_expiry: int | None = None, mins_to_unlock: int | None = None, default_warehouse: str | None = None, default_namespace: str | None = None, default_role: str | None = None, default_secondary_roles: str | None = 'ALL', mins_to_bypass_mfa: int | None = None, rsa_public_key: str | None = None, rsa_public_key_2: str | None = None, comment: str | None = None, type: str | None = None, enable_unredacted_query_syntax_error: bool | None = None, network_policy: str | None = None, created_on: datetime | None = None, last_successful_login: datetime | None = None, expires_at: datetime | None = None, locked_until: datetime | None = None, has_password: bool | None = None, has_rsa_public_key: bool | None = None, rsa_public_key_fp: str | None = None, rsa_public_key_2_fp: str | None = None, ext_authn_duo: bool | None = None, ext_authn_uid: str | None = None, owner: str | None = None, snowflake_lock: bool | None = False, snowflake_support: bool | None = False, mins_to_bypass_network_policy: int | None = None, password_last_set: datetime | None = None, custom_landing_page_url: str | None = None, custom_landing_page_url_flush_next_ui_load: bool | None = False)ΒΆ

Bases: object

A model object representing the User resource.

Constructs an object of type User with the provided properties.

Parameters:
  • name (str) – User name

  • password (str, optional) – Password

  • login_name (str, optional) – Login name

  • display_name (str, optional) – Display name

  • first_name (str, optional) – First name

  • middle_name (str, optional) – Middle name

  • last_name (str, optional) – Last name

  • email (str, optional) – Email address

  • must_change_password (bool, optional) – Does this user need to change their password (e.g., after assigning a temp password)

  • disabled (bool, optional) – Has this user been disabled from the system

  • days_to_expiry (int, optional) – How many days until this user expires

  • mins_to_unlock (int, optional) – How many minutes until the account is unlocked after multiple failed logins

  • default_warehouse (str, optional) – The default warehouse to use when this user starts a session

  • default_namespace (str, optional) – The default namespace to use when this user starts a session

  • default_role (str, optional) – The default role to use when this user starts a session

  • default_secondary_roles (str, default 'ALL') – The default secondary roles of this user to use when starting a session. Only valid set values are ALL or NONE. Default is ALL after 2024-07 BCR.

  • mins_to_bypass_mfa (int, optional) – How many minutes until MFA is required again

  • rsa_public_key (str, optional) – RSA public key of the user

  • rsa_public_key_2 (str, optional) – Second RSA public key of the user

  • comment (str, optional) – Comment about the user.

  • type (str, optional) – Indicates the type of user (PERSON | SERVICE | LEGACY_SERVICE)

  • enable_unredacted_query_syntax_error (bool, optional) – Whether to show unredacted query syntax errors in the query history.

  • network_policy (str, optional) – Specifies an existing network policy is active for the user. Otherwise, use account default.

  • created_on (datetime, optional)

  • last_successful_login (datetime, optional)

  • expires_at (datetime, optional)

  • locked_until (datetime, optional)

  • has_password (bool, optional)

  • has_rsa_public_key (bool, optional)

  • rsa_public_key_fp (str, optional) – Fingerprint of the user’s RSA public key

  • rsa_public_key_2_fp (str, optional) – Fingerprint of the user’s second RSA public key

  • ext_authn_duo (bool, optional)

  • ext_authn_uid (str, optional)

  • owner (str, optional)

  • snowflake_lock (bool, default False) – Whether the user, account, or organization is locked by Snowflake.

  • snowflake_support (bool, default False) – Whether Snowflake Support is allowed to use the user or account

  • mins_to_bypass_network_policy (int, optional) – Temporary bypass network policy on the user for a specified number of minutes

  • password_last_set (datetime, optional)

  • custom_landing_page_url (str, optional)

  • custom_landing_page_url_flush_next_ui_load (bool, default False) – Whether or not to flush the custom landing page of the user on next UI load

Methods

classmethod from_dict(obj: dict) β†’ UserModelΒΆ

Creates an instance of User from a dict.

This method constructs a User 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 User object created using the input dictionary; this will fail if the required properties are missing.

Return type:

User

to_dict()ΒΆ

Creates a dictionary of the properties from a User.

This method constructs a dictionary with the key-value entries corresponding to the properties of the User object.

Returns:

A dictionary object created using the input model.

Return type:

dict