commands.users

module commands.users

Global Variables

  • API_HOST


function create

create(
    debug: Optional[bool] = DEBUG_OPTION
)None

Command to create a user. Asks for the new users information and validates the input, then sends the information to the API

Args:

  • debug (Optional[bool], optional): Whether to add debug information, will show requests, extra logs and traceback if there is an Exception. Defaults to DEBUG_OPTION (False).

Raises:

  • ValidationError: input fields are validated, if these are not suitable the exception is raised

  • HTTPError: request error to the API, 4XX or 5XX


function login

login(
    renew: bool = typer.Option(False, help="Force the renewal of the JWT token"),
    debug: Optional[bool] = DEBUG_OPTION
)None

Logs the current user into Giza. Under the hood this will retrieve the token for the next requests. This token will be saved at home directory for further usage.

Args:

  • renew (bool): Force the retrieval of the token to create a new one. Defaults to False.

  • debug (Optional[bool]): Whether to add debug information, will show requests, extra logs and traceback if there is an Exception. Defaults to DEBUG_OPTION (False)

Raises:

  • HTTPError: request error to the API, 4XX or 5XX


function create_api_key

create_api_key(
    debug: Optional[bool] = DEBUG_OPTION
)None

Create an API key for your user. You need to be logged in to create an API key. The API Key will be saved at home directory for further usage.

Args:

  • debug (Optional[bool]): Whether to add debug information, will show requests, extra logs and traceback if there is an Exception. Defaults to DEBUG_OPTION (False)

  • renew (bool): Force the retrieval of the token to create a new one. Defaults to False.

Raises:

  • HTTPError: request error to the API, 4XX or 5XX


function me

me(
    debug: Optional[bool] = DEBUG_OPTION
)None

Retrieve information about the current user and print it as json to stdout.

Args:

  • debug (Optional[bool], optional): Whether to add debug information, will show requests, extra logs and traceback if there is an Exception. Defaults to DEBUG_OPTION (False)


function resend_email

resend_email(
    debug: Optional[bool] = DEBUG_OPTION
)None

Command to resend verification email. Asks for the user's email and sends the request to the API

Args:

  • debug (Optional[bool], optional): Whether to add debug information, will show requests, extra logs and traceback if there is an Exception. Defaults to DEBUG_OPTION (False).

Raises:

  • ValidationError: input fields are validated, if these are not suitable the exception is raised

  • HTTPError: request error to the API, 4XX or 5XX

Last updated