uiza 1.1.1 → 1.2.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: 6c138520bf1258148cdbbcf9539c0178e400c4caae9a69835f489f71cdcbbe0e
4
- data.tar.gz: 8d6666866e771dc11e8bef1e0d7794f0c12a2a06053cfe920537c64c4b1dd966
3
+ metadata.gz: f23fc7407a3590ab55b04ef7520be7ec172f75ab8f19e191bdc16e96bbd11500
4
+ data.tar.gz: 96a0910830247d02b9b7e2ec23d61dc90efd5b6dcfe69164bd8752682a05afd4
5
5
  SHA512:
6
- metadata.gz: 43a345233984081c0b003236656b7a5ce8cee2043ae814132794bda4f0c5fa2f04aa1e873b690205623ea2b7211f08114037bf93f51a6597c3f825ce4393e870
7
- data.tar.gz: b4ff6a137446846094ba3e38afa37b102d2c1a1b89ac97bd50e59b1a4d22c3ddc3c71970aef1fee7406d90b6fe68495b77b39a6280c93a6aa47075f532e0530f
6
+ metadata.gz: 2ad4d4a999b5f3929e2c11dcde22093daafe97b5de02b5386a535e1bc2698fa7130dd363ff103b8920d4ce87c53f2bff0e90c856d63995e2e981af7d2ff5930f
7
+ data.tar.gz: 9f2e73ef4bee92d1095dd9c08155b31bc9b02b908086e70cc8902112c7831c738b55aee1a87482da89b8e9708b38d23470b9e442e862ff54f3df3bac38c80166
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 - 2019-03-28
4
+ [#151](https://github.com/uizaio/api-wrapper-ruby/pull/151) Release Sprint 5
5
+ 1. Upgrade API v3 to API v4
6
+
3
7
  ## 1.1.0 - 2019-03-07
4
8
  [#89](https://github.com/uizaio/api-wrapper-ruby/pull/89) Release Sprint 4
5
9
  1. Add User
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uiza (1.1.1)
4
+ uiza (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # Uiza
2
2
 
3
3
  ## Introduction
4
- This is documents the public API for Uiza version 3.0.
4
+ This is documents the public API for Uiza version 4.0.
5
+
6
+ See documents for public API for Uiza version 3.0 [here](https://github.com/uizaio/api-wrapper-ruby/tree/master_v3). Please use gem `uiza` version 1.1.0 to use API v3
5
7
 
6
8
  The Uiza API is organized around RESTful standard.
7
9
  Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors.
@@ -49,7 +51,7 @@ See details [here](https://docs.uiza.io/#authentication).
49
51
  ## Ruby
50
52
  ```ruby
51
53
  require "uiza"
52
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
54
+ Uiza.app_id = "your-app-id"
53
55
  Uiza.authorization = "your-authorization"
54
56
  ```
55
57
 
@@ -57,14 +59,14 @@ Uiza.authorization = "your-authorization"
57
59
  Create file `your-app/config/initializers/uiza.rb`
58
60
 
59
61
  ```ruby
60
- Uiza.workspace_api_domain = ENV["WORKSPACE_API_DOMAIN"]
62
+ Uiza.app_id = ENV["APP_ID"]
61
63
  Uiza.authorization = ENV["AUTHORIZATION"]
62
64
  ```
63
65
 
64
66
  ## Entity
65
67
  These below APIs used to take action with your media files (we called Entity).
66
68
 
67
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/ENTITY.md).
69
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/ENTITY.md).
68
70
 
69
71
  ```ruby
70
72
  begin
@@ -83,12 +85,12 @@ end
83
85
  ## Category
84
86
  Category has been splits into 3 types: `folder`, `playlist` and `tag`. These will make the management of entity more easier.
85
87
 
86
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/CATEGORY.md).
88
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/CATEGORY.md).
87
89
 
88
90
  ```ruby
89
91
  require "uiza"
90
92
 
91
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
93
+ Uiza.app_id = "your-app-id"
92
94
  Uiza.authorization = "your-authorization"
93
95
 
94
96
  begin
@@ -108,7 +110,7 @@ end
108
110
  You can add your storage (`FTP`, `AWS S3`) with UIZA.
109
111
  After synced, you can select your content easier from your storage to [create entity](https://docs.uiza.io/#create-entity).
110
112
 
111
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/STORAGE.md).
113
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/STORAGE.md).
112
114
 
113
115
  ```ruby
114
116
  require "json"
@@ -134,12 +136,12 @@ These APIs used to create and manage live streaming event.
134
136
  * When a Live is not start : it's named as `Event`.
135
137
  * When have an `Event` , you can start it : it's named as `Feed`.
136
138
 
137
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/LIVE_STREAMING.md).
139
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/LIVE.md).
138
140
 
139
141
  ```ruby
140
142
  require "json"
141
143
 
142
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
144
+ Uiza.app_id = "your-app-id"
143
145
  Uiza.authorization = "your-authorization"
144
146
 
145
147
  begin
@@ -158,16 +160,16 @@ end
158
160
  ## Callback
159
161
  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
162
 
161
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/CALLBACK.md).
163
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/CALLBACK.md).
162
164
 
163
165
  ```ruby
164
166
  require "json"
165
167
 
166
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
168
+ Uiza.app_id = "your-app-id"
167
169
  Uiza.authorization = "your-authorization"
168
170
 
169
171
  begin
170
- callback = Uiza::Live.retrieve "your-callback-id"
172
+ callback = Uiza::Callback.retrieve "your-callback-id"
171
173
  puts callback.id
172
174
  puts callback.url
173
175
  rescue Uiza::Error::UizaError => e
@@ -184,15 +186,13 @@ You can manage user with APIs user. Uiza have 2 levels of user:
184
186
  Admin - This account will have the highest priority, can have permission to create & manage users.
185
187
  User - This account level is under Admin level. It only manages APIs that relates to this account.
186
188
 
187
- See details [here](https://docs.uiza.io/#user-management).
189
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/develop/doc/USER.md).
188
190
 
189
- ```ruby
191
+ ```ruby
190
192
  require "json"
191
-
192
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
193
+ Uiza.app_id = "your-app-id"
193
194
  Uiza.authorization = "your-authorization"
194
-
195
- begin
195
+ begin
196
196
  user = Uiza::User.retrieve "your-user-id"
197
197
  puts user.id
198
198
  puts user.username
@@ -205,42 +205,10 @@ rescue StandardError => e
205
205
  end
206
206
  ```
207
207
 
208
- ## Analytic
209
- Monitor the four key dimensions of video QoS: playback failures, startup time, rebuffering, and video quality.
210
- These 15 metrics help you track playback performance, so your team can know exactly what’s going on.
211
-
212
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/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
- ```
239
-
240
208
  ## Embed Metadata
241
209
  Embed metadata is information that can be embed into video/audio file. You can embed into file by adding a json compose these tag.
242
210
 
243
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/EMBED_METADATA.md).
211
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/EMBED_METADATA.md).
244
212
 
245
213
  ## Errors Code
246
214
  Uiza uses conventional HTTP response codes to indicate the success or failure of an API request.
@@ -248,7 +216,7 @@ In general: Codes in the `2xx` range indicate success.
248
216
  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.).
249
217
  Codes in the `5xx` range indicate an error with Uiza's servers.
250
218
 
251
- See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/doc/ERRORS_CODE.md).
219
+ See details [here](https://github.com/uizaio/api-wrapper-ruby/blob/master/doc/ERRORS_CODE.md).
252
220
 
253
221
  ## Development
254
222
  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.
@@ -271,4 +239,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/uizaio
271
239
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
272
240
 
273
241
  ## Code of Conduct
274
- Everyone interacting in the Uiza project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/uizaio/api-wrapper-ruby/blob/master_v3/CODE_OF_CONDUCT.md).
242
+ Everyone interacting in the Uiza project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/uizaio/api-wrapper-ruby/blob/master/CODE_OF_CONDUCT.md).
@@ -1,17 +1,17 @@
1
1
  ## Callback
2
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
3
 
4
- See details [here](https://docs.uiza.io/#callback).
4
+ See details [here](https://docs.uiza.io/v4/#callback).
5
5
 
6
6
  ## Create a callback
7
7
  This API will allow you setup a callback to your server when an entity is completed for upload or public
8
8
 
9
- See details [here](https://docs.uiza.io/#create-a-callback).
9
+ See details [here](https://docs.uiza.io/v4/#create-a-callback).
10
10
 
11
11
  ```ruby
12
12
  require "uiza"
13
13
 
14
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
14
+ Uiza.app_id = "your-app-id"
15
15
  Uiza.authorization = "your-authorization"
16
16
 
17
17
  params = {
@@ -33,28 +33,38 @@ end
33
33
  ```
34
34
 
35
35
  Example Response
36
- ```ruby
36
+ ```json
37
37
  {
38
- "id": "0a6bf245-1cce-494f-a193-b5a44aa05558",
39
- "url": "https://callback-url.uiza.co",
40
- "headersData": null,
41
- "jsonData": null,
42
- "method": "POST",
43
- "status": 1,
44
- "createdAt": "2018-06-23T01:27:08.000Z",
45
- "updatedAt": "2018-06-23T01:27:08.000Z"
38
+ "data": {
39
+ "id": "37b3b1fe-c73d-4a7c-8e6b-108d6a251b7b",
40
+ "url": "https://61b2923c-b7fd-4186-ac7d-cb4bbd6480e0.uiza.co",
41
+ "headersData": nil,
42
+ "jsonData": nil,
43
+ "method": "POST",
44
+ "status": 1,
45
+ "createdAt": "2019-03-13T09:32:39.000Z",
46
+ "updatedAt": "0000-00-00 00:00:00"
47
+ },
48
+ "version": 4,
49
+ "datetime": "2019-03-13T12:36:37.811Z",
50
+ "policy": "public",
51
+ "requestId": "7f8931e6-4d5b-459d-b107-94043494516a",
52
+ "serviceName": "api-v4",
53
+ "message": "OK",
54
+ "code": 200,
55
+ "type": "SUCCESS"
46
56
  }
47
57
  ```
48
58
 
49
59
  ## Retrieve a callback
50
60
  Retrieves the details of an existing callback.
51
61
 
52
- See details [here](https://docs.uiza.io/#retrieve-a-callback).
62
+ See details [here](https://docs.uiza.io/v4/#retrieve-a-callback).
53
63
 
54
64
  ```ruby
55
65
  require "uiza"
56
66
 
57
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
67
+ Uiza.app_id = "your-app-id"
58
68
  Uiza.authorization = "your-authorization"
59
69
 
60
70
  begin
@@ -71,30 +81,38 @@ end
71
81
  ```
72
82
 
73
83
  Example Response
74
- ```ruby
84
+ ```json
75
85
  {
76
- "id": "0a6bf245-1cce-494f-a193-b5a44aa05558",
77
- "url": "https://callback-url.uiza.co",
78
- "headersData": null,
79
- "jsonData": {
80
- "text": "example callback"
86
+ "data": {
87
+ "id": "37b3b1fe-c73d-4a7c-8e6b-108d6a251b7b",
88
+ "url": "https://61b2923c-b7fd-4186-ac7d-cb4bbd6480e0.uiza.co",
89
+ "headersData": nil,
90
+ "jsonData": nil,
91
+ "method": "POST",
92
+ "status": 1,
93
+ "createdAt": "2019-03-13T09:32:39.000Z",
94
+ "updatedAt": "0000-00-00 00:00:00"
81
95
  },
82
- "method": "POST",
83
- "status": 1,
84
- "createdAt": "2018-06-23T01:27:08.000Z",
85
- "updatedAt": "2018-06-23T01:27:08.000Z"
96
+ "version": 4,
97
+ "datetime": "2019-03-13T12:36:37.811Z",
98
+ "policy": "public",
99
+ "requestId": "7f8931e6-4d5b-459d-b107-94043494516a",
100
+ "serviceName": "api-v4",
101
+ "message": "OK",
102
+ "code": 200,
103
+ "type": "SUCCESS"
86
104
  }
87
105
  ```
88
106
 
89
107
  ## Update a callback
90
108
  This API will allow you setup a callback to your server when an entity is completed for upload or public
91
109
 
92
- See details [here](https://docs.uiza.io/#update-a-callback).
110
+ See details [here](https://docs.uiza.io/v4/#update-a-callback).
93
111
 
94
112
  ```ruby
95
113
  require "uiza"
96
114
 
97
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
115
+ Uiza.app_id = "your-app-id"
98
116
  Uiza.authorization = "your-authorization"
99
117
 
100
118
  params = {
@@ -117,28 +135,38 @@ end
117
135
  ```
118
136
 
119
137
  Example Response
120
- ```ruby
138
+ ```json
121
139
  {
122
- "id": "your-callback-id",
123
- "url": "https://callback-url.uiza.co",
124
- "headersData": null,
125
- "jsonData": null,
126
- "method": "GET",
127
- "status": 1,
128
- "createdAt": "2018-06-23T01:27:08.000Z",
129
- "updatedAt": "2018-06-23T01:27:08.000Z"
140
+ "data": {
141
+ "id": "37b3b1fe-c73d-4a7c-8e6b-108d6a251b7b",
142
+ "url": "https://update-callback-url.uiza.co",
143
+ "headersData": nil,
144
+ "jsonData": nil,
145
+ "method": "POST",
146
+ "status": 1,
147
+ "createdAt": "2019-03-13T09:32:39.000Z",
148
+ "updatedAt": "0000-00-00 00:00:00"
149
+ },
150
+ "version": 4,
151
+ "datetime": "2019-03-13T12:39:35.619Z",
152
+ "policy": "public",
153
+ "requestId": "c3ad45c8-d022-4dbe-8161-5c140ea2ea7f",
154
+ "serviceName": "api-v4",
155
+ "message": "OK",
156
+ "code": 200,
157
+ "type": "SUCCESS"
130
158
  }
131
159
  ```
132
160
 
133
161
  ## Delete a callback
134
162
  Delete an existing callback.
135
163
 
136
- See details [here](https://docs.uiza.io/#delete-a-callback).
164
+ See details [here](https://docs.uiza.io/v4/#delete-a-callback).
137
165
 
138
166
  ```ruby
139
167
  require "uiza"
140
168
 
141
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
169
+ Uiza.app_id = "your-app-id"
142
170
  Uiza.authorization = "your-authorization"
143
171
 
144
172
  begin
@@ -154,8 +182,18 @@ end
154
182
  ```
155
183
 
156
184
  Example Response
157
- ```ruby
185
+ ```json
158
186
  {
159
- "id": "your-callback-id"
187
+ "data": {
188
+ "id": "37b3b1fe-c73d-4a7c-8e6b-108d6a251b7b"
189
+ },
190
+ "version": 4,
191
+ "datetime": "2019-03-13T12:41:10.784Z",
192
+ "policy": "public",
193
+ "requestId": "4b89d46a-c7e4-4f97-8ebb-fb5b769b7fda",
194
+ "serviceName": "api-v4",
195
+ "message": "OK",
196
+ "code": 200,
197
+ "type": "SUCCESS"
160
198
  }
161
199
  ```
@@ -2,24 +2,28 @@
2
2
  Category has been splits into 3 types: folder, playlist and tag.
3
3
  These will make the management of entity more easier.
4
4
 
5
- See details [here](https://docs.uiza.io/#category).
5
+ See details [here](https://docs.uiza.io/v4/#categorization).
6
6
 
7
7
  ## Create category
8
8
  Create category for entity for easier management.
9
9
  Category use to group all the same entities into a group (like `Folder`/`playlist` or `tag`).
10
10
 
11
- See details [here](https://docs.uiza.io/#create-category).
11
+ See details [here](https://docs.uiza.io/v4/#create-category).
12
12
 
13
13
  ```ruby
14
14
  require "uiza"
15
15
 
16
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
16
+ Uiza.app_id = "your-app-id"
17
17
  Uiza.authorization = "your-authorization"
18
18
 
19
19
  params = {
20
20
  name: "Folder sample",
21
21
  type: "folder",
22
- description: "Folder description"
22
+ description: "Folder description",
23
+ orderNumber: 1,
24
+ icon: "https://exemple.com/icon.png",
25
+ slug: "Azx12da",
26
+ status: 1
23
27
  }
24
28
 
25
29
  begin
@@ -36,30 +40,40 @@ end
36
40
  ```
37
41
 
38
42
  Example Response
39
- ```ruby
43
+ ```json
40
44
  {
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"
45
+ "data": {
46
+ "id": "b62c676a-7370-4d57-960f-ff77cf3d8739",
47
+ "name": "Folder sample",
48
+ "description": "Folder description",
49
+ "slug": "azx12da",
50
+ "type": "folder",
51
+ "orderNumber": 1,
52
+ "icon": "https://exemple.com/icon.png",
53
+ "status": 1,
54
+ "createdAt": "2019-03-13T10:45:26.000Z",
55
+ "updatedAt": "0000-00-00 00:00:00"
56
+ },
57
+ "version": 4,
58
+ "datetime": "2019-03-13T10:45:26.237Z",
59
+ "policy": "public",
60
+ "requestId": "85b8dc0b-6b0b-42e8-ab70-ab9771e21d4a",
61
+ "serviceName": "api-v4",
62
+ "message": "OK",
63
+ "code": 200,
64
+ "type": "SUCCESS"
51
65
  }
52
66
  ```
53
67
 
54
68
  ## Retrieve category
55
69
  Get detail of category.
56
70
 
57
- See details [here](https://docs.uiza.io/?shell#retrieve-category).
71
+ See details [here](https://docs.uiza.io/v4/#retrieve-category).
58
72
 
59
73
  ```ruby
60
74
  require "uiza"
61
75
 
62
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
76
+ Uiza.app_id = "your-app-id"
63
77
  Uiza.authorization = "your-authorization"
64
78
 
65
79
  begin
@@ -76,34 +90,51 @@ end
76
90
  ```
77
91
 
78
92
  Example Response
79
- ```ruby
93
+ ```json
80
94
  {
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"
95
+ "data": {
96
+ "id": "b62c676a-7370-4d57-960f-ff77cf3d8739",
97
+ "name": "Folder sample",
98
+ "description": "Folder description",
99
+ "slug": "azx12da",
100
+ "type": "folder",
101
+ "orderNumber": 1,
102
+ "icon": "https://exemple.com/icon.png",
103
+ "status": 1,
104
+ "createdAt": "2019-03-13T10:45:26.000Z",
105
+ "updatedAt": "0000-00-00 00:00:00"
106
+ },
107
+ "version": 4,
108
+ "datetime": "2019-03-13T10:48:50.499Z",
109
+ "policy": "public",
110
+ "requestId": "bad8b2ca-ebf3-4815-9f1b-952ec394175c",
111
+ "serviceName": "api-v4",
112
+ "message": "OK",
113
+ "code": 200,
114
+ "type": "SUCCESS"
91
115
  }
92
116
  ```
93
117
 
94
118
  ## Retrieve category list
95
119
  Get all category.
96
120
 
97
- See details [here](https://docs.uiza.io/#retrieve-category-list).
121
+ See details [here](https://docs.uiza.io/v4/#list-categories).
98
122
 
99
123
  ```ruby
100
124
  require "uiza"
101
125
 
102
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
126
+ Uiza.app_id = "your-app-id"
103
127
  Uiza.authorization = "your-authorization"
104
128
 
129
+ params = {
130
+ page: 1,
131
+ limit: 10
132
+ }
133
+
105
134
  begin
106
- categories = Uiza::Category.list
135
+ categories = Uiza::Category.list params
136
+ # params is optional
137
+ # or entities = Uiza::Category.list
107
138
  puts categories.first.id
108
139
  puts categories.first.name
109
140
  rescue Uiza::Error::UizaError => e
@@ -116,50 +147,65 @@ end
116
147
  ```
117
148
 
118
149
  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"
150
+ ```json
151
+ {
152
+ "data": [
153
+ {
154
+ "id": "b62c676a-7370-4d57-960f-ff77cf3d8739",
155
+ "name": "Folder sample",
156
+ "description": "Folder description",
157
+ "slug": "azx12da",
158
+ "type": "folder",
159
+ "orderNumber": 1,
160
+ "icon": "https://exemple.com/icon.png",
161
+ "status": 1,
162
+ "createdAt": "2019-03-13T10:45:26.000Z",
163
+ "updatedAt": "0000-00-00 00:00:00"
164
+ },
165
+ {
166
+ "id": "dcaec097-7c2a-4792-9e20-727926ec6b3b",
167
+ "name": "Folder sample",
168
+ "description": "Folder description",
169
+ "slug": "folder-sample",
170
+ "type": "folder",
171
+ "orderNumber": 0,
172
+ "icon": nil,
173
+ "status": 1,
174
+ "createdAt": "2019-03-13T10:41:28.000Z",
175
+ "updatedAt": "0000-00-00 00:00:00"
176
+ }
177
+ ],
178
+ "metadata": {
179
+ "total": 2,
180
+ "result": 2,
181
+ "page": 1,
182
+ "limit": 20
132
183
  },
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
- ]
184
+ "version": 4,
185
+ "datetime": "2019-03-13T10:50:37.024Z",
186
+ "policy": "public",
187
+ "requestId": "0ad6ec82-7ff1-4bf4-87bb-28ea84f1055c",
188
+ "serviceName": "api-v4",
189
+ "message": "OK",
190
+ "code": 200,
191
+ "type": "SUCCESS"
192
+ }
146
193
  ```
147
194
 
148
195
  ## Update category
149
196
  Update information of category.
150
197
 
151
- See details [here](https://docs.uiza.io/#update-category).
198
+ See details [here](https://docs.uiza.io/v4/#update-a-category).
152
199
 
153
200
  ```ruby
154
201
  require "uiza"
155
202
 
156
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
203
+ Uiza.app_id = "your-app-id"
157
204
  Uiza.authorization = "your-authorization"
158
205
 
159
206
  params = {
160
207
  id: "your-category-id",
161
- name: "Folder edited",
162
- type: "folder"
208
+ name: "Folder sample edited"
163
209
  }
164
210
 
165
211
  begin
@@ -176,30 +222,40 @@ end
176
222
  ```
177
223
 
178
224
  Example Response
179
- ```ruby
225
+ ```json
180
226
  {
181
- "id": "f932aa79-852a-41f7-9adc-19935034f944",
182
- "name": "Folder edited",
183
- "description": "Playlist description",
184
- "slug": "playlist-sample",
185
- "type": "folder",
186
- "orderNumber": 3,
187
- "icon": "https:///example.com/image002.png",
188
- "status": 1,
189
- "createdAt": "2018-06-18T04:29:05.000Z",
190
- "updatedAt": "2018-06-18T04:29:05.000Z"
227
+ "data": {
228
+ "id": "b62c676a-7370-4d57-960f-ff77cf3d8739",
229
+ "name": "Folder sample edited",
230
+ "description": "Folder description",
231
+ "slug": "folder-sample-edited",
232
+ "type": "folder",
233
+ "orderNumber": 1,
234
+ "icon": "https://exemple.com/icon.png",
235
+ "status": 1,
236
+ "createdAt": "2019-03-13T10:45:26.000Z",
237
+ "updatedAt": "0000-00-00 00:00:00"
238
+ },
239
+ "version": 4,
240
+ "datetime": "2019-03-13T10:55:23.462Z",
241
+ "policy": "public",
242
+ "requestId": "65a2d0fc-b3aa-42eb-b93b-edbb52286691",
243
+ "serviceName": "api-v4",
244
+ "message": "OK",
245
+ "code": 200,
246
+ "type": "SUCCESS"
191
247
  }
192
248
  ```
193
249
 
194
250
  ## Delete category
195
251
  Delete category.
196
252
 
197
- See details [here](https://docs.uiza.io/#delete-category).
253
+ See details [here](https://docs.uiza.io/v4/#delete-a-category).
198
254
 
199
255
  ```ruby
200
256
  require "uiza"
201
257
 
202
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
258
+ Uiza.app_id = "your-app-id"
203
259
  Uiza.authorization = "your-authorization"
204
260
 
205
261
  begin
@@ -215,21 +271,31 @@ end
215
271
  ```
216
272
 
217
273
  Example Response
218
- ```ruby
274
+ ```json
219
275
  {
220
- "id": "f932aa79-852a-41f7-9adc-19935034f944"
276
+ "data": {
277
+ "id": "b62c676a-7370-4d57-960f-ff77cf3d8739"
278
+ },
279
+ "version": 4,
280
+ "datetime": "2019-03-13T10:58:05.997Z",
281
+ "policy": "public",
282
+ "requestId": "35b0f8c0-22b7-4bea-bdab-38ce6457b306",
283
+ "serviceName": "api-v4",
284
+ "message": "OK",
285
+ "code": 200,
286
+ "type": "SUCCESS"
221
287
  }
222
288
  ```
223
289
 
224
290
  ## Create category relation
225
291
  Add relation for entity and category.
226
292
 
227
- See details [here](https://docs.uiza.io/#create-category-relation).
293
+ See details [here](https://docs.uiza.io/v4/#create-category-relation).
228
294
 
229
295
  ```ruby
230
296
  require "uiza"
231
297
 
232
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
298
+ Uiza.app_id = "your-app-id"
233
299
  Uiza.authorization = "your-authorization"
234
300
 
235
301
  params = {
@@ -251,30 +317,46 @@ end
251
317
  ```
252
318
 
253
319
  Example Response
254
- ```ruby
255
- [
256
- {
257
- "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
258
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
259
- "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
320
+ ```json
321
+ {
322
+ "data": [
323
+ {
324
+ "id": "ac48b2e3-421f-4362-b46a-d217834acc78",
325
+ "entityId": "ed9f5057-b05a-4499-92b4-d3cdba76d0ec",
326
+ "metadataId": "a257d0b7-4a58-44ac-b2ff-0cb26006daa4"
327
+ },
328
+ {
329
+ "id": "c1a9e68a-f1de-4a51-b625-03211fdec4fb",
330
+ "entityId": "ed9f5057-b05a-4499-92b4-d3cdba76d0ec",
331
+ "metadataId": "95b75a92-bd82-4b1f-8925-044caccc6663"
332
+ }
333
+ ],
334
+ "metadata": {
335
+ "total": 2,
336
+ "result": 2,
337
+ "page": 1,
338
+ "limit": 20
260
339
  },
261
- {
262
- "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
263
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
264
- "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
265
- }
266
- ]
340
+ "version": 4,
341
+ "datetime": "2019-03-13T11:03:36.482Z",
342
+ "policy": "public",
343
+ "requestId": "d38329d2-a3bb-4444-ae91-af388316967f",
344
+ "serviceName": "api-v4",
345
+ "message": "OK",
346
+ "code": 200,
347
+ "type": "SUCCESS"
348
+ }
267
349
  ```
268
350
 
269
351
  ## Delete category relation
270
352
  Delete relation for entity and category.
271
353
 
272
- See details [here](https://docs.uiza.io/#delete-category-relation).
354
+ See details [here](https://docs.uiza.io/v4/#delete-category-relation).
273
355
 
274
356
  ```ruby
275
357
  require "uiza"
276
358
 
277
- Uiza.workspace_api_domain = "your-workspace-api-domain.uiza.co"
359
+ Uiza.app_id = "your-app-id"
278
360
  Uiza.authorization = "your-authorization"
279
361
 
280
362
  params = {
@@ -296,17 +378,33 @@ end
296
378
  ```
297
379
 
298
380
  Example Response
299
- ```ruby
300
- [
301
- {
302
- "id": "5620ed3c-b725-4a9a-8ec1-ecc9df3e5aa6",
303
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
304
- "metadataId": "095778fa-7e42-45cc-8a0e-6118e540b61d"
381
+ ```json
382
+ {
383
+ "data": [
384
+ {
385
+ "id": "ac48b2e3-421f-4362-b46a-d217834acc78",
386
+ "entityId": "ed9f5057-b05a-4499-92b4-d3cdba76d0ec",
387
+ "metadataId": "a257d0b7-4a58-44ac-b2ff-0cb26006daa4"
388
+ },
389
+ {
390
+ "id": "c1a9e68a-f1de-4a51-b625-03211fdec4fb",
391
+ "entityId": "ed9f5057-b05a-4499-92b4-d3cdba76d0ec",
392
+ "metadataId": "95b75a92-bd82-4b1f-8925-044caccc6663"
393
+ }
394
+ ],
395
+ "metadata": {
396
+ "total": 2,
397
+ "result": 2,
398
+ "page": 1,
399
+ "limit": 20
305
400
  },
306
- {
307
- "id": "47209e60-a99f-4c96-99fb-be4f858481b4",
308
- "entityId": "16ab25d3-fd0f-4568-8aa0-0339bbfd674f",
309
- "metadataId": "e00586b9-032a-46a3-af71-d275f01b03cf"
310
- }
311
- ]
401
+ "version": 4,
402
+ "datetime": "2019-03-13T11:05:19.156Z",
403
+ "policy": "public",
404
+ "requestId": "52b847af-f620-46c0-8673-a00ebbb59f31",
405
+ "serviceName": "api-v4",
406
+ "message": "OK",
407
+ "code": 200,
408
+ "type": "SUCCESS"
409
+ }
312
410
  ```