code: public final DetectLanguageResponse detectLanguage(String parent, String model, String mimeType) {
      if (!parent.isEmpty()) {
        LOCATION_PATH_TEMPLATE.validate(parent, "detectLanguage");
      }
      DetectLanguageRequest request =
          DetectLanguageRequest.newBuilder()
              .setParent(parent)
              .setModel(model)
              .setMimeType(mimeType)
              .build();
      return detectLanguage(request);
    }
docs: Detects the language of text within a request.
  
  <p>Sample code:
  
  <pre><code>
  try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
  String formattedParent = TranslationServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
  String model = "";
  String mimeType = "";
  DetectLanguageResponse response = translationServiceClient.detectLanguage(formattedParent, model, mimeType);
  }
  </code></pre>
  
  @param parent Optional. Only used when making regionalized call. Format:
  projects/{project-id}/locations/{location-id}.
  <p>Only custom model within the same location-id can be used. Otherwise 400 is returned.
  @param model Optional. The language detection model to be used.
  projects/{project-id}/locations/{location-id}/models/language-detection/{model-id} If not
  specified, default will be used.
  @param mimeType Optional. The format of the source text, for example, "text/html",
  "text/plain". If left blank, the MIME type is assumed to be "text/html".
  @throws com.google.api.gax.rpc.ApiException if the remote call fails