aboutyou-sdk 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/aboutyou-sdk.rb +443 -489
- data/lib/aboutyou-sdk/Client.rb +86 -111
- data/lib/aboutyou-sdk/Constants.rb +34 -34
- data/lib/aboutyou-sdk/Criteria/ProductSearchCriteria.rb +1 -1
- data/lib/aboutyou-sdk/Query.rb +219 -218
- data/lib/aboutyou-sdk/QueryBuilder.rb +414 -432
- data/tests/testAutocomplete.rb +0 -1
- data/tests/testFacets.rb +2 -1
- metadata +2 -2
@@ -1,440 +1,422 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
1
|
module AboutYou
|
4
2
|
module SDK
|
5
3
|
module QueryBuilder
|
6
4
|
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
self.query.push(Hash['basket' => basketQuery])
|
201
|
-
|
202
|
-
return self;
|
203
|
-
end
|
204
|
-
|
205
|
-
###
|
206
|
-
# @param int[]|string[] $ids either a single category ID as integer or an array of IDs
|
207
|
-
#
|
208
|
-
# @return $this
|
209
|
-
###
|
210
|
-
def fetchCategoriesByIds(ids = nil)
|
5
|
+
###
|
6
|
+
# @param string $searchword The prefix search word to search for.
|
7
|
+
# @param int $limit Maximum number of results.
|
8
|
+
# @param array $types Array of types to search for (Constants::TYPE_...).
|
9
|
+
#
|
10
|
+
# @return $this
|
11
|
+
#
|
12
|
+
# @throws \InvalidArgumentException
|
13
|
+
###
|
14
|
+
def fetchAutocomplete(searchword, limit = nil, types = nil)
|
15
|
+
|
16
|
+
unless searchword.is_a? String
|
17
|
+
raise 'InvalidArgumentException! searchword must be a string'
|
18
|
+
end
|
19
|
+
|
20
|
+
# downcase is a workaround of ticket SAPI-532
|
21
|
+
options = {'searchword' => searchword.downcase}
|
22
|
+
|
23
|
+
if limit != nil
|
24
|
+
if !(limit.is_a? Integer) && !limit[/\d/]
|
25
|
+
raise 'InvalidArgumentException! limit must be an integer'
|
26
|
+
end
|
27
|
+
options['limit'] = Integer(limit)
|
28
|
+
end
|
29
|
+
|
30
|
+
unless types.empty?
|
31
|
+
options['types'] = types
|
32
|
+
end
|
33
|
+
|
34
|
+
self.query.push({'autocompletion' => options})
|
35
|
+
self
|
36
|
+
end
|
37
|
+
|
38
|
+
###
|
39
|
+
# @param string $sessionId Free to choose ID of the current website visitor.
|
40
|
+
#
|
41
|
+
# @return $this
|
42
|
+
###
|
43
|
+
def fetchBasket(sessionId)
|
44
|
+
|
45
|
+
checkSessionId(sessionId)
|
46
|
+
|
47
|
+
self.query.push({'basket' => {'session_id' => sessionId}})
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
###
|
52
|
+
# @param string $sessionId Free to choose ID of the current website visitor.
|
53
|
+
# @param int $productVariantId ID of product variant.
|
54
|
+
# @param int $amount Amount of items to add.
|
55
|
+
#
|
56
|
+
#@return $this
|
57
|
+
###
|
58
|
+
def addItemsToBasket(sessionId, items)
|
59
|
+
|
60
|
+
checkSessionId(sessionId)
|
61
|
+
|
62
|
+
orderLines = []
|
63
|
+
|
64
|
+
items.each do |item|
|
65
|
+
orderLine = {
|
66
|
+
'id' => item.id,
|
67
|
+
'variant_id' => item.variantId
|
68
|
+
}
|
69
|
+
|
70
|
+
if item.additionalData
|
71
|
+
orderLine['additional_data'] = item.additionalData
|
72
|
+
end
|
73
|
+
|
74
|
+
orderLines.push(orderLine)
|
75
|
+
end
|
76
|
+
|
77
|
+
self.query.push({'basket' => {
|
78
|
+
'session_id' => sessionId,
|
79
|
+
'order_lines' => orderLines
|
80
|
+
}})
|
81
|
+
self
|
82
|
+
end
|
83
|
+
|
84
|
+
###
|
85
|
+
# @param string $sessionId Free to choose ID of the current website visitor.
|
86
|
+
# @param Model\BasketItemSet[] $itemSets
|
87
|
+
# @param int $amount Amount of items to add.
|
88
|
+
#
|
89
|
+
# @return $this
|
90
|
+
###
|
91
|
+
def addItemSetsToBasket(sessionId, itemSets)
|
92
|
+
|
93
|
+
checkSessionId(sessionId)
|
94
|
+
|
95
|
+
orderLines = []
|
96
|
+
|
97
|
+
itemSets.each do |itemSet|
|
98
|
+
orderLine = {
|
99
|
+
'id' => itemSet.id,
|
100
|
+
'set_items' => []
|
101
|
+
}
|
102
|
+
|
103
|
+
if itemSet.additionalData
|
104
|
+
orderLine['additional_data'] = itemSet.additionalData
|
105
|
+
end
|
106
|
+
|
107
|
+
itemSet.items.each do |item|
|
108
|
+
entry = {'variant_id' => item.variantId}
|
109
|
+
if item.additionalData
|
110
|
+
entry['additional_data'] = item.additionalData
|
111
|
+
end
|
112
|
+
orderLine['set_items'].push(entry)
|
113
|
+
end
|
114
|
+
|
115
|
+
orderLines.push(orderLine)
|
116
|
+
end
|
117
|
+
|
118
|
+
self.query.push({'basket' => {
|
119
|
+
'session_id' => sessionId,
|
120
|
+
'order_lines' => orderLines
|
121
|
+
}})
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
###
|
126
|
+
# @param string $sessionId Free to choose ID of the current website visitor.
|
127
|
+
# @param int $productVariantId ID of product variant.
|
128
|
+
# @param string $basketItemId ID of single item or set in the basket
|
129
|
+
#
|
130
|
+
# @return $this
|
131
|
+
###
|
132
|
+
def addToBasket(sessionId, productVariantId, basketItemId)
|
133
|
+
|
134
|
+
checkSessionId(sessionId);
|
135
|
+
|
136
|
+
self.query.push({'basket' => {
|
137
|
+
'session_id' => sessionId,
|
138
|
+
'order_lines' => [{
|
139
|
+
'id' => basketItemId,
|
140
|
+
'variant_id' => Integer(productVariantId)
|
141
|
+
}]
|
142
|
+
}})
|
143
|
+
self
|
144
|
+
end
|
145
|
+
|
146
|
+
###
|
147
|
+
# @param string $sessionId Free to choose ID of the current website visitor.
|
148
|
+
# @param string[] $itemIds array of basket item ids to delete, this can be sets or single items
|
149
|
+
#
|
150
|
+
# @return $this
|
151
|
+
###
|
152
|
+
def removeFromBasket(sessionId, itemIds)
|
153
|
+
|
154
|
+
checkSessionId(sessionId)
|
155
|
+
|
156
|
+
orderLines = []
|
157
|
+
|
158
|
+
itemIds.each do |id|
|
159
|
+
orderLines.push({'delete' => id})
|
160
|
+
end
|
161
|
+
|
162
|
+
self.query.push({
|
163
|
+
'basket' => {
|
164
|
+
'session_id' => sessionId,
|
165
|
+
'order_lines' => orderLines
|
166
|
+
}
|
167
|
+
})
|
168
|
+
self
|
169
|
+
end
|
170
|
+
|
171
|
+
###
|
172
|
+
# @param string $sessionId
|
173
|
+
# @param Basket $basket
|
174
|
+
#
|
175
|
+
# @return $this
|
176
|
+
###
|
177
|
+
def updateBasket(sessionId, basket)
|
178
|
+
|
179
|
+
checkSessionId(sessionId)
|
180
|
+
|
181
|
+
basketQuery = {'session_id' => sessionId}
|
182
|
+
|
183
|
+
orderLines = basket.orderLinesArray
|
184
|
+
unless orderLines.empty?
|
185
|
+
basketQuery['order_lines'] = orderLines
|
186
|
+
end
|
187
|
+
|
188
|
+
self.query.push({'basket' => basketQuery})
|
189
|
+
self
|
190
|
+
end
|
191
|
+
|
192
|
+
###
|
193
|
+
# @param int[]|string[] $ids either a single category ID as integer or an array of IDs
|
194
|
+
#
|
195
|
+
# @return $this
|
196
|
+
###
|
197
|
+
def fetchCategoriesByIds(ids = nil)
|
211
198
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
self
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
end
|
434
|
-
if !(sessionId.length > 4)
|
435
|
-
raise 'InvalidArgumentException! The session id must have at least 5 characters'
|
436
|
-
end
|
437
|
-
end
|
199
|
+
if ids == nil
|
200
|
+
self.query.push('category' => nil)
|
201
|
+
else
|
202
|
+
# we allow to pass a single ID instead of an array
|
203
|
+
ids = Array(ids)
|
204
|
+
|
205
|
+
ids.each do |id|
|
206
|
+
id = Integer(id)
|
207
|
+
if id < 1
|
208
|
+
raise 'InvalidArgumentException! A single category ID must be greater than 0'
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
ids = ids.map{|id| Integer(id)}
|
213
|
+
|
214
|
+
self.query.push({
|
215
|
+
'category' => {
|
216
|
+
'ids' => ids}
|
217
|
+
})
|
218
|
+
end
|
219
|
+
self
|
220
|
+
end
|
221
|
+
|
222
|
+
###
|
223
|
+
# @param int $maxDepth -1 <= $maxDepth <= 10,
|
224
|
+
#
|
225
|
+
# @return $this
|
226
|
+
###
|
227
|
+
def fetchCategoryTree()
|
228
|
+
|
229
|
+
self.query.push({'category_tree' => {"version"=>"2"}})
|
230
|
+
self
|
231
|
+
end
|
232
|
+
|
233
|
+
###
|
234
|
+
# @param string[]|int[] $ids
|
235
|
+
# @param array $fields
|
236
|
+
#
|
237
|
+
# @return $this
|
238
|
+
###
|
239
|
+
def fetchProductsByIds(ids,fields = [])
|
240
|
+
# we allow to pass a single ID instead of an array
|
241
|
+
|
242
|
+
ids = Array(ids).map{|id| Integer(id)}
|
243
|
+
|
244
|
+
self.query.push({'products' => {
|
245
|
+
'ids' => ids,
|
246
|
+
'fields' => AboutYou::SDK::Criteria::ProductFields.filterFields(fields)
|
247
|
+
}
|
248
|
+
})
|
249
|
+
self
|
250
|
+
end
|
251
|
+
|
252
|
+
###
|
253
|
+
# @param string[]|int[] $ids
|
254
|
+
#
|
255
|
+
# @return $this
|
256
|
+
###
|
257
|
+
def fetchLiveVariantByIds(ids)
|
258
|
+
# we allow to pass a single ID instead of an array
|
259
|
+
ids = Array(ids)
|
260
|
+
|
261
|
+
ids = ids.map{|id| Integer(id)}
|
262
|
+
|
263
|
+
self.query.push({'live_variant' => {'ids' => ids}})
|
264
|
+
self
|
265
|
+
end
|
266
|
+
|
267
|
+
###
|
268
|
+
# @param string[] $eans
|
269
|
+
# @param array $fields
|
270
|
+
#
|
271
|
+
# @return $this
|
272
|
+
###
|
273
|
+
def fetchProductsByEans(eans,fields = [])
|
274
|
+
|
275
|
+
self.query.push({
|
276
|
+
'products_eans' => {
|
277
|
+
'eans' => eans,
|
278
|
+
'fields' => AboutYou::SDK::Criteria::ProductFields.filterFields(fields),
|
279
|
+
'version' => '2'
|
280
|
+
}
|
281
|
+
})
|
282
|
+
self
|
283
|
+
end
|
284
|
+
|
285
|
+
###
|
286
|
+
# @param string|int $orderId
|
287
|
+
#
|
288
|
+
# @return $this
|
289
|
+
###
|
290
|
+
def fetchOrder(orderId)
|
291
|
+
|
292
|
+
self.query.push({'get_order' => {'order_id' => orderId}})
|
293
|
+
self
|
294
|
+
end
|
295
|
+
|
296
|
+
###
|
297
|
+
# @param string $sessionId
|
298
|
+
# @param string $successUrl
|
299
|
+
# @param string $cancelUrl
|
300
|
+
# @param string $errorUrl
|
301
|
+
#
|
302
|
+
# @return $this
|
303
|
+
###
|
304
|
+
def initiateOrder(sessionId, successUrl, cancelUrl, errorUrl)
|
305
|
+
|
306
|
+
checkSessionId(sessionId)
|
307
|
+
|
308
|
+
args = {
|
309
|
+
'session_id' => sessionId,
|
310
|
+
'success_url' => successUrl
|
311
|
+
}
|
312
|
+
if cancelUrl
|
313
|
+
args['cancel_url'] = cancelUrl
|
314
|
+
end
|
315
|
+
if errorUrl
|
316
|
+
args['error_url'] = errorUrl
|
317
|
+
end
|
318
|
+
self.query.push({'initiate_order' => args})
|
319
|
+
self
|
320
|
+
end
|
321
|
+
|
322
|
+
###
|
323
|
+
# @param ProductSearchCriteria $criteria
|
324
|
+
#
|
325
|
+
# @return $this
|
326
|
+
###
|
327
|
+
def fetchProductSearch(criteria)
|
328
|
+
|
329
|
+
checkSessionId(criteria.sessionId)
|
330
|
+
|
331
|
+
self.query.push({'product_search' => criteria.toArray})
|
332
|
+
self
|
333
|
+
end
|
334
|
+
|
335
|
+
###
|
336
|
+
# @param array $groupIds
|
337
|
+
#
|
338
|
+
# @return $this
|
339
|
+
#
|
340
|
+
# @throws \InvalidArgumentException
|
341
|
+
###
|
342
|
+
def fetchFacets(groupIds = [])
|
343
|
+
|
344
|
+
if groupIds
|
345
|
+
groupids = groupIds.map{|groupId| Integer(groupId)}
|
346
|
+
end
|
347
|
+
|
348
|
+
self.query.push({'facets' => {'group_ids' => groupids}})
|
349
|
+
self
|
350
|
+
end
|
351
|
+
|
352
|
+
###
|
353
|
+
# @param array $params
|
354
|
+
#
|
355
|
+
# @return $this
|
356
|
+
#
|
357
|
+
# @throws \InvalidArgumentException
|
358
|
+
###
|
359
|
+
def fetchFacet(params)
|
360
|
+
|
361
|
+
if params.empty?
|
362
|
+
raise 'InvalidArgumentException! no params given'
|
363
|
+
end
|
364
|
+
|
365
|
+
self.query.push({'facet' => params})
|
366
|
+
self
|
367
|
+
end
|
368
|
+
|
369
|
+
###
|
370
|
+
# @return $this
|
371
|
+
###
|
372
|
+
def fetchFacetTypes
|
373
|
+
|
374
|
+
self.query.push({'facet_types' => nil})
|
375
|
+
self
|
376
|
+
end
|
377
|
+
|
378
|
+
###
|
379
|
+
# @param string $searchword The search string to search for.
|
380
|
+
#
|
381
|
+
# @return $this
|
382
|
+
###
|
383
|
+
def fetchSuggest(searchword)
|
384
|
+
|
385
|
+
self.query.push({'suggest' => {'searchword' => searchword}})
|
386
|
+
self
|
387
|
+
end
|
388
|
+
|
389
|
+
###
|
390
|
+
# @return $this
|
391
|
+
###
|
392
|
+
def fetchChildApps
|
393
|
+
|
394
|
+
self.query.push({'child_apps' => nil})
|
395
|
+
self
|
396
|
+
end
|
397
|
+
|
398
|
+
###
|
399
|
+
# @return string
|
400
|
+
###
|
401
|
+
def queryString
|
402
|
+
|
403
|
+
self.query.to_json
|
404
|
+
end
|
405
|
+
|
406
|
+
###
|
407
|
+
# @param $sessionId
|
408
|
+
#
|
409
|
+
# @throws \InvalidArgumentException
|
410
|
+
###
|
411
|
+
def checkSessionId(sessionId)
|
412
|
+
|
413
|
+
unless sessionId.is_a? String
|
414
|
+
raise 'InvalidArgumentException! The session id must be a string'
|
415
|
+
end
|
416
|
+
unless sessionId.length > 4
|
417
|
+
raise 'InvalidArgumentException! The session id must have at least 5 characters'
|
418
|
+
end
|
419
|
+
end
|
438
420
|
end
|
439
421
|
end
|
440
422
|
end
|