commit | author | age
|
3eceb5
|
1 |
// |
W |
2 |
// VKApi.h |
b80c10
|
3 |
// |
3eceb5
|
4 |
// Copyright (c) 2014 VK.com |
W |
5 |
// |
|
6 |
// Permission is hereby granted, free of charge, to any person obtaining a copy of |
|
7 |
// this software and associated documentation files (the "Software"), to deal in |
|
8 |
// the Software without restriction, including without limitation the rights to |
|
9 |
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
|
10 |
// the Software, and to permit persons to whom the Software is furnished to do so, |
|
11 |
// subject to the following conditions: |
|
12 |
// |
|
13 |
// The above copyright notice and this permission notice shall be included in all |
|
14 |
// copies or substantial portions of the Software. |
|
15 |
// |
|
16 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
17 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
18 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
19 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
20 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
21 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
22 |
|
|
23 |
#import <Foundation/Foundation.h> |
|
24 |
#import "VKRequest.h" |
|
25 |
#import "VKApiUsers.h" |
|
26 |
#import "VKApiFriends.h" |
|
27 |
#import "VKApiPhotos.h" |
|
28 |
#import "VKApiWall.h" |
|
29 |
#import "VKApiConst.h" |
|
30 |
#import "VKApiCaptcha.h" |
|
31 |
#import "VKApiGroups.h" |
|
32 |
#import "VKApiDocs.h" |
|
33 |
#import "VKImageParameters.h" |
|
34 |
#import "VKApiModels.h" |
|
35 |
|
|
36 |
|
|
37 |
/** |
|
38 |
Provides access for API parts. |
|
39 |
*/ |
|
40 |
@interface VKApi : NSObject |
|
41 |
/** |
|
42 |
https://vk.com/dev/users |
|
43 |
Returns object for preparing requests to users part of API |
|
44 |
*/ |
|
45 |
+ (VKApiUsers *)users; |
|
46 |
|
|
47 |
/** |
|
48 |
https://vk.com/dev/wall |
|
49 |
Returns object for preparing requests to wall part of API |
|
50 |
*/ |
|
51 |
+ (VKApiWall *)wall; |
|
52 |
|
|
53 |
/** |
|
54 |
https://vk.com/dev/photos |
|
55 |
Returns object for preparing requests to photos part of API |
|
56 |
*/ |
|
57 |
+ (VKApiPhotos *)photos; |
|
58 |
|
|
59 |
/** |
|
60 |
https://vk.com/dev/friends |
|
61 |
Returns object for preparing requests to friends part of API |
|
62 |
*/ |
|
63 |
+ (VKApiFriends *)friends; |
|
64 |
|
|
65 |
/** |
|
66 |
https://vk.com/dev/friends |
|
67 |
Returns object for preparing requests to groups part of API |
|
68 |
*/ |
|
69 |
+ (VKApiGroups *)groups; |
|
70 |
|
|
71 |
/** |
|
72 |
Create new request with parameters. See documentation for methods here https://vk.com/dev/methods |
|
73 |
|
|
74 |
@param method API-method name, e.g. audio.get |
|
75 |
@param parameters method parameters |
|
76 |
@param httpMethod HTTP method for execution, e.g. GET, POST |
|
77 |
@return Complete request class for execute or configure method |
|
78 |
*/ |
|
79 |
+ (VKRequest *)requestWithMethod:(NSString *)method |
|
80 |
andParameters:(NSDictionary *)parameters |
|
81 |
andHttpMethod:(NSString *)httpMethod __deprecated; |
|
82 |
|
|
83 |
/** |
|
84 |
Create new request with parameters. See documentation for methods here https://vk.com/dev/methods |
|
85 |
|
|
86 |
@param method API-method name, e.g. audio.get |
|
87 |
@param parameters method parameters |
|
88 |
@return Complete request class for execute or configure method |
|
89 |
*/ |
|
90 |
+ (VKRequest *)requestWithMethod:(NSString *)method |
|
91 |
andParameters:(NSDictionary *)parameters; |
|
92 |
|
|
93 |
/** |
|
94 |
Uploads photo for wall post |
|
95 |
|
|
96 |
@param image image used for saving to post |
|
97 |
@param parameters parameters for image to be uploaded |
|
98 |
@param userId ID of user on which wall image should be posted (or 0) |
|
99 |
@param groupId ID of group (without minus sign) on which wall image should be posted (or 0) |
|
100 |
*/ |
|
101 |
+ (VKRequest *)uploadWallPhotoRequest:(UIImage *)image |
|
102 |
parameters:(VKImageParameters *)parameters |
|
103 |
userId:(NSInteger)userId |
|
104 |
groupId:(NSInteger)groupId; |
|
105 |
|
|
106 |
/** |
|
107 |
Uploads photo in user or group album |
|
108 |
|
|
109 |
@param image image used for saving to post |
|
110 |
@param parameters parameters for image to be uploaded |
|
111 |
@param albumId target album ID. Required |
|
112 |
@param groupId target group ID (positive). May be 0 |
|
113 |
*/ |
|
114 |
+ (VKRequest *)uploadAlbumPhotoRequest:(UIImage *)image |
|
115 |
parameters:(VKImageParameters *)parameters |
|
116 |
albumId:(NSInteger)albumId |
|
117 |
groupId:(NSInteger)groupId; |
|
118 |
|
|
119 |
/** |
|
120 |
Uploads photo for messaging |
|
121 |
|
|
122 |
@param image image used for saving to post |
|
123 |
@param parameters parameters for image to be uploaded |
|
124 |
*/ |
|
125 |
+ (VKRequest *)uploadMessagePhotoRequest:(UIImage *)image |
|
126 |
parameters:(VKImageParameters *)parameters; |
|
127 |
|
|
128 |
|
|
129 |
@end |