@@ -10,6 +10,65 @@ import Alamofire
10
10
11
11
12
12
open class DefaultEndpoints {
13
+ /**
14
+ Download asset by personId and assetId
15
+
16
+ - parameter personId: (path) The Extole unique profile identifier of this user at Extole.
17
+ - parameter assetId: (path) The Extole unique profile identifier of this asset at Extole.
18
+ - parameter defaultUrl: (query) (optional)
19
+ - parameter completion: completion handler to receive the data and the error objects
20
+ */
21
+ open class func downloadAssetById( personId: String , assetId: String , defaultUrl: String ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
22
+ downloadAssetByIdWithRequestBuilder ( personId: personId, assetId: assetId, defaultUrl: defaultUrl) . execute { ( response, error) -> Void in
23
+ if error == nil {
24
+ completion ( ( ) , error)
25
+ } else {
26
+ completion ( nil , error)
27
+ }
28
+ }
29
+ }
30
+
31
+
32
+ /**
33
+ Download asset by personId and assetId
34
+ - GET /web/persons/{personId}/assets/{assetId}/download
35
+ -
36
+
37
+ - API Key:
38
+ - type: apiKey access_token (QUERY)
39
+ - name: COOKIE
40
+ - API Key:
41
+ - type: apiKey Authorization
42
+ - name: HEADER
43
+ - API Key:
44
+ - type: apiKey access_token (QUERY)
45
+ - name: QUERY
46
+ - parameter personId: (path) The Extole unique profile identifier of this user at Extole.
47
+ - parameter assetId: (path) The Extole unique profile identifier of this asset at Extole.
48
+ - parameter defaultUrl: (query) (optional)
49
+
50
+ - returns: RequestBuilder<Void>
51
+ */
52
+ open class func downloadAssetByIdWithRequestBuilder( personId: String , assetId: String , defaultUrl: String ? = nil ) -> RequestBuilder < Void > {
53
+ var path = " /web/persons/{personId}/assets/{assetId}/download "
54
+ let personIdPreEscape = " \( personId) "
55
+ let personIdPostEscape = personIdPreEscape. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
56
+ path = path. replacingOccurrences ( of: " {personId} " , with: personIdPostEscape, options: . literal, range: nil )
57
+ let assetIdPreEscape = " \( assetId) "
58
+ let assetIdPostEscape = assetIdPreEscape. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
59
+ path = path. replacingOccurrences ( of: " {assetId} " , with: assetIdPostEscape, options: . literal, range: nil )
60
+ let URLString = ExtoleConsumerAPI . basePath + path
61
+ let parameters : [ String : Any ] ? = nil
62
+ var url = URLComponents ( string: URLString)
63
+ url? . queryItems = APIHelper . mapValuesToQueryItems ( [
64
+ " default_url " : defaultUrl
65
+ ] )
66
+
67
+
68
+ let requestBuilder : RequestBuilder < Void > . Type = ExtoleConsumerAPI . requestBuilderFactory. getNonDecodableBuilder ( )
69
+
70
+ return requestBuilder. init ( method: " GET " , URLString: ( url? . string ?? URLString) , parameters: parameters, isBody: false )
71
+ }
13
72
/**
14
73
Download content for an asset
15
74
@@ -60,6 +119,63 @@ open class DefaultEndpoints {
60
119
let url = URLComponents ( string: URLString)
61
120
62
121
122
+ let requestBuilder : RequestBuilder < Void > . Type = ExtoleConsumerAPI . requestBuilderFactory. getNonDecodableBuilder ( )
123
+
124
+ return requestBuilder. init ( method: " GET " , URLString: ( url? . string ?? URLString) , parameters: parameters, isBody: false )
125
+ }
126
+ /**
127
+ Download asset by personId and name
128
+
129
+ - parameter personId: (path) The Extole unique profile identifier of this user at Extole.
130
+ - parameter name: (query) (optional)
131
+ - parameter defaultUrl: (query) (optional)
132
+ - parameter completion: completion handler to receive the data and the error objects
133
+ */
134
+ open class func downloadAssetByName( personId: String , name: String ? = nil , defaultUrl: String ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
135
+ downloadAssetByNameWithRequestBuilder ( personId: personId, name: name, defaultUrl: defaultUrl) . execute { ( response, error) -> Void in
136
+ if error == nil {
137
+ completion ( ( ) , error)
138
+ } else {
139
+ completion ( nil , error)
140
+ }
141
+ }
142
+ }
143
+
144
+
145
+ /**
146
+ Download asset by personId and name
147
+ - GET /web/persons/{personId}/assets/download
148
+ -
149
+
150
+ - API Key:
151
+ - type: apiKey access_token (QUERY)
152
+ - name: COOKIE
153
+ - API Key:
154
+ - type: apiKey Authorization
155
+ - name: HEADER
156
+ - API Key:
157
+ - type: apiKey access_token (QUERY)
158
+ - name: QUERY
159
+ - parameter personId: (path) The Extole unique profile identifier of this user at Extole.
160
+ - parameter name: (query) (optional)
161
+ - parameter defaultUrl: (query) (optional)
162
+
163
+ - returns: RequestBuilder<Void>
164
+ */
165
+ open class func downloadAssetByNameWithRequestBuilder( personId: String , name: String ? = nil , defaultUrl: String ? = nil ) -> RequestBuilder < Void > {
166
+ var path = " /web/persons/{personId}/assets/download "
167
+ let personIdPreEscape = " \( personId) "
168
+ let personIdPostEscape = personIdPreEscape. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
169
+ path = path. replacingOccurrences ( of: " {personId} " , with: personIdPostEscape, options: . literal, range: nil )
170
+ let URLString = ExtoleConsumerAPI . basePath + path
171
+ let parameters : [ String : Any ] ? = nil
172
+ var url = URLComponents ( string: URLString)
173
+ url? . queryItems = APIHelper . mapValuesToQueryItems ( [
174
+ " name " : name,
175
+ " default_url " : defaultUrl
176
+ ] )
177
+
178
+
63
179
let requestBuilder : RequestBuilder < Void > . Type = ExtoleConsumerAPI . requestBuilderFactory. getNonDecodableBuilder ( )
64
180
65
181
return requestBuilder. init ( method: " GET " , URLString: ( url? . string ?? URLString) , parameters: parameters, isBody: false )
@@ -182,11 +298,12 @@ open class DefaultEndpoints {
182
298
}
183
299
/**
184
300
301
+ - parameter zoneName: (path)
185
302
- parameter body: (body) (optional)
186
303
- parameter completion: completion handler to receive the data and the error objects
187
304
*/
188
- open class func post( body: RenderZoneRequest ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
189
- postWithRequestBuilder ( body: body) . execute { ( response, error) -> Void in
305
+ open class func post( zoneName : String , body: [ String : String ] ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
306
+ postWithRequestBuilder ( zoneName : zoneName , body: body) . execute { ( response, error) -> Void in
190
307
if error == nil {
191
308
completion ( ( ) , error)
192
309
} else {
@@ -197,7 +314,7 @@ open class DefaultEndpoints {
197
314
198
315
199
316
/**
200
- - POST /zones
317
+ - POST /zones/{zone_name}
201
318
202
319
- API Key:
203
320
- type: apiKey access_token (QUERY)
@@ -208,12 +325,16 @@ open class DefaultEndpoints {
208
325
- API Key:
209
326
- type: apiKey access_token (QUERY)
210
327
- name: QUERY
328
+ - parameter zoneName: (path)
211
329
- parameter body: (body) (optional)
212
330
213
331
- returns: RequestBuilder<Void>
214
332
*/
215
- open class func postWithRequestBuilder( body: RenderZoneRequest ? = nil ) -> RequestBuilder < Void > {
216
- let path = " /zones "
333
+ open class func postWithRequestBuilder( zoneName: String , body: [ String : String ] ? = nil ) -> RequestBuilder < Void > {
334
+ var path = " /zones/{zone_name} "
335
+ let zoneNamePreEscape = " \( zoneName) "
336
+ let zoneNamePostEscape = zoneNamePreEscape. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
337
+ path = path. replacingOccurrences ( of: " {zone_name} " , with: zoneNamePostEscape, options: . literal, range: nil )
217
338
let URLString = ExtoleConsumerAPI . basePath + path
218
339
let parameters = JSONEncodingHelper . encodingParameters ( forEncodableObject: body)
219
340
let url = URLComponents ( string: URLString)
@@ -225,12 +346,11 @@ open class DefaultEndpoints {
225
346
}
226
347
/**
227
348
228
- - parameter zoneName: (path)
229
349
- parameter body: (body) (optional)
230
350
- parameter completion: completion handler to receive the data and the error objects
231
351
*/
232
- open class func post( zoneName : String , body: [ String : String ] ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
233
- postWithRequestBuilder ( zoneName : zoneName , body: body) . execute { ( response, error) -> Void in
352
+ open class func post( body: RenderZoneRequest ? = nil , completion: @escaping ( ( _ data: Void ? , _ error: Error ? ) -> Void ) ) {
353
+ postWithRequestBuilder ( body: body) . execute { ( response, error) -> Void in
234
354
if error == nil {
235
355
completion ( ( ) , error)
236
356
} else {
@@ -241,7 +361,7 @@ open class DefaultEndpoints {
241
361
242
362
243
363
/**
244
- - POST /zones/{zone_name}
364
+ - POST /zones
245
365
246
366
- API Key:
247
367
- type: apiKey access_token (QUERY)
@@ -252,16 +372,12 @@ open class DefaultEndpoints {
252
372
- API Key:
253
373
- type: apiKey access_token (QUERY)
254
374
- name: QUERY
255
- - parameter zoneName: (path)
256
375
- parameter body: (body) (optional)
257
376
258
377
- returns: RequestBuilder<Void>
259
378
*/
260
- open class func postWithRequestBuilder( zoneName: String , body: [ String : String ] ? = nil ) -> RequestBuilder < Void > {
261
- var path = " /zones/{zone_name} "
262
- let zoneNamePreEscape = " \( zoneName) "
263
- let zoneNamePostEscape = zoneNamePreEscape. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
264
- path = path. replacingOccurrences ( of: " {zone_name} " , with: zoneNamePostEscape, options: . literal, range: nil )
379
+ open class func postWithRequestBuilder( body: RenderZoneRequest ? = nil ) -> RequestBuilder < Void > {
380
+ let path = " /zones "
265
381
let URLString = ExtoleConsumerAPI . basePath + path
266
382
let parameters = JSONEncodingHelper . encodingParameters ( forEncodableObject: body)
267
383
let url = URLComponents ( string: URLString)
0 commit comments