13 #include "iberbox/config.h" 14 #include "iberbox/ownership.h" 25 #include <condition_variable> 28 #include <scapix/bridge/object.h> 34 typedef std::shared_ptr<ActionData>
Action;
43 :
public scapix::bridge::object<ActionData>
185 static const char *sActionNames[] =
221 "CLEAR_FINISHED_TRANSFERS",
223 "SET_TRANSFER_SPEED_LIMIT",
224 "GET_TRANSFER_SPEED_LIMIT",
227 "GET_CURRENT_DEVICE",
237 "CHANGE_BACKUP_SCHEDULE",
238 "CHANGE_BACKUP_PATH",
239 "CHANGE_BACKUP_STATUS",
243 "GET_NEXT_SNAPSHOTS",
244 "GET_NEXT_SNAPSHOTS_BY_DEVICE",
245 "GET_NEXT_SNAPSHOTS_BY_BACKUP",
246 "GET_NEXT_SNAPSHOTS_BY_ACCOUNT",
247 "GET_NEXT_SNAPSHOTS_BY_SCHEDULE",
248 "GET_LAST_SNAPSHOTS",
249 "GET_LAST_SNAPSHOTS_BY_DEVICE",
250 "GET_LAST_SNAPSHOTS_BY_BACKUP",
251 "GET_LAST_SNAPSHOTS_BY_ACCOUNT",
258 "REMOVE_FROM_RECORD",
261 "SUBSCRIPTION_OPTIONS",
263 "REMOVE_PAYMENT_METHOD",
264 "SET_INVOICING_ADDRESS",
278 "ADD_PAYMENT_METHOD",
281 "REVOKE_ACCOUNT_ACCESS",
285 "MANAGE_SENT_RECORDS",
290 "MANAGE_SHARED_DRIVES",
296 "NOTICE_CREDENTIALS",
297 "MANAGE_FOLDER_SYNC",
299 static_assert((
sizeof(sActionNames) /
sizeof(sActionNames[0]) ==
ActionData::LAST),
"Invalid number of action names");
590 std::vector<uint8_t> *
getData();
645 uint64_t mCompletedSize;
647 std::string mAccountHandle;
649 std::string mUserHandle;
655 std::string mNodeHandle;
656 std::string mParentHandle;
658 std::vector<uint8_t> mData;
663 ActionList mActionList;
677 std::string mCustomData;
685 ,
public scapix::bridge::object<ActionListener>
698 ActionListener(std::function<
void(Action)> progressCallback, std::function<
void(Action)> finishCallback);
699 ActionListener(std::function<
void(Action)> errorCallback, std::function<
void(Action)> progressCallback, std::function<
void(Action)> finishCallback);
700 ActionListener(std::function<
void(Action)> startCallback, std::function<
void(Action)> errorCallback, std::function<
void(Action)> progressCallback, std::function<
void(Action)> finishCallback);
704 void setStartCallback(std::function<
void(Action)> startCallback);
705 void setErrorCallback(std::function<
void(Action)> errorCallback);
706 void setProgressCallback(std::function<
void(Action)> progressCallback);
707 void setFinishCallback(std::function<
void(Action)> finishCallback);
713 virtual void onActionStart(Action action);
718 virtual void onActionProcessed(Action action);
723 virtual void onActionProgress(Action action);
728 virtual void onActionError(Action action);
733 virtual void onActionFinish(Action action);
736 std::function<void(Action)> mStartCallback;
737 std::function<void(Action)> mProgressCallback;
738 std::function<void(Action)> mFinishCallback;
739 std::function<void(Action)> mErrorCallback;
763 virtual void onActionFinish(Action action)
override;
768 virtual void onActionProgress(Action action)
override;
774 virtual void setOwnership(
bool external_or_cpp)
override;
786 std::condition_variable mConditionVariable;
799 #define MODIFY_ATTRIBUTES(NodeVarName) \ 800 mApiManager->mCloudCache->encryptNode(NodeVarName, [this, action, NodeVarName](EncryptedNode encryptedNode) \ 802 action->setEncryptedAttributes(new std::vector<uint8_t>(*encryptedNode->getEncryptedAttributes())); \ 803 action->setNode(NodeVarName); \ 804 action->setIntValue(NodeVarName->getExtraNumber()); \ 805 notifyProcessed(action); \ 806 mApiManager->processApiRequest(std::make_shared<RenameNodeRequest>(action, mApiManager->getClientId()), this); \ std::shared_ptr< CouponInfoDataList > CouponInfoList
Definition: account.h:340
uint64_t getNodeId() const
Gets the node identifier.
StringList getStringList() const
Gets the string list.
std::shared_ptr< BalancesInfoData > BalancesInfo
Definition: account.h:305
Transfer getTransfer() const
Gets the transfer.
Change password action.
Definition: action.h:57
The Blocking Action Listener class.
Definition: action.h:745
Copy node action.
Definition: action.h:70
SessionInfoList getActiveSessions() const
Gets the active sessions.
Get node action.
Definition: action.h:64
const char * getActionName() const
Gets the name of the action.
Error getError() const
Gets the error.
uint64_t getParentId() const
Gets the parent node identifier.
const std::string getTextString() const
Gets the text.
std::shared_ptr< CommandLogDataList > CommandLogList
Definition: account.h:400
The iberbox namespace.
Definition: task.h:21
Get nodes action.
Definition: action.h:61
Get the tree of descendants of a node.
Definition: action.h:151
int getIntValue() const
Gets the int value.
uint64_t getAccountId() const
Gets the account identifier.
std::shared_ptr< InvoicingInfoData > InvoicingInfo
Definition: payments.h:300
uint64_t getUserId() const
Gets the user identifier.
const char * getSession() const
Gets the session.
Get children action.
Definition: action.h:63
Account info actions.
Definition: action.h:74
CommandLogList getLog() const
Gets the commands log for the current account.
Test action.
Definition: action.h:52
const char * getLink() const
Gets the link.
ActionListener * ActionListenerType
Definition: action.h:794
uint64_t NodeHandle
Definition: node.h:26
const char * getPassword() const
Gets the password.
CouponInfoList getCoupons() const
Gets the coupons.
bool isFinished() const
Gets whether the action is finished or not.
NodeList getNodeList() const
Gets the node list.
const std::string getCustomData() const
Get custom data set by the app.
Add contact action.
Definition: action.h:53
const std::string getAccountStringHandle() const
Gets the account string handle.
PermissionInfoList getAccountPermissions() const
Gets the permissions a user has in every joined account.
const char * getLastName() const
Gets the last name.
NodeHandle getNodeHandle() const
Gets the node identifier.
long getLongValue() const
Gets the long value.
std::shared_ptr< AccountInfoData > AccountInfo
Definition: account.h:221
std::shared_ptr< NodeData > Node
Definition: node.h:666
Move node action.
Definition: action.h:69
SubscriptionInfoList getSubscriptionInfoList() const
Gets the subscription info list.
std::vector< Action > ActionDataList
Definition: action.h:35
Manager folder sync flag.
Definition: action.h:162
Delete node action.
Definition: action.h:67
const std::string getActionNameString() const
Gets the name of the action.
const std::string getPasswordString() const
Gets the password.
Manage secret spaces.
Definition: action.h:147
AccountInfo getAccountInfo() const
Gets the account info.
The Action Data class.
Definition: action.h:41
TransferList getTransferList() const
Gets the transfer list.
Manage contacts.
Definition: action.h:148
BalancesInfo getBalancesInfo() const
Gets the balances info.
std::shared_ptr< PermissionInfoDataList > PermissionInfoList
Definition: account.h:366
ActionType
The action type enum.
Definition: action.h:50
Forgot password action.
Definition: action.h:55
const std::string getLinkString() const
Gets the link.
std::vector< uint8_t > * getData()
Gets the data.
Get path aciton.
Definition: action.h:65
Create and check join links as well as joining an account.
Definition: action.h:144
ActionList getActionList() const
Gets the action list.
std::shared_ptr< PaymentInfoData > PaymentInfo
Definition: payments.h:215
uint64_t getTotalSize() const
Gets the total size.
Revoke account access.
Definition: action.h:146
std::shared_ptr< NodeDataList > NodeList
Definition: node.h:668
PermissionInfoList getUserPermissions() const
Gets the permissions every joined user has for the current account.
const std::string getNameString() const
Gets the name.
const std::string getLastNameString() const
Gets the last name.
Manage shared drives.
Definition: action.h:155
const char * getName() const
Gets the name.
std::shared_ptr< TransferData > Transfer
Definition: transfer.h:245
Create link action.
Definition: action.h:71
InvoicingInfo getInvoicingInfo() const
Gets the invoicing info.
const char * getText() const
Gets the text.
std::shared_ptr< UserInfoData > UserInfo
The user info type.
Definition: user.h:105
std::shared_ptr< ActionData > Action
Definition: action.h:33
std::shared_ptr< StringVector > StringList
Definition: node.h:674
bool isProcessed() const
Gets whether the action is processed or not.
Add nodea action.
Definition: action.h:66
std::shared_ptr< TransferDataList > TransferList
Definition: transfer.h:247
int getTag() const
Gets the Tag object.
int getErrorType() const
Gets the error type.
Get root nodes action.
Definition: action.h:62
Rename node action.
Definition: action.h:68
Node getNode() const
Gets the node.
Manage outboxes.
Definition: action.h:149
const char * getEmail() const
Gets the email.
const char * getErrorName() const
Gets the error name.
Verify email action.
Definition: action.h:54
const std::string getSessionString() const
Gets the session.
The error class.
Definition: error.h:25
int getLocalTag() const
Gets the local tag of an action.
Get link info action.
Definition: action.h:72
std::shared_ptr< CouponInfoData > CouponInfo
Definition: account.h:338
std::shared_ptr< SessionInfoDataList > SessionInfoList
Definition: account.h:227
Manage sent records.
Definition: action.h:150
CouponInfo getCoupon() const
Gets the coupon.
const std::string getErrorNameString() const
Gets the error name.
std::shared_ptr< ActionDataList > ActionList
Definition: action.h:36
NumberList getNumberList() const
Gets the number list.
Get notice email credentials.
Definition: action.h:161
PaymentInfo getPaymentInfo() const
Gets the payment info.
uint64_t getCompletedSize() const
Gets the completed size.
static const std::string getTypeNameString(unsigned type)
Gets the event type name.
Definition: action.h:309
Replace default account.
Definition: action.h:145
std::shared_ptr< SubscriptionInfoDataList > SubscriptionInfoList
Definition: payments.h:28
Manage2faOperation
The manage 2-Factor Authentication operation enum.
Definition: action.h:170
User info actions.
Definition: action.h:73
int getStatus() const
Gets the status.
static const char * getTypeName(unsigned type)
Gets the event type name.
Definition: action.h:183
The Action Listener class.
Definition: action.h:683
Verify file hash.
Definition: action.h:160
int getType() const
Gets the type of the action.
Create account action.
Definition: action.h:56
NodeHandle getAccountHandle() const
Gets the account handle.
SessionInfoList getInactiveSessions() const
Gets the inactive sessions.
std::shared_ptr< NumberVector > NumberList
Definition: node.h:671
Get commands log.
Definition: action.h:159
const std::string getEmailString() const
Gets the email.
UserInfo getUserInfo() const
Gets the user info.
Set a configuration value of the account.
Definition: action.h:152