/// <summary>Snippet for GetGlossary</summary> public void GetGlossary() { // Snippet: GetGlossary(GlossaryName,CallSettings) // Create client TranslationServiceClient translationServiceClient = TranslationServiceClient.Create(); // Initialize request argument(s) GlossaryName name = new GlossaryName("[PROJECT]", "[LOCATION]", "[GLOSSARY]"); // Make the request Glossary response = translationServiceClient.GetGlossary(name); // End snippet }
/// <summary> /// Retrieves a glossary. /// </summary> /// <param name="projectId">Your Google Cloud Project ID.</param> /// <param name="glossaryId">Glossary ID.</param> public static void GetGlossarySample(string projectId = "[Google Cloud Project ID]", string glossaryId = "[YOUR_GLOSSARY_ID]") { TranslationServiceClient translationServiceClient = TranslationServiceClient.Create(); GetGlossaryRequest request = new GetGlossaryRequest { GlossaryName = new GlossaryName(projectId, "us-central1", glossaryId), }; Glossary response = translationServiceClient.GetGlossary(request); Console.WriteLine($"Glossary name: {response.Name}"); Console.WriteLine($"Entry count: {response.EntryCount}"); Console.WriteLine($"Input URI: {response.InputConfig.GcsSource.InputUri}"); }
/// <summary>Snippet for GetGlossary</summary> public void GetGlossary_RequestObject() { // Snippet: GetGlossary(GetGlossaryRequest,CallSettings) // Create client TranslationServiceClient translationServiceClient = TranslationServiceClient.Create(); // Initialize request argument(s) GetGlossaryRequest request = new GetGlossaryRequest { Name = new GlossaryName("[PROJECT]", "[LOCATION]", "[GLOSSARY]").ToString(), }; // Make the request Glossary response = translationServiceClient.GetGlossary(request); // End snippet }