com.microsoft.azure.cognitiveservices.vision.contentmoderator.TextModerations Maven / Gradle / Ivy
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.cognitiveservices.vision.contentmoderator;
import com.microsoft.azure.cognitiveservices.vision.contentmoderator.models.ScreenTextOptionalParameter;
import com.microsoft.azure.cognitiveservices.vision.contentmoderator.models.APIErrorException;
import com.microsoft.azure.cognitiveservices.vision.contentmoderator.models.DetectedLanguage;
import com.microsoft.azure.cognitiveservices.vision.contentmoderator.models.Screen;
import rx.Observable;
/**
* An instance of this class provides access to all the operations defined
* in TextModerations.
*/
public interface TextModerations {
/**
* Detect profanity and match against custom and shared blacklists.
* Detects profanity in more than 100 languages and match against custom and shared blacklists.
*
* @param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'.
* @param textContent Content to screen.
* @param screenTextOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws APIErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the Screen object if successful.
*/
Screen screenText(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter);
/**
* Detect profanity and match against custom and shared blacklists.
* Detects profanity in more than 100 languages and match against custom and shared blacklists.
*
* @param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'.
* @param textContent Content to screen.
* @param screenTextOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the Screen object
*/
Observable screenTextAsync(String textContentType, byte[] textContent, ScreenTextOptionalParameter screenTextOptionalParameter);
/**
* Detect profanity and match against custom and shared blacklists.
* Detects profanity in more than 100 languages and match against custom and shared blacklists.
*
* @return the first stage of the screenText call
*/
TextModerationsScreenTextDefinitionStages.WithTextContentType screenText();
/**
* Grouping of screenText definition stages.
*/
interface TextModerationsScreenTextDefinitionStages {
/**
* The stage of the definition to be specify textContentType.
*/
interface WithTextContentType {
/**
* The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'.
*
* @return next definition stage
*/
WithTextContent withTextContentType(String textContentType);
}
/**
* The stage of the definition to be specify textContent.
*/
interface WithTextContent {
/**
* Content to screen.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withTextContent(byte[] textContent);
}
/**
* The stage of the definition which allows for any other optional settings to be specified.
*/
interface WithAllOptions {
/**
* Language of the text.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withLanguage(String language);
/**
* Autocorrect text.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withAutocorrect(Boolean autocorrect);
/**
* Detect personal identifiable information.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withPII(Boolean pII);
/**
* The list Id.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withListId(String listId);
/**
* Classify input.
*
* @return next definition stage
*/
TextModerationsScreenTextDefinitionStages.WithExecute withClassify(Boolean classify);
}
/**
* The last stage of the definition which will make the operation call.
*/
interface WithExecute extends TextModerationsScreenTextDefinitionStages.WithAllOptions {
/**
* Execute the request.
*
* @return the Screen object if successful.
*/
Screen execute();
/**
* Execute the request asynchronously.
*
* @return the observable to the Screen object
*/
Observable executeAsync();
}
}
/**
* The entirety of screenText definition.
*/
interface TextModerationsScreenTextDefinition extends
TextModerationsScreenTextDefinitionStages.WithTextContentType,
TextModerationsScreenTextDefinitionStages.WithTextContent,
TextModerationsScreenTextDefinitionStages.WithExecute {
}
/**
* This operation will detect the language of given input content. Returns the
* <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the
* predominant language comprising the submitted text. Over 110 languages supported.
*
* @param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'.
* @param textContent Content to screen.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws APIErrorException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the DetectedLanguage object if successful.
*/
DetectedLanguage detectLanguage(String textContentType, byte[] textContent);
/**
* This operation will detect the language of given input content. Returns the
* <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the
* predominant language comprising the submitted text. Over 110 languages supported.
*
* @param textContentType The content type. Possible values include: 'text/plain', 'text/html', 'text/xml', 'text/markdown'.
* @param textContent Content to screen.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DetectedLanguage object
*/
Observable detectLanguageAsync(String textContentType, byte[] textContent);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy