/// <summary>Snippet for BatchTranslateText</summary> public void BatchTranslateText_RequestObject() { // Snippet: BatchTranslateText(BatchTranslateTextRequest,CallSettings) // Create client TranslationServiceClient translationServiceClient = TranslationServiceClient.Create(); // Initialize request argument(s) BatchTranslateTextRequest request = new BatchTranslateTextRequest { ParentAsLocationName = new LocationName("[PROJECT]", "[LOCATION]"), SourceLanguageCode = "", TargetLanguageCodes = { }, InputConfigs = { }, OutputConfig = new OutputConfig(), }; // Make the request Operation <BatchTranslateResponse, BatchTranslateMetadata> response = translationServiceClient.BatchTranslateText(request); // Poll until the returned long-running operation is complete Operation <BatchTranslateResponse, BatchTranslateMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result BatchTranslateResponse result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <BatchTranslateResponse, BatchTranslateMetadata> retrievedResponse = translationServiceClient.PollOnceBatchTranslateText(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result BatchTranslateResponse retrievedResult = retrievedResponse.Result; } // End snippet }