Appwrite C++ SDK
Auto-generated API documentation for the Appwrite C++ SDK
Loading...
Searching...
No Matches
Account.hpp
Go to the documentation of this file.
1/// @file Account.hpp
2/// @brief Handles user account-related operations like creation and session
3/// management.
4
5#ifndef ACCOUNT_HPP
6#define ACCOUNT_HPP
7
8#include "Utils.hpp"
11#include <string>
12
13/**
14 * @class Account
15 * @brief Handles user account-related operations like creation and session
16 * management.
17 */
18class Account {
19 public:
20 /**
21 * @brief Constructs an Account object with a specified project ID.
22 * @param projectId The Appwrite project ID.
23 */
24 explicit Account(const std::string &projectId);
25
26 /**
27 * @brief Creates a new user account.
28 * @param email User's email address.
29 * @param password User's password.
30 * @param userId Unique ID for the user.
31 * @param name User's display name.
32 * @return True if account creation is successful, false otherwise.
33 */
34 bool createAccount(const std::string &email, const std::string &password,
35 const std::string &userId, const std::string &name);
36
37 /**
38 * @brief Creates a new session for a user.
39 * @param email User's email address.
40 * @param password User's password.
41 * @return Session token as a string.
42 */
43 std::string createSession(const std::string &email,
44 const std::string &password);
45
46 private:
47 std::string projectId; ///< The project ID used for API calls.
48};
49
50#endif
Declares the base exception class used to represent Appwrite SDK errors.
Defines HTTP status code enums for consistent error and response handling.
Provides utility functions and helpers used across the SDK.
Handles user account-related operations like creation and session management.
Definition Account.hpp:18
bool createAccount(const std::string &email, const std::string &password, const std::string &userId, const std::string &name)
Creates a new user account.
std::string createSession(const std::string &email, const std::string &password)
Creates a new session for a user.
Account(const std::string &projectId)
Constructs an Account object with a specified project ID.