uiza_framgia_test 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) 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 +29 -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 +181 -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 +289 -0
  20. data/doc/EMBED_METADATA.md +4 -0
  21. data/doc/ENTITY.md +486 -0
  22. data/doc/ERRORS_CODE.md +60 -0
  23. data/doc/LIVE_STREAMING.md +6 -0
  24. data/doc/STORAGE.md +195 -0
  25. data/lib/uiza.rb +42 -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/api_resource/category_resource.rb +33 -0
  34. data/lib/uiza/api_resource/entity_resource.rb +41 -0
  35. data/lib/uiza/api_resource/storage_resource.rb +21 -0
  36. data/lib/uiza/category.rb +44 -0
  37. data/lib/uiza/entity.rb +68 -0
  38. data/lib/uiza/error/bad_request_error.rb +8 -0
  39. data/lib/uiza/error/client_error.rb +8 -0
  40. data/lib/uiza/error/internal_server_error.rb +8 -0
  41. data/lib/uiza/error/not_found_error.rb +8 -0
  42. data/lib/uiza/error/server_error.rb +8 -0
  43. data/lib/uiza/error/service_unavailable_error.rb +8 -0
  44. data/lib/uiza/error/uiza_error.rb +18 -0
  45. data/lib/uiza/error/unauthorized_error.rb +8 -0
  46. data/lib/uiza/error/unprocessable_error.rb +8 -0
  47. data/lib/uiza/storage.rb +17 -0
  48. data/lib/uiza/uiza_client.rb +82 -0
  49. data/lib/uiza/version.rb +3 -0
  50. data/uiza.gemspec +36 -0
  51. metadata +137 -0
data/bin/console ADDED
@@ -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__)
data/bin/setup ADDED
@@ -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
data/doc/ANALYTIC.md ADDED
@@ -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).
data/doc/CALLBACK.md ADDED
@@ -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).
data/doc/CATEGORY.md ADDED
@@ -0,0 +1,289 @@
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.create_category params
27
+ # or category = Uiza::Category.create params
28
+ puts category.id
29
+ puts category.name
30
+ rescue Uiza::Error::UizaError => e
31
+ puts "description_link: #{e.description_link}"
32
+ puts "code: #{e.code}"
33
+ puts "message: #{e.message}"
34
+ rescue StandardError => e
35
+ puts "message: #{e.message}"
36
+ end
37
+ ```
38
+
39
+ Example Response
40
+ ```ruby
41
+ {
42
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
43
+ "name": "Playlist sample",
44
+ "description": "Playlist description",
45
+ "slug": "playlist-sample",
46
+ "type": "playlist",
47
+ "orderNumber": 3,
48
+ "icon": "https:///example.com/image002.png",
49
+ "status": 1,
50
+ "createdAt": "2018-06-18T04:29:05.000Z",
51
+ "updatedAt": "2018-06-18T04:29:05.000Z"
52
+ }
53
+ ```
54
+
55
+ ## Retrieve category
56
+ Get detail of category.
57
+
58
+ See details [here](https://docs.uiza.io/?shell#retrieve-category).
59
+
60
+ ```ruby
61
+ require "uiza"
62
+
63
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
64
+ Uiza.authorization = "your-authorization"
65
+
66
+ begin
67
+ category = Uiza.retrieve_category "your-category-id"
68
+ # or category = Uiza::Category.retrieve "your-category-id"
69
+ puts category.id
70
+ puts category.name
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": "f932aa79-852a-41f7-9adc-19935034f944",
84
+ "name": "Playlist sample",
85
+ "description": "Playlist description",
86
+ "slug": "playlist-sample",
87
+ "type": "playlist",
88
+ "orderNumber": 3,
89
+ "icon": "https:///example.com/image002.png",
90
+ "status": 1,
91
+ "createdAt": "2018-06-18T04:29:05.000Z",
92
+ "updatedAt": "2018-06-18T04:29:05.000Z"
93
+ }
94
+ ```
95
+
96
+ ## Retrieve category list
97
+ Get all category.
98
+
99
+ See details [here](https://docs.uiza.io/#retrieve-category-list).
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
+ categories = Uiza.list_category
109
+ # or categories = Uiza::Category.list
110
+ puts categories.first.id
111
+ puts categories.first.name
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
+ ## Update category
122
+ Update information of category.
123
+
124
+ See details [here](https://docs.uiza.io/#update-category).
125
+
126
+ ```ruby
127
+ require "uiza"
128
+
129
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
130
+ Uiza.authorization = "your-authorization"
131
+
132
+ params = {
133
+ id: "your-category-id",
134
+ name: "Folder edited",
135
+ type: "folder"
136
+ }
137
+
138
+ begin
139
+ category = Uiza.update_category params
140
+ # or category = Uiza::Category.update params
141
+ puts category.id
142
+ puts category.name
143
+ rescue Uiza::Error::UizaError => e
144
+ puts "description_link: #{e.description_link}"
145
+ puts "code: #{e.code}"
146
+ puts "message: #{e.message}"
147
+ rescue StandardError => e
148
+ puts "message: #{e.message}"
149
+ end
150
+ ```
151
+
152
+ Example Response
153
+ ```ruby
154
+ {
155
+ "id": "f932aa79-852a-41f7-9adc-19935034f944",
156
+ "name": "Folder edited",
157
+ "description": "Playlist description",
158
+ "slug": "playlist-sample",
159
+ "type": "folder",
160
+ "orderNumber": 3,
161
+ "icon": "https:///example.com/image002.png",
162
+ "status": 1,
163
+ "createdAt": "2018-06-18T04:29:05.000Z",
164
+ "updatedAt": "2018-06-18T04:29:05.000Z"
165
+ }
166
+ ```
167
+
168
+ ## Delete category
169
+ Delete category.
170
+
171
+ See details [here](https://docs.uiza.io/#delete-category).
172
+
173
+ ```ruby
174
+ require "uiza"
175
+
176
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
177
+ Uiza.authorization = "your-authorization"
178
+
179
+ begin
180
+ category = Uiza.delete_category "your-category-id"
181
+ # or category = Uiza::Category.delete "your-category-id"
182
+ puts category.id
183
+ rescue Uiza::Error::UizaError => e
184
+ puts "description_link: #{e.description_link}"
185
+ puts "code: #{e.code}"
186
+ puts "message: #{e.message}"
187
+ rescue StandardError => e
188
+ puts "message: #{e.message}"
189
+ end
190
+ ```
191
+
192
+ Example Response
193
+ ```ruby
194
+ {
195
+ "id": "f932aa79-852a-41f7-9adc-19935034f944"
196
+ }
197
+ ```
198
+
199
+ ## Create category relation
200
+ Add relation for entity and category.
201
+
202
+ See details [here](https://docs.uiza.io/#create-category-relation).
203
+
204
+ ```ruby
205
+ require "uiza"
206
+
207
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
208
+ Uiza.authorization = "your-authorization"
209
+
210
+ params = {
211
+ entityId: "your-entity-id",
212
+ metadataIds: ["your-category-id-1", "your-category-id-2"]
213
+ }
214
+
215
+ begin
216
+ relations = Uiza.create_relation_category params
217
+ # or relations = Uiza::Category.create_relation params
218
+ puts relations.first.id
219
+ puts relations.first.entityId
220
+ rescue Uiza::Error::UizaError => e
221
+ puts "description_link: #{e.description_link}"
222
+ puts "code: #{e.code}"
223
+ puts "message: #{e.message}"
224
+ rescue StandardError => e
225
+ puts "message: #{e.message}"
226
+ end
227
+ ```
228
+
229
+ Example Response
230
+ ```ruby
231
+ [
232
+ {
233
+ "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
234
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
235
+ "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
236
+ },
237
+ {
238
+ "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
239
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
240
+ "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
241
+ }
242
+ ]
243
+ ```
244
+
245
+ ## Delete category relation
246
+ Delete relation for entity and category.
247
+
248
+ See details [here](https://docs.uiza.io/#delete-category-relation).
249
+
250
+ ```ruby
251
+ require "uiza"
252
+
253
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
254
+ Uiza.authorization = "your-authorization"
255
+
256
+ params = {
257
+ entityId: "your-entity-id",
258
+ metadataIds: ["your-category-id-1", "your-category-id-2"]
259
+ }
260
+
261
+ begin
262
+ relations = Uiza.delete_relation_category params
263
+ # or relations = Uiza::Category.delete_relation params
264
+ puts relations.first.id
265
+ puts relations.first.entityId
266
+ rescue Uiza::Error::UizaError => e
267
+ puts "description_link: #{e.description_link}"
268
+ puts "code: #{e.code}"
269
+ puts "message: #{e.message}"
270
+ rescue StandardError => e
271
+ puts "message: #{e.message}"
272
+ end
273
+ ```
274
+
275
+ Example Response
276
+ ```ruby
277
+ [
278
+ {
279
+ "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
280
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
281
+ "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
282
+ },
283
+ {
284
+ "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
285
+ "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
286
+ "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
287
+ }
288
+ ]
289
+ ```
@@ -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).
data/doc/ENTITY.md ADDED
@@ -0,0 +1,486 @@
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.create_entity params
29
+ # or entity = Uiza::Entity.create params
30
+
31
+ puts entity.id
32
+ puts entity.name
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": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
46
+ "name": "Sample Video",
47
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry",
48
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
49
+ "view": 0,
50
+ "poster": "https://example.com/picture001",
51
+ "thumbnail": "https://example.com/picture002",
52
+ "type": "vod",
53
+ "status": 1,
54
+ "duration": "237.865215",
55
+ "publishToCdn":"success",
56
+ "embedMetadata": {
57
+ "artist": "John Doe",
58
+ "album": "Album sample",
59
+ "genre": "Pop"
60
+ },
61
+ "extendMetadata": {
62
+ "movie_category":"action",
63
+ "imdb_score":8.8,
64
+ "published_year":"2018"
65
+ },
66
+ "createdAt": "2018-06-16T18:54:15.000Z",
67
+ "updatedAt": "2018-06-16T18:54:29.000Z"
68
+ }
69
+ ```
70
+
71
+ ## Retrieve entity
72
+ Get detail of entity including all information of entity.
73
+
74
+ See details [here](https://docs.uiza.io/#retrieve-an-entity).
75
+
76
+ ```ruby
77
+ require "uiza"
78
+
79
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
80
+ Uiza.authorization = "your-authorization"
81
+
82
+ begin
83
+ entity = Uiza.retrieve_entity "your-entity-id"
84
+ # or entity = Uiza::Entity.retrieve "your-entity-id"
85
+
86
+ puts entity.id
87
+ puts entity.name
88
+ rescue Uiza::Error::UizaError => e
89
+ puts "description_link: #{e.description_link}"
90
+ puts "code: #{e.code}"
91
+ puts "message: #{e.message}"
92
+ rescue StandardError => e
93
+ puts "message: #{e.message}"
94
+ end
95
+ ```
96
+
97
+ Example Response
98
+ ```ruby
99
+ {
100
+ "id": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
101
+ "name": "Sample Video",
102
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
103
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
104
+ "view": 0,
105
+ "poster": "https://example.com/picture001",
106
+ "thumbnail": "https://example.com/picture002",
107
+ "type": "vod",
108
+ "status": 1,
109
+ "duration": "237.865215",
110
+ "publishToCdn":"success",
111
+ "embedMetadata": {
112
+ "artist": "John Doe",
113
+ "album": "Album sample",
114
+ "genre": "Pop"
115
+ },
116
+ "extendMetadata": {
117
+ "movie_category":"action",
118
+ "imdb_score":8.8,
119
+ "published_year":"2018"
120
+ },
121
+ "createdAt": "2018-06-16T18:54:15.000Z",
122
+ "updatedAt": "2018-06-16T18:54:29.000Z"
123
+ }
124
+ ```
125
+
126
+ ## List all entities
127
+ Get list of entities including all detail.
128
+
129
+ See details [here](https://docs.uiza.io/#list-all-entities).
130
+
131
+ ```ruby
132
+ require "uiza"
133
+
134
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
135
+ Uiza.authorization = "your-authorization"
136
+
137
+ params = {
138
+ publishToCdn: "not-ready",
139
+ metadataId: "your-folder/playlist-id"
140
+ }
141
+
142
+ begin
143
+ entities = Uiza.list_entity params
144
+ # or entities = Uiza::Entity.list params
145
+
146
+ # params is optional
147
+ # or entities = Uiza.list_entity
148
+ # or entities = Uiza::Entity.list
149
+
150
+ puts entities.first.id
151
+ puts entities.first.name
152
+ rescue Uiza::Error::UizaError => e
153
+ puts "description_link: #{e.description_link}"
154
+ puts "code: #{e.code}"
155
+ puts "message: #{e.message}"
156
+ rescue StandardError => e
157
+ puts "message: #{e.message}"
158
+ end
159
+ ```
160
+
161
+ Example Response
162
+ ```ruby
163
+ {
164
+ "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
165
+ "name": "Sample Video 1",
166
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
167
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
168
+ "view": 0,
169
+ "poster": "https://example.com/picture001",
170
+ "thumbnail": "https://example.com/picture002",
171
+ "type": "vod",
172
+ "duration": "237.865215",
173
+ "publishToCdn":"success",
174
+ "embedMetadata": {
175
+ "artist": "John Doe",
176
+ "album": "Album sample",
177
+ "genre": "Pop"
178
+ },
179
+ "extendMetadata": {
180
+ "movie_category":"action",
181
+ "imdb_score":8.8,
182
+ "published_year":"2018"
183
+ },
184
+ "createdAt": "2018-06-22T19:20:17.000Z",
185
+ "updatedAt": "2018-06-22T19:20:17.000Z"
186
+ },
187
+ {
188
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
189
+ "name": "Sample Video 2",
190
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
191
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
192
+ "view": 0,
193
+ "poster": "https://example.com/picture001",
194
+ "thumbnail": "https://example.com/picture002",
195
+ "type": "vod",
196
+ "duration": "178.178105",
197
+ "publishToCdn":"success",
198
+ "embedMetadata": {
199
+ "artist": "John Doe",
200
+ "album": "Album sample",
201
+ "genre": "Pop"
202
+ },
203
+ "extendMetadata": {
204
+ "movie_category":"action",
205
+ "imdb_score":8.8,
206
+ "published_year":"2018"
207
+ },
208
+ "createdAt": "2018-06-22T19:16:22.000Z",
209
+ "updatedAt": "2018-06-22T19:16:22.000Z"
210
+ }
211
+ ```
212
+
213
+ ## Update entity
214
+ Update entity's information.
215
+
216
+ See details [here](https://docs.uiza.io/#update-an-entity).
217
+
218
+ ```ruby
219
+ require "uiza"
220
+
221
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
222
+ Uiza.authorization = "your-authorization"
223
+
224
+ params = {
225
+ id: "your-entity-id",
226
+ name: "Name edited"
227
+ }
228
+
229
+ begin
230
+ entity = Uiza.update_entity params
231
+ # or entity = Uiza::Entity.update params
232
+
233
+ puts entity.id
234
+ puts entity.name
235
+ rescue Uiza::Error::UizaError => e
236
+ puts "description_link: #{e.description_link}"
237
+ puts "code: #{e.code}"
238
+ puts "message: #{e.message}"
239
+ rescue StandardError => e
240
+ puts "message: #{e.message}"
241
+ end
242
+ ```
243
+
244
+ Example Response
245
+ ```ruby
246
+ {
247
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
248
+ "name": "Sample Video",
249
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
250
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
251
+ "view": 0,
252
+ "poster": "https://example.com/picture001",
253
+ "thumbnail": "https://example.com/picture002",
254
+ "type": "vod",
255
+ "duration": "178.178105",
256
+ "publishToCdn":"success",
257
+ "embedMetadata": {
258
+ "artist": "John Doe",
259
+ "album": "Album sample",
260
+ "genre": "Pop"
261
+ },
262
+ "extendMetadata": {
263
+ "movie_category":"action",
264
+ "imdb_score":8.8,
265
+ "published_year":"2018"
266
+ },
267
+ "createdAt": "2018-06-22T19:16:22.000Z",
268
+ "updatedAt": "2018-06-22T19:16:22.000Z"
269
+ }
270
+ ```
271
+
272
+ ## Delete entity
273
+ Delete entity.
274
+
275
+ See details [here](https://docs.uiza.io/#delete-an-entity).
276
+
277
+ ```ruby
278
+ require "uiza"
279
+
280
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
281
+ Uiza.authorization = "your-authorization"
282
+
283
+ begin
284
+ entity = Uiza.delete_entity "your-entity-id"
285
+ # or entity = Uiza::Entity.delete "your-entity-id"
286
+
287
+ puts entity.id
288
+ rescue Uiza::Error::UizaError => e
289
+ puts "description_link: #{e.description_link}"
290
+ puts "code: #{e.code}"
291
+ puts "message: #{e.message}"
292
+ rescue StandardError => e
293
+ puts "message: #{e.message}"
294
+ end
295
+ ```
296
+
297
+ Example Response
298
+ ```
299
+ {
300
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67"
301
+ }
302
+ ```
303
+
304
+ ## Search entity
305
+ Search entity base on keyword entered.
306
+
307
+ See details [here](https://docs.uiza.io/#search-entity).
308
+
309
+ ```ruby
310
+ require "uiza"
311
+
312
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
313
+ Uiza.authorization = "your-authorization"
314
+
315
+ begin
316
+ entities = Uiza.search_entity "your-keyword"
317
+ # or entities = Uiza::Entity.search "your-keyword"
318
+
319
+ puts entities.first.id
320
+ puts entities.first.name
321
+ rescue Uiza::Error::UizaError => e
322
+ puts "description_link: #{e.description_link}"
323
+ puts "code: #{e.code}"
324
+ puts "message: #{e.message}"
325
+ rescue StandardError => e
326
+ puts "message: #{e.message}"
327
+ end
328
+ ```
329
+
330
+ Example Response
331
+ ```ruby
332
+ {
333
+ "id": "42ceb1ab-18ef-4f2e-b076-14299756d182",
334
+ "name": "Sample Video 1",
335
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
336
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
337
+ "view": 0,
338
+ "poster": "https://example.com/picture001",
339
+ "thumbnail": "https://example.com/picture002",
340
+ "type": "vod",
341
+ "duration": "237.865215",
342
+ "publishToCdn":"success",
343
+ "embedMetadata": {
344
+ "artist": "John Doe",
345
+ "album": "Album sample",
346
+ "genre": "Pop"
347
+ },
348
+ "extendMetadata": {
349
+ "movie_category":"action",
350
+ "imdb_score":8.8,
351
+ "published_year":"2018"
352
+ },
353
+ "createdAt": "2018-06-22T19:20:17.000Z",
354
+ "updatedAt": "2018-06-22T19:20:17.000Z"
355
+ },
356
+ {
357
+ "id": "64b15996-2261-4f41-a3c4-72b652323f67",
358
+ "name": "Sample Video 2",
359
+ "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
360
+ "shortDescription": "Lorem Ipsum is simply dummy text.",
361
+ "view": 0,
362
+ "poster": "https://example.com/picture001",
363
+ "thumbnail": "https://example.com/picture002",
364
+ "type": "vod",
365
+ "duration": "178.178105",
366
+ "publishToCdn":"success",
367
+ "embedMetadata": {
368
+ "artist": "John Doe",
369
+ "album": "Album sample",
370
+ "genre": "Pop"
371
+ },
372
+ "extendMetadata": {
373
+ "movie_category":"action",
374
+ "imdb_score":8.8,
375
+ "published_year":"2018"
376
+ },
377
+ "createdAt": "2018-06-22T19:16:22.000Z",
378
+ "updatedAt": "2018-06-22T19:16:22.000Z"
379
+ }
380
+ ```
381
+
382
+ ## Publish entity to CDN
383
+ Publish entity to CDN, use for streaming.
384
+
385
+ See details [here](https://docs.uiza.io/#publish-entity-to-cdn).
386
+
387
+ ```ruby
388
+ require "uiza"
389
+
390
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
391
+ Uiza.authorization = "your-authorization"
392
+
393
+ begin
394
+ response = Uiza.publish_entity "your-entity-id"
395
+ # or entities = Uiza::Entity.publish "your-entity-id"
396
+
397
+ puts response.message
398
+ puts response.entityId
399
+ rescue Uiza::Error::UizaError => e
400
+ puts "description_link: #{e.description_link}"
401
+ puts "code: #{e.code}"
402
+ puts "message: #{e.message}"
403
+ rescue StandardError => e
404
+ puts "message: #{e.message}"
405
+ end
406
+ ```
407
+
408
+ Example Response
409
+ ```ruby
410
+ {
411
+ "message": "Your entity started publish, check process status with this entity ID",
412
+ "entityId": "42ceb1ab-18ef-4f2e-b076-14299756d182"
413
+ }
414
+ ```
415
+
416
+ ## Get status publish
417
+ Publish entity to CDN, use for streaming.
418
+
419
+ See details [here](https://docs.uiza.io/#get-status-publish).
420
+
421
+ ```ruby
422
+ require "uiza"
423
+
424
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
425
+ Uiza.authorization = "your-authorization"
426
+
427
+ begin
428
+ response = Uiza.get_status_publish_entity "your-entity-id"
429
+ # or entities = Uiza::Entity.get_status_publish "your-entity-id"
430
+
431
+ puts response.progress
432
+ puts response.status
433
+ rescue Uiza::Error::UizaError => e
434
+ puts "description_link: #{e.description_link}"
435
+ puts "code: #{e.code}"
436
+ puts "message: #{e.message}"
437
+ rescue StandardError => e
438
+ puts "message: #{e.message}"
439
+ end
440
+ ```
441
+
442
+ Example Response
443
+ ```
444
+ {
445
+ "progress": 0,
446
+ "status": "processing"
447
+ }
448
+ ```
449
+
450
+ ## Get AWS upload key
451
+ 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.
452
+
453
+ See details [here](https://docs.uiza.io/#get-aws-upload-key).
454
+
455
+ ```ruby
456
+ require "uiza"
457
+
458
+ Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
459
+ Uiza.authorization = "your-authorization"
460
+
461
+ begin
462
+ response = Uiza.get_aws_upload_key_entity
463
+ # or entities = Uiza::Entity.get_aws_upload_key
464
+
465
+ puts response.bucket_name
466
+ puts response.region_name
467
+ rescue Uiza::Error::UizaError => e
468
+ puts "description_link: #{e.description_link}"
469
+ puts "code: #{e.code}"
470
+ puts "message: #{e.message}"
471
+ rescue StandardError => e
472
+ puts "message: #{e.message}"
473
+ end
474
+ ```
475
+
476
+ Example Response
477
+ ```
478
+ {
479
+ "temp_expire_at": 1533658598,
480
+ "temp_access_id": "ASIAV*******GPHO2DTZ",
481
+ "bucket_name": "uiza****-storage-ap-southeast-1-01/upload-temp/****ff4ad74a5195f4c/",
482
+ "temp_session_token": "FQo///wEaDM3rrospITbBQ==",
483
+ "region_name": "ap-southeast-1",
484
+ "temp_access_secret": "dp****cx2mE2lZxsSq7kV++vWSL6RNatAhbqc"
485
+ }
486
+ ```