|
| 1 | +#import <Foundation/Foundation.h> |
| 2 | +#import "SWGUser.h" |
| 3 | +#import "SWGWordList.h" |
| 4 | +#import "SWGApiTokenStatus.h" |
| 5 | +#import "SWGAuthenticationToken.h" |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +@interface SWGAccountApi: NSObject |
| 10 | + |
| 11 | +-(void) addHeader:(NSString*)value forKey:(NSString*)key; |
| 12 | +-(unsigned long) requestQueueSize; |
| 13 | ++(SWGAccountApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key; |
| 14 | ++(void) setBasePath:(NSString*)basePath; |
| 15 | ++(NSString*) getBasePath; |
| 16 | +/** |
| 17 | +
|
| 18 | + Authenticates a User |
| 19 | + |
| 20 | + @param username A confirmed Wordnik username |
| 21 | + @param password The user's password |
| 22 | + */ |
| 23 | +-(NSNumber*) authenticateWithCompletionBlock :(NSString*) username |
| 24 | + password:(NSString*) password |
| 25 | + completionHandler: (void (^)(SWGAuthenticationToken* output, NSError* error))completionBlock; |
| 26 | + |
| 27 | +/** |
| 28 | +
|
| 29 | + Authenticates a user |
| 30 | + |
| 31 | + @param username A confirmed Wordnik username |
| 32 | + @param body The user's password |
| 33 | + */ |
| 34 | +-(NSNumber*) authenticatePostWithCompletionBlock :(NSString*) username |
| 35 | + body:(NSString*) body |
| 36 | + completionHandler: (void (^)(SWGAuthenticationToken* output, NSError* error))completionBlock; |
| 37 | + |
| 38 | +/** |
| 39 | +
|
| 40 | + Fetches WordList objects for the logged-in user. |
| 41 | + |
| 42 | + @param auth_token auth_token of logged-in user |
| 43 | + @param skip Results to skip |
| 44 | + @param limit Maximum number of results to return |
| 45 | + */ |
| 46 | +-(NSNumber*) getWordListsForLoggedInUserWithCompletionBlock :(NSString*) auth_token |
| 47 | + skip:(NSNumber*) skip |
| 48 | + limit:(NSNumber*) limit |
| 49 | + completionHandler: (void (^)(NSArray* output, NSError* error))completionBlock; |
| 50 | + |
| 51 | +/** |
| 52 | +
|
| 53 | + Returns usage statistics for the API account. |
| 54 | + |
| 55 | + @param api_key Wordnik authentication token |
| 56 | + */ |
| 57 | +-(NSNumber*) getApiTokenStatusWithCompletionBlock :(NSString*) api_key |
| 58 | + completionHandler: (void (^)(SWGApiTokenStatus* output, NSError* error))completionBlock; |
| 59 | + |
| 60 | +/** |
| 61 | +
|
| 62 | + Returns the logged-in User |
| 63 | + Requires a valid auth_token to be set. |
| 64 | + @param auth_token The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) |
| 65 | + */ |
| 66 | +-(NSNumber*) getLoggedInUserWithCompletionBlock :(NSString*) auth_token |
| 67 | + completionHandler: (void (^)(SWGUser* output, NSError* error))completionBlock; |
| 68 | + |
| 69 | +@end |
0 commit comments