uiza 1.0.1 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 158e8b3d2efc6f408f8e3e482c0722360f77a6ee06ddb182a9ba6bdeeb666a53
4
- data.tar.gz: 939dd7855b1b5704a138efd0ad13ec09a10b64450ce9af38d4c70bdc9b775c0b
3
+ metadata.gz: 93fe30440df8aa9273e55759ffcc7ac76638ea95476b15f349441c0371d7541a
4
+ data.tar.gz: 9a435b501ebcfdaa15abc340400ab79fd38564da8b4ae3a98fbfe16e09381889
5
5
  SHA512:
6
- metadata.gz: 5f61f56ace2e1243ecfdd4c35df2d54b8feb02a6907cca5dcbecaa7d32558d04fcb5ee9b0b2cbb2b7f7a083e4e921f46988de06b68498817c5b37213b6e7d034
7
- data.tar.gz: 625e6193a0e8bafb1b8605512a36409e9ce00952a7f1054c44b4c4e4f5e2ffa6ffbc2917ed4d5135b5289ee146fbdecca5a9960f68b52d67ba54303a6b0587a7
6
+ metadata.gz: c90f9c8d7c5640fbf34b6ec3f089edbc121197b6db0b2b04124bcc572ab18c31ee993cd329a65e1d99319d64c9b498ea0847ee8043c56858d319d1087158b6eb
7
+ data.tar.gz: 94bc3e52d459312d90ec73870404724269b8ce2fc16806b51213584200aaf6e016e50064f28f9b79fbd0fb06dc8091b7355327d2df3312fb371081ca7c5c1080
@@ -1,7 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 - 2019-03-07
4
+ [#89](https://github.com/uizaio/api-wrapper-ruby/pull/89) Release Sprint 4
5
+ 1. Add User
6
+
7
+ 2. Add Analytic
8
+
3
9
  ## 1.0.1 - 2019-02-23
4
- [#72](https://github.com/uizaio/api-wrapper-ruby/pull/72) Reslease Sprint 3
10
+ [#72](https://github.com/uizaio/api-wrapper-ruby/pull/72) Release Sprint 3
5
11
  1. Add Live
6
12
 
7
13
  2. Add Callback
data/README.md CHANGED
@@ -64,7 +64,7 @@ Uiza.authorization = ENV["AUTHORIZATION"]
64
64
  ## Entity
65
65
  These below APIs used to take action with your media files (we called Entity).
66
66
 
67
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/ENTITY.md).
67
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/ENTITY.md).
68
68
 
69
69
  ```ruby
70
70
  begin
@@ -83,7 +83,7 @@ end
83
83
  ## Category
84
84
  Category has been splits into 3 types: `folder`, `playlist` and `tag`. These will make the management of entity more easier.
85
85
 
86
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/CATEGORY.md).
86
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/CATEGORY.md).
87
87
 
88
88
  ```ruby
89
89
  require "uiza"
@@ -108,7 +108,7 @@ end
108
108
  You can add your storage (`FTP`, `AWS S3`) with UIZA.
109
109
  After synced, you can select your content easier from your storage to [create entity](https://docs.uiza.io/#create-entity).
110
110
 
111
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/STORAGE.md).
111
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/STORAGE.md).
112
112
 
113
113
  ```ruby
114
114
  require "json"
@@ -134,7 +134,7 @@ These APIs used to create and manage live streaming event.
134
134
  * When a Live is not start : it's named as `Event`.
135
135
  * When have an `Event` , you can start it : it's named as `Feed`.
136
136
 
137
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/LIVE_STREAMING.md).
137
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/LIVE_STREAMING.md).
138
138
 
139
139
  ```ruby
140
140
  require "json"
@@ -158,7 +158,7 @@ end
158
158
  ## Callback
159
159
  Callback used to retrieve an information for Uiza to your server, so you can have a trigger notice about an entity is upload completed and .
160
160
 
161
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/CALLBACK.md).
161
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/CALLBACK.md).
162
162
 
163
163
  ```ruby
164
164
  require "json"
@@ -179,16 +179,68 @@ rescue StandardError => e
179
179
  end
180
180
  ```
181
181
 
182
+ ## User Management
183
+ You can manage user with APIs user. Uiza have 2 levels of user:
184
+ Admin - This account will have the highest priority, can have permission to create & manage users.
185
+ User - This account level is under Admin level. It only manages APIs that relates to this account.
186
+
187
+ See details [here](https://docs.uiza.io/#user-management).
188
+
189
+ ```ruby
190
+ require "json"
191
+
192
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
193
+ Uiza.authorization = "your-authorization"
194
+
195
+ begin
196
+ user = Uiza::User.retrieve "your-user-id"
197
+ puts user.id
198
+ puts user.username
199
+ rescue Uiza::Error::UizaError => e
200
+ puts "description_link: #{e.description_link}"
201
+ puts "code: #{e.code}"
202
+ puts "message: #{e.message}"
203
+ rescue StandardError => e
204
+ puts "message: #{e.message}"
205
+ end
206
+ ```
207
+
182
208
  ## Analytic
183
209
  Monitor the four key dimensions of video QoS: playback failures, startup time, rebuffering, and video quality.
184
210
  These 15 metrics help you track playback performance, so your team can know exactly what’s going on.
185
211
 
186
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/ANALYTIC.md).
212
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/ANALYTIC.md).
213
+
214
+ ```ruby
215
+ require "json"
216
+
217
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
218
+ Uiza.authorization = "your-authorization"
219
+
220
+ params = {
221
+ start_date: "YYYY-MM-DD hh:mm",
222
+ end_date: "YYYY-MM-DD hh:mm",
223
+ type_filter: "your-type-filter"
224
+ }
225
+
226
+ begin
227
+ response = Uiza::Analytic.total_line params
228
+ puts response.first.name
229
+ puts response.first.total_view
230
+ puts response.percentage_of_view
231
+ rescue Uiza::Error::UizaError => e
232
+ puts "description_link: #{e.description_link}"
233
+ puts "code: #{e.code}"
234
+ puts "message: #{e.message}"
235
+ rescue StandardError => e
236
+ puts "message: #{e.message}"
237
+ end
238
+ ```
187
239
 
188
240
  ## Embed Metadata
189
241
  Embed metadata is information that can be embed into video/audio file. You can embed into file by adding a json compose these tag.
190
242
 
191
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/EMBED_METADATA.md).
243
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/EMBED_METADATA.md).
192
244
 
193
245
  ## Errors Code
194
246
  Uiza uses conventional HTTP response codes to indicate the success or failure of an API request.
@@ -196,7 +248,7 @@ In general: Codes in the `2xx` range indicate success.
196
248
  Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.).
197
249
  Codes in the `5xx` range indicate an error with Uiza's servers.
198
250
 
199
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/ERRORS_CODE.md).
251
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/ERRORS_CODE.md).
200
252
 
201
253
  ## Development
202
254
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -3,3 +3,141 @@ Monitor the four key dimensions of video QoS: playback failures, startup time, r
3
3
  These 15 metrics help you track playback performance, so your team can know exactly what’s going on.
4
4
 
5
5
  See details [here](https://docs.uiza.io/#analytic).
6
+
7
+ ## Total Line
8
+ Get data grouped by hour (data refresh every 5 minutes). Track video playback on any metric performance, so you can know exactly what’s happening on every user’s device and debug more effectively.
9
+
10
+ See details [here](https://docs.uiza.io/#total-line).
11
+
12
+ ```ruby
13
+ require "uiza"
14
+
15
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
16
+ Uiza.authorization = "your-authorization"
17
+
18
+ params = {
19
+ start_date: "YYYY-MM-DD hh:mm",
20
+ end_date: "YYYY-MM-DD hh:mm",
21
+ metric: "rebuffer_count"
22
+ }
23
+
24
+ begin
25
+ response = Uiza::Analytic.get_total_line params
26
+ puts response.first.rebuffer_count
27
+ rescue Uiza::Error::UizaError => e
28
+ puts "description_link: #{e.description_link}"
29
+ puts "code: #{e.code}"
30
+ puts "message: #{e.message}"
31
+ rescue StandardError => e
32
+ puts "message: #{e.message}"
33
+ end
34
+ ```
35
+
36
+ Example Response
37
+ ```ruby
38
+ [
39
+ {
40
+ "date_time": 1542978000000,
41
+ "rebuffer_count": 1.6666666666666667
42
+ },
43
+ {
44
+ "date_time": 1543215600000,
45
+ "rebuffer_count": 5
46
+ }
47
+ ]
48
+ ```
49
+
50
+ ## Type
51
+ Get data base on 4 type of filter: country, device, title, player
52
+
53
+ See details [here](https://docs.uiza.io/#type).
54
+
55
+ ```ruby
56
+ require "uiza"
57
+
58
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
59
+ Uiza.authorization = "your-authorization"
60
+
61
+ params = {
62
+ start_date: "YYYY-MM-DD hh:mm",
63
+ end_date: "YYYY-MM-DD hh:mm",
64
+ type_filter: "country"
65
+ }
66
+
67
+ begin
68
+ response = Uiza::Analytic.get_type params
69
+ puts response.first.name
70
+ puts response.first.total_view
71
+ puts response.first.percentage_of_view
72
+ rescue Uiza::Error::UizaError => e
73
+ puts "description_link: #{e.description_link}"
74
+ puts "code: #{e.code}"
75
+ puts "message: #{e.message}"
76
+ rescue StandardError => e
77
+ puts "message: #{e.message}"
78
+ end
79
+ ```
80
+
81
+ Example Response
82
+ ```ruby
83
+ [
84
+ {
85
+ "name": "Vietnam",
86
+ "total_view": 15,
87
+ "percentage_of_view": 0.625
88
+ },
89
+ {
90
+ "name": "Other",
91
+ "total_view": 9,
92
+ "percentage_of_view": 0.375
93
+ }
94
+ ]
95
+ ```
96
+
97
+ ## Line
98
+ Get data grouped by hour. Get total view in time range. This help you to draw a line chart to visualize data
99
+
100
+ See details [here](https://docs.uiza.io/#line).
101
+
102
+ ```ruby
103
+ require "uiza"
104
+
105
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
106
+ Uiza.authorization = "your-authorization"
107
+
108
+ params = {
109
+ start_date: "YYYY-MM-DD hh:mm",
110
+ end_date: "YYYY-MM-DD hh:mm",
111
+ type: "your-metric-type"
112
+ }
113
+
114
+ begin
115
+ response = Uiza::Analytic.get_line params
116
+ puts response.first.day_time
117
+ puts response.first.value
118
+ rescue Uiza::Error::UizaError => e
119
+ puts "description_link: #{e.description_link}"
120
+ puts "code: #{e.code}"
121
+ puts "message: #{e.message}"
122
+ rescue StandardError => e
123
+ puts "message: #{e.message}"
124
+ end
125
+ ```
126
+
127
+ Example Response
128
+ ```ruby
129
+ [
130
+ {
131
+ "day_time": 1541548800000,
132
+ "value": 4
133
+ },
134
+ {
135
+ "day_time": 1541635200000,
136
+ "value": 5
137
+ },
138
+ {
139
+ "day_time": 1541721600000,
140
+ "value": 5
141
+ }
142
+ ]
143
+ ```
@@ -115,6 +115,36 @@ rescue StandardError => e
115
115
  end
116
116
  ```
117
117
 
118
+ Example Response
119
+ ```ruby
120
+ [
121
+ {
122
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
123
+ "name": "Playlist sample",
124
+ "description": "Playlist desciption",
125
+ "slug": "playlist-sample",
126
+ "type": "playlist",
127
+ "orderNumber": 3,
128
+ "icon": "/example.com/image002.png",
129
+ "status": 1,
130
+ "createdAt": "2018-06-18T04:29:05.000Z",
131
+ "updatedAt": "2018-06-18T04:29:05.000Z"
132
+ },
133
+ {
134
+ "id": "ab54db88-0c8c-4928-b1be-1e7120ad2c39",
135
+ "name": "Folder sample",
136
+ "description": "Folder's description",
137
+ "slug": "folder-sample",
138
+ "type": "folder",
139
+ "orderNumber": 1,
140
+ "icon": "/example.com/icon.png",
141
+ "status": 1,
142
+ "createdAt": "2018-06-18T03:17:07.000Z",
143
+ "updatedAt": "2018-06-18T03:17:07.000Z"
144
+ }
145
+ ]
146
+ ```
147
+
118
148
  ## Update category
119
149
  Update information of category.
120
150
 
@@ -224,14 +254,14 @@ Example Response
224
254
  ```ruby
225
255
  [
226
256
  {
227
- "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
228
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
229
- "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
257
+ "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
258
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
259
+ "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
230
260
  },
231
261
  {
232
- "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
233
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
234
- "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
262
+ "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
263
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
264
+ "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
235
265
  }
236
266
  ]
237
267
  ```
@@ -52,14 +52,14 @@ Example Response
52
52
  "duration": "237.865215",
53
53
  "publishToCdn":"success",
54
54
  "embedMetadata": {
55
- "artist": "John Doe",
56
- "album": "Album sample",
57
- "genre": "Pop"
55
+ "artist": "John Doe",
56
+ "album": "Album sample",
57
+ "genre": "Pop"
58
58
  },
59
59
  "extendMetadata": {
60
- "movie_category":"action",
61
- "imdb_score":8.8,
62
- "published_year":"2018"
60
+ "movie_category":"action",
61
+ "imdb_score":8.8,
62
+ "published_year":"2018"
63
63
  },
64
64
  "createdAt": "2018-06-16T18:54:15.000Z",
65
65
  "updatedAt": "2018-06-16T18:54:29.000Z"
@@ -105,14 +105,14 @@ Example Response
105
105
  "duration": "237.865215",
106
106
  "publishToCdn":"success",
107
107
  "embedMetadata": {
108
- "artist": "John Doe",
109
- "album": "Album sample",
110
- "genre": "Pop"
108
+ "artist": "John Doe",
109
+ "album": "Album sample",
110
+ "genre": "Pop"
111
111
  },
112
112
  "extendMetadata": {
113
- "movie_category":"action",
114
- "imdb_score":8.8,
115
- "published_year":"2018"
113
+ "movie_category":"action",
114
+ "imdb_score":8.8,
115
+ "published_year":"2018"
116
116
  },
117
117
  "createdAt": "2018-06-16T18:54:15.000Z",
118
118
  "updatedAt": "2018-06-16T18:54:29.000Z"
@@ -152,7 +152,8 @@ end
152
152
 
153
153
  Example Response
154
154
  ```ruby
155
- {
155
+ [
156
+ {
156
157
  "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
157
158
  "name": "Sample Video 1",
158
159
  "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
@@ -164,19 +165,19 @@ Example Response
164
165
  "duration": "237.865215",
165
166
  "publishToCdn":"success",
166
167
  "embedMetadata": {
167
- "artist": "John Doe",
168
- "album": "Album sample",
169
- "genre": "Pop"
168
+ "artist": "John Doe",
169
+ "album": "Album sample",
170
+ "genre": "Pop"
170
171
  },
171
172
  "extendMetadata": {
172
- "movie_category":"action",
173
- "imdb_score":8.8,
174
- "published_year":"2018"
173
+ "movie_category":"action",
174
+ "imdb_score":8.8,
175
+ "published_year":"2018"
175
176
  },
176
177
  "createdAt": "2018-06-22T19:20:17.000Z",
177
178
  "updatedAt": "2018-06-22T19:20:17.000Z"
178
- },
179
- {
179
+ },
180
+ {
180
181
  "id": "64b15996-2261-4f41-a3c4-72b652323f67",
181
182
  "name": "Sample Video 2",
182
183
  "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
@@ -188,18 +189,19 @@ Example Response
188
189
  "duration": "178.178105",
189
190
  "publishToCdn":"success",
190
191
  "embedMetadata": {
191
- "artist": "John Doe",
192
- "album": "Album sample",
193
- "genre": "Pop"
192
+ "artist": "John Doe",
193
+ "album": "Album sample",
194
+ "genre": "Pop"
194
195
  },
195
196
  "extendMetadata": {
196
- "movie_category":"action",
197
- "imdb_score":8.8,
198
- "published_year":"2018"
197
+ "movie_category":"action",
198
+ "imdb_score":8.8,
199
+ "published_year":"2018"
199
200
  },
200
201
  "createdAt": "2018-06-22T19:16:22.000Z",
201
202
  "updatedAt": "2018-06-22T19:16:22.000Z"
202
- }
203
+ }
204
+ ]
203
205
  ```
204
206
 
205
207
  ## Update entity
@@ -234,28 +236,28 @@ end
234
236
  Example Response
235
237
  ```ruby
236
238
  {
237
- "id": "64b15996-2261-4f41-a3c4-72b652323f67",
238
- "name": "Sample Video",
239
- "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
240
- "shortDescription": "Lorem Ipsum is simply dummy text.",
241
- "view": 0,
242
- "poster": "https://example.com/picture001",
243
- "thumbnail": "https://example.com/picture002",
244
- "type": "vod",
245
- "duration": "178.178105",
246
- "publishToCdn":"success",
247
- "embedMetadata": {
248
- "artist": "John Doe",
249
- "album": "Album sample",
250
- "genre": "Pop"
251
- },
252
- "extendMetadata": {
253
- "movie_category":"action",
254
- "imdb_score":8.8,
255
- "published_year":"2018"
256
- },
257
- "createdAt": "2018-06-22T19:16:22.000Z",
258
- "updatedAt": "2018-06-22T19:16:22.000Z"
239
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
240
+ "name": "Sample Video",
241
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
242
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
243
+ "view": 0,
244
+ "poster": "https://example.com/picture001",
245
+ "thumbnail": "https://example.com/picture002",
246
+ "type": "vod",
247
+ "duration": "178.178105",
248
+ "publishToCdn":"success",
249
+ "embedMetadata": {
250
+ "artist": "John Doe",
251
+ "album": "Album sample",
252
+ "genre": "Pop"
253
+ },
254
+ "extendMetadata": {
255
+ "movie_category":"action",
256
+ "imdb_score":8.8,
257
+ "published_year":"2018"
258
+ },
259
+ "createdAt": "2018-06-22T19:16:22.000Z",
260
+ "updatedAt": "2018-06-22T19:16:22.000Z"
259
261
  }
260
262
  ```
261
263
 
@@ -283,9 +285,9 @@ end
283
285
  ```
284
286
 
285
287
  Example Response
286
- ```
288
+ ```ruby
287
289
  {
288
- "id": "64b15996-2261-4f41-a3c4-72b652323f67"
290
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67"
289
291
  }
290
292
  ```
291
293
 
@@ -315,7 +317,8 @@ end
315
317
 
316
318
  Example Response
317
319
  ```ruby
318
- {
320
+ [
321
+ {
319
322
  "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
320
323
  "name": "Sample Video 1",
321
324
  "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
@@ -327,19 +330,19 @@ Example Response
327
330
  "duration": "237.865215",
328
331
  "publishToCdn":"success",
329
332
  "embedMetadata": {
330
- "artist": "John Doe",
331
- "album": "Album sample",
332
- "genre": "Pop"
333
+ "artist": "John Doe",
334
+ "album": "Album sample",
335
+ "genre": "Pop"
333
336
  },
334
337
  "extendMetadata": {
335
- "movie_category":"action",
336
- "imdb_score":8.8,
337
- "published_year":"2018"
338
+ "movie_category":"action",
339
+ "imdb_score":8.8,
340
+ "published_year":"2018"
338
341
  },
339
342
  "createdAt": "2018-06-22T19:20:17.000Z",
340
343
  "updatedAt": "2018-06-22T19:20:17.000Z"
341
- },
342
- {
344
+ },
345
+ {
343
346
  "id": "64b15996-2261-4f41-a3c4-72b652323f67",
344
347
  "name": "Sample Video 2",
345
348
  "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
@@ -351,18 +354,19 @@ Example Response
351
354
  "duration": "178.178105",
352
355
  "publishToCdn":"success",
353
356
  "embedMetadata": {
354
- "artist": "John Doe",
355
- "album": "Album sample",
356
- "genre": "Pop"
357
+ "artist": "John Doe",
358
+ "album": "Album sample",
359
+ "genre": "Pop"
357
360
  },
358
361
  "extendMetadata": {
359
- "movie_category":"action",
360
- "imdb_score":8.8,
361
- "published_year":"2018"
362
+ "movie_category":"action",
363
+ "imdb_score":8.8,
364
+ "published_year":"2018"
362
365
  },
363
366
  "createdAt": "2018-06-22T19:16:22.000Z",
364
367
  "updatedAt": "2018-06-22T19:16:22.000Z"
365
- }
368
+ }
369
+ ]
366
370
  ```
367
371
 
368
372
  ## Publish entity to CDN
@@ -392,8 +396,8 @@ end
392
396
  Example Response
393
397
  ```ruby
394
398
  {
395
- "message": "Your entity started publish, check process status with this entity ID",
396
- "entityId": "42ceb1ab-18ef-4f2e-b076-14299756d182"
399
+ "message": "Your entity started publish, check process status with this entity ID",
400
+ "entityId": "42ceb1ab-18ef-4f2e-b076-14299756d182"
397
401
  }
398
402
  ```
399
403
 
@@ -422,10 +426,10 @@ end
422
426
  ```
423
427
 
424
428
  Example Response
425
- ```
429
+ ```ruby
426
430
  {
427
- "progress": 0,
428
- "status": "processing"
431
+ "progress": 0,
432
+ "status": "processing"
429
433
  }
430
434
  ```
431
435
 
@@ -454,13 +458,13 @@ end
454
458
  ```
455
459
 
456
460
  Example Response
457
- ```
461
+ ```ruby
458
462
  {
459
- "temp_expire_at": 1533658598,
460
- "temp_access_id": "ASIAV*******GPHO2DTZ",
461
- "bucket_name": "uiza****-storage-ap-southeast-1-01/upload-temp/****ff4ad74a5195f4c/",
462
- "temp_session_token": "FQo///wEaDM3rrospITbBQ==",
463
- "region_name": "ap-southeast-1",
464
- "temp_access_secret": "dp****cx2mE2lZxsSq7kV++vWSL6RNatAhbqc"
463
+ "temp_expire_at": 1533658598,
464
+ "temp_access_id": "ASIAV*******GPHO2DTZ",
465
+ "bucket_name": "uiza****-storage-ap-southeast-1-01/upload-temp/****ff4ad74a5195f4c/",
466
+ "temp_session_token": "FQo///wEaDM3rrospITbBQ==",
467
+ "region_name": "ap-southeast-1",
468
+ "temp_access_secret": "dp****cx2mE2lZxsSq7kV++vWSL6RNatAhbqc"
465
469
  }
466
470
  ```
@@ -27,7 +27,7 @@ params = {
27
27
  poster: "https://example.com/poster.jpeg",
28
28
  thumbnail: "https://example.com/poster.jpeg",
29
29
  linkStream: [
30
- "https://playlist.m3u8"
30
+ "https://playlist.m3u8"
31
31
  ],
32
32
  resourceMode: "single"
33
33
  }
@@ -254,7 +254,7 @@ end
254
254
  ```
255
255
 
256
256
  Example Response
257
- ```
257
+ ```ruby
258
258
  {
259
259
  "stream_name": "peppa-pig-english-episodes",
260
260
  "watchnow": 1,
@@ -323,6 +323,8 @@ Uiza.authorization = "your-authorization"
323
323
 
324
324
  begin
325
325
  live = Uiza::Live.list_recorded limit: 2
326
+ # limit is optional
327
+ # or live = Uiza::Live.list_recorded
326
328
  puts live.first.id
327
329
  puts live.first.entityId
328
330
  rescue Uiza::Error::UizaError => e
@@ -336,38 +338,40 @@ end
336
338
 
337
339
  Example Response
338
340
  ```ruby
339
- {
340
- "id": "040df935-61c4-46f7-a41f-0a899ebaa2cc",
341
- "entityId": "ee122e85-553f-4621-bc77-1396191d5846",
342
- "channelName": "dcb8686f-d0f8-4a0f-8b92-22db339eb315",
343
- "feedId": "3e3b75df-e6fa-471c-b386-8f44b8a34b6c",
344
- "eventType": "pull",
345
- "startTime": "2018-12-13T16:28:29.000Z",
346
- "endTime": "2018-12-13T18:28:29.000Z",
347
- "length": "7200",
348
- "fileSize": "9276182",
349
- "extraInfo": null,
350
- "endpointConfig": "s3-uiza-dvr",
351
- "createdAt": "2018-12-13T19:28:43.000Z",
352
- "updatedAt": "2018-12-13T19:28:43.000Z",
353
- "entityName": "Christmas 2018 Holidays Special | Best Christmas Songs & Cartoons for Kids & Babies on Baby First TV"
354
- },
355
- {
356
- "id": "3fec45e9-932b-4efe-b97f-dc3053acaa05",
357
- "entityId": "47e804bc-d4e5-4442-8f1f-20341a156a70",
358
- "channelName": "e9034eac-4905-4f9a-8e79-c0bd67e49dd5",
359
- "feedId": "12830696-87e3-4209-a877-954f8f008964",
360
- "eventType": "pull",
361
- "startTime": "2018-12-13T14:14:14.000Z",
362
- "endTime": "2018-12-13T16:14:14.000Z",
363
- "length": "7200",
364
- "fileSize": "439858038",
365
- "extraInfo": null,
366
- "endpointConfig": "s3-uiza-dvr",
367
- "createdAt": "2018-12-13T17:30:42.000Z",
368
- "updatedAt": "2018-12-13T17:30:42.000Z",
369
- "entityName": "WATCH: SpaceX to Launch Falcon 9 Rocket #Spaceflight CRS16 @1:16pm EST"
370
- }
341
+ [
342
+ {
343
+ "id": "040df935-61c4-46f7-a41f-0a899ebaa2cc",
344
+ "entityId": "ee122e85-553f-4621-bc77-1396191d5846",
345
+ "channelName": "dcb8686f-d0f8-4a0f-8b92-22db339eb315",
346
+ "feedId": "3e3b75df-e6fa-471c-b386-8f44b8a34b6c",
347
+ "eventType": "pull",
348
+ "startTime": "2018-12-13T16:28:29.000Z",
349
+ "endTime": "2018-12-13T18:28:29.000Z",
350
+ "length": "7200",
351
+ "fileSize": "9276182",
352
+ "extraInfo": null,
353
+ "endpointConfig": "s3-uiza-dvr",
354
+ "createdAt": "2018-12-13T19:28:43.000Z",
355
+ "updatedAt": "2018-12-13T19:28:43.000Z",
356
+ "entityName": "Christmas 2018 Holidays Special | Best Christmas Songs & Cartoons for Kids & Babies on Baby First TV"
357
+ },
358
+ {
359
+ "id": "3fec45e9-932b-4efe-b97f-dc3053acaa05",
360
+ "entityId": "47e804bc-d4e5-4442-8f1f-20341a156a70",
361
+ "channelName": "e9034eac-4905-4f9a-8e79-c0bd67e49dd5",
362
+ "feedId": "12830696-87e3-4209-a877-954f8f008964",
363
+ "eventType": "pull",
364
+ "startTime": "2018-12-13T14:14:14.000Z",
365
+ "endTime": "2018-12-13T16:14:14.000Z",
366
+ "length": "7200",
367
+ "fileSize": "439858038",
368
+ "extraInfo": null,
369
+ "endpointConfig": "s3-uiza-dvr",
370
+ "createdAt": "2018-12-13T17:30:42.000Z",
371
+ "updatedAt": "2018-12-13T17:30:42.000Z",
372
+ "entityName": "WATCH: SpaceX to Launch Falcon 9 Rocket #Spaceflight CRS16 @1:16pm EST"
373
+ }
374
+ ]
371
375
  ```
372
376
 
373
377
  ## Delete a record file
@@ -64,7 +64,6 @@ Get information of your added storage (`FTP` or `AWS S3`).
64
64
  See details [here](https://docs.uiza.io/#retrieve-a-storage).
65
65
 
66
66
  ```ruby
67
- require "json"
68
67
 
69
68
  Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
70
69
  Uiza.authorization = "your-authorization"
@@ -0,0 +1,286 @@
1
+ ## User Management
2
+ You can manage user with APIs user. Uiza have 2 levels of user:
3
+ Admin - This account will have the highest priority, can have permission to create & manage users.
4
+ User - This account level is under Admin level. It only manages APIs that relates to this account.
5
+
6
+ See details [here](https://docs.uiza.io/#user-management).
7
+
8
+ ## Create an user
9
+ Create an user account for workspace
10
+
11
+ See details [here](https://docs.uiza.io/#create-an-user).
12
+
13
+ ```ruby
14
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
15
+ Uiza.authorization = "your-authorization"
16
+
17
+ params = {
18
+ status: 1,
19
+ username: "user_test",
20
+ email: "user_test@uiza.io",
21
+ password: "FMpsr<4[dGPu?B#u",
22
+ gender: 0,
23
+ dob: "05/15/2018",
24
+ avatar: "https://exemple.com/avatar.jpeg",
25
+ fullname: "User Test",
26
+ isAdmin: 0
27
+ }
28
+
29
+ begin
30
+ user = Uiza::User.create params
31
+ puts user.id
32
+ puts user.username
33
+ rescue Uiza::Error::UizaError => e
34
+ puts "description_link: #{e.description_link}"
35
+ puts "code: #{e.code}"
36
+ puts "message: #{e.message}"
37
+ rescue StandardError => e
38
+ puts "message: #{e.message}"
39
+ end
40
+ ```
41
+
42
+ Example Response
43
+ ```ruby
44
+ {
45
+ "id": "37d6706e-be91-463e-b3b3-b69451dd4752",
46
+ "isAdmin": 0,
47
+ "username": "user_test",
48
+ "email": "user_test@uiza.io",
49
+ "avatar": "https://exemple.com/avatar.jpeg",
50
+ "fullname": "User Test",
51
+ "updatedAt": "2018-06-22T18:05:47.000Z",
52
+ "createdAt": "2018-06-22T18:05:47.000Z"
53
+ }
54
+ ```
55
+
56
+ ## Retrieve an user
57
+ Retrieves the details of an existing user.
58
+ You need only supply the unique userId that was returned upon user creation.
59
+
60
+ See details [here](https://docs.uiza.io/#retrieve-an-user).
61
+
62
+ ```ruby
63
+
64
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
65
+ Uiza.authorization = "your-authorization"
66
+
67
+ begin
68
+ user = Uiza::User.retrieve "your-user-id"
69
+ puts user.id
70
+ puts user.username
71
+ rescue Uiza::Error::UizaError => e
72
+ puts "description_link: #{e.description_link}"
73
+ puts "code: #{e.code}"
74
+ puts "message: #{e.message}"
75
+ rescue StandardError => e
76
+ puts "message: #{e.message}"
77
+ end
78
+ ```
79
+
80
+ Example Response
81
+ ```ruby
82
+ {
83
+ "id": "37d6706e-be91-463e-b3b3-b69451dd4752",
84
+ "isAdmin": 0,
85
+ "username": "user_test",
86
+ "email": "user_test@uiza.io",
87
+ "avatar": "https://exemple.com/avatar.jpeg",
88
+ "fullname": "User Test",
89
+ "updatedAt": "2018-06-22T18:05:47.000Z",
90
+ "createdAt": "2018-06-22T18:05:47.000Z"
91
+ }
92
+ ```
93
+
94
+ ## List all users
95
+ Returns a list of your user. The users are returned sorted by creation date, with the most recent user appearing first.
96
+ If you use Admin token, you will get all the user.
97
+ If you use User token, you can only get the information of that user
98
+
99
+ See details [here](https://docs.uiza.io/#list-all-users).
100
+
101
+ ```ruby
102
+ require "uiza"
103
+
104
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
105
+ Uiza.authorization = "your-authorization"
106
+
107
+ begin
108
+ users = Uiza::User.list
109
+ # or users = Uiza::User.list limit: 2, page: 2
110
+ puts users.first.id
111
+ puts users.first.username
112
+ rescue Uiza::Error::UizaError => e
113
+ puts "description_link: #{e.description_link}"
114
+ puts "code: #{e.code}"
115
+ puts "message: #{e.message}"
116
+ rescue StandardError => e
117
+ puts "message: #{e.message}"
118
+ end
119
+ ```
120
+
121
+ Example Response
122
+ ```ruby
123
+ {
124
+ "id": "1a95f752-19e0-4a2e-9951-6d1fc0adbeaf",
125
+ "isAdmin": 0,
126
+ "username": "user_test",
127
+ "email": "user_test@uiza.io",
128
+ "updatedAt": "2018-06-22T02:31:14.000Z",
129
+ "createdAt": "2018-06-22T02:31:14.000Z"
130
+ },
131
+ {
132
+ "id": "95c1229a-73e6-4ef7-98eb-e64a765c32d5",
133
+ "isAdmin": 1,
134
+ "username": "user_admin",
135
+ "email": "user_admin@uiza.io",
136
+ "updatedAt": "2018-06-22T00:00:00.000Z",
137
+ "createdAt": "2018-06-22T02:32:29.000Z"
138
+ }
139
+ ```
140
+
141
+ ## Update an user
142
+ Updates the specified user by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
143
+
144
+ See details [here](https://docs.uiza.io/#update-an-user).
145
+
146
+ ```ruby
147
+ require "uiza"
148
+
149
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
150
+ Uiza.authorization = "your-authorization"
151
+
152
+ params = {
153
+ id: "37d6706e-be91-463e-b3b3-b69451dd4752"
154
+ status: 1,
155
+ username: "user_test",
156
+ email: "user_test@uiza.io",
157
+ password: "FMpsr<4[dGPu?B#u",
158
+ gender: 0,
159
+ dob: "05/15/2018",
160
+ avatar: "https://exemple.com/avatar.jpeg",
161
+ fullname: "User Test",
162
+ isAdmin: 0
163
+ }
164
+
165
+ begin
166
+ user = Uiza::User.update params
167
+ puts user.id
168
+ puts user.username
169
+ rescue Uiza::Error::UizaError => e
170
+ puts "description_link: #{e.description_link}"
171
+ puts "code: #{e.code}"
172
+ puts "message: #{e.message}"
173
+ rescue StandardError => e
174
+ puts "message: #{e.message}"
175
+ end
176
+ ```
177
+
178
+ Example Response
179
+ ```ruby
180
+ {
181
+ "id": "37d6706e-be91-463e-b3b3-b69451dd4752",
182
+ "isAdmin": 0,
183
+ "username": "user_test",
184
+ "email": "user_test@uiza.io",
185
+ "avatar": "https://exemple.com/avatar.jpeg",
186
+ "fullname": "User Test",
187
+ "updatedAt": "2018-06-22T18:05:47.000Z",
188
+ "createdAt": "2018-06-22T18:05:47.000Z"
189
+ }
190
+ ```
191
+
192
+ ## Delete an user
193
+ Permanently deletes an user. It cannot be undone. Also immediately cancels all token & information of this user.
194
+
195
+ See details [here](https://docs.uiza.io/#delete-an-user).
196
+
197
+ ```ruby
198
+ require "uiza"
199
+
200
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
201
+ Uiza.authorization = "your-authorization"
202
+
203
+ begin
204
+ user = Uiza::User.delete "your-user-id"
205
+ puts user.id
206
+ rescue Uiza::Error::UizaError => e
207
+ puts "description_link: #{e.description_link}"
208
+ puts "code: #{e.code}"
209
+ puts "message: #{e.message}"
210
+ rescue StandardError => e
211
+ puts "message: #{e.message}"
212
+ end
213
+ ```
214
+
215
+ Example Response
216
+ ```
217
+ {
218
+ "id": "2c98b4d5-7d7f-4a0f-9258-5689f90fd28c"
219
+ }
220
+ ```
221
+
222
+ ## Update password
223
+ Update password allows Admin or User update their current password.
224
+
225
+ See details [here](https://docs.uiza.io/#update-password).
226
+
227
+ ```ruby
228
+ require "uiza"
229
+
230
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
231
+ Uiza.authorization = "your-authorization"
232
+
233
+ params = {
234
+ id: "your-user-id",
235
+ oldPassword: "FMpsr<4[dGPu?B#u",
236
+ newPassword: "S57Eb{:aMZhW=)G$"
237
+ }
238
+
239
+ begin
240
+ response = Uiza::User.change_password params
241
+ puts response.result
242
+ rescue Uiza::Error::UizaError => e
243
+ puts "description_link: #{e.description_link}"
244
+ puts "code: #{e.code}"
245
+ puts "message: #{e.message}"
246
+ rescue StandardError => e
247
+ puts "message: #{e.message}"
248
+ end
249
+ ```
250
+
251
+ Example Response
252
+ ```ruby
253
+ {
254
+ "result": "ok"
255
+ }
256
+ ```
257
+
258
+ ## Log Out
259
+ This API use to log out an user. After logged out, token will be removed.
260
+
261
+ See details [here](https://docs.uiza.io/#log-out).
262
+
263
+ ```ruby
264
+ require "uiza"
265
+
266
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
267
+ Uiza.authorization = "your-authorization"
268
+
269
+ begin
270
+ response = Uiza::User.logout
271
+ puts response.message
272
+ rescue Uiza::Error::UizaError => e
273
+ puts "description_link: #{e.description_link}"
274
+ puts "code: #{e.code}"
275
+ puts "message: #{e.message}"
276
+ rescue StandardError => e
277
+ puts "message: #{e.message}"
278
+ end
279
+ ```
280
+
281
+ Example Response
282
+ ```ruby
283
+ {
284
+ "message": "Logout success"
285
+ }
286
+ ```
@@ -29,6 +29,8 @@ require "uiza/storage"
29
29
  require "uiza/category"
30
30
  require "uiza/live"
31
31
  require "uiza/callback"
32
+ require "uiza/user"
33
+ require "uiza/analytic"
32
34
 
33
35
  module Uiza
34
36
  class << self
@@ -0,0 +1,42 @@
1
+ module Uiza
2
+ class Analytic
3
+ OBJECT_API_PATH = "analytic/entity/video-quality".freeze
4
+ OBJECT_API_DESCRIPTION_LINK = {
5
+ get_total_line: "https://docs.uiza.io/#total-line",
6
+ get_type: "https://docs.uiza.io/#type",
7
+ get_line: "https://docs.uiza.io/#line"
8
+ }.freeze
9
+
10
+ class << self
11
+ def get_total_line params
12
+ url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/total-line-v2"
13
+ method = :get
14
+ headers = {"Authorization" => Uiza.authorization}
15
+ description_link = OBJECT_API_DESCRIPTION_LINK[:get_total_line]
16
+
17
+ uiza_client = UizaClient.new url, method, headers, params, description_link
18
+ uiza_client.execute_request
19
+ end
20
+
21
+ def get_type params
22
+ url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/type"
23
+ method = :get
24
+ headers = {"Authorization" => Uiza.authorization}
25
+ description_link = OBJECT_API_DESCRIPTION_LINK[:get_type]
26
+
27
+ uiza_client = UizaClient.new url, method, headers, params, description_link
28
+ uiza_client.execute_request
29
+ end
30
+
31
+ def get_line params
32
+ url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/line"
33
+ method = :get
34
+ headers = {"Authorization" => Uiza.authorization}
35
+ description_link = OBJECT_API_DESCRIPTION_LINK[:get_line]
36
+
37
+ uiza_client = UizaClient.new url, method, headers, params, description_link
38
+ uiza_client.execute_request
39
+ end
40
+ end
41
+ end
42
+ end
@@ -4,6 +4,8 @@ module Uiza
4
4
  @uri = URI.parse url
5
5
  @description_link = description_link
6
6
 
7
+ params ||= {}
8
+
7
9
  case method.to_s.downcase
8
10
  when "get"
9
11
  @uri.query = URI.encode_www_form params
@@ -0,0 +1,41 @@
1
+ module Uiza
2
+ class User
3
+ extend Uiza::APIOperation::Create
4
+ extend Uiza::APIOperation::Retrieve
5
+ extend Uiza::APIOperation::List
6
+ extend Uiza::APIOperation::Update
7
+ extend Uiza::APIOperation::Delete
8
+
9
+ OBJECT_API_PATH = "admin/user".freeze
10
+ OBJECT_API_DESCRIPTION_LINK = {
11
+ create: "https://docs.uiza.io/#create-an-user",
12
+ retrieve: "https://docs.uiza.io/#retrieve-an-user",
13
+ list: "https://docs.uiza.io/#list-all-users",
14
+ update: "https://docs.uiza.io/#update-an-user",
15
+ delete: "https://docs.uiza.io/#delete-an-user",
16
+ change_password: "https://docs.uiza.io/#update-password",
17
+ logout: "https://docs.uiza.io/#log-out"
18
+ }.freeze
19
+
20
+ class << self
21
+ def change_password params
22
+ url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/changepassword"
23
+ method = :post
24
+ headers = {"Authorization" => Uiza.authorization}
25
+
26
+ uiza_client = UizaClient.new url, method, headers, params, OBJECT_API_DESCRIPTION_LINK[:change_password]
27
+ uiza_client.execute_request
28
+ end
29
+
30
+ def logout
31
+ url = "https://#{Uiza.workspace_api_domain}/api/public/v3/#{OBJECT_API_PATH}/logout"
32
+ method = :post
33
+ headers = {"Authorization" => Uiza.authorization}
34
+ params = {}
35
+
36
+ uiza_client = UizaClient.new url, method, headers, params, OBJECT_API_DESCRIPTION_LINK[:logout]
37
+ uiza_client.execute_request
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,3 @@
1
1
  module Uiza
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uiza
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vo Khanh Toan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-27 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,7 +82,9 @@ files:
82
82
  - doc/ERRORS_CODE.md
83
83
  - doc/LIVE_STREAMING.md
84
84
  - doc/STORAGE.md
85
+ - doc/USER.md
85
86
  - lib/uiza.rb
87
+ - lib/uiza/analytic.rb
86
88
  - lib/uiza/api_operation/add.rb
87
89
  - lib/uiza/api_operation/create.rb
88
90
  - lib/uiza/api_operation/delete.rb
@@ -106,6 +108,7 @@ files:
106
108
  - lib/uiza/storage.rb
107
109
  - lib/uiza/uiza_client.rb
108
110
  - lib/uiza/uiza_open_struct.rb
111
+ - lib/uiza/user.rb
109
112
  - lib/uiza/version.rb
110
113
  - uiza.gemspec
111
114
  homepage: https://docs.uiza.io