diff --git a/java-language/README.md b/java-language/README.md index c180ea1e25ff..4dea55c2033b 100644 --- a/java-language/README.md +++ b/java-language/README.md @@ -11,58 +11,28 @@ Java idiomatic client for [Natural Language][product-docs]. ## Quickstart -If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: -```xml - - - - com.google.cloud - libraries-bom - 26.1.1 - pom - import - - - - - - - com.google.cloud - google-cloud-language - - -``` - -If you are using Maven without BOM, add this to your dependencies: +If you are using Maven, add this to your pom.xml file: ```xml com.google.cloud google-cloud-language - 2.3.2 + 2.3.4 - ``` -If you are using Gradle 5.x or later, add this to your dependencies: - -```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.1') - -implementation 'com.google.cloud:google-cloud-language' -``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-language:2.3.3' +implementation 'com.google.cloud:google-cloud-language:2.3.4' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.3" +libraryDependencies += "com.google.cloud" % "google-cloud-language" % "2.3.4" ``` ## Authentication @@ -132,18 +102,6 @@ In [AnalyzeSentiment.java](https://github.com/googleapis/google-cloud-java/blob/ -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/java-language/tree/main/samples) directory. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Analyze Beta | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/beta/example/language/AnalyzeBeta.java) | -| Analyze | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/Analyze.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/Analyze.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/QuickstartSample.java) | -| Set Endpoint | [source code](https://github.com/googleapis/java-language/blob/main/samples/snippets/src/main/java/com/example/language/SetEndpoint.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-language&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/language/SetEndpoint.java) | - - ## Troubleshooting diff --git a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java index e4d00fdd4f02..f5c952be6084 100644 --- a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java +++ b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java @@ -189,7 +189,7 @@ public LanguageServiceStub getStub() { * } * } * - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { @@ -218,7 +218,7 @@ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { * } * } * - * @param document Input document. + * @param document Required. 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 */ @@ -310,7 +310,7 @@ public final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest r * } * } * - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitiesResponse analyzeEntities(Document document) { @@ -340,7 +340,7 @@ public final AnalyzeEntitiesResponse analyzeEntities(Document document) { * } * } * - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -436,7 +436,7 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ * } * } * - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { @@ -467,7 +467,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document docu * } * } * - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -565,7 +565,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( * } * } * - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { @@ -593,7 +593,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { * } * } * - * @param document Input document. + * @param document Required. Input document. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -684,7 +684,7 @@ public final UnaryCallable analyzeS * } * } * - * @param document Input document. + * @param document Required. Input document. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ClassifyTextResponse classifyText(Document document) { @@ -706,7 +706,10 @@ public final ClassifyTextResponse classifyText(Document document) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ClassifyTextResponse response = languageServiceClient.classifyText(request); * } * } @@ -732,7 +735,10 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ApiFuture future = * languageServiceClient.classifyTextCallable().futureCall(request); * // Do something. @@ -764,8 +770,8 @@ public final UnaryCallable classifyTe * } * } * - * @param document Input document. - * @param features The enabled features. + * @param document Required. Input document. + * @param features Required. The enabled features. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnnotateTextResponse annotateText( @@ -797,8 +803,8 @@ public final AnnotateTextResponse annotateText( * } * } * - * @param document Input document. - * @param features The enabled features. + * @param document Required. Input document. + * @param features Required. The enabled features. * @param encodingType The encoding type used by the API to calculate offsets. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java index 5d1efcb4ff96..a3260a785b20 100644 --- a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java +++ b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Natural Language API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= LanguageServiceClient ======================= * diff --git a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java index e887f23b35a1..48573abccac5 100644 --- a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java +++ b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceClient.java @@ -552,7 +552,7 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment( // 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. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -579,7 +579,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { // 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. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -612,7 +612,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType // 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. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -642,7 +642,7 @@ public final AnalyzeSyntaxResponse analyzeSyntax(AnalyzeSyntaxRequest 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. + * part of speech tags, dependency trees, and other properties. * *

Sample code: * @@ -709,7 +709,10 @@ public final ClassifyTextResponse classifyText(Document document) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ClassifyTextResponse response = languageServiceClient.classifyText(request); * } * } @@ -735,7 +738,10 @@ public final ClassifyTextResponse classifyText(ClassifyTextRequest request) { * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { * ClassifyTextRequest request = - * ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + * ClassifyTextRequest.newBuilder() + * .setDocument(Document.newBuilder().build()) + * .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + * .build(); * ApiFuture future = * languageServiceClient.classifyTextCallable().futureCall(request); * // Do something. diff --git a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java index 8d011841537c..9575cab45be8 100644 --- a/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java +++ b/java-language/google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Natural Language API + * + *

The interfaces provided are listed below, along with usage samples. * *

======================= LanguageServiceClient ======================= * diff --git a/java-language/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java b/java-language/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java index bf5719669330..e3f745e6983e 100644 --- a/java-language/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java +++ b/java-language/grpc-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceGrpc.java @@ -408,8 +408,10 @@ public void analyzeEntities( * * *

-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -576,8 +578,10 @@ public void analyzeEntities( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public void analyzeEntitySentiment( @@ -697,8 +701,10 @@ public com.google.cloud.language.v1.AnalyzeEntitiesResponse analyzeEntities( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public com.google.cloud.language.v1.AnalyzeEntitySentimentResponse analyzeEntitySentiment( @@ -804,8 +810,10 @@ protected LanguageServiceFutureStub build( * * *
-     * Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
-     * sentiment associated with each entity and its mentions.
+     * Finds entities, similar to
+     * [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
+     * in the text and analyzes sentiment associated with each entity and its
+     * mentions.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/java-language/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java b/java-language/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java index b167f0483d3d..bfe3452d09bd 100644 --- a/java-language/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java +++ b/java-language/grpc-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceGrpc.java @@ -426,7 +426,7 @@ public void analyzeEntitySentiment( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -597,7 +597,7 @@ public void analyzeEntitySentiment( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -714,7 +714,7 @@ public com.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse analyzeE * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ @@ -823,7 +823,7 @@ protected LanguageServiceFutureStub build( * *
      * Analyzes the syntax of the text and provides sentence boundaries and
-     * tokenization along with part-of-speech tags, dependency trees, and other
+     * tokenization along with part of speech tags, dependency trees, and other
      * properties.
      * 
*/ diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java index a986dfc386d2..69dc1fbc4812 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java index 1e4f6bc4b0b1..2b0136d73707 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeEntitiesRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java index accd0b3e4a93..23f750d858b3 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponse.java @@ -206,7 +206,8 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -231,7 +232,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -982,7 +984,8 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1006,7 +1009,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1030,7 +1034,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1053,7 +1058,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1072,7 +1078,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java index 62bb035b9a46..4a920281e665 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitiesResponseOrBuilder.java @@ -80,7 +80,8 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -94,7 +95,8 @@ public interface AnalyzeEntitiesResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java index f6b2118f7cd0..e2320968142e 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -575,7 +575,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -591,7 +591,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -613,7 +613,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -637,7 +637,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -658,7 +658,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -686,7 +686,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -708,7 +708,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -724,7 +724,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -744,7 +744,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java index f53159b94d9e..9001f8b5e67d 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeEntitySentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java index 905425e5c433..2307898ce365 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponse.java @@ -207,7 +207,8 @@ public com.google.cloud.language.v1.EntityOrBuilder getEntitiesOrBuilder(int ind *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -232,7 +233,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -984,7 +986,8 @@ public java.util.List getEntitiesBu *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1008,7 +1011,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1032,7 +1036,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1055,7 +1060,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1074,7 +1080,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java index 16ee973a23b9..885d156bfe47 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeEntitySentimentResponseOrBuilder.java @@ -80,7 +80,8 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -94,7 +95,8 @@ public interface AnalyzeEntitySentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java index 496ec1ee587e..78045d28ccad 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java index eb46a9fefa6d..10852b5cfec0 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeSentimentRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java index 49f6247cade2..c557151855b7 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponse.java @@ -201,7 +201,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -226,7 +227,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -913,7 +915,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -937,7 +940,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -961,7 +965,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -984,7 +989,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; @@ -1003,7 +1009,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java index 9fa9e6082d54..78f94d9bf13f 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSentimentResponseOrBuilder.java @@ -64,7 +64,8 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; @@ -78,7 +79,8 @@ public interface AnalyzeSentimentResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java index ca9576842570..a607c0123802 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequest.java @@ -135,7 +135,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -152,7 +152,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -171,7 +171,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -574,7 +574,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -590,7 +590,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -612,7 +612,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -636,7 +636,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -657,7 +657,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -685,7 +685,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -707,7 +707,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -723,7 +723,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -743,7 +743,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java index 410ea9f2f1ae..346123c38fe0 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnalyzeSyntaxRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java index 0288ed59c66d..214cca7efb91 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponse.java @@ -290,7 +290,8 @@ public com.google.cloud.language.v1.TokenOrBuilder getTokensOrBuilder(int index) *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -315,7 +316,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -1468,7 +1470,8 @@ public java.util.List getTokensBuild *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1492,7 +1495,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1516,7 +1520,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1539,7 +1544,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; @@ -1558,7 +1564,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 3; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java index 1369f367f116..4a950561458e 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnalyzeSyntaxResponseOrBuilder.java @@ -132,7 +132,8 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; @@ -146,7 +147,8 @@ public interface AnalyzeSyntaxResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 3; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java index 40c2fa83d49e..69eb77b807f3 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequest.java @@ -216,6 +216,48 @@ public interface FeaturesOrBuilder * @return The classifyText. */ boolean getClassifyText(); + + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } /** * @@ -291,6 +333,23 @@ private Features( case 48: { classifyText_ = input.readBool(); + break; + } + case 82: + { + com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -419,6 +478,61 @@ public boolean getClassifyText() { return classifyText_; } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -448,6 +562,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classifyText_ != false) { output.writeBool(6, classifyText_); } + if (classificationModelOptions_ != null) { + output.writeMessage(10, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -472,6 +589,11 @@ public int getSerializedSize() { if (classifyText_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -493,6 +615,11 @@ public boolean equals(final java.lang.Object obj) { if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; if (getClassifyText() != other.getClassifyText()) return false; + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -514,6 +641,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -673,6 +804,12 @@ public Builder clear() { classifyText_ = false; + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -705,6 +842,11 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features buildPartial() result.extractDocumentSentiment_ = extractDocumentSentiment_; result.extractEntitySentiment_ = extractEntitySentiment_; result.classifyText_ = classifyText_; + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -772,6 +914,9 @@ public Builder mergeFrom(com.google.cloud.language.v1.AnnotateTextRequest.Featur if (other.getClassifyText() != false) { setClassifyText(other.getClassifyText()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1062,6 +1207,225 @@ public Builder clearClassifyText() { return this; } + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1120,7 +1484,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getDefaultInsta * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1137,7 +1501,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1156,7 +1520,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -1174,7 +1538,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1191,7 +1555,7 @@ public boolean hasFeatures() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1210,7 +1574,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -1641,7 +2005,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1657,7 +2021,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1679,7 +2043,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1703,7 +2067,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1724,7 +2088,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1752,7 +2116,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1774,7 +2138,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1790,7 +2154,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1810,7 +2174,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -1844,7 +2208,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1860,7 +2224,7 @@ public boolean hasFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1882,7 +2246,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features getFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1906,7 +2270,7 @@ public Builder setFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Feat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1928,7 +2292,7 @@ public Builder setFeatures( * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1956,7 +2320,7 @@ public Builder mergeFeatures(com.google.cloud.language.v1.AnnotateTextRequest.Fe * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1978,7 +2342,7 @@ public Builder clearFeatures() { * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -1994,7 +2358,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * @@ -2015,7 +2379,7 @@ public com.google.cloud.language.v1.AnnotateTextRequest.Features.Builder getFeat * * *
-     * The enabled features.
+     * Required. The enabled features.
      * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java index d998316e5a9e..db69924b77b8 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -68,7 +68,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -82,7 +82,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * @@ -96,7 +96,7 @@ public interface AnnotateTextRequestOrBuilder * * *
-   * The enabled features.
+   * Required. The enabled features.
    * 
* * diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java index 56f2bb5454ed..e7471838e654 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponse.java @@ -483,7 +483,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -508,7 +509,8 @@ public java.lang.String getLanguage() { *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -2500,7 +2502,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getDocumentSentimentOrBui *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2524,7 +2527,8 @@ public java.lang.String getLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2548,7 +2552,8 @@ public com.google.protobuf.ByteString getLanguageBytes() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2571,7 +2576,8 @@ public Builder setLanguage(java.lang.String value) { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; @@ -2590,7 +2596,8 @@ public Builder clearLanguage() { *
      * The language of the text, which will be the same as the language specified
      * in the request or, if not specified, the automatically-detected language.
-     * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+     * See [Document.language][google.cloud.language.v1.Document.language] field
+     * for more details.
      * 
* * string language = 5; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java index 42ca1b94e339..922f5b1fc067 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/AnnotateTextResponseOrBuilder.java @@ -246,7 +246,8 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; @@ -260,7 +261,8 @@ public interface AnnotateTextResponseOrBuilder *
    * The language of the text, which will be the same as the language specified
    * in the request or, if not specified, the automatically-detected language.
-   * See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+   * See [Document.language][google.cloud.language.v1.Document.language] field
+   * for more details.
    * 
* * string language = 5; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java new file mode 100644 index 000000000000..ef354d0bcfe3 --- /dev/null +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptions.java @@ -0,0 +1,2508 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/language/v1/language_service.proto + +package com.google.cloud.language.v1; + +/** + * + * + *
+ * Model options available for classification requests.
+ * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} + */ +public final class ClassificationModelOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions) + ClassificationModelOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationModelOptions.newBuilder() to construct. + private ClassificationModelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationModelOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClassificationModelOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationModelOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder subBuilder = + null; + if (modelTypeCase_ == 1) { + subBuilder = + ((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 1; + break; + } + case 18: + { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder subBuilder = + null; + if (modelTypeCase_ == 2) { + subBuilder = + ((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.class, + com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); + } + + public interface V1ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V1Model) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Options for the V1 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} + */ + public static final class V1Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) + V1ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V1Model.newBuilder() to construct. + private V1Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V1Model() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V1Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V1Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions.V1Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions.V1Model other = + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Options for the V1 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V1Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V1Model) + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model build() { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model result = + new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1.ClassificationModelOptions.V1Model) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V1Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model other) { + if (other + == com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1.ClassificationModelOptions.V1Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.ClassificationModelOptions.V1Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V1Model) + private static final com.google.cloud.language.v1.ClassificationModelOptions.V1Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V1Model(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V1Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V1Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V1Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface V2ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions.V2Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + int getContentCategoriesVersionValue(); + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion(); + } + /** + * + * + *
+   * Options for the V2 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} + */ + public static final class V2Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) + V2ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V2Model.newBuilder() to construct. + private V2Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V2Model() { + contentCategoriesVersion_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V2Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V2Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + contentCategoriesVersion_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); + } + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion} + */ + public enum ContentCategoriesVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + CONTENT_CATEGORIES_VERSION_UNSPECIFIED(0), + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + V1(1), + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + V2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + public static final int CONTENT_CATEGORIES_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + public static final int V2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCategoriesVersion valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ContentCategoriesVersion forNumber(int value) { + switch (value) { + case 0: + return CONTENT_CATEGORIES_VERSION_UNSPECIFIED; + case 1: + return V1; + case 2: + return V2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentCategoriesVersion findValueByNumber(int number) { + return ContentCategoriesVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ContentCategoriesVersion[] VALUES = values(); + + public static ContentCategoriesVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentCategoriesVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion) + } + + public static final int CONTENT_CATEGORIES_VERSION_FIELD_NUMBER = 1; + private int contentCategoriesVersion_; + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCategoriesVersion_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, contentCategoriesVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCategoriesVersion_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions.V2Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions.V2Model other = + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) obj; + + if (contentCategoriesVersion_ != other.contentCategoriesVersion_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; + hash = (53 * hash) + contentCategoriesVersion_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Options for the V2 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions.V2Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions.V2Model) + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + contentCategoriesVersion_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model build() { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model result = + new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(this); + result.contentCategoriesVersion_ = contentCategoriesVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1.ClassificationModelOptions.V2Model) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions.V2Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model other) { + if (other + == com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance()) + return this; + if (other.contentCategoriesVersion_ != 0) { + setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1.ClassificationModelOptions.V2Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCategoriesVersion_ = 0; + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The enum numeric value on the wire for contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersionValue(int value) { + + contentCategoriesVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersion( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion + value) { + if (value == null) { + throw new NullPointerException(); + } + + contentCategoriesVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearContentCategoriesVersion() { + + contentCategoriesVersion_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions.V2Model) + private static final com.google.cloud.language.v1.ClassificationModelOptions.V2Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions.V2Model(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions.V2Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V2Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V2Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public enum ModelTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + V1_MODEL(1), + V2_MODEL(2), + MODELTYPE_NOT_SET(0); + private final int value; + + private ModelTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModelTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ModelTypeCase forNumber(int value) { + switch (value) { + case 1: + return V1_MODEL; + case 2: + return V2_MODEL; + case 0: + return MODELTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public static final int V1_MODEL_FIELD_NUMBER = 1; + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + + public static final int V2_MODEL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (modelTypeCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modelTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1.ClassificationModelOptions)) { + return super.equals(obj); + } + com.google.cloud.language.v1.ClassificationModelOptions other = + (com.google.cloud.language.v1.ClassificationModelOptions) obj; + + if (!getModelTypeCase().equals(other.getModelTypeCase())) return false; + switch (modelTypeCase_) { + case 1: + if (!getV1Model().equals(other.getV1Model())) return false; + break; + case 2: + if (!getV2Model().equals(other.getV2Model())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (modelTypeCase_) { + case 1: + hash = (37 * hash) + V1_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV1Model().hashCode(); + break; + case 2: + hash = (37 * hash) + V2_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV2Model().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1.ClassificationModelOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Model options available for classification requests.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1.ClassificationModelOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1.ClassificationModelOptions) + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1.ClassificationModelOptions.class, + com.google.cloud.language.v1.ClassificationModelOptions.Builder.class); + } + + // Construct using com.google.cloud.language.v1.ClassificationModelOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + modelTypeCase_ = 0; + modelType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1.LanguageServiceProto + .internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstanceForType() { + return com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions build() { + com.google.cloud.language.v1.ClassificationModelOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions buildPartial() { + com.google.cloud.language.v1.ClassificationModelOptions result = + new com.google.cloud.language.v1.ClassificationModelOptions(this); + if (modelTypeCase_ == 1) { + if (v1ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v1ModelBuilder_.build(); + } + } + if (modelTypeCase_ == 2) { + if (v2ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v2ModelBuilder_.build(); + } + } + result.modelTypeCase_ = modelTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1.ClassificationModelOptions) { + return mergeFrom((com.google.cloud.language.v1.ClassificationModelOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.language.v1.ClassificationModelOptions other) { + if (other == com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance()) + return this; + switch (other.getModelTypeCase()) { + case V1_MODEL: + { + mergeV1Model(other.getV1Model()); + break; + } + case V2_MODEL: + { + mergeV2Model(other.getV2Model()); + break; + } + case MODELTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1.ClassificationModelOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1.ClassificationModelOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public Builder clearModelType() { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> + v1ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } else { + if (modelTypeCase_ == 1) { + return v1ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v1ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder builderForValue) { + if (v1ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v1ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder mergeV1Model( + com.google.cloud.language.v1.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1 + && modelType_ + != com.google.cloud.language.v1.ClassificationModelOptions.V1Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.newBuilder( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 1) { + v1ModelBuilder_.mergeFrom(value); + } else { + v1ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder clearV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + } + v1ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + public com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder + getV1ModelBuilder() { + return getV1ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if ((modelTypeCase_ == 1) && (v1ModelBuilder_ != null)) { + return v1ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder> + getV1ModelFieldBuilder() { + if (v1ModelBuilder_ == null) { + if (!(modelTypeCase_ == 1)) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.getDefaultInstance(); + } + v1ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder>( + (com.google.cloud.language.v1.ClassificationModelOptions.V1Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 1; + onChanged(); + ; + return v1ModelBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> + v2ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } else { + if (modelTypeCase_ == 2) { + return v2ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v2ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder builderForValue) { + if (v2ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v2ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder mergeV2Model( + com.google.cloud.language.v1.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2 + && modelType_ + != com.google.cloud.language.v1.ClassificationModelOptions.V2Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.newBuilder( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 2) { + v2ModelBuilder_.mergeFrom(value); + } else { + v2ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder clearV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + } + v2ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + public com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder + getV2ModelBuilder() { + return getV2ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if ((modelTypeCase_ == 2) && (v2ModelBuilder_ != null)) { + return v2ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder> + getV2ModelFieldBuilder() { + if (v2ModelBuilder_ == null) { + if (!(modelTypeCase_ == 2)) { + modelType_ = + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.getDefaultInstance(); + } + v2ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder>( + (com.google.cloud.language.v1.ClassificationModelOptions.V2Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 2; + onChanged(); + ; + return v2ModelBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1.ClassificationModelOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1.ClassificationModelOptions) + private static final com.google.cloud.language.v1.ClassificationModelOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1.ClassificationModelOptions(); + } + + public static com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationModelOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationModelOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java new file mode 100644 index 000000000000..852a2579ebd6 --- /dev/null +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassificationModelOptionsOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/language/v1/language_service.proto + +package com.google.cloud.language.v1; + +public interface ClassificationModelOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1.ClassificationModelOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + boolean hasV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V1Model getV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V1Model v1_model = 1; + */ + com.google.cloud.language.v1.ClassificationModelOptions.V1ModelOrBuilder getV1ModelOrBuilder(); + + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + boolean hasV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2Model getV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions.V2Model v2_model = 2; + */ + com.google.cloud.language.v1.ClassificationModelOptions.V2ModelOrBuilder getV2ModelOrBuilder(); + + public com.google.cloud.language.v1.ClassificationModelOptions.ModelTypeCase getModelTypeCase(); +} diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java index fb71a005f743..6a86198085b4 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequest.java @@ -82,6 +82,23 @@ private ClassifyTextRequest( document_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.cloud.language.v1.ClassificationModelOptions.Builder subBuilder = null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -126,7 +143,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -143,7 +160,7 @@ public boolean hasDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -162,7 +179,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -174,6 +191,61 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { return getDocument(); } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -191,6 +263,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(1, getDocument()); } + if (classificationModelOptions_ != null) { + output.writeMessage(3, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -203,6 +278,11 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -223,6 +303,11 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -238,6 +323,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -389,6 +478,12 @@ public Builder clear() { document_ = null; documentBuilder_ = null; } + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -421,6 +516,11 @@ public com.google.cloud.language.v1.ClassifyTextRequest buildPartial() { } else { result.document_ = documentBuilder_.build(); } + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -474,6 +574,9 @@ public Builder mergeFrom(com.google.cloud.language.v1.ClassifyTextRequest other) if (other.hasDocument()) { mergeDocument(other.getDocument()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -513,7 +616,7 @@ public Builder mergeFrom( * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -529,7 +632,7 @@ public boolean hasDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -551,7 +654,7 @@ public com.google.cloud.language.v1.Document getDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -575,7 +678,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -596,7 +699,7 @@ public Builder setDocument(com.google.cloud.language.v1.Document.Builder builder * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -624,7 +727,7 @@ public Builder mergeDocument(com.google.cloud.language.v1.Document value) { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -646,7 +749,7 @@ public Builder clearDocument() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -662,7 +765,7 @@ public com.google.cloud.language.v1.Document.Builder getDocumentBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -682,7 +785,7 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { * * *
-     * Input document.
+     * Required. Input document.
      * 
* * @@ -706,6 +809,215 @@ public com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder() { return documentBuilder_; } + private com.google.cloud.language.v1.ClassificationModelOptions classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1.ClassificationModelOptions, + com.google.cloud.language.v1.ClassificationModelOptions.Builder, + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java index 6d362243f70c..087944f567bc 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/ClassifyTextRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -41,7 +41,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -55,7 +55,7 @@ public interface ClassifyTextRequestOrBuilder * * *
-   * Input document.
+   * Required. Input document.
    * 
* * @@ -63,4 +63,46 @@ public interface ClassifyTextRequestOrBuilder * */ com.google.cloud.language.v1.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * .google.cloud.language.v1.ClassificationModelOptions classification_model_options = 3; + * + */ + com.google.cloud.language.v1.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java index b2b98e0942b9..76a2d96cc76e 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Document.java @@ -22,6 +22,7 @@ * * *
+ * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -797,6 +798,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
+   * ################################################################ #
    * Represents the input to API methods.
    * 
* diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java index bfb7090c3cd9..c6991d69761a 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Entity.java @@ -283,14 +283,15 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Phone number<br><br>
+     * Phone number
      * The metadata lists the phone number, formatted according to local
-     * convention, plus whichever additional elements appear in the text:<ul>
-     * <li><code>number</code> &ndash; the actual number, broken down into
-     * sections as per local convention</li> <li><code>national_prefix</code>
-     * &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
-     * region or area code, if detected</li> <li><code>extension</code> &ndash;
-     * phone extension (to be dialed after connection), if detected</li></ul>
+     * convention, plus whichever additional elements appear in the text:
+     * * `number` - the actual number, broken down into sections as per local
+     * convention
+     * * `national_prefix` - country code, if detected
+     * * `area_code` - region or area code, if detected
+     * * `extension` - phone extension (to be dialed after connection), if
+     * detected
      * 
* * PHONE_NUMBER = 9; @@ -300,19 +301,19 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Address<br><br>
+     * Address
      * The metadata identifies the street number and locality plus whichever
-     * additional elements appear in the text:<ul>
-     * <li><code>street_number</code> &ndash; street number</li>
-     * <li><code>locality</code> &ndash; city or town</li>
-     * <li><code>street_name</code> &ndash; street/route name, if detected</li>
-     * <li><code>postal_code</code> &ndash; postal code, if detected</li>
-     * <li><code>country</code> &ndash; country, if detected</li>
-     * <li><code>broad_region</code> &ndash; administrative area, such as the
-     * state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
-     * administrative area, such as county, if detected</li>
-     * <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
-     * district within a city, if detected</li></ul>
+     * additional elements appear in the text:
+     * * `street_number` - street number
+     * * `locality` - city or town
+     * * `street_name` - street/route name, if detected
+     * * `postal_code` - postal code, if detected
+     * * `country` - country, if detected<
+     * * `broad_region` - administrative area, such as the state, if detected
+     * * `narrow_region` - smaller administrative area, such as county, if
+     * detected
+     * * `sublocality` - used in Asian addresses to demark a district within a
+     * city, if detected
      * 
* * ADDRESS = 10; @@ -322,11 +323,11 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Date<br><br>
-     * The metadata identifies the components of the date:<ul>
-     * <li><code>year</code> &ndash; four digit year, if detected</li>
-     * <li><code>month</code> &ndash; two digit month number, if detected</li>
-     * <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
+     * Date
+     * The metadata identifies the components of the date:
+     * * `year` - four digit year, if detected
+     * * `month` - two digit month number, if detected
+     * * `day` - two digit day number, if detected
      * 
* * DATE = 11; @@ -336,7 +337,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Number<br><br>
+     * Number
      * The metadata is the number itself.
      * 
* @@ -347,8 +348,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Price<br><br>
-     * The metadata identifies the <code>value</code> and <code>currency</code>.
+     * Price
+     * The metadata identifies the `value` and `currency`.
      * 
* * PRICE = 13; @@ -441,14 +442,15 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Phone number<br><br>
+     * Phone number
      * The metadata lists the phone number, formatted according to local
-     * convention, plus whichever additional elements appear in the text:<ul>
-     * <li><code>number</code> &ndash; the actual number, broken down into
-     * sections as per local convention</li> <li><code>national_prefix</code>
-     * &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
-     * region or area code, if detected</li> <li><code>extension</code> &ndash;
-     * phone extension (to be dialed after connection), if detected</li></ul>
+     * convention, plus whichever additional elements appear in the text:
+     * * `number` - the actual number, broken down into sections as per local
+     * convention
+     * * `national_prefix` - country code, if detected
+     * * `area_code` - region or area code, if detected
+     * * `extension` - phone extension (to be dialed after connection), if
+     * detected
      * 
* * PHONE_NUMBER = 9; @@ -458,19 +460,19 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Address<br><br>
+     * Address
      * The metadata identifies the street number and locality plus whichever
-     * additional elements appear in the text:<ul>
-     * <li><code>street_number</code> &ndash; street number</li>
-     * <li><code>locality</code> &ndash; city or town</li>
-     * <li><code>street_name</code> &ndash; street/route name, if detected</li>
-     * <li><code>postal_code</code> &ndash; postal code, if detected</li>
-     * <li><code>country</code> &ndash; country, if detected</li>
-     * <li><code>broad_region</code> &ndash; administrative area, such as the
-     * state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
-     * administrative area, such as county, if detected</li>
-     * <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
-     * district within a city, if detected</li></ul>
+     * additional elements appear in the text:
+     * * `street_number` - street number
+     * * `locality` - city or town
+     * * `street_name` - street/route name, if detected
+     * * `postal_code` - postal code, if detected
+     * * `country` - country, if detected<
+     * * `broad_region` - administrative area, such as the state, if detected
+     * * `narrow_region` - smaller administrative area, such as county, if
+     * detected
+     * * `sublocality` - used in Asian addresses to demark a district within a
+     * city, if detected
      * 
* * ADDRESS = 10; @@ -480,11 +482,11 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Date<br><br>
-     * The metadata identifies the components of the date:<ul>
-     * <li><code>year</code> &ndash; four digit year, if detected</li>
-     * <li><code>month</code> &ndash; two digit month number, if detected</li>
-     * <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
+     * Date
+     * The metadata identifies the components of the date:
+     * * `year` - four digit year, if detected
+     * * `month` - two digit month number, if detected
+     * * `day` - two digit day number, if detected
      * 
* * DATE = 11; @@ -494,7 +496,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Number<br><br>
+     * Number
      * The metadata is the number itself.
      * 
* @@ -505,8 +507,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * Price<br><br>
-     * The metadata identifies the <code>value</code> and <code>currency</code>.
+     * Price
+     * The metadata identifies the `value` and `currency`.
      * 
* * PRICE = 13; @@ -915,9 +917,9 @@ public com.google.cloud.language.v1.EntityMentionOrBuilder getMentionsOrBuilder( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -933,9 +935,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -953,9 +955,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2257,9 +2259,9 @@ public com.google.cloud.language.v1.EntityMention.Builder addMentionsBuilder(int * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2274,9 +2276,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2297,9 +2299,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2322,9 +2324,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2344,9 +2346,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2373,9 +2375,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2396,9 +2398,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2413,9 +2415,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -2434,9 +2436,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the aggregate sentiment expressed for this
-     * entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the aggregate sentiment expressed
+     * for this entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java index e176c4ba21d1..d0f1d55c8375 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMention.java @@ -392,9 +392,9 @@ public com.google.cloud.language.v1.EntityMention.Type getType() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -410,9 +410,9 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -430,9 +430,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1097,9 +1097,9 @@ public Builder clearType() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1114,9 +1114,9 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1137,9 +1137,9 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1162,9 +1162,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1184,9 +1184,9 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1213,9 +1213,9 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1236,9 +1236,9 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1253,9 +1253,9 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -1274,9 +1274,9 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeEntitySentiment][] or if
-     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-     * true, this field will contain the sentiment expressed for this mention of
-     * the entity in the provided document.
+     * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+     * is set to true, this field will contain the sentiment expressed for this
+     * mention of the entity in the provided document.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java index b0c19f722632..444002d5ee23 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityMentionOrBuilder.java @@ -88,9 +88,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -103,9 +103,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; @@ -118,9 +118,9 @@ public interface EntityMentionOrBuilder * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the sentiment expressed for this mention of
-   * the entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the sentiment expressed for this
+   * mention of the entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 3; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java index 40475ed77623..326115d016a3 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/EntityOrBuilder.java @@ -226,9 +226,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -241,9 +241,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; @@ -256,9 +256,9 @@ java.lang.String getMetadataOrDefault( * *
    * For calls to [AnalyzeEntitySentiment][] or if
-   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
-   * true, this field will contain the aggregate sentiment expressed for this
-   * entity in the provided document.
+   * [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment]
+   * is set to true, this field will contain the aggregate sentiment expressed
+   * for this entity in the provided document.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 6; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java index 8d943785a566..17ab199abb88 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/LanguageServiceProto.java @@ -71,6 +71,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_language_v1_ClassificationCategory_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_language_v1_ClassificationCategory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -250,95 +262,111 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\020\001\022\n\n\006COMMON\020\002\"1\n\010TextSpan\022\017\n\007content\030\001 " + "\001(\t\022\024\n\014begin_offset\030\002 \001(\005\":\n\026Classificat" + "ionCategory\022\014\n\004name\030\001 \001(\t\022\022\n\nconfidence\030" - + "\002 \001(\002\"\223\001\n\027AnalyzeSentimentRequest\0229\n\010doc" - + "ument\030\001 \001(\0132\".google.cloud.language.v1.D" - + "ocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(\0162&.go" - + "ogle.cloud.language.v1.EncodingType\"\244\001\n\030" - + "AnalyzeSentimentResponse\022?\n\022document_sen" - + "timent\030\001 \001(\0132#.google.cloud.language.v1." - + "Sentiment\022\020\n\010language\030\002 \001(\t\0225\n\tsentences" - + "\030\003 \003(\0132\".google.cloud.language.v1.Senten" - + "ce\"\231\001\n\035AnalyzeEntitySentimentRequest\0229\n\010" + + "\002 \001(\002\"\270\003\n\032ClassificationModelOptions\022P\n\010" + + "v1_model\030\001 \001(\0132<.google.cloud.language.v" + + "1.ClassificationModelOptions.V1ModelH\000\022P" + + "\n\010v2_model\030\002 \001(\0132<.google.cloud.language" + + ".v1.ClassificationModelOptions.V2ModelH\000" + + "\032\t\n\007V1Model\032\334\001\n\007V2Model\022y\n\032content_categ" + + "ories_version\030\001 \001(\0162U.google.cloud.langu" + + "age.v1.ClassificationModelOptions.V2Mode" + + "l.ContentCategoriesVersion\"V\n\030ContentCat" + + "egoriesVersion\022*\n&CONTENT_CATEGORIES_VER" + + "SION_UNSPECIFIED\020\000\022\006\n\002V1\020\001\022\006\n\002V2\020\002B\014\n\nmo" + + "del_type\"\223\001\n\027AnalyzeSentimentRequest\0229\n\010" + "document\030\001 \001(\0132\".google.cloud.language.v" + "1.DocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(\0162&" - + ".google.cloud.language.v1.EncodingType\"f" - + "\n\036AnalyzeEntitySentimentResponse\0222\n\010enti" - + "ties\030\001 \003(\0132 .google.cloud.language.v1.En" - + "tity\022\020\n\010language\030\002 \001(\t\"\222\001\n\026AnalyzeEntiti" - + "esRequest\0229\n\010document\030\001 \001(\0132\".google.clo" - + "ud.language.v1.DocumentB\003\340A\002\022=\n\rencoding" - + "_type\030\002 \001(\0162&.google.cloud.language.v1.E" - + "ncodingType\"_\n\027AnalyzeEntitiesResponse\0222" - + "\n\010entities\030\001 \003(\0132 .google.cloud.language" - + ".v1.Entity\022\020\n\010language\030\002 \001(\t\"\220\001\n\024Analyze" - + "SyntaxRequest\0229\n\010document\030\001 \001(\0132\".google" - + ".cloud.language.v1.DocumentB\003\340A\002\022=\n\renco" - + "ding_type\030\002 \001(\0162&.google.cloud.language." - + "v1.EncodingType\"\221\001\n\025AnalyzeSyntaxRespons" - + "e\0225\n\tsentences\030\001 \003(\0132\".google.cloud.lang" - + "uage.v1.Sentence\022/\n\006tokens\030\002 \003(\0132\037.googl" - + "e.cloud.language.v1.Token\022\020\n\010language\030\003 " - + "\001(\t\"P\n\023ClassifyTextRequest\0229\n\010document\030\001" - + " \001(\0132\".google.cloud.language.v1.Document" - + "B\003\340A\002\"\\\n\024ClassifyTextResponse\022D\n\ncategor" - + "ies\030\001 \003(\01320.google.cloud.language.v1.Cla" - + "ssificationCategory\"\372\002\n\023AnnotateTextRequ" - + "est\0229\n\010document\030\001 \001(\0132\".google.cloud.lan" - + "guage.v1.DocumentB\003\340A\002\022M\n\010features\030\002 \001(\013" - + "26.google.cloud.language.v1.AnnotateText" - + "Request.FeaturesB\003\340A\002\022=\n\rencoding_type\030\003" - + " \001(\0162&.google.cloud.language.v1.Encoding" - + "Type\032\231\001\n\010Features\022\026\n\016extract_syntax\030\001 \001(" - + "\010\022\030\n\020extract_entities\030\002 \001(\010\022\"\n\032extract_d" - + "ocument_sentiment\030\003 \001(\010\022 \n\030extract_entit" - + "y_sentiment\030\004 \001(\010\022\025\n\rclassify_text\030\006 \001(\010" - + "\"\313\002\n\024AnnotateTextResponse\0225\n\tsentences\030\001" - + " \003(\0132\".google.cloud.language.v1.Sentence" - + "\022/\n\006tokens\030\002 \003(\0132\037.google.cloud.language" - + ".v1.Token\0222\n\010entities\030\003 \003(\0132 .google.clo" - + "ud.language.v1.Entity\022?\n\022document_sentim" - + "ent\030\004 \001(\0132#.google.cloud.language.v1.Sen" - + "timent\022\020\n\010language\030\005 \001(\t\022D\n\ncategories\030\006" - + " \003(\01320.google.cloud.language.v1.Classifi" - + "cationCategory*8\n\014EncodingType\022\010\n\004NONE\020\000" - + "\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020\002\022\t\n\005UTF32\020\0032\260\n\n\017Lan" - + "guageService\022\310\001\n\020AnalyzeSentiment\0221.goog" - + "le.cloud.language.v1.AnalyzeSentimentReq" - + "uest\0322.google.cloud.language.v1.AnalyzeS" - + "entimentResponse\"M\202\323\344\223\002#\"\036/v1/documents:" - + "analyzeSentiment:\001*\332A\026document,encoding_" - + "type\332A\010document\022\304\001\n\017AnalyzeEntities\0220.go" - + "ogle.cloud.language.v1.AnalyzeEntitiesRe" - + "quest\0321.google.cloud.language.v1.Analyze" - + "EntitiesResponse\"L\202\323\344\223\002\"\"\035/v1/documents:" - + "analyzeEntities:\001*\332A\026document,encoding_t" - + "ype\332A\010document\022\340\001\n\026AnalyzeEntitySentimen" - + "t\0227.google.cloud.language.v1.AnalyzeEnti" - + "tySentimentRequest\0328.google.cloud.langua" - + "ge.v1.AnalyzeEntitySentimentResponse\"S\202\323" - + "\344\223\002)\"$/v1/documents:analyzeEntitySentime" - + "nt:\001*\332A\026document,encoding_type\332A\010documen" - + "t\022\274\001\n\rAnalyzeSyntax\022..google.cloud.langu" - + "age.v1.AnalyzeSyntaxRequest\032/.google.clo" - + "ud.language.v1.AnalyzeSyntaxResponse\"J\202\323" - + "\344\223\002 \"\033/v1/documents:analyzeSyntax:\001*\332A\026d" - + "ocument,encoding_type\332A\010document\022\237\001\n\014Cla" - + "ssifyText\022-.google.cloud.language.v1.Cla" - + "ssifyTextRequest\032..google.cloud.language" - + ".v1.ClassifyTextResponse\"0\202\323\344\223\002\037\"\032/v1/do" - + "cuments:classifyText:\001*\332A\010document\022\312\001\n\014A" - + "nnotateText\022-.google.cloud.language.v1.A" - + "nnotateTextRequest\032..google.cloud.langua" - + "ge.v1.AnnotateTextResponse\"[\202\323\344\223\002\037\"\032/v1/" - + "documents:annotateText:\001*\332A\037document,fea" - + "tures,encoding_type\332A\021document,features\032" - + "z\312A\027language.googleapis.com\322A]https://ww" - + "w.googleapis.com/auth/cloud-language,htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "ormBx\n\034com.google.cloud.language.v1B\024Lan" - + "guageServiceProtoP\001Z@google.golang.org/g" - + "enproto/googleapis/cloud/language/v1;lan" - + "guageb\006proto3" + + ".google.cloud.language.v1.EncodingType\"\244" + + "\001\n\030AnalyzeSentimentResponse\022?\n\022document_" + + "sentiment\030\001 \001(\0132#.google.cloud.language." + + "v1.Sentiment\022\020\n\010language\030\002 \001(\t\0225\n\tsenten" + + "ces\030\003 \003(\0132\".google.cloud.language.v1.Sen" + + "tence\"\231\001\n\035AnalyzeEntitySentimentRequest\022" + + "9\n\010document\030\001 \001(\0132\".google.cloud.languag" + + "e.v1.DocumentB\003\340A\002\022=\n\rencoding_type\030\002 \001(" + + "\0162&.google.cloud.language.v1.EncodingTyp" + + "e\"f\n\036AnalyzeEntitySentimentResponse\0222\n\010e" + + "ntities\030\001 \003(\0132 .google.cloud.language.v1" + + ".Entity\022\020\n\010language\030\002 \001(\t\"\222\001\n\026AnalyzeEnt" + + "itiesRequest\0229\n\010document\030\001 \001(\0132\".google." + + "cloud.language.v1.DocumentB\003\340A\002\022=\n\rencod" + + "ing_type\030\002 \001(\0162&.google.cloud.language.v" + + "1.EncodingType\"_\n\027AnalyzeEntitiesRespons" + + "e\0222\n\010entities\030\001 \003(\0132 .google.cloud.langu" + + "age.v1.Entity\022\020\n\010language\030\002 \001(\t\"\220\001\n\024Anal" + + "yzeSyntaxRequest\0229\n\010document\030\001 \001(\0132\".goo" + + "gle.cloud.language.v1.DocumentB\003\340A\002\022=\n\re" + + "ncoding_type\030\002 \001(\0162&.google.cloud.langua" + + "ge.v1.EncodingType\"\221\001\n\025AnalyzeSyntaxResp" + + "onse\0225\n\tsentences\030\001 \003(\0132\".google.cloud.l" + + "anguage.v1.Sentence\022/\n\006tokens\030\002 \003(\0132\037.go" + + "ogle.cloud.language.v1.Token\022\020\n\010language" + + "\030\003 \001(\t\"\254\001\n\023ClassifyTextRequest\0229\n\010docume" + + "nt\030\001 \001(\0132\".google.cloud.language.v1.Docu" + + "mentB\003\340A\002\022Z\n\034classification_model_option" + + "s\030\003 \001(\01324.google.cloud.language.v1.Class" + + "ificationModelOptions\"\\\n\024ClassifyTextRes" + + "ponse\022D\n\ncategories\030\001 \003(\01320.google.cloud" + + ".language.v1.ClassificationCategory\"\326\003\n\023" + + "AnnotateTextRequest\0229\n\010document\030\001 \001(\0132\"." + + "google.cloud.language.v1.DocumentB\003\340A\002\022M" + + "\n\010features\030\002 \001(\01326.google.cloud.language" + + ".v1.AnnotateTextRequest.FeaturesB\003\340A\002\022=\n" + + "\rencoding_type\030\003 \001(\0162&.google.cloud.lang" + + "uage.v1.EncodingType\032\365\001\n\010Features\022\026\n\016ext" + + "ract_syntax\030\001 \001(\010\022\030\n\020extract_entities\030\002 " + + "\001(\010\022\"\n\032extract_document_sentiment\030\003 \001(\010\022" + + " \n\030extract_entity_sentiment\030\004 \001(\010\022\025\n\rcla" + + "ssify_text\030\006 \001(\010\022Z\n\034classification_model" + + "_options\030\n \001(\01324.google.cloud.language.v" + + "1.ClassificationModelOptions\"\313\002\n\024Annotat" + + "eTextResponse\0225\n\tsentences\030\001 \003(\0132\".googl" + + "e.cloud.language.v1.Sentence\022/\n\006tokens\030\002" + + " \003(\0132\037.google.cloud.language.v1.Token\0222\n" + + "\010entities\030\003 \003(\0132 .google.cloud.language." + + "v1.Entity\022?\n\022document_sentiment\030\004 \001(\0132#." + + "google.cloud.language.v1.Sentiment\022\020\n\010la" + + "nguage\030\005 \001(\t\022D\n\ncategories\030\006 \003(\01320.googl" + + "e.cloud.language.v1.ClassificationCatego" + + "ry*8\n\014EncodingType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t" + + "\n\005UTF16\020\002\022\t\n\005UTF32\020\0032\260\n\n\017LanguageService" + + "\022\310\001\n\020AnalyzeSentiment\0221.google.cloud.lan" + + "guage.v1.AnalyzeSentimentRequest\0322.googl" + + "e.cloud.language.v1.AnalyzeSentimentResp" + + "onse\"M\202\323\344\223\002#\"\036/v1/documents:analyzeSenti" + + "ment:\001*\332A\026document,encoding_type\332A\010docum" + + "ent\022\304\001\n\017AnalyzeEntities\0220.google.cloud.l" + + "anguage.v1.AnalyzeEntitiesRequest\0321.goog" + + "le.cloud.language.v1.AnalyzeEntitiesResp" + + "onse\"L\202\323\344\223\002\"\"\035/v1/documents:analyzeEntit" + + "ies:\001*\332A\026document,encoding_type\332A\010docume" + + "nt\022\340\001\n\026AnalyzeEntitySentiment\0227.google.c" + + "loud.language.v1.AnalyzeEntitySentimentR" + + "equest\0328.google.cloud.language.v1.Analyz" + + "eEntitySentimentResponse\"S\202\323\344\223\002)\"$/v1/do" + + "cuments:analyzeEntitySentiment:\001*\332A\026docu" + + "ment,encoding_type\332A\010document\022\274\001\n\rAnalyz" + + "eSyntax\022..google.cloud.language.v1.Analy" + + "zeSyntaxRequest\032/.google.cloud.language." + + "v1.AnalyzeSyntaxResponse\"J\202\323\344\223\002 \"\033/v1/do" + + "cuments:analyzeSyntax:\001*\332A\026document,enco" + + "ding_type\332A\010document\022\237\001\n\014ClassifyText\022-." + + "google.cloud.language.v1.ClassifyTextReq" + + "uest\032..google.cloud.language.v1.Classify" + + "TextResponse\"0\202\323\344\223\002\037\"\032/v1/documents:clas" + + "sifyText:\001*\332A\010document\022\312\001\n\014AnnotateText\022" + + "-.google.cloud.language.v1.AnnotateTextR" + + "equest\032..google.cloud.language.v1.Annota" + + "teTextResponse\"[\202\323\344\223\002\037\"\032/v1/documents:an" + + "notateText:\001*\332A\037document,features,encodi" + + "ng_type\332A\021document,features\032z\312A\027language" + + ".googleapis.com\322A]https://www.googleapis" + + ".com/auth/cloud-language,https://www.goo" + + "gleapis.com/auth/cloud-platformBx\n\034com.g" + + "oogle.cloud.language.v1B\024LanguageService" + + "ProtoP\001Z@google.golang.org/genproto/goog" + + "leapis/cloud/language/v1;languageb\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -447,8 +475,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Confidence", }); - internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_language_v1_ClassificationModelOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor, + new java.lang.String[] { + "V1Model", "V2Model", "ModelType", + }); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_V1Model_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor = + internal_static_google_cloud_language_v1_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1_ClassificationModelOptions_V2Model_descriptor, + new java.lang.String[] { + "ContentCategoriesVersion", + }); + internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor = + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSentimentRequest_descriptor, @@ -456,7 +510,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSentimentResponse_descriptor, @@ -464,7 +518,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocumentSentiment", "Language", "Sentences", }); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitySentimentRequest_descriptor, @@ -472,7 +526,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitySentimentResponse_descriptor, @@ -480,7 +534,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitiesRequest_descriptor, @@ -488,7 +542,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeEntitiesResponse_descriptor, @@ -496,7 +550,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSyntaxRequest_descriptor, @@ -504,7 +558,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnalyzeSyntaxResponse_descriptor, @@ -512,15 +566,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Sentences", "Tokens", "Language", }); internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_language_v1_ClassifyTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_ClassifyTextRequest_descriptor, new java.lang.String[] { - "Document", + "Document", "ClassificationModelOptions", }); internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_language_v1_ClassifyTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_ClassifyTextResponse_descriptor, @@ -528,7 +582,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Categories", }); internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_language_v1_AnnotateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnnotateTextRequest_descriptor, @@ -548,9 +602,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", + "ClassificationModelOptions", }); internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_language_v1_AnnotateTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1_AnnotateTextResponse_descriptor, diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java index 461cdeb7099d..ff00a442786f 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/Sentence.java @@ -189,8 +189,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -206,8 +206,8 @@ public boolean hasSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -225,8 +225,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -782,8 +782,8 @@ public com.google.cloud.language.v1.TextSpanOrBuilder getTextOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -798,8 +798,8 @@ public boolean hasSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -820,8 +820,8 @@ public com.google.cloud.language.v1.Sentiment getSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -844,8 +844,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -865,8 +865,8 @@ public Builder setSentiment(com.google.cloud.language.v1.Sentiment.Builder build * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -893,8 +893,8 @@ public Builder mergeSentiment(com.google.cloud.language.v1.Sentiment value) { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -915,8 +915,8 @@ public Builder clearSentiment() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -931,8 +931,8 @@ public com.google.cloud.language.v1.Sentiment.Builder getSentimentBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -951,8 +951,8 @@ public com.google.cloud.language.v1.SentimentOrBuilder getSentimentOrBuilder() { * *
      * For calls to [AnalyzeSentiment][] or if
-     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-     * true, this field will contain the sentiment for the sentence.
+     * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+     * is set to true, this field will contain the sentiment for the sentence.
      * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java index beaf01608d33..bf5fefcbb1fe 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/SentenceOrBuilder.java @@ -63,8 +63,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -77,8 +77,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; @@ -91,8 +91,8 @@ public interface SentenceOrBuilder * *
    * For calls to [AnalyzeSentiment][] or if
-   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
-   * true, this field will contain the sentiment for the sentence.
+   * [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
+   * is set to true, this field will contain the sentiment for the sentence.
    * 
* * .google.cloud.language.v1.Sentiment sentiment = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java index 8f4dd26947ed..78b8aa144147 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpan.java @@ -174,7 +174,9 @@ public com.google.protobuf.ByteString getContentBytes() { * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+   * document according to the
+   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+   * request.
    * 
* * int32 begin_offset = 2; @@ -627,7 +629,9 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; @@ -643,7 +647,9 @@ public int getBeginOffset() { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; @@ -662,7 +668,9 @@ public Builder setBeginOffset(int value) { * *
      * The API calculates the beginning offset of the content in the original
-     * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+     * document according to the
+     * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+     * request.
      * 
* * int32 begin_offset = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java index 6f39dd71419f..789ce7a8ffd7 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1/src/main/java/com/google/cloud/language/v1/TextSpanOrBuilder.java @@ -53,7 +53,9 @@ public interface TextSpanOrBuilder * *
    * The API calculates the beginning offset of the content in the original
-   * document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
+   * document according to the
+   * [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
+   * request.
    * 
* * int32 begin_offset = 2; diff --git a/java-language/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto b/java-language/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto index 304eab073a33..06c68a279355 100644 --- a/java-language/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto +++ b/java-language/proto-google-cloud-language-v1/src/main/proto/google/cloud/language/v1/language_service.proto @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -26,16 +25,17 @@ option java_multiple_files = true; option java_outer_classname = "LanguageServiceProto"; option java_package = "com.google.cloud.language.v1"; - // Provides text analysis operations such as sentiment analysis and entity // recognition. service LanguageService { option (google.api.default_host) = "language.googleapis.com"; option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-language," - "https://www.googleapis.com/auth/cloud-platform"; + "https://www.googleapis.com/auth/cloud-language," + "https://www.googleapis.com/auth/cloud-platform"; + // Analyzes the sentiment of the provided text. - rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) { + rpc AnalyzeSentiment(AnalyzeSentimentRequest) + returns (AnalyzeSentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeSentiment" body: "*" @@ -47,7 +47,8 @@ service LanguageService { // Finds named entities (currently proper names and common nouns) in the text // along with entity types, salience, mentions for each entity, and // other properties. - rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) { + rpc AnalyzeEntities(AnalyzeEntitiesRequest) + returns (AnalyzeEntitiesResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntities" body: "*" @@ -56,9 +57,12 @@ service LanguageService { option (google.api.method_signature) = "document"; } - // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes - // sentiment associated with each entity and its mentions. - rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) { + // Finds entities, similar to + // [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] + // in the text and analyzes sentiment associated with each entity and its + // mentions. + rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) + returns (AnalyzeEntitySentimentResponse) { option (google.api.http) = { post: "/v1/documents:analyzeEntitySentiment" body: "*" @@ -100,7 +104,7 @@ service LanguageService { } } - +// ################################################################ # // // Represents the input to API methods. message Document { @@ -151,11 +155,37 @@ message Sentence { TextSpan text = 1; // For calls to [AnalyzeSentiment][] or if - // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to - // true, this field will contain the sentiment for the sentence. + // [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] + // is set to true, this field will contain the sentiment for the sentence. Sentiment sentiment = 2; } +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + // Represents a phrase in the text that is a known entity, such as // a person, an organization, or location. The API associates information, such // as salience and mentions, with entities. @@ -189,44 +219,53 @@ message Entity { // Other types of entities OTHER = 7; - // Phone number

+ // Phone number + // // The metadata lists the phone number, formatted according to local - // convention, plus whichever additional elements appear in the text:
    - //
  • number – the actual number, broken down into - // sections as per local convention
  • national_prefix - // – country code, if detected
  • area_code – - // region or area code, if detected
  • extension – - // phone extension (to be dialed after connection), if detected
+ // convention, plus whichever additional elements appear in the text: + // + // * `number` - the actual number, broken down into sections as per local + // convention + // * `national_prefix` - country code, if detected + // * `area_code` - region or area code, if detected + // * `extension` - phone extension (to be dialed after connection), if + // detected PHONE_NUMBER = 9; - // Address

+ // Address + // // The metadata identifies the street number and locality plus whichever - // additional elements appear in the text:
    - //
  • street_number – street number
  • - //
  • locality – city or town
  • - //
  • street_name – street/route name, if detected
  • - //
  • postal_code – postal code, if detected
  • - //
  • country – country, if detected
  • - //
  • broad_region – administrative area, such as the - // state, if detected
  • narrow_region – smaller - // administrative area, such as county, if detected
  • - //
  • sublocality – used in Asian addresses to demark a - // district within a city, if detected
+ // additional elements appear in the text: + // + // * `street_number` - street number + // * `locality` - city or town + // * `street_name` - street/route name, if detected + // * `postal_code` - postal code, if detected + // * `country` - country, if detected< + // * `broad_region` - administrative area, such as the state, if detected + // * `narrow_region` - smaller administrative area, such as county, if + // detected + // * `sublocality` - used in Asian addresses to demark a district within a + // city, if detected ADDRESS = 10; - // Date

- // The metadata identifies the components of the date:
    - //
  • year – four digit year, if detected
  • - //
  • month – two digit month number, if detected
  • - //
  • day – two digit day number, if detected
+ // Date + // + // The metadata identifies the components of the date: + // + // * `year` - four digit year, if detected + // * `month` - two digit month number, if detected + // * `day` - two digit day number, if detected DATE = 11; - // Number

+ // Number + // // The metadata is the number itself. NUMBER = 12; - // Price

- // The metadata identifies the value and currency. + // Price + // + // The metadata identifies the `value` and `currency`. PRICE = 13; } @@ -256,38 +295,12 @@ message Entity { repeated EntityMention mentions = 5; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the aggregate sentiment expressed for this - // entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the aggregate sentiment expressed + // for this entity in the provided document. Sentiment sentiment = 6; } -// Represents the text encoding that the caller uses to process the output. -// Providing an `EncodingType` is recommended because the API provides the -// beginning offsets for various outputs, such as tokens and mentions, and -// languages that natively use different text encodings may access offsets -// differently. -enum EncodingType { - // If `EncodingType` is not specified, encoding-dependent information (such as - // `begin_offset`) will be set at `-1`. - NONE = 0; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-8 encoding of the input. C++ and Go are examples of languages - // that use this encoding natively. - UTF8 = 1; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-16 encoding of the input. Java and JavaScript are examples of - // languages that use this encoding natively. - UTF16 = 2; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-32 encoding of the input. Python is an example of a language - // that uses this encoding natively. - UTF32 = 3; -} - // Represents the smallest syntactic building block of the text. message Token { // The token text. @@ -935,9 +948,9 @@ message EntityMention { Type type = 2; // For calls to [AnalyzeEntitySentiment][] or if - // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to - // true, this field will contain the sentiment expressed for this mention of - // the entity in the provided document. + // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] + // is set to true, this field will contain the sentiment expressed for this + // mention of the entity in the provided document. Sentiment sentiment = 3; } @@ -947,7 +960,9 @@ message TextSpan { string content = 1; // The API calculates the beginning offset of the content in the original - // document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request. + // document according to the + // [EncodingType][google.cloud.language.v1.EncodingType] specified in the API + // request. int32 begin_offset = 2; } @@ -962,9 +977,46 @@ message ClassificationCategory { float confidence = 2; } +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model {} + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + // The sentiment analysis request message. message AnalyzeSentimentRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate sentence offsets. @@ -978,7 +1030,8 @@ message AnalyzeSentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; // The sentiment for all the sentences in the document. @@ -987,7 +1040,7 @@ message AnalyzeSentimentResponse { // The entity-level sentiment analysis request message. message AnalyzeEntitySentimentRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1001,13 +1054,14 @@ message AnalyzeEntitySentimentResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; } // The entity analysis request message. message AnalyzeEntitiesRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1021,13 +1075,14 @@ message AnalyzeEntitiesResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 2; } // The syntax analysis request message. message AnalyzeSyntaxRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1044,14 +1099,19 @@ message AnalyzeSyntaxResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 3; } // The document classification request message. message ClassifyTextRequest { - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; } // The document classification response message. @@ -1080,12 +1140,16 @@ message AnnotateTextRequest { // Classify the full document into categories. bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; } - // Input document. + // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; - // The enabled features. + // Required. The enabled features. Features features = 2 [(google.api.field_behavior) = REQUIRED]; // The encoding type used by the API to calculate offsets. @@ -1114,7 +1178,8 @@ message AnnotateTextResponse { // The language of the text, which will be the same as the language specified // in the request or, if not specified, the automatically-detected language. - // See [Document.language][google.cloud.language.v1.Document.language] field for more details. + // See [Document.language][google.cloud.language.v1.Document.language] field + // for more details. string language = 5; // Categories identified in the input document. diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java index 2cb17b946f0a..2da5e0d941ab 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/AnnotateTextRequest.java @@ -220,6 +220,51 @@ public interface FeaturesOrBuilder * @return The classifyText. */ boolean getClassifyText(); + + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } /** * @@ -227,7 +272,7 @@ public interface FeaturesOrBuilder *
    * All available features for sentiment, syntax, and semantic analysis.
    * Setting each one to true will enable that specific analysis for the input.
-   * Next ID: 10
+   * Next ID: 11
    * 
* * Protobuf type {@code google.cloud.language.v1beta2.AnnotateTextRequest.Features} @@ -296,6 +341,24 @@ private Features( case 48: { classifyText_ = input.readBool(); + break; + } + case 82: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = + null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -427,6 +490,66 @@ public boolean getClassifyText() { return classifyText_; } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 10; + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+     * The model options to use for classification. Defaults to v1 options
+     * if not specified. Only used if `classify_text` is set to true.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -456,6 +579,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (classifyText_ != false) { output.writeBool(6, classifyText_); } + if (classificationModelOptions_ != null) { + output.writeMessage(10, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -480,6 +606,11 @@ public int getSerializedSize() { if (classifyText_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, classifyText_); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -501,6 +632,11 @@ public boolean equals(final java.lang.Object obj) { if (getExtractDocumentSentiment() != other.getExtractDocumentSentiment()) return false; if (getExtractEntitySentiment() != other.getExtractEntitySentiment()) return false; if (getClassifyText() != other.getClassifyText()) return false; + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -522,6 +658,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getExtractEntitySentiment()); hash = (37 * hash) + CLASSIFY_TEXT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClassifyText()); + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -630,7 +770,7 @@ protected Builder newBuilderForType( *
      * All available features for sentiment, syntax, and semantic analysis.
      * Setting each one to true will enable that specific analysis for the input.
-     * Next ID: 10
+     * Next ID: 11
      * 
* * Protobuf type {@code google.cloud.language.v1beta2.AnnotateTextRequest.Features} @@ -682,6 +822,12 @@ public Builder clear() { classifyText_ = false; + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -715,6 +861,11 @@ public com.google.cloud.language.v1beta2.AnnotateTextRequest.Features buildParti result.extractDocumentSentiment_ = extractDocumentSentiment_; result.extractEntitySentiment_ = extractEntitySentiment_; result.classifyText_ = classifyText_; + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -784,6 +935,9 @@ public Builder mergeFrom( if (other.getClassifyText() != false) { setClassifyText(other.getClassifyText()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1084,6 +1238,226 @@ public Builder clearClassifyText() { return this; } + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+       * The model options to use for classification. Defaults to v1 options
+       * if not specified. Only used if `classify_text` is set to true.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 10; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java new file mode 100644 index 000000000000..739ab38295d3 --- /dev/null +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptions.java @@ -0,0 +1,2540 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/language/v1beta2/language_service.proto + +package com.google.cloud.language.v1beta2; + +/** + * + * + *
+ * Model options available for classification requests.
+ * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions} + */ +public final class ClassificationModelOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions) + ClassificationModelOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassificationModelOptions.newBuilder() to construct. + private ClassificationModelOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ClassificationModelOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ClassificationModelOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ClassificationModelOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + subBuilder = null; + if (modelTypeCase_ == 1) { + subBuilder = + ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 1; + break; + } + case 18: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + subBuilder = null; + if (modelTypeCase_ == 2) { + subBuilder = + ((com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_) + .toBuilder(); + } + modelType_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_); + modelType_ = subBuilder.buildPartial(); + } + modelTypeCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder.class); + } + + public interface V1ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Options for the V1 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} + */ + public static final class V1Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + V1ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V1Model.newBuilder() to construct. + private V1Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V1Model() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V1Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V1Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Options for the V1 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V1Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) { + return mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V1Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V1Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface V2ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + int getContentCategoriesVersionValue(); + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + getContentCategoriesVersion(); + } + /** + * + * + *
+   * Options for the V2 model.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} + */ + public static final class V2Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + V2ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use V2Model.newBuilder() to construct. + private V2Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private V2Model() { + contentCategoriesVersion_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new V2Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private V2Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + contentCategoriesVersion_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder.class); + } + + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion} + */ + public enum ContentCategoriesVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + CONTENT_CATEGORIES_VERSION_UNSPECIFIED(0), + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + V1(1), + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + V2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * If `ContentCategoriesVersion` is not specified, this option will
+       * default to `V1`.
+       * 
+ * + * CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + */ + public static final int CONTENT_CATEGORIES_VERSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Legacy content categories of our initial launch in 2017.
+       * 
+ * + * V1 = 1; + */ + public static final int V1_VALUE = 1; + /** + * + * + *
+       * Updated content categories in 2022.
+       * 
+ * + * V2 = 2; + */ + public static final int V2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCategoriesVersion valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ContentCategoriesVersion forNumber(int value) { + switch (value) { + case 0: + return CONTENT_CATEGORIES_VERSION_UNSPECIFIED; + case 1: + return V1; + case 2: + return V2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentCategoriesVersion findValueByNumber(int number) { + return ContentCategoriesVersion.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ContentCategoriesVersion[] VALUES = values(); + + public static ContentCategoriesVersion valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentCategoriesVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion) + } + + public static final int CONTENT_CATEGORIES_VERSION_FIELD_NUMBER = 1; + private int contentCategoriesVersion_; + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+     * The content categories used for classification.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion + result = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCategoriesVersion_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, contentCategoriesVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCategoriesVersion_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.CONTENT_CATEGORIES_VERSION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentCategoriesVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) obj; + + if (contentCategoriesVersion_ != other.contentCategoriesVersion_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_CATEGORIES_VERSION_FIELD_NUMBER; + hash = (53 * hash) + contentCategoriesVersion_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Options for the V2 model.
+     * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions.V2Model} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder.class); + } + + // Construct using + // com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + contentCategoriesVersion_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(this); + result.contentCategoriesVersion_ = contentCategoriesVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) { + return mergeFrom( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance()) return this; + if (other.contentCategoriesVersion_ != 0) { + setContentCategoriesVersionValue(other.getContentCategoriesVersionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCategoriesVersion_ = 0; + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The enum numeric value on the wire for contentCategoriesVersion. + */ + @java.lang.Override + public int getContentCategoriesVersionValue() { + return contentCategoriesVersion_; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The enum numeric value on the wire for contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersionValue(int value) { + + contentCategoriesVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return The contentCategoriesVersion. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + getContentCategoriesVersion() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + result = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.valueOf(contentCategoriesVersion_); + return result == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @param value The contentCategoriesVersion to set. + * @return This builder for chaining. + */ + public Builder setContentCategoriesVersion( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .ContentCategoriesVersion + value) { + if (value == null) { + throw new NullPointerException(); + } + + contentCategoriesVersion_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The content categories used for classification.
+       * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion content_categories_version = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearContentCategoriesVersion() { + + contentCategoriesVersion_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public V2Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new V2Model(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public enum ModelTypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + V1_MODEL(1), + V2_MODEL(2), + MODELTYPE_NOT_SET(0); + private final int value; + + private ModelTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ModelTypeCase valueOf(int value) { + return forNumber(value); + } + + public static ModelTypeCase forNumber(int value) { + switch (value) { + case 1: + return V1_MODEL; + case 2: + return V2_MODEL; + case 0: + return MODELTYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public static final int V1_MODEL_FIELD_NUMBER = 1; + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + + public static final int V2_MODEL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (modelTypeCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (modelTypeCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_); + } + if (modelTypeCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions)) { + return super.equals(obj); + } + com.google.cloud.language.v1beta2.ClassificationModelOptions other = + (com.google.cloud.language.v1beta2.ClassificationModelOptions) obj; + + if (!getModelTypeCase().equals(other.getModelTypeCase())) return false; + switch (modelTypeCase_) { + case 1: + if (!getV1Model().equals(other.getV1Model())) return false; + break; + case 2: + if (!getV2Model().equals(other.getV2Model())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (modelTypeCase_) { + case 1: + hash = (37 * hash) + V1_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV1Model().hashCode(); + break; + case 2: + hash = (37 * hash) + V2_MODEL_FIELD_NUMBER; + hash = (53 * hash) + getV2Model().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.language.v1beta2.ClassificationModelOptions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Model options available for classification requests.
+   * 
+ * + * Protobuf type {@code google.cloud.language.v1beta2.ClassificationModelOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.language.v1beta2.ClassificationModelOptions) + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.language.v1beta2.ClassificationModelOptions.class, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder.class); + } + + // Construct using com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + modelTypeCase_ = 0; + modelType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.language.v1beta2.LanguageServiceProto + .internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getDefaultInstanceForType() { + return com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions build() { + com.google.cloud.language.v1beta2.ClassificationModelOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions buildPartial() { + com.google.cloud.language.v1beta2.ClassificationModelOptions result = + new com.google.cloud.language.v1beta2.ClassificationModelOptions(this); + if (modelTypeCase_ == 1) { + if (v1ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v1ModelBuilder_.build(); + } + } + if (modelTypeCase_ == 2) { + if (v2ModelBuilder_ == null) { + result.modelType_ = modelType_; + } else { + result.modelType_ = v2ModelBuilder_.build(); + } + } + result.modelTypeCase_ = modelTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.language.v1beta2.ClassificationModelOptions) { + return mergeFrom((com.google.cloud.language.v1beta2.ClassificationModelOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassificationModelOptions other) { + if (other + == com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance()) + return this; + switch (other.getModelTypeCase()) { + case V1_MODEL: + { + mergeV1Model(other.getV1Model()); + break; + } + case V2_MODEL: + { + mergeV2Model(other.getV2Model()); + break; + } + case MODELTYPE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.language.v1beta2.ClassificationModelOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.language.v1beta2.ClassificationModelOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int modelTypeCase_ = 0; + private java.lang.Object modelType_; + + public ModelTypeCase getModelTypeCase() { + return ModelTypeCase.forNumber(modelTypeCase_); + } + + public Builder clearModelType() { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder> + v1ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + @java.lang.Override + public boolean hasV1Model() { + return modelTypeCase_ == 1; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } else { + if (modelTypeCase_ == 1) { + return v1ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v1ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder setV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + builderForValue) { + if (v1ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v1ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder mergeV1Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model value) { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1 + && modelType_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.newBuilder( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) + modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 1) { + v1ModelBuilder_.mergeFrom(value); + } else { + v1ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 1; + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public Builder clearV1Model() { + if (v1ModelBuilder_ == null) { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 1) { + modelTypeCase_ = 0; + modelType_ = null; + } + v1ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder + getV1ModelBuilder() { + return getV1ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder() { + if ((modelTypeCase_ == 1) && (v1ModelBuilder_ != null)) { + return v1ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 1) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V1 model and V1 content categories
+     * version. The V1 model is a legacy model; support for this will be
+     * discontinued in the future.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder> + getV1ModelFieldBuilder() { + if (v1ModelBuilder_ == null) { + if (!(modelTypeCase_ == 1)) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model + .getDefaultInstance(); + } + v1ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder>( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 1; + onChanged(); + ; + return v1ModelBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder> + v2ModelBuilder_; + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + @java.lang.Override + public boolean hasV2Model() { + return modelTypeCase_ == 2; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } else { + if (modelTypeCase_ == 2) { + return v2ModelBuilder_.getMessage(); + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + modelType_ = value; + onChanged(); + } else { + v2ModelBuilder_.setMessage(value); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder setV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + builderForValue) { + if (v2ModelBuilder_ == null) { + modelType_ = builderForValue.build(); + onChanged(); + } else { + v2ModelBuilder_.setMessage(builderForValue.build()); + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder mergeV2Model( + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model value) { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2 + && modelType_ + != com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance()) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.newBuilder( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) + modelType_) + .mergeFrom(value) + .buildPartial(); + } else { + modelType_ = value; + } + onChanged(); + } else { + if (modelTypeCase_ == 2) { + v2ModelBuilder_.mergeFrom(value); + } else { + v2ModelBuilder_.setMessage(value); + } + } + modelTypeCase_ = 2; + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public Builder clearV2Model() { + if (v2ModelBuilder_ == null) { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + onChanged(); + } + } else { + if (modelTypeCase_ == 2) { + modelTypeCase_ = 0; + modelType_ = null; + } + v2ModelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder + getV2ModelBuilder() { + return getV2ModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder() { + if ((modelTypeCase_ == 2) && (v2ModelBuilder_ != null)) { + return v2ModelBuilder_.getMessageOrBuilder(); + } else { + if (modelTypeCase_ == 2) { + return (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_; + } + return com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Setting this field will use the V2 model with the appropriate content
+     * categories version. The V2 model is a better performing model.
+     * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder> + getV2ModelFieldBuilder() { + if (v2ModelBuilder_ == null) { + if (!(modelTypeCase_ == 2)) { + modelType_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model + .getDefaultInstance(); + } + v2ModelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder>( + (com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model) modelType_, + getParentForChildren(), + isClean()); + modelType_ = null; + } + modelTypeCase_ = 2; + onChanged(); + ; + return v2ModelBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.language.v1beta2.ClassificationModelOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.language.v1beta2.ClassificationModelOptions) + private static final com.google.cloud.language.v1beta2.ClassificationModelOptions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.language.v1beta2.ClassificationModelOptions(); + } + + public static com.google.cloud.language.v1beta2.ClassificationModelOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassificationModelOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassificationModelOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java new file mode 100644 index 000000000000..013c953a07ea --- /dev/null +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassificationModelOptionsOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/language/v1beta2/language_service.proto + +package com.google.cloud.language.v1beta2; + +public interface ClassificationModelOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.language.v1beta2.ClassificationModelOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return Whether the v1Model field is set. + */ + boolean hasV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + * + * @return The v1Model. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1Model getV1Model(); + /** + * + * + *
+   * Setting this field will use the V1 model and V1 content categories
+   * version. The V1 model is a legacy model; support for this will be
+   * discontinued in the future.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V1Model v1_model = 1; + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelOrBuilder + getV1ModelOrBuilder(); + + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return Whether the v2Model field is set. + */ + boolean hasV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + * + * @return The v2Model. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model getV2Model(); + /** + * + * + *
+   * Setting this field will use the V2 model with the appropriate content
+   * categories version. The V2 model is a better performing model.
+   * 
+ * + * .google.cloud.language.v1beta2.ClassificationModelOptions.V2Model v2_model = 2; + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelOrBuilder + getV2ModelOrBuilder(); + + public com.google.cloud.language.v1beta2.ClassificationModelOptions.ModelTypeCase + getModelTypeCase(); +} diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java index 9844702c411d..ced49eae706e 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequest.java @@ -82,6 +82,24 @@ private ClassifyTextRequest( document_ = subBuilder.buildPartial(); } + break; + } + case 26: + { + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder subBuilder = + null; + if (classificationModelOptions_ != null) { + subBuilder = classificationModelOptions_.toBuilder(); + } + classificationModelOptions_ = + input.readMessage( + com.google.cloud.language.v1beta2.ClassificationModelOptions.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(classificationModelOptions_); + classificationModelOptions_ = subBuilder.buildPartial(); + } + break; } default: @@ -174,6 +192,65 @@ public com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder( return getDocument(); } + public static final int CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER = 3; + private com.google.cloud.language.v1beta2.ClassificationModelOptions classificationModelOptions_; + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + @java.lang.Override + public boolean hasClassificationModelOptions() { + return classificationModelOptions_ != null; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + return getClassificationModelOptions(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -191,6 +268,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (document_ != null) { output.writeMessage(1, getDocument()); } + if (classificationModelOptions_ != null) { + output.writeMessage(3, getClassificationModelOptions()); + } unknownFields.writeTo(output); } @@ -203,6 +283,11 @@ public int getSerializedSize() { if (document_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDocument()); } + if (classificationModelOptions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getClassificationModelOptions()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -223,6 +308,11 @@ public boolean equals(final java.lang.Object obj) { if (hasDocument()) { if (!getDocument().equals(other.getDocument())) return false; } + if (hasClassificationModelOptions() != other.hasClassificationModelOptions()) return false; + if (hasClassificationModelOptions()) { + if (!getClassificationModelOptions().equals(other.getClassificationModelOptions())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -238,6 +328,10 @@ public int hashCode() { hash = (37 * hash) + DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getDocument().hashCode(); } + if (hasClassificationModelOptions()) { + hash = (37 * hash) + CLASSIFICATION_MODEL_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getClassificationModelOptions().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -390,6 +484,12 @@ public Builder clear() { document_ = null; documentBuilder_ = null; } + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } return this; } @@ -422,6 +522,11 @@ public com.google.cloud.language.v1beta2.ClassifyTextRequest buildPartial() { } else { result.document_ = documentBuilder_.build(); } + if (classificationModelOptionsBuilder_ == null) { + result.classificationModelOptions_ = classificationModelOptions_; + } else { + result.classificationModelOptions_ = classificationModelOptionsBuilder_.build(); + } onBuilt(); return result; } @@ -475,6 +580,9 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.ClassifyTextRequest o if (other.hasDocument()) { mergeDocument(other.getDocument()); } + if (other.hasClassificationModelOptions()) { + mergeClassificationModelOptions(other.getClassificationModelOptions()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -708,6 +816,226 @@ public com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder( return documentBuilder_; } + private com.google.cloud.language.v1beta2.ClassificationModelOptions + classificationModelOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + classificationModelOptionsBuilder_; + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + public boolean hasClassificationModelOptions() { + return classificationModelOptionsBuilder_ != null || classificationModelOptions_ != null; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions + getClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } else { + return classificationModelOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + classificationModelOptions_ = value; + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder setClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder builderForValue) { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = builderForValue.build(); + onChanged(); + } else { + classificationModelOptionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder mergeClassificationModelOptions( + com.google.cloud.language.v1beta2.ClassificationModelOptions value) { + if (classificationModelOptionsBuilder_ == null) { + if (classificationModelOptions_ != null) { + classificationModelOptions_ = + com.google.cloud.language.v1beta2.ClassificationModelOptions.newBuilder( + classificationModelOptions_) + .mergeFrom(value) + .buildPartial(); + } else { + classificationModelOptions_ = value; + } + onChanged(); + } else { + classificationModelOptionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public Builder clearClassificationModelOptions() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptions_ = null; + onChanged(); + } else { + classificationModelOptions_ = null; + classificationModelOptionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder + getClassificationModelOptionsBuilder() { + + onChanged(); + return getClassificationModelOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + public com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder() { + if (classificationModelOptionsBuilder_ != null) { + return classificationModelOptionsBuilder_.getMessageOrBuilder(); + } else { + return classificationModelOptions_ == null + ? com.google.cloud.language.v1beta2.ClassificationModelOptions.getDefaultInstance() + : classificationModelOptions_; + } + } + /** + * + * + *
+     * Model options to use for classification. Defaults to v1 options if not
+     * specified.
+     * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder> + getClassificationModelOptionsFieldBuilder() { + if (classificationModelOptionsBuilder_ == null) { + classificationModelOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.language.v1beta2.ClassificationModelOptions, + com.google.cloud.language.v1beta2.ClassificationModelOptions.Builder, + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder>( + getClassificationModelOptions(), getParentForChildren(), isClean()); + classificationModelOptions_ = null; + } + return classificationModelOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java index fd30bacb0f59..90c86000330a 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/ClassifyTextRequestOrBuilder.java @@ -63,4 +63,49 @@ public interface ClassifyTextRequestOrBuilder *
*/ com.google.cloud.language.v1beta2.DocumentOrBuilder getDocumentOrBuilder(); + + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return Whether the classificationModelOptions field is set. + */ + boolean hasClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + * + * @return The classificationModelOptions. + */ + com.google.cloud.language.v1beta2.ClassificationModelOptions getClassificationModelOptions(); + /** + * + * + *
+   * Model options to use for classification. Defaults to v1 options if not
+   * specified.
+   * 
+ * + * + * .google.cloud.language.v1beta2.ClassificationModelOptions classification_model_options = 3; + * + */ + com.google.cloud.language.v1beta2.ClassificationModelOptionsOrBuilder + getClassificationModelOptionsOrBuilder(); } diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java index c77979e93bcf..ad769f875742 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/Document.java @@ -22,6 +22,7 @@ * * *
+ * ################################################################ #
  * Represents the input to API methods.
  * 
* @@ -40,6 +41,8 @@ private Document(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Document() { type_ = 0; language_ = ""; + referenceWebUri_ = ""; + boilerplateHandling_ = 0; } @java.lang.Override @@ -99,6 +102,20 @@ private Document( language_ = s; break; } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + referenceWebUri_ = s; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + boilerplateHandling_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -292,6 +309,168 @@ private Type(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.Document.Type) } + /** + * + * + *
+   * Ways of handling boilerplate detected in the document
+   * 
+ * + * Protobuf enum {@code google.cloud.language.v1beta2.Document.BoilerplateHandling} + */ + public enum BoilerplateHandling implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The boilerplate handling is not specified.
+     * 
+ * + * BOILERPLATE_HANDLING_UNSPECIFIED = 0; + */ + BOILERPLATE_HANDLING_UNSPECIFIED(0), + /** + * + * + *
+     * Do not analyze detected boilerplate. Reference web URI is required for
+     * detecting boilerplate.
+     * 
+ * + * SKIP_BOILERPLATE = 1; + */ + SKIP_BOILERPLATE(1), + /** + * + * + *
+     * Treat boilerplate the same as content.
+     * 
+ * + * KEEP_BOILERPLATE = 2; + */ + KEEP_BOILERPLATE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The boilerplate handling is not specified.
+     * 
+ * + * BOILERPLATE_HANDLING_UNSPECIFIED = 0; + */ + public static final int BOILERPLATE_HANDLING_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not analyze detected boilerplate. Reference web URI is required for
+     * detecting boilerplate.
+     * 
+ * + * SKIP_BOILERPLATE = 1; + */ + public static final int SKIP_BOILERPLATE_VALUE = 1; + /** + * + * + *
+     * Treat boilerplate the same as content.
+     * 
+ * + * KEEP_BOILERPLATE = 2; + */ + public static final int KEEP_BOILERPLATE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static BoilerplateHandling valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static BoilerplateHandling forNumber(int value) { + switch (value) { + case 0: + return BOILERPLATE_HANDLING_UNSPECIFIED; + case 1: + return SKIP_BOILERPLATE; + case 2: + return KEEP_BOILERPLATE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BoilerplateHandling findValueByNumber(int number) { + return BoilerplateHandling.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.language.v1beta2.Document.getDescriptor().getEnumTypes().get(1); + } + + private static final BoilerplateHandling[] VALUES = values(); + + public static BoilerplateHandling valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private BoilerplateHandling(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.language.v1beta2.Document.BoilerplateHandling) + } + private int sourceCase_ = 0; private java.lang.Object source_; @@ -592,6 +771,102 @@ public com.google.protobuf.ByteString getLanguageBytes() { } } + public static final int REFERENCE_WEB_URI_FIELD_NUMBER = 5; + private volatile java.lang.Object referenceWebUri_; + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + @java.lang.Override + public java.lang.String getReferenceWebUri() { + java.lang.Object ref = referenceWebUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceWebUri_ = s; + return s; + } + } + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReferenceWebUriBytes() { + java.lang.Object ref = referenceWebUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceWebUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOILERPLATE_HANDLING_FIELD_NUMBER = 6; + private int boilerplateHandling_; + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + @java.lang.Override + public int getBoilerplateHandlingValue() { + return boilerplateHandling_; + } + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.Document.BoilerplateHandling result = + com.google.cloud.language.v1beta2.Document.BoilerplateHandling.valueOf( + boilerplateHandling_); + return result == null + ? com.google.cloud.language.v1beta2.Document.BoilerplateHandling.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -618,6 +893,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, language_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceWebUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, referenceWebUri_); + } + if (boilerplateHandling_ + != com.google.cloud.language.v1beta2.Document.BoilerplateHandling + .BOILERPLATE_HANDLING_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, boilerplateHandling_); + } unknownFields.writeTo(output); } @@ -639,6 +923,15 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(language_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, language_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceWebUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, referenceWebUri_); + } + if (boilerplateHandling_ + != com.google.cloud.language.v1beta2.Document.BoilerplateHandling + .BOILERPLATE_HANDLING_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, boilerplateHandling_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -657,6 +950,8 @@ public boolean equals(final java.lang.Object obj) { if (type_ != other.type_) return false; if (!getLanguage().equals(other.getLanguage())) return false; + if (!getReferenceWebUri().equals(other.getReferenceWebUri())) return false; + if (boilerplateHandling_ != other.boilerplateHandling_) return false; if (!getSourceCase().equals(other.getSourceCase())) return false; switch (sourceCase_) { case 2: @@ -683,6 +978,10 @@ public int hashCode() { hash = (53 * hash) + type_; hash = (37 * hash) + LANGUAGE_FIELD_NUMBER; hash = (53 * hash) + getLanguage().hashCode(); + hash = (37 * hash) + REFERENCE_WEB_URI_FIELD_NUMBER; + hash = (53 * hash) + getReferenceWebUri().hashCode(); + hash = (37 * hash) + BOILERPLATE_HANDLING_FIELD_NUMBER; + hash = (53 * hash) + boilerplateHandling_; switch (sourceCase_) { case 2: hash = (37 * hash) + CONTENT_FIELD_NUMBER; @@ -799,6 +1098,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
+   * ################################################################ #
    * Represents the input to API methods.
    * 
* @@ -844,6 +1144,10 @@ public Builder clear() { language_ = ""; + referenceWebUri_ = ""; + + boilerplateHandling_ = 0; + sourceCase_ = 0; source_ = null; return this; @@ -881,6 +1185,8 @@ public com.google.cloud.language.v1beta2.Document buildPartial() { result.source_ = source_; } result.language_ = language_; + result.referenceWebUri_ = referenceWebUri_; + result.boilerplateHandling_ = boilerplateHandling_; result.sourceCase_ = sourceCase_; onBuilt(); return result; @@ -938,6 +1244,13 @@ public Builder mergeFrom(com.google.cloud.language.v1beta2.Document other) { language_ = other.language_; onChanged(); } + if (!other.getReferenceWebUri().isEmpty()) { + referenceWebUri_ = other.referenceWebUri_; + onChanged(); + } + if (other.boilerplateHandling_ != 0) { + setBoilerplateHandlingValue(other.getBoilerplateHandlingValue()); + } switch (other.getSourceCase()) { case CONTENT: { @@ -1530,6 +1843,227 @@ public Builder setLanguageBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object referenceWebUri_ = ""; + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + public java.lang.String getReferenceWebUri() { + java.lang.Object ref = referenceWebUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referenceWebUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + public com.google.protobuf.ByteString getReferenceWebUriBytes() { + java.lang.Object ref = referenceWebUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + referenceWebUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @param value The referenceWebUri to set. + * @return This builder for chaining. + */ + public Builder setReferenceWebUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referenceWebUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearReferenceWebUri() { + + referenceWebUri_ = getDefaultInstance().getReferenceWebUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The web URI where the document comes from. This URI is not used for
+     * fetching the content, but as a hint for analyzing the document.
+     * 
+ * + * string reference_web_uri = 5; + * + * @param value The bytes for referenceWebUri to set. + * @return This builder for chaining. + */ + public Builder setReferenceWebUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referenceWebUri_ = value; + onChanged(); + return this; + } + + private int boilerplateHandling_ = 0; + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + @java.lang.Override + public int getBoilerplateHandlingValue() { + return boilerplateHandling_; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @param value The enum numeric value on the wire for boilerplateHandling to set. + * @return This builder for chaining. + */ + public Builder setBoilerplateHandlingValue(int value) { + + boilerplateHandling_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + @java.lang.Override + public com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling() { + @SuppressWarnings("deprecation") + com.google.cloud.language.v1beta2.Document.BoilerplateHandling result = + com.google.cloud.language.v1beta2.Document.BoilerplateHandling.valueOf( + boilerplateHandling_); + return result == null + ? com.google.cloud.language.v1beta2.Document.BoilerplateHandling.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @param value The boilerplateHandling to set. + * @return This builder for chaining. + */ + public Builder setBoilerplateHandling( + com.google.cloud.language.v1beta2.Document.BoilerplateHandling value) { + if (value == null) { + throw new NullPointerException(); + } + + boilerplateHandling_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates how detected boilerplate(e.g. advertisements, copyright
+     * declarations, banners) should be handled for this document. If not
+     * specified, boilerplate will be treated the same as content.
+     * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return This builder for chaining. + */ + public Builder clearBoilerplateHandling() { + + boilerplateHandling_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java index 09bf845db0c7..88d2576bcc9e 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/DocumentOrBuilder.java @@ -175,5 +175,63 @@ public interface DocumentOrBuilder */ com.google.protobuf.ByteString getLanguageBytes(); + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The referenceWebUri. + */ + java.lang.String getReferenceWebUri(); + /** + * + * + *
+   * The web URI where the document comes from. This URI is not used for
+   * fetching the content, but as a hint for analyzing the document.
+   * 
+ * + * string reference_web_uri = 5; + * + * @return The bytes for referenceWebUri. + */ + com.google.protobuf.ByteString getReferenceWebUriBytes(); + + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The enum numeric value on the wire for boilerplateHandling. + */ + int getBoilerplateHandlingValue(); + /** + * + * + *
+   * Indicates how detected boilerplate(e.g. advertisements, copyright
+   * declarations, banners) should be handled for this document. If not
+   * specified, boilerplate will be treated the same as content.
+   * 
+ * + * .google.cloud.language.v1beta2.Document.BoilerplateHandling boilerplate_handling = 6; + * + * + * @return The boilerplateHandling. + */ + com.google.cloud.language.v1beta2.Document.BoilerplateHandling getBoilerplateHandling(); + public com.google.cloud.language.v1beta2.Document.SourceCase getSourceCase(); } diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java index 9a8e9ec754a3..4086c793ab24 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/java/com/google/cloud/language/v1beta2/LanguageServiceProto.java @@ -71,6 +71,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_language_v1beta2_ClassificationCategory_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_language_v1beta2_ClassificationCategory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -136,218 +148,240 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "_service.proto\022\035google.cloud.language.v1" + "beta2\032\034google/api/annotations.proto\032\027goo" + "gle/api/client.proto\032\037google/api/field_b" - + "ehavior.proto\"\310\001\n\010Document\022:\n\004type\030\001 \001(\016" + + "ehavior.proto\"\247\003\n\010Document\022:\n\004type\030\001 \001(\016" + "2,.google.cloud.language.v1beta2.Documen" + "t.Type\022\021\n\007content\030\002 \001(\tH\000\022\031\n\017gcs_content" - + "_uri\030\003 \001(\tH\000\022\020\n\010language\030\004 \001(\t\"6\n\004Type\022\024" - + "\n\020TYPE_UNSPECIFIED\020\000\022\016\n\nPLAIN_TEXT\020\001\022\010\n\004" - + "HTML\020\002B\010\n\006source\"~\n\010Sentence\0225\n\004text\030\001 \001" - + "(\0132\'.google.cloud.language.v1beta2.TextS" - + "pan\022;\n\tsentiment\030\002 \001(\0132(.google.cloud.la" - + "nguage.v1beta2.Sentiment\"\223\004\n\006Entity\022\014\n\004n" - + "ame\030\001 \001(\t\0228\n\004type\030\002 \001(\0162*.google.cloud.l" - + "anguage.v1beta2.Entity.Type\022E\n\010metadata\030" - + "\003 \003(\01323.google.cloud.language.v1beta2.En" - + "tity.MetadataEntry\022\020\n\010salience\030\004 \001(\002\022>\n\010" - + "mentions\030\005 \003(\0132,.google.cloud.language.v" - + "1beta2.EntityMention\022;\n\tsentiment\030\006 \001(\0132" - + "(.google.cloud.language.v1beta2.Sentimen" - + "t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"\271\001\n\004Type\022\013\n\007UNKNOWN\020\000\022\n\n\006PERS" - + "ON\020\001\022\014\n\010LOCATION\020\002\022\020\n\014ORGANIZATION\020\003\022\t\n\005" - + "EVENT\020\004\022\017\n\013WORK_OF_ART\020\005\022\021\n\rCONSUMER_GOO" - + "D\020\006\022\t\n\005OTHER\020\007\022\020\n\014PHONE_NUMBER\020\t\022\013\n\007ADDR" - + "ESS\020\n\022\010\n\004DATE\020\013\022\n\n\006NUMBER\020\014\022\t\n\005PRICE\020\r\"\332" - + "\001\n\005Token\0225\n\004text\030\001 \001(\0132\'.google.cloud.la" - + "nguage.v1beta2.TextSpan\022C\n\016part_of_speec" - + "h\030\002 \001(\0132+.google.cloud.language.v1beta2." - + "PartOfSpeech\022F\n\017dependency_edge\030\003 \001(\0132-." - + "google.cloud.language.v1beta2.Dependency" - + "Edge\022\r\n\005lemma\030\004 \001(\t\"-\n\tSentiment\022\021\n\tmagn" - + "itude\030\002 \001(\002\022\r\n\005score\030\003 \001(\002\"\337\020\n\014PartOfSpe" - + "ech\022<\n\003tag\030\001 \001(\0162/.google.cloud.language" - + ".v1beta2.PartOfSpeech.Tag\022B\n\006aspect\030\002 \001(" - + "\01622.google.cloud.language.v1beta2.PartOf" - + "Speech.Aspect\022>\n\004case\030\003 \001(\01620.google.clo" - + "ud.language.v1beta2.PartOfSpeech.Case\022>\n" - + "\004form\030\004 \001(\01620.google.cloud.language.v1be" - + "ta2.PartOfSpeech.Form\022B\n\006gender\030\005 \001(\01622." - + "google.cloud.language.v1beta2.PartOfSpee" - + "ch.Gender\022>\n\004mood\030\006 \001(\01620.google.cloud.l" - + "anguage.v1beta2.PartOfSpeech.Mood\022B\n\006num" - + "ber\030\007 \001(\01622.google.cloud.language.v1beta" - + "2.PartOfSpeech.Number\022B\n\006person\030\010 \001(\01622." - + "google.cloud.language.v1beta2.PartOfSpee" - + "ch.Person\022B\n\006proper\030\t \001(\01622.google.cloud" - + ".language.v1beta2.PartOfSpeech.Proper\022L\n" - + "\013reciprocity\030\n \001(\01627.google.cloud.langua" - + "ge.v1beta2.PartOfSpeech.Reciprocity\022@\n\005t" - + "ense\030\013 \001(\01621.google.cloud.language.v1bet" - + "a2.PartOfSpeech.Tense\022@\n\005voice\030\014 \001(\01621.g" - + "oogle.cloud.language.v1beta2.PartOfSpeec" - + "h.Voice\"\215\001\n\003Tag\022\013\n\007UNKNOWN\020\000\022\007\n\003ADJ\020\001\022\007\n" - + "\003ADP\020\002\022\007\n\003ADV\020\003\022\010\n\004CONJ\020\004\022\007\n\003DET\020\005\022\010\n\004NO" - + "UN\020\006\022\007\n\003NUM\020\007\022\010\n\004PRON\020\010\022\007\n\003PRT\020\t\022\t\n\005PUNC" - + "T\020\n\022\010\n\004VERB\020\013\022\005\n\001X\020\014\022\t\n\005AFFIX\020\r\"O\n\006Aspec" - + "t\022\022\n\016ASPECT_UNKNOWN\020\000\022\016\n\nPERFECTIVE\020\001\022\020\n" - + "\014IMPERFECTIVE\020\002\022\017\n\013PROGRESSIVE\020\003\"\370\001\n\004Cas" - + "e\022\020\n\014CASE_UNKNOWN\020\000\022\016\n\nACCUSATIVE\020\001\022\r\n\tA" - + "DVERBIAL\020\002\022\021\n\rCOMPLEMENTIVE\020\003\022\n\n\006DATIVE\020" - + "\004\022\014\n\010GENITIVE\020\005\022\020\n\014INSTRUMENTAL\020\006\022\014\n\010LOC" - + "ATIVE\020\007\022\016\n\nNOMINATIVE\020\010\022\013\n\007OBLIQUE\020\t\022\r\n\t" - + "PARTITIVE\020\n\022\021\n\rPREPOSITIONAL\020\013\022\022\n\016REFLEX" - + "IVE_CASE\020\014\022\021\n\rRELATIVE_CASE\020\r\022\014\n\010VOCATIV" - + "E\020\016\"\257\001\n\004Form\022\020\n\014FORM_UNKNOWN\020\000\022\014\n\010ADNOMI" - + "AL\020\001\022\r\n\tAUXILIARY\020\002\022\022\n\016COMPLEMENTIZER\020\003\022" - + "\020\n\014FINAL_ENDING\020\004\022\n\n\006GERUND\020\005\022\n\n\006REALIS\020" - + "\006\022\014\n\010IRREALIS\020\007\022\t\n\005SHORT\020\010\022\010\n\004LONG\020\t\022\t\n\005" - + "ORDER\020\n\022\014\n\010SPECIFIC\020\013\"E\n\006Gender\022\022\n\016GENDE" - + "R_UNKNOWN\020\000\022\014\n\010FEMININE\020\001\022\r\n\tMASCULINE\020\002" - + "\022\n\n\006NEUTER\020\003\"\177\n\004Mood\022\020\n\014MOOD_UNKNOWN\020\000\022\024" - + "\n\020CONDITIONAL_MOOD\020\001\022\016\n\nIMPERATIVE\020\002\022\016\n\n" - + "INDICATIVE\020\003\022\021\n\rINTERROGATIVE\020\004\022\013\n\007JUSSI" - + "VE\020\005\022\017\n\013SUBJUNCTIVE\020\006\"@\n\006Number\022\022\n\016NUMBE" - + "R_UNKNOWN\020\000\022\014\n\010SINGULAR\020\001\022\n\n\006PLURAL\020\002\022\010\n" - + "\004DUAL\020\003\"T\n\006Person\022\022\n\016PERSON_UNKNOWN\020\000\022\t\n" - + "\005FIRST\020\001\022\n\n\006SECOND\020\002\022\t\n\005THIRD\020\003\022\024\n\020REFLE" - + "XIVE_PERSON\020\004\"8\n\006Proper\022\022\n\016PROPER_UNKNOW" - + "N\020\000\022\n\n\006PROPER\020\001\022\016\n\nNOT_PROPER\020\002\"J\n\013Recip" - + "rocity\022\027\n\023RECIPROCITY_UNKNOWN\020\000\022\016\n\nRECIP" - + "ROCAL\020\001\022\022\n\016NON_RECIPROCAL\020\002\"s\n\005Tense\022\021\n\r" - + "TENSE_UNKNOWN\020\000\022\025\n\021CONDITIONAL_TENSE\020\001\022\n" - + "\n\006FUTURE\020\002\022\010\n\004PAST\020\003\022\013\n\007PRESENT\020\004\022\r\n\tIMP" - + "ERFECT\020\005\022\016\n\nPLUPERFECT\020\006\"B\n\005Voice\022\021\n\rVOI" - + "CE_UNKNOWN\020\000\022\n\n\006ACTIVE\020\001\022\r\n\tCAUSATIVE\020\002\022" - + "\013\n\007PASSIVE\020\003\"\232\010\n\016DependencyEdge\022\030\n\020head_" - + "token_index\030\001 \001(\005\022B\n\005label\030\002 \001(\01623.googl" - + "e.cloud.language.v1beta2.DependencyEdge." - + "Label\"\251\007\n\005Label\022\013\n\007UNKNOWN\020\000\022\n\n\006ABBREV\020\001" - + "\022\t\n\005ACOMP\020\002\022\t\n\005ADVCL\020\003\022\n\n\006ADVMOD\020\004\022\010\n\004AM" - + "OD\020\005\022\t\n\005APPOS\020\006\022\010\n\004ATTR\020\007\022\007\n\003AUX\020\010\022\013\n\007AU" - + "XPASS\020\t\022\006\n\002CC\020\n\022\t\n\005CCOMP\020\013\022\010\n\004CONJ\020\014\022\t\n\005" - + "CSUBJ\020\r\022\r\n\tCSUBJPASS\020\016\022\007\n\003DEP\020\017\022\007\n\003DET\020\020" - + "\022\r\n\tDISCOURSE\020\021\022\010\n\004DOBJ\020\022\022\010\n\004EXPL\020\023\022\014\n\010G" - + "OESWITH\020\024\022\010\n\004IOBJ\020\025\022\010\n\004MARK\020\026\022\007\n\003MWE\020\027\022\007" - + "\n\003MWV\020\030\022\007\n\003NEG\020\031\022\006\n\002NN\020\032\022\014\n\010NPADVMOD\020\033\022\t" - + "\n\005NSUBJ\020\034\022\r\n\tNSUBJPASS\020\035\022\007\n\003NUM\020\036\022\n\n\006NUM" - + "BER\020\037\022\005\n\001P\020 \022\r\n\tPARATAXIS\020!\022\013\n\007PARTMOD\020\"" - + "\022\t\n\005PCOMP\020#\022\010\n\004POBJ\020$\022\010\n\004POSS\020%\022\013\n\007POSTN" - + "EG\020&\022\013\n\007PRECOMP\020\'\022\013\n\007PRECONJ\020(\022\n\n\006PREDET" - + "\020)\022\010\n\004PREF\020*\022\010\n\004PREP\020+\022\t\n\005PRONL\020,\022\007\n\003PRT" - + "\020-\022\006\n\002PS\020.\022\014\n\010QUANTMOD\020/\022\t\n\005RCMOD\0200\022\014\n\010R" - + "CMODREL\0201\022\t\n\005RDROP\0202\022\007\n\003REF\0203\022\013\n\007REMNANT" - + "\0204\022\016\n\nREPARANDUM\0205\022\010\n\004ROOT\0206\022\010\n\004SNUM\0207\022\010" - + "\n\004SUFF\0208\022\010\n\004TMOD\0209\022\t\n\005TOPIC\020:\022\010\n\004VMOD\020;\022" - + "\014\n\010VOCATIVE\020<\022\t\n\005XCOMP\020=\022\n\n\006SUFFIX\020>\022\t\n\005" - + "TITLE\020?\022\014\n\010ADVPHMOD\020@\022\013\n\007AUXCAUS\020A\022\t\n\005AU" - + "XVV\020B\022\t\n\005DTMOD\020C\022\013\n\007FOREIGN\020D\022\006\n\002KW\020E\022\010\n" - + "\004LIST\020F\022\010\n\004NOMC\020G\022\014\n\010NOMCSUBJ\020H\022\020\n\014NOMCS" - + "UBJPASS\020I\022\010\n\004NUMC\020J\022\007\n\003COP\020K\022\016\n\nDISLOCAT" - + "ED\020L\022\007\n\003ASP\020M\022\010\n\004GMOD\020N\022\010\n\004GOBJ\020O\022\n\n\006INF" - + "MOD\020P\022\007\n\003MES\020Q\022\t\n\005NCOMP\020R\"\366\001\n\rEntityMent" - + "ion\0225\n\004text\030\001 \001(\0132\'.google.cloud.languag" - + "e.v1beta2.TextSpan\022?\n\004type\030\002 \001(\01621.googl" - + "e.cloud.language.v1beta2.EntityMention.T" - + "ype\022;\n\tsentiment\030\003 \001(\0132(.google.cloud.la" - + "nguage.v1beta2.Sentiment\"0\n\004Type\022\020\n\014TYPE" - + "_UNKNOWN\020\000\022\n\n\006PROPER\020\001\022\n\n\006COMMON\020\002\"1\n\010Te" - + "xtSpan\022\017\n\007content\030\001 \001(\t\022\024\n\014begin_offset\030" - + "\002 \001(\005\":\n\026ClassificationCategory\022\014\n\004name\030" - + "\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\"\235\001\n\027AnalyzeSen" - + "timentRequest\022>\n\010document\030\001 \001(\0132\'.google" - + ".cloud.language.v1beta2.DocumentB\003\340A\002\022B\n" - + "\rencoding_type\030\002 \001(\0162+.google.cloud.lang" - + "uage.v1beta2.EncodingType\"\256\001\n\030AnalyzeSen" - + "timentResponse\022D\n\022document_sentiment\030\001 \001" - + "(\0132(.google.cloud.language.v1beta2.Senti" - + "ment\022\020\n\010language\030\002 \001(\t\022:\n\tsentences\030\003 \003(" - + "\0132\'.google.cloud.language.v1beta2.Senten" - + "ce\"\243\001\n\035AnalyzeEntitySentimentRequest\022>\n\010" - + "document\030\001 \001(\0132\'.google.cloud.language.v" - + "1beta2.DocumentB\003\340A\002\022B\n\rencoding_type\030\002 " - + "\001(\0162+.google.cloud.language.v1beta2.Enco" - + "dingType\"k\n\036AnalyzeEntitySentimentRespon" - + "se\0227\n\010entities\030\001 \003(\0132%.google.cloud.lang" - + "uage.v1beta2.Entity\022\020\n\010language\030\002 \001(\t\"\234\001" - + "\n\026AnalyzeEntitiesRequest\022>\n\010document\030\001 \001" - + "(\0132\'.google.cloud.language.v1beta2.Docum" - + "entB\003\340A\002\022B\n\rencoding_type\030\002 \001(\0162+.google" - + ".cloud.language.v1beta2.EncodingType\"d\n\027" - + "AnalyzeEntitiesResponse\0227\n\010entities\030\001 \003(" - + "\0132%.google.cloud.language.v1beta2.Entity" - + "\022\020\n\010language\030\002 \001(\t\"\232\001\n\024AnalyzeSyntaxRequ" - + "est\022>\n\010document\030\001 \001(\0132\'.google.cloud.lan" - + "guage.v1beta2.DocumentB\003\340A\002\022B\n\rencoding_" - + "type\030\002 \001(\0162+.google.cloud.language.v1bet" - + "a2.EncodingType\"\233\001\n\025AnalyzeSyntaxRespons" - + "e\022:\n\tsentences\030\001 \003(\0132\'.google.cloud.lang" - + "uage.v1beta2.Sentence\0224\n\006tokens\030\002 \003(\0132$." - + "google.cloud.language.v1beta2.Token\022\020\n\010l" - + "anguage\030\003 \001(\t\"U\n\023ClassifyTextRequest\022>\n\010" - + "document\030\001 \001(\0132\'.google.cloud.language.v" - + "1beta2.DocumentB\003\340A\002\"a\n\024ClassifyTextResp" - + "onse\022I\n\ncategories\030\001 \003(\01325.google.cloud." - + "language.v1beta2.ClassificationCategory\"" - + "\211\003\n\023AnnotateTextRequest\022>\n\010document\030\001 \001(" - + "\0132\'.google.cloud.language.v1beta2.Docume" - + "ntB\003\340A\002\022R\n\010features\030\002 \001(\0132;.google.cloud" - + ".language.v1beta2.AnnotateTextRequest.Fe" - + "aturesB\003\340A\002\022B\n\rencoding_type\030\003 \001(\0162+.goo" - + "gle.cloud.language.v1beta2.EncodingType\032" - + "\231\001\n\010Features\022\026\n\016extract_syntax\030\001 \001(\010\022\030\n\020" - + "extract_entities\030\002 \001(\010\022\"\n\032extract_docume" - + "nt_sentiment\030\003 \001(\010\022 \n\030extract_entity_sen" - + "timent\030\004 \001(\010\022\025\n\rclassify_text\030\006 \001(\010\"\344\002\n\024" - + "AnnotateTextResponse\022:\n\tsentences\030\001 \003(\0132" - + "\'.google.cloud.language.v1beta2.Sentence" - + "\0224\n\006tokens\030\002 \003(\0132$.google.cloud.language" - + ".v1beta2.Token\0227\n\010entities\030\003 \003(\0132%.googl" - + "e.cloud.language.v1beta2.Entity\022D\n\022docum" - + "ent_sentiment\030\004 \001(\0132(.google.cloud.langu" - + "age.v1beta2.Sentiment\022\020\n\010language\030\005 \001(\t\022" - + "I\n\ncategories\030\006 \003(\01325.google.cloud.langu" - + "age.v1beta2.ClassificationCategory*8\n\014En" - + "codingType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020" - + "\002\022\t\n\005UTF32\020\0032\212\013\n\017LanguageService\022\327\001\n\020Ana" - + "lyzeSentiment\0226.google.cloud.language.v1" - + "beta2.AnalyzeSentimentRequest\0327.google.c" - + "loud.language.v1beta2.AnalyzeSentimentRe" - + "sponse\"R\202\323\344\223\002(\"#/v1beta2/documents:analy" - + "zeSentiment:\001*\332A\026document,encoding_type\332" - + "A\010document\022\323\001\n\017AnalyzeEntities\0225.google." - + "cloud.language.v1beta2.AnalyzeEntitiesRe" - + "quest\0326.google.cloud.language.v1beta2.An" - + "alyzeEntitiesResponse\"Q\202\323\344\223\002\'\"\"/v1beta2/" - + "documents:analyzeEntities:\001*\332A\026document," - + "encoding_type\332A\010document\022\357\001\n\026AnalyzeEnti" - + "tySentiment\022<.google.cloud.language.v1be" - + "ta2.AnalyzeEntitySentimentRequest\032=.goog" - + "le.cloud.language.v1beta2.AnalyzeEntityS" - + "entimentResponse\"X\202\323\344\223\002.\")/v1beta2/docum" - + "ents:analyzeEntitySentiment:\001*\332A\026documen" - + "t,encoding_type\332A\010document\022\313\001\n\rAnalyzeSy" - + "ntax\0223.google.cloud.language.v1beta2.Ana" - + "lyzeSyntaxRequest\0324.google.cloud.languag" - + "e.v1beta2.AnalyzeSyntaxResponse\"O\202\323\344\223\002%\"" - + " /v1beta2/documents:analyzeSyntax:\001*\332A\026d" - + "ocument,encoding_type\332A\010document\022\256\001\n\014Cla" - + "ssifyText\0222.google.cloud.language.v1beta" - + "2.ClassifyTextRequest\0323.google.cloud.lan" - + "guage.v1beta2.ClassifyTextResponse\"5\202\323\344\223" - + "\002$\"\037/v1beta2/documents:classifyText:\001*\332A" - + "\010document\022\331\001\n\014AnnotateText\0222.google.clou" - + "d.language.v1beta2.AnnotateTextRequest\0323" - + ".google.cloud.language.v1beta2.AnnotateT" - + "extResponse\"`\202\323\344\223\002$\"\037/v1beta2/documents:" - + "annotateText:\001*\332A\037document,features,enco" - + "ding_type\332A\021document,features\032z\312A\027langua" - + "ge.googleapis.com\322A]https://www.googleap" - + "is.com/auth/cloud-language,https://www.g" - + "oogleapis.com/auth/cloud-platformB\202\001\n!co" - + "m.google.cloud.language.v1beta2B\024Languag" - + "eServiceProtoP\001ZEgoogle.golang.org/genpr" - + "oto/googleapis/cloud/language/v1beta2;la" - + "nguageb\006proto3" + + "_uri\030\003 \001(\tH\000\022\020\n\010language\030\004 \001(\t\022\031\n\021refere" + + "nce_web_uri\030\005 \001(\t\022Y\n\024boilerplate_handlin" + + "g\030\006 \001(\0162;.google.cloud.language.v1beta2." + + "Document.BoilerplateHandling\"6\n\004Type\022\024\n\020" + + "TYPE_UNSPECIFIED\020\000\022\016\n\nPLAIN_TEXT\020\001\022\010\n\004HT" + + "ML\020\002\"g\n\023BoilerplateHandling\022$\n BOILERPLA" + + "TE_HANDLING_UNSPECIFIED\020\000\022\024\n\020SKIP_BOILER" + + "PLATE\020\001\022\024\n\020KEEP_BOILERPLATE\020\002B\010\n\006source\"" + + "~\n\010Sentence\0225\n\004text\030\001 \001(\0132\'.google.cloud" + + ".language.v1beta2.TextSpan\022;\n\tsentiment\030" + + "\002 \001(\0132(.google.cloud.language.v1beta2.Se" + + "ntiment\"\223\004\n\006Entity\022\014\n\004name\030\001 \001(\t\0228\n\004type" + + "\030\002 \001(\0162*.google.cloud.language.v1beta2.E" + + "ntity.Type\022E\n\010metadata\030\003 \003(\01323.google.cl" + + "oud.language.v1beta2.Entity.MetadataEntr" + + "y\022\020\n\010salience\030\004 \001(\002\022>\n\010mentions\030\005 \003(\0132,." + + "google.cloud.language.v1beta2.EntityMent" + + "ion\022;\n\tsentiment\030\006 \001(\0132(.google.cloud.la" + + "nguage.v1beta2.Sentiment\032/\n\rMetadataEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\271\001\n\004Ty" + + "pe\022\013\n\007UNKNOWN\020\000\022\n\n\006PERSON\020\001\022\014\n\010LOCATION\020" + + "\002\022\020\n\014ORGANIZATION\020\003\022\t\n\005EVENT\020\004\022\017\n\013WORK_O" + + "F_ART\020\005\022\021\n\rCONSUMER_GOOD\020\006\022\t\n\005OTHER\020\007\022\020\n" + + "\014PHONE_NUMBER\020\t\022\013\n\007ADDRESS\020\n\022\010\n\004DATE\020\013\022\n" + + "\n\006NUMBER\020\014\022\t\n\005PRICE\020\r\"\332\001\n\005Token\0225\n\004text\030" + + "\001 \001(\0132\'.google.cloud.language.v1beta2.Te" + + "xtSpan\022C\n\016part_of_speech\030\002 \001(\0132+.google." + + "cloud.language.v1beta2.PartOfSpeech\022F\n\017d" + + "ependency_edge\030\003 \001(\0132-.google.cloud.lang" + + "uage.v1beta2.DependencyEdge\022\r\n\005lemma\030\004 \001" + + "(\t\"-\n\tSentiment\022\021\n\tmagnitude\030\002 \001(\002\022\r\n\005sc" + + "ore\030\003 \001(\002\"\337\020\n\014PartOfSpeech\022<\n\003tag\030\001 \001(\0162" + + "/.google.cloud.language.v1beta2.PartOfSp" + + "eech.Tag\022B\n\006aspect\030\002 \001(\01622.google.cloud." + + "language.v1beta2.PartOfSpeech.Aspect\022>\n\004" + + "case\030\003 \001(\01620.google.cloud.language.v1bet" + + "a2.PartOfSpeech.Case\022>\n\004form\030\004 \001(\01620.goo" + + "gle.cloud.language.v1beta2.PartOfSpeech." + + "Form\022B\n\006gender\030\005 \001(\01622.google.cloud.lang" + + "uage.v1beta2.PartOfSpeech.Gender\022>\n\004mood" + + "\030\006 \001(\01620.google.cloud.language.v1beta2.P" + + "artOfSpeech.Mood\022B\n\006number\030\007 \001(\01622.googl" + + "e.cloud.language.v1beta2.PartOfSpeech.Nu" + + "mber\022B\n\006person\030\010 \001(\01622.google.cloud.lang" + + "uage.v1beta2.PartOfSpeech.Person\022B\n\006prop" + + "er\030\t \001(\01622.google.cloud.language.v1beta2" + + ".PartOfSpeech.Proper\022L\n\013reciprocity\030\n \001(" + + "\01627.google.cloud.language.v1beta2.PartOf" + + "Speech.Reciprocity\022@\n\005tense\030\013 \001(\01621.goog" + + "le.cloud.language.v1beta2.PartOfSpeech.T" + + "ense\022@\n\005voice\030\014 \001(\01621.google.cloud.langu" + + "age.v1beta2.PartOfSpeech.Voice\"\215\001\n\003Tag\022\013" + + "\n\007UNKNOWN\020\000\022\007\n\003ADJ\020\001\022\007\n\003ADP\020\002\022\007\n\003ADV\020\003\022\010" + + "\n\004CONJ\020\004\022\007\n\003DET\020\005\022\010\n\004NOUN\020\006\022\007\n\003NUM\020\007\022\010\n\004" + + "PRON\020\010\022\007\n\003PRT\020\t\022\t\n\005PUNCT\020\n\022\010\n\004VERB\020\013\022\005\n\001" + + "X\020\014\022\t\n\005AFFIX\020\r\"O\n\006Aspect\022\022\n\016ASPECT_UNKNO" + + "WN\020\000\022\016\n\nPERFECTIVE\020\001\022\020\n\014IMPERFECTIVE\020\002\022\017" + + "\n\013PROGRESSIVE\020\003\"\370\001\n\004Case\022\020\n\014CASE_UNKNOWN" + + "\020\000\022\016\n\nACCUSATIVE\020\001\022\r\n\tADVERBIAL\020\002\022\021\n\rCOM" + + "PLEMENTIVE\020\003\022\n\n\006DATIVE\020\004\022\014\n\010GENITIVE\020\005\022\020" + + "\n\014INSTRUMENTAL\020\006\022\014\n\010LOCATIVE\020\007\022\016\n\nNOMINA" + + "TIVE\020\010\022\013\n\007OBLIQUE\020\t\022\r\n\tPARTITIVE\020\n\022\021\n\rPR" + + "EPOSITIONAL\020\013\022\022\n\016REFLEXIVE_CASE\020\014\022\021\n\rREL" + + "ATIVE_CASE\020\r\022\014\n\010VOCATIVE\020\016\"\257\001\n\004Form\022\020\n\014F" + + "ORM_UNKNOWN\020\000\022\014\n\010ADNOMIAL\020\001\022\r\n\tAUXILIARY" + + "\020\002\022\022\n\016COMPLEMENTIZER\020\003\022\020\n\014FINAL_ENDING\020\004" + + "\022\n\n\006GERUND\020\005\022\n\n\006REALIS\020\006\022\014\n\010IRREALIS\020\007\022\t" + + "\n\005SHORT\020\010\022\010\n\004LONG\020\t\022\t\n\005ORDER\020\n\022\014\n\010SPECIF" + + "IC\020\013\"E\n\006Gender\022\022\n\016GENDER_UNKNOWN\020\000\022\014\n\010FE" + + "MININE\020\001\022\r\n\tMASCULINE\020\002\022\n\n\006NEUTER\020\003\"\177\n\004M" + + "ood\022\020\n\014MOOD_UNKNOWN\020\000\022\024\n\020CONDITIONAL_MOO" + + "D\020\001\022\016\n\nIMPERATIVE\020\002\022\016\n\nINDICATIVE\020\003\022\021\n\rI" + + "NTERROGATIVE\020\004\022\013\n\007JUSSIVE\020\005\022\017\n\013SUBJUNCTI" + + "VE\020\006\"@\n\006Number\022\022\n\016NUMBER_UNKNOWN\020\000\022\014\n\010SI" + + "NGULAR\020\001\022\n\n\006PLURAL\020\002\022\010\n\004DUAL\020\003\"T\n\006Person" + + "\022\022\n\016PERSON_UNKNOWN\020\000\022\t\n\005FIRST\020\001\022\n\n\006SECON" + + "D\020\002\022\t\n\005THIRD\020\003\022\024\n\020REFLEXIVE_PERSON\020\004\"8\n\006" + + "Proper\022\022\n\016PROPER_UNKNOWN\020\000\022\n\n\006PROPER\020\001\022\016" + + "\n\nNOT_PROPER\020\002\"J\n\013Reciprocity\022\027\n\023RECIPRO" + + "CITY_UNKNOWN\020\000\022\016\n\nRECIPROCAL\020\001\022\022\n\016NON_RE" + + "CIPROCAL\020\002\"s\n\005Tense\022\021\n\rTENSE_UNKNOWN\020\000\022\025" + + "\n\021CONDITIONAL_TENSE\020\001\022\n\n\006FUTURE\020\002\022\010\n\004PAS" + + "T\020\003\022\013\n\007PRESENT\020\004\022\r\n\tIMPERFECT\020\005\022\016\n\nPLUPE" + + "RFECT\020\006\"B\n\005Voice\022\021\n\rVOICE_UNKNOWN\020\000\022\n\n\006A" + + "CTIVE\020\001\022\r\n\tCAUSATIVE\020\002\022\013\n\007PASSIVE\020\003\"\232\010\n\016" + + "DependencyEdge\022\030\n\020head_token_index\030\001 \001(\005" + + "\022B\n\005label\030\002 \001(\01623.google.cloud.language." + + "v1beta2.DependencyEdge.Label\"\251\007\n\005Label\022\013" + + "\n\007UNKNOWN\020\000\022\n\n\006ABBREV\020\001\022\t\n\005ACOMP\020\002\022\t\n\005AD" + + "VCL\020\003\022\n\n\006ADVMOD\020\004\022\010\n\004AMOD\020\005\022\t\n\005APPOS\020\006\022\010" + + "\n\004ATTR\020\007\022\007\n\003AUX\020\010\022\013\n\007AUXPASS\020\t\022\006\n\002CC\020\n\022\t" + + "\n\005CCOMP\020\013\022\010\n\004CONJ\020\014\022\t\n\005CSUBJ\020\r\022\r\n\tCSUBJP" + + "ASS\020\016\022\007\n\003DEP\020\017\022\007\n\003DET\020\020\022\r\n\tDISCOURSE\020\021\022\010" + + "\n\004DOBJ\020\022\022\010\n\004EXPL\020\023\022\014\n\010GOESWITH\020\024\022\010\n\004IOBJ" + + "\020\025\022\010\n\004MARK\020\026\022\007\n\003MWE\020\027\022\007\n\003MWV\020\030\022\007\n\003NEG\020\031\022" + + "\006\n\002NN\020\032\022\014\n\010NPADVMOD\020\033\022\t\n\005NSUBJ\020\034\022\r\n\tNSUB" + + "JPASS\020\035\022\007\n\003NUM\020\036\022\n\n\006NUMBER\020\037\022\005\n\001P\020 \022\r\n\tP" + + "ARATAXIS\020!\022\013\n\007PARTMOD\020\"\022\t\n\005PCOMP\020#\022\010\n\004PO" + + "BJ\020$\022\010\n\004POSS\020%\022\013\n\007POSTNEG\020&\022\013\n\007PRECOMP\020\'" + + "\022\013\n\007PRECONJ\020(\022\n\n\006PREDET\020)\022\010\n\004PREF\020*\022\010\n\004P" + + "REP\020+\022\t\n\005PRONL\020,\022\007\n\003PRT\020-\022\006\n\002PS\020.\022\014\n\010QUA" + + "NTMOD\020/\022\t\n\005RCMOD\0200\022\014\n\010RCMODREL\0201\022\t\n\005RDRO" + + "P\0202\022\007\n\003REF\0203\022\013\n\007REMNANT\0204\022\016\n\nREPARANDUM\020" + + "5\022\010\n\004ROOT\0206\022\010\n\004SNUM\0207\022\010\n\004SUFF\0208\022\010\n\004TMOD\020" + + "9\022\t\n\005TOPIC\020:\022\010\n\004VMOD\020;\022\014\n\010VOCATIVE\020<\022\t\n\005" + + "XCOMP\020=\022\n\n\006SUFFIX\020>\022\t\n\005TITLE\020?\022\014\n\010ADVPHM" + + "OD\020@\022\013\n\007AUXCAUS\020A\022\t\n\005AUXVV\020B\022\t\n\005DTMOD\020C\022" + + "\013\n\007FOREIGN\020D\022\006\n\002KW\020E\022\010\n\004LIST\020F\022\010\n\004NOMC\020G" + + "\022\014\n\010NOMCSUBJ\020H\022\020\n\014NOMCSUBJPASS\020I\022\010\n\004NUMC" + + "\020J\022\007\n\003COP\020K\022\016\n\nDISLOCATED\020L\022\007\n\003ASP\020M\022\010\n\004" + + "GMOD\020N\022\010\n\004GOBJ\020O\022\n\n\006INFMOD\020P\022\007\n\003MES\020Q\022\t\n" + + "\005NCOMP\020R\"\366\001\n\rEntityMention\0225\n\004text\030\001 \001(\013" + + "2\'.google.cloud.language.v1beta2.TextSpa" + + "n\022?\n\004type\030\002 \001(\01621.google.cloud.language." + + "v1beta2.EntityMention.Type\022;\n\tsentiment\030" + + "\003 \001(\0132(.google.cloud.language.v1beta2.Se" + + "ntiment\"0\n\004Type\022\020\n\014TYPE_UNKNOWN\020\000\022\n\n\006PRO" + + "PER\020\001\022\n\n\006COMMON\020\002\"1\n\010TextSpan\022\017\n\007content" + + "\030\001 \001(\t\022\024\n\014begin_offset\030\002 \001(\005\":\n\026Classifi" + + "cationCategory\022\014\n\004name\030\001 \001(\t\022\022\n\nconfiden" + + "ce\030\002 \001(\002\"\307\003\n\032ClassificationModelOptions\022" + + "U\n\010v1_model\030\001 \001(\0132A.google.cloud.languag" + + "e.v1beta2.ClassificationModelOptions.V1M" + + "odelH\000\022U\n\010v2_model\030\002 \001(\0132A.google.cloud." + + "language.v1beta2.ClassificationModelOpti" + + "ons.V2ModelH\000\032\t\n\007V1Model\032\341\001\n\007V2Model\022~\n\032" + + "content_categories_version\030\001 \001(\0162Z.googl" + + "e.cloud.language.v1beta2.ClassificationM" + + "odelOptions.V2Model.ContentCategoriesVer" + + "sion\"V\n\030ContentCategoriesVersion\022*\n&CONT" + + "ENT_CATEGORIES_VERSION_UNSPECIFIED\020\000\022\006\n\002" + + "V1\020\001\022\006\n\002V2\020\002B\014\n\nmodel_type\"\235\001\n\027AnalyzeSe" + + "ntimentRequest\022>\n\010document\030\001 \001(\0132\'.googl" + + "e.cloud.language.v1beta2.DocumentB\003\340A\002\022B" + + "\n\rencoding_type\030\002 \001(\0162+.google.cloud.lan" + + "guage.v1beta2.EncodingType\"\256\001\n\030AnalyzeSe" + + "ntimentResponse\022D\n\022document_sentiment\030\001 " + + "\001(\0132(.google.cloud.language.v1beta2.Sent" + + "iment\022\020\n\010language\030\002 \001(\t\022:\n\tsentences\030\003 \003" + + "(\0132\'.google.cloud.language.v1beta2.Sente" + + "nce\"\243\001\n\035AnalyzeEntitySentimentRequest\022>\n" + + "\010document\030\001 \001(\0132\'.google.cloud.language." + + "v1beta2.DocumentB\003\340A\002\022B\n\rencoding_type\030\002" + + " \001(\0162+.google.cloud.language.v1beta2.Enc" + + "odingType\"k\n\036AnalyzeEntitySentimentRespo" + + "nse\0227\n\010entities\030\001 \003(\0132%.google.cloud.lan" + + "guage.v1beta2.Entity\022\020\n\010language\030\002 \001(\t\"\234" + + "\001\n\026AnalyzeEntitiesRequest\022>\n\010document\030\001 " + + "\001(\0132\'.google.cloud.language.v1beta2.Docu" + + "mentB\003\340A\002\022B\n\rencoding_type\030\002 \001(\0162+.googl" + + "e.cloud.language.v1beta2.EncodingType\"d\n" + + "\027AnalyzeEntitiesResponse\0227\n\010entities\030\001 \003" + + "(\0132%.google.cloud.language.v1beta2.Entit" + + "y\022\020\n\010language\030\002 \001(\t\"\232\001\n\024AnalyzeSyntaxReq" + + "uest\022>\n\010document\030\001 \001(\0132\'.google.cloud.la" + + "nguage.v1beta2.DocumentB\003\340A\002\022B\n\rencoding" + + "_type\030\002 \001(\0162+.google.cloud.language.v1be" + + "ta2.EncodingType\"\233\001\n\025AnalyzeSyntaxRespon" + + "se\022:\n\tsentences\030\001 \003(\0132\'.google.cloud.lan" + + "guage.v1beta2.Sentence\0224\n\006tokens\030\002 \003(\0132$" + + ".google.cloud.language.v1beta2.Token\022\020\n\010" + + "language\030\003 \001(\t\"\266\001\n\023ClassifyTextRequest\022>" + + "\n\010document\030\001 \001(\0132\'.google.cloud.language" + + ".v1beta2.DocumentB\003\340A\002\022_\n\034classification" + + "_model_options\030\003 \001(\01329.google.cloud.lang" + + "uage.v1beta2.ClassificationModelOptions\"" + + "a\n\024ClassifyTextResponse\022I\n\ncategories\030\001 " + + "\003(\01325.google.cloud.language.v1beta2.Clas" + + "sificationCategory\"\352\003\n\023AnnotateTextReque" + + "st\022>\n\010document\030\001 \001(\0132\'.google.cloud.lang" + + "uage.v1beta2.DocumentB\003\340A\002\022R\n\010features\030\002" + + " \001(\0132;.google.cloud.language.v1beta2.Ann" + + "otateTextRequest.FeaturesB\003\340A\002\022B\n\rencodi" + + "ng_type\030\003 \001(\0162+.google.cloud.language.v1" + + "beta2.EncodingType\032\372\001\n\010Features\022\026\n\016extra" + + "ct_syntax\030\001 \001(\010\022\030\n\020extract_entities\030\002 \001(" + + "\010\022\"\n\032extract_document_sentiment\030\003 \001(\010\022 \n" + + "\030extract_entity_sentiment\030\004 \001(\010\022\025\n\rclass" + + "ify_text\030\006 \001(\010\022_\n\034classification_model_o" + + "ptions\030\n \001(\01329.google.cloud.language.v1b" + + "eta2.ClassificationModelOptions\"\344\002\n\024Anno" + + "tateTextResponse\022:\n\tsentences\030\001 \003(\0132\'.go" + + "ogle.cloud.language.v1beta2.Sentence\0224\n\006" + + "tokens\030\002 \003(\0132$.google.cloud.language.v1b" + + "eta2.Token\0227\n\010entities\030\003 \003(\0132%.google.cl" + + "oud.language.v1beta2.Entity\022D\n\022document_" + + "sentiment\030\004 \001(\0132(.google.cloud.language." + + "v1beta2.Sentiment\022\020\n\010language\030\005 \001(\t\022I\n\nc" + + "ategories\030\006 \003(\01325.google.cloud.language." + + "v1beta2.ClassificationCategory*8\n\014Encodi" + + "ngType\022\010\n\004NONE\020\000\022\010\n\004UTF8\020\001\022\t\n\005UTF16\020\002\022\t\n" + + "\005UTF32\020\0032\212\013\n\017LanguageService\022\327\001\n\020Analyze" + + "Sentiment\0226.google.cloud.language.v1beta" + + "2.AnalyzeSentimentRequest\0327.google.cloud" + + ".language.v1beta2.AnalyzeSentimentRespon" + + "se\"R\202\323\344\223\002(\"#/v1beta2/documents:analyzeSe" + + "ntiment:\001*\332A\026document,encoding_type\332A\010do" + + "cument\022\323\001\n\017AnalyzeEntities\0225.google.clou" + + "d.language.v1beta2.AnalyzeEntitiesReques" + + "t\0326.google.cloud.language.v1beta2.Analyz" + + "eEntitiesResponse\"Q\202\323\344\223\002\'\"\"/v1beta2/docu" + + "ments:analyzeEntities:\001*\332A\026document,enco" + + "ding_type\332A\010document\022\357\001\n\026AnalyzeEntitySe" + + "ntiment\022<.google.cloud.language.v1beta2." + + "AnalyzeEntitySentimentRequest\032=.google.c" + + "loud.language.v1beta2.AnalyzeEntitySenti" + + "mentResponse\"X\202\323\344\223\002.\")/v1beta2/documents" + + ":analyzeEntitySentiment:\001*\332A\026document,en" + + "coding_type\332A\010document\022\313\001\n\rAnalyzeSyntax" + + "\0223.google.cloud.language.v1beta2.Analyze" + + "SyntaxRequest\0324.google.cloud.language.v1" + + "beta2.AnalyzeSyntaxResponse\"O\202\323\344\223\002%\" /v1" + + "beta2/documents:analyzeSyntax:\001*\332A\026docum" + + "ent,encoding_type\332A\010document\022\256\001\n\014Classif" + + "yText\0222.google.cloud.language.v1beta2.Cl" + + "assifyTextRequest\0323.google.cloud.languag" + + "e.v1beta2.ClassifyTextResponse\"5\202\323\344\223\002$\"\037" + + "/v1beta2/documents:classifyText:\001*\332A\010doc" + + "ument\022\331\001\n\014AnnotateText\0222.google.cloud.la" + + "nguage.v1beta2.AnnotateTextRequest\0323.goo" + + "gle.cloud.language.v1beta2.AnnotateTextR" + + "esponse\"`\202\323\344\223\002$\"\037/v1beta2/documents:anno" + + "tateText:\001*\332A\037document,features,encoding" + + "_type\332A\021document,features\032z\312A\027language.g" + + "oogleapis.com\322A]https://www.googleapis.c" + + "om/auth/cloud-language,https://www.googl" + + "eapis.com/auth/cloud-platformB\202\001\n!com.go" + + "ogle.cloud.language.v1beta2B\024LanguageSer" + + "viceProtoP\001ZEgoogle.golang.org/genproto/" + + "googleapis/cloud/language/v1beta2;langua" + + "geb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -363,7 +397,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_Document_descriptor, new java.lang.String[] { - "Type", "Content", "GcsContentUri", "Language", "Source", + "Type", + "Content", + "GcsContentUri", + "Language", + "ReferenceWebUri", + "BoilerplateHandling", + "Source", }); internal_static_google_cloud_language_v1beta2_Sentence_descriptor = getDescriptor().getMessageTypes().get(1); @@ -456,8 +496,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Confidence", }); - internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor, + new java.lang.String[] { + "V1Model", "V2Model", "ModelType", + }); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V1Model_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor = + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_language_v1beta2_ClassificationModelOptions_V2Model_descriptor, + new java.lang.String[] { + "ContentCategoriesVersion", + }); + internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor = + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSentimentRequest_descriptor, @@ -465,7 +531,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSentimentResponse_descriptor, @@ -473,7 +539,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocumentSentiment", "Language", "Sentences", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentRequest_descriptor, @@ -481,7 +547,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitySentimentResponse_descriptor, @@ -489,7 +555,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesRequest_descriptor, @@ -497,7 +563,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeEntitiesResponse_descriptor, @@ -505,7 +571,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Entities", "Language", }); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxRequest_descriptor, @@ -513,7 +579,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Document", "EncodingType", }); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnalyzeSyntaxResponse_descriptor, @@ -521,15 +587,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Sentences", "Tokens", "Language", }); internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_ClassifyTextRequest_descriptor, new java.lang.String[] { - "Document", + "Document", "ClassificationModelOptions", }); internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_ClassifyTextResponse_descriptor, @@ -537,7 +603,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Categories", }); internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnnotateTextRequest_descriptor, @@ -557,9 +623,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExtractDocumentSentiment", "ExtractEntitySentiment", "ClassifyText", + "ClassificationModelOptions", }); internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_language_v1beta2_AnnotateTextResponse_descriptor, diff --git a/java-language/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto b/java-language/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto index 7d77376e985c..fd51d48652de 100644 --- a/java-language/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto +++ b/java-language/proto-google-cloud-language-v1beta2/src/main/proto/google/cloud/language/v1beta2/language_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -68,7 +67,7 @@ service LanguageService { } // Analyzes the syntax of the text and provides sentence boundaries and - // tokenization along with part-of-speech tags, dependency trees, and other + // tokenization along with part of speech tags, dependency trees, and other // properties. rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) { option (google.api.http) = { @@ -100,7 +99,7 @@ service LanguageService { } } - +// ################################################################ # // // Represents the input to API methods. message Document { @@ -116,6 +115,19 @@ message Document { HTML = 2; } + // Ways of handling boilerplate detected in the document + enum BoilerplateHandling { + // The boilerplate handling is not specified. + BOILERPLATE_HANDLING_UNSPECIFIED = 0; + + // Do not analyze detected boilerplate. Reference web URI is required for + // detecting boilerplate. + SKIP_BOILERPLATE = 1; + + // Treat boilerplate the same as content. + KEEP_BOILERPLATE = 2; + } + // Required. If the type is not set or is `TYPE_UNSPECIFIED`, // returns an `INVALID_ARGUMENT` error. Type type = 1; @@ -143,6 +155,15 @@ message Document { // specified by the caller or automatically detected) is not supported by the // called API method, an `INVALID_ARGUMENT` error is returned. string language = 4; + + // The web URI where the document comes from. This URI is not used for + // fetching the content, but as a hint for analyzing the document. + string reference_web_uri = 5; + + // Indicates how detected boilerplate(e.g. advertisements, copyright + // declarations, banners) should be handled for this document. If not + // specified, boilerplate will be treated the same as content. + BoilerplateHandling boilerplate_handling = 6; } // Represents a sentence in the input document. @@ -156,6 +177,32 @@ message Sentence { Sentiment sentiment = 2; } +// Represents the text encoding that the caller uses to process the output. +// Providing an `EncodingType` is recommended because the API provides the +// beginning offsets for various outputs, such as tokens and mentions, and +// languages that natively use different text encodings may access offsets +// differently. +enum EncodingType { + // If `EncodingType` is not specified, encoding-dependent information (such as + // `begin_offset`) will be set at `-1`. + NONE = 0; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-8 encoding of the input. C++ and Go are examples of languages + // that use this encoding natively. + UTF8 = 1; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-16 encoding of the input. Java and JavaScript are examples of + // languages that use this encoding natively. + UTF16 = 2; + + // Encoding-dependent information (such as `begin_offset`) is calculated based + // on the UTF-32 encoding of the input. Python is an example of a language + // that uses this encoding natively. + UTF32 = 3; +} + // Represents a phrase in the text that is a known entity, such as // a person, an organization, or location. The API associates information, such // as salience and mentions, with entities. @@ -286,32 +333,6 @@ message Token { string lemma = 4; } -// Represents the text encoding that the caller uses to process the output. -// Providing an `EncodingType` is recommended because the API provides the -// beginning offsets for various outputs, such as tokens and mentions, and -// languages that natively use different text encodings may access offsets -// differently. -enum EncodingType { - // If `EncodingType` is not specified, encoding-dependent information (such as - // `begin_offset`) will be set at `-1`. - NONE = 0; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-8 encoding of the input. C++ and Go are examples of languages - // that use this encoding natively. - UTF8 = 1; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-16 encoding of the input. Java and JavaScript are examples of - // languages that use this encoding natively. - UTF16 = 2; - - // Encoding-dependent information (such as `begin_offset`) is calculated based - // on the UTF-32 encoding of the input. Python is an example of a language - // that uses this encoding natively. - UTF32 = 3; -} - // Represents the feeling associated with the entire text or entities in // the text. // Next ID: 6 @@ -968,6 +989,45 @@ message ClassificationCategory { float confidence = 2; } +// Model options available for classification requests. +message ClassificationModelOptions { + // Options for the V1 model. + message V1Model { + + } + + // Options for the V2 model. + message V2Model { + // The content categories used for classification. + enum ContentCategoriesVersion { + // If `ContentCategoriesVersion` is not specified, this option will + // default to `V1`. + CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0; + + // Legacy content categories of our initial launch in 2017. + V1 = 1; + + // Updated content categories in 2022. + V2 = 2; + } + + // The content categories used for classification. + ContentCategoriesVersion content_categories_version = 1; + } + + // If this field is not set, then the `v1_model` will be used by default. + oneof model_type { + // Setting this field will use the V1 model and V1 content categories + // version. The V1 model is a legacy model; support for this will be + // discontinued in the future. + V1Model v1_model = 1; + + // Setting this field will use the V2 model with the appropriate content + // categories version. The V2 model is a better performing model. + V2Model v2_model = 2; + } +} + // The sentiment analysis request message. message AnalyzeSentimentRequest { // Required. Input document. @@ -1059,6 +1119,10 @@ message AnalyzeSyntaxResponse { message ClassifyTextRequest { // Required. Input document. Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Model options to use for classification. Defaults to v1 options if not + // specified. + ClassificationModelOptions classification_model_options = 3; } // The document classification response message. @@ -1072,7 +1136,7 @@ message ClassifyTextResponse { message AnnotateTextRequest { // All available features for sentiment, syntax, and semantic analysis. // Setting each one to true will enable that specific analysis for the input. - // Next ID: 10 + // Next ID: 11 message Features { // Extract syntax information. bool extract_syntax = 1; @@ -1091,6 +1155,10 @@ message AnnotateTextRequest { // [predefined // taxonomy](https://cloud.google.com/natural-language/docs/categories). bool classify_text = 6; + + // The model options to use for classification. Defaults to v1 options + // if not specified. Only used if `classify_text` is set to true. + ClassificationModelOptions classification_model_options = 10; } // Required. Input document. diff --git a/java-language/renovate.json b/java-language/renovate.json new file mode 100644 index 000000000000..3a3c56f17436 --- /dev/null +++ b/java-language/renovate.json @@ -0,0 +1,74 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-language", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-conformance-tests" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "dependencyDashboard": true +} diff --git a/java-language/samples/install-without-bom/pom.xml b/java-language/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..1604ea57c999 --- /dev/null +++ b/java-language/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google Natural Language Install Without Bom + https://github.com/googleapis/java-language + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-language + 2.3.4 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-language/samples/pom.xml b/java-language/samples/pom.xml new file mode 100644 index 000000000000..628ae66c5871 --- /dev/null +++ b/java-language/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google Natural Language Samples Parent + https://github.com/googleapis/java-language + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + + true + + + + + diff --git a/java-language/samples/snapshot/pom.xml b/java-language/samples/snapshot/pom.xml new file mode 100644 index 000000000000..59b3c6d9e6de --- /dev/null +++ b/java-language/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google Natural Language Snapshot Samples + https://github.com/googleapis/java-language + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-language + 2.3.4 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java b/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java index def8f6a5ed9c..5d351f77818c 100644 --- a/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/AsyncClassifyText.java @@ -18,6 +18,7 @@ // [START language_v1_generated_languageserviceclient_classifytext_async] import com.google.api.core.ApiFuture; +import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; @@ -37,7 +38,10 @@ public static void asyncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ApiFuture future = languageServiceClient.classifyTextCallable().futureCall(request); // Do something. diff --git a/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java b/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java index 5e68d26b5e3d..b319f8a6358a 100644 --- a/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java +++ b/java-language/samples/snippets/generated/com/google/cloud/language/v1/languageserviceclient/classifytext/SyncClassifyText.java @@ -17,6 +17,7 @@ package com.google.cloud.language.v1.samples; // [START language_v1_generated_languageserviceclient_classifytext_sync] +import com.google.cloud.language.v1.ClassificationModelOptions; import com.google.cloud.language.v1.ClassifyTextRequest; import com.google.cloud.language.v1.ClassifyTextResponse; import com.google.cloud.language.v1.Document; @@ -36,7 +37,10 @@ public static void syncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ClassifyTextResponse response = languageServiceClient.classifyText(request); } } diff --git a/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java b/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java index ab9f2a1fe33d..7eeee4a88f88 100644 --- a/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java +++ b/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/AsyncClassifyText.java @@ -18,6 +18,7 @@ // [START language_v1beta2_generated_languageserviceclient_classifytext_async] import com.google.api.core.ApiFuture; +import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; import com.google.cloud.language.v1beta2.ClassifyTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -37,7 +38,10 @@ public static void asyncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ApiFuture future = languageServiceClient.classifyTextCallable().futureCall(request); // Do something. diff --git a/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java b/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java index 11f02cd06735..9d74f92bca71 100644 --- a/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java +++ b/java-language/samples/snippets/generated/com/google/cloud/language/v1beta2/languageserviceclient/classifytext/SyncClassifyText.java @@ -17,6 +17,7 @@ package com.google.cloud.language.v1beta2.samples; // [START language_v1beta2_generated_languageserviceclient_classifytext_sync] +import com.google.cloud.language.v1beta2.ClassificationModelOptions; import com.google.cloud.language.v1beta2.ClassifyTextRequest; import com.google.cloud.language.v1beta2.ClassifyTextResponse; import com.google.cloud.language.v1beta2.Document; @@ -36,7 +37,10 @@ public static void syncClassifyText() throws Exception { // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { ClassifyTextRequest request = - ClassifyTextRequest.newBuilder().setDocument(Document.newBuilder().build()).build(); + ClassifyTextRequest.newBuilder() + .setDocument(Document.newBuilder().build()) + .setClassificationModelOptions(ClassificationModelOptions.newBuilder().build()) + .build(); ClassifyTextResponse response = languageServiceClient.classifyText(request); } } diff --git a/java-language/samples/snippets/pom.xml b/java-language/samples/snippets/pom.xml new file mode 100644 index 000000000000..87623a8a22f2 --- /dev/null +++ b/java-language/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google Natural Language Snippets + https://github.com/googleapis/java-language + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-language + 2.3.4 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + +