uploadcare-ruby 4.4.3 → 5.0.0.rc1
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/.env.example +7 -0
- data/.github/workflows/gem-push.yml +1 -1
- data/.github/workflows/ruby.yml +10 -13
- data/.gitignore +9 -0
- data/.rubocop.yml +95 -8
- data/CHANGELOG.md +71 -1
- data/Gemfile +23 -6
- data/MIGRATING_V5.md +290 -0
- data/README.md +422 -671
- data/Rakefile +5 -1
- data/api_examples/README.md +77 -0
- data/api_examples/rest_api/delete_files_storage.rb +3 -5
- data/api_examples/rest_api/delete_files_uuid_metadata_key.rb +3 -4
- data/api_examples/rest_api/delete_files_uuid_storage.rb +3 -4
- data/api_examples/rest_api/delete_groups_uuid.rb +3 -4
- data/api_examples/rest_api/delete_webhooks_unsubscribe.rb +3 -4
- data/api_examples/rest_api/get_addons_aws_rekognition_detect_labels_execute_status.rb +3 -6
- data/api_examples/rest_api/get_addons_aws_rekognition_detect_moderation_labels_execute_status.rb +3 -6
- data/api_examples/rest_api/get_addons_remove_bg_execute_status.rb +3 -6
- data/api_examples/rest_api/get_addons_uc_clamav_virus_scan_execute_status.rb +3 -6
- data/api_examples/rest_api/get_convert_document_status_token.rb +3 -5
- data/api_examples/rest_api/get_convert_document_uuid.rb +3 -5
- data/api_examples/rest_api/get_convert_video_status_token.rb +3 -5
- data/api_examples/rest_api/get_files.rb +3 -5
- data/api_examples/rest_api/get_files_uuid.rb +3 -5
- data/api_examples/rest_api/get_files_uuid_metadata.rb +3 -5
- data/api_examples/rest_api/get_files_uuid_metadata_key.rb +3 -5
- data/api_examples/rest_api/get_groups.rb +3 -5
- data/api_examples/rest_api/get_groups_uuid.rb +3 -5
- data/api_examples/rest_api/get_project.rb +3 -5
- data/api_examples/rest_api/get_webhooks.rb +3 -5
- data/api_examples/rest_api/post_addons_aws_rekognition_detect_labels_execute.rb +3 -5
- data/api_examples/rest_api/post_addons_aws_rekognition_detect_moderation_labels_execute.rb +3 -5
- data/api_examples/rest_api/post_addons_remove_bg_execute.rb +3 -5
- data/api_examples/rest_api/post_addons_uc_clamav_virus_scan_execute.rb +3 -5
- data/api_examples/rest_api/post_convert_document.rb +3 -8
- data/api_examples/rest_api/post_convert_video.rb +3 -10
- data/api_examples/rest_api/post_files_local_copy.rb +3 -6
- data/api_examples/rest_api/post_files_remote_copy.rb +3 -7
- data/api_examples/rest_api/post_webhooks.rb +3 -9
- data/api_examples/rest_api/put_files_storage.rb +3 -8
- data/api_examples/rest_api/put_files_uuid_metadata_key.rb +3 -7
- data/api_examples/rest_api/put_files_uuid_storage.rb +3 -5
- data/api_examples/rest_api/put_webhooks_id.rb +3 -11
- data/api_examples/support/example_helper.rb +250 -0
- data/api_examples/support/run_rest_example.rb +161 -0
- data/api_examples/support/run_upload_example.rb +88 -0
- data/api_examples/upload_api/get_from_url_status.rb +3 -5
- data/api_examples/upload_api/get_group_info.rb +3 -6
- data/api_examples/upload_api/get_info.rb +3 -6
- data/api_examples/upload_api/post_base.rb +3 -5
- data/api_examples/upload_api/post_from_url.rb +3 -5
- data/api_examples/upload_api/post_group.rb +3 -8
- data/api_examples/upload_api/post_multipart_complete.rb +3 -7
- data/api_examples/upload_api/post_multipart_start.rb +3 -7
- data/api_examples/upload_api/put_multipart_part.rb +4 -0
- data/bin/console +1 -1
- data/docs/release-notes-5.0.0.rc1.md +34 -0
- data/examples/README.md +39 -0
- data/examples/batch_upload.rb +54 -0
- data/examples/group_creation.rb +88 -0
- data/examples/large_file_upload.rb +88 -0
- data/examples/simple_upload.rb +39 -0
- data/examples/upload_with_progress.rb +84 -0
- data/examples/url_upload.rb +56 -0
- data/lib/uploadcare/api/rest/addons.rb +107 -0
- data/lib/uploadcare/api/rest/document_conversions.rb +65 -0
- data/lib/uploadcare/api/rest/file_metadata.rb +71 -0
- data/lib/uploadcare/api/rest/files.rb +112 -0
- data/lib/uploadcare/api/rest/groups.rb +49 -0
- data/lib/uploadcare/api/rest/project.rb +23 -0
- data/lib/uploadcare/api/rest/video_conversions.rb +52 -0
- data/lib/uploadcare/api/rest/webhooks.rb +74 -0
- data/lib/uploadcare/api/rest.rb +254 -0
- data/lib/uploadcare/api/upload/files.rb +313 -0
- data/lib/uploadcare/api/upload/groups.rb +72 -0
- data/lib/uploadcare/api/upload.rb +272 -0
- data/lib/uploadcare/client/addons_accessor.rb +85 -0
- data/lib/uploadcare/client/api.rb +33 -0
- data/lib/uploadcare/client/conversions_accessor.rb +33 -0
- data/lib/uploadcare/client/document_conversions_accessor.rb +41 -0
- data/lib/uploadcare/client/file_metadata_accessor.rb +46 -0
- data/lib/uploadcare/client/files_accessor.rb +82 -0
- data/lib/uploadcare/client/groups_accessor.rb +35 -0
- data/lib/uploadcare/client/project_accessor.rb +17 -0
- data/lib/uploadcare/client/video_conversions_accessor.rb +33 -0
- data/lib/uploadcare/client/webhooks_accessor.rb +42 -0
- data/lib/uploadcare/client.rb +127 -0
- data/lib/uploadcare/cname_generator.rb +68 -0
- data/lib/uploadcare/collections/batch_result.rb +35 -0
- data/lib/uploadcare/collections/paginated.rb +165 -0
- data/lib/uploadcare/configuration.rb +81 -0
- data/lib/uploadcare/exception/auth_error.rb +2 -6
- data/lib/uploadcare/exception/configuration_error.rb +4 -0
- data/lib/uploadcare/exception/conversion_error.rb +2 -6
- data/lib/uploadcare/exception/invalid_request_error.rb +4 -0
- data/lib/uploadcare/exception/multipart_upload_error.rb +4 -0
- data/lib/uploadcare/exception/not_found_error.rb +4 -0
- data/lib/uploadcare/exception/request_error.rb +2 -6
- data/lib/uploadcare/exception/retry_error.rb +2 -6
- data/lib/uploadcare/exception/throttle_error.rb +7 -11
- data/lib/uploadcare/exception/unknown_status_error.rb +4 -0
- data/lib/uploadcare/exception/upload_error.rb +4 -0
- data/lib/uploadcare/exception/upload_timeout_error.rb +4 -0
- data/lib/uploadcare/internal/authenticator.rb +101 -0
- data/lib/uploadcare/internal/error_handler.rb +102 -0
- data/lib/uploadcare/internal/signature_generator.rb +31 -0
- data/lib/uploadcare/internal/throttle_handler.rb +36 -0
- data/lib/uploadcare/internal/upload_io.rb +110 -0
- data/lib/uploadcare/internal/upload_params_generator.rb +86 -0
- data/lib/uploadcare/internal/user_agent.rb +22 -0
- data/lib/uploadcare/operations/multipart_upload.rb +213 -0
- data/lib/uploadcare/operations/upload_router.rb +162 -0
- data/lib/uploadcare/resources/addon_execution.rb +97 -0
- data/lib/uploadcare/resources/base_resource.rb +61 -0
- data/lib/uploadcare/resources/document_conversion.rb +81 -0
- data/lib/uploadcare/resources/file.rb +366 -0
- data/lib/uploadcare/resources/file_metadata.rb +135 -0
- data/lib/uploadcare/resources/group.rb +142 -0
- data/lib/uploadcare/resources/project.rb +26 -0
- data/lib/uploadcare/resources/video_conversion.rb +59 -0
- data/lib/uploadcare/resources/webhook.rb +85 -0
- data/lib/uploadcare/result.rb +85 -0
- data/lib/uploadcare/signed_url_generators/akamai_generator.rb +50 -51
- data/lib/uploadcare/signed_url_generators/base_generator.rb +15 -15
- data/lib/uploadcare/version.rb +7 -0
- data/lib/uploadcare/webhook_signature_verifier.rb +60 -0
- data/lib/uploadcare.rb +84 -50
- data/mise.toml +2 -0
- data/uploadcare-ruby.gemspec +8 -7
- metadata +102 -74
- data/api_examples/upload_api/put_presigned_url_x.rb +0 -8
- data/lib/uploadcare/api/api.rb +0 -25
- data/lib/uploadcare/client/addons_client.rb +0 -69
- data/lib/uploadcare/client/conversion/base_conversion_client.rb +0 -60
- data/lib/uploadcare/client/conversion/document_conversion_client.rb +0 -45
- data/lib/uploadcare/client/conversion/video_conversion_client.rb +0 -46
- data/lib/uploadcare/client/file_client.rb +0 -48
- data/lib/uploadcare/client/file_list_client.rb +0 -46
- data/lib/uploadcare/client/file_metadata_client.rb +0 -36
- data/lib/uploadcare/client/group_client.rb +0 -45
- data/lib/uploadcare/client/multipart_upload/chunks_client.rb +0 -58
- data/lib/uploadcare/client/multipart_upload_client.rb +0 -64
- data/lib/uploadcare/client/project_client.rb +0 -20
- data/lib/uploadcare/client/rest_client.rb +0 -77
- data/lib/uploadcare/client/rest_group_client.rb +0 -43
- data/lib/uploadcare/client/upload_client.rb +0 -46
- data/lib/uploadcare/client/uploader_client.rb +0 -128
- data/lib/uploadcare/client/webhook_client.rb +0 -49
- data/lib/uploadcare/concern/error_handler.rb +0 -54
- data/lib/uploadcare/concern/throttle_handler.rb +0 -25
- data/lib/uploadcare/concern/upload_error_handler.rb +0 -32
- data/lib/uploadcare/entity/addons.rb +0 -14
- data/lib/uploadcare/entity/conversion/base_converter.rb +0 -43
- data/lib/uploadcare/entity/conversion/document_converter.rb +0 -15
- data/lib/uploadcare/entity/conversion/video_converter.rb +0 -15
- data/lib/uploadcare/entity/decorator/paginator.rb +0 -79
- data/lib/uploadcare/entity/entity.rb +0 -18
- data/lib/uploadcare/entity/file.rb +0 -103
- data/lib/uploadcare/entity/file_list.rb +0 -32
- data/lib/uploadcare/entity/file_metadata.rb +0 -30
- data/lib/uploadcare/entity/group.rb +0 -49
- data/lib/uploadcare/entity/group_list.rb +0 -24
- data/lib/uploadcare/entity/project.rb +0 -13
- data/lib/uploadcare/entity/uploader.rb +0 -93
- data/lib/uploadcare/entity/webhook.rb +0 -14
- data/lib/uploadcare/param/authentication_header.rb +0 -37
- data/lib/uploadcare/param/conversion/document/processing_job_url_builder.rb +0 -39
- data/lib/uploadcare/param/conversion/video/processing_job_url_builder.rb +0 -64
- data/lib/uploadcare/param/param.rb +0 -10
- data/lib/uploadcare/param/secure_auth_header.rb +0 -51
- data/lib/uploadcare/param/simple_auth_header.rb +0 -14
- data/lib/uploadcare/param/upload/signature_generator.rb +0 -24
- data/lib/uploadcare/param/upload/upload_params_generator.rb +0 -41
- data/lib/uploadcare/param/user_agent.rb +0 -21
- data/lib/uploadcare/param/webhook_signature_verifier.rb +0 -23
- data/lib/uploadcare/ruby/version.rb +0 -5
data/Rakefile
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# API Examples
|
|
2
|
+
|
|
3
|
+
Each file in this directory maps to one documented Uploadcare API endpoint.
|
|
4
|
+
|
|
5
|
+
Run examples with project-managed Ruby and real credentials:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
mise exec -- ruby api_examples/rest_api/get_project.rb
|
|
9
|
+
mise exec -- ruby api_examples/upload_api/post_base.rb
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Required environment variables:
|
|
13
|
+
|
|
14
|
+
- `UPLOADCARE_PUBLIC_KEY`
|
|
15
|
+
- `UPLOADCARE_SECRET_KEY`
|
|
16
|
+
|
|
17
|
+
Optional environment variables:
|
|
18
|
+
|
|
19
|
+
- `UPLOADCARE_AUTH_TYPE`
|
|
20
|
+
- `UPLOADCARE_REMOTE_STORAGE` for `post_files_remote_copy.rb`
|
|
21
|
+
|
|
22
|
+
Verification:
|
|
23
|
+
|
|
24
|
+
- Verified against a real Uploadcare demo account on `2026-03-16`
|
|
25
|
+
- All canonical scripts in `api_examples/rest_api` and `api_examples/upload_api` executed successfully
|
|
26
|
+
|
|
27
|
+
## REST API 0.7
|
|
28
|
+
|
|
29
|
+
| Endpoint | Example file | Notes |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `GET /files/` | `api_examples/rest_api/get_files.rb` | Uses `client.files.list` |
|
|
32
|
+
| `PUT /files/{uuid}/storage/` | `api_examples/rest_api/put_files_uuid_storage.rb` | Uses `file.store` |
|
|
33
|
+
| `DELETE /files/{uuid}/storage/` | `api_examples/rest_api/delete_files_uuid_storage.rb` | Uses `file.delete` |
|
|
34
|
+
| `GET /files/{uuid}/` | `api_examples/rest_api/get_files_uuid.rb` | Uses `client.files.find` |
|
|
35
|
+
| `PUT /files/storage/` | `api_examples/rest_api/put_files_storage.rb` | Uses `client.files.batch_store` |
|
|
36
|
+
| `DELETE /files/storage/` | `api_examples/rest_api/delete_files_storage.rb` | Uses `client.files.batch_delete` |
|
|
37
|
+
| `POST /files/local_copy/` | `api_examples/rest_api/post_files_local_copy.rb` | Uses `client.files.copy_to_local` |
|
|
38
|
+
| `POST /files/remote_copy/` | `api_examples/rest_api/post_files_remote_copy.rb` | Uses `client.files.copy_to_remote`; requires `UPLOADCARE_REMOTE_STORAGE` |
|
|
39
|
+
| `GET /files/{uuid}/metadata/` | `api_examples/rest_api/get_files_uuid_metadata.rb` | Uses `client.file_metadata.index` |
|
|
40
|
+
| `GET /files/{uuid}/metadata/{key}/` | `api_examples/rest_api/get_files_uuid_metadata_key.rb` | Uses `client.file_metadata.show` |
|
|
41
|
+
| `PUT /files/{uuid}/metadata/{key}/` | `api_examples/rest_api/put_files_uuid_metadata_key.rb` | Uses `client.file_metadata.update` |
|
|
42
|
+
| `DELETE /files/{uuid}/metadata/{key}/` | `api_examples/rest_api/delete_files_uuid_metadata_key.rb` | Uses `client.file_metadata.delete` |
|
|
43
|
+
| `GET /groups/` | `api_examples/rest_api/get_groups.rb` | Uses `client.groups.list` |
|
|
44
|
+
| `GET /groups/{uuid}/` | `api_examples/rest_api/get_groups_uuid.rb` | Uses `client.groups.find` |
|
|
45
|
+
| `DELETE /groups/{uuid}/` | `api_examples/rest_api/delete_groups_uuid.rb` | Uses `group.delete` |
|
|
46
|
+
| `POST /addons/aws_rekognition_detect_labels/execute/` | `api_examples/rest_api/post_addons_aws_rekognition_detect_labels_execute.rb` | Uses `client.addons.aws_rekognition_detect_labels` |
|
|
47
|
+
| `GET /addons/aws_rekognition_detect_labels/execute/status/` | `api_examples/rest_api/get_addons_aws_rekognition_detect_labels_execute_status.rb` | Uses `client.addons.*` and checks status |
|
|
48
|
+
| `POST /addons/aws_rekognition_detect_moderation_labels/execute/` | `api_examples/rest_api/post_addons_aws_rekognition_detect_moderation_labels_execute.rb` | Uses `client.addons.aws_rekognition_detect_moderation_labels` |
|
|
49
|
+
| `GET /addons/aws_rekognition_detect_moderation_labels/execute/status/` | `api_examples/rest_api/get_addons_aws_rekognition_detect_moderation_labels_execute_status.rb` | Uses `client.addons.*` and checks status |
|
|
50
|
+
| `POST /addons/uc_clamav_virus_scan/execute/` | `api_examples/rest_api/post_addons_uc_clamav_virus_scan_execute.rb` | Uses `client.addons.uc_clamav_virus_scan` |
|
|
51
|
+
| `GET /addons/uc_clamav_virus_scan/execute/status/` | `api_examples/rest_api/get_addons_uc_clamav_virus_scan_execute_status.rb` | Uses `client.addons.*` and checks status |
|
|
52
|
+
| `POST /addons/remove_bg/execute/` | `api_examples/rest_api/post_addons_remove_bg_execute.rb` | Uses `client.addons.remove_bg` |
|
|
53
|
+
| `GET /addons/remove_bg/execute/status/` | `api_examples/rest_api/get_addons_remove_bg_execute_status.rb` | Uses `client.addons.*` and checks status |
|
|
54
|
+
| `GET /project/` | `api_examples/rest_api/get_project.rb` | Uses `client.project.current` |
|
|
55
|
+
| `GET /webhooks/` | `api_examples/rest_api/get_webhooks.rb` | Uses `client.webhooks.list` |
|
|
56
|
+
| `POST /webhooks/` | `api_examples/rest_api/post_webhooks.rb` | Uses `client.webhooks.create` |
|
|
57
|
+
| `PUT /webhooks/{id}/` | `api_examples/rest_api/put_webhooks_id.rb` | Uses `client.webhooks.update` |
|
|
58
|
+
| `DELETE /webhooks/unsubscribe/` | `api_examples/rest_api/delete_webhooks_unsubscribe.rb` | Uses `client.webhooks.delete` |
|
|
59
|
+
| `GET /convert/document/{uuid}/` | `api_examples/rest_api/get_convert_document_uuid.rb` | Uses `client.conversions.documents.info` |
|
|
60
|
+
| `POST /convert/document/` | `api_examples/rest_api/post_convert_document.rb` | Uses `client.conversions.documents.convert` |
|
|
61
|
+
| `GET /convert/document/status/{token}/` | `api_examples/rest_api/get_convert_document_status_token.rb` | Uses `client.conversions.documents.convert` then `status` |
|
|
62
|
+
| `POST /convert/video/` | `api_examples/rest_api/post_convert_video.rb` | Uses `client.conversions.videos.convert` |
|
|
63
|
+
| `GET /convert/video/status/{token}/` | `api_examples/rest_api/get_convert_video_status_token.rb` | Uses `client.conversions.videos.convert` then `status` |
|
|
64
|
+
|
|
65
|
+
## Upload API
|
|
66
|
+
|
|
67
|
+
| Endpoint | Example file | Notes |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `POST /base/` | `api_examples/upload_api/post_base.rb` | Uses raw upload API |
|
|
70
|
+
| `POST /multipart/start/` | `api_examples/upload_api/post_multipart_start.rb` | Starts and completes a real multipart upload |
|
|
71
|
+
| `PUT <presigned-url-x>` | `api_examples/upload_api/put_multipart_part.rb` | Uploads one part via gem multipart helper |
|
|
72
|
+
| `POST /multipart/complete/` | `api_examples/upload_api/post_multipart_complete.rb` | Completes a real multipart upload |
|
|
73
|
+
| `POST /from_url/` | `api_examples/upload_api/post_from_url.rb` | Uses raw upload API |
|
|
74
|
+
| `GET /from_url/status/` | `api_examples/upload_api/get_from_url_status.rb` | Starts async upload then checks status |
|
|
75
|
+
| `GET /info/` | `api_examples/upload_api/get_info.rb` | Uses raw upload API |
|
|
76
|
+
| `POST /group/` | `api_examples/upload_api/post_group.rb` | Uses raw upload API |
|
|
77
|
+
| `GET /group/info/` | `api_examples/upload_api/get_group_info.rb` | Uses raw upload API |
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::FileList.batch_delete(uuids)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
result = Uploadcare::Addons.ws_rekognition_detect_labels_status(request_id)
|
|
7
|
-
puts result.status
|
|
4
|
+
require_relative '../support/run_rest_example'
|
data/api_examples/rest_api/get_addons_aws_rekognition_detect_moderation_labels_execute_status.rb
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
result = Uploadcare::Addons.ws_rekognition_detect_moderation_labels_status(request_id)
|
|
7
|
-
puts result.status
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
result = Uploadcare::Addons.remove_bg_status(request_id)
|
|
7
|
-
puts result.status
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
result = Uploadcare::Addons.uc_clamav_virus_scan_status(request_id)
|
|
7
|
-
puts result.status
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::DocumentConverter.status(token)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::DocumentConverter.info(uuid)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::VideoConverter.status(token)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
list.each { |file| puts file.inspect }
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::File.info(uuid).inspect
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::FileMetadata.show(uuid, 'pet')
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::FileMetadata.index(uuid).inspect
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
groups.each { |group| puts group.inspect }
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts Uploadcare::Group.info(uuid).inspect
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
puts project_info.inspect
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
webhooks.each { |webhook| puts webhook.inspect }
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
Uploadcare::Addons.ws_rekognition_detect_labels(uuid)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
Uploadcare::Addons.ws_rekognition_detect_moderation_labels(uuid)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
Uploadcare::Addons.remove_bg(uuid, crop: true)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
Uploadcare::Addons.uc_clamav_virus_scan(uuid, purge_infected: true)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
options = { store: '1' }
|
|
7
|
-
# for multipage conversion
|
|
8
|
-
# options = { store: '1', save_in_group: '1' }
|
|
9
|
-
Uploadcare::DocumentConverter.convert(document_params, options)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
|
|
7
|
-
format: :mp4,
|
|
8
|
-
quality: :lighter
|
|
9
|
-
}
|
|
10
|
-
options = { store: true }
|
|
11
|
-
Uploadcare::VideoConverter.convert(video_params, options)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
copied_file = Uploadcare::File.local_copy(source, store: true)
|
|
7
|
-
puts copied_file.uuid
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
target = 'custom_storage_connected_to_the_project'
|
|
7
|
-
copied_file_url = Uploadcare::File.remote_copy(source_object, target, make_public: true)
|
|
8
|
-
puts copied_file_url
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
target_url: 'https://yourwebhook.com',
|
|
7
|
-
event: 'file.uploaded',
|
|
8
|
-
is_active: true
|
|
9
|
-
}
|
|
10
|
-
Uploadcare::Webhook.create(**options)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
b7a301d1-1bd0-473d-8d32-708dd55addc0
|
|
7
|
-
1bac376c-aa7e-4356-861b-dd2657b5bfd2
|
|
8
|
-
]
|
|
9
|
-
Uploadcare::FileList.batch_store(uuids)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
key = 'pet'
|
|
7
|
-
value = 'dog'
|
|
8
|
-
Uploadcare::FileMetadata.update(uuid, key, value)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
Uploadcare::File.store(uuid)
|
|
4
|
+
require_relative '../support/run_rest_example'
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
options = {
|
|
7
|
-
target_url: 'https://yourwebhook.com',
|
|
8
|
-
event: 'file.uploaded',
|
|
9
|
-
is_active: true,
|
|
10
|
-
signing_secret: 'webhook-secret'
|
|
11
|
-
}
|
|
12
|
-
Uploadcare::Webhook.update(webhook_id, options)
|
|
4
|
+
require_relative '../support/run_rest_example'
|