moderation_api 1.2.0
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 +7 -0
- data/Gemfile +9 -0
- data/README.md +144 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +74 -0
- data/docs/AccountGet200Response.md +26 -0
- data/docs/AccountGet200ResponseCurrentProject.md +20 -0
- data/docs/ActionsCreateRequest.md +36 -0
- data/docs/ActionsCreateRequestWebhooksInner.md +24 -0
- data/docs/ActionsDelete200Response.md +20 -0
- data/docs/ActionsExecute200Response.md +22 -0
- data/docs/ActionsExecuteDeprecatedRequest.md +22 -0
- data/docs/ActionsExecuteRequest.md +24 -0
- data/docs/ActionsGet200Response.md +40 -0
- data/docs/ActionsGet200ResponseWebhooksInner.md +26 -0
- data/docs/ActionsList200ResponseInner.md +38 -0
- data/docs/ActionsList200ResponseInnerPossibleValuesInner.md +18 -0
- data/docs/ActionsList400Response.md +22 -0
- data/docs/ActionsList400ResponseIssuesInner.md +18 -0
- data/docs/ActionsUpdateRequest.md +36 -0
- data/docs/ModerateApi.md +357 -0
- data/docs/ModerationAudioRequest.md +28 -0
- data/docs/ModerationImage200Response.md +28 -0
- data/docs/ModerationImage200ResponseLabelsInner.md +20 -0
- data/docs/ModerationImageRequest.md +28 -0
- data/docs/ModerationObject200Response.md +36 -0
- data/docs/ModerationObject200ResponseAllOfEntitiesInner.md +22 -0
- data/docs/ModerationObject200ResponseAllOfFieldsInner.md +22 -0
- data/docs/ModerationObject200ResponseAllOfLabelsInner.md +22 -0
- data/docs/ModerationObjectRequest.md +28 -0
- data/docs/ModerationObjectRequestValue.md +20 -0
- data/docs/ModerationObjectRequestValueDataValue.md +22 -0
- data/docs/ModerationText200Response.md +64 -0
- data/docs/ModerationText200ResponseAllOfAddress.md +28 -0
- data/docs/ModerationText200ResponseAllOfEmail.md +28 -0
- data/docs/ModerationText200ResponseAllOfName.md +28 -0
- data/docs/ModerationText200ResponseAllOfNsfw.md +26 -0
- data/docs/ModerationText200ResponseAllOfNsfwLabelScores.md +22 -0
- data/docs/ModerationText200ResponseAllOfPhone.md +28 -0
- data/docs/ModerationText200ResponseAllOfProfanity.md +28 -0
- data/docs/ModerationText200ResponseAllOfPropriety.md +26 -0
- data/docs/ModerationText200ResponseAllOfProprietyLabelScores.md +22 -0
- data/docs/ModerationText200ResponseAllOfQuality.md +26 -0
- data/docs/ModerationText200ResponseAllOfQualityLabelScores.md +24 -0
- data/docs/ModerationText200ResponseAllOfRequest.md +20 -0
- data/docs/ModerationText200ResponseAllOfSensitive.md +28 -0
- data/docs/ModerationText200ResponseAllOfSentiment.md +26 -0
- data/docs/ModerationText200ResponseAllOfSentimentLabelScores.md +22 -0
- data/docs/ModerationText200ResponseAllOfToxicity.md +26 -0
- data/docs/ModerationText200ResponseAllOfToxicityLabelScores.md +30 -0
- data/docs/ModerationText200ResponseAllOfUrl.md +28 -0
- data/docs/ModerationText200ResponseAllOfUsername.md +28 -0
- data/docs/ModerationText200ResponseAllOfWordlist.md +28 -0
- data/docs/ModerationText200ResponseAllOfWordlistsInner.md +36 -0
- data/docs/ModerationTextRequest.md +28 -0
- data/docs/ModerationVideo200Response.md +24 -0
- data/docs/ModerationVideoRequest.md +28 -0
- data/docs/QueueActionsApi.md +503 -0
- data/git_push.sh +57 -0
- data/lib/moderation_api/api/account_api.rb +79 -0
- data/lib/moderation_api/api/moderate_api.rb +362 -0
- data/lib/moderation_api/api/queue_actions_api.rb +492 -0
- data/lib/moderation_api/api_client.rb +437 -0
- data/lib/moderation_api/api_error.rb +58 -0
- data/lib/moderation_api/configuration.rb +392 -0
- data/lib/moderation_api/models/account_get200_response.rb +278 -0
- data/lib/moderation_api/models/account_get200_response_current_project.rb +237 -0
- data/lib/moderation_api/models/actions_create_request.rb +374 -0
- data/lib/moderation_api/models/actions_create_request_webhooks_inner.rb +260 -0
- data/lib/moderation_api/models/actions_delete200_response.rb +239 -0
- data/lib/moderation_api/models/actions_execute200_response.rb +258 -0
- data/lib/moderation_api/models/actions_execute_deprecated_request.rb +244 -0
- data/lib/moderation_api/models/actions_execute_request.rb +261 -0
- data/lib/moderation_api/models/actions_get200_response.rb +408 -0
- data/lib/moderation_api/models/actions_get200_response_webhooks_inner.rb +278 -0
- data/lib/moderation_api/models/actions_list200_response_inner.rb +396 -0
- data/lib/moderation_api/models/actions_list200_response_inner_possible_values_inner.rb +222 -0
- data/lib/moderation_api/models/actions_list400_response.rb +248 -0
- data/lib/moderation_api/models/actions_list400_response_issues_inner.rb +221 -0
- data/lib/moderation_api/models/actions_update_request.rb +367 -0
- data/lib/moderation_api/models/moderation_audio_request.rb +302 -0
- data/lib/moderation_api/models/moderation_image200_response.rb +296 -0
- data/lib/moderation_api/models/moderation_image200_response_labels_inner.rb +301 -0
- data/lib/moderation_api/models/moderation_image_request.rb +302 -0
- data/lib/moderation_api/models/moderation_object200_response.rb +368 -0
- data/lib/moderation_api/models/moderation_object200_response_all_of_entities_inner.rb +251 -0
- data/lib/moderation_api/models/moderation_object200_response_all_of_fields_inner.rb +258 -0
- data/lib/moderation_api/models/moderation_object200_response_all_of_labels_inner.rb +284 -0
- data/lib/moderation_api/models/moderation_object_request.rb +301 -0
- data/lib/moderation_api/models/moderation_object_request_value.rb +275 -0
- data/lib/moderation_api/models/moderation_object_request_value_data_value.rb +285 -0
- data/lib/moderation_api/models/moderation_text200_response.rb +488 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_address.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_email.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_name.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_nsfw.rb +255 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_nsfw_label_scores.rb +235 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_phone.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_profanity.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_propriety.rb +255 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_propriety_label_scores.rb +235 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_quality.rb +255 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_quality_label_scores.rb +245 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_request.rb +240 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_sensitive.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_sentiment.rb +255 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_sentiment_label_scores.rb +235 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_toxicity.rb +262 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_toxicity_label_scores.rb +275 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_url.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_username.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_wordlist.rb +303 -0
- data/lib/moderation_api/models/moderation_text200_response_all_of_wordlists_inner.rb +377 -0
- data/lib/moderation_api/models/moderation_text_request.rb +330 -0
- data/lib/moderation_api/models/moderation_video200_response.rb +265 -0
- data/lib/moderation_api/models/moderation_video_request.rb +302 -0
- data/lib/moderation_api/version.rb +15 -0
- data/lib/moderation_api.rb +93 -0
- data/moderation_api.gemspec +45 -0
- data/spec/api/account_api_spec.rb +46 -0
- data/spec/api/moderate_api_spec.rb +95 -0
- data/spec/api/queue_actions_api_spec.rb +121 -0
- data/spec/models/account_get200_response_current_project_spec.rb +42 -0
- data/spec/models/account_get200_response_spec.rb +60 -0
- data/spec/models/actions_create_request_spec.rb +98 -0
- data/spec/models/actions_create_request_webhooks_inner_spec.rb +54 -0
- data/spec/models/actions_delete200_response_spec.rb +42 -0
- data/spec/models/actions_execute200_response_spec.rb +48 -0
- data/spec/models/actions_execute_deprecated_request_spec.rb +48 -0
- data/spec/models/actions_execute_request_spec.rb +54 -0
- data/spec/models/actions_get200_response_spec.rb +110 -0
- data/spec/models/actions_get200_response_webhooks_inner_spec.rb +60 -0
- data/spec/models/actions_list200_response_inner_possible_values_inner_spec.rb +36 -0
- data/spec/models/actions_list200_response_inner_spec.rb +104 -0
- data/spec/models/actions_list400_response_issues_inner_spec.rb +36 -0
- data/spec/models/actions_list400_response_spec.rb +48 -0
- data/spec/models/actions_update_request_spec.rb +98 -0
- data/spec/models/moderation_audio_request_spec.rb +66 -0
- data/spec/models/moderation_image200_response_labels_inner_spec.rb +46 -0
- data/spec/models/moderation_image200_response_spec.rb +66 -0
- data/spec/models/moderation_image_request_spec.rb +66 -0
- data/spec/models/moderation_object200_response_all_of_entities_inner_spec.rb +48 -0
- data/spec/models/moderation_object200_response_all_of_fields_inner_spec.rb +48 -0
- data/spec/models/moderation_object200_response_all_of_labels_inner_spec.rb +48 -0
- data/spec/models/moderation_object200_response_spec.rb +90 -0
- data/spec/models/moderation_object_request_spec.rb +66 -0
- data/spec/models/moderation_object_request_value_data_value_spec.rb +52 -0
- data/spec/models/moderation_object_request_value_spec.rb +46 -0
- data/spec/models/moderation_text200_response_all_of_address_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_email_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_name_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_nsfw_label_scores_spec.rb +48 -0
- data/spec/models/moderation_text200_response_all_of_nsfw_spec.rb +60 -0
- data/spec/models/moderation_text200_response_all_of_phone_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_profanity_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_propriety_label_scores_spec.rb +48 -0
- data/spec/models/moderation_text200_response_all_of_propriety_spec.rb +60 -0
- data/spec/models/moderation_text200_response_all_of_quality_label_scores_spec.rb +54 -0
- data/spec/models/moderation_text200_response_all_of_quality_spec.rb +60 -0
- data/spec/models/moderation_text200_response_all_of_request_spec.rb +42 -0
- data/spec/models/moderation_text200_response_all_of_sensitive_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_sentiment_label_scores_spec.rb +48 -0
- data/spec/models/moderation_text200_response_all_of_sentiment_spec.rb +60 -0
- data/spec/models/moderation_text200_response_all_of_toxicity_label_scores_spec.rb +72 -0
- data/spec/models/moderation_text200_response_all_of_toxicity_spec.rb +60 -0
- data/spec/models/moderation_text200_response_all_of_url_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_username_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_wordlist_spec.rb +70 -0
- data/spec/models/moderation_text200_response_all_of_wordlists_inner_spec.rb +94 -0
- data/spec/models/moderation_text200_response_spec.rb +174 -0
- data/spec/models/moderation_text_request_spec.rb +66 -0
- data/spec/models/moderation_video200_response_spec.rb +54 -0
- data/spec/models/moderation_video_request_spec.rb +66 -0
- data/spec/spec_helper.rb +111 -0
- metadata +340 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
# ModerationAPI::ModerationVideo200Response
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **status** | **String** | Success if the request was successful | |
|
8
|
+
| **request** | [**ModerationText200ResponseAllOfRequest**](ModerationText200ResponseAllOfRequest.md) | | |
|
9
|
+
| **flagged** | **Boolean** | Whether the content was flagged by any models | |
|
10
|
+
| **content_id** | **String** | The ID of the content. Only returned if the content was stored. | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'moderation_api'
|
16
|
+
|
17
|
+
instance = ModerationAPI::ModerationVideo200Response.new(
|
18
|
+
status: null,
|
19
|
+
request: null,
|
20
|
+
flagged: null,
|
21
|
+
content_id: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# ModerationAPI::ModerationVideoRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **url** | **String** | The URL of the video you want to analyze. | |
|
8
|
+
| **content_id** | **String** | The unique ID of the content in your database. | [optional] |
|
9
|
+
| **do_not_store** | **Boolean** | Do not store the content. The content won't enter the review queue | [optional] |
|
10
|
+
| **author_id** | **String** | The author of the content. | [optional] |
|
11
|
+
| **context_id** | **String** | For example the ID of a chat room or a post | [optional] |
|
12
|
+
| **metadata** | **Hash<String, Object>** | Any metadata you want to store with the content | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'moderation_api'
|
18
|
+
|
19
|
+
instance = ModerationAPI::ModerationVideoRequest.new(
|
20
|
+
url: null,
|
21
|
+
content_id: null,
|
22
|
+
do_not_store: null,
|
23
|
+
author_id: null,
|
24
|
+
context_id: null,
|
25
|
+
metadata: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
@@ -0,0 +1,503 @@
|
|
1
|
+
# ModerationAPI::QueueActionsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://moderationapi.com/api/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**actions_create**](QueueActionsApi.md#actions_create) | **POST** /actions | Create an action |
|
8
|
+
| [**actions_delete**](QueueActionsApi.md#actions_delete) | **DELETE** /actions/{id} | Delete an action |
|
9
|
+
| [**actions_execute**](QueueActionsApi.md#actions_execute) | **POST** /actions/execute | Execute an action |
|
10
|
+
| [**actions_execute_deprecated**](QueueActionsApi.md#actions_execute_deprecated) | **POST** /actions/{actionId}/execute | Execute an action |
|
11
|
+
| [**actions_get**](QueueActionsApi.md#actions_get) | **GET** /actions/{id} | Get an action |
|
12
|
+
| [**actions_list**](QueueActionsApi.md#actions_list) | **GET** /actions | List actions |
|
13
|
+
| [**actions_update**](QueueActionsApi.md#actions_update) | **PUT** /actions/{id} | Update an action |
|
14
|
+
|
15
|
+
|
16
|
+
## actions_create
|
17
|
+
|
18
|
+
> <ActionsList200ResponseInner> actions_create(actions_create_request)
|
19
|
+
|
20
|
+
Create an action
|
21
|
+
|
22
|
+
Create an action.
|
23
|
+
|
24
|
+
### Examples
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
require 'time'
|
28
|
+
require 'moderation_api'
|
29
|
+
# setup authorization
|
30
|
+
ModerationAPI.configure do |config|
|
31
|
+
# Configure Bearer authorization: Authorization
|
32
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
33
|
+
end
|
34
|
+
|
35
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
36
|
+
actions_create_request = ModerationAPI::ActionsCreateRequest.new({name: 'name_example'}) # ActionsCreateRequest |
|
37
|
+
|
38
|
+
begin
|
39
|
+
# Create an action
|
40
|
+
result = api_instance.actions_create(actions_create_request)
|
41
|
+
p result
|
42
|
+
rescue ModerationAPI::ApiError => e
|
43
|
+
puts "Error when calling QueueActionsApi->actions_create: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
#### Using the actions_create_with_http_info variant
|
48
|
+
|
49
|
+
This returns an Array which contains the response data, status code and headers.
|
50
|
+
|
51
|
+
> <Array(<ActionsList200ResponseInner>, Integer, Hash)> actions_create_with_http_info(actions_create_request)
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
begin
|
55
|
+
# Create an action
|
56
|
+
data, status_code, headers = api_instance.actions_create_with_http_info(actions_create_request)
|
57
|
+
p status_code # => 2xx
|
58
|
+
p headers # => { ... }
|
59
|
+
p data # => <ActionsList200ResponseInner>
|
60
|
+
rescue ModerationAPI::ApiError => e
|
61
|
+
puts "Error when calling QueueActionsApi->actions_create_with_http_info: #{e}"
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
### Parameters
|
66
|
+
|
67
|
+
| Name | Type | Description | Notes |
|
68
|
+
| ---- | ---- | ----------- | ----- |
|
69
|
+
| **actions_create_request** | [**ActionsCreateRequest**](ActionsCreateRequest.md) | | |
|
70
|
+
|
71
|
+
### Return type
|
72
|
+
|
73
|
+
[**ActionsList200ResponseInner**](ActionsList200ResponseInner.md)
|
74
|
+
|
75
|
+
### Authorization
|
76
|
+
|
77
|
+
[Authorization](../README.md#Authorization)
|
78
|
+
|
79
|
+
### HTTP request headers
|
80
|
+
|
81
|
+
- **Content-Type**: application/json
|
82
|
+
- **Accept**: application/json
|
83
|
+
|
84
|
+
|
85
|
+
## actions_delete
|
86
|
+
|
87
|
+
> <ActionsDelete200Response> actions_delete(id)
|
88
|
+
|
89
|
+
Delete an action
|
90
|
+
|
91
|
+
Delete an action and all of its webhooks.
|
92
|
+
|
93
|
+
### Examples
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'time'
|
97
|
+
require 'moderation_api'
|
98
|
+
# setup authorization
|
99
|
+
ModerationAPI.configure do |config|
|
100
|
+
# Configure Bearer authorization: Authorization
|
101
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
102
|
+
end
|
103
|
+
|
104
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
105
|
+
id = '60c9e1c0e4e7e1001c7a0e1d' # String | The ID of the action to delete.
|
106
|
+
|
107
|
+
begin
|
108
|
+
# Delete an action
|
109
|
+
result = api_instance.actions_delete(id)
|
110
|
+
p result
|
111
|
+
rescue ModerationAPI::ApiError => e
|
112
|
+
puts "Error when calling QueueActionsApi->actions_delete: #{e}"
|
113
|
+
end
|
114
|
+
```
|
115
|
+
|
116
|
+
#### Using the actions_delete_with_http_info variant
|
117
|
+
|
118
|
+
This returns an Array which contains the response data, status code and headers.
|
119
|
+
|
120
|
+
> <Array(<ActionsDelete200Response>, Integer, Hash)> actions_delete_with_http_info(id)
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
begin
|
124
|
+
# Delete an action
|
125
|
+
data, status_code, headers = api_instance.actions_delete_with_http_info(id)
|
126
|
+
p status_code # => 2xx
|
127
|
+
p headers # => { ... }
|
128
|
+
p data # => <ActionsDelete200Response>
|
129
|
+
rescue ModerationAPI::ApiError => e
|
130
|
+
puts "Error when calling QueueActionsApi->actions_delete_with_http_info: #{e}"
|
131
|
+
end
|
132
|
+
```
|
133
|
+
|
134
|
+
### Parameters
|
135
|
+
|
136
|
+
| Name | Type | Description | Notes |
|
137
|
+
| ---- | ---- | ----------- | ----- |
|
138
|
+
| **id** | **String** | The ID of the action to delete. | |
|
139
|
+
|
140
|
+
### Return type
|
141
|
+
|
142
|
+
[**ActionsDelete200Response**](ActionsDelete200Response.md)
|
143
|
+
|
144
|
+
### Authorization
|
145
|
+
|
146
|
+
[Authorization](../README.md#Authorization)
|
147
|
+
|
148
|
+
### HTTP request headers
|
149
|
+
|
150
|
+
- **Content-Type**: Not defined
|
151
|
+
- **Accept**: application/json
|
152
|
+
|
153
|
+
|
154
|
+
## actions_execute
|
155
|
+
|
156
|
+
> <ActionsExecute200Response> actions_execute(actions_execute_request)
|
157
|
+
|
158
|
+
Execute an action
|
159
|
+
|
160
|
+
Execute an action on a set of content items in a queue.
|
161
|
+
|
162
|
+
### Examples
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
require 'time'
|
166
|
+
require 'moderation_api'
|
167
|
+
# setup authorization
|
168
|
+
ModerationAPI.configure do |config|
|
169
|
+
# Configure Bearer authorization: Authorization
|
170
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
171
|
+
end
|
172
|
+
|
173
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
174
|
+
actions_execute_request = ModerationAPI::ActionsExecuteRequest.new({content_ids: ['content_ids_example'], action_id: 'action_id_example'}) # ActionsExecuteRequest |
|
175
|
+
|
176
|
+
begin
|
177
|
+
# Execute an action
|
178
|
+
result = api_instance.actions_execute(actions_execute_request)
|
179
|
+
p result
|
180
|
+
rescue ModerationAPI::ApiError => e
|
181
|
+
puts "Error when calling QueueActionsApi->actions_execute: #{e}"
|
182
|
+
end
|
183
|
+
```
|
184
|
+
|
185
|
+
#### Using the actions_execute_with_http_info variant
|
186
|
+
|
187
|
+
This returns an Array which contains the response data, status code and headers.
|
188
|
+
|
189
|
+
> <Array(<ActionsExecute200Response>, Integer, Hash)> actions_execute_with_http_info(actions_execute_request)
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
begin
|
193
|
+
# Execute an action
|
194
|
+
data, status_code, headers = api_instance.actions_execute_with_http_info(actions_execute_request)
|
195
|
+
p status_code # => 2xx
|
196
|
+
p headers # => { ... }
|
197
|
+
p data # => <ActionsExecute200Response>
|
198
|
+
rescue ModerationAPI::ApiError => e
|
199
|
+
puts "Error when calling QueueActionsApi->actions_execute_with_http_info: #{e}"
|
200
|
+
end
|
201
|
+
```
|
202
|
+
|
203
|
+
### Parameters
|
204
|
+
|
205
|
+
| Name | Type | Description | Notes |
|
206
|
+
| ---- | ---- | ----------- | ----- |
|
207
|
+
| **actions_execute_request** | [**ActionsExecuteRequest**](ActionsExecuteRequest.md) | | |
|
208
|
+
|
209
|
+
### Return type
|
210
|
+
|
211
|
+
[**ActionsExecute200Response**](ActionsExecute200Response.md)
|
212
|
+
|
213
|
+
### Authorization
|
214
|
+
|
215
|
+
[Authorization](../README.md#Authorization)
|
216
|
+
|
217
|
+
### HTTP request headers
|
218
|
+
|
219
|
+
- **Content-Type**: application/json
|
220
|
+
- **Accept**: application/json
|
221
|
+
|
222
|
+
|
223
|
+
## actions_execute_deprecated
|
224
|
+
|
225
|
+
> <ActionsExecute200Response> actions_execute_deprecated(action_id, actions_execute_deprecated_request)
|
226
|
+
|
227
|
+
Execute an action
|
228
|
+
|
229
|
+
Execute an action on a set of content items in a queue.
|
230
|
+
|
231
|
+
### Examples
|
232
|
+
|
233
|
+
```ruby
|
234
|
+
require 'time'
|
235
|
+
require 'moderation_api'
|
236
|
+
# setup authorization
|
237
|
+
ModerationAPI.configure do |config|
|
238
|
+
# Configure Bearer authorization: Authorization
|
239
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
240
|
+
end
|
241
|
+
|
242
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
243
|
+
action_id = 'action_id_example' # String | The ID or key of the action to execute.
|
244
|
+
actions_execute_deprecated_request = ModerationAPI::ActionsExecuteDeprecatedRequest.new({content_ids: ['content_ids_example']}) # ActionsExecuteDeprecatedRequest |
|
245
|
+
|
246
|
+
begin
|
247
|
+
# Execute an action
|
248
|
+
result = api_instance.actions_execute_deprecated(action_id, actions_execute_deprecated_request)
|
249
|
+
p result
|
250
|
+
rescue ModerationAPI::ApiError => e
|
251
|
+
puts "Error when calling QueueActionsApi->actions_execute_deprecated: #{e}"
|
252
|
+
end
|
253
|
+
```
|
254
|
+
|
255
|
+
#### Using the actions_execute_deprecated_with_http_info variant
|
256
|
+
|
257
|
+
This returns an Array which contains the response data, status code and headers.
|
258
|
+
|
259
|
+
> <Array(<ActionsExecute200Response>, Integer, Hash)> actions_execute_deprecated_with_http_info(action_id, actions_execute_deprecated_request)
|
260
|
+
|
261
|
+
```ruby
|
262
|
+
begin
|
263
|
+
# Execute an action
|
264
|
+
data, status_code, headers = api_instance.actions_execute_deprecated_with_http_info(action_id, actions_execute_deprecated_request)
|
265
|
+
p status_code # => 2xx
|
266
|
+
p headers # => { ... }
|
267
|
+
p data # => <ActionsExecute200Response>
|
268
|
+
rescue ModerationAPI::ApiError => e
|
269
|
+
puts "Error when calling QueueActionsApi->actions_execute_deprecated_with_http_info: #{e}"
|
270
|
+
end
|
271
|
+
```
|
272
|
+
|
273
|
+
### Parameters
|
274
|
+
|
275
|
+
| Name | Type | Description | Notes |
|
276
|
+
| ---- | ---- | ----------- | ----- |
|
277
|
+
| **action_id** | **String** | The ID or key of the action to execute. | |
|
278
|
+
| **actions_execute_deprecated_request** | [**ActionsExecuteDeprecatedRequest**](ActionsExecuteDeprecatedRequest.md) | | |
|
279
|
+
|
280
|
+
### Return type
|
281
|
+
|
282
|
+
[**ActionsExecute200Response**](ActionsExecute200Response.md)
|
283
|
+
|
284
|
+
### Authorization
|
285
|
+
|
286
|
+
[Authorization](../README.md#Authorization)
|
287
|
+
|
288
|
+
### HTTP request headers
|
289
|
+
|
290
|
+
- **Content-Type**: application/json
|
291
|
+
- **Accept**: application/json
|
292
|
+
|
293
|
+
|
294
|
+
## actions_get
|
295
|
+
|
296
|
+
> <ActionsGet200Response> actions_get(id)
|
297
|
+
|
298
|
+
Get an action
|
299
|
+
|
300
|
+
Get an action by ID.
|
301
|
+
|
302
|
+
### Examples
|
303
|
+
|
304
|
+
```ruby
|
305
|
+
require 'time'
|
306
|
+
require 'moderation_api'
|
307
|
+
# setup authorization
|
308
|
+
ModerationAPI.configure do |config|
|
309
|
+
# Configure Bearer authorization: Authorization
|
310
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
311
|
+
end
|
312
|
+
|
313
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
314
|
+
id = '60c9e1c0e4e7e1001c7a0e1d' # String | The ID of the action to get.
|
315
|
+
|
316
|
+
begin
|
317
|
+
# Get an action
|
318
|
+
result = api_instance.actions_get(id)
|
319
|
+
p result
|
320
|
+
rescue ModerationAPI::ApiError => e
|
321
|
+
puts "Error when calling QueueActionsApi->actions_get: #{e}"
|
322
|
+
end
|
323
|
+
```
|
324
|
+
|
325
|
+
#### Using the actions_get_with_http_info variant
|
326
|
+
|
327
|
+
This returns an Array which contains the response data, status code and headers.
|
328
|
+
|
329
|
+
> <Array(<ActionsGet200Response>, Integer, Hash)> actions_get_with_http_info(id)
|
330
|
+
|
331
|
+
```ruby
|
332
|
+
begin
|
333
|
+
# Get an action
|
334
|
+
data, status_code, headers = api_instance.actions_get_with_http_info(id)
|
335
|
+
p status_code # => 2xx
|
336
|
+
p headers # => { ... }
|
337
|
+
p data # => <ActionsGet200Response>
|
338
|
+
rescue ModerationAPI::ApiError => e
|
339
|
+
puts "Error when calling QueueActionsApi->actions_get_with_http_info: #{e}"
|
340
|
+
end
|
341
|
+
```
|
342
|
+
|
343
|
+
### Parameters
|
344
|
+
|
345
|
+
| Name | Type | Description | Notes |
|
346
|
+
| ---- | ---- | ----------- | ----- |
|
347
|
+
| **id** | **String** | The ID of the action to get. | |
|
348
|
+
|
349
|
+
### Return type
|
350
|
+
|
351
|
+
[**ActionsGet200Response**](ActionsGet200Response.md)
|
352
|
+
|
353
|
+
### Authorization
|
354
|
+
|
355
|
+
[Authorization](../README.md#Authorization)
|
356
|
+
|
357
|
+
### HTTP request headers
|
358
|
+
|
359
|
+
- **Content-Type**: Not defined
|
360
|
+
- **Accept**: application/json
|
361
|
+
|
362
|
+
|
363
|
+
## actions_list
|
364
|
+
|
365
|
+
> <Array<ActionsList200ResponseInner>> actions_list(opts)
|
366
|
+
|
367
|
+
List actions
|
368
|
+
|
369
|
+
List actions for the current user.
|
370
|
+
|
371
|
+
### Examples
|
372
|
+
|
373
|
+
```ruby
|
374
|
+
require 'time'
|
375
|
+
require 'moderation_api'
|
376
|
+
# setup authorization
|
377
|
+
ModerationAPI.configure do |config|
|
378
|
+
# Configure Bearer authorization: Authorization
|
379
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
380
|
+
end
|
381
|
+
|
382
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
383
|
+
opts = {
|
384
|
+
queue_id: '60c9e1c0e4e7e1001c7a0e1d' # String | Only return actions available in this queue.
|
385
|
+
}
|
386
|
+
|
387
|
+
begin
|
388
|
+
# List actions
|
389
|
+
result = api_instance.actions_list(opts)
|
390
|
+
p result
|
391
|
+
rescue ModerationAPI::ApiError => e
|
392
|
+
puts "Error when calling QueueActionsApi->actions_list: #{e}"
|
393
|
+
end
|
394
|
+
```
|
395
|
+
|
396
|
+
#### Using the actions_list_with_http_info variant
|
397
|
+
|
398
|
+
This returns an Array which contains the response data, status code and headers.
|
399
|
+
|
400
|
+
> <Array(<Array<ActionsList200ResponseInner>>, Integer, Hash)> actions_list_with_http_info(opts)
|
401
|
+
|
402
|
+
```ruby
|
403
|
+
begin
|
404
|
+
# List actions
|
405
|
+
data, status_code, headers = api_instance.actions_list_with_http_info(opts)
|
406
|
+
p status_code # => 2xx
|
407
|
+
p headers # => { ... }
|
408
|
+
p data # => <Array<ActionsList200ResponseInner>>
|
409
|
+
rescue ModerationAPI::ApiError => e
|
410
|
+
puts "Error when calling QueueActionsApi->actions_list_with_http_info: #{e}"
|
411
|
+
end
|
412
|
+
```
|
413
|
+
|
414
|
+
### Parameters
|
415
|
+
|
416
|
+
| Name | Type | Description | Notes |
|
417
|
+
| ---- | ---- | ----------- | ----- |
|
418
|
+
| **queue_id** | **String** | Only return actions available in this queue. | [optional] |
|
419
|
+
|
420
|
+
### Return type
|
421
|
+
|
422
|
+
[**Array<ActionsList200ResponseInner>**](ActionsList200ResponseInner.md)
|
423
|
+
|
424
|
+
### Authorization
|
425
|
+
|
426
|
+
[Authorization](../README.md#Authorization)
|
427
|
+
|
428
|
+
### HTTP request headers
|
429
|
+
|
430
|
+
- **Content-Type**: Not defined
|
431
|
+
- **Accept**: application/json
|
432
|
+
|
433
|
+
|
434
|
+
## actions_update
|
435
|
+
|
436
|
+
> <ActionsList200ResponseInner> actions_update(id, actions_update_request)
|
437
|
+
|
438
|
+
Update an action
|
439
|
+
|
440
|
+
Update an action.
|
441
|
+
|
442
|
+
### Examples
|
443
|
+
|
444
|
+
```ruby
|
445
|
+
require 'time'
|
446
|
+
require 'moderation_api'
|
447
|
+
# setup authorization
|
448
|
+
ModerationAPI.configure do |config|
|
449
|
+
# Configure Bearer authorization: Authorization
|
450
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
451
|
+
end
|
452
|
+
|
453
|
+
api_instance = ModerationAPI::QueueActionsApi.new
|
454
|
+
id = '60c9e1c0e4e7e1001c7a0e1d' # String | The ID of the action to update.
|
455
|
+
actions_update_request = ModerationAPI::ActionsUpdateRequest.new # ActionsUpdateRequest |
|
456
|
+
|
457
|
+
begin
|
458
|
+
# Update an action
|
459
|
+
result = api_instance.actions_update(id, actions_update_request)
|
460
|
+
p result
|
461
|
+
rescue ModerationAPI::ApiError => e
|
462
|
+
puts "Error when calling QueueActionsApi->actions_update: #{e}"
|
463
|
+
end
|
464
|
+
```
|
465
|
+
|
466
|
+
#### Using the actions_update_with_http_info variant
|
467
|
+
|
468
|
+
This returns an Array which contains the response data, status code and headers.
|
469
|
+
|
470
|
+
> <Array(<ActionsList200ResponseInner>, Integer, Hash)> actions_update_with_http_info(id, actions_update_request)
|
471
|
+
|
472
|
+
```ruby
|
473
|
+
begin
|
474
|
+
# Update an action
|
475
|
+
data, status_code, headers = api_instance.actions_update_with_http_info(id, actions_update_request)
|
476
|
+
p status_code # => 2xx
|
477
|
+
p headers # => { ... }
|
478
|
+
p data # => <ActionsList200ResponseInner>
|
479
|
+
rescue ModerationAPI::ApiError => e
|
480
|
+
puts "Error when calling QueueActionsApi->actions_update_with_http_info: #{e}"
|
481
|
+
end
|
482
|
+
```
|
483
|
+
|
484
|
+
### Parameters
|
485
|
+
|
486
|
+
| Name | Type | Description | Notes |
|
487
|
+
| ---- | ---- | ----------- | ----- |
|
488
|
+
| **id** | **String** | The ID of the action to update. | |
|
489
|
+
| **actions_update_request** | [**ActionsUpdateRequest**](ActionsUpdateRequest.md) | | |
|
490
|
+
|
491
|
+
### Return type
|
492
|
+
|
493
|
+
[**ActionsList200ResponseInner**](ActionsList200ResponseInner.md)
|
494
|
+
|
495
|
+
### Authorization
|
496
|
+
|
497
|
+
[Authorization](../README.md#Authorization)
|
498
|
+
|
499
|
+
### HTTP request headers
|
500
|
+
|
501
|
+
- **Content-Type**: application/json
|
502
|
+
- **Accept**: application/json
|
503
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,79 @@
|
|
1
|
+
=begin
|
2
|
+
#Moderation API
|
3
|
+
|
4
|
+
#API for automated content moderation
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.10.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module ModerationAPI
|
16
|
+
class AccountApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get account details
|
23
|
+
# Get account details
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [AccountGet200Response]
|
26
|
+
def account_get(opts = {})
|
27
|
+
data, _status_code, _headers = account_get_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get account details
|
32
|
+
# Get account details
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(AccountGet200Response, Integer, Hash)>] AccountGet200Response data, response status code and response headers
|
35
|
+
def account_get_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountApi.account_get ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/account'
|
41
|
+
|
42
|
+
# query parameters
|
43
|
+
query_params = opts[:query_params] || {}
|
44
|
+
|
45
|
+
# header parameters
|
46
|
+
header_params = opts[:header_params] || {}
|
47
|
+
# HTTP header 'Accept' (if needed)
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = opts[:form_params] || {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = opts[:debug_body]
|
55
|
+
|
56
|
+
# return_type
|
57
|
+
return_type = opts[:debug_return_type] || 'AccountGet200Response'
|
58
|
+
|
59
|
+
# auth_names
|
60
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
61
|
+
|
62
|
+
new_options = opts.merge(
|
63
|
+
:operation => :"AccountApi.account_get",
|
64
|
+
:header_params => header_params,
|
65
|
+
:query_params => query_params,
|
66
|
+
:form_params => form_params,
|
67
|
+
:body => post_body,
|
68
|
+
:auth_names => auth_names,
|
69
|
+
:return_type => return_type
|
70
|
+
)
|
71
|
+
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
73
|
+
if @api_client.config.debugging
|
74
|
+
@api_client.config.logger.debug "API called: AccountApi#account_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
+
end
|
76
|
+
return data, status_code, headers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|