Skip to content

Commit

Permalink
Changed file uuid variable name in README
Browse files Browse the repository at this point in the history
All Files in Uploadcare have their Projects, but only UUID is needed to make most of the operations, so this variable mentioning Project ID is counter intuitive
  • Loading branch information
alxgsv committed Apr 2, 2024
1 parent b92062d commit 5212c7e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,22 +211,22 @@ Entities are representations of objects in Uploadcare cloud.

#### File

File entity contains its metadata. It also supports `include` param to include additional fields to the file object, such as: "appdata".
File entity contains its metadata. It also supports `include` param to include additional fields to the file object, such as: "appdata".

```ruby
@file = Uploadcare::File.file("FILE_ID_IN_YOUR_PROJECT", include: "appdata")
@file = Uploadcare::File.file("FILE_UUID", include: "appdata")
{
"datetime_removed"=>nil,
"datetime_stored"=>"2018-11-26T12:49:10.477888Z",
"datetime_uploaded"=>"2018-11-26T12:49:09.945335Z",
"is_image"=>true,
"is_ready"=>true,
"mime_type"=>"image/jpeg",
"original_file_url"=>"https://ucarecdn.com/FILE_ID_IN_YOUR_PROJECT/pineapple.jpg",
"original_file_url"=>"https://ucarecdn.com/FILE_UUID/pineapple.jpg",
"original_filename"=>"pineapple.jpg",
"size"=>642,
"url"=>"https://api.uploadcare.com/files/FILE_ID_IN_YOUR_PROJECT/",
"uuid"=>"FILE_ID_IN_YOUR_PROJECT",
"url"=>"https://api.uploadcare.com/files/FILE_UUID/",
"uuid"=>"FILE_UUID",
"variations"=>nil,
"content_info"=>{
"mime"=>{
Expand Down Expand Up @@ -325,7 +325,7 @@ File entity contains its metadata. It also supports `include` param to include a
The File object is also can be converted if it is a document or a video file. Imagine, you have a document file:

```ruby
@file = Uploadcare::File.file("FILE_ID_IN_YOUR_PROJECT")
@file = Uploadcare::File.file("FILE_UUID")
```

To convert it to an another file, just do:
Expand Down Expand Up @@ -440,16 +440,16 @@ As an example, you could store unique file identifier from your system.

```ruby
# Get file's metadata keys and values.
Uploadcare::FileMetadata.index('FILE_ID_IN_YOUR_PROJECT')
Uploadcare::FileMetadata.index('FILE_UUID')

# Get the value of a single metadata key.
Uploadcare::FileMetadata.show('FILE_ID_IN_YOUR_PROJECT', 'KEY')
Uploadcare::FileMetadata.show('FILE_UUID', 'KEY')

# Update the value of a single metadata key. If the key does not exist, it will be created.
Uploadcare::FileMetadata.update('FILE_ID_IN_YOUR_PROJECT', 'KEY', 'VALUE')
Uploadcare::FileMetadata.update('FILE_UUID', 'KEY', 'VALUE')

# Delete a file's metadata key.
Uploadcare::FileMetadata.delete('FILE_ID_IN_YOUR_PROJECT', 'KEY')
Uploadcare::FileMetadata.delete('FILE_UUID', 'KEY')
```

#### Group
Expand Down Expand Up @@ -556,7 +556,7 @@ An `Add-On` is an application implemented by Uploadcare that accepts uploaded fi

```ruby
# Execute AWS Rekognition Add-On for a given target to detect labels in an image. Note: Detected labels are stored in the file's appdata.
Uploadcare::Addons.ws_rekognition_detect_labels('FILE_ID_IN_YOUR_PROJECT')
Uploadcare::Addons.ws_rekognition_detect_labels('FILE_UUID')

# Check the status of AWS Rekognition.
Uploadcare::Addons.ws_rekognition_detect_labels_status('RETURNED_ID_FROM_WS_REKOGNITION_DETECT_LABELS')
Expand All @@ -566,10 +566,10 @@ Uploadcare::Addons.ws_rekognition_detect_labels_status('RETURNED_ID_FROM_WS_REKO

```ruby
# ClamAV virus checking Add-On for a given target.
Uploadcare::Addons.uc_clamav_virus_scan('FILE_ID_IN_YOUR_PROJECT')
Uploadcare::Addons.uc_clamav_virus_scan('FILE_UUID')

# Checking and purge infected file.
Uploadcare::Addons.uc_clamav_virus_scan('FILE_ID_IN_YOUR_PROJECT', purge_infected: true )
Uploadcare::Addons.uc_clamav_virus_scan('FILE_UUID', purge_infected: true )

# Check the status ClamAV virus scan.
Uploadcare::Addons.uc_clamav_virus_scan_status('RETURNED_ID_FROM_UC_CLAMAV_VIRUS_SCAN')
Expand All @@ -579,11 +579,11 @@ Uploadcare::Addons.uc_clamav_virus_scan_status('RETURNED_ID_FROM_UC_CLAMAV_VIRUS

```ruby
# Remove background image removal Add-On for a given target.
Uploadcare::Addons.remove_bg('FILE_ID_IN_YOUR_PROJECT')
Uploadcare::Addons.remove_bg('FILE_UUID')

# You can pass optional parameters.
# See the full list of parameters here: https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/removeBgExecute
Uploadcare::Addons.remove_bg('FILE_ID_IN_YOUR_PROJECT', crop: true, type_level: '2')
Uploadcare::Addons.remove_bg('FILE_UUID', crop: true, type_level: '2')

# Check the status of background image removal.
Uploadcare::Addons.remove_bg_status('RETURNED_ID_FROM_REMOVE_BG')
Expand Down

0 comments on commit 5212c7e

Please sign in to comment.