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,362 @@
|
|
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 ModerateApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Analyze audio
|
23
|
+
# Analyze audio with your Moderation API project
|
24
|
+
# @param moderation_audio_request [ModerationAudioRequest]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [ModerationVideo200Response]
|
27
|
+
def moderation_audio(moderation_audio_request, opts = {})
|
28
|
+
data, _status_code, _headers = moderation_audio_with_http_info(moderation_audio_request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Analyze audio
|
33
|
+
# Analyze audio with your Moderation API project
|
34
|
+
# @param moderation_audio_request [ModerationAudioRequest]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(ModerationVideo200Response, Integer, Hash)>] ModerationVideo200Response data, response status code and response headers
|
37
|
+
def moderation_audio_with_http_info(moderation_audio_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ModerateApi.moderation_audio ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'moderation_audio_request' is set
|
42
|
+
if @api_client.config.client_side_validation && moderation_audio_request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'moderation_audio_request' when calling ModerateApi.moderation_audio"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/moderate/audio'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(moderation_audio_request)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'ModerationVideo200Response'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"ModerateApi.moderation_audio",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: ModerateApi#moderation_audio\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Analyze image
|
91
|
+
# Analyze image with your Moderation API project
|
92
|
+
# @param moderation_image_request [ModerationImageRequest]
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [ModerationImage200Response]
|
95
|
+
def moderation_image(moderation_image_request, opts = {})
|
96
|
+
data, _status_code, _headers = moderation_image_with_http_info(moderation_image_request, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Analyze image
|
101
|
+
# Analyze image with your Moderation API project
|
102
|
+
# @param moderation_image_request [ModerationImageRequest]
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(ModerationImage200Response, Integer, Hash)>] ModerationImage200Response data, response status code and response headers
|
105
|
+
def moderation_image_with_http_info(moderation_image_request, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: ModerateApi.moderation_image ...'
|
108
|
+
end
|
109
|
+
# verify the required parameter 'moderation_image_request' is set
|
110
|
+
if @api_client.config.client_side_validation && moderation_image_request.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'moderation_image_request' when calling ModerateApi.moderation_image"
|
112
|
+
end
|
113
|
+
# resource path
|
114
|
+
local_var_path = '/moderate/image'
|
115
|
+
|
116
|
+
# query parameters
|
117
|
+
query_params = opts[:query_params] || {}
|
118
|
+
|
119
|
+
# header parameters
|
120
|
+
header_params = opts[:header_params] || {}
|
121
|
+
# HTTP header 'Accept' (if needed)
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
123
|
+
# HTTP header 'Content-Type'
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
125
|
+
if !content_type.nil?
|
126
|
+
header_params['Content-Type'] = content_type
|
127
|
+
end
|
128
|
+
|
129
|
+
# form parameters
|
130
|
+
form_params = opts[:form_params] || {}
|
131
|
+
|
132
|
+
# http body (model)
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(moderation_image_request)
|
134
|
+
|
135
|
+
# return_type
|
136
|
+
return_type = opts[:debug_return_type] || 'ModerationImage200Response'
|
137
|
+
|
138
|
+
# auth_names
|
139
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
140
|
+
|
141
|
+
new_options = opts.merge(
|
142
|
+
:operation => :"ModerateApi.moderation_image",
|
143
|
+
:header_params => header_params,
|
144
|
+
:query_params => query_params,
|
145
|
+
:form_params => form_params,
|
146
|
+
:body => post_body,
|
147
|
+
:auth_names => auth_names,
|
148
|
+
:return_type => return_type
|
149
|
+
)
|
150
|
+
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "API called: ModerateApi#moderation_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
|
+
end
|
155
|
+
return data, status_code, headers
|
156
|
+
end
|
157
|
+
|
158
|
+
# Analyze object.
|
159
|
+
# Analyze an object with multiple fields including text, images, video, audio. Use to moderate a post, a profile, a form submission or anything that have multiple fields.
|
160
|
+
# @param moderation_object_request [ModerationObjectRequest]
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @return [ModerationObject200Response]
|
163
|
+
def moderation_object(moderation_object_request, opts = {})
|
164
|
+
data, _status_code, _headers = moderation_object_with_http_info(moderation_object_request, opts)
|
165
|
+
data
|
166
|
+
end
|
167
|
+
|
168
|
+
# Analyze object.
|
169
|
+
# Analyze an object with multiple fields including text, images, video, audio. Use to moderate a post, a profile, a form submission or anything that have multiple fields.
|
170
|
+
# @param moderation_object_request [ModerationObjectRequest]
|
171
|
+
# @param [Hash] opts the optional parameters
|
172
|
+
# @return [Array<(ModerationObject200Response, Integer, Hash)>] ModerationObject200Response data, response status code and response headers
|
173
|
+
def moderation_object_with_http_info(moderation_object_request, opts = {})
|
174
|
+
if @api_client.config.debugging
|
175
|
+
@api_client.config.logger.debug 'Calling API: ModerateApi.moderation_object ...'
|
176
|
+
end
|
177
|
+
# verify the required parameter 'moderation_object_request' is set
|
178
|
+
if @api_client.config.client_side_validation && moderation_object_request.nil?
|
179
|
+
fail ArgumentError, "Missing the required parameter 'moderation_object_request' when calling ModerateApi.moderation_object"
|
180
|
+
end
|
181
|
+
# resource path
|
182
|
+
local_var_path = '/moderate/object'
|
183
|
+
|
184
|
+
# query parameters
|
185
|
+
query_params = opts[:query_params] || {}
|
186
|
+
|
187
|
+
# header parameters
|
188
|
+
header_params = opts[:header_params] || {}
|
189
|
+
# HTTP header 'Accept' (if needed)
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
191
|
+
# HTTP header 'Content-Type'
|
192
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
193
|
+
if !content_type.nil?
|
194
|
+
header_params['Content-Type'] = content_type
|
195
|
+
end
|
196
|
+
|
197
|
+
# form parameters
|
198
|
+
form_params = opts[:form_params] || {}
|
199
|
+
|
200
|
+
# http body (model)
|
201
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(moderation_object_request)
|
202
|
+
|
203
|
+
# return_type
|
204
|
+
return_type = opts[:debug_return_type] || 'ModerationObject200Response'
|
205
|
+
|
206
|
+
# auth_names
|
207
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
208
|
+
|
209
|
+
new_options = opts.merge(
|
210
|
+
:operation => :"ModerateApi.moderation_object",
|
211
|
+
:header_params => header_params,
|
212
|
+
:query_params => query_params,
|
213
|
+
:form_params => form_params,
|
214
|
+
:body => post_body,
|
215
|
+
:auth_names => auth_names,
|
216
|
+
:return_type => return_type
|
217
|
+
)
|
218
|
+
|
219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
220
|
+
if @api_client.config.debugging
|
221
|
+
@api_client.config.logger.debug "API called: ModerateApi#moderation_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
222
|
+
end
|
223
|
+
return data, status_code, headers
|
224
|
+
end
|
225
|
+
|
226
|
+
# Analyze text.
|
227
|
+
# Analyze text with your Moderation API project.
|
228
|
+
# @param moderation_text_request [ModerationTextRequest]
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @return [ModerationText200Response]
|
231
|
+
def moderation_text(moderation_text_request, opts = {})
|
232
|
+
data, _status_code, _headers = moderation_text_with_http_info(moderation_text_request, opts)
|
233
|
+
data
|
234
|
+
end
|
235
|
+
|
236
|
+
# Analyze text.
|
237
|
+
# Analyze text with your Moderation API project.
|
238
|
+
# @param moderation_text_request [ModerationTextRequest]
|
239
|
+
# @param [Hash] opts the optional parameters
|
240
|
+
# @return [Array<(ModerationText200Response, Integer, Hash)>] ModerationText200Response data, response status code and response headers
|
241
|
+
def moderation_text_with_http_info(moderation_text_request, opts = {})
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug 'Calling API: ModerateApi.moderation_text ...'
|
244
|
+
end
|
245
|
+
# verify the required parameter 'moderation_text_request' is set
|
246
|
+
if @api_client.config.client_side_validation && moderation_text_request.nil?
|
247
|
+
fail ArgumentError, "Missing the required parameter 'moderation_text_request' when calling ModerateApi.moderation_text"
|
248
|
+
end
|
249
|
+
# resource path
|
250
|
+
local_var_path = '/moderate/text'
|
251
|
+
|
252
|
+
# query parameters
|
253
|
+
query_params = opts[:query_params] || {}
|
254
|
+
|
255
|
+
# header parameters
|
256
|
+
header_params = opts[:header_params] || {}
|
257
|
+
# HTTP header 'Accept' (if needed)
|
258
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
259
|
+
# HTTP header 'Content-Type'
|
260
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
261
|
+
if !content_type.nil?
|
262
|
+
header_params['Content-Type'] = content_type
|
263
|
+
end
|
264
|
+
|
265
|
+
# form parameters
|
266
|
+
form_params = opts[:form_params] || {}
|
267
|
+
|
268
|
+
# http body (model)
|
269
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(moderation_text_request)
|
270
|
+
|
271
|
+
# return_type
|
272
|
+
return_type = opts[:debug_return_type] || 'ModerationText200Response'
|
273
|
+
|
274
|
+
# auth_names
|
275
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
276
|
+
|
277
|
+
new_options = opts.merge(
|
278
|
+
:operation => :"ModerateApi.moderation_text",
|
279
|
+
:header_params => header_params,
|
280
|
+
:query_params => query_params,
|
281
|
+
:form_params => form_params,
|
282
|
+
:body => post_body,
|
283
|
+
:auth_names => auth_names,
|
284
|
+
:return_type => return_type
|
285
|
+
)
|
286
|
+
|
287
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
288
|
+
if @api_client.config.debugging
|
289
|
+
@api_client.config.logger.debug "API called: ModerateApi#moderation_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
290
|
+
end
|
291
|
+
return data, status_code, headers
|
292
|
+
end
|
293
|
+
|
294
|
+
# Analyze video
|
295
|
+
# Analyze video with your Moderation API project
|
296
|
+
# @param moderation_video_request [ModerationVideoRequest]
|
297
|
+
# @param [Hash] opts the optional parameters
|
298
|
+
# @return [ModerationVideo200Response]
|
299
|
+
def moderation_video(moderation_video_request, opts = {})
|
300
|
+
data, _status_code, _headers = moderation_video_with_http_info(moderation_video_request, opts)
|
301
|
+
data
|
302
|
+
end
|
303
|
+
|
304
|
+
# Analyze video
|
305
|
+
# Analyze video with your Moderation API project
|
306
|
+
# @param moderation_video_request [ModerationVideoRequest]
|
307
|
+
# @param [Hash] opts the optional parameters
|
308
|
+
# @return [Array<(ModerationVideo200Response, Integer, Hash)>] ModerationVideo200Response data, response status code and response headers
|
309
|
+
def moderation_video_with_http_info(moderation_video_request, opts = {})
|
310
|
+
if @api_client.config.debugging
|
311
|
+
@api_client.config.logger.debug 'Calling API: ModerateApi.moderation_video ...'
|
312
|
+
end
|
313
|
+
# verify the required parameter 'moderation_video_request' is set
|
314
|
+
if @api_client.config.client_side_validation && moderation_video_request.nil?
|
315
|
+
fail ArgumentError, "Missing the required parameter 'moderation_video_request' when calling ModerateApi.moderation_video"
|
316
|
+
end
|
317
|
+
# resource path
|
318
|
+
local_var_path = '/moderate/video'
|
319
|
+
|
320
|
+
# query parameters
|
321
|
+
query_params = opts[:query_params] || {}
|
322
|
+
|
323
|
+
# header parameters
|
324
|
+
header_params = opts[:header_params] || {}
|
325
|
+
# HTTP header 'Accept' (if needed)
|
326
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
327
|
+
# HTTP header 'Content-Type'
|
328
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
329
|
+
if !content_type.nil?
|
330
|
+
header_params['Content-Type'] = content_type
|
331
|
+
end
|
332
|
+
|
333
|
+
# form parameters
|
334
|
+
form_params = opts[:form_params] || {}
|
335
|
+
|
336
|
+
# http body (model)
|
337
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(moderation_video_request)
|
338
|
+
|
339
|
+
# return_type
|
340
|
+
return_type = opts[:debug_return_type] || 'ModerationVideo200Response'
|
341
|
+
|
342
|
+
# auth_names
|
343
|
+
auth_names = opts[:debug_auth_names] || ['Authorization']
|
344
|
+
|
345
|
+
new_options = opts.merge(
|
346
|
+
:operation => :"ModerateApi.moderation_video",
|
347
|
+
:header_params => header_params,
|
348
|
+
:query_params => query_params,
|
349
|
+
:form_params => form_params,
|
350
|
+
:body => post_body,
|
351
|
+
:auth_names => auth_names,
|
352
|
+
:return_type => return_type
|
353
|
+
)
|
354
|
+
|
355
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
356
|
+
if @api_client.config.debugging
|
357
|
+
@api_client.config.logger.debug "API called: ModerateApi#moderation_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
358
|
+
end
|
359
|
+
return data, status_code, headers
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|