uiza 1.0.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.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +535 -0
  3. data/.rubocop_disable.yml +78 -0
  4. data/.rubocop_enable.yml +786 -0
  5. data/CHANGELOG.md +41 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/CONTRIBUTORS.txt +3 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +65 -0
  10. data/History.txt +1 -0
  11. data/LICENSE.txt +21 -0
  12. data/PULL_REQUEST_TEMPLATE.md +44 -0
  13. data/README.md +179 -0
  14. data/Rakefile +6 -0
  15. data/bin/console +14 -0
  16. data/bin/setup +8 -0
  17. data/doc/ANALYTIC.md +5 -0
  18. data/doc/CALLBACK.md +4 -0
  19. data/doc/CATEGORY.md +282 -0
  20. data/doc/EMBED_METADATA.md +4 -0
  21. data/doc/ENTITY.md +466 -0
  22. data/doc/ERRORS_CODE.md +60 -0
  23. data/doc/LIVE_STREAMING.md +6 -0
  24. data/doc/STORAGE.md +189 -0
  25. data/lib/uiza.rb +34 -0
  26. data/lib/uiza/api_operation/add.rb +16 -0
  27. data/lib/uiza/api_operation/create.rb +16 -0
  28. data/lib/uiza/api_operation/delete.rb +15 -0
  29. data/lib/uiza/api_operation/list.rb +14 -0
  30. data/lib/uiza/api_operation/remove.rb +15 -0
  31. data/lib/uiza/api_operation/retrieve.rb +15 -0
  32. data/lib/uiza/api_operation/update.rb +16 -0
  33. data/lib/uiza/category.rb +42 -0
  34. data/lib/uiza/entity.rb +68 -0
  35. data/lib/uiza/error/bad_request_error.rb +8 -0
  36. data/lib/uiza/error/client_error.rb +8 -0
  37. data/lib/uiza/error/internal_server_error.rb +8 -0
  38. data/lib/uiza/error/not_found_error.rb +8 -0
  39. data/lib/uiza/error/server_error.rb +8 -0
  40. data/lib/uiza/error/service_unavailable_error.rb +8 -0
  41. data/lib/uiza/error/uiza_error.rb +18 -0
  42. data/lib/uiza/error/unauthorized_error.rb +8 -0
  43. data/lib/uiza/error/unprocessable_error.rb +8 -0
  44. data/lib/uiza/storage.rb +17 -0
  45. data/lib/uiza/uiza_client.rb +74 -0
  46. data/lib/uiza/version.rb +3 -0
  47. data/uiza.gemspec +36 -0
  48. metadata +134 -0
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "uiza"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ ## Analytic
2
+ Monitor the four key dimensions of video QoS: playback failures, startup time, rebuffering, and video quality.
3
+ These 15 metrics help you track playback performance, so your team can know exactly what’s going on.
4
+
5
+ See details [here](https://docs.uiza.io/#analytic).
@@ -0,0 +1,4 @@
1
+ ## Callback
2
+ 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 .
3
+
4
+ See details [here](https://docs.uiza.io/#callback).
@@ -0,0 +1,282 @@
1
+ ## Category
2
+ Category has been splits into 3 types: folder, playlist and tag.
3
+ These will make the management of entity more easier.
4
+
5
+ See details [here](https://docs.uiza.io/#category).
6
+
7
+ ## Create category
8
+ Create category for entity for easier management.
9
+ Category use to group all the same entities into a group (like `Folder`/`playlist` or `tag`).
10
+
11
+ See details [here](https://docs.uiza.io/#create-category).
12
+
13
+ ```ruby
14
+ require "uiza"
15
+
16
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
17
+ Uiza.authorization = "your-authorization"
18
+
19
+ params = {
20
+ name: "Folder sample",
21
+ type: "folder",
22
+ description: "Folder description"
23
+ }
24
+
25
+ begin
26
+ category = Uiza::Category.create params
27
+ puts category.id
28
+ puts category.name
29
+ rescue Uiza::Error::UizaError => e
30
+ puts "description_link: #{e.description_link}"
31
+ puts "code: #{e.code}"
32
+ puts "message: #{e.message}"
33
+ rescue StandardError => e
34
+ puts "message: #{e.message}"
35
+ end
36
+ ```
37
+
38
+ Example Response
39
+ ```ruby
40
+ {
41
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
42
+ "name": "Playlist sample",
43
+ "description": "Playlist description",
44
+ "slug": "playlist-sample",
45
+ "type": "playlist",
46
+ "orderNumber": 3,
47
+ "icon": "https:///example.com/image002.png",
48
+ "status": 1,
49
+ "createdAt": "2018-06-18T04:29:05.000Z",
50
+ "updatedAt": "2018-06-18T04:29:05.000Z"
51
+ }
52
+ ```
53
+
54
+ ## Retrieve category
55
+ Get detail of category.
56
+
57
+ See details [here](https://docs.uiza.io/?shell#retrieve-category).
58
+
59
+ ```ruby
60
+ require "uiza"
61
+
62
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
63
+ Uiza.authorization = "your-authorization"
64
+
65
+ begin
66
+ category = Uiza::Category.retrieve "your-category-id"
67
+ puts category.id
68
+ puts category.name
69
+ rescue Uiza::Error::UizaError => e
70
+ puts "description_link: #{e.description_link}"
71
+ puts "code: #{e.code}"
72
+ puts "message: #{e.message}"
73
+ rescue StandardError => e
74
+ puts "message: #{e.message}"
75
+ end
76
+ ```
77
+
78
+ Example Response
79
+ ```ruby
80
+ {
81
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
82
+ "name": "Playlist sample",
83
+ "description": "Playlist description",
84
+ "slug": "playlist-sample",
85
+ "type": "playlist",
86
+ "orderNumber": 3,
87
+ "icon": "https:///example.com/image002.png",
88
+ "status": 1,
89
+ "createdAt": "2018-06-18T04:29:05.000Z",
90
+ "updatedAt": "2018-06-18T04:29:05.000Z"
91
+ }
92
+ ```
93
+
94
+ ## Retrieve category list
95
+ Get all category.
96
+
97
+ See details [here](https://docs.uiza.io/#retrieve-category-list).
98
+
99
+ ```ruby
100
+ require "uiza"
101
+
102
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
103
+ Uiza.authorization = "your-authorization"
104
+
105
+ begin
106
+ categories = Uiza::Category.list
107
+ puts categories.first.id
108
+ puts categories.first.name
109
+ rescue Uiza::Error::UizaError => e
110
+ puts "description_link: #{e.description_link}"
111
+ puts "code: #{e.code}"
112
+ puts "message: #{e.message}"
113
+ rescue StandardError => e
114
+ puts "message: #{e.message}"
115
+ end
116
+ ```
117
+
118
+ ## Update category
119
+ Update information of category.
120
+
121
+ See details [here](https://docs.uiza.io/#update-category).
122
+
123
+ ```ruby
124
+ require "uiza"
125
+
126
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
127
+ Uiza.authorization = "your-authorization"
128
+
129
+ params = {
130
+ id: "your-category-id",
131
+ name: "Folder edited",
132
+ type: "folder"
133
+ }
134
+
135
+ begin
136
+ category = Uiza::Category.update params
137
+ puts category.id
138
+ puts category.name
139
+ rescue Uiza::Error::UizaError => e
140
+ puts "description_link: #{e.description_link}"
141
+ puts "code: #{e.code}"
142
+ puts "message: #{e.message}"
143
+ rescue StandardError => e
144
+ puts "message: #{e.message}"
145
+ end
146
+ ```
147
+
148
+ Example Response
149
+ ```ruby
150
+ {
151
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
152
+ "name": "Folder edited",
153
+ "description": "Playlist description",
154
+ "slug": "playlist-sample",
155
+ "type": "folder",
156
+ "orderNumber": 3,
157
+ "icon": "https:///example.com/image002.png",
158
+ "status": 1,
159
+ "createdAt": "2018-06-18T04:29:05.000Z",
160
+ "updatedAt": "2018-06-18T04:29:05.000Z"
161
+ }
162
+ ```
163
+
164
+ ## Delete category
165
+ Delete category.
166
+
167
+ See details [here](https://docs.uiza.io/#delete-category).
168
+
169
+ ```ruby
170
+ require "uiza"
171
+
172
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
173
+ Uiza.authorization = "your-authorization"
174
+
175
+ begin
176
+ category = Uiza::Category.delete "your-category-id"
177
+ puts category.id
178
+ rescue Uiza::Error::UizaError => e
179
+ puts "description_link: #{e.description_link}"
180
+ puts "code: #{e.code}"
181
+ puts "message: #{e.message}"
182
+ rescue StandardError => e
183
+ puts "message: #{e.message}"
184
+ end
185
+ ```
186
+
187
+ Example Response
188
+ ```ruby
189
+ {
190
+ "id": "f932aa79-852a-41f7-9adc-19935034f944"
191
+ }
192
+ ```
193
+
194
+ ## Create category relation
195
+ Add relation for entity and category.
196
+
197
+ See details [here](https://docs.uiza.io/#create-category-relation).
198
+
199
+ ```ruby
200
+ require "uiza"
201
+
202
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
203
+ Uiza.authorization = "your-authorization"
204
+
205
+ params = {
206
+ entityId: "your-entity-id",
207
+ metadataIds: ["your-category-id-1", "your-category-id-2"]
208
+ }
209
+
210
+ begin
211
+ relations = Uiza::Category.create_relation params
212
+ puts relations.first.id
213
+ puts relations.first.entityId
214
+ rescue Uiza::Error::UizaError => e
215
+ puts "description_link: #{e.description_link}"
216
+ puts "code: #{e.code}"
217
+ puts "message: #{e.message}"
218
+ rescue StandardError => e
219
+ puts "message: #{e.message}"
220
+ end
221
+ ```
222
+
223
+ Example Response
224
+ ```ruby
225
+ [
226
+ {
227
+ "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
228
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
229
+ "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
230
+ },
231
+ {
232
+ "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
233
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
234
+ "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
235
+ }
236
+ ]
237
+ ```
238
+
239
+ ## Delete category relation
240
+ Delete relation for entity and category.
241
+
242
+ See details [here](https://docs.uiza.io/#delete-category-relation).
243
+
244
+ ```ruby
245
+ require "uiza"
246
+
247
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
248
+ Uiza.authorization = "your-authorization"
249
+
250
+ params = {
251
+ entityId: "your-entity-id",
252
+ metadataIds: ["your-category-id-1", "your-category-id-2"]
253
+ }
254
+
255
+ begin
256
+ relations = Uiza::Category.delete_relation params
257
+ puts relations.first.id
258
+ puts relations.first.entityId
259
+ rescue Uiza::Error::UizaError => e
260
+ puts "description_link: #{e.description_link}"
261
+ puts "code: #{e.code}"
262
+ puts "message: #{e.message}"
263
+ rescue StandardError => e
264
+ puts "message: #{e.message}"
265
+ end
266
+ ```
267
+
268
+ Example Response
269
+ ```ruby
270
+ [
271
+ {
272
+ "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
273
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
274
+ "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
275
+ },
276
+ {
277
+ "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
278
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
279
+ "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
280
+ }
281
+ ]
282
+ ```
@@ -0,0 +1,4 @@
1
+ ## Embed Metadata
2
+ Embed metadata is information that can be embed into video/audio file. You can embed into file by adding a json compose these tag.
3
+
4
+ See details [here](https://docs.uiza.io/#embed-metadata).
@@ -0,0 +1,466 @@
1
+ ## Entity
2
+ These below APIs used to take action with your media files (we called Entity).
3
+
4
+ See details [here](https://docs.uiza.io/#video).
5
+
6
+ ## Create entity
7
+ Create entity using full URL. Direct HTTP, FTP or AWS S3 link are acceptable.
8
+
9
+ See details [here](https://docs.uiza.io/#create-entity).
10
+
11
+ ```ruby
12
+ require "uiza"
13
+
14
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
15
+ Uiza.authorization = "your-authorization"
16
+
17
+ params = {
18
+ name: "Sample Video",
19
+ url: "https://example.com/video.mp4",
20
+ inputType: "http",
21
+ description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
22
+ shortDescription: "Lorem Ipsum is simply dummy text.",
23
+ poster: "https://example.com/picture001.jpeg",
24
+ thumbnail: "https://example.com/picture002.jpeg"
25
+ }
26
+
27
+ begin
28
+ entity = Uiza::Entity.create params
29
+ puts entity.id
30
+ puts entity.name
31
+ rescue Uiza::Error::UizaError => e
32
+ puts "description_link: #{e.description_link}"
33
+ puts "code: #{e.code}"
34
+ puts "message: #{e.message}"
35
+ rescue StandardError => e
36
+ puts "message: #{e.message}"
37
+ end
38
+ ```
39
+
40
+ Example Response
41
+ ```ruby
42
+ {
43
+ "id": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
44
+ "name": "Sample Video",
45
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry",
46
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
47
+ "view": 0,
48
+ "poster": "https://example.com/picture001",
49
+ "thumbnail": "https://example.com/picture002",
50
+ "type": "vod",
51
+ "status": 1,
52
+ "duration": "237.865215",
53
+ "publishToCdn":"success",
54
+ "embedMetadata": {
55
+ "artist": "John Doe",
56
+ "album": "Album sample",
57
+ "genre": "Pop"
58
+ },
59
+ "extendMetadata": {
60
+ "movie_category":"action",
61
+ "imdb_score":8.8,
62
+ "published_year":"2018"
63
+ },
64
+ "createdAt": "2018-06-16T18:54:15.000Z",
65
+ "updatedAt": "2018-06-16T18:54:29.000Z"
66
+ }
67
+ ```
68
+
69
+ ## Retrieve entity
70
+ Get detail of entity including all information of entity.
71
+
72
+ See details [here](https://docs.uiza.io/#retrieve-an-entity).
73
+
74
+ ```ruby
75
+ require "uiza"
76
+
77
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
78
+ Uiza.authorization = "your-authorization"
79
+
80
+ begin
81
+ entity = Uiza::Entity.retrieve "your-entity-id"
82
+ puts entity.id
83
+ puts entity.name
84
+ rescue Uiza::Error::UizaError => e
85
+ puts "description_link: #{e.description_link}"
86
+ puts "code: #{e.code}"
87
+ puts "message: #{e.message}"
88
+ rescue StandardError => e
89
+ puts "message: #{e.message}"
90
+ end
91
+ ```
92
+
93
+ Example Response
94
+ ```ruby
95
+ {
96
+ "id": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
97
+ "name": "Sample Video",
98
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
99
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
100
+ "view": 0,
101
+ "poster": "https://example.com/picture001",
102
+ "thumbnail": "https://example.com/picture002",
103
+ "type": "vod",
104
+ "status": 1,
105
+ "duration": "237.865215",
106
+ "publishToCdn":"success",
107
+ "embedMetadata": {
108
+ "artist": "John Doe",
109
+ "album": "Album sample",
110
+ "genre": "Pop"
111
+ },
112
+ "extendMetadata": {
113
+ "movie_category":"action",
114
+ "imdb_score":8.8,
115
+ "published_year":"2018"
116
+ },
117
+ "createdAt": "2018-06-16T18:54:15.000Z",
118
+ "updatedAt": "2018-06-16T18:54:29.000Z"
119
+ }
120
+ ```
121
+
122
+ ## List all entities
123
+ Get list of entities including all detail.
124
+
125
+ See details [here](https://docs.uiza.io/#list-all-entities).
126
+
127
+ ```ruby
128
+ require "uiza"
129
+
130
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
131
+ Uiza.authorization = "your-authorization"
132
+
133
+ params = {
134
+ publishToCdn: "not-ready",
135
+ metadataId: "your-folder/playlist-id"
136
+ }
137
+
138
+ begin
139
+ entities = Uiza::Entity.list params
140
+ # params is optional
141
+ # or entities = Uiza::Entity.list
142
+ puts entities.first.id
143
+ puts entities.first.name
144
+ rescue Uiza::Error::UizaError => e
145
+ puts "description_link: #{e.description_link}"
146
+ puts "code: #{e.code}"
147
+ puts "message: #{e.message}"
148
+ rescue StandardError => e
149
+ puts "message: #{e.message}"
150
+ end
151
+ ```
152
+
153
+ Example Response
154
+ ```ruby
155
+ {
156
+ "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
157
+ "name": "Sample Video 1",
158
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
159
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
160
+ "view": 0,
161
+ "poster": "https://example.com/picture001",
162
+ "thumbnail": "https://example.com/picture002",
163
+ "type": "vod",
164
+ "duration": "237.865215",
165
+ "publishToCdn":"success",
166
+ "embedMetadata": {
167
+ "artist": "John Doe",
168
+ "album": "Album sample",
169
+ "genre": "Pop"
170
+ },
171
+ "extendMetadata": {
172
+ "movie_category":"action",
173
+ "imdb_score":8.8,
174
+ "published_year":"2018"
175
+ },
176
+ "createdAt": "2018-06-22T19:20:17.000Z",
177
+ "updatedAt": "2018-06-22T19:20:17.000Z"
178
+ },
179
+ {
180
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
181
+ "name": "Sample Video 2",
182
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
183
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
184
+ "view": 0,
185
+ "poster": "https://example.com/picture001",
186
+ "thumbnail": "https://example.com/picture002",
187
+ "type": "vod",
188
+ "duration": "178.178105",
189
+ "publishToCdn":"success",
190
+ "embedMetadata": {
191
+ "artist": "John Doe",
192
+ "album": "Album sample",
193
+ "genre": "Pop"
194
+ },
195
+ "extendMetadata": {
196
+ "movie_category":"action",
197
+ "imdb_score":8.8,
198
+ "published_year":"2018"
199
+ },
200
+ "createdAt": "2018-06-22T19:16:22.000Z",
201
+ "updatedAt": "2018-06-22T19:16:22.000Z"
202
+ }
203
+ ```
204
+
205
+ ## Update entity
206
+ Update entity's information.
207
+
208
+ See details [here](https://docs.uiza.io/#update-an-entity).
209
+
210
+ ```ruby
211
+ require "uiza"
212
+
213
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
214
+ Uiza.authorization = "your-authorization"
215
+
216
+ params = {
217
+ id: "your-entity-id",
218
+ name: "Name edited"
219
+ }
220
+
221
+ begin
222
+ entity = Uiza::Entity.update params
223
+ puts entity.id
224
+ puts entity.name
225
+ rescue Uiza::Error::UizaError => e
226
+ puts "description_link: #{e.description_link}"
227
+ puts "code: #{e.code}"
228
+ puts "message: #{e.message}"
229
+ rescue StandardError => e
230
+ puts "message: #{e.message}"
231
+ end
232
+ ```
233
+
234
+ Example Response
235
+ ```ruby
236
+ {
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"
259
+ }
260
+ ```
261
+
262
+ ## Delete entity
263
+ Delete entity.
264
+
265
+ See details [here](https://docs.uiza.io/#delete-an-entity).
266
+
267
+ ```ruby
268
+ require "uiza"
269
+
270
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
271
+ Uiza.authorization = "your-authorization"
272
+
273
+ begin
274
+ entity = Uiza::Entity.delete "your-entity-id"
275
+ puts entity.id
276
+ rescue Uiza::Error::UizaError => e
277
+ puts "description_link: #{e.description_link}"
278
+ puts "code: #{e.code}"
279
+ puts "message: #{e.message}"
280
+ rescue StandardError => e
281
+ puts "message: #{e.message}"
282
+ end
283
+ ```
284
+
285
+ Example Response
286
+ ```
287
+ {
288
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67"
289
+ }
290
+ ```
291
+
292
+ ## Search entity
293
+ Search entity base on keyword entered.
294
+
295
+ See details [here](https://docs.uiza.io/#search-entity).
296
+
297
+ ```ruby
298
+ require "uiza"
299
+
300
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
301
+ Uiza.authorization = "your-authorization"
302
+
303
+ begin
304
+ entities = Uiza::Entity.search "your-keyword"
305
+ puts entities.first.id
306
+ puts entities.first.name
307
+ rescue Uiza::Error::UizaError => e
308
+ puts "description_link: #{e.description_link}"
309
+ puts "code: #{e.code}"
310
+ puts "message: #{e.message}"
311
+ rescue StandardError => e
312
+ puts "message: #{e.message}"
313
+ end
314
+ ```
315
+
316
+ Example Response
317
+ ```ruby
318
+ {
319
+ "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
320
+ "name": "Sample Video 1",
321
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
322
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
323
+ "view": 0,
324
+ "poster": "https://example.com/picture001",
325
+ "thumbnail": "https://example.com/picture002",
326
+ "type": "vod",
327
+ "duration": "237.865215",
328
+ "publishToCdn":"success",
329
+ "embedMetadata": {
330
+ "artist": "John Doe",
331
+ "album": "Album sample",
332
+ "genre": "Pop"
333
+ },
334
+ "extendMetadata": {
335
+ "movie_category":"action",
336
+ "imdb_score":8.8,
337
+ "published_year":"2018"
338
+ },
339
+ "createdAt": "2018-06-22T19:20:17.000Z",
340
+ "updatedAt": "2018-06-22T19:20:17.000Z"
341
+ },
342
+ {
343
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
344
+ "name": "Sample Video 2",
345
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
346
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
347
+ "view": 0,
348
+ "poster": "https://example.com/picture001",
349
+ "thumbnail": "https://example.com/picture002",
350
+ "type": "vod",
351
+ "duration": "178.178105",
352
+ "publishToCdn":"success",
353
+ "embedMetadata": {
354
+ "artist": "John Doe",
355
+ "album": "Album sample",
356
+ "genre": "Pop"
357
+ },
358
+ "extendMetadata": {
359
+ "movie_category":"action",
360
+ "imdb_score":8.8,
361
+ "published_year":"2018"
362
+ },
363
+ "createdAt": "2018-06-22T19:16:22.000Z",
364
+ "updatedAt": "2018-06-22T19:16:22.000Z"
365
+ }
366
+ ```
367
+
368
+ ## Publish entity to CDN
369
+ Publish entity to CDN, use for streaming.
370
+
371
+ See details [here](https://docs.uiza.io/#publish-entity-to-cdn).
372
+
373
+ ```ruby
374
+ require "uiza"
375
+
376
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
377
+ Uiza.authorization = "your-authorization"
378
+
379
+ begin
380
+ response = Uiza::Entity.publish "your-entity-id"
381
+ puts response.message
382
+ puts response.entityId
383
+ rescue Uiza::Error::UizaError => e
384
+ puts "description_link: #{e.description_link}"
385
+ puts "code: #{e.code}"
386
+ puts "message: #{e.message}"
387
+ rescue StandardError => e
388
+ puts "message: #{e.message}"
389
+ end
390
+ ```
391
+
392
+ Example Response
393
+ ```ruby
394
+ {
395
+ "message": "Your entity started publish, check process status with this entity ID",
396
+ "entityId": "42ceb1ab-18ef-4f2e-b076-14299756d182"
397
+ }
398
+ ```
399
+
400
+ ## Get status publish
401
+ Publish entity to CDN, use for streaming.
402
+
403
+ See details [here](https://docs.uiza.io/#get-status-publish).
404
+
405
+ ```ruby
406
+ require "uiza"
407
+
408
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
409
+ Uiza.authorization = "your-authorization"
410
+
411
+ begin
412
+ response = Uiza::Entity.get_status_publish "your-entity-id"
413
+ puts response.progress
414
+ puts response.status
415
+ rescue Uiza::Error::UizaError => e
416
+ puts "description_link: #{e.description_link}"
417
+ puts "code: #{e.code}"
418
+ puts "message: #{e.message}"
419
+ rescue StandardError => e
420
+ puts "message: #{e.message}"
421
+ end
422
+ ```
423
+
424
+ Example Response
425
+ ```
426
+ {
427
+ "progress": 0,
428
+ "status": "processing"
429
+ }
430
+ ```
431
+
432
+ ## Get AWS upload key
433
+ This API will be return the bucket temporary upload storage & key for upload, so that you can push your file to Uiza’s storage and get the link for URL upload & create entity.
434
+
435
+ See details [here](https://docs.uiza.io/#get-aws-upload-key).
436
+
437
+ ```ruby
438
+ require "uiza"
439
+
440
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
441
+ Uiza.authorization = "your-authorization"
442
+
443
+ begin
444
+ response = Uiza::Entity.get_aws_upload_key
445
+ puts response.bucket_name
446
+ puts response.region_name
447
+ rescue Uiza::Error::UizaError => e
448
+ puts "description_link: #{e.description_link}"
449
+ puts "code: #{e.code}"
450
+ puts "message: #{e.message}"
451
+ rescue StandardError => e
452
+ puts "message: #{e.message}"
453
+ end
454
+ ```
455
+
456
+ Example Response
457
+ ```
458
+ {
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"
465
+ }
466
+ ```