ittybit 0.8.7 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6e6b9e76d03fdbbaa03524ff3046be278eba109ebc3d37361ceff2dc4be3268
4
- data.tar.gz: 3ad3d4f98cf9f50775aee331375229b2c6557078cc005f4310baff5f3e8d9ea2
3
+ metadata.gz: a3e62b752b4501016cddd19e889b0bd60fe947774c99ab0ab5b577fd839ffdbb
4
+ data.tar.gz: 48882dd0bab725a2ac33ce722a6167437784c0b0b36a4648d172c6f991c811cd
5
5
  SHA512:
6
- metadata.gz: 3bf316682be01b4b9abd5bb6598d61609f437fdc59a95fa29e0c836233e5e740f162ddc9c13a44c5f98829246d8d649d3a66d531b9b326b9d623ebb01fbc55af
7
- data.tar.gz: d0f5c768748f9fd10127663e05160a86243326874409d0e3541b559706d1c41357cb54e57c10b8a4868472c65fc8d140c9c30161073d5b475369b96ed6833b36
6
+ metadata.gz: 9289acda5c97a93de7adc5ac7acaf1965518dd64ac148d8895d996b4754c785e5f50381508448ab0fe5845bd24d079a9d343703f2cfe301ef490600829a955f9
7
+ data.tar.gz: ff0896814c3ca512aefcd99a4d4c2f33cbc41a1134231b9d40be545f38819e6f9eb7ef15a427737d820e6df2fcee8973bb3adfc36e9530cfdb3bdf1391d2eda1
@@ -22,7 +22,7 @@ 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
27
  # @param page [Integer]
28
28
  # @param limit [Integer]
@@ -32,13 +32,13 @@ module Ittybit
32
32
  # api = Ittybit::Client.new(
33
33
  # base_url: "https://api.example.com",
34
34
  # environment: Ittybit::Environment::DEFAULT,
35
- # token: "YOUR_AUTH_TOKEN"
35
+ # api_key: "YOUR_AUTH_TOKEN"
36
36
  # )
37
37
  # api.automations.list
38
38
  def list(page: nil, limit: nil, request_options: nil)
39
39
  response = @request_client.conn.get do |req|
40
40
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
41
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
41
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
42
42
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
43
43
  req.headers = {
44
44
  **(req.headers || {}),
@@ -72,7 +72,7 @@ module Ittybit
72
72
  # api = Ittybit::Client.new(
73
73
  # base_url: "https://api.example.com",
74
74
  # environment: Ittybit::Environment::DEFAULT,
75
- # token: "YOUR_AUTH_TOKEN"
75
+ # api_key: "YOUR_AUTH_TOKEN"
76
76
  # )
77
77
  # api.automations.create(
78
78
  # name: "My Example Automation",
@@ -84,7 +84,7 @@ module Ittybit
84
84
  def create(trigger:, workflow:, name: nil, description: nil, status: nil, request_options: nil)
85
85
  response = @request_client.conn.post do |req|
86
86
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
87
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
87
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
88
88
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
89
89
  req.headers = {
90
90
  **(req.headers || {}),
@@ -116,13 +116,13 @@ module Ittybit
116
116
  # api = Ittybit::Client.new(
117
117
  # base_url: "https://api.example.com",
118
118
  # environment: Ittybit::Environment::DEFAULT,
119
- # token: "YOUR_AUTH_TOKEN"
119
+ # api_key: "YOUR_AUTH_TOKEN"
120
120
  # )
121
121
  # api.automations.get(id: "auto_abcdefgh1234")
122
122
  def get(id:, request_options: nil)
123
123
  response = @request_client.conn.get do |req|
124
124
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
125
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
125
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
126
126
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
127
127
  req.headers = {
128
128
  **(req.headers || {}),
@@ -149,13 +149,13 @@ module Ittybit
149
149
  # api = Ittybit::Client.new(
150
150
  # base_url: "https://api.example.com",
151
151
  # environment: Ittybit::Environment::DEFAULT,
152
- # token: "YOUR_AUTH_TOKEN"
152
+ # api_key: "YOUR_AUTH_TOKEN"
153
153
  # )
154
154
  # api.automations.delete(id: "auto_abcdefgh1234")
155
155
  def delete(id:, request_options: nil)
156
156
  response = @request_client.conn.delete do |req|
157
157
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
158
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
158
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
159
159
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
160
160
  req.headers = {
161
161
  **(req.headers || {}),
@@ -193,7 +193,7 @@ module Ittybit
193
193
  # api = Ittybit::Client.new(
194
194
  # base_url: "https://api.example.com",
195
195
  # environment: Ittybit::Environment::DEFAULT,
196
- # token: "YOUR_AUTH_TOKEN"
196
+ # api_key: "YOUR_AUTH_TOKEN"
197
197
  # )
198
198
  # api.automations.update(
199
199
  # id: "auto_abcdefgh1234",
@@ -204,7 +204,7 @@ module Ittybit
204
204
  def update(id:, name: nil, description: nil, trigger: nil, workflow: nil, status: nil, request_options: nil)
205
205
  response = @request_client.conn.patch do |req|
206
206
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
207
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
207
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
208
208
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
209
209
  req.headers = {
210
210
  **(req.headers || {}),
@@ -238,7 +238,7 @@ module Ittybit
238
238
  @request_client = request_client
239
239
  end
240
240
 
241
- # Retrieves a paginated list of all automations for the current project
241
+ # Retrieves a paginated list of all automations for the current project.
242
242
  #
243
243
  # @param page [Integer]
244
244
  # @param limit [Integer]
@@ -248,14 +248,14 @@ module Ittybit
248
248
  # api = Ittybit::Client.new(
249
249
  # base_url: "https://api.example.com",
250
250
  # environment: Ittybit::Environment::DEFAULT,
251
- # token: "YOUR_AUTH_TOKEN"
251
+ # api_key: "YOUR_AUTH_TOKEN"
252
252
  # )
253
253
  # api.automations.list
254
254
  def list(page: nil, limit: nil, request_options: nil)
255
255
  Async do
256
256
  response = @request_client.conn.get do |req|
257
257
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
258
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
258
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
259
259
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
260
260
  req.headers = {
261
261
  **(req.headers || {}),
@@ -290,7 +290,7 @@ module Ittybit
290
290
  # api = Ittybit::Client.new(
291
291
  # base_url: "https://api.example.com",
292
292
  # environment: Ittybit::Environment::DEFAULT,
293
- # token: "YOUR_AUTH_TOKEN"
293
+ # api_key: "YOUR_AUTH_TOKEN"
294
294
  # )
295
295
  # api.automations.create(
296
296
  # name: "My Example Automation",
@@ -303,7 +303,7 @@ module Ittybit
303
303
  Async do
304
304
  response = @request_client.conn.post do |req|
305
305
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
306
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
306
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
307
307
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
308
308
  req.headers = {
309
309
  **(req.headers || {}),
@@ -336,14 +336,14 @@ module Ittybit
336
336
  # api = Ittybit::Client.new(
337
337
  # base_url: "https://api.example.com",
338
338
  # environment: Ittybit::Environment::DEFAULT,
339
- # token: "YOUR_AUTH_TOKEN"
339
+ # api_key: "YOUR_AUTH_TOKEN"
340
340
  # )
341
341
  # api.automations.get(id: "auto_abcdefgh1234")
342
342
  def get(id:, request_options: nil)
343
343
  Async do
344
344
  response = @request_client.conn.get do |req|
345
345
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
346
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
346
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
347
347
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
348
348
  req.headers = {
349
349
  **(req.headers || {}),
@@ -371,14 +371,14 @@ module Ittybit
371
371
  # api = Ittybit::Client.new(
372
372
  # base_url: "https://api.example.com",
373
373
  # environment: Ittybit::Environment::DEFAULT,
374
- # token: "YOUR_AUTH_TOKEN"
374
+ # api_key: "YOUR_AUTH_TOKEN"
375
375
  # )
376
376
  # api.automations.delete(id: "auto_abcdefgh1234")
377
377
  def delete(id:, request_options: nil)
378
378
  Async do
379
379
  response = @request_client.conn.delete do |req|
380
380
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
381
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
381
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
382
382
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
383
383
  req.headers = {
384
384
  **(req.headers || {}),
@@ -417,7 +417,7 @@ module Ittybit
417
417
  # api = Ittybit::Client.new(
418
418
  # base_url: "https://api.example.com",
419
419
  # environment: Ittybit::Environment::DEFAULT,
420
- # token: "YOUR_AUTH_TOKEN"
420
+ # api_key: "YOUR_AUTH_TOKEN"
421
421
  # )
422
422
  # api.automations.update(
423
423
  # id: "auto_abcdefgh1234",
@@ -429,7 +429,7 @@ module Ittybit
429
429
  Async do
430
430
  response = @request_client.conn.patch do |req|
431
431
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
432
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
432
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
433
433
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
434
434
  req.headers = {
435
435
  **(req.headers || {}),
@@ -27,13 +27,13 @@ module Ittybit
27
27
  # api = Ittybit::Client.new(
28
28
  # base_url: "https://api.example.com",
29
29
  # environment: Ittybit::Environment::DEFAULT,
30
- # token: "YOUR_AUTH_TOKEN"
30
+ # api_key: "YOUR_AUTH_TOKEN"
31
31
  # )
32
32
  # api.files.list
33
33
  def list(page: nil, limit: nil, request_options: nil)
34
34
  response = @request_client.conn.get do |req|
35
35
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
36
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
36
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
37
37
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
38
38
  req.headers = {
39
39
  **(req.headers || {}),
@@ -63,18 +63,18 @@ module Ittybit
63
63
  # api = Ittybit::Client.new(
64
64
  # base_url: "https://api.example.com",
65
65
  # environment: Ittybit::Environment::DEFAULT,
66
- # token: "YOUR_AUTH_TOKEN"
66
+ # api_key: "YOUR_AUTH_TOKEN"
67
67
  # )
68
68
  # api.files.create(
69
69
  # url: "https://ittyb.it/sample.mp4",
70
70
  # folder: "ittybit/samples",
71
71
  # filename: "video.mp4",
72
- # metadata: { "customKey2": "a different custom value" }
72
+ # metadata: { "customKey": "your custom value" }
73
73
  # )
74
74
  def create(url:, media_id: nil, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
75
75
  response = @request_client.conn.post do |req|
76
76
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
77
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
77
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
78
78
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
79
79
  req.headers = {
80
80
  **(req.headers || {}),
@@ -107,13 +107,13 @@ module Ittybit
107
107
  # api = Ittybit::Client.new(
108
108
  # base_url: "https://api.example.com",
109
109
  # environment: Ittybit::Environment::DEFAULT,
110
- # token: "YOUR_AUTH_TOKEN"
110
+ # api_key: "YOUR_AUTH_TOKEN"
111
111
  # )
112
112
  # api.files.get(id: "file_abcdefgh1234")
113
113
  def get(id:, request_options: nil)
114
114
  response = @request_client.conn.get do |req|
115
115
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
116
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
116
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
117
117
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
118
118
  req.headers = {
119
119
  **(req.headers || {}),
@@ -140,13 +140,13 @@ module Ittybit
140
140
  # api = Ittybit::Client.new(
141
141
  # base_url: "https://api.example.com",
142
142
  # environment: Ittybit::Environment::DEFAULT,
143
- # token: "YOUR_AUTH_TOKEN"
143
+ # api_key: "YOUR_AUTH_TOKEN"
144
144
  # )
145
145
  # api.files.delete(id: "file_abcdefgh1234")
146
146
  def delete(id:, request_options: nil)
147
147
  response = @request_client.conn.delete do |req|
148
148
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
149
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
149
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
150
150
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
151
151
  req.headers = {
152
152
  **(req.headers || {}),
@@ -178,7 +178,7 @@ module Ittybit
178
178
  # api = Ittybit::Client.new(
179
179
  # base_url: "https://api.example.com",
180
180
  # environment: Ittybit::Environment::DEFAULT,
181
- # token: "YOUR_AUTH_TOKEN"
181
+ # api_key: "YOUR_AUTH_TOKEN"
182
182
  # )
183
183
  # api.files.update(
184
184
  # id: "file_abcdefgh1234",
@@ -189,7 +189,7 @@ module Ittybit
189
189
  def update(id:, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
190
190
  response = @request_client.conn.patch do |req|
191
191
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
192
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
192
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
193
193
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
194
194
  req.headers = {
195
195
  **(req.headers || {}),
@@ -232,14 +232,14 @@ module Ittybit
232
232
  # api = Ittybit::Client.new(
233
233
  # base_url: "https://api.example.com",
234
234
  # environment: Ittybit::Environment::DEFAULT,
235
- # token: "YOUR_AUTH_TOKEN"
235
+ # api_key: "YOUR_AUTH_TOKEN"
236
236
  # )
237
237
  # api.files.list
238
238
  def list(page: nil, limit: nil, request_options: nil)
239
239
  Async do
240
240
  response = @request_client.conn.get do |req|
241
241
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
242
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
242
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
243
243
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
244
244
  req.headers = {
245
245
  **(req.headers || {}),
@@ -270,19 +270,19 @@ module Ittybit
270
270
  # api = Ittybit::Client.new(
271
271
  # base_url: "https://api.example.com",
272
272
  # environment: Ittybit::Environment::DEFAULT,
273
- # token: "YOUR_AUTH_TOKEN"
273
+ # api_key: "YOUR_AUTH_TOKEN"
274
274
  # )
275
275
  # api.files.create(
276
276
  # url: "https://ittyb.it/sample.mp4",
277
277
  # folder: "ittybit/samples",
278
278
  # filename: "video.mp4",
279
- # metadata: { "customKey2": "a different custom value" }
279
+ # metadata: { "customKey": "your custom value" }
280
280
  # )
281
281
  def create(url:, media_id: nil, folder: nil, filename: nil, ref: nil, metadata: nil, request_options: nil)
282
282
  Async do
283
283
  response = @request_client.conn.post do |req|
284
284
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
285
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
285
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
286
286
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
287
287
  req.headers = {
288
288
  **(req.headers || {}),
@@ -316,14 +316,14 @@ module Ittybit
316
316
  # api = Ittybit::Client.new(
317
317
  # base_url: "https://api.example.com",
318
318
  # environment: Ittybit::Environment::DEFAULT,
319
- # token: "YOUR_AUTH_TOKEN"
319
+ # api_key: "YOUR_AUTH_TOKEN"
320
320
  # )
321
321
  # api.files.get(id: "file_abcdefgh1234")
322
322
  def get(id:, request_options: nil)
323
323
  Async do
324
324
  response = @request_client.conn.get do |req|
325
325
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
326
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
326
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
327
327
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
328
328
  req.headers = {
329
329
  **(req.headers || {}),
@@ -351,14 +351,14 @@ module Ittybit
351
351
  # api = Ittybit::Client.new(
352
352
  # base_url: "https://api.example.com",
353
353
  # environment: Ittybit::Environment::DEFAULT,
354
- # token: "YOUR_AUTH_TOKEN"
354
+ # api_key: "YOUR_AUTH_TOKEN"
355
355
  # )
356
356
  # api.files.delete(id: "file_abcdefgh1234")
357
357
  def delete(id:, request_options: nil)
358
358
  Async do
359
359
  response = @request_client.conn.delete do |req|
360
360
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
361
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
361
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
362
362
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
363
363
  req.headers = {
364
364
  **(req.headers || {}),
@@ -391,7 +391,7 @@ module Ittybit
391
391
  # api = Ittybit::Client.new(
392
392
  # base_url: "https://api.example.com",
393
393
  # environment: Ittybit::Environment::DEFAULT,
394
- # token: "YOUR_AUTH_TOKEN"
394
+ # api_key: "YOUR_AUTH_TOKEN"
395
395
  # )
396
396
  # api.files.update(
397
397
  # id: "file_abcdefgh1234",
@@ -403,7 +403,7 @@ module Ittybit
403
403
  Async do
404
404
  response = @request_client.conn.patch do |req|
405
405
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
406
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
406
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
407
407
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
408
408
  req.headers = {
409
409
  **(req.headers || {}),
@@ -17,7 +17,7 @@ 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
22
  # @param page [Integer]
23
23
  # @param limit [Integer]
@@ -27,13 +27,13 @@ module Ittybit
27
27
  # api = Ittybit::Client.new(
28
28
  # base_url: "https://api.example.com",
29
29
  # environment: Ittybit::Environment::DEFAULT,
30
- # token: "YOUR_AUTH_TOKEN"
30
+ # api_key: "YOUR_AUTH_TOKEN"
31
31
  # )
32
32
  # api.media.list
33
33
  def list(page: nil, limit: nil, request_options: nil)
34
34
  response = @request_client.conn.get do |req|
35
35
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
36
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
36
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
37
37
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
38
38
  req.headers = {
39
39
  **(req.headers || {}),
@@ -60,7 +60,7 @@ module Ittybit
60
60
  # api = Ittybit::Client.new(
61
61
  # base_url: "https://api.example.com",
62
62
  # environment: Ittybit::Environment::DEFAULT,
63
- # token: "YOUR_AUTH_TOKEN"
63
+ # api_key: "YOUR_AUTH_TOKEN"
64
64
  # )
65
65
  # api.media.create(
66
66
  # title: "My Video Example",
@@ -70,7 +70,7 @@ module Ittybit
70
70
  def create(title: nil, alt: nil, metadata: nil, request_options: nil)
71
71
  response = @request_client.conn.post do |req|
72
72
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
73
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
73
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
74
74
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
75
75
  req.headers = {
76
76
  **(req.headers || {}),
@@ -100,13 +100,13 @@ module Ittybit
100
100
  # api = Ittybit::Client.new(
101
101
  # base_url: "https://api.example.com",
102
102
  # environment: Ittybit::Environment::DEFAULT,
103
- # token: "YOUR_AUTH_TOKEN"
103
+ # api_key: "YOUR_AUTH_TOKEN"
104
104
  # )
105
105
  # api.media.get(id: "med_abcdefgh1234")
106
106
  def get(id:, request_options: nil)
107
107
  response = @request_client.conn.get do |req|
108
108
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
109
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
109
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
110
110
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
111
111
  req.headers = {
112
112
  **(req.headers || {}),
@@ -134,13 +134,13 @@ module Ittybit
134
134
  # api = Ittybit::Client.new(
135
135
  # base_url: "https://api.example.com",
136
136
  # environment: Ittybit::Environment::DEFAULT,
137
- # token: "YOUR_AUTH_TOKEN"
137
+ # api_key: "YOUR_AUTH_TOKEN"
138
138
  # )
139
139
  # api.media.delete(id: "med_abcdefgh1234")
140
140
  def delete(id:, request_options: nil)
141
141
  response = @request_client.conn.delete do |req|
142
142
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
143
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
143
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
144
144
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
145
145
  req.headers = {
146
146
  **(req.headers || {}),
@@ -171,7 +171,7 @@ module Ittybit
171
171
  # api = Ittybit::Client.new(
172
172
  # base_url: "https://api.example.com",
173
173
  # environment: Ittybit::Environment::DEFAULT,
174
- # token: "YOUR_AUTH_TOKEN"
174
+ # api_key: "YOUR_AUTH_TOKEN"
175
175
  # )
176
176
  # api.media.update(
177
177
  # id: "med_abcdefgh1234",
@@ -182,7 +182,7 @@ module Ittybit
182
182
  def update(id:, title: nil, alt: nil, metadata: nil, request_options: nil)
183
183
  response = @request_client.conn.patch do |req|
184
184
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
185
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
185
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
186
186
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
187
187
  req.headers = {
188
188
  **(req.headers || {}),
@@ -214,7 +214,7 @@ module Ittybit
214
214
  @request_client = request_client
215
215
  end
216
216
 
217
- # Retrieves a paginated list of all media for the current project
217
+ # Retrieves a paginated list of all media for the current project.
218
218
  #
219
219
  # @param page [Integer]
220
220
  # @param limit [Integer]
@@ -224,14 +224,14 @@ module Ittybit
224
224
  # api = Ittybit::Client.new(
225
225
  # base_url: "https://api.example.com",
226
226
  # environment: Ittybit::Environment::DEFAULT,
227
- # token: "YOUR_AUTH_TOKEN"
227
+ # api_key: "YOUR_AUTH_TOKEN"
228
228
  # )
229
229
  # api.media.list
230
230
  def list(page: nil, limit: nil, request_options: nil)
231
231
  Async do
232
232
  response = @request_client.conn.get do |req|
233
233
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
234
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
234
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
235
235
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
236
236
  req.headers = {
237
237
  **(req.headers || {}),
@@ -259,7 +259,7 @@ module Ittybit
259
259
  # api = Ittybit::Client.new(
260
260
  # base_url: "https://api.example.com",
261
261
  # environment: Ittybit::Environment::DEFAULT,
262
- # token: "YOUR_AUTH_TOKEN"
262
+ # api_key: "YOUR_AUTH_TOKEN"
263
263
  # )
264
264
  # api.media.create(
265
265
  # title: "My Video Example",
@@ -270,7 +270,7 @@ module Ittybit
270
270
  Async do
271
271
  response = @request_client.conn.post do |req|
272
272
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
273
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
273
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
274
274
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
275
275
  req.headers = {
276
276
  **(req.headers || {}),
@@ -301,14 +301,14 @@ module Ittybit
301
301
  # api = Ittybit::Client.new(
302
302
  # base_url: "https://api.example.com",
303
303
  # environment: Ittybit::Environment::DEFAULT,
304
- # token: "YOUR_AUTH_TOKEN"
304
+ # api_key: "YOUR_AUTH_TOKEN"
305
305
  # )
306
306
  # api.media.get(id: "med_abcdefgh1234")
307
307
  def get(id:, request_options: nil)
308
308
  Async do
309
309
  response = @request_client.conn.get do |req|
310
310
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
311
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
311
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
312
312
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
313
313
  req.headers = {
314
314
  **(req.headers || {}),
@@ -337,14 +337,14 @@ module Ittybit
337
337
  # api = Ittybit::Client.new(
338
338
  # base_url: "https://api.example.com",
339
339
  # environment: Ittybit::Environment::DEFAULT,
340
- # token: "YOUR_AUTH_TOKEN"
340
+ # api_key: "YOUR_AUTH_TOKEN"
341
341
  # )
342
342
  # api.media.delete(id: "med_abcdefgh1234")
343
343
  def delete(id:, request_options: nil)
344
344
  Async do
345
345
  response = @request_client.conn.delete do |req|
346
346
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
347
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
347
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
348
348
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
349
349
  req.headers = {
350
350
  **(req.headers || {}),
@@ -376,7 +376,7 @@ module Ittybit
376
376
  # api = Ittybit::Client.new(
377
377
  # base_url: "https://api.example.com",
378
378
  # environment: Ittybit::Environment::DEFAULT,
379
- # token: "YOUR_AUTH_TOKEN"
379
+ # api_key: "YOUR_AUTH_TOKEN"
380
380
  # )
381
381
  # api.media.update(
382
382
  # id: "med_abcdefgh1234",
@@ -388,7 +388,7 @@ module Ittybit
388
388
  Async do
389
389
  response = @request_client.conn.patch do |req|
390
390
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
391
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
391
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
392
392
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
393
393
  req.headers = {
394
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
- # token: "YOUR_AUTH_TOKEN"
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.token unless request_options&.token.nil?
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
- # token: "YOUR_AUTH_TOKEN"
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.token unless request_options&.token.nil?
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 || {}),
@@ -17,6 +17,8 @@ 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
+ #
20
22
  # @param page [Integer]
21
23
  # @param limit [Integer]
22
24
  # @param request_options [Ittybit::RequestOptions]
@@ -25,13 +27,13 @@ module Ittybit
25
27
  # api = Ittybit::Client.new(
26
28
  # base_url: "https://api.example.com",
27
29
  # environment: Ittybit::Environment::DEFAULT,
28
- # token: "YOUR_AUTH_TOKEN"
30
+ # api_key: "YOUR_AUTH_TOKEN"
29
31
  # )
30
32
  # api.tasks.list
31
33
  def list(page: nil, limit: nil, request_options: nil)
32
34
  response = @request_client.conn.get do |req|
33
35
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
34
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
36
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
35
37
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
36
38
  req.headers = {
37
39
  **(req.headers || {}),
@@ -57,13 +59,13 @@ module Ittybit
57
59
  # api = Ittybit::Client.new(
58
60
  # base_url: "https://api.example.com",
59
61
  # environment: Ittybit::Environment::DEFAULT,
60
- # token: "YOUR_AUTH_TOKEN"
62
+ # api_key: "YOUR_AUTH_TOKEN"
61
63
  # )
62
64
  # api.tasks.create(request: {"file_id":"file_abcdefgh1234","kind":"image","width":320,"format":"png","ref":"thumbnail"})
63
65
  def create(request: nil, request_options: nil)
64
66
  response = @request_client.conn.post do |req|
65
67
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
66
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
68
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
67
69
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
68
70
  req.headers = {
69
71
  **(req.headers || {}),
@@ -88,13 +90,13 @@ module Ittybit
88
90
  # api = Ittybit::Client.new(
89
91
  # base_url: "https://api.example.com",
90
92
  # environment: Ittybit::Environment::DEFAULT,
91
- # token: "YOUR_AUTH_TOKEN"
93
+ # api_key: "YOUR_AUTH_TOKEN"
92
94
  # )
93
95
  # api.tasks.get(id: "task_abcdefgh1234")
94
96
  def get(id:, request_options: nil)
95
97
  response = @request_client.conn.get do |req|
96
98
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
97
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
99
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
98
100
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
99
101
  req.headers = {
100
102
  **(req.headers || {}),
@@ -120,13 +122,13 @@ module Ittybit
120
122
  # api = Ittybit::Client.new(
121
123
  # base_url: "https://api.example.com",
122
124
  # environment: Ittybit::Environment::DEFAULT,
123
- # token: "YOUR_AUTH_TOKEN"
125
+ # api_key: "YOUR_AUTH_TOKEN"
124
126
  # )
125
127
  # api.tasks.get_task_config
126
128
  def get_task_config(request_options: nil)
127
129
  response = @request_client.conn.get do |req|
128
130
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
129
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
131
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
130
132
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
131
133
  req.headers = {
132
134
  **(req.headers || {}),
@@ -155,6 +157,8 @@ module Ittybit
155
157
  @request_client = request_client
156
158
  end
157
159
 
160
+ # Retrieves a paginated list of all tasks for the current project.
161
+ #
158
162
  # @param page [Integer]
159
163
  # @param limit [Integer]
160
164
  # @param request_options [Ittybit::RequestOptions]
@@ -163,14 +167,14 @@ module Ittybit
163
167
  # api = Ittybit::Client.new(
164
168
  # base_url: "https://api.example.com",
165
169
  # environment: Ittybit::Environment::DEFAULT,
166
- # token: "YOUR_AUTH_TOKEN"
170
+ # api_key: "YOUR_AUTH_TOKEN"
167
171
  # )
168
172
  # api.tasks.list
169
173
  def list(page: nil, limit: nil, request_options: nil)
170
174
  Async do
171
175
  response = @request_client.conn.get do |req|
172
176
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
173
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
177
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
174
178
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
175
179
  req.headers = {
176
180
  **(req.headers || {}),
@@ -197,14 +201,14 @@ module Ittybit
197
201
  # api = Ittybit::Client.new(
198
202
  # base_url: "https://api.example.com",
199
203
  # environment: Ittybit::Environment::DEFAULT,
200
- # token: "YOUR_AUTH_TOKEN"
204
+ # api_key: "YOUR_AUTH_TOKEN"
201
205
  # )
202
206
  # api.tasks.create(request: {"file_id":"file_abcdefgh1234","kind":"image","width":320,"format":"png","ref":"thumbnail"})
203
207
  def create(request: nil, request_options: nil)
204
208
  Async do
205
209
  response = @request_client.conn.post do |req|
206
210
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
207
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
211
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
208
212
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
209
213
  req.headers = {
210
214
  **(req.headers || {}),
@@ -230,14 +234,14 @@ module Ittybit
230
234
  # api = Ittybit::Client.new(
231
235
  # base_url: "https://api.example.com",
232
236
  # environment: Ittybit::Environment::DEFAULT,
233
- # token: "YOUR_AUTH_TOKEN"
237
+ # api_key: "YOUR_AUTH_TOKEN"
234
238
  # )
235
239
  # api.tasks.get(id: "task_abcdefgh1234")
236
240
  def get(id:, request_options: nil)
237
241
  Async do
238
242
  response = @request_client.conn.get do |req|
239
243
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
240
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
244
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
241
245
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
242
246
  req.headers = {
243
247
  **(req.headers || {}),
@@ -264,14 +268,14 @@ module Ittybit
264
268
  # api = Ittybit::Client.new(
265
269
  # base_url: "https://api.example.com",
266
270
  # environment: Ittybit::Environment::DEFAULT,
267
- # token: "YOUR_AUTH_TOKEN"
271
+ # api_key: "YOUR_AUTH_TOKEN"
268
272
  # )
269
273
  # api.tasks.get_task_config
270
274
  def get_task_config(request_options: nil)
271
275
  Async do
272
276
  response = @request_client.conn.get do |req|
273
277
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
274
- req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
278
+ req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
275
279
  req.headers["ACCEPT_VERSION"] = request_options.version unless request_options&.version.nil?
276
280
  req.headers = {
277
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 token [String]
29
+ # @param api_key [String]
30
30
  # @param version [String]
31
31
  # @return [Ittybit::Client]
32
- def initialize(token:, base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
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
- token: token,
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 token [String]
66
+ # @param api_key [String]
67
67
  # @param version [String]
68
68
  # @return [Ittybit::AsyncClient]
69
- def initialize(token:, base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
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
- token: token,
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 :token
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 token [String]
23
+ # @param api_key [String]
24
24
  # @param version [String]
25
25
  # @return [Ittybit::RequestClient]
26
- def initialize(token:, base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
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
- @token = "Bearer #{token}"
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.7" }
50
- headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless @token.nil?
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 :token
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 token [String]
69
+ # @param api_key [String]
70
70
  # @param version [String]
71
71
  # @return [Ittybit::AsyncRequestClient]
72
- def initialize(token:, base_url: nil, environment: Ittybit::Environment::DEFAULT, max_retries: nil,
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
- @token = "Bearer #{token}"
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.7" }
97
- headers["Authorization"] = ((@token.is_a? Method) ? @token.call : @token) unless @token.nil?
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,7 +105,7 @@ module Ittybit
105
105
  # @return [String]
106
106
  attr_reader :base_url
107
107
  # @return [String]
108
- attr_reader :token
108
+ attr_reader :api_key
109
109
  # @return [String]
110
110
  attr_reader :version
111
111
  # @return [Hash{String => Object}]
@@ -118,17 +118,17 @@ module Ittybit
118
118
  attr_reader :timeout_in_seconds
119
119
 
120
120
  # @param base_url [String]
121
- # @param token [String]
121
+ # @param api_key [String]
122
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, token: nil, version: nil, additional_headers: nil, additional_query_parameters: 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
- @token = token
131
+ @api_key = api_key
132
132
  @version = version
133
133
  @additional_headers = additional_headers
134
134
  @additional_query_parameters = additional_query_parameters
@@ -143,7 +143,7 @@ module Ittybit
143
143
  # @return [String]
144
144
  attr_reader :base_url
145
145
  # @return [String]
146
- attr_reader :token
146
+ attr_reader :api_key
147
147
  # @return [String]
148
148
  attr_reader :version
149
149
  # @return [Hash{String => Object}]
@@ -156,17 +156,17 @@ module Ittybit
156
156
  attr_reader :timeout_in_seconds
157
157
 
158
158
  # @param base_url [String]
159
- # @param token [String]
159
+ # @param api_key [String]
160
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, token: nil, version: nil, additional_headers: nil, additional_query_parameters: 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
- @token = token
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.7
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-07-08 00:00:00.000000000 Z
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