示例#1
0
    def update_user(self, username, first_name, last_name,
                    email, password):
        """Asks the client to update the user record"""

        req = UserRequest()
        req.username = username
        req.first_name = first_name
        req.last_name = last_name
        req.email = email
        req.password = password

        return self._make_request('user?username=%s' % username, data=req.new_user_json(), method='PUT')
示例#2
0
    def create_user(self, username, first_name, last_name,
                    email, password):
        """Asks the client to create a user with the given information
            Params:
                username - login name for the user
                first_name - The name given to the user for use in an informal setting
                last_name - The name of the user's family
                email - Email address
                password - User's desired password
        """

        req = UserRequest()
        req.username = username
        req.first_name = first_name
        req.last_name = last_name
        req.email = email
        req.password = password

        return self._make_request('user', data=req.new_user_json())