VaultMobileSDK  18R3
iOS framework for Vault API
VEVVaultAPI.h
Go to the documentation of this file.
1 
7 #import <Foundation/Foundation.h>
8 
9 NS_ASSUME_NONNULL_BEGIN
10 
11 @class VEVVault;
12 @class VEVVaultServerQuery;
14 #pragma mark -
15 
18 typedef NS_ENUM(NSUInteger, VEVRequestMethod) {
19 
23 
27 
31 };
32 
35 typedef NS_ENUM(NSUInteger, VEVParameterEncoding) {
36 
41 
46 };
47 
57 typedef void (^VEVVaultAPIResponseHandler)(NSDictionary* _Nullable response, NSError* _Nullable error);
58 
73 typedef void (^VEVVaultAPIUploadResultHandler)(NSDictionary * _Nullable response,
74  NSURL * fileURL,
75  NSString * username,
76  NSError * _Nullable error);
77 
96 typedef void (^VEVVaultAPIDownloadResultHandler)(NSDictionary * _Nullable response,
97  NSURL * fileURL,
98  NSString * _Nullable MIMEType,
99  NSString * username,
100  NSError * _Nullable error);
101 
108 typedef void (^VEVVaultAPIProgressHandler)(NSProgress* progress);
109 
110 #pragma mark - Documents
111 
114 typedef NS_ENUM(NSUInteger, VEVSearchScope) {
115 
119 
124 };
125 
128 typedef NS_ENUM(NSUInteger, VEVSearchResultsSortOrder) {
129 
134 
138 
142 };
143 
154 typedef void (^VEVVaultAPICreateDocumentResultHandler)(NSDictionary * _Nullable response,
155  NSError * _Nullable error);
156 
167 typedef void (^VEVVaultAPIUpdateDocumentResultHandler)(NSDictionary * _Nullable response,
168  NSError * _Nullable error);
169 
179 typedef void (^VEVVaultAPIGetDocumentResultHandler)(NSDictionary * _Nullable response,
180  NSError * _Nullable error);
181 
191 typedef void (^VEVVaultAPIGetDocumentsResultHandler)(NSDictionary * _Nullable response,
192  NSError * _Nullable error);
193 
202 typedef void (^VEVVaultAPIGetDocumentTypeResultHandler)(NSDictionary * _Nullable response,
203  NSError * _Nullable error);
204 
213 typedef void (^VEVVaultAPIGetDocumentPropertiesResultHandler)(NSDictionary * _Nullable response,
214  NSError * _Nullable error);
215 #pragma clang diagnostic push
216 #pragma clang diagnostic ignored "-Wdocumentation"
217 
252 #pragma clang diagnostic pop
253 @interface VEVVaultAPI : NSObject
254 
257 + (instancetype)sharedInstance;
258 
286 - (void)requestVaultEndpoint:(NSString*)endpoint
287  vault:(VEVVault*)vault
288  method:(VEVRequestMethod)method
289  parameters:(nullable id)params
290  parameterEncoding:(VEVParameterEncoding)encoding
291  completionHandler:(VEVVaultAPIResponseHandler _Nullable)completionHandler;
292 
325 - (void)requestVaultMultipartFormEndpoint:(NSString*)endpoint
326  vault:(VEVVault*)vault
327  fileURL:(NSURL*)fileURL
328  isEncrypted:(BOOL)isEncrypted
329  method:(VEVRequestMethod)method
330  parameters:(nullable id)params
331  progressHandler:(VEVVaultAPIProgressHandler _Nullable)progressHandler
332  completionHandler:(VEVVaultAPIUploadResultHandler _Nullable)completionHandler;
333 
364 - (void)requestVaultDownloadFileEndpoint:(NSString*)endpoint
365  vault:(VEVVault*)vault
366  fileURL:(NSURL*)fileURL // nil means use default file name
367  encrypt:(BOOL)encrypt
368  parameters:(nullable id)params
369  progressHandler:(VEVVaultAPIProgressHandler _Nullable)progressHandler
370  completionHandler:(VEVVaultAPIDownloadResultHandler _Nullable)completionHandler;
371 
379 - (void)setBackgroundUploadResultHandler:(VEVVaultAPIUploadResultHandler)handler;
380 
389 - (void)setBackgroundDownloadResultHandler:(VEVVaultAPIDownloadResultHandler)handler;
390 
391 #pragma clang diagnostic push
392 #pragma clang diagnostic ignored "-Wdocumentation"
393 
413 #pragma clang diagnostic pop
414 
415 #pragma clang diagnostic push
416 #pragma clang diagnostic ignored "-Wdocumentation"
417 - (void)createDocumentWithFields:(NSDictionary *)fields
418  vault:(VEVVault *)vault
419  completeHandler:(nullable VEVVaultAPICreateDocumentResultHandler)cHandler;
420 
454 #pragma clang diagnostic pop
455 
456 - (void)createDocumentWithFields:(nullable NSDictionary *)fields
457  vault:(VEVVault *)vault
458  fileURL:(NSURL *)fileURL
459  fileIsEncrypted:(BOOL)isEncrypted
460  progressHandler:(nullable VEVVaultAPIProgressHandler)pHandler
461  completeHandler:(nullable VEVVaultAPICreateDocumentResultHandler)cHandler;
462 
481 - (void)updateDocument:(NSUInteger)documentId
482  fields:(NSDictionary *)fields
483  vault:(VEVVault *)vault
484  completeHandler:(nullable VEVVaultAPIUpdateDocumentResultHandler)cHandler;
485 
518 - (void)updateDocument:(NSUInteger)documentId
519  fields:(nullable NSDictionary *)fields
520  vault:(VEVVault *)vault
521  fileURL:(NSURL *)fileURL
522  fileIsEncrypted:(BOOL)isEncrypted
523  progressHandler:(nullable VEVVaultAPIProgressHandler)pHandler
524  completeHandler:(nullable VEVVaultAPIUpdateDocumentResultHandler)cHandler;
525 
541 - (void)getDocument:(NSUInteger)documentId
542  vault:(VEVVault*)vault
543  completeHandler:(VEVVaultAPIGetDocumentResultHandler)cHandler;
544 
545 #pragma clang diagnostic push
546 #pragma clang diagnostic ignored "-Wdocumentation"
547 
567 #pragma clang diagnostic pop
568 -(void)getDocumentType:(NSString *)name
569  vault:(VEVVault *)vault
570  completeHandler:(VEVVaultAPIGetDocumentTypeResultHandler)cHandler;
571 
587 - (void)getDocumentProperties:(NSUInteger)documentId
588  vault:(VEVVault *)vault
589  completeHandler:(VEVVaultAPIGetDocumentPropertiesResultHandler)cHandler;
590 
603 - (void)query:(VEVVaultServerRequest *)request completeHandler:(VEVVaultAPIResponseHandler)cHandler;
604 
605 
606 @end
607 
608 NS_ASSUME_NONNULL_END
Instances of this class may be instantiated directly in order to invoke arbitrary Vault endpoints...
Definition: VEVVaultServerRequest.h:16
Sorts the results in descending order.
Definition: VEVVaultAPI.h:141
VEVParameterEncoding
The encoding used by a request&#39;s params.
Definition: VEVVaultAPI.h:35
void(^ VEVVaultAPIProgressHandler)(NSProgress *progress)
The block type to call back to the application after a chunk of data is uploaded or downloaded...
Definition: VEVVaultAPI.h:108
void(^ VEVVaultAPIGetDocumentsResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after retrieving the list of document information from...
Definition: VEVVaultAPI.h:191
void(^ VEVVaultAPIUploadResultHandler)(NSDictionary *_Nullable response, NSURL *fileURL, NSString *username, NSError *_Nullable error)
The block type used to call back to the application after a multipart request upload to Vault complet...
Definition: VEVVaultAPI.h:73
void(^ VEVVaultAPIGetDocumentResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after retrieving the document information from Vault...
Definition: VEVVaultAPI.h:179
void(^ VEVVaultAPIUpdateDocumentResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after an existing Vault document has been updated...
Definition: VEVVaultAPI.h:167
Search both the contents and the document record fields.
Definition: VEVVaultAPI.h:123
Specifies request parameters are encoded with ContentType application/json.
Definition: VEVVaultAPI.h:45
Applies the default sort order for records being searched.
Definition: VEVVaultAPI.h:133
void(^ VEVVaultAPIGetDocumentTypeResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after retrieving document type information from Vault...
Definition: VEVVaultAPI.h:202
VEVSearchResultsSortOrder
Definition: VEVVaultAPI.h:128
Specifies request parameters are encoded with ContentType application/x-www-form-urlencoded.
Definition: VEVVaultAPI.h:40
Search the file contents only.
Definition: VEVVaultAPI.h:118
GET HTTP method.
Definition: VEVVaultAPI.h:22
An object type that refers to a particular Vault. VEVVaultAuth::currentUser tracks the authenticated ...
Definition: VEVVaultAuth.h:22
void(^ VEVVaultAPIResponseHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type used to call back to the application after a request to Vault.
Definition: VEVVaultAPI.h:57
A singleton class that is used to interface to the Vault server and the methods here help to issue re...
Definition: VEVVaultAPI.h:253
POST HTTP method.
Definition: VEVVaultAPI.h:26
instancetype sharedInstance()
Return the singleton instance.
Sorts the results in ascending order.
Definition: VEVVaultAPI.h:137
VEVSearchScope
The scope to apply search keywords to when searching.
Definition: VEVVaultAPI.h:114
PUT HTTP method.
Definition: VEVVaultAPI.h:30
void(^ VEVVaultAPIGetDocumentPropertiesResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after retrieving a document&#39;s properties from Vault...
Definition: VEVVaultAPI.h:213
void(^ VEVVaultAPICreateDocumentResultHandler)(NSDictionary *_Nullable response, NSError *_Nullable error)
The block type to call back to the application after a new Vault document has been created...
Definition: VEVVaultAPI.h:154
VEVRequestMethod
The HTTP method to use when invoking a request on Vault.
Definition: VEVVaultAPI.h:18
void(^ VEVVaultAPIDownloadResultHandler)(NSDictionary *_Nullable response, NSURL *fileURL, NSString *_Nullable MIMEType, NSString *username, NSError *_Nullable error)
The block type used to call back to the application after a download request to Vault completes...
Definition: VEVVaultAPI.h:96