
    i                     l    d dl mZ ddlmZmZmZ d dlmZ d dlm	Z	 d dl
mZmZmZmZmZ  G d d      Zy	)
   )	none_type    )DictListCallable)	ApiClient)
HeaderUtil)EndpointUtilsEndpointParamsMapDictEndpointRootMapDictEndpointSettingsDictExtraOpenApiKwargsTypedDictc                   X    e Zd Zdedededeeee   f   de	de
fdZd Zd	 Zd
edefdZy)Endpointsettings
params_maproot_mapheaders_map
api_clientcallablec           
         || _         || _        | j                  d   j                  g d       | j                  d   j                  dg       |d   | _        |d   | _        |d   | _        t        ft        ft        ft        t        t        ft        gt        t        ft        gft        ft        ft        fd}| j
                  j                  |       |d   | _        |d	   | _        |d
   | _        || _        || _        || _        y)aU  Creates an endpoint

        Args:
            settings (dict): see below key value pairs
                'response_type' (tuple/None): response type
                'auth' (list): a list of auth type keys
                'endpoint_path' (str): the endpoint path
                'operation_id' (str): endpoint string identifier
                'http_method' (str): POST/PUT/PATCH/GET etc
                'servers' (list): list of str servers that this endpoint is at
            params_map (dict): see below key value pairs
                'all' (list): list of str endpoint parameter names
                'required' (list): list of required parameter names
                'nullable' (list): list of nullable parameter names
                'enum' (list): list of parameters with enum values
                'validation' (list): list of parameters with validations
            root_map
                'validations' (dict): the dict mapping endpoint parameter tuple
                    paths to their validation dictionaries
                'allowed_values' (dict): the dict mapping endpoint parameter
                    tuple paths to their allowed_values (enum) dictionaries
                'openapi_types' (dict): param_name to openapi type
                'attribute_map' (dict): param_name to camelCase name
                'location_map' (dict): param_name to  'body', 'file', 'form',
                    'header', 'path', 'query'
                collection_format_map (dict): param_name to `csv` etc.
            headers_map (dict): see below key value pairs
                'accept' (list): list of Accept header strings
                'content_type' (list): list of Content-Type header strings
            api_client (ApiClient) api client instance
            callable (function): the function which is invoked when the
                Endpoint is called
        all)	async_reqasync_threadpool_executor_preload_content_request_timeout_return_http_data_only_check_input_type_check_return_typenullabler   validationsallowed_valuesopenapi_typesattribute_maplocation_mapcollection_format_mapN)r   r   extendr!   r"   r#   boolr   floatintupdater$   r%   r&   r   r   r   )selfr   r   r   r   r   r   extra_typess           s/var/www/catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/pinecone/openapi_support/endpoint.py__init__zEndpoint.__init__   s	   T !$%%
	
 	
#**,>+?@#M2&'78%o6*.!%!*EE8eWcC6TWSX Y'+g"&#''
 	!!+.%o6$^4%-.E%F"&$     c                 .     | j                   | g|i |S )a  This method is invoked when endpoints are called
        Example:

        api_instance = InferenceApi()
        api_instance.embed  # this is an instance of the class Endpoint
        api_instance.embed()  # this invokes api_instance.embed.__call__()
        which then invokes the callable functions stored in that endpoint at
        api_instance.embed.callable or self.callable in this class

        )r   )r,   argskwargss      r.   __call__zEndpoint.__call__[   s     t}}T3D3F33r0   c                    | j                   j                  j                  }t        j                  | j
                  | j                  |       t        j                  | j
                  | j                  |       t        j                  | j                   j                  | j
                  | j                  | j                  | j                  |       t        j                  | j                  | j                  | j                  | j                  |      }t!        j"                  | j$                  |       | j                   j'                  | j                  d   | j                  d   |d   |d   |d	   |d
   |d   |d   | j                  d   | j                  d   |d   |j)                  dd       |d   |d   |d   |d   ||d         S )N)r   r   r3   )configr   r"   r!   r#   r3   )r$   r%   r#   r&   r3   )r   paramsendpoint_pathhttp_methodpathqueryheaderbodyformfileresponse_typeauthr   r   r   r   r   r   collection_format)path_paramsquery_paramsheader_paramsr=   post_paramsfilesr@   auth_settingsr   r   _check_typer   r   r   _hostcollection_formats)r   configurationhostr
   raise_if_unexpected_paramr   r    raise_if_missing_required_paramsraise_if_invalid_inputsr"   r!   r#   gather_paramsr$   r%   r&   r	   prepare_headersr   call_apiget)r,   r3   rJ   r7   s       r.   call_with_http_infozEndpoint.call_with_http_infoh   s   --22//v	
 	66v	
 	--??00..((,,	
 ,,,,**,,"&"<"<
 	""t/?/?O''MM/*MM-(v *v.--8--/[)&,jj1Ld&S34#)*B#C#$67#$67%&9:% ( 
 	
r0   r3   returnc                    |j                  dd      |d<   |j                  dd      |d<   |j                  dd      |d<   |j                  dd       |d<   |j                  dd      |d<   |j                  dd      |d<   |S )	Nr   Fr   Tr   r   r   r   )rT   )r,   r3   s     r.   _process_openapi_kwargsz Endpoint._process_openapi_kwargs   s     %jje<{+1::6NPT+U'(%+ZZ0BD%I!"%+ZZ0BD%I!"&,jj1Dd&K"#'-zz2F'M#$r0   N)__name__
__module____qualname__r   r   r   r   strr   r   r   r/   r4   rU   r   rX    r0   r.   r   r      sv    J!&J! *J! &	J!
 #tCy.)J! J! J!X41
f	1		$	r0   r   N)model_utilsr   typingr   r   r   r   r   api_client_utilsr	   endpoint_utilsr
   r   r   r   r   r   r]   r0   r.   <module>rb      s*    " ' ' ! ( V Vr0   