deepl-rb 2.5.3 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/add_issues_to_kanban.yml +16 -0
  3. data/.gitlab-ci.yml +135 -0
  4. data/.rubocop.yml +27 -0
  5. data/CHANGELOG.md +39 -0
  6. data/CODE_OF_CONDUCT.md +132 -0
  7. data/CONTRIBUTING.md +37 -0
  8. data/Gemfile +3 -1
  9. data/LICENSE.md +1 -0
  10. data/README.md +115 -5
  11. data/Rakefile +7 -5
  12. data/SECURITY.md +58 -0
  13. data/VERSION +1 -1
  14. data/deepl-rb.gemspec +36 -20
  15. data/lib/deepl/api.rb +11 -1
  16. data/lib/deepl/configuration.rb +34 -3
  17. data/lib/deepl/document_api.rb +121 -0
  18. data/lib/deepl/exceptions/authorization_failed.rb +3 -0
  19. data/lib/deepl/exceptions/bad_request.rb +3 -0
  20. data/lib/deepl/exceptions/document_translation_error.rb +15 -0
  21. data/lib/deepl/exceptions/error.rb +6 -0
  22. data/lib/deepl/exceptions/limit_exceeded.rb +7 -0
  23. data/lib/deepl/exceptions/not_found.rb +3 -0
  24. data/lib/deepl/exceptions/not_supported.rb +3 -0
  25. data/lib/deepl/exceptions/quota_exceeded.rb +3 -0
  26. data/lib/deepl/exceptions/request_entity_too_large.rb +3 -0
  27. data/lib/deepl/exceptions/request_error.rb +4 -2
  28. data/lib/deepl/exceptions/server_error.rb +18 -0
  29. data/lib/deepl/glossary_api.rb +3 -0
  30. data/lib/deepl/requests/base.rb +89 -34
  31. data/lib/deepl/requests/document/download.rb +44 -0
  32. data/lib/deepl/requests/document/get_status.rb +44 -0
  33. data/lib/deepl/requests/document/upload.rb +64 -0
  34. data/lib/deepl/requests/glossary/create.rb +15 -1
  35. data/lib/deepl/requests/glossary/destroy.rb +8 -1
  36. data/lib/deepl/requests/glossary/entries.rb +8 -1
  37. data/lib/deepl/requests/glossary/find.rb +8 -1
  38. data/lib/deepl/requests/glossary/language_pairs.rb +9 -2
  39. data/lib/deepl/requests/glossary/list.rb +9 -2
  40. data/lib/deepl/requests/languages.rb +9 -2
  41. data/lib/deepl/requests/translate.rb +33 -11
  42. data/lib/deepl/requests/usage.rb +9 -2
  43. data/lib/deepl/resources/base.rb +3 -0
  44. data/lib/deepl/resources/document_handle.rb +57 -0
  45. data/lib/deepl/resources/document_translation_status.rb +54 -0
  46. data/lib/deepl/resources/glossary.rb +3 -0
  47. data/lib/deepl/resources/language.rb +3 -0
  48. data/lib/deepl/resources/language_pair.rb +3 -0
  49. data/lib/deepl/resources/text.rb +3 -0
  50. data/lib/deepl/resources/usage.rb +3 -0
  51. data/lib/deepl/utils/backoff_timer.rb +46 -0
  52. data/lib/deepl/utils/exception_builder.rb +18 -13
  53. data/lib/deepl.rb +47 -0
  54. data/lib/http_client_options.rb +22 -0
  55. data/license_checker.sh +8 -0
  56. data/spec/api/api_spec.rb +8 -4
  57. data/spec/api/configuration_spec.rb +92 -18
  58. data/spec/api/deepl_spec.rb +225 -86
  59. data/spec/fixtures/vcr_cassettes/deepl_document.yml +95 -0
  60. data/spec/fixtures/vcr_cassettes/deepl_document_download.yml +1214 -0
  61. data/spec/fixtures/vcr_cassettes/deepl_glossaries.yml +812 -23
  62. data/spec/fixtures/vcr_cassettes/deepl_languages.yml +28 -17
  63. data/spec/fixtures/vcr_cassettes/deepl_translate.yml +161 -53
  64. data/spec/fixtures/vcr_cassettes/deepl_usage.yml +93 -3
  65. data/spec/fixtures/vcr_cassettes/glossaries.yml +1237 -15
  66. data/spec/fixtures/vcr_cassettes/languages.yml +159 -44
  67. data/spec/fixtures/vcr_cassettes/translate_texts.yml +9742 -12
  68. data/spec/fixtures/vcr_cassettes/usage.yml +134 -2
  69. data/spec/integration_tests/document_api_spec.rb +155 -0
  70. data/spec/integration_tests/integration_test_utils.rb +170 -0
  71. data/spec/requests/glossary/create_spec.rb +23 -13
  72. data/spec/requests/glossary/destroy_spec.rb +33 -17
  73. data/spec/requests/glossary/entries_spec.rb +31 -17
  74. data/spec/requests/glossary/find_spec.rb +31 -17
  75. data/spec/requests/glossary/language_pairs_spec.rb +17 -7
  76. data/spec/requests/glossary/list_spec.rb +21 -11
  77. data/spec/requests/languages_spec.rb +31 -21
  78. data/spec/requests/translate_spec.rb +125 -131
  79. data/spec/requests/usage_spec.rb +17 -7
  80. data/spec/resources/glossary_spec.rb +15 -12
  81. data/spec/resources/language_pair_spec.rb +10 -7
  82. data/spec/resources/language_spec.rb +21 -18
  83. data/spec/resources/text_spec.rb +10 -7
  84. data/spec/resources/usage_spec.rb +16 -13
  85. data/spec/spec_helper.rb +63 -6
  86. metadata +32 -9
@@ -2,42 +2,53 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api-free.deepl.com/v2/languages?type=target
5
+ uri: https://api.deepl.com/v2/languages
6
6
  body:
7
- encoding: US-ASCII
8
- string: ''
7
+ encoding: UTF-8
8
+ string: '{"type":"target"}'
9
9
  headers:
10
10
  Authorization:
11
11
  - DeepL-Auth-Key VALID_TOKEN
12
+ User-Agent:
13
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
14
+ Content-Type:
15
+ - application/json
12
16
  Accept-Encoding:
13
17
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
18
  Accept:
15
19
  - "*/*"
16
- User-Agent:
17
- - Ruby
18
20
  response:
19
21
  status:
20
22
  code: 200
21
23
  message: OK
22
24
  headers:
23
- Server:
24
- - nginx
25
25
  Date:
26
- - Mon, 17 May 2021 15:07:54 GMT
26
+ - Mon, 08 Jul 2024 11:28:09 GMT
27
27
  Content-Type:
28
28
  - application/json
29
- Content-Length:
30
- - '1667'
31
- Connection:
32
- - keep-alive
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Vary:
32
+ - Accept-Encoding
33
33
  Access-Control-Allow-Origin:
34
34
  - "*"
35
+ X-Cache-Status:
36
+ - MISS
37
+ Strict-Transport-Security:
38
+ - max-age=63072000; includeSubDomains; preload
39
+ Server-Timing:
40
+ - l7_lb_tls;dur=99, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=142
41
+ Access-Control-Expose-Headers:
42
+ - Server-Timing, X-Trace-ID
43
+ X-Trace-Id:
44
+ - 245e59cedea848ef8c7ccb7d15a71aea
35
45
  body:
36
- encoding: UTF-8
46
+ encoding: ASCII-8BIT
37
47
  string: '[{"language":"BG","name":"Bulgarian","supports_formality":false},{"language":"CS","name":"Czech","supports_formality":false},{"language":"DA","name":"Danish","supports_formality":false},{"language":"DE","name":"German","supports_formality":true},{"language":"EL","name":"Greek","supports_formality":false},{"language":"EN-GB","name":"English
38
48
  (British)","supports_formality":false},{"language":"EN-US","name":"English
39
- (American)","supports_formality":false},{"language":"ES","name":"Spanish","supports_formality":true},{"language":"ET","name":"Estonian","supports_formality":false},{"language":"FI","name":"Finnish","supports_formality":false},{"language":"FR","name":"French","supports_formality":true},{"language":"HU","name":"Hungarian","supports_formality":false},{"language":"IT","name":"Italian","supports_formality":true},{"language":"JA","name":"Japanese","supports_formality":false},{"language":"LT","name":"Lithuanian","supports_formality":false},{"language":"LV","name":"Latvian","supports_formality":false},{"language":"NL","name":"Dutch","supports_formality":true},{"language":"PL","name":"Polish","supports_formality":true},{"language":"PT-BR","name":"Portuguese
49
+ (American)","supports_formality":false},{"language":"ES","name":"Spanish","supports_formality":true},{"language":"ET","name":"Estonian","supports_formality":false},{"language":"FI","name":"Finnish","supports_formality":false},{"language":"FR","name":"French","supports_formality":true},{"language":"HU","name":"Hungarian","supports_formality":false},{"language":"ID","name":"Indonesian","supports_formality":false},{"language":"IT","name":"Italian","supports_formality":true},{"language":"JA","name":"Japanese","supports_formality":true},{"language":"KO","name":"Korean","supports_formality":false},{"language":"LT","name":"Lithuanian","supports_formality":false},{"language":"LV","name":"Latvian","supports_formality":false},{"language":"NB","name":"Norwegian","supports_formality":false},{"language":"NL","name":"Dutch","supports_formality":true},{"language":"PL","name":"Polish","supports_formality":true},{"language":"PT-BR","name":"Portuguese
40
50
  (Brazilian)","supports_formality":true},{"language":"PT-PT","name":"Portuguese
41
- (European)","supports_formality":true},{"language":"RO","name":"Romanian","supports_formality":false},{"language":"RU","name":"Russian","supports_formality":true},{"language":"SK","name":"Slovak","supports_formality":false},{"language":"SL","name":"Slovenian","supports_formality":false},{"language":"SV","name":"Swedish","supports_formality":false},{"language":"ZH","name":"Chinese","supports_formality":false}]'
42
- recorded_at: Mon, 17 May 2021 15:07:54 GMT
43
- recorded_with: VCR 6.0.0
51
+ (European)","supports_formality":true},{"language":"RO","name":"Romanian","supports_formality":false},{"language":"RU","name":"Russian","supports_formality":true},{"language":"SK","name":"Slovak","supports_formality":false},{"language":"SL","name":"Slovenian","supports_formality":false},{"language":"SV","name":"Swedish","supports_formality":false},{"language":"TR","name":"Turkish","supports_formality":false},{"language":"UK","name":"Ukrainian","supports_formality":false},{"language":"ZH","name":"Chinese
52
+ (simplified)","supports_formality":false}]'
53
+ recorded_at: Mon, 08 Jul 2024 11:28:09 GMT
54
+ recorded_with: VCR 6.2.0
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - Ruby
17
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
18
18
  Content-Type:
19
19
  - application/x-www-form-urlencoded
20
20
  response:
@@ -52,7 +52,7 @@ http_interactions:
52
52
  Accept:
53
53
  - "*/*"
54
54
  User-Agent:
55
- - Ruby
55
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
56
56
  Content-Type:
57
57
  - application/x-www-form-urlencoded
58
58
  response:
@@ -88,7 +88,7 @@ http_interactions:
88
88
  Accept:
89
89
  - "*/*"
90
90
  User-Agent:
91
- - Ruby
91
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
92
92
  Content-Type:
93
93
  - application/x-www-form-urlencoded
94
94
  response:
@@ -113,11 +113,11 @@ http_interactions:
113
113
  string: '{"translations":[{"detected_source_language":"EN","text":"Hola Tierra"}]}'
114
114
  recorded_at: Mon, 24 Jan 2022 23:22:47 GMT
115
115
  - request:
116
- method: delete
117
- uri: https://api-free.deepl.com/v2/glossaries/c8ec9224-f13c-4af5-94eb-25e2d6112d34
116
+ method: post
117
+ uri: https://api.deepl.com/v2/translate?param=fake
118
118
  body:
119
119
  encoding: US-ASCII
120
- string: ''
120
+ string: text=Sample&source_lang=EN&target_lang=ES
121
121
  headers:
122
122
  Authorization:
123
123
  - DeepL-Auth-Key VALID_TOKEN
@@ -126,125 +126,233 @@ http_interactions:
126
126
  Accept:
127
127
  - "*/*"
128
128
  User-Agent:
129
- - Ruby
129
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
130
+ Content-Type:
131
+ - application/x-www-form-urlencoded
130
132
  response:
131
133
  status:
132
- code: 204
133
- message: No Content
134
+ code: 200
135
+ message: OK
134
136
  headers:
135
137
  Server:
136
138
  - nginx
137
139
  Date:
138
- - Mon, 24 Jan 2022 23:22:48 GMT
139
- Connection:
140
- - keep-alive
140
+ - Wed, 01 Feb 2023 14:39:00 GMT
141
+ Content-Type:
142
+ - application/json
143
+ Transfer-Encoding:
144
+ - chunked
145
+ Access-Control-Allow-Origin:
146
+ - "*"
147
+ Strict-Transport-Security:
148
+ - max-age=63072000; includeSubDomains; preload
149
+ body:
150
+ encoding: ASCII-8BIT
151
+ string: '{"translations":[{"detected_source_language":"EN","text":"Muestra"}]}'
152
+ recorded_at: Wed, 01 Feb 2023 14:39:00 GMT
153
+ - request:
154
+ method: post
155
+ uri: https://api.deepl.com/v2/translate
156
+ body:
157
+ encoding: UTF-8
158
+ string: '{"text":"Sample","source_lang":"EN","target_lang":"ES","param":"fake"}'
159
+ headers:
160
+ Authorization:
161
+ - DeepL-Auth-Key VALID_TOKEN
162
+ User-Agent:
163
+ - deepl-ruby/2.5.3(darwin23) ruby/3.3.3
164
+ Content-Type:
165
+ - application/json
166
+ Accept-Encoding:
167
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
168
+ Accept:
169
+ - "*/*"
170
+ response:
171
+ status:
172
+ code: 403
173
+ message: Forbidden
174
+ headers:
175
+ Date:
176
+ - Tue, 02 Jul 2024 13:44:23 GMT
177
+ Transfer-Encoding:
178
+ - chunked
179
+ Access-Control-Allow-Origin:
180
+ - "*"
181
+ Strict-Transport-Security:
182
+ - max-age=63072000; includeSubDomains; preload
183
+ Server-Timing:
184
+ - l7_lb_tls;dur=101, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=107
185
+ Access-Control-Expose-Headers:
186
+ - Server-Timing, X-Trace-ID
187
+ X-Trace-Id:
188
+ - d76fa5ee2e5643368519529f5de9d4ea
141
189
  body:
142
190
  encoding: UTF-8
143
191
  string: ''
144
- recorded_at: Mon, 24 Jan 2022 23:22:48 GMT
192
+ recorded_at: Tue, 02 Jul 2024 13:44:23 GMT
145
193
  - request:
146
194
  method: post
147
- uri: https://api-free.deepl.com/v2/glossaries
195
+ uri: https://api.deepl.com/v2/translate
148
196
  body:
149
- encoding: US-ASCII
150
- string: name=fixture&source_lang=EN&target_lang=ES&entries=car%09auto%0A&entries_format=tsv
197
+ encoding: UTF-8
198
+ string: '{"text":["Sample"],"source_lang":"EN","target_lang":"ES","param":"fake"}'
151
199
  headers:
152
200
  Authorization:
153
201
  - DeepL-Auth-Key VALID_TOKEN
202
+ User-Agent:
203
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
204
+ Content-Type:
205
+ - application/json
154
206
  Accept-Encoding:
155
207
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
156
208
  Accept:
157
209
  - "*/*"
210
+ response:
211
+ status:
212
+ code: 200
213
+ message: OK
214
+ headers:
215
+ Date:
216
+ - Tue, 02 Jul 2024 16:02:26 GMT
217
+ Content-Type:
218
+ - application/json
219
+ Transfer-Encoding:
220
+ - chunked
221
+ Vary:
222
+ - Accept-Encoding
223
+ Access-Control-Allow-Origin:
224
+ - "*"
225
+ Strict-Transport-Security:
226
+ - max-age=63072000; includeSubDomains; preload
227
+ Server-Timing:
228
+ - l7_lb_tls;dur=111, l7_lb_idle;dur=2, l7_lb_receive;dur=0, l7_lb_total;dur=164
229
+ Access-Control-Expose-Headers:
230
+ - Server-Timing, X-Trace-ID
231
+ X-Trace-Id:
232
+ - 7085263a2c734f6bbc0ef2a3248d11a2
233
+ body:
234
+ encoding: ASCII-8BIT
235
+ string: '{"translations":[{"detected_source_language":"EN","text":"Muestra"}]}'
236
+ recorded_at: Tue, 02 Jul 2024 16:02:26 GMT
237
+ - request:
238
+ method: post
239
+ uri: https://api.deepl.com/v2/glossaries
240
+ body:
241
+ encoding: UTF-8
242
+ string: '{"name":"fixture","source_lang":"EN","target_lang":"ES","entries":"car\tauto\n","entries_format":"tsv"}'
243
+ headers:
244
+ Authorization:
245
+ - DeepL-Auth-Key VALID_TOKEN
158
246
  User-Agent:
159
- - Ruby
247
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
160
248
  Content-Type:
161
- - application/x-www-form-urlencoded
249
+ - application/json
250
+ Accept-Encoding:
251
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
252
+ Accept:
253
+ - "*/*"
162
254
  response:
163
255
  status:
164
256
  code: 201
165
257
  message: Created
166
258
  headers:
167
- Server:
168
- - nginx
169
259
  Date:
170
- - Tue, 25 Jan 2022 00:52:04 GMT
260
+ - Tue, 09 Jul 2024 01:50:11 GMT
171
261
  Content-Type:
172
262
  - application/json; charset=utf-8
173
263
  Transfer-Encoding:
174
264
  - chunked
175
- Connection:
176
- - keep-alive
265
+ X-Trace-Id:
266
+ - 12c5d435de7a492b93f26cd05a8c6b2d
267
+ Strict-Transport-Security:
268
+ - max-age=63072000; includeSubDomains; preload
269
+ Server-Timing:
270
+ - l7_lb_tls;dur=105, l7_lb_idle;dur=5, l7_lb_receive;dur=0, l7_lb_total;dur=128
271
+ Access-Control-Expose-Headers:
272
+ - Server-Timing, X-Trace-ID
177
273
  body:
178
274
  encoding: UTF-8
179
- string: '{"glossary_id":"0d425d16-dbdf-4d26-aca1-12d41e9ea484","name":"fixture","ready":true,"source_lang":"en","target_lang":"es","creation_time":"2022-01-25T00:52:04.21883+00:00","entry_count":1}'
180
- recorded_at: Tue, 25 Jan 2022 00:52:04 GMT
275
+ string: '{"glossary_id":"b5972112-b74d-447f-92ff-888db3df7e5d","name":"fixture","ready":true,"source_lang":"en","target_lang":"es","creation_time":"2024-07-09T01:50:11.109588Z","entry_count":1}'
276
+ recorded_at: Tue, 09 Jul 2024 01:50:11 GMT
181
277
  - request:
182
278
  method: post
183
- uri: https://api-free.deepl.com/v2/translate?glossary_id=0d425d16-dbdf-4d26-aca1-12d41e9ea484
279
+ uri: https://api.deepl.com/v2/translate
184
280
  body:
185
- encoding: US-ASCII
186
- string: text=I+wish+we+had+a+car.&source_lang=EN&target_lang=ES
281
+ encoding: UTF-8
282
+ string: '{"text":["I wish we had a car."],"source_lang":"EN","target_lang":"ES","glossary_id":"b5972112-b74d-447f-92ff-888db3df7e5d"}'
187
283
  headers:
188
284
  Authorization:
189
285
  - DeepL-Auth-Key VALID_TOKEN
286
+ User-Agent:
287
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
288
+ Content-Type:
289
+ - application/json
190
290
  Accept-Encoding:
191
291
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
192
292
  Accept:
193
293
  - "*/*"
194
- User-Agent:
195
- - Ruby
196
- Content-Type:
197
- - application/x-www-form-urlencoded
198
294
  response:
199
295
  status:
200
296
  code: 200
201
297
  message: OK
202
298
  headers:
203
- Server:
204
- - nginx
205
299
  Date:
206
- - Tue, 25 Jan 2022 00:52:04 GMT
300
+ - Tue, 09 Jul 2024 01:50:11 GMT
207
301
  Content-Type:
208
302
  - application/json
209
- Content-Length:
210
- - '89'
211
- Connection:
212
- - keep-alive
303
+ Transfer-Encoding:
304
+ - chunked
305
+ Vary:
306
+ - Accept-Encoding
213
307
  Access-Control-Allow-Origin:
214
308
  - "*"
309
+ Strict-Transport-Security:
310
+ - max-age=63072000; includeSubDomains; preload
311
+ Server-Timing:
312
+ - l7_lb_tls;dur=278, l7_lb_idle;dur=2, l7_lb_receive;dur=0, l7_lb_total;dur=355
313
+ Access-Control-Expose-Headers:
314
+ - Server-Timing, X-Trace-ID
315
+ X-Trace-Id:
316
+ - ab9c20ae972946cf9e001a0e7b0aa7dc
215
317
  body:
216
318
  encoding: ASCII-8BIT
217
319
  string: !binary |-
218
- eyJ0cmFuc2xhdGlvbnMiOlt7ImRldGVjdGVkX3NvdXJjZV9sYW5ndWFnZSI6IkVOIiwidGV4dCI6Ik9qYWzDoSB0dXZpw6lyYW1vcyB1biBhdXRvLiJ9XX0=
219
- recorded_at: Tue, 25 Jan 2022 00:52:04 GMT
320
+ eyJ0cmFuc2xhdGlvbnMiOlt7ImRldGVjdGVkX3NvdXJjZV9sYW5ndWFnZSI6IkVOIiwidGV4dCI6Ik9qYWzDoSB0dXZpw6lyYW1vcyBhdXRvLiJ9XX0=
321
+ recorded_at: Tue, 09 Jul 2024 01:50:11 GMT
220
322
  - request:
221
323
  method: delete
222
- uri: https://api-free.deepl.com/v2/glossaries/0d425d16-dbdf-4d26-aca1-12d41e9ea484
324
+ uri: https://api.deepl.com/v2/glossaries/b5972112-b74d-447f-92ff-888db3df7e5d
223
325
  body:
224
- encoding: US-ASCII
225
- string: ''
326
+ encoding: UTF-8
327
+ string: "{}"
226
328
  headers:
227
329
  Authorization:
228
330
  - DeepL-Auth-Key VALID_TOKEN
331
+ User-Agent:
332
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
333
+ Content-Type:
334
+ - application/json
229
335
  Accept-Encoding:
230
336
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
231
337
  Accept:
232
338
  - "*/*"
233
- User-Agent:
234
- - Ruby
235
339
  response:
236
340
  status:
237
341
  code: 204
238
342
  message: No Content
239
343
  headers:
240
- Server:
241
- - nginx
242
344
  Date:
243
- - Tue, 25 Jan 2022 00:52:05 GMT
244
- Connection:
245
- - keep-alive
345
+ - Tue, 09 Jul 2024 01:50:12 GMT
346
+ X-Trace-Id:
347
+ - 4b145ebec675432e98119ac4449f764f
348
+ Strict-Transport-Security:
349
+ - max-age=63072000; includeSubDomains; preload
350
+ Server-Timing:
351
+ - l7_lb_tls;dur=151, l7_lb_idle;dur=2, l7_lb_receive;dur=0, l7_lb_total;dur=1007
352
+ Access-Control-Expose-Headers:
353
+ - Server-Timing, X-Trace-ID
246
354
  body:
247
355
  encoding: UTF-8
248
356
  string: ''
249
- recorded_at: Tue, 25 Jan 2022 00:52:05 GMT
250
- recorded_with: VCR 6.0.0
357
+ recorded_at: Tue, 09 Jul 2024 01:50:12 GMT
358
+ recorded_with: VCR 6.2.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api-free.deepl.com/v2/usage
5
+ uri: https://api.deepl.com/v2/usage
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -14,7 +14,7 @@ http_interactions:
14
14
  Accept:
15
15
  - "*/*"
16
16
  User-Agent:
17
- - Ruby
17
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
18
18
  response:
19
19
  status:
20
20
  code: 200
@@ -36,4 +36,94 @@ http_interactions:
36
36
  encoding: UTF-8
37
37
  string: '{"character_count":303,"character_limit":500000}'
38
38
  recorded_at: Mon, 17 May 2021 14:18:28 GMT
39
- recorded_with: VCR 6.0.0
39
+ - request:
40
+ method: get
41
+ uri: https://api.deepl.com/v2/usage
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ''
45
+ headers:
46
+ Authorization:
47
+ - DeepL-Auth-Key VALID_TOKEN
48
+ User-Agent:
49
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
50
+ Accept-Encoding:
51
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
52
+ Accept:
53
+ - "*/*"
54
+ response:
55
+ status:
56
+ code: 200
57
+ message: OK
58
+ headers:
59
+ Date:
60
+ - Tue, 02 Jul 2024 15:04:44 GMT
61
+ Content-Type:
62
+ - application/json
63
+ Transfer-Encoding:
64
+ - chunked
65
+ Vary:
66
+ - Accept-Encoding
67
+ Access-Control-Allow-Origin:
68
+ - "*"
69
+ X-Cache-Status:
70
+ - MISS
71
+ Strict-Transport-Security:
72
+ - max-age=63072000; includeSubDomains; preload
73
+ Server-Timing:
74
+ - l7_lb_tls;dur=105, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=140
75
+ Access-Control-Expose-Headers:
76
+ - Server-Timing, X-Trace-ID
77
+ X-Trace-Id:
78
+ - abe01bcc8c834ec6a2837d30f9bcf1b2
79
+ body:
80
+ encoding: ASCII-8BIT
81
+ string: '{"character_count":18593,"character_limit":1000000000000}'
82
+ recorded_at: Tue, 02 Jul 2024 15:04:44 GMT
83
+ - request:
84
+ method: get
85
+ uri: https://api.deepl.com/v2/usage
86
+ body:
87
+ encoding: UTF-8
88
+ string: "{}"
89
+ headers:
90
+ Authorization:
91
+ - DeepL-Auth-Key VALID_TOKEN
92
+ User-Agent:
93
+ - deepl-ruby/2.5.3 (darwin23) ruby/3.3.3
94
+ Content-Type:
95
+ - application/json
96
+ Accept-Encoding:
97
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
98
+ Accept:
99
+ - "*/*"
100
+ response:
101
+ status:
102
+ code: 200
103
+ message: OK
104
+ headers:
105
+ Date:
106
+ - Tue, 09 Jul 2024 01:47:02 GMT
107
+ Content-Type:
108
+ - application/json
109
+ Transfer-Encoding:
110
+ - chunked
111
+ Vary:
112
+ - Accept-Encoding
113
+ Access-Control-Allow-Origin:
114
+ - "*"
115
+ X-Cache-Status:
116
+ - MISS
117
+ Strict-Transport-Security:
118
+ - max-age=63072000; includeSubDomains; preload
119
+ Server-Timing:
120
+ - l7_lb_tls;dur=166, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=170
121
+ Access-Control-Expose-Headers:
122
+ - Server-Timing, X-Trace-ID
123
+ X-Trace-Id:
124
+ - f0901812e3b74562b460fc95cec5d92e
125
+ body:
126
+ encoding: ASCII-8BIT
127
+ string: '{"character_count":69350,"character_limit":1000000000000}'
128
+ recorded_at: Tue, 09 Jul 2024 01:47:02 GMT
129
+ recorded_with: VCR 6.2.0