
    G)f                        U d dl Z d dlZd dlmZ  ej                  d      Zej                  ej                  e   ef   Z	 G d de j                  ej                  e         Z G d de j                  ej                  e         Z G d d	eej                  ee	f            Z e       Zee   ed
<    G d deej$                  ee	f            Z e       Zee   ed<    G d de j                        Zy)    N)ContextCarrierTc            	           e Zd ZdZej
                  dededej                  ej                  e      fd       Zej
                  dedej                  e   fd       Zy)GetterzaThis class implements a Getter that enables extracting propagated
    fields from a carrier.
    carrierkeyreturnc                      y)a  Function that can retrieve zero
        or more values from the carrier. In the case that
        the value does not exist, returns None.

        Args:
            carrier: An object which contains values that are used to
                    construct a Context.
            key: key of a field in carrier.
        Returns: first value of the propagation key or None if the key doesn't
                exist.
        N )selfr   r   s      d/var/www/html/flask-app/venv/lib/python3.12/site-packages/mysql/opentelemetry/propagators/textmap.pygetz
Getter.get           c                      y)zFunction that can retrieve all the keys in a carrier object.

        Args:
            carrier: An object which contains values that are
                used to construct a Context.
        Returns:
            list of keys from the carrier.
        Nr   r   r   s     r   keyszGetter.keys+   r   r   N)__name__
__module____qualname____doc__abcabstractmethodr   strtypingOptionalListr   r   r   r   r   r   r      sy     	8 # &//&++cBR2S   	H S)9  r   r   c            	       F    e Zd ZdZej
                  dedededdfd       Zy)Setterz`This class implements a Setter that enables injecting propagated
    fields into a carrier.
    r   r   valuer	   Nc                      y)a  Function that can set a value into a carrier""

        Args:
            carrier: An object which contains values that are used to
                    construct a Context.
            key: key of a field in carrier.
            value: value for a field in carrier.
        Nr   r   r   r   r    s       r   setz
Setter.set<   r   r   )	r   r   r   r   r   r   r   r   r#   r   r   r   r   r   7   s=     	8 # c d  r   r   c                       e Zd Zdej                  eef   dedej                  ej                  e      fdZ	dej                  eef   dej                  e   fdZ
y)DefaultGetterr   r   r	   c                     |j                  |d      }|yt        |t        j                        rt        |t              st        |      S |gS )a  Getter implementation to retrieve a value from a dictionary.

        Args:
            carrier: dictionary in which to get value
            key: the key used to get the value
        Returns:
            A list with a single string with the value if it exists, else None.
        N)r   
isinstancer   Iterabler   list)r   r   r   vals       r   r   zDefaultGetter.getI   sD     kk#t$;c6??+JsC4H9ur   c                 4    t        |j                               S )z<Keys implementation that returns all keys from a dictionary.)r)   r   r   s     r   r   zDefaultGetter.keys[   s    GLLN##r   N)r   r   r   r   Mappingr   CarrierValTr   r   r   r   r   r   r   r%   r%   H   si    ~~c;&67>A	S)	*$$FNN3+;< $SAQ $r   r%   default_getterc                   B    e Zd Zdej                  eef   dededdfdZy)DefaultSetterr   r   r    r	   Nc                     |||<   y)zSetter implementation to set a value into a dictionary.

        Args:
            carrier: dictionary in which to set value
            key: the key used to set the value
            value: the value to set
        Nr   r"   s       r   r#   zDefaultSetter.setd   s     r   )r   r   r   r   MutableMappingr   r-   r#   r   r   r   r0   r0   c   s=    &&sK'78  	
 
r   r0   default_setterc            
          e Zd ZdZej
                  defdedej                  e
   dee   de
fd       Zej
                  defdedej                  e
   dee   ddfd	       Zeej
                  dej"                  e   fd
              Zy)TextMapPropagatoraO  This class provides an interface that enables extracting and injecting
    context into headers of HTTP requests. HTTP frameworks and clients
    can integrate with TextMapPropagator by providing the object containing the
    headers, and a getter and setter function for the extraction and
    injection of values, respectively.

    Nr   contextgetterr	   c                      y)aL  Create a Context from values in the carrier.

        The extract function should retrieve values from the carrier
        object using getter, and use values to populate a
        Context value and return it.

        Args:
            getter: a function that can retrieve zero
                or more values from the carrier. In the case that
                the value does not exist, return an empty list.
            carrier: and object which contains values that are
                used to construct a Context. This object
                must be paired with an appropriate getter
                which understands how to extract a value from it.
            context: an optional Context to use. Defaults to root
                context if not set.
        Returns:
            A Context with configuration found in the carrier.

        Nr   )r   r   r6   r7   s       r   extractzTextMapPropagator.extract   r   r   setterc                      y)a  Inject values from a Context into a carrier.

        inject enables the propagation of values into HTTP clients or
        other objects which perform an HTTP request. Implementations
        should use the `Setter` 's set method to set values on the
        carrier.

        Args:
            carrier: An object that a place to define HTTP headers.
                Should be paired with setter, which should
                know how to set header values on the carrier.
            context: an optional Context to use. Defaults to current
                context if not set.
            setter: An optional `Setter` object that can set values
                on the carrier.

        Nr   )r   r   r6   r:   s       r   injectzTextMapPropagator.inject   r   r   c                      y)a*  
        Gets the fields set in the carrier by the `inject` method.

        If the carrier is reused, its fields that correspond with the ones
        present in this attribute should be deleted before calling `inject`.

        Returns:
            A set with the fields set in `inject`.
        Nr   )r   s    r   fieldszTextMapPropagator.fields   r   r   )r   r   r   r   r   r   r.   r   r   r   r   r   r9   r3   r   r<   propertySetr   r>   r   r   r   r5   r5   w   s     	 -1#1	 ) x 	
 
 6 	 -1#1	 ) x 	
 
 0 	

3 	  	r   r5   )r   r   #mysql.opentelemetry.context.contextr   TypeVarr   Unionr   r   r-   ABCGenericr   r   r,   r%   r.   __annotations__r2   r0   r3   r5   r   r   r   <module>rG      s      76>>*%ll6;;s+S01SWWfnnX. >SWWfnnX. "$F6>>#{*:;< $0 $1?x  2F600k1ABC " $1?x  2I Ir   