/// <summary>Snippet for BatchTranslateTextAsync</summary> public async Task BatchTranslateTextAsync_RequestObject() { // Snippet: BatchTranslateTextAsync(BatchTranslateTextRequest,CallSettings) // Create client TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync(); // 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 = await translationServiceClient.BatchTranslateTextAsync(request); // Poll until the returned long-running operation is complete Operation <BatchTranslateResponse, BatchTranslateMetadata> completedResponse = await response.PollUntilCompletedAsync(); // 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 = await translationServiceClient.PollOnceBatchTranslateTextAsync(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 }