def get_user_session(self, args):
self._set_verbose_mode(args.verbose)<EOL>session = self._sdk.GATDLSession(username=args.username, password=args.password, enterprise=args.enterprise, api_url=args.api)<EOL>try:<EOL><INDENT>session.start()<EOL><DEDENT>except BambouHTTPError as error:<EOL><INDENT>status_code = error.connection.response.status_code<EOL>if status_code == <NUM_LIT>:<EOL><INDENT>Printer.raise_error("<STR_LIT>" % (args.api, args.version, args.username, args.password, args.enterprise))<EOL><DEDENT>else:<EOL><INDENT>Printer.raise_error("<STR_LIT>" % (args.api, status_code, args.version))<EOL><DEDENT><DEDENT>root_object = session.root_object<EOL>if root_object.api_key is None:<EOL><INDENT>Printer.raise_error("<STR_LIT>")<EOL><DEDENT>return session<EOL>
Get api key

            Args:
                username: username to get an api key
                password: password to get an api key
                api: URL of the API endpoint
                enterprise: Name of the enterprise to connect

            Returns:
                Returns an API Key if everything works fine