"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .canonicaltoolattributes import (
    CanonicalToolAttributes,
    CanonicalToolAttributesTypedDict,
)
from .toolvariation import ToolVariation, ToolVariationTypedDict
from datetime import datetime
from gram_ai.types import BaseModel
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class HTTPToolDefinitionTypedDict(TypedDict):
    canonical_name: str
    r"""The canonical name of the tool. Will be the same as the name if there is no variation."""
    confirm: str
    r"""Confirmation mode for the tool"""
    created_at: datetime
    r"""The creation date of the tool."""
    deployment_id: str
    r"""The ID of the deployment"""
    description: str
    r"""Description of the tool"""
    http_method: str
    r"""HTTP method for the request"""
    id: str
    r"""The ID of the HTTP tool"""
    name: str
    r"""The name of the tool"""
    path: str
    r"""Path for the request"""
    project_id: str
    r"""The ID of the project"""
    schema_: str
    r"""JSON schema for the request"""
    summary: str
    r"""Summary of the tool"""
    tags: List[str]
    r"""The tags list for this http tool"""
    updated_at: datetime
    r"""The last update date of the tool."""
    canonical: NotRequired[CanonicalToolAttributesTypedDict]
    r"""The original details of a tool"""
    confirm_prompt: NotRequired[str]
    r"""Prompt for the confirmation"""
    openapiv3_document_id: NotRequired[str]
    r"""The ID of the OpenAPI v3 document"""
    openapiv3_operation: NotRequired[str]
    r"""OpenAPI v3 operation"""
    package_name: NotRequired[str]
    r"""The name of the source package"""
    schema_version: NotRequired[str]
    r"""Version of the schema"""
    security: NotRequired[str]
    r"""Security requirements for the underlying HTTP endpoint"""
    summarizer: NotRequired[str]
    r"""Summarizer for the tool"""
    variation: NotRequired[ToolVariationTypedDict]


class HTTPToolDefinition(BaseModel):
    canonical_name: str
    r"""The canonical name of the tool. Will be the same as the name if there is no variation."""

    confirm: str
    r"""Confirmation mode for the tool"""

    created_at: datetime
    r"""The creation date of the tool."""

    deployment_id: str
    r"""The ID of the deployment"""

    description: str
    r"""Description of the tool"""

    http_method: str
    r"""HTTP method for the request"""

    id: str
    r"""The ID of the HTTP tool"""

    name: str
    r"""The name of the tool"""

    path: str
    r"""Path for the request"""

    project_id: str
    r"""The ID of the project"""

    schema_: Annotated[str, pydantic.Field(alias="schema")]
    r"""JSON schema for the request"""

    summary: str
    r"""Summary of the tool"""

    tags: List[str]
    r"""The tags list for this http tool"""

    updated_at: datetime
    r"""The last update date of the tool."""

    canonical: Optional[CanonicalToolAttributes] = None
    r"""The original details of a tool"""

    confirm_prompt: Optional[str] = None
    r"""Prompt for the confirmation"""

    openapiv3_document_id: Optional[str] = None
    r"""The ID of the OpenAPI v3 document"""

    openapiv3_operation: Optional[str] = None
    r"""OpenAPI v3 operation"""

    package_name: Optional[str] = None
    r"""The name of the source package"""

    schema_version: Optional[str] = None
    r"""Version of the schema"""

    security: Optional[str] = None
    r"""Security requirements for the underlying HTTP endpoint"""

    summarizer: Optional[str] = None
    r"""Summarizer for the tool"""

    variation: Optional[ToolVariation] = None
