steps.api.cloud_objects.cloud_user ================================== .. py:module:: steps.api.cloud_objects.cloud_user Attributes ---------- .. autoapisummary:: steps.api.cloud_objects.cloud_user.SYMBOLS steps.api.cloud_objects.cloud_user.ALPHABET steps.api.cloud_objects.cloud_user.CHAR_REPLACE_MAP Classes ------- .. autoapisummary:: steps.api.cloud_objects.cloud_user.User Module Contents --------------- .. py:data:: SYMBOLS :value: '*.!@#$%^&(){}[]:;<>,.?/~_+-=|\\' .. py:data:: ALPHABET :value: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789*.!@#$%^&(){}[]:;<>,.?/~_+-=|\\' .. py:data:: CHAR_REPLACE_MAP .. py:class:: User(first_name: str = '', last_name: str = '', user_id: int = -1, email: str = '', password: str = '', platform_ids: list[str] = [], is_admin: bool = False, priority: int = 2, company_id: int = None, **kwargs) Bases: :py:obj:`steps.api.cloud_objects.cloud_base.ACloudObject` User class representing a user in the cloud system. This class handles all user-related operations including user creation, authentication, token management, and CRUD operations. :param first_name: User's first name :param last_name: User's last name :param user_id: User's ID (defaults to -1 for new users) :param email: User's email address :param password: User's password :param platform_ids: List of platform IDs the user has access to :param is_admin: Whether the user has admin privileges :param priority: User's priority level (default: 2) :param company_id: User's company ID :param kwargs: Additional attributes to set on the user .. py:attribute:: EMAIL_KEY :value: 'email' .. py:attribute:: PASSWORD_KEY :value: 'password' .. py:attribute:: FIRST_NAME_KEY :value: 'first_name' .. py:attribute:: LAST_NAME_KEY :value: 'last_name' .. py:attribute:: PLATFORM_IDS_KEY :value: 'platform_ids' .. py:attribute:: IS_ADMIN_KEY :value: 'is_admin' .. py:attribute:: COMPANY_ID_KEY :value: 'company_id' .. py:attribute:: PRIORITY_KEY :value: 'priority' .. py:method:: get_object_name() -> str :classmethod: .. py:method:: get_endpoint() -> str :classmethod: .. py:method:: get_api(context: steps.api.utils.CloudContext) -> steps.api.utils.Api :classmethod: .. py:method:: get_token_method() -> str :classmethod: .. py:method:: get_token(token_type: steps.api.cloud_objects.cloud_base.TokenType) -> None Get a token of the specified type for this user. :param token_type: Type of token to retrieve :return: Token string for the requested token type :raises NotImplementedError: If the token type is not supported .. py:attribute:: first_name :type: str :value: '' .. py:attribute:: last_name :type: str :value: '' .. py:attribute:: email :type: str :value: '' .. py:attribute:: password :type: str :value: '' .. py:attribute:: user_id :type: int .. py:attribute:: is_admin :type: bool :value: False .. py:attribute:: priority :type: int :value: 2 .. py:attribute:: company_id :type: int :value: None .. py:attribute:: platform_ids :type: list[str] :value: [] .. py:attribute:: job_tokens :type: list[steps.api.cloud_objects.cloud_token.JobToken] :value: [] .. py:attribute:: login_token :type: steps.api.cloud_objects.cloud_token.LoginToken .. py:attribute:: api_key :type: steps.api.cloud_objects.cloud_token.ApiKey :value: None .. py:method:: keys() -> list[str] .. py:method:: generate_data() -> None Generate email and password data for this user. Creates a standardized email based on first and last name, and generates a secure random password that meets complexity requirements. .. py:method:: create(context: steps.api.utils.CloudContext, user: User) -> None Create this user in the cloud. :param context: Cloud context for API configuration :param user: User providing authentication for the creation :raises RuntimeError: If user creation fails :raises AssertionError: If trying to create an admin user .. py:method:: read(context: steps.api.utils.CloudContext, user=None) -> dict[str] Read this user's information from the cloud. :param context: Cloud context for API configuration :param user: User providing authentication (defaults to self) :return: Dictionary with user data from response :raises RuntimeError: If reading user data fails :raises AssertionError: If the user has not been created yet .. py:method:: update(context: steps.api.utils.CloudContext, user, update_dict: dict[str]) -> None Update this user's information in the cloud. :param context: Cloud context for API configuration :param user: User providing authentication (defaults to self) :param update_dict: Dictionary with fields to update :raises RuntimeError: If updating user data fails :raises AssertionError: If the user has not been created yet .. py:method:: delete(context: steps.api.utils.CloudContext, user: User) -> None Delete this user from the cloud. :param context: Cloud context for API configuration :param user: User providing authentication :raises RuntimeError: If deleting the user fails :raises AssertionError: If the user has not been created or is an admin .. py:method:: log(context: steps.api.utils.CloudContext) -> None Login the user and obtain a login token. :param context: Cloud context for API configuration :raises AssertionError: If the user is not an admin and hasn't been created .. py:method:: create_job_token(context: steps.api.utils.CloudContext, token_dict: dict[str]) -> None Create a job token for this user. :param context: Cloud context for API configuration :param token_dict: Dictionary with token parameters :raises AssertionError: If the user hasn't been created .. py:method:: create_api_key(context: steps.api.utils.CloudContext, api_key_dict: dict[str]) -> None Create an API key for this user. :param context: Cloud context for API configuration :param api_key_dict: Dictionary with API key parameters :raises AssertionError: If the user hasn't been created .. py:method:: list_all(context: steps.api.utils.CloudContext, admin: User) -> list[User] :classmethod: List all users in the cloud. :param context: Cloud context for API configuration :param admin: Admin user providing authentication :return: List of User objects :raises RuntimeError: If listing users fails :raises AssertionError: If the authenticating user is not an admin