azure_cognitiveservices_contentmoderator 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator.rb +93 -0
  4. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/content_moderator_client.rb +167 -0
  5. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/image_moderation.rb +1399 -0
  6. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image.rb +637 -0
  7. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image_lists.rb +610 -0
  8. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term.rb +429 -0
  9. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term_lists.rb +618 -0
  10. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/address.rb +58 -0
  11. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/apierror.rb +47 -0
  12. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/azure_region_base_url.rb +27 -0
  13. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/body.rb +70 -0
  14. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/body_metadata.rb +57 -0
  15. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/candidate.rb +57 -0
  16. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/classification.rb +82 -0
  17. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/content.rb +47 -0
  18. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_review_body_item.rb +101 -0
  19. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_review_body_item_metadata_item.rb +58 -0
  20. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_video_reviews_body_item.rb +144 -0
  21. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_video_reviews_body_item_metadata_item.rb +58 -0
  22. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_video_reviews_body_item_video_frames_item.rb +112 -0
  23. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_video_reviews_body_item_video_frames_item_metadata_item.rb +59 -0
  24. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/create_video_reviews_body_item_video_frames_item_reviewer_result_tags_item.rb +60 -0
  25. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/detected_language.rb +69 -0
  26. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/detected_terms.rb +81 -0
  27. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/email.rb +80 -0
  28. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/error.rb +57 -0
  29. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/evaluate.rb +144 -0
  30. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/face.rb +79 -0
  31. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/found_faces.rb +131 -0
  32. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/frame.rb +97 -0
  33. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/frames.rb +66 -0
  34. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image.rb +89 -0
  35. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image_additional_info_item.rb +58 -0
  36. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image_ids.rb +88 -0
  37. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image_list.rb +80 -0
  38. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image_list_metadata.rb +57 -0
  39. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/image_url.rb +59 -0
  40. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/ipa.rb +69 -0
  41. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/job.rb +153 -0
  42. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/job_execution_report_details.rb +57 -0
  43. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/job_id.rb +47 -0
  44. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/job_list_result.rb +54 -0
  45. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/key_value_pair.rb +57 -0
  46. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/match.rb +98 -0
  47. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/match_response.rb +100 -0
  48. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/ocr.rb +131 -0
  49. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/phone.rb +69 -0
  50. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/pii.rb +115 -0
  51. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/refresh_index.rb +100 -0
  52. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/refresh_index_advanced_info_item.rb +58 -0
  53. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/review.rb +163 -0
  54. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/score.rb +48 -0
  55. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/screen.rb +165 -0
  56. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/status.rb +68 -0
  57. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/tag.rb +57 -0
  58. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/term_list.rb +80 -0
  59. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/term_list_metadata.rb +57 -0
  60. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/terms.rb +59 -0
  61. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/terms_data.rb +89 -0
  62. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/terms_in_list.rb +46 -0
  63. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/terms_paging.rb +79 -0
  64. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/transcript_moderation_body_item.rb +67 -0
  65. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/transcript_moderation_body_item_terms_item.rb +58 -0
  66. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/video_frame_body_item.rb +98 -0
  67. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/video_frame_body_item_metadata_item.rb +58 -0
  68. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/models/video_frame_body_item_reviewer_result_tags_item.rb +58 -0
  69. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/module_definition.rb +9 -0
  70. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb +1829 -0
  71. data/lib/1.0/generated/azure_cognitiveservices_contentmoderator/text_moderation.rb +294 -0
  72. data/lib/azure_cognitiveservices_contentmoderator.rb +6 -0
  73. data/lib/module_definition.rb +7 -0
  74. data/lib/profiles/latest/contentmoderator_latest_profile_client.rb +38 -0
  75. data/lib/profiles/latest/contentmoderator_module_definition.rb +8 -0
  76. data/lib/profiles/latest/modules/contentmoderator_profile_module.rb +307 -0
  77. data/lib/version.rb +7 -0
  78. metadata +196 -0
@@ -0,0 +1,294 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CognitiveServices::ContentModerator::V1_0
7
+ #
8
+ # You use the API to scan your content as it is generated. Content Moderator
9
+ # then processes your content and sends the results along with relevant
10
+ # information either back to your systems or to the built-in review tool. You
11
+ # can use this information to take decisions e.g. take it down, send to human
12
+ # judge, etc.
13
+ #
14
+ # When using the API, images need to have a minimum of 128 pixels and a
15
+ # maximum file size of 4MB.
16
+ # Text can be at most 1024 characters long.
17
+ # If the content passed to the text API or the image API exceeds the size
18
+ # limits, the API will return an error code that informs about the issue.
19
+ #
20
+ # This API is currently available in:
21
+ #
22
+ # * West US - westus.api.cognitive.microsoft.com
23
+ # * East US 2 - eastus2.api.cognitive.microsoft.com
24
+ # * West Central US - westcentralus.api.cognitive.microsoft.com
25
+ # * West Europe - westeurope.api.cognitive.microsoft.com
26
+ # * Southeast Asia - southeastasia.api.cognitive.microsoft.com .
27
+ #
28
+ class TextModeration
29
+ include MsRestAzure
30
+
31
+ #
32
+ # Creates and initializes a new instance of the TextModeration class.
33
+ # @param client service class for accessing basic functionality.
34
+ #
35
+ def initialize(client)
36
+ @client = client
37
+ end
38
+
39
+ # @return [ContentModeratorClient] reference to the ContentModeratorClient
40
+ attr_reader :client
41
+
42
+ #
43
+ # Detect profanity and match against custom and shared blacklists
44
+ #
45
+ # Detects profanity in more than 100 languages and match against custom and
46
+ # shared blacklists.
47
+ #
48
+ # @param language [String] Language of the terms.
49
+ # @param text_content_type [Enum] The content type. Possible values include:
50
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
51
+ # @param text_content [String] Content to screen.
52
+ # @param autocorrect [Boolean] Autocorrect text.
53
+ # @param pii [Boolean] Detect personal identifiable information.
54
+ # @param list_id [String] The list Id.
55
+ # @param classify [Boolean] Classify input.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [Screen] operation results.
60
+ #
61
+ def screen_text(language, text_content_type, text_content, autocorrect:false, pii:false, list_id:nil, classify:false, custom_headers:nil)
62
+ response = screen_text_async(language, text_content_type, text_content, autocorrect:autocorrect, pii:pii, list_id:list_id, classify:classify, custom_headers:custom_headers).value!
63
+ response.body unless response.nil?
64
+ end
65
+
66
+ #
67
+ # Detect profanity and match against custom and shared blacklists
68
+ #
69
+ # Detects profanity in more than 100 languages and match against custom and
70
+ # shared blacklists.
71
+ #
72
+ # @param language [String] Language of the terms.
73
+ # @param text_content_type [Enum] The content type. Possible values include:
74
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
75
+ # @param text_content [String] Content to screen.
76
+ # @param autocorrect [Boolean] Autocorrect text.
77
+ # @param pii [Boolean] Detect personal identifiable information.
78
+ # @param list_id [String] The list Id.
79
+ # @param classify [Boolean] Classify input.
80
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
+ # will be added to the HTTP request.
82
+ #
83
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
84
+ #
85
+ def screen_text_with_http_info(language, text_content_type, text_content, autocorrect:false, pii:false, list_id:nil, classify:false, custom_headers:nil)
86
+ screen_text_async(language, text_content_type, text_content, autocorrect:autocorrect, pii:pii, list_id:list_id, classify:classify, custom_headers:custom_headers).value!
87
+ end
88
+
89
+ #
90
+ # Detect profanity and match against custom and shared blacklists
91
+ #
92
+ # Detects profanity in more than 100 languages and match against custom and
93
+ # shared blacklists.
94
+ #
95
+ # @param language [String] Language of the terms.
96
+ # @param text_content_type [Enum] The content type. Possible values include:
97
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
98
+ # @param text_content [String] Content to screen.
99
+ # @param autocorrect [Boolean] Autocorrect text.
100
+ # @param pii [Boolean] Detect personal identifiable information.
101
+ # @param list_id [String] The list Id.
102
+ # @param classify [Boolean] Classify input.
103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
104
+ # to the HTTP request.
105
+ #
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def screen_text_async(language, text_content_type, text_content, autocorrect:false, pii:false, list_id:nil, classify:false, custom_headers:nil)
109
+ fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
110
+ fail ArgumentError, 'language is nil' if language.nil?
111
+ fail ArgumentError, 'text_content_type is nil' if text_content_type.nil?
112
+ fail ArgumentError, 'text_content is nil' if text_content.nil?
113
+
114
+
115
+ request_headers = {}
116
+ request_headers['Content-Type'] = 'text/plain'
117
+
118
+ # Set Headers
119
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
120
+ request_headers['Content-Type'] = text_content_type.to_s unless text_content_type.to_s.nil?
121
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
122
+
123
+ # Serialize Request
124
+ request_mapper = {
125
+ client_side_validation: true,
126
+ required: true,
127
+ serialized_name: 'Text Content',
128
+ type: {
129
+ name: 'String'
130
+ }
131
+ }
132
+ request_content = @client.serialize(request_mapper, text_content)
133
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
134
+
135
+ path_template = 'contentmoderator/moderate/v1.0/ProcessText/Screen/'
136
+
137
+ request_url = @base_url || @client.base_url
138
+ request_url = request_url.gsub('{baseUrl}', @client.base_url)
139
+
140
+ options = {
141
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
142
+ query_params: {'language' => language,'autocorrect' => autocorrect,'PII' => pii,'listId' => list_id,'classify' => classify},
143
+ body: request_content,
144
+ headers: request_headers.merge(custom_headers || {}),
145
+ base_url: request_url
146
+ }
147
+ promise = @client.make_request_async(:post, path_template, options)
148
+
149
+ promise = promise.then do |result|
150
+ http_response = result.response
151
+ status_code = http_response.status
152
+ response_content = http_response.body
153
+ unless status_code == 200
154
+ error_model = JSON.load(response_content)
155
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
156
+ end
157
+
158
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
159
+ # Deserialize Response
160
+ if status_code == 200
161
+ begin
162
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
163
+ result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::Screen.mapper()
164
+ result.body = @client.deserialize(result_mapper, parsed_response)
165
+ rescue Exception => e
166
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
167
+ end
168
+ end
169
+
170
+ result
171
+ end
172
+
173
+ promise.execute
174
+ end
175
+
176
+ #
177
+ # This operation will detect the language of given input content. Returns the
178
+ # <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the
179
+ # predominant language comprising the submitted text. Over 110 languages
180
+ # supported.
181
+ #
182
+ # @param text_content_type [Enum] The content type. Possible values include:
183
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
184
+ # @param text_content [String] Content to screen.
185
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
186
+ # will be added to the HTTP request.
187
+ #
188
+ # @return [DetectedLanguage] operation results.
189
+ #
190
+ def detect_language(text_content_type, text_content, custom_headers:nil)
191
+ response = detect_language_async(text_content_type, text_content, custom_headers:custom_headers).value!
192
+ response.body unless response.nil?
193
+ end
194
+
195
+ #
196
+ # This operation will detect the language of given input content. Returns the
197
+ # <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the
198
+ # predominant language comprising the submitted text. Over 110 languages
199
+ # supported.
200
+ #
201
+ # @param text_content_type [Enum] The content type. Possible values include:
202
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
203
+ # @param text_content [String] Content to screen.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
208
+ #
209
+ def detect_language_with_http_info(text_content_type, text_content, custom_headers:nil)
210
+ detect_language_async(text_content_type, text_content, custom_headers:custom_headers).value!
211
+ end
212
+
213
+ #
214
+ # This operation will detect the language of given input content. Returns the
215
+ # <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the
216
+ # predominant language comprising the submitted text. Over 110 languages
217
+ # supported.
218
+ #
219
+ # @param text_content_type [Enum] The content type. Possible values include:
220
+ # 'text/plain', 'text/html', 'text/xml', 'text/markdown'
221
+ # @param text_content [String] Content to screen.
222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
223
+ # to the HTTP request.
224
+ #
225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
226
+ #
227
+ def detect_language_async(text_content_type, text_content, custom_headers:nil)
228
+ fail ArgumentError, '@client.base_url is nil' if @client.base_url.nil?
229
+ fail ArgumentError, 'text_content_type is nil' if text_content_type.nil?
230
+ fail ArgumentError, 'text_content is nil' if text_content.nil?
231
+
232
+
233
+ request_headers = {}
234
+ request_headers['Content-Type'] = 'text/plain'
235
+
236
+ # Set Headers
237
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
238
+ request_headers['Content-Type'] = text_content_type.to_s unless text_content_type.to_s.nil?
239
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
240
+
241
+ # Serialize Request
242
+ request_mapper = {
243
+ client_side_validation: true,
244
+ required: true,
245
+ serialized_name: 'Text Content',
246
+ type: {
247
+ name: 'String'
248
+ }
249
+ }
250
+ request_content = @client.serialize(request_mapper, text_content)
251
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
252
+
253
+ path_template = 'contentmoderator/moderate/v1.0/ProcessText/DetectLanguage'
254
+
255
+ request_url = @base_url || @client.base_url
256
+ request_url = request_url.gsub('{baseUrl}', @client.base_url)
257
+
258
+ options = {
259
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
260
+ body: request_content,
261
+ headers: request_headers.merge(custom_headers || {}),
262
+ base_url: request_url
263
+ }
264
+ promise = @client.make_request_async(:post, path_template, options)
265
+
266
+ promise = promise.then do |result|
267
+ http_response = result.response
268
+ status_code = http_response.status
269
+ response_content = http_response.body
270
+ unless status_code == 200
271
+ error_model = JSON.load(response_content)
272
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
273
+ end
274
+
275
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
276
+ # Deserialize Response
277
+ if status_code == 200
278
+ begin
279
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
280
+ result_mapper = Azure::CognitiveServices::ContentModerator::V1_0::Models::DetectedLanguage.mapper()
281
+ result.body = @client.deserialize(result_mapper, parsed_response)
282
+ rescue Exception => e
283
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
284
+ end
285
+ end
286
+
287
+ result
288
+ end
289
+
290
+ promise.execute
291
+ end
292
+
293
+ end
294
+ end
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require '1.0/generated/azure_cognitiveservices_contentmoderator'
6
+ require 'profiles/latest/contentmoderator_latest_profile_client'
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ module Azure end
6
+ module Azure::CognitiveServices end
7
+ module Azure::CognitiveServices::ContentModerator end
@@ -0,0 +1,38 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'profiles/latest/contentmoderator_module_definition'
6
+ require 'profiles/latest/modules/contentmoderator_profile_module'
7
+
8
+ module Azure::ContentModerator::Profiles::Latest
9
+ #
10
+ # Client class for the Latest profile SDK.
11
+ #
12
+ class Client < ContentModeratorDataClass
13
+ include MsRestAzure::Common::Configurable
14
+
15
+ #
16
+ # Initializes a new instance of the Client class.
17
+ # @param options [Hash] hash of client options.
18
+ # options = {
19
+ # tenant_id: 'YOUR TENANT ID',
20
+ # client_id: 'YOUR CLIENT ID',
21
+ # client_secret: 'YOUR CLIENT SECRET',
22
+ # subscription_id: 'YOUR SUBSCRIPTION ID',
23
+ # credentials: credentials,
24
+ # active_directory_settings: active_directory_settings,
25
+ # base_url: 'YOUR BASE URL',
26
+ # options: options
27
+ # }
28
+ # 'credentials' are optional and if not passed in the hash, will be obtained
29
+ # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
30
+ #
31
+ # Also, base_url, active_directory_settings & options are optional.
32
+ #
33
+ def initialize(options = {})
34
+ super(options)
35
+ end
36
+
37
+ end
38
+ end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ module Azure end
6
+ module Azure::ContentModerator end
7
+ module Azure::ContentModerator::Profiles end
8
+ module Azure::ContentModerator::Profiles::Latest end
@@ -0,0 +1,307 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'azure_cognitiveservices_contentmoderator'
6
+
7
+ module Azure::ContentModerator::Profiles::Latest
8
+ ImageModeration = Azure::CognitiveServices::ContentModerator::V1_0::ImageModeration
9
+ TextModeration = Azure::CognitiveServices::ContentModerator::V1_0::TextModeration
10
+ ListManagementImageLists = Azure::CognitiveServices::ContentModerator::V1_0::ListManagementImageLists
11
+ ListManagementTermLists = Azure::CognitiveServices::ContentModerator::V1_0::ListManagementTermLists
12
+ ListManagementImage = Azure::CognitiveServices::ContentModerator::V1_0::ListManagementImage
13
+ ListManagementTerm = Azure::CognitiveServices::ContentModerator::V1_0::ListManagementTerm
14
+ Reviews = Azure::CognitiveServices::ContentModerator::V1_0::Reviews
15
+
16
+ module Models
17
+ Image = Azure::CognitiveServices::ContentModerator::V1_0::Models::Image
18
+ KeyValuePair = Azure::CognitiveServices::ContentModerator::V1_0::Models::KeyValuePair
19
+ ImageIds = Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageIds
20
+ Frame = Azure::CognitiveServices::ContentModerator::V1_0::Models::Frame
21
+ TermsInList = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsInList
22
+ Score = Azure::CognitiveServices::ContentModerator::V1_0::Models::Score
23
+ TermsData = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsData
24
+ Status = Azure::CognitiveServices::ContentModerator::V1_0::Models::Status
25
+ TermsPaging = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsPaging
26
+ IPA = Azure::CognitiveServices::ContentModerator::V1_0::Models::IPA
27
+ Terms = Azure::CognitiveServices::ContentModerator::V1_0::Models::Terms
28
+ Address = Azure::CognitiveServices::ContentModerator::V1_0::Models::Address
29
+ Review = Azure::CognitiveServices::ContentModerator::V1_0::Models::Review
30
+ DetectedTerms = Azure::CognitiveServices::ContentModerator::V1_0::Models::DetectedTerms
31
+ JobExecutionReportDetails = Azure::CognitiveServices::ContentModerator::V1_0::Models::JobExecutionReportDetails
32
+ Face = Azure::CognitiveServices::ContentModerator::V1_0::Models::Face
33
+ Job = Azure::CognitiveServices::ContentModerator::V1_0::Models::Job
34
+ Candidate = Azure::CognitiveServices::ContentModerator::V1_0::Models::Candidate
35
+ JobListResult = Azure::CognitiveServices::ContentModerator::V1_0::Models::JobListResult
36
+ Evaluate = Azure::CognitiveServices::ContentModerator::V1_0::Models::Evaluate
37
+ JobId = Azure::CognitiveServices::ContentModerator::V1_0::Models::JobId
38
+ MatchResponse = Azure::CognitiveServices::ContentModerator::V1_0::Models::MatchResponse
39
+ Error = Azure::CognitiveServices::ContentModerator::V1_0::Models::Error
40
+ ImageListMetadata = Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageListMetadata
41
+ APIError = Azure::CognitiveServices::ContentModerator::V1_0::Models::APIError
42
+ TermListMetadata = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermListMetadata
43
+ TranscriptModerationBodyItemTermsItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::TranscriptModerationBodyItemTermsItem
44
+ RefreshIndexAdvancedInfoItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::RefreshIndexAdvancedInfoItem
45
+ TranscriptModerationBodyItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::TranscriptModerationBodyItem
46
+ ImageAdditionalInfoItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageAdditionalInfoItem
47
+ CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem
48
+ Frames = Azure::CognitiveServices::ContentModerator::V1_0::Models::Frames
49
+ CreateVideoReviewsBodyItemVideoFramesItemMetadataItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItemMetadataItem
50
+ Email = Azure::CognitiveServices::ContentModerator::V1_0::Models::Email
51
+ CreateVideoReviewsBodyItemVideoFramesItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItem
52
+ PII = Azure::CognitiveServices::ContentModerator::V1_0::Models::PII
53
+ CreateVideoReviewsBodyItemMetadataItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemMetadataItem
54
+ FoundFaces = Azure::CognitiveServices::ContentModerator::V1_0::Models::FoundFaces
55
+ CreateVideoReviewsBodyItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItem
56
+ Match = Azure::CognitiveServices::ContentModerator::V1_0::Models::Match
57
+ BodyMetadata = Azure::CognitiveServices::ContentModerator::V1_0::Models::BodyMetadata
58
+ ImageList = Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageList
59
+ Body = Azure::CognitiveServices::ContentModerator::V1_0::Models::Body
60
+ RefreshIndex = Azure::CognitiveServices::ContentModerator::V1_0::Models::RefreshIndex
61
+ ImageUrl = Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageUrl
62
+ Classification = Azure::CognitiveServices::ContentModerator::V1_0::Models::Classification
63
+ VideoFrameBodyItemReviewerResultTagsItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItemReviewerResultTagsItem
64
+ Screen = Azure::CognitiveServices::ContentModerator::V1_0::Models::Screen
65
+ VideoFrameBodyItemMetadataItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItemMetadataItem
66
+ DetectedLanguage = Azure::CognitiveServices::ContentModerator::V1_0::Models::DetectedLanguage
67
+ VideoFrameBodyItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItem
68
+ Tag = Azure::CognitiveServices::ContentModerator::V1_0::Models::Tag
69
+ CreateReviewBodyItemMetadataItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateReviewBodyItemMetadataItem
70
+ OCR = Azure::CognitiveServices::ContentModerator::V1_0::Models::OCR
71
+ CreateReviewBodyItem = Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateReviewBodyItem
72
+ Phone = Azure::CognitiveServices::ContentModerator::V1_0::Models::Phone
73
+ Content = Azure::CognitiveServices::ContentModerator::V1_0::Models::Content
74
+ TermList = Azure::CognitiveServices::ContentModerator::V1_0::Models::TermList
75
+ AzureRegionBaseUrl = Azure::CognitiveServices::ContentModerator::V1_0::Models::AzureRegionBaseUrl
76
+ end
77
+
78
+ #
79
+ # ContentModeratorDataClass
80
+ #
81
+ class ContentModeratorDataClass
82
+ attr_reader :image_moderation, :text_moderation, :list_management_image_lists, :list_management_term_lists, :list_management_image, :list_management_term, :reviews, :configurable, :base_url, :options, :model_classes
83
+
84
+ def initialize(options = {})
85
+ if options.is_a?(Hash) && options.length == 0
86
+ @options = setup_default_options
87
+ else
88
+ @options = options
89
+ end
90
+
91
+ reset!(options)
92
+
93
+ @configurable = self
94
+ @base_url = options[:base_url].nil? ? nil:options[:base_url]
95
+ @options = options[:options].nil? ? nil:options[:options]
96
+
97
+ @client_0 = Azure::CognitiveServices::ContentModerator::V1_0::ContentModeratorClient.new(configurable.credentials, options)
98
+ if(@client_0.respond_to?(:subscription_id))
99
+ @client_0.subscription_id = configurable.subscription_id
100
+ end
101
+ add_telemetry(@client_0)
102
+ @image_moderation = @client_0.image_moderation
103
+ @text_moderation = @client_0.text_moderation
104
+ @list_management_image_lists = @client_0.list_management_image_lists
105
+ @list_management_term_lists = @client_0.list_management_term_lists
106
+ @list_management_image = @client_0.list_management_image
107
+ @list_management_term = @client_0.list_management_term
108
+ @reviews = @client_0.reviews
109
+
110
+ @model_classes = ModelClasses.new
111
+ end
112
+
113
+ def add_telemetry(client)
114
+ profile_information = 'Profiles/Latest/ContentModerator'
115
+ client.add_user_agent_information(profile_information)
116
+ end
117
+
118
+ def method_missing(method, *args)
119
+ if @client_0.respond_to?method
120
+ @client_0.send(method, *args)
121
+ else
122
+ super
123
+ end
124
+ end
125
+
126
+ end
127
+
128
+ class ModelClasses
129
+ def image
130
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Image
131
+ end
132
+ def key_value_pair
133
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::KeyValuePair
134
+ end
135
+ def image_ids
136
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageIds
137
+ end
138
+ def frame
139
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Frame
140
+ end
141
+ def terms_in_list
142
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsInList
143
+ end
144
+ def score
145
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Score
146
+ end
147
+ def terms_data
148
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsData
149
+ end
150
+ def status
151
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Status
152
+ end
153
+ def terms_paging
154
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TermsPaging
155
+ end
156
+ def ipa
157
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::IPA
158
+ end
159
+ def terms
160
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Terms
161
+ end
162
+ def address
163
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Address
164
+ end
165
+ def review
166
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Review
167
+ end
168
+ def detected_terms
169
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::DetectedTerms
170
+ end
171
+ def job_execution_report_details
172
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::JobExecutionReportDetails
173
+ end
174
+ def face
175
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Face
176
+ end
177
+ def job
178
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Job
179
+ end
180
+ def candidate
181
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Candidate
182
+ end
183
+ def job_list_result
184
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::JobListResult
185
+ end
186
+ def evaluate
187
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Evaluate
188
+ end
189
+ def job_id
190
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::JobId
191
+ end
192
+ def match_response
193
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::MatchResponse
194
+ end
195
+ def error
196
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Error
197
+ end
198
+ def image_list_metadata
199
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageListMetadata
200
+ end
201
+ def apierror
202
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::APIError
203
+ end
204
+ def term_list_metadata
205
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TermListMetadata
206
+ end
207
+ def transcript_moderation_body_item_terms_item
208
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TranscriptModerationBodyItemTermsItem
209
+ end
210
+ def refresh_index_advanced_info_item
211
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::RefreshIndexAdvancedInfoItem
212
+ end
213
+ def transcript_moderation_body_item
214
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TranscriptModerationBodyItem
215
+ end
216
+ def image_additional_info_item
217
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageAdditionalInfoItem
218
+ end
219
+ def create_video_reviews_body_item_video_frames_item_reviewer_result_tags_item
220
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem
221
+ end
222
+ def frames
223
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Frames
224
+ end
225
+ def create_video_reviews_body_item_video_frames_item_metadata_item
226
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItemMetadataItem
227
+ end
228
+ def email
229
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Email
230
+ end
231
+ def create_video_reviews_body_item_video_frames_item
232
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemVideoFramesItem
233
+ end
234
+ def pii
235
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::PII
236
+ end
237
+ def create_video_reviews_body_item_metadata_item
238
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItemMetadataItem
239
+ end
240
+ def found_faces
241
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::FoundFaces
242
+ end
243
+ def create_video_reviews_body_item
244
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateVideoReviewsBodyItem
245
+ end
246
+ def match
247
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Match
248
+ end
249
+ def body_metadata
250
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::BodyMetadata
251
+ end
252
+ def image_list
253
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageList
254
+ end
255
+ def body
256
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Body
257
+ end
258
+ def refresh_index
259
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::RefreshIndex
260
+ end
261
+ def image_url
262
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::ImageUrl
263
+ end
264
+ def classification
265
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Classification
266
+ end
267
+ def video_frame_body_item_reviewer_result_tags_item
268
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItemReviewerResultTagsItem
269
+ end
270
+ def screen
271
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Screen
272
+ end
273
+ def video_frame_body_item_metadata_item
274
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItemMetadataItem
275
+ end
276
+ def detected_language
277
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::DetectedLanguage
278
+ end
279
+ def video_frame_body_item
280
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::VideoFrameBodyItem
281
+ end
282
+ def tag
283
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Tag
284
+ end
285
+ def create_review_body_item_metadata_item
286
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateReviewBodyItemMetadataItem
287
+ end
288
+ def ocr
289
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::OCR
290
+ end
291
+ def create_review_body_item
292
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::CreateReviewBodyItem
293
+ end
294
+ def phone
295
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Phone
296
+ end
297
+ def content
298
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::Content
299
+ end
300
+ def term_list
301
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::TermList
302
+ end
303
+ def azure_region_base_url
304
+ Azure::CognitiveServices::ContentModerator::V1_0::Models::AzureRegionBaseUrl
305
+ end
306
+ end
307
+ end