#include <Application.h>
Public Member Functions | |
Application (const Application &)=delete | |
Application & | operator= (const Application &)=delete |
Application (Application &&)=delete | |
Application & | operator= (Application &&)=delete |
core::User & | authenticate (const utility::string_t &login, const utility::string_t &password) |
Authenticate a user by it's login/password. More... | |
bool | isAuthenticated () const |
const core::User & | currentUser () const |
core::User & | mutableCurrentUser () |
core::User | getUserById (uint64_t id) const |
Call the GiGa API to get a users' informations. More... | |
core::User | getUserByLogin (const utility::string_t &login) const |
Call the GiGa API to get a users' informations. More... | |
core::User | getContact (uint64_t id) const |
Call the GiGa API to get a contact of the currentUser, including core::User::contactData() and core::User::relation() More... | |
std::vector< core::User > | getContacts () const |
Call the GiGa API to get all the currentUser contacts. More... | |
std::vector< core::User > | getInvitingUsers () const |
Call the GiGa API to get all the currentUser received invitations. More... | |
std::vector< core::User > | getInvitedUsers () const |
Call the GiGa API to get all the currentUser sent invitations. More... | |
std::vector< core::User > | getSuggestedUsers () const |
Call the GiGa API to get the suggested users. More... | |
std::vector< core::User > | getBlockedUsers () const |
Call the GiGa API to get the blocked users. More... | |
std::vector< core::User > | searchUser (const utility::string_t &search) const |
Search users by login and tag. More... | |
std::unique_ptr< core::Node > | getNodeById (const std::string &id) const |
look for a node by its id | |
std::vector< std::unique_ptr < core::Node > > | searchNode (const utility::string_t &search, core::Node::MediaType type) const |
search for a node by its name and type | |
const std::string & | userAgent () const |
void | setUserAgent (std::string &&userAgent) |
const GigaApi & | api () const |
GigaApi & | mutableApi () |
Friends | |
web::uri | core::FileNodeData::fileUrl () const |
std::unique_ptr< core::Node > | giga::core::Node::copyOrMoveTo (const FolderNode &node, bool isMove, MergePolicy policy=MergePolicy::renameSource) const |
Detailed Description
The Application class is the entry point to access the GiGa API. The Application must be authenticated (once and only once).
- See Also
- authenticate (const utility::string_t& login, const utility::string_t& password)
Member Function Documentation
core::User & giga::Application::authenticate | ( | const utility::string_t & | login, |
const utility::string_t & | password | ||
) |
const core::User & giga::Application::currentUser | ( | ) | const |
- Returns
- The currently logged user (when you called
authenticate(const utility::string_t&, const utility::string_t&)
).
std::vector< core::User > giga::Application::getBlockedUsers | ( | ) | const |
Call the GiGa API to get the blocked users.
Use core::User::removeRelation()
to unblock a user.
- Returns
- the list of blocked users
- Exceptions
-
HttpError
core::User giga::Application::getContact | ( | uint64_t | id | ) | const |
Call the GiGa API to get a contact of the currentUser, including core::User::contactData()
and core::User::relation()
This method may look for the data in the cache (which should be ok most of the time). If you really need to make sure the cache is up to date, you can call Application::getContacts() const.
If the user with this id is not one of the currentUser contacts, then an ErrorNotFound exception is thrown.
- Returns
- the contact
- Exceptions
-
HttpError
- See Also
- getContacts() const
std::vector< core::User > giga::Application::getContacts | ( | ) | const |
Call the GiGa API to get all the currentUser contacts.
- To get the contact specific information, use
core::User::relation() const
. - To get the informations restricted to its contacts, use
core::User::contactData()
. This will include the rootcore::Node
shared with the currentUser (seecore::User::ContactData::node() const
).
To get a new contact you need to accept other user invitation, or send invitations and then get accepted.
You can remove a contact by using: core::User::removeRelation()
This method will refresh the local contact cache.
- Returns
- the contact list
- Exceptions
-
HttpError
- See Also
- core::User::invite()
std::vector< core::User > giga::Application::getInvitedUsers | ( | ) | const |
Call the GiGa API to get all the currentUser sent invitations.
Use core::User::relation() const
to get the sent invitation specific information.
To cancel a sent invitation use core::User::removeRelation()
- Returns
- the list of sent invitation
- Exceptions
-
HttpError
- See Also
- core::User::invite()
std::vector< core::User > giga::Application::getInvitingUsers | ( | ) | const |
Call the GiGa API to get all the currentUser received invitations.
Use core::User::relation() const
to get the received invitation specific information.
- You can accept an invitation to get a new contact:
core::User::acceptInvitation()
- Or you can refuse an invitation:
core::User::removeRelation()
- Returns
- the list of received invitation
- Exceptions
-
HttpError
std::vector< core::User > giga::Application::getSuggestedUsers | ( | ) | const |
Call the GiGa API to get the suggested users.
Use core::User::relation() const
to get the suggested user specific information. Use core::User::removeRelation()
to remove a suggestion.
- Returns
- the list of suggested users
- Exceptions
-
HttpError
core::User giga::Application::getUserById | ( | uint64_t | id | ) | const |
Call the GiGa API to get a users' informations.
WARINIG: the core::User::relation()
is never set when getting a user with this method. The core::User::contactData()
is not set either. To have the relation and associated data of a user you need to use getContacts() / getInvitingUsers() / getInvitedUsers() / getSuggestedUsers() / getBlockedUsers().
- Returns
- the user
- Exceptions
-
HttpError
core::User giga::Application::getUserByLogin | ( | const utility::string_t & | login | ) | const |
Call the GiGa API to get a users' informations.
- See Also
- getUserById(uint64_t) const
bool giga::Application::isAuthenticated | ( | ) | const |
- Returns
- true if the
authenticate()
method has been called and successfull.
core::User & giga::Application::mutableCurrentUser | ( | ) |
- Returns
- The currently logged user (when you called
authenticate(const utility::string_t&, const utility::string_t&)
).
std::vector< core::User > giga::Application::searchUser | ( | const utility::string_t & | search | ) | const |
Search users by login and tag.
WARINIG: the core::User::relation()
is never set when getting a user with this method. The core::User::contactData()
is not set either. To have the relation and associated data of a user you need to use getContacts() / getInvitingUsers() / getInvitedUsers() / getSuggestedUsers() / getBlockedUsers().
- Returns
- the list of matching users
- Exceptions
-
HttpError
The documentation for this class was generated from the following files:
- /home/thomas/code/GiGaSdk/src/giga/Application.h
- /home/thomas/code/GiGaSdk/src/giga/Application.cpp