# Code generated by smithy-python-codegen DO NOT EDIT.

from dataclasses import dataclass
from typing import Any, Callable, TypeAlias, Union

from smithy_core.aio.endpoints import StaticEndpointResolver
from smithy_core.aio.interfaces import EndpointResolver as _EndpointResolver
from smithy_core.interceptors import Interceptor
from smithy_core.interfaces import URI
from smithy_core.interfaces.retries import RetryStrategy
from smithy_core.retries import SimpleRetryStrategy
from smithy_http.aio.aiohttp import AIOHTTPClient
from smithy_http.aio.interfaces import HTTPClient
from smithy_http.interfaces import HTTPRequestConfiguration

from .models import QueryAgentInput, QueryAgentOutput


_ServiceInterceptor = Union[Interceptor[QueryAgentInput, QueryAgentOutput, Any, Any]]
@dataclass(init=False)
class Config:
    """Configuration for Vibe."""

    endpoint_resolver: _EndpointResolver
    endpoint_uri: str | URI | None
    http_client: HTTPClient
    http_request_config: HTTPRequestConfiguration | None
    interceptors: list[_ServiceInterceptor]
    retry_strategy: RetryStrategy

    def __init__(
        self,
        *,
        endpoint_resolver: _EndpointResolver | None = None,
        endpoint_uri: str | URI | None = None,
        http_client: HTTPClient | None = None,
        http_request_config: HTTPRequestConfiguration | None = None,
        interceptors: list[_ServiceInterceptor] | None = None,
        retry_strategy: RetryStrategy | None = None,
    ):
        """Constructor.

        :param endpoint_resolver:
             The endpoint resolver used to resolve the final endpoint per-operation based on
             the configuration.

        :param endpoint_uri:
             A static URI to route requests to.

        :param http_client:
             The HTTP client used to make requests.

        :param http_request_config:
             Configuration for individual HTTP requests.

        :param interceptors:
             The list of interceptors, which are hooks that are called during the execution
             of a request.

        :param retry_strategy:
             The retry strategy for issuing retry tokens and computing retry delays.

        """
        self.endpoint_resolver = endpoint_resolver or StaticEndpointResolver()
        self.endpoint_uri = endpoint_uri
        self.http_client = http_client or AIOHTTPClient()
        self.http_request_config = http_request_config
        self.interceptors = interceptors or []
        self.retry_strategy = retry_strategy or SimpleRetryStrategy()

#
# A callable that allows customizing the config object on each request.
#
Plugin: TypeAlias = Callable[[Config], None]
