Package ai.rev.speechtotext
Class CustomVocabulariesClient
- java.lang.Object
-
- ai.rev.speechtotext.CustomVocabulariesClient
-
public class CustomVocabulariesClient extends Object
The CustomVocabularyClient object provides methods to interact with the Custom Vocabulary Api.
-
-
Field Summary
Fields Modifier and Type Field Description CustomVocabularyApiInterfacecustomVocabularyApiInterfaceInterface that CustomVocabularyClient methods use to make requests
-
Constructor Summary
Constructors Constructor Description CustomVocabulariesClient(String accessToken)Constructs the custom vocabulary client used to create custom vocabularies for streaming.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteCustomVocabulary(String id)This method sends a DELETE request to the /vocabularies/{id} endpoint.CustomVocabularyInformationgetCustomVocabularyInformation(String id)This method sends a GET request to the /vocabularies/{id} endpoint and returns aCustomVocabularyInformationobject.List<CustomVocabularyInformation>getListOfCustomVocabularyInformation()This method sends a GET request to the /vocabularies endpoint and returns a list ofCustomVocabularyInformationobjects.CustomVocabularyInformationsubmitCustomVocabularies(CustomVocabularySubmission submission)This method makes a POST request to the /vocabularies endpoint and returns aCustomVocabularyInformationobject that provides details about the custom vocabulary submission and its progress.
-
-
-
Field Detail
-
customVocabularyApiInterface
public CustomVocabularyApiInterface customVocabularyApiInterface
Interface that CustomVocabularyClient methods use to make requests
-
-
Constructor Detail
-
CustomVocabulariesClient
public CustomVocabulariesClient(String accessToken)
Constructs the custom vocabulary client used to create custom vocabularies for streaming. The user access token can be generated on the website at https://www.rev.ai/access_token.- Parameters:
accessToken- Rev AI authorization token associate with the account.- Throws:
IllegalArgumentException- If the access token is null or empty.
-
-
Method Detail
-
submitCustomVocabularies
public CustomVocabularyInformation submitCustomVocabularies(CustomVocabularySubmission submission) throws IOException
This method makes a POST request to the /vocabularies endpoint and returns aCustomVocabularyInformationobject that provides details about the custom vocabulary submission and its progress.- Parameters:
submission- An object that contains the custom vocabularies and optional parameters- Returns:
- A
CustomVocabularyInformationobject. - Throws:
IOException- If the response has a status code > 399.IllegalArgumentException- If the list of custom vocabularies is null or empty.- See Also:
CustomVocabularyInformation
-
getListOfCustomVocabularyInformation
public List<CustomVocabularyInformation> getListOfCustomVocabularyInformation() throws IOException
This method sends a GET request to the /vocabularies endpoint and returns a list ofCustomVocabularyInformationobjects.- Returns:
- A list of
CustomVocabularyInformationobjects. - Throws:
IOException- If the response has a status code > 399.- See Also:
CustomVocabularyInformation
-
getCustomVocabularyInformation
public CustomVocabularyInformation getCustomVocabularyInformation(String id) throws IOException
This method sends a GET request to the /vocabularies/{id} endpoint and returns aCustomVocabularyInformationobject.- Parameters:
id- The Id of the custom vocabulary to return an object for.- Returns:
- A
CustomVocabularyInformationobject. - Throws:
IOException- If the response has a status code > 399.IllegalArgumentException- If the custom vocabulary Id is null.- See Also:
CustomVocabularyInformation
-
deleteCustomVocabulary
public void deleteCustomVocabulary(String id) throws IOException
This method sends a DELETE request to the /vocabularies/{id} endpoint.- Parameters:
id- The Id of the custom vocabulary to be deleted.- Throws:
IOException- If the response has a status code > 399.IllegalArgumentException- If the job Id is null.- See Also:
- https://docs.rev.ai/api/custom-vocabulary/reference/#operation/DeleteCustomVocabulary
-
-