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

from __future__ import annotations
from .rendertemplaterequestbody import (
    RenderTemplateRequestBody,
    RenderTemplateRequestBodyTypedDict,
)
from gram_ai.types import BaseModel
from gram_ai.utils import (
    FieldMetadata,
    HeaderMetadata,
    QueryParamMetadata,
    RequestMetadata,
    SecurityMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class RenderTemplateSecurityOption1TypedDict(TypedDict):
    project_slug_header_gram_project: str
    session_header_gram_session: str


class RenderTemplateSecurityOption1(BaseModel):
    project_slug_header_gram_project: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="apiKey",
                sub_type="header",
                field_name="Gram-Project",
            )
        ),
    ]

    session_header_gram_session: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="apiKey",
                sub_type="header",
                field_name="Gram-Session",
            )
        ),
    ]


class RenderTemplateSecurityOption2TypedDict(TypedDict):
    apikey_header_gram_key: str
    project_slug_header_gram_project: str


class RenderTemplateSecurityOption2(BaseModel):
    apikey_header_gram_key: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="apiKey",
                sub_type="header",
                field_name="Gram-Key",
            )
        ),
    ]

    project_slug_header_gram_project: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="apiKey",
                sub_type="header",
                field_name="Gram-Project",
            )
        ),
    ]


class RenderTemplateSecurityTypedDict(TypedDict):
    option1: NotRequired[RenderTemplateSecurityOption1TypedDict]
    option2: NotRequired[RenderTemplateSecurityOption2TypedDict]


class RenderTemplateSecurity(BaseModel):
    option1: Annotated[
        Optional[RenderTemplateSecurityOption1],
        FieldMetadata(security=SecurityMetadata(option=True)),
    ] = None

    option2: Annotated[
        Optional[RenderTemplateSecurityOption2],
        FieldMetadata(security=SecurityMetadata(option=True)),
    ] = None


class RenderTemplateRequestTypedDict(TypedDict):
    id: str
    r"""The ID of the prompt template to render"""
    render_template_request_body: RenderTemplateRequestBodyTypedDict
    gram_key: NotRequired[str]
    r"""API Key header"""
    gram_session: NotRequired[str]
    r"""Session header"""
    gram_project: NotRequired[str]
    r"""project header"""


class RenderTemplateRequest(BaseModel):
    id: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""The ID of the prompt template to render"""

    render_template_request_body: Annotated[
        RenderTemplateRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]

    gram_key: Annotated[
        Optional[str],
        pydantic.Field(alias="Gram-Key"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""API Key header"""

    gram_session: Annotated[
        Optional[str],
        pydantic.Field(alias="Gram-Session"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""Session header"""

    gram_project: Annotated[
        Optional[str],
        pydantic.Field(alias="Gram-Project"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""project header"""
