{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-platform/json-schema/google-cloud-platform-send-message-request-schema.json",
  "title": "SendMessageRequest",
  "description": "/////////// Request Messages ///////////",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-platform-cloudbilling-message-api-openapi.yml#/components/schemas/SendMessageRequest",
  "properties": {
    "metadata": {
      "type": "object",
      "description": "Optional metadata for the request.",
      "additionalProperties": {
        "description": "Properties of the object."
      }
    },
    "configuration": {
      "$ref": "#/$defs/SendMessageConfiguration",
      "description": "Configuration for the send request."
    },
    "tenant": {
      "type": "string",
      "description": "Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release."
    },
    "message": {
      "$ref": "#/$defs/Message",
      "description": "Required. The message to send to the agent."
    }
  },
  "type": "object",
  "$defs": {
    "AuthenticationInfo": {
      "description": "Defines authentication details, used for push notifications.",
      "properties": {
        "schemes": {
          "description": "Supported authentication schemes - e.g. Basic, Bearer, etc",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "credentials": {
          "description": "Optional credentials",
          "type": "string"
        }
      },
      "type": "object"
    },
    "DataPart": {
      "properties": {
        "data": {
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "type": "object"
        }
      },
      "description": "DataPart represents a structured blob. This is most commonly a JSON payload.",
      "type": "object"
    },
    "FilePart": {
      "properties": {
        "name": {
          "type": "string"
        },
        "fileWithBytes": {
          "type": "string",
          "format": "byte"
        },
        "mimeType": {
          "type": "string"
        },
        "fileWithUri": {
          "type": "string"
        }
      },
      "description": "FilePart represents the different ways files can be provided. If files are small, directly feeding the bytes is supported via file_with_bytes. If the file is large, the agent should read the content as appropriate directly from the file_with_uri source.",
      "type": "object"
    },
    "Message": {
      "type": "object",
      "properties": {
        "content": {
          "items": {
            "$ref": "#/$defs/Part"
          },
          "description": "protolint:disable REPEATED_FIELD_NAMES_PLURALIZED Content is the container of the message content.",
          "type": "array"
        },
        "extensions": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "The URIs of extensions that are present or contributed to this Message."
        },
        "role": {
          "enum": [
            "ROLE_UNSPECIFIED",
            "ROLE_USER",
            "ROLE_AGENT"
          ],
          "description": "A role for the message.",
          "type": "string"
        },
        "taskId": {
          "description": "The task id of the message. This is optional and if set, the message will be associated with the given task.",
          "type": "string"
        },
        "messageId": {
          "description": "The unique identifier (e.g. UUID)of the message. This is required and created by the message creator.",
          "type": "string"
        },
        "contextId": {
          "description": "The context id of the message. This is optional and if set, the message will be associated with the given context.",
          "type": "string"
        },
        "metadata": {
          "description": "protolint:enable REPEATED_FIELD_NAMES_PLURALIZED Any optional metadata to provide along with the message.",
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object."
          }
        }
      },
      "description": "Message is one unit of communication between client and server. It is associated with a context and optionally a task. Since the server is responsible for the context definition, it must always provide a context_id in its messages. The client can optionally provide the context_id if it knows the context to associate the message to. Similarly for task_id, except the server decides if a task is created and whether to include the task_id."
    },
    "Part": {
      "description": "Part represents a container for a section of communication content. Parts can be purely textual, some sort of file (image, video, etc) or a structured data blob (i.e. JSON).",
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "metadata": {
          "description": "Optional metadata associated with this part.",
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object."
          }
        },
        "file": {
          "$ref": "#/$defs/FilePart"
        },
        "data": {
          "$ref": "#/$defs/DataPart"
        }
      }
    },
    "PushNotificationConfig": {
      "properties": {
        "token": {
          "description": "Token unique for this task/session",
          "type": "string"
        },
        "authentication": {
          "$ref": "#/$defs/AuthenticationInfo",
          "description": "Information about the authentication to sent with the notification"
        },
        "id": {
          "description": "A unique identifier (e.g. UUID) for this push notification.",
          "type": "string"
        },
        "url": {
          "description": "Url to send the notification too",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Configuration for setting up push notifications for task updates."
    },
    "SendMessageConfiguration": {
      "type": "object",
      "properties": {
        "historyLength": {
          "type": "integer",
          "format": "int32",
          "description": "The maximum number of messages to include in the history. if 0, the history will be unlimited."
        },
        "acceptedOutputModes": {
          "type": "array",
          "description": "The output modes that the agent is expected to respond with.",
          "items": {
            "type": "string"
          }
        },
        "blocking": {
          "type": "boolean",
          "description": "If true, the message will be blocking until the task is completed. If false, the message will be non-blocking and the task will be returned immediately. It is the caller's responsibility to check for any task updates."
        },
        "pushNotification": {
          "$ref": "#/$defs/PushNotificationConfig",
          "description": "A configuration of a webhook that can be used to receive updates"
        }
      },
      "description": "Configuration of a send message request."
    }
  }
}