suggestgrid 0.1.15.pre.SNAPSHOT

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +104 -0
  4. data/lib/suggest_grid/api_helper.rb +151 -0
  5. data/lib/suggest_grid/configuration.rb +21 -0
  6. data/lib/suggest_grid/controllers/action_controller.rb +257 -0
  7. data/lib/suggest_grid/controllers/base_controller.rb +20 -0
  8. data/lib/suggest_grid/controllers/metadata_controller.rb +527 -0
  9. data/lib/suggest_grid/controllers/recommendation_controller.rb +119 -0
  10. data/lib/suggest_grid/controllers/similarity_controller.rb +119 -0
  11. data/lib/suggest_grid/controllers/type_controller.rb +280 -0
  12. data/lib/suggest_grid/exceptions/api_exception.rb +16 -0
  13. data/lib/suggest_grid/http/http_call_back.rb +17 -0
  14. data/lib/suggest_grid/http/http_client.rb +112 -0
  15. data/lib/suggest_grid/http/http_context.rb +15 -0
  16. data/lib/suggest_grid/http/http_method_enum.rb +7 -0
  17. data/lib/suggest_grid/http/http_request.rb +28 -0
  18. data/lib/suggest_grid/http/http_response.rb +19 -0
  19. data/lib/suggest_grid/http/unirest_client.rb +41 -0
  20. data/lib/suggest_grid/models/action.rb +66 -0
  21. data/lib/suggest_grid/models/bulk_schema_error_response.rb +53 -0
  22. data/lib/suggest_grid/models/count_response.rb +39 -0
  23. data/lib/suggest_grid/models/error_response.rb +48 -0
  24. data/lib/suggest_grid/models/get_recommended_items_body.rb +111 -0
  25. data/lib/suggest_grid/models/get_recommended_users_body.rb +111 -0
  26. data/lib/suggest_grid/models/get_similar_items_body.rb +102 -0
  27. data/lib/suggest_grid/models/get_similar_users_body.rb +102 -0
  28. data/lib/suggest_grid/models/get_type_response.rb +39 -0
  29. data/lib/suggest_grid/models/get_types_response.rb +48 -0
  30. data/lib/suggest_grid/models/items_response.rb +53 -0
  31. data/lib/suggest_grid/models/message_response.rb +39 -0
  32. data/lib/suggest_grid/models/metadata.rb +39 -0
  33. data/lib/suggest_grid/models/metadata_information_response.rb +39 -0
  34. data/lib/suggest_grid/models/schema_error_response.rb +57 -0
  35. data/lib/suggest_grid/models/type_request_body.rb +40 -0
  36. data/lib/suggest_grid/models/users_response.rb +53 -0
  37. data/lib/suggest_grid/suggest_grid_client.rb +47 -0
  38. data/lib/suggest_grid.rb +48 -0
  39. data/spec/swagger.yaml +1169 -0
  40. metadata +123 -0
data/spec/swagger.yaml ADDED
@@ -0,0 +1,1169 @@
1
+ swagger: '2.0'
2
+
3
+ info:
4
+ title: SuggestGrid
5
+ version: 0.1.15-SNAPSHOT
6
+ description: SuggestGrid is an recommendation and personalization service.
7
+ x-codegen-settings:
8
+ appendContentHeaders: true
9
+ generateAsyncCode: true
10
+ useMethodPrefix: false
11
+ useModelPostfix: false
12
+ useEnumPostfix: false
13
+ useConstructorsForConfig: false
14
+ iOSUseAppInfoPlist: true
15
+ androidUseAppManifest: true
16
+ collectParameters: false
17
+ csharpDefaultNamespace: SuggestGrid
18
+ javaDefaultPackageName: com.suggestgrid
19
+ brandLabel: SuggestGrid
20
+ userAgent: SUGGESTGRID
21
+ projectName: SuggestGrid
22
+ enableAdditionalModelProperties: false
23
+ preserveParameterOrder: true
24
+
25
+ host: localhost:9090
26
+
27
+ schemes:
28
+ - http
29
+
30
+ securityDefinitions:
31
+ basicAuth:
32
+ type: basic
33
+ description: HTTP Basic Authentication. Works over `HTTP`
34
+
35
+ security:
36
+ - basicAuth: []
37
+
38
+ consumes:
39
+ - application/json
40
+
41
+ produces:
42
+ - application/json
43
+
44
+ tags:
45
+ - name: type
46
+ description: Type Methods
47
+ x-docs-text: |
48
+ Type methods are used for managing SuggestGrid types.
49
+ For more information on types, refer to [Types concept documentation](http://www.suggestgrid.com/docs/concepts#types).
50
+ x-methods:
51
+ - create_type
52
+ - get_type
53
+ - delete_type
54
+ - get_all_types
55
+ - delete_all_types
56
+ - name: action
57
+ description: Action Methods
58
+ x-docs-text: |
59
+ Action methods are for posting and deleting actions.
60
+ For more information on actions, refer to [Actions concept documentation](http://www.suggestgrid.com/docs/concepts#actions).
61
+ x-methods:
62
+ - post_action
63
+ - post_bulk_actions
64
+ - get_actions
65
+ - delete_actions
66
+ - name: metadata
67
+ description: Metadata Methods
68
+ x-docs-text: |
69
+ Metadata methods are for posting and deleting metadata.
70
+ For more information on metadata, refer to [Metadata concept documentation ](http://www.suggestgrid.com/docs/concepts#metadata).
71
+ x-methods:
72
+ - post_user
73
+ - post_bulk_users
74
+ - get_users
75
+ - delete_user
76
+ - delete_all_users
77
+ - post_item
78
+ - post_bulk_items
79
+ - get_items
80
+ - delete_item
81
+ - delete_all_items
82
+ - name: recommendation
83
+ description: Recommnedation Methods
84
+ x-docs-text: |
85
+ Recommnedation methods are for getting recommended items or users responses from SuggestGrid.
86
+ For more information on recommendations, refer to [Recommendations concept documentation](http://www.suggestgrid.com/docs/concepts#recommendations).
87
+ x-methods:
88
+ - get_recommended_users
89
+ - get_recommended_items
90
+ - name: similarity
91
+ description: Similarity Methods
92
+ x-docs-text: |
93
+ Similarity methods are for getting similar items or users responses from SuggestGrid.
94
+ For more information on similars, refer to [Similarities concept documentation](http://www.suggestgrid.com/docs/concepts#similarities).
95
+ x-methods:
96
+ - get_similar_users
97
+ - get_similar_items
98
+
99
+ definitions:
100
+ Action:
101
+ type: object
102
+ description: An action object.
103
+ properties:
104
+ type:
105
+ type: string
106
+ description: The type that the action belongs to.
107
+ user_id:
108
+ type: string
109
+ description: The user id of the performer of the action.
110
+ item_id:
111
+ type: string
112
+ description: The item id of the item the action is performed on.
113
+ rating:
114
+ type: number
115
+ description: The optional rating, if the type is explicit.
116
+ required:
117
+ - type
118
+ - user_id
119
+ - item_id
120
+ Filter:
121
+ type: object
122
+ description: |
123
+ additionalProperties:
124
+ type:
125
+ - string
126
+ - integer
127
+ - number
128
+ - boolean
129
+ Metadata:
130
+ type: object
131
+ description: |
132
+ properties:
133
+ id:
134
+ type: string
135
+ description: |
136
+ additionalProperties:
137
+ type:
138
+ - string
139
+ - integer
140
+ - number
141
+ - boolean
142
+ required:
143
+ - id
144
+ # Request Bodies
145
+ TypeRequestBody:
146
+ type: object
147
+ description: |
148
+ properties:
149
+ rating:
150
+ type: string
151
+ description: |-
152
+ Could be "explicit" or "implicit"
153
+ The default is "implicit".
154
+ GetRecommendedUsersBody:
155
+ type: object
156
+ description: |
157
+ properties:
158
+ type:
159
+ type: string
160
+ description: |
161
+ types:
162
+ type: string
163
+ description: |
164
+ item_id:
165
+ type: string
166
+ description: |
167
+ item_ids:
168
+ type: array
169
+ description: |
170
+ items:
171
+ type: string
172
+ size:
173
+ type: integer
174
+ description: |
175
+ similar_user_id:
176
+ type: string
177
+ description: |
178
+ fields:
179
+ type: array
180
+ items:
181
+ type: string
182
+ description: |
183
+ filter:
184
+ $ref: '#/definitions/Filter'
185
+ except:
186
+ type: array
187
+ items:
188
+ type: string
189
+ description: |
190
+ These ids will not be included in the response.
191
+ GetRecommendedItemsBody:
192
+ type: object
193
+ description: |
194
+ properties:
195
+ type:
196
+ type: string
197
+ description: |
198
+ types:
199
+ type: string
200
+ description: |
201
+ user_id:
202
+ type: string
203
+ description: |
204
+ user_ids:
205
+ type: array
206
+ description: |
207
+ items:
208
+ type: string
209
+ size:
210
+ type: integer
211
+ description: |
212
+ similar_item_id:
213
+ type: string
214
+ description: |
215
+ fields:
216
+ type: array
217
+ items:
218
+ type: string
219
+ description: |
220
+ filter:
221
+ $ref: '#/definitions/Filter'
222
+ except:
223
+ type: array
224
+ items:
225
+ type: string
226
+ description: |
227
+ These ids will not be included in the response.
228
+ GetSimilarUsersBody:
229
+ type: object
230
+ description: |
231
+ properties:
232
+ type:
233
+ type: string
234
+ description: |
235
+ types:
236
+ type: string
237
+ description: |
238
+ user_id:
239
+ type: string
240
+ description: |
241
+ user_ids:
242
+ type: array
243
+ description: |
244
+ items:
245
+ type: string
246
+ size:
247
+ type: integer
248
+ description: |
249
+ fields:
250
+ type: array
251
+ items:
252
+ type: string
253
+ description: |
254
+ filter:
255
+ $ref: '#/definitions/Filter'
256
+ except:
257
+ type: array
258
+ items:
259
+ type: string
260
+ description: |
261
+ These ids will not be included in the response.
262
+ GetSimilarItemsBody:
263
+ type: object
264
+ description: |
265
+ properties:
266
+ type:
267
+ type: string
268
+ description: |
269
+ types:
270
+ type: string
271
+ description: |
272
+ item_id:
273
+ type: string
274
+ description: |
275
+ Get similar items to given item id. Either item id or item ids must be provided.
276
+ item_ids:
277
+ type: array
278
+ description: |
279
+ Get similar items to given item ids. Either item id or item ids must be provided.
280
+ items:
281
+ type: string
282
+ size:
283
+ type: integer
284
+ description: |
285
+ fields:
286
+ type: array
287
+ items:
288
+ type: string
289
+ description: |
290
+ filter:
291
+ $ref: '#/definitions/Filter'
292
+ except:
293
+ type: array
294
+ items:
295
+ type: string
296
+ description: |
297
+ These ids will not be included in the response.
298
+ # Responses
299
+ MessageResponse:
300
+ type: object
301
+ description: |
302
+ properties:
303
+ message:
304
+ type: string
305
+ description: Message of the response.
306
+ CountResponse:
307
+ type: object
308
+ description: |
309
+ properties:
310
+ count:
311
+ type: integer
312
+ format: int32
313
+ description: |
314
+ ErrorResponse:
315
+ type: object
316
+ description: |
317
+ properties:
318
+ message:
319
+ type: string
320
+ description: Message of the response.
321
+ status:
322
+ type: integer
323
+ format: int32
324
+ description: Status code of the response. It is not 2XX.
325
+ GetTypesResponse:
326
+ type: object
327
+ description: |
328
+ properties:
329
+ types:
330
+ type: array
331
+ description: The list of type names
332
+ items:
333
+ type: string
334
+ status:
335
+ type: integer
336
+ format: int32
337
+ description: Status code of the response. It is not 2XX.
338
+ GetTypeResponse:
339
+ type: object
340
+ description: |
341
+ properties:
342
+ rating:
343
+ type: string
344
+ description: Either 'implicit' or 'explicit'
345
+ BulkSchemaErrorResponse:
346
+ type: object
347
+ description: |
348
+ properties:
349
+ message:
350
+ type: string
351
+ description: Message of the response.
352
+ errors:
353
+ type: array
354
+ items:
355
+ $ref: '#/definitions/SchemaErrorResponse'
356
+ SchemaErrorResponse:
357
+ type: object
358
+ description: Error response returned due to Schema validations.
359
+ properties:
360
+ message:
361
+ type: string
362
+ description: Message of the response.
363
+ value:
364
+ type: object
365
+ description: The cause of the error.
366
+ error:
367
+ type: object
368
+ description: Programatic description of the error.
369
+ MetadataInformationResponse:
370
+ type: object
371
+ description: |
372
+ properties:
373
+ count:
374
+ type: integer
375
+ format: int64
376
+ description: The number of users or items with metadata.
377
+ UsersResponse:
378
+ type: object
379
+ description: |
380
+ properties:
381
+ count:
382
+ type: integer
383
+ format: int64
384
+ description: The number of users in the response.
385
+ users:
386
+ type: array
387
+ items:
388
+ $ref: '#/definitions/Metadata'
389
+ ItemsResponse:
390
+ type: object
391
+ description: |
392
+ properties:
393
+ count:
394
+ type: integer
395
+ format: int64
396
+ description: The number of items in the response.
397
+ items:
398
+ type: array
399
+ items:
400
+ $ref: '#/definitions/Metadata'
401
+
402
+ paths:
403
+ # Type Paths
404
+ /v1/types:
405
+ get:
406
+ tags:
407
+ - type
408
+ operationId: get_all_types
409
+ summary: Get All Types
410
+ description: Get all type names in an array named types.
411
+ responses:
412
+ 200:
413
+ description: Get types response.
414
+ schema:
415
+ $ref: '#/definitions/GetTypesResponse'
416
+ 429:
417
+ description: Too many requests.
418
+ schema:
419
+ $ref: '#/definitions/ErrorResponse'
420
+ default:
421
+ description: Unexpected internal error.
422
+ schema:
423
+ $ref: '#/definitions/ErrorResponse'
424
+ delete:
425
+ tags:
426
+ - type
427
+ operationId: delete_all_types
428
+ summary: Delete All Types
429
+ description: Deletes ALL types and ALL actions.
430
+ responses:
431
+ 200:
432
+ description: Get types response.
433
+ schema:
434
+ $ref: '#/definitions/GetTypesResponse'
435
+ 429:
436
+ description: Too many requests.
437
+ schema:
438
+ $ref: '#/definitions/ErrorResponse'
439
+ default:
440
+ description: Unexpected internal error.
441
+ schema:
442
+ $ref: '#/definitions/ErrorResponse'
443
+ /v1/types/{type}:
444
+ get:
445
+ tags:
446
+ - type
447
+ operationId: get_type
448
+ summary: Get Properties of a Type
449
+ description: Get the options of a type. Has rating parameter.
450
+ parameters:
451
+ - name: type
452
+ in: path
453
+ description: The name of the type to get properties.
454
+ required: true
455
+ type: string
456
+ format: id
457
+ responses:
458
+ 200:
459
+ description: Get type response.
460
+ schema:
461
+ $ref: '#/definitions/GetTypeResponse'
462
+ 429:
463
+ description: Too many requests.
464
+ schema:
465
+ $ref: '#/definitions/ErrorResponse'
466
+ default:
467
+ description: Unexpected internal error.
468
+ schema:
469
+ $ref: '#/definitions/ErrorResponse'
470
+ put:
471
+ tags:
472
+ - type
473
+ operationId: create_type
474
+ summary: Create a New Type
475
+ description: Creates a new implicit or explicit type.
476
+ parameters:
477
+ - name: type
478
+ in: path
479
+ description: The name of the type to be created.
480
+ required: true
481
+ type: string
482
+ format: id
483
+ - name: body
484
+ in: body
485
+ description: Optional body for the rating parameter.
486
+ required: false
487
+ schema:
488
+ $ref: '#/definitions/TypeRequestBody'
489
+ responses:
490
+ 200:
491
+ description: Type is created.
492
+ schema:
493
+ $ref: '#/definitions/MessageResponse'
494
+ 402:
495
+ description: Type limit reached.
496
+ schema:
497
+ $ref: '#/definitions/ErrorResponse'
498
+ 409:
499
+ description: Type already exists.
500
+ schema:
501
+ $ref: '#/definitions/ErrorResponse'
502
+ 422:
503
+ description: Rating type is not `implicit` or `explicit`.
504
+ schema:
505
+ $ref: '#/definitions/ErrorResponse'
506
+ 429:
507
+ description: Too many requests.
508
+ schema:
509
+ $ref: '#/definitions/ErrorResponse'
510
+ default:
511
+ description: Unexpected internal error.
512
+ schema:
513
+ $ref: '#/definitions/ErrorResponse'
514
+ delete:
515
+ tags:
516
+ - type
517
+ operationId: delete_type
518
+ summary: Delete a Type
519
+ description: |
520
+ Deletes a type with ALL of its actions and recommendation model.
521
+ Do not use this if you will need the type.
522
+ parameters:
523
+ - name: type
524
+ in: path
525
+ description: The name of the type to be deleted.
526
+ required: true
527
+ type: string
528
+ format: id
529
+ responses:
530
+ 200:
531
+ description: Type is deleted
532
+ schema:
533
+ $ref: '#/definitions/MessageResponse'
534
+ 404:
535
+ description: Type does not exists.
536
+ schema:
537
+ $ref: '#/definitions/ErrorResponse'
538
+ 429:
539
+ description: Too many requests.
540
+ schema:
541
+ $ref: '#/definitions/ErrorResponse'
542
+ default:
543
+ description: Unexpected internal error.
544
+ schema:
545
+ $ref: '#/definitions/ErrorResponse'
546
+ # Action Paths
547
+ /v1/actions:
548
+ post:
549
+ tags:
550
+ - action
551
+ operationId: post_action
552
+ summary: Post an Action
553
+ description: |
554
+ Posts an action to the given type in the body.
555
+ The body must have user id, item id and type.
556
+ Rating is required for actions sent to an explicit type.
557
+ parameters:
558
+ - name: body
559
+ in: body
560
+ description: The action to be posted.
561
+ required: true
562
+ schema:
563
+ $ref: '#/definitions/Action'
564
+ responses:
565
+ 200:
566
+ description: Action posted.
567
+ schema:
568
+ $ref: '#/definitions/MessageResponse'
569
+ 400:
570
+ description: Required `user_id` or `item_id` parameters are missing from the request body.
571
+ schema:
572
+ $ref: '#/definitions/ErrorResponse'
573
+ 402:
574
+ description: Action limit exceeded.
575
+ schema:
576
+ $ref: '#/definitions/ErrorResponse'
577
+ 404:
578
+ description: Type does not exists.
579
+ schema:
580
+ $ref: '#/definitions/ErrorResponse'
581
+ 429:
582
+ description: Too many requests.
583
+ schema:
584
+ $ref: '#/definitions/ErrorResponse'
585
+ default:
586
+ description: Unexpected internal error.
587
+ schema:
588
+ $ref: '#/definitions/ErrorResponse'
589
+ get:
590
+ tags:
591
+ - action
592
+ operationId: get_actions
593
+ summary: Get Actions
594
+ description: |
595
+ Type must be provided. Additionally,
596
+
597
+ * If both `user_id` and `item_id` are supplied it returns the count of the corresponding actions.
598
+ * If only `user_id` is provided, it returns the count of all the action of the given user.
599
+ * If only `user_id` is provided, it returns the count of all the action of the given item.
600
+ * If only `older_than` is provided, it returns the count of actions older than the given timestamp.
601
+ * If a few of these parameters are provided, it returns the count of the intersection of these parameters.
602
+ * If none of these are provided, it returns the count of the whole type.
603
+ parameters:
604
+ - name: type
605
+ in: query
606
+ description: The type of the actions.
607
+ required: false
608
+ type: string
609
+ format: id
610
+ - name: user_id
611
+ in: query
612
+ description: The user id of the actions.
613
+ required: false
614
+ type: string
615
+ format: id
616
+ - name: item_id
617
+ in: query
618
+ description: The item id of the actions.
619
+ required: false
620
+ type: string
621
+ format: id
622
+ - name: older_than
623
+ in: query
624
+ description: |
625
+ Delete all actions of a type older than the given timestamp or time.
626
+ Valid times are 1s, 1m, 1h, 1d, 1M, 1y, or unix timestamp (like 1443798195).
627
+ required: false
628
+ type: string
629
+ format: id
630
+ responses:
631
+ 200:
632
+ description: Successfully deleted actions.
633
+ schema:
634
+ $ref: '#/definitions/CountResponse'
635
+ 400:
636
+ description: Required `user_id` or `item_id` parameters are missing from the request body.
637
+ schema:
638
+ $ref: '#/definitions/ErrorResponse'
639
+ 429:
640
+ description: Too many requests.
641
+ schema:
642
+ $ref: '#/definitions/ErrorResponse'
643
+ default:
644
+ description: Unexpected internal error.
645
+ schema:
646
+ $ref: '#/definitions/ErrorResponse'
647
+ delete:
648
+ tags:
649
+ - action
650
+ operationId: delete_actions
651
+ summary: Delete Actions
652
+ description: |
653
+ Type must be provided. Additionally,
654
+
655
+ * If both user id and item id are supplied the user's actions on the item will be deleted.
656
+ * If only user id is provided, all actions of the user will be deleted.
657
+ * If only item id is provided, all actions on the item will be deleted.
658
+ * If only older than is provided, all actions older than the timestamp or the duration will be deleted.
659
+ * If a few of these parameters are provided, delete action will be executed within intersection of these parameters.
660
+ * One of these parameters must be provided. In order to delete all actions, delete the type.
661
+ parameters:
662
+ - name: type
663
+ in: query
664
+ description: The type of the actions.
665
+ required: false
666
+ type: string
667
+ format: id
668
+ - name: user_id
669
+ in: query
670
+ description: The user id of the actions.
671
+ required: false
672
+ type: string
673
+ format: id
674
+ - name: item_id
675
+ in: query
676
+ description: The item id of the actions.
677
+ required: false
678
+ type: string
679
+ format: id
680
+ - name: older_than
681
+ in: query
682
+ description: |
683
+ Delete all actions of a type older than the given timestamp or time.
684
+ Valid times are 1s, 1m, 1h, 1d, 1M, 1y, or unix timestamp (like 1443798195).
685
+ required: false
686
+ type: string
687
+ format: id
688
+ responses:
689
+ 200:
690
+ description: Successfully deleted actions.
691
+ schema:
692
+ $ref: '#/definitions/MessageResponse'
693
+ 400:
694
+ description: Required `user_id` or `item_id` parameters are missing from the request body.
695
+ schema:
696
+ $ref: '#/definitions/ErrorResponse'
697
+ 404:
698
+ description: Type does not exists.
699
+ schema:
700
+ $ref: '#/definitions/ErrorResponse'
701
+ 422:
702
+ description: No query parameter (`user_id`, `item_id`, or `older_than`) is given. In order to delete all actionsdelete the type.
703
+ schema:
704
+ $ref: '#/definitions/ErrorResponse'
705
+ 429:
706
+ description: Too many requests.
707
+ schema:
708
+ $ref: '#/definitions/ErrorResponse'
709
+ default:
710
+ description: Unexpected internal error.
711
+ schema:
712
+ $ref: '#/definitions/ErrorResponse'
713
+ /v1/actions/_bulk:
714
+ post:
715
+ tags:
716
+ - action
717
+ operationId: post_bulk_actions
718
+ summary: Post Bulk Actions
719
+ description: |
720
+ Posts bulk actions to SuggestGrid.
721
+ The recommended method for posting multiple actions at once.
722
+ consumes:
723
+ - text/plain; charset=utf-8
724
+ parameters:
725
+ - name: body
726
+ in: body
727
+ description: |
728
+ A number of action objects separated with newlines.
729
+ Note that this is not a valid JSON data structure.
730
+ The body size is limited to 10 thousand lines.
731
+ required: true
732
+ schema:
733
+ type: string
734
+ responses:
735
+ 200:
736
+ description: Bulk action request executed.
737
+ schema:
738
+ $ref: '#/definitions/MessageResponse'
739
+ 402:
740
+ description: Action limit exceeded.
741
+ schema:
742
+ $ref: '#/definitions/ErrorResponse'
743
+ 429:
744
+ description: Too many requests.
745
+ schema:
746
+ $ref: '#/definitions/ErrorResponse'
747
+ default:
748
+ description: Unexpected internal error.
749
+ schema:
750
+ $ref: '#/definitions/ErrorResponse'
751
+ # Metadata Paths
752
+ /v1/users/{user_id}:
753
+ delete:
754
+ tags:
755
+ - metadata
756
+ operationId: delete_user
757
+ summary: Delete a User
758
+ description: Delete a user metadata with the given user_id.
759
+ parameters:
760
+ - name: user_id
761
+ in: path
762
+ description: The user_id to delete its metadata.
763
+ required: true
764
+ type: string
765
+ format: id
766
+ responses:
767
+ 200:
768
+ description: Deleted a user metadata.
769
+ schema:
770
+ $ref: '#/definitions/MessageResponse'
771
+ 429:
772
+ description: Too many requests.
773
+ schema:
774
+ $ref: '#/definitions/ErrorResponse'
775
+ default:
776
+ description: Unexpected internal error.
777
+ schema:
778
+ $ref: '#/definitions/ErrorResponse'
779
+ /v1/users:
780
+ post:
781
+ tags:
782
+ - metadata
783
+ operationId: post_user
784
+ summary: Post a User
785
+ description: Posts a user metadata.
786
+ parameters:
787
+ - name: metadata
788
+ in: body
789
+ description: The metadata to be saved. Metadata format has its restrictions.
790
+ required: true
791
+ schema:
792
+ $ref: '#/definitions/Metadata'
793
+ responses:
794
+ 200:
795
+ description: Posted a user metadata.
796
+ schema:
797
+ $ref: '#/definitions/MessageResponse'
798
+ 400:
799
+ description: Metadata is invalid.
800
+ schema:
801
+ $ref: '#/definitions/SchemaErrorResponse'
802
+ 429:
803
+ description: Too many requests.
804
+ schema:
805
+ $ref: '#/definitions/ErrorResponse'
806
+ default:
807
+ description: Unexpected internal error.
808
+ schema:
809
+ $ref: '#/definitions/ErrorResponse'
810
+ get:
811
+ tags:
812
+ - metadata
813
+ operationId: get_users
814
+ summary: Get Users
815
+ description: Get information about users. Only returns count at the moment.
816
+ responses:
817
+ 200:
818
+ description: Information on users.
819
+ schema:
820
+ $ref: '#/definitions/MetadataInformationResponse'
821
+ 429:
822
+ description: Too many requests.
823
+ schema:
824
+ $ref: '#/definitions/ErrorResponse'
825
+ default:
826
+ description: Unexpected internal error.
827
+ schema:
828
+ $ref: '#/definitions/ErrorResponse'
829
+ delete:
830
+ tags:
831
+ - metadata
832
+ operationId: delete_all_users
833
+ summary: Delete All Users
834
+ description: Deletes all user metadata from SuggestGrid.
835
+ responses:
836
+ 200:
837
+ description: Deleted all user metadata.
838
+ schema:
839
+ $ref: '#/definitions/MessageResponse'
840
+ 429:
841
+ description: Too many requests.
842
+ schema:
843
+ $ref: '#/definitions/ErrorResponse'
844
+ default:
845
+ description: Unexpected internal error.
846
+ schema:
847
+ $ref: '#/definitions/ErrorResponse'
848
+ /v1/items/{item_id}:
849
+ delete:
850
+ tags:
851
+ - metadata
852
+ operationId: delete_item
853
+ summary: Delete an Item
854
+ description: Delete an item metadata with the given item_id.
855
+ parameters:
856
+ - name: item_id
857
+ in: path
858
+ description: The item_id to delete its metadata.
859
+ required: true
860
+ type: string
861
+ format: id
862
+ responses:
863
+ 200:
864
+ description: Deleted an item metadata.
865
+ schema:
866
+ $ref: '#/definitions/MessageResponse'
867
+ 429:
868
+ description: Too many requests.
869
+ schema:
870
+ $ref: '#/definitions/ErrorResponse'
871
+ default:
872
+ description: Unexpected internal error.
873
+ schema:
874
+ $ref: '#/definitions/ErrorResponse'
875
+ /v1/items:
876
+ post:
877
+ tags:
878
+ - metadata
879
+ operationId: post_item
880
+ summary: Post an Item
881
+ description: |
882
+ Posts an item metadata.
883
+ This metadata can be used to filter or to be included in recommendations and similars methods.
884
+ parameters:
885
+ - name: body
886
+ in: body
887
+ description: The metadata to be saved. Metadata format has its restrictions.
888
+ required: true
889
+ schema:
890
+ $ref: '#/definitions/Metadata'
891
+ responses:
892
+ 200:
893
+ description: Posted an item metadata.
894
+ schema:
895
+ $ref: '#/definitions/MessageResponse'
896
+ 400:
897
+ description: Metadata is invalid.
898
+ schema:
899
+ $ref: '#/definitions/SchemaErrorResponse'
900
+ 429:
901
+ description: Too many requests.
902
+ schema:
903
+ $ref: '#/definitions/ErrorResponse'
904
+ default:
905
+ description: Unexpected internal error.
906
+ schema:
907
+ $ref: '#/definitions/ErrorResponse'
908
+ get:
909
+ tags:
910
+ - metadata
911
+ operationId: get_items
912
+ summary: Get Items
913
+ description: Get information about items. Only returns count at the moment.
914
+ responses:
915
+ 200:
916
+ description: Information on items.
917
+ schema:
918
+ $ref: '#/definitions/MetadataInformationResponse'
919
+ 429:
920
+ description: Too many requests.
921
+ schema:
922
+ $ref: '#/definitions/ErrorResponse'
923
+ default:
924
+ description: Unexpected internal error.
925
+ schema:
926
+ $ref: '#/definitions/ErrorResponse'
927
+ delete:
928
+ tags:
929
+ - metadata
930
+ operationId: delete_all_items
931
+ summary: Delete All Items
932
+ description: |
933
+ Delete all items metadata.
934
+ This method would flush all items metadata on SuggestGrid.
935
+ responses:
936
+ 200:
937
+ description: Deleted all item metadata.
938
+ schema:
939
+ $ref: '#/definitions/MessageResponse'
940
+ 429:
941
+ description: Too many requests.
942
+ schema:
943
+ $ref: '#/definitions/ErrorResponse'
944
+ default:
945
+ description: Unexpected internal error.
946
+ schema:
947
+ $ref: '#/definitions/ErrorResponse'
948
+ /v1/users/_bulk:
949
+ post:
950
+ tags:
951
+ - metadata
952
+ operationId: post_bulk_users
953
+ summary: Post Bulk Users
954
+ description: |
955
+ Post user metadata in bulk.
956
+ This metadata can be used to filter or to be included in recommendations and similars methods.
957
+ consumes:
958
+ - text/plain; charset=utf-8
959
+ parameters:
960
+ - name: body
961
+ in: body
962
+ description: |
963
+ A number of user metadata objects separated with newlines.
964
+ Each user metadata object must have its id field.
965
+ Note that this is not a valid JSON data structure.
966
+ The body size is limited to 10 thousand lines.
967
+ required: true
968
+ schema:
969
+ type: string
970
+ responses:
971
+ 200:
972
+ description: Bulk user metadata request executed.
973
+ schema:
974
+ $ref: '#/definitions/MessageResponse'
975
+ 209:
976
+ description: Some metadata is not uploaded successfully.
977
+ schema:
978
+ $ref: '#/definitions/BulkSchemaErrorResponse'
979
+ 429:
980
+ description: Too many requests.
981
+ schema:
982
+ $ref: '#/definitions/ErrorResponse'
983
+ default:
984
+ description: Unexpected internal error.
985
+ schema:
986
+ $ref: '#/definitions/ErrorResponse'
987
+ /v1/items/_bulk:
988
+ post:
989
+ tags:
990
+ - metadata
991
+ operationId: post_bulk_items
992
+ summary: Post Bulk Items
993
+ description: |
994
+ Post item metadata in bulk.
995
+ This method is recommended for sharing stored data with SuggestGrid.
996
+ consumes:
997
+ - text/plain; charset=utf-8
998
+ parameters:
999
+ - name: body
1000
+ in: body
1001
+ description: |
1002
+ A number of item metadata objects separated with newlines.
1003
+ Each item metadata object must have its id field.
1004
+ Note that this is not a valid JSON data structure.
1005
+ The body size is limited to 10 thousand lines.
1006
+ required: true
1007
+ schema:
1008
+ type: string
1009
+ responses:
1010
+ 200:
1011
+ description: Bulk item metadata request executed.
1012
+ schema:
1013
+ $ref: '#/definitions/MessageResponse'
1014
+ 209:
1015
+ description: Some metadata is not uploaded successfully.
1016
+ schema:
1017
+ $ref: '#/definitions/BulkSchemaErrorResponse'
1018
+ 429:
1019
+ description: Too many requests.
1020
+ schema:
1021
+ $ref: '#/definitions/ErrorResponse'
1022
+ default:
1023
+ description: Unexpected internal error.
1024
+ schema:
1025
+ $ref: '#/definitions/ErrorResponse'
1026
+ # Recommendation Paths
1027
+ /v1/recommend/users:
1028
+ post:
1029
+ tags:
1030
+ - recommendation
1031
+ operationId: get_recommended_users
1032
+ summary: Get Recommended Users
1033
+ description: Recommend users for the given body parameters.
1034
+ parameters:
1035
+ - name: body
1036
+ in: body
1037
+ description: |
1038
+ Parameters for recommend users method.
1039
+ required: true
1040
+ schema:
1041
+ $ref: '#/definitions/GetRecommendedUsersBody'
1042
+ responses:
1043
+ 200:
1044
+ description: Similar users response.
1045
+ schema:
1046
+ $ref: '#/definitions/UsersResponse'
1047
+ 400:
1048
+ description: Request body is invalid.
1049
+ schema:
1050
+ $ref: '#/definitions/ErrorResponse'
1051
+ 422:
1052
+ description: Required parameters are missing.
1053
+ schema:
1054
+ $ref: '#/definitions/ErrorResponse'
1055
+ 429:
1056
+ description: Too many requests.
1057
+ schema:
1058
+ $ref: '#/definitions/ErrorResponse'
1059
+ default:
1060
+ description: Unexpected internal error.
1061
+ schema:
1062
+ $ref: '#/definitions/ErrorResponse'
1063
+ /v1/recommend/items:
1064
+ post:
1065
+ tags:
1066
+ - recommendation
1067
+ operationId: get_recommended_items
1068
+ summary: Get Recommended Items
1069
+ description: Recommend items for the given body parameters.
1070
+ parameters:
1071
+ - name: body
1072
+ in: body
1073
+ description: |
1074
+ Parameters for recommend items method.
1075
+ required: true
1076
+ schema:
1077
+ $ref: '#/definitions/GetRecommendedItemsBody'
1078
+ responses:
1079
+ 200:
1080
+ description: |
1081
+ schema:
1082
+ $ref: '#/definitions/ItemsResponse'
1083
+ 400:
1084
+ description: Request body is invalid.
1085
+ schema:
1086
+ $ref: '#/definitions/ErrorResponse'
1087
+ 422:
1088
+ description: Required parameters are missing.
1089
+ schema:
1090
+ $ref: '#/definitions/ErrorResponse'
1091
+ 429:
1092
+ description: Too many requests.
1093
+ schema:
1094
+ $ref: '#/definitions/ErrorResponse'
1095
+ default:
1096
+ description: Unexpected internal error.
1097
+ schema:
1098
+ $ref: '#/definitions/ErrorResponse'
1099
+ # Similarity Paths
1100
+ /v1/similar/users:
1101
+ post:
1102
+ tags:
1103
+ - similarity
1104
+ operationId: get_similar_users
1105
+ summary: Get Similar Users
1106
+ description: Get similar users to a user.
1107
+ parameters:
1108
+ - name: body
1109
+ in: body
1110
+ description: Similar users method parameters.
1111
+ required: true
1112
+ schema:
1113
+ $ref: '#/definitions/GetSimilarUsersBody'
1114
+ responses:
1115
+ 200:
1116
+ description: Similar users response.
1117
+ schema:
1118
+ $ref: '#/definitions/UsersResponse'
1119
+ 400:
1120
+ description: Request body is invalid.
1121
+ schema:
1122
+ $ref: '#/definitions/ErrorResponse'
1123
+ 422:
1124
+ description: Required parameters are missing.
1125
+ schema:
1126
+ $ref: '#/definitions/ErrorResponse'
1127
+ 429:
1128
+ description: Too many requests.
1129
+ schema:
1130
+ $ref: '#/definitions/ErrorResponse'
1131
+ default:
1132
+ description: Unexpected internal error.
1133
+ schema:
1134
+ $ref: '#/definitions/ErrorResponse'
1135
+ /v1/similar/items:
1136
+ post:
1137
+ tags:
1138
+ - similarity
1139
+ operationId: get_similar_items
1140
+ summary: Get Similar Items
1141
+ description: Get similar items to an item.
1142
+ parameters:
1143
+ - name: body
1144
+ in: body
1145
+ description: Similar items method parameter.
1146
+ required: true
1147
+ schema:
1148
+ $ref: '#/definitions/GetSimilarItemsBody'
1149
+ responses:
1150
+ 200:
1151
+ description: |
1152
+ schema:
1153
+ $ref: '#/definitions/ItemsResponse'
1154
+ 400:
1155
+ description: Request body is invalid.
1156
+ schema:
1157
+ $ref: '#/definitions/ErrorResponse'
1158
+ 422:
1159
+ description: Required parameters are missing.
1160
+ schema:
1161
+ $ref: '#/definitions/ErrorResponse'
1162
+ 429:
1163
+ description: Too many requests.
1164
+ schema:
1165
+ $ref: '#/definitions/ErrorResponse'
1166
+ default:
1167
+ description: Unexpected internal error.
1168
+ schema:
1169
+ $ref: '#/definitions/ErrorResponse'