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

from __future__ import annotations
from ascend_sdk.types import BaseModel
from ascend_sdk.utils import FieldMetadata, SecurityMetadata
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ServiceAccountCredsTypedDict(TypedDict):
    private_key: str
    name: str
    organization: str
    type: str


class ServiceAccountCreds(BaseModel):
    private_key: Annotated[str, pydantic.Field(alias="privateKey")]

    name: str

    organization: str

    type: str


class SecurityTypedDict(TypedDict):
    api_key: NotRequired[str]
    service_account_creds: NotRequired[ServiceAccountCredsTypedDict]


class Security(BaseModel):
    api_key: Annotated[
        Optional[str],
        pydantic.Field(alias="apiKey"),
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True, scheme_type="http", sub_type="custom", field_name="apiKey"
            )
        ),
    ] = None

    service_account_creds: Annotated[
        Optional[ServiceAccountCreds],
        pydantic.Field(alias="serviceAccountCreds"),
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="http",
                sub_type="custom",
                field_name="serviceAccountCreds",
            )
        ),
    ] = None
