Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWS Rekognition moderation Add-On methods #140

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based now on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

### Added
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove repeated word "Added" for clarity.

- * Added Addons api for `AWS Rekognition Moderation` Add-On.
+ * Addons api for `AWS Rekognition Moderation` Add-On.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
### Added
###

* Added Addons api for `AWS Rekognition Moderation` Add-On.

## 3.4.1 — 2024-03-24

### Fixed
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ post.picture.store
# ...other group data...
# }

#
# Delete the file from an Uploadcare server permanently:
post.picture.delete
# => {
Expand Down Expand Up @@ -422,6 +423,7 @@ post.attachments.store
# }]
# }

#
# Delete the file group from an Uploadcare server permanently:
post.attachments.delete
# => {
Expand Down Expand Up @@ -977,6 +979,25 @@ Uploadcare::AddonsApi.rekognition_detect_labels_status('dfeaf81c-5c0d-49d5-8ed4-
# => {"status"=>"done"}
```

#### Execute AWS Rekognition Moderation Add-On for a given target to detect moderation labels in an image.
```
Note: Detected labels are stored in the file's appdata.
```

```ruby
Uploadcare::AddonsApi.rekognition_detect_moderation_labels('f757ea10-8b1a-4361-9a7c-56bfa5d45176')
# => {"request_id"=>"dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e"}
```

# Check the status of an AWS Rekognition Moderation Add-On execution request that had been started using the Execute Add-On operation.

```ruby
Uploadcare::AddonsApi.rekognition_detect_moderation_labels_status('dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e')
# => {"status"=>"done"}
```

Comment on lines +982 to +998
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure there is a blank line after the heading for better readability and markdown formatting.

#### Execute AWS Rekognition Moderation Add-On for a given target to detect moderation labels in an image.

+ 

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
#### Execute AWS Rekognition Moderation Add-On for a given target to detect moderation labels in an image.
```
Note: Detected labels are stored in the file's appdata.
```
```ruby
Uploadcare::AddonsApi.rekognition_detect_moderation_labels('f757ea10-8b1a-4361-9a7c-56bfa5d45176')
# => {"request_id"=>"dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e"}
```
# Check the status of an AWS Rekognition Moderation Add-On execution request that had been started using the Execute Add-On operation.
```ruby
Uploadcare::AddonsApi.rekognition_detect_moderation_labels_status('dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e')
# => {"status"=>"done"}
```
#### Execute AWS Rekognition Moderation Add-On for a given target to detect moderation labels in an image.

Note: Detected labels are stored in the file's appdata.


```ruby
Uploadcare::AddonsApi.rekognition_detect_moderation_labels('f757ea10-8b1a-4361-9a7c-56bfa5d45176')
#   => {"request_id"=>"dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e"}

Check the status of an AWS Rekognition Moderation Add-On execution request that had been started using the Execute Add-On operation.

Uploadcare::AddonsApi.rekognition_detect_moderation_labels_status('dfeaf81c-5c0d-49d5-8ed4-ac09bac7998e')
#   => {"status"=>"done"}

</details>
<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->



#### Execute ClamAV virus checking Add-On for a given target

```ruby
Expand Down
12 changes: 12 additions & 0 deletions lib/uploadcare/rails/api/rest/addons_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ def remove_bg(uuid, params = {})
def remove_bg_status(uuid)
Uploadcare::Addons.remove_bg_status(uuid)
end

# Execute AWS Rekognition Moderation Add-On for a given target to detect labels in an image.
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/Add-Ons/operation/awsRekognitionDetectModerationLabelsExecute
def rekognition_detect_moderation_labels(uuid)
Uploadcare::Addons.ws_rekognition_detect_moderation_labels(uuid)
end

# Check the status of an Add-On execution request that had been started using the Execute Add-On operation.
# @see https://uploadcare.com/api-refs/rest-api/v0.7.0/#tag/Add-Ons/operation/awsRekognitionDetectModerationLabelsExecutionStatus
def rekognition_detect_moderation_labels_status(uuid)
Uploadcare::Addons.ws_rekognition_detect_moderation_labels_status(uuid)
end
end
end
end
Expand Down
18 changes: 9 additions & 9 deletions spec/fixtures/vcr_cassettes/group_api_get_group.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions spec/fixtures/vcr_cassettes/remove_bg.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions spec/fixtures/vcr_cassettes/remove_bg_status.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions spec/fixtures/vcr_cassettes/uc_clamav_virus_scan.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions spec/fixtures/vcr_cassettes/uc_clamav_virus_scan_status.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading