From abbf45dac41842adc813d5e2ae81ebb3118ae4bb Mon Sep 17 00:00:00 2001
From: Yoshi Automation Bot
<44816363+yoshi-automation@users.noreply.github.com>
Date: Sat, 6 Apr 2019 04:10:13 -0700
Subject: [PATCH] Regenerate language client (#4921)
---
.../language/v1/LanguageServiceClient.java | 131 ++++++++++-
.../cloud/language/v1/package-info.java | 3 +-
.../v1/LanguageServiceClientTest.java | 209 +++++++++++++++++-
.../google-cloud-language/synth.metadata | 10 +-
4 files changed, 345 insertions(+), 8 deletions(-)
diff --git a/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java
index df590debd8a9..d2db5d05e07c 100644
--- a/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java
+++ b/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java
@@ -36,7 +36,8 @@
*
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
* Document document = Document.newBuilder().build();
- * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
+ * EncodingType encodingType = EncodingType.NONE;
+ * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
* }
*
*
@@ -146,6 +147,35 @@ public LanguageServiceStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Analyzes the sentiment of the provided text.
+ *
+ *
Sample code: + * + *
+ * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
+ * Document document = Document.newBuilder().build();
+ * EncodingType encodingType = EncodingType.NONE;
+ * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
+ * }
+ *
+ *
+ * @param document Input document.
+ * @param encodingType The encoding type used by the API to calculate sentence offsets.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AnalyzeSentimentResponse analyzeSentiment(
+ Document document, EncodingType encodingType) {
+
+ AnalyzeSentimentRequest request =
+ AnalyzeSentimentRequest.newBuilder()
+ .setDocument(document)
+ .setEncodingType(encodingType)
+ .build();
+ return analyzeSentiment(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes the sentiment of the provided text.
@@ -245,6 +275,30 @@ public final AnalyzeEntitiesResponse analyzeEntities(
return analyzeEntities(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Finds named entities (currently proper names and common nouns) in the text along with entity
+ * types, salience, mentions for each entity, and other properties.
+ *
+ * Sample code: + * + *
+ * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
+ * Document document = Document.newBuilder().build();
+ * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
+ * }
+ *
+ *
+ * @param document Input document.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AnalyzeEntitiesResponse analyzeEntities(Document document) {
+
+ AnalyzeEntitiesRequest request =
+ AnalyzeEntitiesRequest.newBuilder().setDocument(document).build();
+ return analyzeEntities(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Finds named entities (currently proper names and common nouns) in the text along with entity
@@ -324,6 +378,31 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
return analyzeEntitySentiment(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Finds entities, similar to
+ * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and
+ * analyzes sentiment associated with each entity and its mentions.
+ *
+ * Sample code: + * + *
+ * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
+ * Document document = Document.newBuilder().build();
+ * AnalyzeEntitySentimentResponse response = languageServiceClient.analyzeEntitySentiment(document);
+ * }
+ *
+ *
+ * @param document Input document.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) {
+
+ AnalyzeEntitySentimentRequest request =
+ AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build();
+ return analyzeEntitySentiment(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Finds entities, similar to
@@ -404,6 +483,29 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType
return analyzeSyntax(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
+ * part of speech tags, dependency trees, and other properties.
+ *
+ * Sample code: + * + *
+ * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
+ * Document document = Document.newBuilder().build();
+ * AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
+ * }
+ *
+ *
+ * @param document Input document.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) {
+
+ AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder().setDocument(document).build();
+ return analyzeSyntax(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
@@ -551,6 +653,33 @@ public final AnnotateTextResponse annotateText(
return annotateText(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and
+ * analyzeSyntax provide in one call.
+ *
+ * Sample code: + * + *
+ * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
+ * Document document = Document.newBuilder().build();
+ * AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
+ * AnnotateTextResponse response = languageServiceClient.annotateText(document, features);
+ * }
+ *
+ *
+ * @param document Input document.
+ * @param features The enabled features.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AnnotateTextResponse annotateText(
+ Document document, AnnotateTextRequest.Features features) {
+
+ AnnotateTextRequest request =
+ AnnotateTextRequest.newBuilder().setDocument(document).setFeatures(features).build();
+ return annotateText(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and
diff --git a/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java b/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
index 410ff1248de4..2cf6aeec113f 100644
--- a/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
+++ b/google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java
@@ -30,7 +30,8 @@
*
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
* Document document = Document.newBuilder().build();
- * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
+ * EncodingType encodingType = EncodingType.NONE;
+ * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
* }
*
*
diff --git a/google-cloud-clients/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java b/google-cloud-clients/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java
index f02c92c5e098..1541fa1851cc 100644
--- a/google-cloud-clients/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java
+++ b/google-cloud-clients/google-cloud-language/src/test/java/com/google/cloud/language/v1/LanguageServiceClientTest.java
@@ -81,8 +81,9 @@ public void analyzeSentimentTest() {
mockLanguageService.addResponse(expectedResponse);
Document document = Document.newBuilder().build();
+ EncodingType encodingType = EncodingType.NONE;
- AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document);
+ AnalyzeSentimentResponse actualResponse = client.analyzeSentiment(document, encodingType);
Assert.assertEquals(expectedResponse, actualResponse);
List