{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-natural-language/json-schema/google-cloud-natural-language-annotate-text-request-schema.json",
  "title": "AnnotateTextRequest",
  "description": "The request message for the text annotation API, which can perform multiple analysis types in one call.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-natural-language-documents-api-openapi.yml#/components/schemas/AnnotateTextRequest",
  "type": "object",
  "properties": {
    "features": {
      "$ref": "#/$defs/AnnotateTextRequestFeatures",
      "description": "Required. The enabled features."
    },
    "document": {
      "$ref": "#/$defs/Document",
      "description": "Required. Input document."
    },
    "encodingType": {
      "enum": [
        "NONE",
        "UTF8",
        "UTF16",
        "UTF32"
      ],
      "description": "The encoding type used by the API to calculate offsets.",
      "type": "string"
    }
  },
  "$defs": {
    "AnnotateTextRequestFeatures": {
      "type": "object",
      "properties": {
        "extractEntities": {
          "description": "Optional. Extract entities.",
          "type": "boolean"
        },
        "classifyText": {
          "description": "Optional. Classify the full document into categories.",
          "type": "boolean"
        },
        "extractDocumentSentiment": {
          "description": "Optional. Extract document-level sentiment.",
          "type": "boolean"
        },
        "moderateText": {
          "description": "Optional. Moderate the document for harmful and sensitive categories.",
          "type": "boolean"
        }
      },
      "description": "All available features. Setting each one to true will enable that specific analysis for the input."
    },
    "Document": {
      "properties": {
        "type": {
          "enum": [
            "TYPE_UNSPECIFIED",
            "PLAIN_TEXT",
            "HTML"
          ],
          "description": "Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.",
          "type": "string"
        },
        "gcsContentUri": {
          "description": "The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.",
          "type": "string"
        },
        "languageCode": {
          "type": "string",
          "description": "Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. [Language Support](https://cloud.google.com/natural-language/docs/languages) lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an `INVALID_ARGUMENT` error is returned."
        },
        "content": {
          "type": "string",
          "description": "The content of the input in string format. Cloud audit logging exempt since it is based on user data."
        }
      },
      "description": "Represents the input to API methods.",
      "type": "object"
    }
  }
}