ittybit 0.8.6 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ittybit/automations/client.rb +34 -32
- data/lib/ittybit/files/client.rb +34 -32
- data/lib/ittybit/media/client.rb +34 -32
- data/lib/ittybit/signatures/client.rb +4 -4
- data/lib/ittybit/tasks/client.rb +28 -22
- data/lib/ittybit.rb +10 -10
- data/lib/requests.rb +30 -30
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3e62b752b4501016cddd19e889b0bd60fe947774c99ab0ab5b577fd839ffdbb
|
4
|
+
data.tar.gz: 48882dd0bab725a2ac33ce722a6167437784c0b0b36a4648d172c6f991c811cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9289acda5c97a93de7adc5ac7acaf1965518dd64ac148d8895d996b4754c785e5f50381508448ab0fe5845bd24d079a9d343703f2cfe301ef490600829a955f9
|
7
|
+
data.tar.gz: ff0896814c3ca512aefcd99a4d4c2f33cbc41a1134231b9d40be545f38819e6f9eb7ef15a427737d820e6df2fcee8973bb3adfc36e9530cfdb3bdf1391d2eda1
|
@@ -22,8 +22,9 @@ module Ittybit
|
|
22
22
|
@request_client = request_client
|
23
23
|
end
|
24
24
|
|
25
|
-
# Retrieves a paginated list of all automations for the current project
|
25
|
+
# Retrieves a paginated list of all automations for the current project.
|
26
26
|
#
|
27
|
+
# @param page [Integer]
|
27
28
|
# @param limit [Integer]
|
28
29
|
# @param request_options [Ittybit::RequestOptions]
|
29
30
|
# @return [Ittybit::AutomationListResponse]
|
@@ -31,20 +32,20 @@ module Ittybit
|
|
31
32
|
# api = Ittybit::Client.new(
|
32
33
|
# base_url: "https://api.example.com",
|
33
34
|
# environment: Ittybit::Environment::DEFAULT,
|
34
|
-
#
|
35
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
35
36
|
# )
|
36
37
|
# api.automations.list
|
37
|
-
def list(limit: nil, request_options: nil)
|
38
|
+
def list(page: nil, limit: nil, request_options: nil)
|
38
39
|
response = @request_client.conn.get do |req|
|
39
40
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
40
|
-
req.headers["Authorization"] = request_options.
|
41
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
41
42
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
42
43
|
req.headers = {
|
43
44
|
**(req.headers || {}),
|
44
45
|
**@request_client.get_headers,
|
45
46
|
**(request_options&.additional_headers || {})
|
46
47
|
}.compact
|
47
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
48
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
48
49
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
49
50
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
50
51
|
end
|
@@ -71,7 +72,7 @@ module Ittybit
|
|
71
72
|
# api = Ittybit::Client.new(
|
72
73
|
# base_url: "https://api.example.com",
|
73
74
|
# environment: Ittybit::Environment::DEFAULT,
|
74
|
-
#
|
75
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
75
76
|
# )
|
76
77
|
# api.automations.create(
|
77
78
|
# name: "My Example Automation",
|
@@ -83,7 +84,7 @@ module Ittybit
|
|
83
84
|
def create(trigger:, workflow:, name: nil, description: nil, status: nil, request_options: nil)
|
84
85
|
response = @request_client.conn.post do |req|
|
85
86
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
86
|
-
req.headers["Authorization"] = request_options.
|
87
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
87
88
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
88
89
|
req.headers = {
|
89
90
|
**(req.headers || {}),
|
@@ -115,13 +116,13 @@ module Ittybit
|
|
115
116
|
# api = Ittybit::Client.new(
|
116
117
|
# base_url: "https://api.example.com",
|
117
118
|
# environment: Ittybit::Environment::DEFAULT,
|
118
|
-
#
|
119
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
119
120
|
# )
|
120
|
-
# api.automations.get(id: "
|
121
|
+
# api.automations.get(id: "auto_abcdefgh1234")
|
121
122
|
def get(id:, request_options: nil)
|
122
123
|
response = @request_client.conn.get do |req|
|
123
124
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
124
|
-
req.headers["Authorization"] = request_options.
|
125
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
125
126
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
126
127
|
req.headers = {
|
127
128
|
**(req.headers || {}),
|
@@ -148,13 +149,13 @@ module Ittybit
|
|
148
149
|
# api = Ittybit::Client.new(
|
149
150
|
# base_url: "https://api.example.com",
|
150
151
|
# environment: Ittybit::Environment::DEFAULT,
|
151
|
-
#
|
152
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
152
153
|
# )
|
153
|
-
# api.automations.delete(id: "
|
154
|
+
# api.automations.delete(id: "auto_abcdefgh1234")
|
154
155
|
def delete(id:, request_options: nil)
|
155
156
|
response = @request_client.conn.delete do |req|
|
156
157
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
157
|
-
req.headers["Authorization"] = request_options.
|
158
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
158
159
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
159
160
|
req.headers = {
|
160
161
|
**(req.headers || {}),
|
@@ -192,10 +193,10 @@ module Ittybit
|
|
192
193
|
# api = Ittybit::Client.new(
|
193
194
|
# base_url: "https://api.example.com",
|
194
195
|
# environment: Ittybit::Environment::DEFAULT,
|
195
|
-
#
|
196
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
196
197
|
# )
|
197
198
|
# api.automations.update(
|
198
|
-
# id: "
|
199
|
+
# id: "auto_abcdefgh1234",
|
199
200
|
# name: "My Updated Automation",
|
200
201
|
# workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
|
201
202
|
# status: ACTIVE
|
@@ -203,7 +204,7 @@ module Ittybit
|
|
203
204
|
def update(id:, name: nil, description: nil, trigger: nil, workflow: nil, status: nil, request_options: nil)
|
204
205
|
response = @request_client.conn.patch do |req|
|
205
206
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
206
|
-
req.headers["Authorization"] = request_options.
|
207
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
207
208
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
208
209
|
req.headers = {
|
209
210
|
**(req.headers || {}),
|
@@ -237,8 +238,9 @@ module Ittybit
|
|
237
238
|
@request_client = request_client
|
238
239
|
end
|
239
240
|
|
240
|
-
# Retrieves a paginated list of all automations for the current project
|
241
|
+
# Retrieves a paginated list of all automations for the current project.
|
241
242
|
#
|
243
|
+
# @param page [Integer]
|
242
244
|
# @param limit [Integer]
|
243
245
|
# @param request_options [Ittybit::RequestOptions]
|
244
246
|
# @return [Ittybit::AutomationListResponse]
|
@@ -246,21 +248,21 @@ module Ittybit
|
|
246
248
|
# api = Ittybit::Client.new(
|
247
249
|
# base_url: "https://api.example.com",
|
248
250
|
# environment: Ittybit::Environment::DEFAULT,
|
249
|
-
#
|
251
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
250
252
|
# )
|
251
253
|
# api.automations.list
|
252
|
-
def list(limit: nil, request_options: nil)
|
254
|
+
def list(page: nil, limit: nil, request_options: nil)
|
253
255
|
Async do
|
254
256
|
response = @request_client.conn.get do |req|
|
255
257
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
256
|
-
req.headers["Authorization"] = request_options.
|
258
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
257
259
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
258
260
|
req.headers = {
|
259
261
|
**(req.headers || {}),
|
260
262
|
**@request_client.get_headers,
|
261
263
|
**(request_options&.additional_headers || {})
|
262
264
|
}.compact
|
263
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
265
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
264
266
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
265
267
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
266
268
|
end
|
@@ -288,7 +290,7 @@ module Ittybit
|
|
288
290
|
# api = Ittybit::Client.new(
|
289
291
|
# base_url: "https://api.example.com",
|
290
292
|
# environment: Ittybit::Environment::DEFAULT,
|
291
|
-
#
|
293
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
292
294
|
# )
|
293
295
|
# api.automations.create(
|
294
296
|
# name: "My Example Automation",
|
@@ -301,7 +303,7 @@ module Ittybit
|
|
301
303
|
Async do
|
302
304
|
response = @request_client.conn.post do |req|
|
303
305
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
304
|
-
req.headers["Authorization"] = request_options.
|
306
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
305
307
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
306
308
|
req.headers = {
|
307
309
|
**(req.headers || {}),
|
@@ -334,14 +336,14 @@ module Ittybit
|
|
334
336
|
# api = Ittybit::Client.new(
|
335
337
|
# base_url: "https://api.example.com",
|
336
338
|
# environment: Ittybit::Environment::DEFAULT,
|
337
|
-
#
|
339
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
338
340
|
# )
|
339
|
-
# api.automations.get(id: "
|
341
|
+
# api.automations.get(id: "auto_abcdefgh1234")
|
340
342
|
def get(id:, request_options: nil)
|
341
343
|
Async do
|
342
344
|
response = @request_client.conn.get do |req|
|
343
345
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
344
|
-
req.headers["Authorization"] = request_options.
|
346
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
345
347
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
346
348
|
req.headers = {
|
347
349
|
**(req.headers || {}),
|
@@ -369,14 +371,14 @@ module Ittybit
|
|
369
371
|
# api = Ittybit::Client.new(
|
370
372
|
# base_url: "https://api.example.com",
|
371
373
|
# environment: Ittybit::Environment::DEFAULT,
|
372
|
-
#
|
374
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
373
375
|
# )
|
374
|
-
# api.automations.delete(id: "
|
376
|
+
# api.automations.delete(id: "auto_abcdefgh1234")
|
375
377
|
def delete(id:, request_options: nil)
|
376
378
|
Async do
|
377
379
|
response = @request_client.conn.delete do |req|
|
378
380
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
379
|
-
req.headers["Authorization"] = request_options.
|
381
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
380
382
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
381
383
|
req.headers = {
|
382
384
|
**(req.headers || {}),
|
@@ -415,10 +417,10 @@ module Ittybit
|
|
415
417
|
# api = Ittybit::Client.new(
|
416
418
|
# base_url: "https://api.example.com",
|
417
419
|
# environment: Ittybit::Environment::DEFAULT,
|
418
|
-
#
|
420
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
419
421
|
# )
|
420
422
|
# api.automations.update(
|
421
|
-
# id: "
|
423
|
+
# id: "auto_abcdefgh1234",
|
422
424
|
# name: "My Updated Automation",
|
423
425
|
# workflow: [{ kind: NSFW }, { kind: DESCRIPTION }, { kind: IMAGE, ref: "big_thumbnail" }, { kind: VIDEO, next_: [{ kind: "subtitle", ref: "subtitle" }] }],
|
424
426
|
# status: ACTIVE
|
@@ -427,7 +429,7 @@ module Ittybit
|
|
427
429
|
Async do
|
428
430
|
response = @request_client.conn.patch do |req|
|
429
431
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
430
|
-
req.headers["Authorization"] = request_options.
|
432
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
431
433
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
432
434
|
req.headers = {
|
433
435
|
**(req.headers || {}),
|
data/lib/ittybit/files/client.rb
CHANGED
@@ -19,6 +19,7 @@ module Ittybit
|
|
19
19
|
|
20
20
|
# Retrieves a paginated list of all files associated with the current project.
|
21
21
|
#
|
22
|
+
# @param page [Integer]
|
22
23
|
# @param limit [Integer]
|
23
24
|
# @param request_options [Ittybit::RequestOptions]
|
24
25
|
# @return [Ittybit::FileListResponse]
|
@@ -26,20 +27,20 @@ module Ittybit
|
|
26
27
|
# api = Ittybit::Client.new(
|
27
28
|
# base_url: "https://api.example.com",
|
28
29
|
# environment: Ittybit::Environment::DEFAULT,
|
29
|
-
#
|
30
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
30
31
|
# )
|
31
32
|
# api.files.list
|
32
|
-
def list(limit: nil, request_options: nil)
|
33
|
+
def list(page: nil, limit: nil, request_options: nil)
|
33
34
|
response = @request_client.conn.get do |req|
|
34
35
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
35
|
-
req.headers["Authorization"] = request_options.
|
36
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
36
37
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
37
38
|
req.headers = {
|
38
39
|
**(req.headers || {}),
|
39
40
|
**@request_client.get_headers,
|
40
41
|
**(request_options&.additional_headers || {})
|
41
42
|
}.compact
|
42
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
43
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
43
44
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
44
45
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
45
46
|
end
|
@@ -62,18 +63,18 @@ module Ittybit
|
|
62
63
|
# api = Ittybit::Client.new(
|
63
64
|
# base_url: "https://api.example.com",
|
64
65
|
# environment: Ittybit::Environment::DEFAULT,
|
65
|
-
#
|
66
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
66
67
|
# )
|
67
68
|
# api.files.create(
|
68
69
|
# url: "https://ittyb.it/sample.mp4",
|
69
70
|
# folder: "ittybit/samples",
|
70
71
|
# filename: "video.mp4",
|
71
|
-
# metadata: { "
|
72
|
+
# metadata: { "customKey": "your custom value" }
|
72
73
|
# )
|
73
74
|
def create(url:, media_id: nil, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
|
74
75
|
response = @request_client.conn.post do |req|
|
75
76
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
76
|
-
req.headers["Authorization"] = request_options.
|
77
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
77
78
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
78
79
|
req.headers = {
|
79
80
|
**(req.headers || {}),
|
@@ -106,13 +107,13 @@ module Ittybit
|
|
106
107
|
# api = Ittybit::Client.new(
|
107
108
|
# base_url: "https://api.example.com",
|
108
109
|
# environment: Ittybit::Environment::DEFAULT,
|
109
|
-
#
|
110
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
110
111
|
# )
|
111
|
-
# api.files.get(id: "
|
112
|
+
# api.files.get(id: "file_abcdefgh1234")
|
112
113
|
def get(id:, request_options: nil)
|
113
114
|
response = @request_client.conn.get do |req|
|
114
115
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
115
|
-
req.headers["Authorization"] = request_options.
|
116
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
116
117
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
117
118
|
req.headers = {
|
118
119
|
**(req.headers || {}),
|
@@ -139,13 +140,13 @@ module Ittybit
|
|
139
140
|
# api = Ittybit::Client.new(
|
140
141
|
# base_url: "https://api.example.com",
|
141
142
|
# environment: Ittybit::Environment::DEFAULT,
|
142
|
-
#
|
143
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
143
144
|
# )
|
144
|
-
# api.files.delete(id: "
|
145
|
+
# api.files.delete(id: "file_abcdefgh1234")
|
145
146
|
def delete(id:, request_options: nil)
|
146
147
|
response = @request_client.conn.delete do |req|
|
147
148
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
148
|
-
req.headers["Authorization"] = request_options.
|
149
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
149
150
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
150
151
|
req.headers = {
|
151
152
|
**(req.headers || {}),
|
@@ -177,10 +178,10 @@ module Ittybit
|
|
177
178
|
# api = Ittybit::Client.new(
|
178
179
|
# base_url: "https://api.example.com",
|
179
180
|
# environment: Ittybit::Environment::DEFAULT,
|
180
|
-
#
|
181
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
181
182
|
# )
|
182
183
|
# api.files.update(
|
183
|
-
# id: "
|
184
|
+
# id: "file_abcdefgh1234",
|
184
185
|
# folder: "updated/folder",
|
185
186
|
# filename: "new_filename.mp4",
|
186
187
|
# metadata: { "customKey2": "a different custom value" }
|
@@ -188,7 +189,7 @@ module Ittybit
|
|
188
189
|
def update(id:, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
|
189
190
|
response = @request_client.conn.patch do |req|
|
190
191
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
191
|
-
req.headers["Authorization"] = request_options.
|
192
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
192
193
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
193
194
|
req.headers = {
|
194
195
|
**(req.headers || {}),
|
@@ -223,6 +224,7 @@ module Ittybit
|
|
223
224
|
|
224
225
|
# Retrieves a paginated list of all files associated with the current project.
|
225
226
|
#
|
227
|
+
# @param page [Integer]
|
226
228
|
# @param limit [Integer]
|
227
229
|
# @param request_options [Ittybit::RequestOptions]
|
228
230
|
# @return [Ittybit::FileListResponse]
|
@@ -230,21 +232,21 @@ module Ittybit
|
|
230
232
|
# api = Ittybit::Client.new(
|
231
233
|
# base_url: "https://api.example.com",
|
232
234
|
# environment: Ittybit::Environment::DEFAULT,
|
233
|
-
#
|
235
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
234
236
|
# )
|
235
237
|
# api.files.list
|
236
|
-
def list(limit: nil, request_options: nil)
|
238
|
+
def list(page: nil, limit: nil, request_options: nil)
|
237
239
|
Async do
|
238
240
|
response = @request_client.conn.get do |req|
|
239
241
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
240
|
-
req.headers["Authorization"] = request_options.
|
242
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
241
243
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
242
244
|
req.headers = {
|
243
245
|
**(req.headers || {}),
|
244
246
|
**@request_client.get_headers,
|
245
247
|
**(request_options&.additional_headers || {})
|
246
248
|
}.compact
|
247
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
249
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
248
250
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
249
251
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
250
252
|
end
|
@@ -268,19 +270,19 @@ module Ittybit
|
|
268
270
|
# api = Ittybit::Client.new(
|
269
271
|
# base_url: "https://api.example.com",
|
270
272
|
# environment: Ittybit::Environment::DEFAULT,
|
271
|
-
#
|
273
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
272
274
|
# )
|
273
275
|
# api.files.create(
|
274
276
|
# url: "https://ittyb.it/sample.mp4",
|
275
277
|
# folder: "ittybit/samples",
|
276
278
|
# filename: "video.mp4",
|
277
|
-
# metadata: { "
|
279
|
+
# metadata: { "customKey": "your custom value" }
|
278
280
|
# )
|
279
281
|
def create(url:, media_id: nil, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
|
280
282
|
Async do
|
281
283
|
response = @request_client.conn.post do |req|
|
282
284
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
283
|
-
req.headers["Authorization"] = request_options.
|
285
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
284
286
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
285
287
|
req.headers = {
|
286
288
|
**(req.headers || {}),
|
@@ -314,14 +316,14 @@ module Ittybit
|
|
314
316
|
# api = Ittybit::Client.new(
|
315
317
|
# base_url: "https://api.example.com",
|
316
318
|
# environment: Ittybit::Environment::DEFAULT,
|
317
|
-
#
|
319
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
318
320
|
# )
|
319
|
-
# api.files.get(id: "
|
321
|
+
# api.files.get(id: "file_abcdefgh1234")
|
320
322
|
def get(id:, request_options: nil)
|
321
323
|
Async do
|
322
324
|
response = @request_client.conn.get do |req|
|
323
325
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
324
|
-
req.headers["Authorization"] = request_options.
|
326
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
325
327
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
326
328
|
req.headers = {
|
327
329
|
**(req.headers || {}),
|
@@ -349,14 +351,14 @@ module Ittybit
|
|
349
351
|
# api = Ittybit::Client.new(
|
350
352
|
# base_url: "https://api.example.com",
|
351
353
|
# environment: Ittybit::Environment::DEFAULT,
|
352
|
-
#
|
354
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
353
355
|
# )
|
354
|
-
# api.files.delete(id: "
|
356
|
+
# api.files.delete(id: "file_abcdefgh1234")
|
355
357
|
def delete(id:, request_options: nil)
|
356
358
|
Async do
|
357
359
|
response = @request_client.conn.delete do |req|
|
358
360
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
359
|
-
req.headers["Authorization"] = request_options.
|
361
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
360
362
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
361
363
|
req.headers = {
|
362
364
|
**(req.headers || {}),
|
@@ -389,10 +391,10 @@ module Ittybit
|
|
389
391
|
# api = Ittybit::Client.new(
|
390
392
|
# base_url: "https://api.example.com",
|
391
393
|
# environment: Ittybit::Environment::DEFAULT,
|
392
|
-
#
|
394
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
393
395
|
# )
|
394
396
|
# api.files.update(
|
395
|
-
# id: "
|
397
|
+
# id: "file_abcdefgh1234",
|
396
398
|
# folder: "updated/folder",
|
397
399
|
# filename: "new_filename.mp4",
|
398
400
|
# metadata: { "customKey2": "a different custom value" }
|
@@ -401,7 +403,7 @@ module Ittybit
|
|
401
403
|
Async do
|
402
404
|
response = @request_client.conn.patch do |req|
|
403
405
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
404
|
-
req.headers["Authorization"] = request_options.
|
406
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
405
407
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
406
408
|
req.headers = {
|
407
409
|
**(req.headers || {}),
|
data/lib/ittybit/media/client.rb
CHANGED
@@ -17,8 +17,9 @@ module Ittybit
|
|
17
17
|
@request_client = request_client
|
18
18
|
end
|
19
19
|
|
20
|
-
# Retrieves a paginated list of all media for the current project
|
20
|
+
# Retrieves a paginated list of all media for the current project.
|
21
21
|
#
|
22
|
+
# @param page [Integer]
|
22
23
|
# @param limit [Integer]
|
23
24
|
# @param request_options [Ittybit::RequestOptions]
|
24
25
|
# @return [Ittybit::MediaListResponse]
|
@@ -26,20 +27,20 @@ module Ittybit
|
|
26
27
|
# api = Ittybit::Client.new(
|
27
28
|
# base_url: "https://api.example.com",
|
28
29
|
# environment: Ittybit::Environment::DEFAULT,
|
29
|
-
#
|
30
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
30
31
|
# )
|
31
32
|
# api.media.list
|
32
|
-
def list(limit: nil, request_options: nil)
|
33
|
+
def list(page: nil, limit: nil, request_options: nil)
|
33
34
|
response = @request_client.conn.get do |req|
|
34
35
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
35
|
-
req.headers["Authorization"] = request_options.
|
36
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
36
37
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
37
38
|
req.headers = {
|
38
39
|
**(req.headers || {}),
|
39
40
|
**@request_client.get_headers,
|
40
41
|
**(request_options&.additional_headers || {})
|
41
42
|
}.compact
|
42
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
43
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
43
44
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
44
45
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
45
46
|
end
|
@@ -59,7 +60,7 @@ module Ittybit
|
|
59
60
|
# api = Ittybit::Client.new(
|
60
61
|
# base_url: "https://api.example.com",
|
61
62
|
# environment: Ittybit::Environment::DEFAULT,
|
62
|
-
#
|
63
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
63
64
|
# )
|
64
65
|
# api.media.create(
|
65
66
|
# title: "My Video Example",
|
@@ -69,7 +70,7 @@ module Ittybit
|
|
69
70
|
def create(title: nil, alt: nil, metadata: nil, request_options: nil)
|
70
71
|
response = @request_client.conn.post do |req|
|
71
72
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
72
|
-
req.headers["Authorization"] = request_options.
|
73
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
73
74
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
74
75
|
req.headers = {
|
75
76
|
**(req.headers || {}),
|
@@ -99,13 +100,13 @@ module Ittybit
|
|
99
100
|
# api = Ittybit::Client.new(
|
100
101
|
# base_url: "https://api.example.com",
|
101
102
|
# environment: Ittybit::Environment::DEFAULT,
|
102
|
-
#
|
103
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
103
104
|
# )
|
104
|
-
# api.media.get(id: "
|
105
|
+
# api.media.get(id: "med_abcdefgh1234")
|
105
106
|
def get(id:, request_options: nil)
|
106
107
|
response = @request_client.conn.get do |req|
|
107
108
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
108
|
-
req.headers["Authorization"] = request_options.
|
109
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
109
110
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
110
111
|
req.headers = {
|
111
112
|
**(req.headers || {}),
|
@@ -133,13 +134,13 @@ module Ittybit
|
|
133
134
|
# api = Ittybit::Client.new(
|
134
135
|
# base_url: "https://api.example.com",
|
135
136
|
# environment: Ittybit::Environment::DEFAULT,
|
136
|
-
#
|
137
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
137
138
|
# )
|
138
|
-
# api.media.delete(id: "
|
139
|
+
# api.media.delete(id: "med_abcdefgh1234")
|
139
140
|
def delete(id:, request_options: nil)
|
140
141
|
response = @request_client.conn.delete do |req|
|
141
142
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
142
|
-
req.headers["Authorization"] = request_options.
|
143
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
143
144
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
144
145
|
req.headers = {
|
145
146
|
**(req.headers || {}),
|
@@ -170,10 +171,10 @@ module Ittybit
|
|
170
171
|
# api = Ittybit::Client.new(
|
171
172
|
# base_url: "https://api.example.com",
|
172
173
|
# environment: Ittybit::Environment::DEFAULT,
|
173
|
-
#
|
174
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
174
175
|
# )
|
175
176
|
# api.media.update(
|
176
|
-
# id: "
|
177
|
+
# id: "med_abcdefgh1234",
|
177
178
|
# title: "Updated Video Example",
|
178
179
|
# alt: "An updated example video used to demonstrate the ittybit API",
|
179
180
|
# metadata: { "customKey2": "a different custom value" }
|
@@ -181,7 +182,7 @@ module Ittybit
|
|
181
182
|
def update(id:, title: nil, alt: nil, metadata: nil, request_options: nil)
|
182
183
|
response = @request_client.conn.patch do |req|
|
183
184
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
184
|
-
req.headers["Authorization"] = request_options.
|
185
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
185
186
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
186
187
|
req.headers = {
|
187
188
|
**(req.headers || {}),
|
@@ -213,8 +214,9 @@ module Ittybit
|
|
213
214
|
@request_client = request_client
|
214
215
|
end
|
215
216
|
|
216
|
-
# Retrieves a paginated list of all media for the current project
|
217
|
+
# Retrieves a paginated list of all media for the current project.
|
217
218
|
#
|
219
|
+
# @param page [Integer]
|
218
220
|
# @param limit [Integer]
|
219
221
|
# @param request_options [Ittybit::RequestOptions]
|
220
222
|
# @return [Ittybit::MediaListResponse]
|
@@ -222,21 +224,21 @@ module Ittybit
|
|
222
224
|
# api = Ittybit::Client.new(
|
223
225
|
# base_url: "https://api.example.com",
|
224
226
|
# environment: Ittybit::Environment::DEFAULT,
|
225
|
-
#
|
227
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
226
228
|
# )
|
227
229
|
# api.media.list
|
228
|
-
def list(limit: nil, request_options: nil)
|
230
|
+
def list(page: nil, limit: nil, request_options: nil)
|
229
231
|
Async do
|
230
232
|
response = @request_client.conn.get do |req|
|
231
233
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
232
|
-
req.headers["Authorization"] = request_options.
|
234
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
233
235
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
234
236
|
req.headers = {
|
235
237
|
**(req.headers || {}),
|
236
238
|
**@request_client.get_headers,
|
237
239
|
**(request_options&.additional_headers || {})
|
238
240
|
}.compact
|
239
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
241
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
240
242
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
241
243
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
242
244
|
end
|
@@ -257,7 +259,7 @@ module Ittybit
|
|
257
259
|
# api = Ittybit::Client.new(
|
258
260
|
# base_url: "https://api.example.com",
|
259
261
|
# environment: Ittybit::Environment::DEFAULT,
|
260
|
-
#
|
262
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
261
263
|
# )
|
262
264
|
# api.media.create(
|
263
265
|
# title: "My Video Example",
|
@@ -268,7 +270,7 @@ module Ittybit
|
|
268
270
|
Async do
|
269
271
|
response = @request_client.conn.post do |req|
|
270
272
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
271
|
-
req.headers["Authorization"] = request_options.
|
273
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
272
274
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
273
275
|
req.headers = {
|
274
276
|
**(req.headers || {}),
|
@@ -299,14 +301,14 @@ module Ittybit
|
|
299
301
|
# api = Ittybit::Client.new(
|
300
302
|
# base_url: "https://api.example.com",
|
301
303
|
# environment: Ittybit::Environment::DEFAULT,
|
302
|
-
#
|
304
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
303
305
|
# )
|
304
|
-
# api.media.get(id: "
|
306
|
+
# api.media.get(id: "med_abcdefgh1234")
|
305
307
|
def get(id:, request_options: nil)
|
306
308
|
Async do
|
307
309
|
response = @request_client.conn.get do |req|
|
308
310
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
309
|
-
req.headers["Authorization"] = request_options.
|
311
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
310
312
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
311
313
|
req.headers = {
|
312
314
|
**(req.headers || {}),
|
@@ -335,14 +337,14 @@ module Ittybit
|
|
335
337
|
# api = Ittybit::Client.new(
|
336
338
|
# base_url: "https://api.example.com",
|
337
339
|
# environment: Ittybit::Environment::DEFAULT,
|
338
|
-
#
|
340
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
339
341
|
# )
|
340
|
-
# api.media.delete(id: "
|
342
|
+
# api.media.delete(id: "med_abcdefgh1234")
|
341
343
|
def delete(id:, request_options: nil)
|
342
344
|
Async do
|
343
345
|
response = @request_client.conn.delete do |req|
|
344
346
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
345
|
-
req.headers["Authorization"] = request_options.
|
347
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
346
348
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
347
349
|
req.headers = {
|
348
350
|
**(req.headers || {}),
|
@@ -374,10 +376,10 @@ module Ittybit
|
|
374
376
|
# api = Ittybit::Client.new(
|
375
377
|
# base_url: "https://api.example.com",
|
376
378
|
# environment: Ittybit::Environment::DEFAULT,
|
377
|
-
#
|
379
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
378
380
|
# )
|
379
381
|
# api.media.update(
|
380
|
-
# id: "
|
382
|
+
# id: "med_abcdefgh1234",
|
381
383
|
# title: "Updated Video Example",
|
382
384
|
# alt: "An updated example video used to demonstrate the ittybit API",
|
383
385
|
# metadata: { "customKey2": "a different custom value" }
|
@@ -386,7 +388,7 @@ module Ittybit
|
|
386
388
|
Async do
|
387
389
|
response = @request_client.conn.patch do |req|
|
388
390
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
389
|
-
req.headers["Authorization"] = request_options.
|
391
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
390
392
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
391
393
|
req.headers = {
|
392
394
|
**(req.headers || {}),
|
@@ -31,7 +31,7 @@ module Ittybit
|
|
31
31
|
# api = Ittybit::Client.new(
|
32
32
|
# base_url: "https://api.example.com",
|
33
33
|
# environment: Ittybit::Environment::DEFAULT,
|
34
|
-
#
|
34
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
35
35
|
# )
|
36
36
|
# api.signatures.create(
|
37
37
|
# filename: "video.mp4",
|
@@ -42,7 +42,7 @@ module Ittybit
|
|
42
42
|
def create(filename:, folder: nil, expiry: nil, method: nil, request_options: nil)
|
43
43
|
response = @request_client.conn.post do |req|
|
44
44
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
45
|
-
req.headers["Authorization"] = request_options.
|
45
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
46
46
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
47
47
|
req.headers = {
|
48
48
|
**(req.headers || {}),
|
@@ -90,7 +90,7 @@ module Ittybit
|
|
90
90
|
# api = Ittybit::Client.new(
|
91
91
|
# base_url: "https://api.example.com",
|
92
92
|
# environment: Ittybit::Environment::DEFAULT,
|
93
|
-
#
|
93
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
94
94
|
# )
|
95
95
|
# api.signatures.create(
|
96
96
|
# filename: "video.mp4",
|
@@ -102,7 +102,7 @@ module Ittybit
|
|
102
102
|
Async do
|
103
103
|
response = @request_client.conn.post do |req|
|
104
104
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
105
|
-
req.headers["Authorization"] = request_options.
|
105
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
106
106
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
107
107
|
req.headers = {
|
108
108
|
**(req.headers || {}),
|
data/lib/ittybit/tasks/client.rb
CHANGED
@@ -17,6 +17,9 @@ module Ittybit
|
|
17
17
|
@request_client = request_client
|
18
18
|
end
|
19
19
|
|
20
|
+
# Retrieves a paginated list of all tasks for the current project.
|
21
|
+
#
|
22
|
+
# @param page [Integer]
|
20
23
|
# @param limit [Integer]
|
21
24
|
# @param request_options [Ittybit::RequestOptions]
|
22
25
|
# @return [Ittybit::TaskListResponse]
|
@@ -24,20 +27,20 @@ module Ittybit
|
|
24
27
|
# api = Ittybit::Client.new(
|
25
28
|
# base_url: "https://api.example.com",
|
26
29
|
# environment: Ittybit::Environment::DEFAULT,
|
27
|
-
#
|
30
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
28
31
|
# )
|
29
32
|
# api.tasks.list
|
30
|
-
def list(limit: nil, request_options: nil)
|
33
|
+
def list(page: nil, limit: nil, request_options: nil)
|
31
34
|
response = @request_client.conn.get do |req|
|
32
35
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
33
|
-
req.headers["Authorization"] = request_options.
|
36
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
34
37
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
35
38
|
req.headers = {
|
36
39
|
**(req.headers || {}),
|
37
40
|
**@request_client.get_headers,
|
38
41
|
**(request_options&.additional_headers || {})
|
39
42
|
}.compact
|
40
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
43
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
41
44
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
42
45
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
43
46
|
end
|
@@ -56,13 +59,13 @@ module Ittybit
|
|
56
59
|
# api = Ittybit::Client.new(
|
57
60
|
# base_url: "https://api.example.com",
|
58
61
|
# environment: Ittybit::Environment::DEFAULT,
|
59
|
-
#
|
62
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
60
63
|
# )
|
61
64
|
# api.tasks.create(request: {"file_id":"file_abcdefgh1234","kind":"image","width":320,"format":"png","ref":"thumbnail"})
|
62
65
|
def create(request: nil, request_options: nil)
|
63
66
|
response = @request_client.conn.post do |req|
|
64
67
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
65
|
-
req.headers["Authorization"] = request_options.
|
68
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
66
69
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
67
70
|
req.headers = {
|
68
71
|
**(req.headers || {}),
|
@@ -87,13 +90,13 @@ module Ittybit
|
|
87
90
|
# api = Ittybit::Client.new(
|
88
91
|
# base_url: "https://api.example.com",
|
89
92
|
# environment: Ittybit::Environment::DEFAULT,
|
90
|
-
#
|
93
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
91
94
|
# )
|
92
|
-
# api.tasks.get(id: "
|
95
|
+
# api.tasks.get(id: "task_abcdefgh1234")
|
93
96
|
def get(id:, request_options: nil)
|
94
97
|
response = @request_client.conn.get do |req|
|
95
98
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
96
|
-
req.headers["Authorization"] = request_options.
|
99
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
97
100
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
98
101
|
req.headers = {
|
99
102
|
**(req.headers || {}),
|
@@ -119,13 +122,13 @@ module Ittybit
|
|
119
122
|
# api = Ittybit::Client.new(
|
120
123
|
# base_url: "https://api.example.com",
|
121
124
|
# environment: Ittybit::Environment::DEFAULT,
|
122
|
-
#
|
125
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
123
126
|
# )
|
124
127
|
# api.tasks.get_task_config
|
125
128
|
def get_task_config(request_options: nil)
|
126
129
|
response = @request_client.conn.get do |req|
|
127
130
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
128
|
-
req.headers["Authorization"] = request_options.
|
131
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
129
132
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
130
133
|
req.headers = {
|
131
134
|
**(req.headers || {}),
|
@@ -154,6 +157,9 @@ module Ittybit
|
|
154
157
|
@request_client = request_client
|
155
158
|
end
|
156
159
|
|
160
|
+
# Retrieves a paginated list of all tasks for the current project.
|
161
|
+
#
|
162
|
+
# @param page [Integer]
|
157
163
|
# @param limit [Integer]
|
158
164
|
# @param request_options [Ittybit::RequestOptions]
|
159
165
|
# @return [Ittybit::TaskListResponse]
|
@@ -161,21 +167,21 @@ module Ittybit
|
|
161
167
|
# api = Ittybit::Client.new(
|
162
168
|
# base_url: "https://api.example.com",
|
163
169
|
# environment: Ittybit::Environment::DEFAULT,
|
164
|
-
#
|
170
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
165
171
|
# )
|
166
172
|
# api.tasks.list
|
167
|
-
def list(limit: nil, request_options: nil)
|
173
|
+
def list(page: nil, limit: nil, request_options: nil)
|
168
174
|
Async do
|
169
175
|
response = @request_client.conn.get do |req|
|
170
176
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
171
|
-
req.headers["Authorization"] = request_options.
|
177
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
172
178
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
173
179
|
req.headers = {
|
174
180
|
**(req.headers || {}),
|
175
181
|
**@request_client.get_headers,
|
176
182
|
**(request_options&.additional_headers || {})
|
177
183
|
}.compact
|
178
|
-
req.params = { **(request_options&.additional_query_parameters || {}), "limit": limit }.compact
|
184
|
+
req.params = { **(request_options&.additional_query_parameters || {}), "page": page, "limit": limit }.compact
|
179
185
|
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
180
186
|
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
181
187
|
end
|
@@ -195,14 +201,14 @@ module Ittybit
|
|
195
201
|
# api = Ittybit::Client.new(
|
196
202
|
# base_url: "https://api.example.com",
|
197
203
|
# environment: Ittybit::Environment::DEFAULT,
|
198
|
-
#
|
204
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
199
205
|
# )
|
200
206
|
# api.tasks.create(request: {"file_id":"file_abcdefgh1234","kind":"image","width":320,"format":"png","ref":"thumbnail"})
|
201
207
|
def create(request: nil, request_options: nil)
|
202
208
|
Async do
|
203
209
|
response = @request_client.conn.post do |req|
|
204
210
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
205
|
-
req.headers["Authorization"] = request_options.
|
211
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
206
212
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
207
213
|
req.headers = {
|
208
214
|
**(req.headers || {}),
|
@@ -228,14 +234,14 @@ module Ittybit
|
|
228
234
|
# api = Ittybit::Client.new(
|
229
235
|
# base_url: "https://api.example.com",
|
230
236
|
# environment: Ittybit::Environment::DEFAULT,
|
231
|
-
#
|
237
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
232
238
|
# )
|
233
|
-
# api.tasks.get(id: "
|
239
|
+
# api.tasks.get(id: "task_abcdefgh1234")
|
234
240
|
def get(id:, request_options: nil)
|
235
241
|
Async do
|
236
242
|
response = @request_client.conn.get do |req|
|
237
243
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
238
|
-
req.headers["Authorization"] = request_options.
|
244
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
239
245
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
240
246
|
req.headers = {
|
241
247
|
**(req.headers || {}),
|
@@ -262,14 +268,14 @@ module Ittybit
|
|
262
268
|
# api = Ittybit::Client.new(
|
263
269
|
# base_url: "https://api.example.com",
|
264
270
|
# environment: Ittybit::Environment::DEFAULT,
|
265
|
-
#
|
271
|
+
# api_key: "YOUR_AUTH_TOKEN"
|
266
272
|
# )
|
267
273
|
# api.tasks.get_task_config
|
268
274
|
def get_task_config(request_options: nil)
|
269
275
|
Async do
|
270
276
|
response = @request_client.conn.get do |req|
|
271
277
|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
272
|
-
req.headers["Authorization"] = request_options.
|
278
|
+
req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
|
273
279
|
req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
|
274
280
|
req.headers = {
|
275
281
|
**(req.headers || {}),
|
data/lib/ittybit.rb
CHANGED
@@ -26,17 +26,17 @@ module Ittybit
|
|
26
26
|
# @param environment [Ittybit::Environment]
|
27
27
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
28
28
|
# @param timeout_in_seconds [Long]
|
29
|
-
# @param
|
30
|
-
# @param version [
|
29
|
+
# @param api_key [String]
|
30
|
+
# @param version [String]
|
31
31
|
# @return [Ittybit::Client]
|
32
|
-
def initialize(
|
33
|
-
timeout_in_seconds: nil, version: nil)
|
32
|
+
def initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
|
33
|
+
timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil)
|
34
34
|
@request_client = Ittybit::RequestClient.new(
|
35
35
|
base_url: base_url,
|
36
36
|
environment: environment,
|
37
37
|
max_retries: max_retries,
|
38
38
|
timeout_in_seconds: timeout_in_seconds,
|
39
|
-
|
39
|
+
api_key: api_key,
|
40
40
|
version: version
|
41
41
|
)
|
42
42
|
@automations = Ittybit::AutomationsClient.new(request_client: @request_client)
|
@@ -63,17 +63,17 @@ module Ittybit
|
|
63
63
|
# @param environment [Ittybit::Environment]
|
64
64
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
65
65
|
# @param timeout_in_seconds [Long]
|
66
|
-
# @param
|
67
|
-
# @param version [
|
66
|
+
# @param api_key [String]
|
67
|
+
# @param version [String]
|
68
68
|
# @return [Ittybit::AsyncClient]
|
69
|
-
def initialize(
|
70
|
-
timeout_in_seconds: nil, version: nil)
|
69
|
+
def initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
|
70
|
+
timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil)
|
71
71
|
@async_request_client = Ittybit::AsyncRequestClient.new(
|
72
72
|
base_url: base_url,
|
73
73
|
environment: environment,
|
74
74
|
max_retries: max_retries,
|
75
75
|
timeout_in_seconds: timeout_in_seconds,
|
76
|
-
|
76
|
+
api_key: api_key,
|
77
77
|
version: version
|
78
78
|
)
|
79
79
|
@automations = Ittybit::AsyncAutomationsClient.new(request_client: @async_request_client)
|
data/lib/requests.rb
CHANGED
@@ -12,7 +12,7 @@ module Ittybit
|
|
12
12
|
# @return [String]
|
13
13
|
attr_reader :base_url
|
14
14
|
# @return [String]
|
15
|
-
attr_reader :
|
15
|
+
attr_reader :api_key
|
16
16
|
# @return [String]
|
17
17
|
attr_reader :default_environment
|
18
18
|
|
@@ -20,14 +20,14 @@ module Ittybit
|
|
20
20
|
# @param environment [Ittybit::Environment]
|
21
21
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
22
22
|
# @param timeout_in_seconds [Long]
|
23
|
-
# @param
|
24
|
-
# @param version [
|
23
|
+
# @param api_key [String]
|
24
|
+
# @param version [String]
|
25
25
|
# @return [Ittybit::RequestClient]
|
26
|
-
def initialize(
|
27
|
-
timeout_in_seconds: nil, version: nil)
|
26
|
+
def initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
|
27
|
+
timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil)
|
28
28
|
@default_environment = environment
|
29
29
|
@base_url = environment || base_url
|
30
|
-
@
|
30
|
+
@api_key = "Bearer #{api_key}"
|
31
31
|
@headers = {}
|
32
32
|
@headers["ACCEPT_VERSION"] = version unless version.nil?
|
33
33
|
@conn = Faraday.new(headers: @headers) do |faraday|
|
@@ -46,8 +46,8 @@ module Ittybit
|
|
46
46
|
|
47
47
|
# @return [Hash{String => String}]
|
48
48
|
def get_headers
|
49
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.
|
50
|
-
headers["Authorization"] = ((@
|
49
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.14" }
|
50
|
+
headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
51
51
|
headers
|
52
52
|
end
|
53
53
|
end
|
@@ -58,7 +58,7 @@ module Ittybit
|
|
58
58
|
# @return [String]
|
59
59
|
attr_reader :base_url
|
60
60
|
# @return [String]
|
61
|
-
attr_reader :
|
61
|
+
attr_reader :api_key
|
62
62
|
# @return [String]
|
63
63
|
attr_reader :default_environment
|
64
64
|
|
@@ -66,14 +66,14 @@ module Ittybit
|
|
66
66
|
# @param environment [Ittybit::Environment]
|
67
67
|
# @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
|
68
68
|
# @param timeout_in_seconds [Long]
|
69
|
-
# @param
|
70
|
-
# @param version [
|
69
|
+
# @param api_key [String]
|
70
|
+
# @param version [String]
|
71
71
|
# @return [Ittybit::AsyncRequestClient]
|
72
|
-
def initialize(
|
73
|
-
timeout_in_seconds: nil, version: nil)
|
72
|
+
def initialize(base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
|
73
|
+
timeout_in_seconds: nil, api_key: ENV["ITTYBIT_API_KEY"], version: nil)
|
74
74
|
@default_environment = environment
|
75
75
|
@base_url = environment || base_url
|
76
|
-
@
|
76
|
+
@api_key = "Bearer #{api_key}"
|
77
77
|
@headers = {}
|
78
78
|
@headers["ACCEPT_VERSION"] = version unless version.nil?
|
79
79
|
@conn = Faraday.new(headers: @headers) do |faraday|
|
@@ -93,8 +93,8 @@ module Ittybit
|
|
93
93
|
|
94
94
|
# @return [Hash{String => String}]
|
95
95
|
def get_headers
|
96
|
-
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.
|
97
|
-
headers["Authorization"] = ((@
|
96
|
+
headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ittybit", "X-Fern-SDK-Version": "0.8.14" }
|
97
|
+
headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
|
98
98
|
headers
|
99
99
|
end
|
100
100
|
end
|
@@ -105,8 +105,8 @@ module Ittybit
|
|
105
105
|
# @return [String]
|
106
106
|
attr_reader :base_url
|
107
107
|
# @return [String]
|
108
|
-
attr_reader :
|
109
|
-
# @return [
|
108
|
+
attr_reader :api_key
|
109
|
+
# @return [String]
|
110
110
|
attr_reader :version
|
111
111
|
# @return [Hash{String => Object}]
|
112
112
|
attr_reader :additional_headers
|
@@ -118,17 +118,17 @@ module Ittybit
|
|
118
118
|
attr_reader :timeout_in_seconds
|
119
119
|
|
120
120
|
# @param base_url [String]
|
121
|
-
# @param
|
122
|
-
# @param version [
|
121
|
+
# @param api_key [String]
|
122
|
+
# @param version [String]
|
123
123
|
# @param additional_headers [Hash{String => Object}]
|
124
124
|
# @param additional_query_parameters [Hash{String => Object}]
|
125
125
|
# @param additional_body_parameters [Hash{String => Object}]
|
126
126
|
# @param timeout_in_seconds [Long]
|
127
127
|
# @return [Ittybit::RequestOptions]
|
128
|
-
def initialize(base_url: nil,
|
129
|
-
additional_body_parameters: nil, timeout_in_seconds: nil)
|
128
|
+
def initialize(base_url: nil, api_key: nil, version: nil, additional_headers: nil,
|
129
|
+
additional_query_parameters: nil, additional_body_parameters: nil, timeout_in_seconds: nil)
|
130
130
|
@base_url = base_url
|
131
|
-
@
|
131
|
+
@api_key = api_key
|
132
132
|
@version = version
|
133
133
|
@additional_headers = additional_headers
|
134
134
|
@additional_query_parameters = additional_query_parameters
|
@@ -143,8 +143,8 @@ module Ittybit
|
|
143
143
|
# @return [String]
|
144
144
|
attr_reader :base_url
|
145
145
|
# @return [String]
|
146
|
-
attr_reader :
|
147
|
-
# @return [
|
146
|
+
attr_reader :api_key
|
147
|
+
# @return [String]
|
148
148
|
attr_reader :version
|
149
149
|
# @return [Hash{String => Object}]
|
150
150
|
attr_reader :additional_headers
|
@@ -156,17 +156,17 @@ module Ittybit
|
|
156
156
|
attr_reader :timeout_in_seconds
|
157
157
|
|
158
158
|
# @param base_url [String]
|
159
|
-
# @param
|
160
|
-
# @param version [
|
159
|
+
# @param api_key [String]
|
160
|
+
# @param version [String]
|
161
161
|
# @param additional_headers [Hash{String => Object}]
|
162
162
|
# @param additional_query_parameters [Hash{String => Object}]
|
163
163
|
# @param additional_body_parameters [Hash{String => Object}]
|
164
164
|
# @param timeout_in_seconds [Long]
|
165
165
|
# @return [Ittybit::IdempotencyRequestOptions]
|
166
|
-
def initialize(base_url: nil,
|
167
|
-
additional_body_parameters: nil, timeout_in_seconds: nil)
|
166
|
+
def initialize(base_url: nil, api_key: nil, version: nil, additional_headers: nil,
|
167
|
+
additional_query_parameters: nil, additional_body_parameters: nil, timeout_in_seconds: nil)
|
168
168
|
@base_url = base_url
|
169
|
-
@
|
169
|
+
@api_key = api_key
|
170
170
|
@version = version
|
171
171
|
@additional_headers = additional_headers
|
172
172
|
@additional_query_parameters = additional_query_parameters
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ittybit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http-faraday
|