Skip to content

Commit abbf45d

Browse files
yoshi-automationandrey-qlogic
authored andcommitted
Regenerate language client (#4921)
1 parent dcf8341 commit abbf45d

File tree

4 files changed

+345
-8
lines changed

4 files changed

+345
-8
lines changed

google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java

Lines changed: 130 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
* <code>
3737
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
3838
* Document document = Document.newBuilder().build();
39-
* AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
39+
* EncodingType encodingType = EncodingType.NONE;
40+
* AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
4041
* }
4142
* </code>
4243
* </pre>
@@ -146,6 +147,35 @@ public LanguageServiceStub getStub() {
146147
return stub;
147148
}
148149

150+
// AUTO-GENERATED DOCUMENTATION AND METHOD
151+
/**
152+
* Analyzes the sentiment of the provided text.
153+
*
154+
* <p>Sample code:
155+
*
156+
* <pre><code>
157+
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
158+
* Document document = Document.newBuilder().build();
159+
* EncodingType encodingType = EncodingType.NONE;
160+
* AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
161+
* }
162+
* </code></pre>
163+
*
164+
* @param document Input document.
165+
* @param encodingType The encoding type used by the API to calculate sentence offsets.
166+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
167+
*/
168+
public final AnalyzeSentimentResponse analyzeSentiment(
169+
Document document, EncodingType encodingType) {
170+
171+
AnalyzeSentimentRequest request =
172+
AnalyzeSentimentRequest.newBuilder()
173+
.setDocument(document)
174+
.setEncodingType(encodingType)
175+
.build();
176+
return analyzeSentiment(request);
177+
}
178+
149179
// AUTO-GENERATED DOCUMENTATION AND METHOD
150180
/**
151181
* Analyzes the sentiment of the provided text.
@@ -245,6 +275,30 @@ public final AnalyzeEntitiesResponse analyzeEntities(
245275
return analyzeEntities(request);
246276
}
247277

278+
// AUTO-GENERATED DOCUMENTATION AND METHOD
279+
/**
280+
* Finds named entities (currently proper names and common nouns) in the text along with entity
281+
* types, salience, mentions for each entity, and other properties.
282+
*
283+
* <p>Sample code:
284+
*
285+
* <pre><code>
286+
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
287+
* Document document = Document.newBuilder().build();
288+
* AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document);
289+
* }
290+
* </code></pre>
291+
*
292+
* @param document Input document.
293+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
294+
*/
295+
public final AnalyzeEntitiesResponse analyzeEntities(Document document) {
296+
297+
AnalyzeEntitiesRequest request =
298+
AnalyzeEntitiesRequest.newBuilder().setDocument(document).build();
299+
return analyzeEntities(request);
300+
}
301+
248302
// AUTO-GENERATED DOCUMENTATION AND METHOD
249303
/**
250304
* Finds named entities (currently proper names and common nouns) in the text along with entity
@@ -324,6 +378,31 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
324378
return analyzeEntitySentiment(request);
325379
}
326380

381+
// AUTO-GENERATED DOCUMENTATION AND METHOD
382+
/**
383+
* Finds entities, similar to
384+
* [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and
385+
* analyzes sentiment associated with each entity and its mentions.
386+
*
387+
* <p>Sample code:
388+
*
389+
* <pre><code>
390+
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
391+
* Document document = Document.newBuilder().build();
392+
* AnalyzeEntitySentimentResponse response = languageServiceClient.analyzeEntitySentiment(document);
393+
* }
394+
* </code></pre>
395+
*
396+
* @param document Input document.
397+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
398+
*/
399+
public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) {
400+
401+
AnalyzeEntitySentimentRequest request =
402+
AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build();
403+
return analyzeEntitySentiment(request);
404+
}
405+
327406
// AUTO-GENERATED DOCUMENTATION AND METHOD
328407
/**
329408
* Finds entities, similar to
@@ -404,6 +483,29 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType
404483
return analyzeSyntax(request);
405484
}
406485

486+
// AUTO-GENERATED DOCUMENTATION AND METHOD
487+
/**
488+
* Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
489+
* part of speech tags, dependency trees, and other properties.
490+
*
491+
* <p>Sample code:
492+
*
493+
* <pre><code>
494+
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
495+
* Document document = Document.newBuilder().build();
496+
* AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document);
497+
* }
498+
* </code></pre>
499+
*
500+
* @param document Input document.
501+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
502+
*/
503+
public final AnalyzeSyntaxResponse analyzeSyntax(Document document) {
504+
505+
AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder().setDocument(document).build();
506+
return analyzeSyntax(request);
507+
}
508+
407509
// AUTO-GENERATED DOCUMENTATION AND METHOD
408510
/**
409511
* Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
@@ -551,6 +653,33 @@ public final AnnotateTextResponse annotateText(
551653
return annotateText(request);
552654
}
553655

656+
// AUTO-GENERATED DOCUMENTATION AND METHOD
657+
/**
658+
* A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and
659+
* analyzeSyntax provide in one call.
660+
*
661+
* <p>Sample code:
662+
*
663+
* <pre><code>
664+
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
665+
* Document document = Document.newBuilder().build();
666+
* AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build();
667+
* AnnotateTextResponse response = languageServiceClient.annotateText(document, features);
668+
* }
669+
* </code></pre>
670+
*
671+
* @param document Input document.
672+
* @param features The enabled features.
673+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
674+
*/
675+
public final AnnotateTextResponse annotateText(
676+
Document document, AnnotateTextRequest.Features features) {
677+
678+
AnnotateTextRequest request =
679+
AnnotateTextRequest.newBuilder().setDocument(document).setFeatures(features).build();
680+
return annotateText(request);
681+
}
682+
554683
// AUTO-GENERATED DOCUMENTATION AND METHOD
555684
/**
556685
* A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and

google-cloud-clients/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
* <code>
3131
* try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
3232
* Document document = Document.newBuilder().build();
33-
* AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document);
33+
* EncodingType encodingType = EncodingType.NONE;
34+
* AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
3435
* }
3536
* </code>
3637
* </pre>

0 commit comments

Comments
 (0)