k_sequencing 0.1.21 → 0.1.22
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 +4 -4
- data/README.md +102 -28
- data/docs/documentation.md +145 -62
- data/k_sequencing.gemspec +1 -1
- data/lib/k_sequencing/connection.rb +1 -1
- data/lib/k_sequencing/image_choices.rb +28 -0
- data/lib/k_sequencing/image_closed_questions.rb +28 -0
- data/lib/k_sequencing/image_messages.rb +28 -0
- data/lib/k_sequencing/image_photo_tags.rb +28 -0
- data/lib/k_sequencing/predictions.rb +28 -0
- data/lib/k_sequencing.rb +27 -1
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df1243bea4f2e8e973f371694330aca7c80b0a90
|
4
|
+
data.tar.gz: 2432af1d3d4969ffd5481f713b391c49784b1cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32622a0b1747ce257f7f18d61e73d018d78b2d40660bd3d923a0c91dd66fcb1824b6bbc6aa67c7b9144261e1d1a0fcda0e4873b10f4875fcb4e9dbe9a2d8ae30
|
7
|
+
data.tar.gz: 2ed1358f4bd62ab9a05f9f277e58cdd07304d842d998457542450400ee56db0cd7ab62050557c0e89b894bf5394379fbf10344d10bb76669b6e46935a1072a21
|
data/README.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# Image and content moderation services.
|
2
|
+
|
3
|
+
|
4
|
+
## There are 5 avalable for API
|
5
|
+
* Closed questions - Answer can be only approved, declined or ban(kenta).
|
6
|
+
* Choices - This model use to ask question with multiple choice. Anwser can be one or multiple.
|
7
|
+
* Photo tags - This model use to create a selection area to find where answer is, by drag the area on image from webpage.
|
8
|
+
* Messages - This model allow moderator type the anwser on what they see.
|
9
|
+
* Predictions - Use AI to prediction the result
|
10
|
+
|
11
|
+
##### Please see more usage [documentation](docs/documentation.md) for details on our guideline.
|
12
|
+
|
2
13
|
|
3
|
-
Image and content moderation services.
|
4
14
|
|
5
15
|
## Getting Started
|
6
16
|
|
@@ -21,31 +31,40 @@ The generator will install an initializer which describes ALL of KSequencing's c
|
|
21
31
|
You have to contact us [Datawow](https://datawow.io/pages/contact) to get your token. With this token you'll be able to use our gem properly.
|
22
32
|
|
23
33
|
## Usage
|
24
|
-
|
25
|
-
|
34
|
+
There are 3 oparations of each model as the same name see example below
|
35
|
+
|
36
|
+
#### Get image
|
26
37
|
```ruby
|
27
|
-
KSequencing.
|
38
|
+
KSequencing.[model].find_by()
|
28
39
|
```
|
29
40
|
|
30
41
|
| Field | Type | Required | Description |
|
31
42
|
| ------------- |:-------------:| :----:| :-----|
|
43
|
+
|token | string | Yes | Project token |
|
32
44
|
| id | string | No | Image id|
|
33
|
-
|custom_id | string | No | Client's image id
|
45
|
+
|custom_id | string | No | Client's image id |\
|
34
46
|
|
35
47
|
Note: You must choose id or custom_id for search. Not both.
|
36
48
|
|
37
|
-
Sample request
|
49
|
+
###### Sample request
|
50
|
+
|
38
51
|
```ruby
|
39
|
-
KSequencing.
|
52
|
+
KSequencing.[model].find_by({
|
53
|
+
token: "[you_token]",
|
40
54
|
id: "59311194e99991b2ca8979f1"
|
41
|
-
)
|
55
|
+
})
|
42
56
|
```
|
43
57
|
|
44
|
-
|
45
|
-
|
58
|
+
or
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
KSequencing.[model].find_by({
|
62
|
+
token: "[you_token]",
|
63
|
+
custom_id: "59311194e99991b2ca8979f1"
|
64
|
+
})
|
46
65
|
```
|
47
66
|
|
48
|
-
Sample results
|
67
|
+
###### Sample results
|
49
68
|
```json
|
50
69
|
{
|
51
70
|
"data": {
|
@@ -68,31 +87,33 @@ Sample results
|
|
68
87
|
}
|
69
88
|
}
|
70
89
|
```
|
90
|
+
<Enter>
|
91
|
+
---
|
92
|
+
#### Create images
|
71
93
|
|
72
|
-
Create images
|
73
94
|
```ruby
|
74
|
-
KSequencing.
|
95
|
+
KSequencing.[model].create()
|
75
96
|
```
|
97
|
+
|
76
98
|
| Field | Type | Required | Description |
|
77
99
|
| ------------- |:-------------:| :-----:| :-----|
|
100
|
+
|token | string | Yes | Project token |
|
78
101
|
| data | string | Yes |Data for moderate|
|
79
102
|
| postback_url | string | No | Image postback url|
|
80
103
|
| postback_method | string | No |Postback method|
|
81
104
|
| custom_id | string | No |Custom's id|
|
82
105
|
|
83
|
-
Sample request
|
106
|
+
###### Sample request
|
84
107
|
|
85
108
|
```ruby
|
86
|
-
KSequencing.
|
109
|
+
KSequencing.[model].create({
|
110
|
+
token: "[you_token]"
|
87
111
|
data: "image_url"
|
88
|
-
|
112
|
+
....
|
113
|
+
})
|
89
114
|
```
|
90
115
|
|
91
|
-
|
92
|
-
curl --request POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" --data "data=image_url" "http://k-sequencing.datawow.io/api/images/closed_questions"
|
93
|
-
```
|
94
|
-
|
95
|
-
Sample results
|
116
|
+
###### Sample results
|
96
117
|
```json
|
97
118
|
{
|
98
119
|
"data": {
|
@@ -113,14 +134,67 @@ Sample results
|
|
113
134
|
}
|
114
135
|
}
|
115
136
|
```
|
137
|
+
<Enter>
|
116
138
|
---
|
117
|
-
#### Image moderation can set 4 kinds of answer
|
118
|
-
* Closed question - Answer can be only approved, declined or ban.
|
119
|
-
* Choices - User can set multiple choices for select. It can be radio or checkbox.
|
120
|
-
* Photo tag - User can create box-like overlays on top of your image and assign messages to each box.
|
121
|
-
* Message - User can set messages for answer.
|
122
139
|
|
123
|
-
|
140
|
+
#### Get list of images
|
141
|
+
```ruby
|
142
|
+
KSequencing.[model].all()
|
143
|
+
```
|
144
|
+
|
145
|
+
| Field | Type | Required | Description |
|
146
|
+
| ------------- |:-------------:| :----:| :-----|
|
147
|
+
|token | string | Yes | Project token |
|
148
|
+
| page | integer | No | Image id|
|
149
|
+
|per_page | integer | No | Client's image id |\
|
150
|
+
|
151
|
+
Note: You must choose id or custom_id for search. Not both.
|
152
|
+
|
153
|
+
###### Sample request
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
KSequencing.[model].all({
|
157
|
+
token: "[you_token]"
|
158
|
+
})
|
159
|
+
```
|
160
|
+
|
161
|
+
|
162
|
+
###### Sample results
|
163
|
+
```json
|
164
|
+
{
|
165
|
+
"data": {
|
166
|
+
"images": [
|
167
|
+
{
|
168
|
+
"id": "5a0d5a0c0deb540ab9c56e4e",
|
169
|
+
"allow_empty": false,
|
170
|
+
"answer": [],
|
171
|
+
"categories": ["face", "eye"],
|
172
|
+
"credit_charged": 0,
|
173
|
+
"custom_id": null,
|
174
|
+
"data": "image_url",
|
175
|
+
"instruction": "face",
|
176
|
+
"multiple": false,
|
177
|
+
"postback_url": "www.example.com",
|
178
|
+
"processed_at": null,
|
179
|
+
"project_id": 94,
|
180
|
+
"status": "unprocess"
|
181
|
+
}
|
182
|
+
]
|
183
|
+
},
|
184
|
+
"meta": {
|
185
|
+
"code": 200,
|
186
|
+
"message": "success",
|
187
|
+
"current_page": 1,
|
188
|
+
"next_page": 2,
|
189
|
+
"prev_page": -1,
|
190
|
+
"total_pages": 13,
|
191
|
+
"total_count": 13
|
192
|
+
}
|
193
|
+
}
|
194
|
+
```
|
195
|
+
<Enter>
|
196
|
+
|
197
|
+
However `token: "[you_token]"` you can config in configuration file is not necessary to send to method every time you request, if you have one project token we recommeded this approach
|
124
198
|
|
125
199
|
## License
|
126
200
|
|
data/docs/documentation.md
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
## Usage
|
2
2
|
### Operations about Images
|
3
3
|
#### Image moderation can set 4 kinds of answer
|
4
|
-
* [Closed questions](#closed-questions)- Answer can be only approved, declined or ban.
|
5
|
-
* [Choices](#choices) -
|
6
|
-
* [Photo tags](#photo-tags) -
|
7
|
-
* [Messages](#messages) -
|
4
|
+
* [Closed questions](#closed-questions) - Answer can be only approved, declined or ban(kenta).
|
5
|
+
* [Choices](#choices) - This model use to ask question with multiple choice. Anwser can be one or multiple.
|
6
|
+
* [Photo tags](#photo-tags) - This model use to create a selection area to find where answer is by drag the area on image from web page.
|
7
|
+
* [Messages](#messages) - This model allow moderator type the anwser on what they see.
|
8
|
+
* [Prediction](#messages) - Use AI to prediction the result
|
8
9
|
---
|
9
|
-
|
10
|
+
### Closed questions
|
10
11
|
Get image
|
11
12
|
```ruby
|
12
|
-
KSequencing.
|
13
|
+
KSequencing.image_closed_question.find_by()
|
13
14
|
```
|
14
15
|
|
15
16
|
| Field | Type | Required | Description |
|
@@ -19,15 +20,12 @@ KSequencing.client.get_image_closed_question()
|
|
19
20
|
|
20
21
|
Note: You must choose id or custom_id for search. Not both.
|
21
22
|
|
22
|
-
Sample request
|
23
|
+
--- Sample request
|
23
24
|
```ruby
|
24
|
-
KSequencing.
|
25
|
+
KSequencing.image_closed_question.find_by({
|
26
|
+
token: "[you_token]",
|
25
27
|
id: "59311194e99991b2ca8979f1"
|
26
|
-
)
|
27
|
-
```
|
28
|
-
|
29
|
-
```
|
30
|
-
curl --request GET -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" "https://k-sequencing.datawow.io/api/images/closed_question?id=59311194e99991b2ca8979f1"
|
28
|
+
})
|
31
29
|
```
|
32
30
|
|
33
31
|
Sample results
|
@@ -56,7 +54,7 @@ Sample results
|
|
56
54
|
|
57
55
|
Create images
|
58
56
|
```ruby
|
59
|
-
KSequencing.
|
57
|
+
KSequencing.image_closed_questions.create()
|
60
58
|
```
|
61
59
|
| Field | Type | Required | Description |
|
62
60
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -67,13 +65,10 @@ KSequencing.client.create_image_closed_questions()
|
|
67
65
|
|
68
66
|
Sample request
|
69
67
|
```ruby
|
70
|
-
KSequencing.
|
68
|
+
KSequencing.image_closed_questions.create({
|
69
|
+
token: "[you_token]",
|
71
70
|
data: "image_url"
|
72
|
-
)
|
73
|
-
```
|
74
|
-
|
75
|
-
```
|
76
|
-
curl --request POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" --data "data=image_url" "http://k-sequencing.datawow.io/api/images/closed_questions"
|
71
|
+
})
|
77
72
|
```
|
78
73
|
|
79
74
|
Sample results
|
@@ -101,7 +96,7 @@ Sample results
|
|
101
96
|
#### Choices
|
102
97
|
Get image
|
103
98
|
```ruby
|
104
|
-
KSequencing.
|
99
|
+
KSequencing.image_choice.find_by()
|
105
100
|
```
|
106
101
|
|
107
102
|
| Field | Type | Required | Description |
|
@@ -113,13 +108,10 @@ Note: You must choose id or custom_id for search. Not both.
|
|
113
108
|
|
114
109
|
Sample request
|
115
110
|
```ruby
|
116
|
-
KSequencing.
|
111
|
+
KSequencing.image_choice.find_by({
|
112
|
+
token: "[you_token]",
|
117
113
|
id: "59311194e99991b2ca8979f1"
|
118
|
-
)
|
119
|
-
```
|
120
|
-
|
121
|
-
```
|
122
|
-
curl --request GET -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" "https://k-sequencing.datawow.io/api/images/choice?id=59311194e99991b2ca8979f1"
|
114
|
+
})
|
123
115
|
```
|
124
116
|
|
125
117
|
Sample results
|
@@ -156,7 +148,7 @@ Sample results
|
|
156
148
|
|
157
149
|
Create new choices
|
158
150
|
```ruby
|
159
|
-
KSequencing.
|
151
|
+
KSequencing.image_choices.create()
|
160
152
|
```
|
161
153
|
| Field | Type | Required | Description |
|
162
154
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -167,6 +159,8 @@ KSequencing.client.create_image_choices()
|
|
167
159
|
|multiple | boolean | No | true for multiple answer and false for one answer |
|
168
160
|
| postback_method | string | No |Postback method|
|
169
161
|
| custom_id | string | No |Custom's id|
|
162
|
+
| allow_empty | boolean | No |Allow sent answer with empty choice. default is `false`|
|
163
|
+
|
170
164
|
|
171
165
|
Note: Answer can choose only one is default. If you want answer to be multiple, you need to set multiple to true.
|
172
166
|
|
@@ -174,24 +168,22 @@ Sample request
|
|
174
168
|
|
175
169
|
For one answer
|
176
170
|
```ruby
|
177
|
-
KSequencing.
|
171
|
+
KSequencing.image_choices.create({
|
172
|
+
token: "[you_token]",
|
178
173
|
instruction: "question",
|
179
174
|
categories: "options1 options2 options3",
|
180
175
|
data: "image_url"
|
181
|
-
)
|
176
|
+
})
|
182
177
|
```
|
183
178
|
For multiple answer
|
184
179
|
```ruby
|
185
|
-
KSequencing.
|
180
|
+
KSequencing.image_choices.create({
|
181
|
+
token: "[you_token]",
|
186
182
|
instruction: "question",
|
187
183
|
categories: "options1 options2 options3",
|
188
184
|
data: "image_url",
|
189
185
|
multiple: true
|
190
|
-
)
|
191
|
-
```
|
192
|
-
|
193
|
-
```
|
194
|
-
curl --request POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" --data "instruction=question&categories=option1%20options2%20options3&data=image_url" "http://k-sequencing.datawow.io/api/images/choices"
|
186
|
+
})
|
195
187
|
```
|
196
188
|
|
197
189
|
Sample results
|
@@ -227,7 +219,7 @@ Sample results
|
|
227
219
|
#### Messages
|
228
220
|
Get image
|
229
221
|
```ruby
|
230
|
-
KSequencing.
|
222
|
+
KSequencing.image_message.find_by()
|
231
223
|
```
|
232
224
|
|
233
225
|
| Field | Type | Required | Description |
|
@@ -239,13 +231,10 @@ Note: You must choose id or custom_id for search. Not both.
|
|
239
231
|
|
240
232
|
Sample request
|
241
233
|
```ruby
|
242
|
-
KSequencing.
|
234
|
+
KSequencing.image_message.find_by({
|
235
|
+
token: "[you_token]",
|
243
236
|
id: "592fbfce1b9d8f69e4178688"
|
244
|
-
)
|
245
|
-
```
|
246
|
-
|
247
|
-
```
|
248
|
-
curl --request GET -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" "https://k-sequencing.datawow.io/api/images/message?id=592fbfce1b9d8f69e4178688"
|
237
|
+
})
|
249
238
|
```
|
250
239
|
|
251
240
|
Sample results
|
@@ -275,7 +264,7 @@ Sample results
|
|
275
264
|
|
276
265
|
Create new message
|
277
266
|
```ruby
|
278
|
-
KSequencing.
|
267
|
+
KSequencing.image_messages.create()
|
279
268
|
```
|
280
269
|
| Field | Type | Required | Description |
|
281
270
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -287,14 +276,10 @@ KSequencing.client.create_image_messages()
|
|
287
276
|
|
288
277
|
Sample request
|
289
278
|
```ruby
|
290
|
-
KSequencing.
|
279
|
+
KSequencing.image_messages.create({
|
291
280
|
instruction: "question",
|
292
281
|
data: "image_url"
|
293
|
-
)
|
294
|
-
```
|
295
|
-
|
296
|
-
```
|
297
|
-
curl --request POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" --data "instruction=question&data=image_url" "http://k-sequencing.datawow.io/api/images/messages"
|
282
|
+
})
|
298
283
|
```
|
299
284
|
|
300
285
|
Sample results
|
@@ -323,7 +308,7 @@ Sample results
|
|
323
308
|
#### Photo tags
|
324
309
|
Get image
|
325
310
|
```ruby
|
326
|
-
KSequencing.
|
311
|
+
KSequencing.image_photo_tag.find_by()
|
327
312
|
```
|
328
313
|
|
329
314
|
| Field | Type | Required | Description |
|
@@ -335,13 +320,9 @@ Note: You must choose id or custom_id for search. Not both.
|
|
335
320
|
|
336
321
|
Sample request
|
337
322
|
```ruby
|
338
|
-
KSequencing.
|
323
|
+
KSequencing.image_photo_tag.find_by({
|
339
324
|
id: "592fbfec1b9d8f69e4178689"
|
340
|
-
)
|
341
|
-
```
|
342
|
-
|
343
|
-
```
|
344
|
-
curl --request GET -H "Accept: application/json" -H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" "https://k-sequencing.datawow.io/api/images/photo_tag?id=592fbfec1b9d8f69e4178689"
|
325
|
+
})
|
345
326
|
```
|
346
327
|
|
347
328
|
Sample results
|
@@ -371,7 +352,7 @@ Sample results
|
|
371
352
|
|
372
353
|
Create new photo tag
|
373
354
|
```ruby
|
374
|
-
KSequencing.client.
|
355
|
+
KSequencing.client.image_photo_tags.create()
|
375
356
|
```
|
376
357
|
| Field | Type | Required | Description |
|
377
358
|
| ------------- |:-------------:| :-----:| :-----|
|
@@ -383,15 +364,12 @@ KSequencing.client.create_image_photo_tags()
|
|
383
364
|
|
384
365
|
Sample request
|
385
366
|
```ruby
|
386
|
-
KSequencing.client.
|
367
|
+
KSequencing.client.image_photo_tags.create(
|
387
368
|
instruction: "question",
|
388
369
|
data: "image_url"
|
389
370
|
)
|
390
371
|
```
|
391
372
|
|
392
|
-
```
|
393
|
-
curl --request POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" --H "Authorization: 9UPmGGWEwBsJrVnw6844tfpd" --data "instruction=question&data=image_url" "http://k-sequencing.datawow.io/api/images/photo_tags"
|
394
|
-
```
|
395
373
|
|
396
374
|
Sample results
|
397
375
|
```json
|
@@ -416,3 +394,108 @@ Sample results
|
|
416
394
|
}
|
417
395
|
```
|
418
396
|
---
|
397
|
+
|
398
|
+
|
399
|
+
#### Prediction
|
400
|
+
Get prediction
|
401
|
+
```ruby
|
402
|
+
KSequencing.prediction.find_by()
|
403
|
+
```
|
404
|
+
|
405
|
+
| Field | Type | Required | Description |
|
406
|
+
| ------------- |:-------------:| :----:| :-----|
|
407
|
+
| id | string | No | Image id|
|
408
|
+
|custom_id | string | No | Client's image id |
|
409
|
+
|
410
|
+
Note: You must choose id or custom_id for search. Not both.
|
411
|
+
|
412
|
+
Sample request
|
413
|
+
```ruby
|
414
|
+
KSequencing.prediction.find_by({
|
415
|
+
id: "592fbfec1b9d8f69e4178689"
|
416
|
+
})
|
417
|
+
```
|
418
|
+
|
419
|
+
Sample results
|
420
|
+
```json
|
421
|
+
{
|
422
|
+
"data": {
|
423
|
+
"image": {
|
424
|
+
"id": "5a0d3a8c0deb540ab9c56e33",
|
425
|
+
"answer": null,
|
426
|
+
"credit_charged": 0,
|
427
|
+
"custom_id": null,
|
428
|
+
"data": "www.example.com",
|
429
|
+
"postback_url": "www.example.com",
|
430
|
+
"processed_at": null,
|
431
|
+
"project_id": 96,
|
432
|
+
"status": "processing"
|
433
|
+
}
|
434
|
+
},
|
435
|
+
"meta": {
|
436
|
+
"code": 200,
|
437
|
+
"message": "success"
|
438
|
+
}
|
439
|
+
}
|
440
|
+
```
|
441
|
+
|
442
|
+
Create prediction
|
443
|
+
```ruby
|
444
|
+
KSequencing.prediction.create()
|
445
|
+
```
|
446
|
+
| Field | Type | Required | Description |
|
447
|
+
| ------------- |:-------------:| :-----:| :-----|
|
448
|
+
| data | string | Yes |Data for attachment|
|
449
|
+
| postback_url | string | No | Image postback url|
|
450
|
+
| postback_method | string | No |Postback method|
|
451
|
+
| custom_id | string | No |Custom's id|
|
452
|
+
|
453
|
+
Sample request
|
454
|
+
```ruby
|
455
|
+
KSequencing.prediction.create(
|
456
|
+
token: "[your_token]",
|
457
|
+
data: "image_url"
|
458
|
+
)
|
459
|
+
```
|
460
|
+
|
461
|
+
Sample results
|
462
|
+
```json
|
463
|
+
{
|
464
|
+
"data": {
|
465
|
+
"id": "5a0e49d00deb540ab9c56e4f",
|
466
|
+
"answer": null,
|
467
|
+
"credit_charged": 0,
|
468
|
+
"custom_id": null,
|
469
|
+
"data": "www.example.com",
|
470
|
+
"postback_url": "www.example.com",
|
471
|
+
"processed_at": null,
|
472
|
+
"project_id": 96,
|
473
|
+
"status": "processing"
|
474
|
+
},
|
475
|
+
"meta": {
|
476
|
+
"code": 200,
|
477
|
+
"message": "success"
|
478
|
+
}
|
479
|
+
}
|
480
|
+
```
|
481
|
+
<enter>
|
482
|
+
---
|
483
|
+
|
484
|
+
As you see above all API have a same name just change model name and paramter, however if you would like to list all of your data just use all() see example below
|
485
|
+
|
486
|
+
#### Get list of data
|
487
|
+
|
488
|
+
```ruby
|
489
|
+
KSequencing.[model].all()
|
490
|
+
```
|
491
|
+
| Field | Type | Required | Description |
|
492
|
+
| ------------- |:-------------:| :-----:| :-----|
|
493
|
+
| page | interger | No | default 0|
|
494
|
+
| per_page | string | No | default 20 |
|
495
|
+
|
496
|
+
Sample request
|
497
|
+
```ruby
|
498
|
+
KSequencing.[model].all(
|
499
|
+
token: "[your_token]"
|
500
|
+
)
|
501
|
+
```
|
data/k_sequencing.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'k_sequencing'
|
8
|
-
s.version = '0.1.
|
8
|
+
s.version = '0.1.22'
|
9
9
|
s.date = '2017-10-31'
|
10
10
|
s.summary = 'KSequencing is a moderator service for your online content'
|
11
11
|
s.description = 'Moderation suite'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module KSequencing
|
2
|
+
# :nodoc:
|
3
|
+
class ImageChoice
|
4
|
+
|
5
|
+
def create(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.post('/api/images/choices', options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
options[:token] ||= KSequencing.project_key
|
12
|
+
connection.get('/api/images/choices', options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_by(options = {})
|
16
|
+
options[:token] ||= KSequencing.project_key
|
17
|
+
connection.get('/api/images/choice', options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
@connection ||= Connection.new
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module KSequencing
|
2
|
+
# :nodoc:
|
3
|
+
class ImageClosedQuestion
|
4
|
+
|
5
|
+
def create(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.post('/api/images/closed_questions', options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def find_by(options = {})
|
11
|
+
options[:token] ||= KSequencing.project_key
|
12
|
+
connection.get('/api/images/closed_question', options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def all(options = {})
|
16
|
+
options[:token] ||= KSequencing.project_key
|
17
|
+
connection.get('/api/images/closed_questions', options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
@connection ||= Connection.new
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module KSequencing
|
2
|
+
# :nodoc:
|
3
|
+
class ImageMessage
|
4
|
+
|
5
|
+
def create(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.post('/api/images/messages', options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
options[:token] ||= KSequencing.project_key
|
12
|
+
connection.get('/api/images/messages', options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_by(options = {})
|
16
|
+
options[:token] ||= KSequencing.project_key
|
17
|
+
connection.get('/api/images/message', options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
@connection ||= Connection.new
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module KSequencing
|
2
|
+
# :nodoc:
|
3
|
+
class ImagePhotoTag
|
4
|
+
|
5
|
+
def all(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.get('/api/images/photo_tags', options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def find_by(options = {})
|
11
|
+
options[:token] ||= KSequencing.project_key
|
12
|
+
connection.get('/api/images/photo_tag', options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create(options = {})
|
16
|
+
options[:token] ||= KSequencing.project_key
|
17
|
+
connection.post('/api/images/photo_tags', options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
@connection ||= Connection.new
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module KSequencing
|
2
|
+
# :nodoc:
|
3
|
+
class Prediction
|
4
|
+
|
5
|
+
def create(options = {})
|
6
|
+
options[:token] ||= KSequencing.project_key
|
7
|
+
connection.post('/api/prime/predictions', options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def all(options = {})
|
11
|
+
options[:token] ||= KSequencing.project_key
|
12
|
+
connection.get('/api/prime/predictions', options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_by(options = {})
|
16
|
+
options[:token] ||= KSequencing.project_key
|
17
|
+
connection.get("/api/prime/predictions/#{options[:id]}", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection
|
23
|
+
@connection ||= Connection.new
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/k_sequencing.rb
CHANGED
@@ -3,7 +3,11 @@ require_relative 'k_sequencing/client_response'
|
|
3
3
|
require_relative 'k_sequencing/connection'
|
4
4
|
require_relative 'k_sequencing/error'
|
5
5
|
require_relative 'k_sequencing/version'
|
6
|
-
|
6
|
+
require_relative 'k_sequencing/image_closed_questions'
|
7
|
+
require_relative 'k_sequencing/image_photo_tags'
|
8
|
+
require_relative 'k_sequencing/image_choices'
|
9
|
+
require_relative 'k_sequencing/image_messages'
|
10
|
+
require_relative 'k_sequencing/predictions'
|
7
11
|
# :nodoc:
|
8
12
|
module KSequencing
|
9
13
|
mattr_accessor :user_key, :project_key
|
@@ -16,5 +20,27 @@ module KSequencing
|
|
16
20
|
def client
|
17
21
|
Client.new
|
18
22
|
end
|
23
|
+
|
24
|
+
def image_closed_question
|
25
|
+
ImageClosedQuestion.new
|
26
|
+
end
|
27
|
+
|
28
|
+
def image_photo_tag
|
29
|
+
ImagePhotoTag.new
|
30
|
+
end
|
31
|
+
|
32
|
+
def image_choice
|
33
|
+
ImageChoice.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def image_message
|
37
|
+
ImageMessage.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def prediction
|
41
|
+
Prediction.new
|
42
|
+
end
|
43
|
+
|
19
44
|
end
|
45
|
+
|
20
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_sequencing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesdakorn Samittiauttakorn
|
@@ -92,6 +92,11 @@ files:
|
|
92
92
|
- lib/k_sequencing/connection.rb
|
93
93
|
- lib/k_sequencing/error.rb
|
94
94
|
- lib/k_sequencing/faraday/raise_http_exception.rb
|
95
|
+
- lib/k_sequencing/image_choices.rb
|
96
|
+
- lib/k_sequencing/image_closed_questions.rb
|
97
|
+
- lib/k_sequencing/image_messages.rb
|
98
|
+
- lib/k_sequencing/image_photo_tags.rb
|
99
|
+
- lib/k_sequencing/predictions.rb
|
95
100
|
- lib/k_sequencing/version.rb
|
96
101
|
homepage: https://datawow.io
|
97
102
|
licenses:
|