123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713 |
- //
- // OCWebDAVClient.h
- // OCWebDAVClient
- //
- // This class is based in https://github.com/zwaldowski/DZWebDAVClient. Copyright (c) 2012 Zachary Waldowski, Troy Brant, Marcus Rohrmoser, and Sam Soffes.
- //
- // Copyright (C) 2016, ownCloud GmbH. ( http://www.owncloud.org/ )
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to deal
- // in the Software without restriction, including without limitation the rights
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- // copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- // THE SOFTWARE.
- //
- //
- // Add : getNotificationServer & setNotificationServer
- // Add : getUserProfileServer
- // Add : Support for Favorite
- // Add : getActivityServer
- //
- // Author Marino Faggiana <marino.faggiana@nextcloud.com>
- // Copyright (c) 2017 Marino Faggiana. All rights reserved.
- //
- #import "OCHTTPRequestOperation.h"
- @import AFNetworking;
- @class OCCommunication;
- @class OCChunkDto;
- /** The key for a uniform (MIME) type identifier returned from the property request methods. */
- extern NSString * _Nullable OCWebDAVContentTypeKey;
- /** The key for a unique entity identifier returned from the property request methods. */
- extern NSString * _Nullable OCWebDAVETagKey;
- /** The key for a content identifier tag returned from the property request methods. This is only supported on some servers, and usually defines whether the contents of a collection (folder) have changed. */
- extern NSString * _Nullable OCWebDAVCTagKey;
- /** The key for the creation date of an entity. */
- extern NSString * _Nullable OCWebDAVCreationDateKey;
- /** The key for last modification date of an entity. */
- extern NSString * _Nullable OCWebDAVModificationDateKey;
- @interface OCWebDAVClient : NSObject
- @property (readwrite, nonatomic, strong) NSMutableDictionary * _Nullable defaultHeaders;
- //On redirections AFNetworking lose the request method on iOS6 and set a GET, we use this as workarround
- @property (nonatomic, strong) NSString * _Nullable requestMethod;
- //We use this variable to return the url of a redirected server to detect if we receive any sesion expired on SSO server
- @property (nonatomic, strong) NSString * _Nullable redirectedServer;
- //We use this variable to get the Cookies from the storage provider
- @property (nonatomic, strong) NSString * _Nullable originalUrlServer;
- @property (nonatomic, strong) NSString * _Nullable postStringForShare;
- // E2EE Metadata
- @property (nonatomic, strong) NSString * _Nullable postStringMetadata;
- // E2EE privateKey, publicKey
- @property (nonatomic, strong) NSString * _Nullable postStringKey;
- /**
- Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header.
-
- @param username The HTTP basic auth username
- @param password The HTTP basic auth password
- */
- - (void)setAuthorizationHeaderWithUsername:(NSString * _Nonnull)username
- password:(NSString * _Nonnull)password;
- /**
- Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header.
-
- @param cookieString The HTTP token to login on SSO Servers
- */
- - (void)setAuthorizationHeaderWithCookie:(NSString * _Nonnull) cookieString;
- /**
- Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a token-based authentication value, such as an OAuth access token. This overwrites any existing value for this header.
-
- @param token The authentication token
- */
- - (void)setAuthorizationHeaderWithToken:(NSString * _Nonnull)token;
- /**
- Sets the "User-Agent" HTTP header
-
- @param userAgent -> String that indentifies the client app. Ex: "iOS-ownCloud"
- */
- - (void)setUserAgent:(NSString * _Nonnull)userAgent;
- /**
- Add Header
- */
- - (void)setDefaultHeader:(NSString * _Nonnull)header value:(NSString *_Nullable)value;
- /**
- Enqueues an operation to move the object at a path to another path using a `MOVE` request.
-
- @param source The path to move.
- @param destination The path to move the item to.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with no arguments.
- @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and the network error that occurred.
- */
- - (void)movePath:(NSString * _Nonnull)source toPath:(NSString * _Nonnull)destination
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- /**
- Enqueues an operation to delete the object at a path using a `DELETE` request.
-
- @param path The path for which to create a directory.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with no arguments.
- @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and the network error that occurred.
- */
- - (void)deletePath:(NSString * _Nonnull)path
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- /**
- Enqueues a request to list the properties of a single entity using a `PROPFIND` request for the specified path.
-
- @param path The path for which to list the properties.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a dictionary with the properties of the entity.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
-
- @see listPath:success:failure:
- @see recursiveListPath:success:failure:
- */
- - (void)propertiesOfPath:(NSString * _Nonnull)path
- onCommunication: (OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- /**
- Enqueues a request to list the contents of a single collection and
- the properties of each object, including the properties of the
- collection itself, using a `PROPFIND` request.
-
- @param path The directory for which to list the contents.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a dictionary with the properties of the directory and its contents.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
-
- @see propertiesOfPath:success:failure:
- @see recursiveListPath:success:failure:
- */
- - (void)listPath:(NSString * _Nonnull)path depth:(NSString * _Nonnull)depth
- onCommunication: (OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- /**
- Enqueues a request to list the contents of a single collection and
- the properties of each object, including the properties of the
- collection itself, using a `PROPFIND` request.
-
- @param path The directory for which to list the contents.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param token User Session token
- @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a dictionary with the properties of the directory and its contents.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
-
- @see propertiesOfPath:success:failure:
- @see recursiveListPath:success:failure:
- */
- - (void)listPath:(NSString * _Nonnull)path depth:(NSString * _Nonnull)depth
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication withUserSessionToken:(NSString * _Nonnull)token
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull, NSString * _Nonnull token))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull, NSString * _Nonnull token))failure;
- /**
-
- */
- NS_ASSUME_NONNULL_BEGIN
- - (void)search:(NSString * _Nonnull)path folder:(NSString * _Nonnull)folder fileName:(NSString * _Nonnull)fileName depth:(NSString * _Nonnull)depth lteDateLastModified:(NSString *)lteDateLastModified gteDateLastModified:(NSString *)gteDateLastModified contentType:(NSArray * _Nonnull)contentType user:(NSString * _Nonnull)user userID:(NSString * _Nonnull)userID onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication withUserSessionToken:(NSString * _Nonnull)token success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull, NSString * _Nonnull token))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull, NSString * _Nonnull token))failure;
- - (void)search:(NSString *)path folder:(NSString *)folder fileName:(NSString *)fileName dateLastModified:(NSString *)dateLastModified numberOfItem:(NSInteger)numberOfItem userID:(NSString *)userID onCommunication:(OCCommunication *)sharedOCCommunication withUserSessionToken:(NSString *)token success:(void(^)(NSHTTPURLResponse *, id, NSString *token))success failure:(void(^)(NSHTTPURLResponse *, id _Nullable responseObject, NSError *, NSString *token))failure;
- NS_ASSUME_NONNULL_END
- /**
-
- */
- - (void)settingFavorite:(NSString * _Nonnull)path favorite:(BOOL)favorite onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication withUserSessionToken:(NSString * _Nonnull)token success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull, NSString * _Nonnull token))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull, NSString * _Nonnull token))failure;
- /**
-
- */
- - (void)listingFavorites:(NSString * _Nonnull)path folder:(NSString * _Nonnull)folder user:(NSString * _Nonnull)user userID:(NSString * _Nonnull)userID onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication withUserSessionToken:(NSString * _Nonnull)token success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull, NSString * _Nonnull token))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull, NSString * _Nonnull token))failure;
- /**
- Creates an `NSURLSessionDownloadTask` with the specified request for a local file.
-
- @param remoteSource is a string with the path of the file in the server
- @param localDestination is a string with the local device path for store the file
- @param defaultPriority is a bool with a flag to indicate if the download must be download inmediately of not.
- @param progress A progress object monitoring the current upload progress.
- @param success A block callback, to be fired upon successful completion, with NSURLResponse and string of URL of the filePath
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
- *
- @warning NSURLSession and NSRULSessionUploadTask only can be supported in iOS 7.
- */
- - (NSURLSessionDownloadTask * _Nonnull)downloadWithSessionPath:(NSString * _Nonnull)remoteSource toPath:(NSString * _Nonnull)localDestination defaultPriority:(BOOL)defaultPriority onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication progress:(void(^ _Nonnull)(NSProgress * _Nonnull progress))downloadProgress success:(void(^ _Nonnull)(NSURLResponse * _Nonnull response, NSURL * _Nonnull filePath))success failure:(void(^ _Nonnull)(NSURLResponse * _Nonnull response, NSError * _Nonnull error))failure;
- /**
- Enqueues a request to check the server to know the kind of authentication needed.
-
- @param path The path of the server.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with no arguments.
- @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and the network error that occurred.
- */
- - (void)checkServer:(NSString * _Nonnull)path onCommunication:
- (OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- /**
- Enqueues a request to creates a directory using a `MKCOL` request for the specified path.
-
- @param path The path for which to create a directory.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with no arguments.
- @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and the network error that occurred.
- */
- - (void)makeCollection:(NSString * _Nonnull)path
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- /**
- Creates an `NSURLSessionUploadTask` with the specified request for a local file.
-
- @param localSource is a string with the path of the file to upload
- @param remoteDestination A remote path, relative to the HTTP client's base URL, to write the data to.
- @param progress A progress object monitoring the current upload progress.
- @param success A block callback, to be fired upon successful completion, with NSURLResponse and string of redirected server.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
- *
- @warning NSURLSession and NSRULSessionUploadTask only can be supported in iOS 7.
- */
- - (NSURLSessionUploadTask * _Nonnull)putWithSessionLocalPath:(NSString * _Nonnull)localSource atRemotePath:(NSString * _Nonnull)remoteDestination onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication progress:(void(^ _Nonnull)(NSProgress * _Nonnull progress))uploadProgress success:(void(^ _Nonnull)(NSURLResponse * _Nonnull, NSString * _Nonnull))success failure:(void(^ _Nonnull)(NSURLResponse * _Nonnull, id _Nonnull, NSError * _Nonnull))failure failureBeforeRequest:(void(^ _Nonnull)(NSError * _Nonnull)) failureBeforeRequest;
- ///-----------------------------------
- /// @name requestForUserNameByCookie
- ///-----------------------------------
- /**
- * Method to obtain the User name by the cookie of the session
- *
- * @param NSString the cookie of the session
- *
- */
- - (void) requestUserNameOfServer:(NSString * _Nonnull) path byCookie:(NSString * _Nonnull) cookieString onCommunication:
- (OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name Get status of the server
- ///-----------------------------------
- /**
- * Method to get the json of the status.php common in the ownCloud servers
- *
- * @param serverPath -> url of the server
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- *
- */
- - (void) getStatusOfTheServer:(NSString * _Nonnull)serverPath onCommunication:
- (OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull responseObject))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name Get All the shared files and folders of a server
- ///-----------------------------------
- /**
- Method to get all the shared files fo an account by the server path and api
-
- @param serverPath -> The url of the server including the path of the Share API.
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a dictionary with the properties of the directory and its contents.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
- */
- - (void)listSharedByServer:(NSString * _Nonnull)serverPath
- onCommunication: (OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull responseObject))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name Get All the shared files and folders of concrete folder
- ///-----------------------------------
- /**
- Method to get all the shared files fo an account by the server path and api
-
- @param serverPath -> The url of the server including the path of the Share API.
- @param path -> The path of the folder that we want to know the shared
- @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a dictionary with the properties of the directory and its contents.
- @param failure A block callback, to be fired upon the failure of either the request or the parsing of the request's data, with two arguments: the request operation and the network or parsing error that occurred.
- */
- - (void)listSharedByServer:(NSString * _Nonnull)serverPath andPath:(NSString * _Nonnull) path
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name shareFileOrFolderByServer
- ///-----------------------------------
- /**
- * Method to share a file or folder with password
- *
- * @param serverPath -> NSString: Server path where we want to share a file or folder. Ex: http://10.40.40.20/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares
- * @param filePath -> NSString: Path of the server where is the file. Ex: /File.pdf
- * @param password -> NSString: Password
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- *
- */
- - (void)shareByLinkFileOrFolderByServer:(NSString * _Nonnull)serverPath andPath:(NSString * _Nonnull) filePath andPassword:(NSString * _Nonnull)password andPermission:(NSInteger)permission andHideDownload:(BOOL)hideDownload
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name shareFileOrFolderByServer
- ///-----------------------------------
- /**
- * Method to share a file or folder
- *
- * @param serverPath -> NSString: Server path where we want to share a file or folder. Ex: http://10.40.40.20/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares
- * @param filePath -> NSString: Path of the server where is the file. Ex: /File.pdf
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- *
- */
- - (void)shareByLinkFileOrFolderByServer:(NSString * _Nonnull)serverPath andPath:(NSString * _Nonnull) filePath
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name shareWith
- ///-----------------------------------
- /**
- * Method to share a file or folder with user and group
- *
- * @param userOrGroup -> NSString: user or group (You can get the shares id in the calls searchUsersAndGroupsWith....)
- * @param shareeType -> NSInteger: to set the type of sharee (user/group/federated)
- * @param serverPath -> NSString: Server path where we want to share a file or folder. Ex: http://10.40.40.20/owncloud/ocs/v2.php/apps/files_sharing/api/v1/sharees?format=json
- * @param filePath -> NSString: Path of the server where is the file. Ex: /File.pdf
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- *
- */
- - (void)shareWith:(NSString * _Nonnull)userOrGroup shareeType:(NSInteger)shareeType inServer:(NSString * _Nonnull) serverPath andPath:(NSString * _Nonnull) filePath andPermissions:(NSInteger) permissions onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name unShareFileOrFolderByServer
- ///-----------------------------------
- /**
- * Method to unshare a file or folder
- *
- * @param serverPath -> NSString: Server path with the id of the file or folder that we want to unshare Ex: http://10.40.40.20/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares/44
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- */
- - (void)unShareFileOrFolderByServer:(NSString * _Nonnull)serverPath
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name isShareFileOrFolderByServer
- ///-----------------------------------
- /**
- * Method to know if a share item still shared
- *
- * @param serverPath -> NSString: Server path with the id of the file or folder that we want know if is shared Ex: http://10.40.40.20/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares/44
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- */
- - (void)isShareFileOrFolderByServer:(NSString * _Nonnull)serverPath
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name updateShareItem
- ///-----------------------------------
- /**
- * Method to update a share link
- *
- * @param shareId -> NSInterger: Share id (You can get the shares id in the calls listSharedByServer....)
- * @param serverPath -> NSString: Server path with the id of the file or folder that we want know if is shared Ex: http://10.40.40.20/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares/44
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- */
- - (void) updateShareItem:(NSInteger)shareId ofServerPath:(NSString * _Nonnull)serverPath withPasswordProtect:(NSString * _Nonnull)password andNote:(NSString * _Nonnull)note andExpirationTime:(NSString * _Nonnull)expirationTime andPermissions:(NSInteger)permissions andHideDownload:(BOOL)hideDownload
- onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name searchUsersAndGroupsWith
- ///-----------------------------------
- /**
- * Method to search users or groups
- *
- * @param searchString -> NSString: Search string
- * @param serverPath -> NSString: Server path with the id of the file or folder that we want know if is shared Ex: http://10.40.40.20/owncloud/ocs/v2.php/apps/files_sharing/api/v1/sharees?format=json
- * @param page -> NSInteger: Number of page of the results (pagination support)
- * @param resultsPerPage -> NSInteger: Number of results per page (pagination support)
- * @param sharedOCCommunication Singleton of communication to add the operation on the queue.
- * @param success A block callback, to be fired upon successful completion, with two arguments: the request operation and a data with the json file.
- * @param failure A block callback, to be fired upon the failure of the request, with two arguments: the request operation and error.
- */
- - (void) searchUsersAndGroupsWith:(NSString * _Nonnull)searchString forPage:(NSInteger)page with:(NSInteger)resultsPerPage ofServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name Get the server capabilities
- ///-----------------------------------
- /**
- * Method read the capabilities of the server
- *
- * @param serverPath -> NSString server
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return capabilities -> OCCapabilities
- *
- */
- - (void) getCapabilitiesOfServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- #pragma mark - Remote thumbnails
- ///-----------------------------------
- /// @name Get the thumbnail for a file
- ///-----------------------------------
- /**
- * Method to get the remote thumbnail for a file
- *
- * @param serverPath -> NSString server
- * @param filePath -> NSString file path
- * @param fileWidth -> NSInteger with the width size
- * @param fileHeight -> NSInteger with the height size
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return nsData -> thumbnail of the file with the size requested
- *
- */
- - (OCHTTPRequestOperation * _Nonnull) getRemoteThumbnailByServer:(NSString * _Nonnull)serverPath ofFilePath:(NSString * _Nonnull)filePath withWidth:(NSInteger)fileWidth andHeight:(NSInteger)fileHeight onCommunication:(OCCommunication * _Nonnull)sharedOCComunication
- success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success
- failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- NS_ASSUME_NONNULL_BEGIN
- - (OCHTTPRequestOperation *) getRemotePreviewByServer:(NSString * _Nonnull)serverPath ofFilePath:(NSString *_Nonnull)filePath withWidth:(NSInteger)fileWidth andHeight:(NSInteger)fileHeight andA:(NSInteger)a andMode:(NSString * _Nonnull)mode path:(NSString * _Nonnull)path onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- - (OCHTTPRequestOperation *) getRemotePreviewTrashByServer:(NSString * _Nonnull)serverPath ofFileId:(NSString *_Nonnull)fileId size:(NSString *)size onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- NS_ASSUME_NONNULL_END
- #pragma mark - Notification
- ///-----------------------------------
- /// @name Get the server Notification
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return listOfNotifications -> OCNotification
- *
- */
- - (void) getNotificationServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name set server Notification
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param type -> NSString "POST" "DELETE"
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- */
- - (void)setNotificationServer:(NSString * _Nonnull)serverPath type:(NSString * _Nonnull)type onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name Subscribing at the Nextcloud server
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param type -> NSString "POST" "DELETE"
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- */
- - (void)subscribingNextcloudServerPush:(NSString * _Nonnull)serverPath pushTokenHash:(NSString * _Nonnull)pushTokenHash devicePublicKey:(NSString * _Nonnull)devicePublicKey proxyServerPath:(NSString * _Nonnull)proxyServerPath onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- - (void)unsubscribingNextcloudServerPush:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- - (void)subscribingPushProxy:(NSString * _Nonnull)serverPath pushToken:(NSString * _Nonnull)pushToken deviceIdentifier:(NSString * _Nonnull)deviceIdentifier deviceIdentifierSignature:(NSString * _Nonnull)deviceIdentifierSignature publicKey:(NSString * _Nonnull)publicKey onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- - (void)unsubscribingPushProxy:(NSString * _Nonnull)serverPath deviceIdentifier:(NSString * _Nonnull)deviceIdentifier deviceIdentifierSignature:(NSString * _Nonnull)deviceIdentifierSignature publicKey:(NSString * _Nonnull)publicKey onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nullable responseObject, NSError * _Nonnull))failure;
- ///-----------------------------------
- /// @name Get the server Notification
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return listOfActivity -> OCActivity
- *
- */
- - (void) getActivityServer:(NSString * _Nonnull)serverPath since:(NSInteger)since limit:(NSInteger)limit objectId:(NSString * _Nonnull)objectId objectType:(NSString * _Nonnull)objectType previews:(BOOL)previews link:(NSString * _Nonnull)link onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name Get the list of External sites
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return listOfExternalSites -> OCExternalSites
- *
- */
- - (void) getExternalSitesServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// @name Get User Profile
- ///-----------------------------------
- /**
- * Method read the notification of the server
- *
- * @param serverPath -> NSString server
- * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue.
- *
- * @return userProfile -> OCUserProfile
- *
- */
- - (void) getUserProfileServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// End-to-End Encryption
- ///-----------------------------------
- - (void)getEndToEndPublicKeys:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)getEndToEndPrivateKeyCipher:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)getEndToEndServerPublicKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)signEndToEndPublicKey:(NSString * _Nonnull)serverPath key:(NSString * _Nonnull)key onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)storeEndToEndPrivateKeyCipher:(NSString * _Nonnull)serverPath key:(NSString * _Nonnull)key onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)deleteEndToEndPublicKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)deleteEndToEndPrivateKey:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)markEndToEndFolderEncrypted:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)deletemarkEndToEndFolderEncrypted:(NSString * _Nonnull)serverPath e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)lockEndToEndFolderEncrypted:(NSString * _Nonnull)serverPath e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)unlockEndToEndFolderEncrypted:(NSString * _Nonnull)serverPath e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)getEndToEndMetadata:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)storeEndToEndMetadata:(NSString * _Nonnull)serverPath metadata:(NSString * _Nonnull)metadata e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)updateEndToEndMetadata:(NSString * _Nonnull)serverPath metadata:(NSString * _Nonnull)metadata e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- - (void)deleteEndToEndMetadata:(NSString * _Nonnull)serverPath e2eToken:(NSString * _Nonnull)e2eToken onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nullable responseObject, NSError * _Nonnull error))failure;
- ///-----------------------------------
- /// Manage Mobile Editor OCS API
- ///-----------------------------------
- NS_ASSUME_NONNULL_BEGIN
- - (void)createLinkRichdocuments:(NSString *_Nonnull)serverPath fileId:(NSString * _Nonnull)fileId onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- - (void)getTemplatesRichdocuments:(NSString *_Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- - (void)createNewRichdocuments:(NSString *_Nonnull)serverPath path:(NSString *_Nonnull)path templateID:(NSString *_Nonnull)templateID onCommunication:(OCCommunication *_Nonnull)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- - (void)createAssetRichdocuments:(NSString *_Nonnull)serverPath path:(NSString *_Nonnull)path onCommunication:(OCCommunication *_Nonnull)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- #pragma mark - Fulltextsearch
- - (void)fullTextSearch:(NSString *)serverPath data:(NSString *)data onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- #pragma mark - Remore wipe
- - (void)getSetRemoteWipe:(NSString *)serverPath token:(NSString *)token onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- #pragma mark - Trash
- - (void)listTrash:(NSString *)path depth:(NSString *)depth onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *response, id _Nullable responseObject, NSError *error))failure;
- - (void)emptyTrash:(NSString*)path onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- #pragma mark - Messages
- - (void)getComments:(NSString *)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id _Nullable responseObject, NSError *error))failure;
- - (void)putComments:(NSString*)serverPath message:(NSString *)message onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- - (void)updateComments:(NSString*)serverPath message:(NSString *)message onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- - (void)readMarkComments:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- - (void)deleteComments:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- #pragma mark - Third Parts
- - (void)getHCUserProfile:(NSString *)serverPath onCommunication:(OCCommunication *)sharedOCComunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- - (void)putHCUserProfile:(NSString *)serverPath data:(NSString *)data onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- - (void)getHCFeatures:(NSString *)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success failure:(void(^)(NSHTTPURLResponse *operation, id responseObject, NSError *error))failure;
- NS_ASSUME_NONNULL_END
- @end
|