code: public final AnalyzeSentimentResponse analyzeSentiment(
        Document document, EncodingType encodingType) {
  
      AnalyzeSentimentRequest request =
          AnalyzeSentimentRequest.newBuilder()
              .setDocument(document)
              .setEncodingType(encodingType)
              .build();
      return analyzeSentiment(request);
    }
docs: Analyzes the sentiment of the provided text.
  
  <p>Sample code:
  
  <pre><code>
  try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
  Document document = Document.newBuilder().build();
  EncodingType encodingType = EncodingType.NONE;
  AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType);
  }
  </code></pre>
  
  @param document Input document.
  @param encodingType The encoding type used by the API to calculate sentence offsets.
  @throws com.google.api.gax.rpc.ApiException if the remote call fails