forked from rayyan/AloharDemo
/
ALResponse.h
66 lines (52 loc) · 1.24 KB
/
ALResponse.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// ALResponse.h
// Alohar
//
// Created by Sam Warmuth on 2/23/12.
// Copyright (c) 2012 Alohar Mobile Inc.. All rights reserved.
//
#import <Foundation/Foundation.h>
@class ALResponse, ALMotionState;
enum {
kALRequestTypeUserStays,
kALRequestTypePlaces,
kALRequestTypeMotionState,
kALRequestTypeStayDetail,
kALRequestTypePlaceDetail,
kALRequestTypeCorrectUserStay,
kALRequestTypeAddUserStay,
kALRequestTypeDeleteUserStay,
};
typedef enum {
kErr_NETWORK,
kErr_SERVER,
kErr_REQUEST
} errorCode;
typedef NSUInteger ALRequestType;
/*!
ALResponse class declare a common protocol to process
Alohar response.
The response has three main parts:
+ timeStamp The time the response is returned.
+ requestType The type of the request type.
+ objects The payload of the response
ALResponse has following request types:
enum {
kALRequestTypeUserStays,
kALRequestTypePlaces,
kALRequestTypeMotionState,
kALRequestTypeStayDetail,
kALRequestTypePlaceDetail,
}
*/
@interface ALResponse : NSObject
/*!
*/
@property (strong) NSDate *timeStamp;
/*!
*/
@property (nonatomic, strong) NSMutableArray *objects;
/*!
*/
@property ALRequestType requestType;
@end