giga::Application Class Reference

#include <Application.h>

Public Member Functions

 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 
core::Userauthenticate (const utility::string_t &login, const utility::string_t &password)
 Authenticate a user by it's login/password. More...
 
bool isAuthenticated () const
 
const core::UsercurrentUser () const
 
core::UsermutableCurrentUser ()
 
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::UsergetContacts () const
 Call the GiGa API to get all the currentUser contacts. More...
 
std::vector< core::UsergetInvitingUsers () const
 Call the GiGa API to get all the currentUser received invitations. More...
 
std::vector< core::UsergetInvitedUsers () const
 Call the GiGa API to get all the currentUser sent invitations. More...
 
std::vector< core::UsergetSuggestedUsers () const
 Call the GiGa API to get the suggested users. More...
 
std::vector< core::UsergetBlockedUsers () const
 Call the GiGa API to get the blocked users. More...
 
std::vector< core::UsersearchUser (const utility::string_t &search) const
 Search users by login and tag. More...
 
std::unique_ptr< core::NodegetNodeById (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 GigaApiapi () const
 
GigaApimutableApi ()
 

Friends

web::uri core::FileNodeData::fileUrl () const
 
std::unique_ptr< core::Nodegiga::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 
)

Authenticate a user by it's login/password.

Returns
The current user.
See Also
currentUser()
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 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.

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