summaryrefslogtreecommitdiff
path: root/Juick/APIClient.h
blob: 46e86c7e6c09a7fc0b1284ab183cc9a35852646b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
//  APIClient.h
//  Juick
//
//  Created by Vitaly Takmazov on 22/08/16.
//  Copyright © 2016 com.juick. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Message.h"
@import AFNetworking;

@interface APIClient : NSObject

@property (nonatomic, retain) AFHTTPSessionManager *manager;
@property (nonatomic, strong) NSDateFormatter *dateFormatter;

+(APIClient *) sharedClient;

-(void) pullNextFromPath:(NSString *)path params:(NSDictionary *)params callback:(void(^)(NSArray *, NSError *))callback;
-(void) postMessage:(NSString *)text result:(void(^)(Message *, NSError *))callback;
-(void) postReplyToThread:(NSNumber *)mid inReplyTo:(NSNumber *)rid text:(NSString *)text result:(void(^)(Message *, NSError *))callback;
-(void) fetchChats:(void(^)(NSArray *, NSError *))callback;
-(void) fetchChatWithUser:(NSString *)uname callback:(void(^)(NSArray *, NSError *))callback;

+(NSString *) messagesUrl;
+(NSString *) threadUrl;
+(NSString *) feedUrl;
+(NSString *) discussionsUrl;

@end