{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-platform/json-schema/google-cloud-platform-send-message-response-schema.json",
  "title": "SendMessageResponse",
  "description": "////// Response 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/SendMessageResponse",
  "type": "object",
  "properties": {
    "message": {
      "$ref": "#/$defs/Message"
    },
    "task": {
      "$ref": "#/$defs/Task"
    }
  },
  "$defs": {
    "Artifact": {
      "description": "Artifacts are the container for task completed results. These are similar to Messages but are intended to be the product of a task, as opposed to point-to-point communication.",
      "properties": {
        "artifactId": {
          "description": "Unique identifier (e.g. UUID) for the artifact. It must be at least unique within a task.",
          "type": "string"
        },
        "metadata": {
          "description": "Optional metadata included with the artifact.",
          "type": "object",
          "additionalProperties": {
            "description": "Properties of the object."
          }
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Part"
          },
          "description": "The content of the artifact."
        },
        "name": {
          "type": "string",
          "description": "A human readable name for the artifact."
        },
        "extensions": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "The URIs of extensions that are present or contributed to this Artifact."
        },
        "description": {
          "type": "string",
          "description": "A human readable description of the artifact, optional."
        }
      },
      "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"
        }
      }
    },
    "Task": {
      "type": "object",
      "properties": {
        "id": {
          "description": "Unique identifier (e.g. UUID) for the task, generated by the server for a new task.",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/TaskStatus",
          "description": "The current status of a Task, including state and a message."
        },
        "metadata": {
          "additionalProperties": {
            "description": "Properties of the object."
          },
          "type": "object",
          "description": "protolint:enable REPEATED_FIELD_NAMES_PLURALIZED A key/value object to store custom metadata about a task."
        },
        "contextId": {
          "description": "Unique identifier (e.g. UUID) for the contextual collection of interactions (tasks and messages). Created by the A2A server.",
          "type": "string"
        },
        "artifacts": {
          "description": "A set of output artifacts for a Task.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Artifact"
          }
        },
        "history": {
          "items": {
            "$ref": "#/$defs/Message"
          },
          "description": "protolint:disable REPEATED_FIELD_NAMES_PLURALIZED The history of interactions from a task.",
          "type": "array"
        }
      },
      "description": "Task is the core unit of action for A2A. It has a current status and when results are created for the task they are stored in the artifact. If there are multiple turns for a task, these are stored in history."
    },
    "TaskStatus": {
      "description": "A container for the status of a task",
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "google-datetime",
          "description": "Timestamp when the status was recorded. Example: \"2023-10-27T10:00:00Z\""
        },
        "state": {
          "enum": [
            "TASK_STATE_UNSPECIFIED",
            "TASK_STATE_SUBMITTED",
            "TASK_STATE_WORKING",
            "TASK_STATE_COMPLETED",
            "TASK_STATE_FAILED",
            "TASK_STATE_CANCELLED",
            "TASK_STATE_INPUT_REQUIRED",
            "TASK_STATE_REJECTED",
            "TASK_STATE_AUTH_REQUIRED"
          ],
          "type": "string",
          "description": "The current state of this task"
        },
        "message": {
          "$ref": "#/$defs/Message",
          "description": "A message associated with the status."
        }
      }
    }
  }
}