Struct google_api_proto::google::cloud::translation::v3::translation_service_client::TranslationServiceClient
source · pub struct TranslationServiceClient<T> { /* private fields */ }
Expand description
Provides natural language translation operations.
Implementations§
source§impl<T> TranslationServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> TranslationServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TranslationServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn translate_text(
&mut self,
request: impl IntoRequest<TranslateTextRequest>,
) -> Result<Response<TranslateTextResponse>, Status>
pub async fn translate_text( &mut self, request: impl IntoRequest<TranslateTextRequest>, ) -> Result<Response<TranslateTextResponse>, Status>
Translates input text and returns translated text.
sourcepub async fn romanize_text(
&mut self,
request: impl IntoRequest<RomanizeTextRequest>,
) -> Result<Response<RomanizeTextResponse>, Status>
pub async fn romanize_text( &mut self, request: impl IntoRequest<RomanizeTextRequest>, ) -> Result<Response<RomanizeTextResponse>, Status>
Romanize input text written in non-Latin scripts to Latin text.
sourcepub async fn detect_language(
&mut self,
request: impl IntoRequest<DetectLanguageRequest>,
) -> Result<Response<DetectLanguageResponse>, Status>
pub async fn detect_language( &mut self, request: impl IntoRequest<DetectLanguageRequest>, ) -> Result<Response<DetectLanguageResponse>, Status>
Detects the language of text within a request.
sourcepub async fn get_supported_languages(
&mut self,
request: impl IntoRequest<GetSupportedLanguagesRequest>,
) -> Result<Response<SupportedLanguages>, Status>
pub async fn get_supported_languages( &mut self, request: impl IntoRequest<GetSupportedLanguagesRequest>, ) -> Result<Response<SupportedLanguages>, Status>
Returns a list of supported languages for translation.
sourcepub async fn translate_document(
&mut self,
request: impl IntoRequest<TranslateDocumentRequest>,
) -> Result<Response<TranslateDocumentResponse>, Status>
pub async fn translate_document( &mut self, request: impl IntoRequest<TranslateDocumentRequest>, ) -> Result<Response<TranslateDocumentResponse>, Status>
Translates documents in synchronous mode.
sourcepub async fn batch_translate_text(
&mut self,
request: impl IntoRequest<BatchTranslateTextRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_translate_text( &mut self, request: impl IntoRequest<BatchTranslateTextRequest>, ) -> Result<Response<Operation>, Status>
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it’s all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
sourcepub async fn batch_translate_document(
&mut self,
request: impl IntoRequest<BatchTranslateDocumentRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_translate_document( &mut self, request: impl IntoRequest<BatchTranslateDocumentRequest>, ) -> Result<Response<Operation>, Status>
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it’s all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
sourcepub async fn create_glossary(
&mut self,
request: impl IntoRequest<CreateGlossaryRequest>,
) -> Result<Response<Operation>, Status>
pub async fn create_glossary( &mut self, request: impl IntoRequest<CreateGlossaryRequest>, ) -> Result<Response<Operation>, Status>
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn’t exist.
sourcepub async fn update_glossary(
&mut self,
request: impl IntoRequest<UpdateGlossaryRequest>,
) -> Result<Response<Operation>, Status>
pub async fn update_glossary( &mut self, request: impl IntoRequest<UpdateGlossaryRequest>, ) -> Result<Response<Operation>, Status>
Updates a glossary. A LRO is used since the update can be async if the glossary’s entry file is updated.
sourcepub async fn list_glossaries(
&mut self,
request: impl IntoRequest<ListGlossariesRequest>,
) -> Result<Response<ListGlossariesResponse>, Status>
pub async fn list_glossaries( &mut self, request: impl IntoRequest<ListGlossariesRequest>, ) -> Result<Response<ListGlossariesResponse>, Status>
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn’t exist.
sourcepub async fn get_glossary(
&mut self,
request: impl IntoRequest<GetGlossaryRequest>,
) -> Result<Response<Glossary>, Status>
pub async fn get_glossary( &mut self, request: impl IntoRequest<GetGlossaryRequest>, ) -> Result<Response<Glossary>, Status>
Gets a glossary. Returns NOT_FOUND, if the glossary doesn’t exist.
sourcepub async fn delete_glossary(
&mut self,
request: impl IntoRequest<DeleteGlossaryRequest>,
) -> Result<Response<Operation>, Status>
pub async fn delete_glossary( &mut self, request: impl IntoRequest<DeleteGlossaryRequest>, ) -> Result<Response<Operation>, Status>
Deletes a glossary, or cancels glossary construction if the glossary isn’t created yet. Returns NOT_FOUND, if the glossary doesn’t exist.
sourcepub async fn get_glossary_entry(
&mut self,
request: impl IntoRequest<GetGlossaryEntryRequest>,
) -> Result<Response<GlossaryEntry>, Status>
pub async fn get_glossary_entry( &mut self, request: impl IntoRequest<GetGlossaryEntryRequest>, ) -> Result<Response<GlossaryEntry>, Status>
Gets a single glossary entry by the given id.
sourcepub async fn list_glossary_entries(
&mut self,
request: impl IntoRequest<ListGlossaryEntriesRequest>,
) -> Result<Response<ListGlossaryEntriesResponse>, Status>
pub async fn list_glossary_entries( &mut self, request: impl IntoRequest<ListGlossaryEntriesRequest>, ) -> Result<Response<ListGlossaryEntriesResponse>, Status>
List the entries for the glossary.
sourcepub async fn create_glossary_entry(
&mut self,
request: impl IntoRequest<CreateGlossaryEntryRequest>,
) -> Result<Response<GlossaryEntry>, Status>
pub async fn create_glossary_entry( &mut self, request: impl IntoRequest<CreateGlossaryEntryRequest>, ) -> Result<Response<GlossaryEntry>, Status>
Creates a glossary entry.
sourcepub async fn update_glossary_entry(
&mut self,
request: impl IntoRequest<UpdateGlossaryEntryRequest>,
) -> Result<Response<GlossaryEntry>, Status>
pub async fn update_glossary_entry( &mut self, request: impl IntoRequest<UpdateGlossaryEntryRequest>, ) -> Result<Response<GlossaryEntry>, Status>
Updates a glossary entry.
sourcepub async fn delete_glossary_entry(
&mut self,
request: impl IntoRequest<DeleteGlossaryEntryRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_glossary_entry( &mut self, request: impl IntoRequest<DeleteGlossaryEntryRequest>, ) -> Result<Response<()>, Status>
Deletes a single entry from the glossary
sourcepub async fn create_dataset(
&mut self,
request: impl IntoRequest<CreateDatasetRequest>,
) -> Result<Response<Operation>, Status>
pub async fn create_dataset( &mut self, request: impl IntoRequest<CreateDatasetRequest>, ) -> Result<Response<Operation>, Status>
Creates a Dataset.
sourcepub async fn get_dataset(
&mut self,
request: impl IntoRequest<GetDatasetRequest>,
) -> Result<Response<Dataset>, Status>
pub async fn get_dataset( &mut self, request: impl IntoRequest<GetDatasetRequest>, ) -> Result<Response<Dataset>, Status>
Gets a Dataset.
sourcepub async fn list_datasets(
&mut self,
request: impl IntoRequest<ListDatasetsRequest>,
) -> Result<Response<ListDatasetsResponse>, Status>
pub async fn list_datasets( &mut self, request: impl IntoRequest<ListDatasetsRequest>, ) -> Result<Response<ListDatasetsResponse>, Status>
Lists datasets.
sourcepub async fn delete_dataset(
&mut self,
request: impl IntoRequest<DeleteDatasetRequest>,
) -> Result<Response<Operation>, Status>
pub async fn delete_dataset( &mut self, request: impl IntoRequest<DeleteDatasetRequest>, ) -> Result<Response<Operation>, Status>
Deletes a dataset and all of its contents.
sourcepub async fn create_adaptive_mt_dataset(
&mut self,
request: impl IntoRequest<CreateAdaptiveMtDatasetRequest>,
) -> Result<Response<AdaptiveMtDataset>, Status>
pub async fn create_adaptive_mt_dataset( &mut self, request: impl IntoRequest<CreateAdaptiveMtDatasetRequest>, ) -> Result<Response<AdaptiveMtDataset>, Status>
Creates an Adaptive MT dataset.
sourcepub async fn delete_adaptive_mt_dataset(
&mut self,
request: impl IntoRequest<DeleteAdaptiveMtDatasetRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_adaptive_mt_dataset( &mut self, request: impl IntoRequest<DeleteAdaptiveMtDatasetRequest>, ) -> Result<Response<()>, Status>
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
sourcepub async fn get_adaptive_mt_dataset(
&mut self,
request: impl IntoRequest<GetAdaptiveMtDatasetRequest>,
) -> Result<Response<AdaptiveMtDataset>, Status>
pub async fn get_adaptive_mt_dataset( &mut self, request: impl IntoRequest<GetAdaptiveMtDatasetRequest>, ) -> Result<Response<AdaptiveMtDataset>, Status>
Gets the Adaptive MT dataset.
sourcepub async fn list_adaptive_mt_datasets(
&mut self,
request: impl IntoRequest<ListAdaptiveMtDatasetsRequest>,
) -> Result<Response<ListAdaptiveMtDatasetsResponse>, Status>
pub async fn list_adaptive_mt_datasets( &mut self, request: impl IntoRequest<ListAdaptiveMtDatasetsRequest>, ) -> Result<Response<ListAdaptiveMtDatasetsResponse>, Status>
Lists all Adaptive MT datasets for which the caller has read permission.
sourcepub async fn adaptive_mt_translate(
&mut self,
request: impl IntoRequest<AdaptiveMtTranslateRequest>,
) -> Result<Response<AdaptiveMtTranslateResponse>, Status>
pub async fn adaptive_mt_translate( &mut self, request: impl IntoRequest<AdaptiveMtTranslateRequest>, ) -> Result<Response<AdaptiveMtTranslateResponse>, Status>
Translate text using Adaptive MT.
sourcepub async fn get_adaptive_mt_file(
&mut self,
request: impl IntoRequest<GetAdaptiveMtFileRequest>,
) -> Result<Response<AdaptiveMtFile>, Status>
pub async fn get_adaptive_mt_file( &mut self, request: impl IntoRequest<GetAdaptiveMtFileRequest>, ) -> Result<Response<AdaptiveMtFile>, Status>
Gets and AdaptiveMtFile
sourcepub async fn delete_adaptive_mt_file(
&mut self,
request: impl IntoRequest<DeleteAdaptiveMtFileRequest>,
) -> Result<Response<()>, Status>
pub async fn delete_adaptive_mt_file( &mut self, request: impl IntoRequest<DeleteAdaptiveMtFileRequest>, ) -> Result<Response<()>, Status>
Deletes an AdaptiveMtFile along with its sentences.
sourcepub async fn import_adaptive_mt_file(
&mut self,
request: impl IntoRequest<ImportAdaptiveMtFileRequest>,
) -> Result<Response<ImportAdaptiveMtFileResponse>, Status>
pub async fn import_adaptive_mt_file( &mut self, request: impl IntoRequest<ImportAdaptiveMtFileRequest>, ) -> Result<Response<ImportAdaptiveMtFileResponse>, Status>
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
sourcepub async fn list_adaptive_mt_files(
&mut self,
request: impl IntoRequest<ListAdaptiveMtFilesRequest>,
) -> Result<Response<ListAdaptiveMtFilesResponse>, Status>
pub async fn list_adaptive_mt_files( &mut self, request: impl IntoRequest<ListAdaptiveMtFilesRequest>, ) -> Result<Response<ListAdaptiveMtFilesResponse>, Status>
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
sourcepub async fn list_adaptive_mt_sentences(
&mut self,
request: impl IntoRequest<ListAdaptiveMtSentencesRequest>,
) -> Result<Response<ListAdaptiveMtSentencesResponse>, Status>
pub async fn list_adaptive_mt_sentences( &mut self, request: impl IntoRequest<ListAdaptiveMtSentencesRequest>, ) -> Result<Response<ListAdaptiveMtSentencesResponse>, Status>
Lists all AdaptiveMtSentences under a given file/dataset.
sourcepub async fn import_data(
&mut self,
request: impl IntoRequest<ImportDataRequest>,
) -> Result<Response<Operation>, Status>
pub async fn import_data( &mut self, request: impl IntoRequest<ImportDataRequest>, ) -> Result<Response<Operation>, Status>
Import sentence pairs into translation Dataset.
sourcepub async fn export_data(
&mut self,
request: impl IntoRequest<ExportDataRequest>,
) -> Result<Response<Operation>, Status>
pub async fn export_data( &mut self, request: impl IntoRequest<ExportDataRequest>, ) -> Result<Response<Operation>, Status>
Exports dataset’s data to the provided output location.
sourcepub async fn list_examples(
&mut self,
request: impl IntoRequest<ListExamplesRequest>,
) -> Result<Response<ListExamplesResponse>, Status>
pub async fn list_examples( &mut self, request: impl IntoRequest<ListExamplesRequest>, ) -> Result<Response<ListExamplesResponse>, Status>
Lists sentence pairs in the dataset.
sourcepub async fn create_model(
&mut self,
request: impl IntoRequest<CreateModelRequest>,
) -> Result<Response<Operation>, Status>
pub async fn create_model( &mut self, request: impl IntoRequest<CreateModelRequest>, ) -> Result<Response<Operation>, Status>
Creates a Model.
sourcepub async fn list_models(
&mut self,
request: impl IntoRequest<ListModelsRequest>,
) -> Result<Response<ListModelsResponse>, Status>
pub async fn list_models( &mut self, request: impl IntoRequest<ListModelsRequest>, ) -> Result<Response<ListModelsResponse>, Status>
Lists models.
sourcepub async fn get_model(
&mut self,
request: impl IntoRequest<GetModelRequest>,
) -> Result<Response<Model>, Status>
pub async fn get_model( &mut self, request: impl IntoRequest<GetModelRequest>, ) -> Result<Response<Model>, Status>
Gets a model.
sourcepub async fn delete_model(
&mut self,
request: impl IntoRequest<DeleteModelRequest>,
) -> Result<Response<Operation>, Status>
pub async fn delete_model( &mut self, request: impl IntoRequest<DeleteModelRequest>, ) -> Result<Response<Operation>, Status>
Deletes a model.
Trait Implementations§
source§impl<T: Clone> Clone for TranslationServiceClient<T>
impl<T: Clone> Clone for TranslationServiceClient<T>
source§fn clone(&self) -> TranslationServiceClient<T>
fn clone(&self) -> TranslationServiceClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for TranslationServiceClient<T>
impl<T> RefUnwindSafe for TranslationServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for TranslationServiceClient<T>where
T: Send,
impl<T> Sync for TranslationServiceClient<T>where
T: Sync,
impl<T> Unpin for TranslationServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for TranslationServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request