
    ZThg
                        d dl mZ d dlmZ d dlmZmZmZmZ d dlm	Z	 d dl
mZ d dl
mZ d dlmZ d dlmZ d d	lmZmZmZ  G d
 de      Z G d de      Z G d de      Zy)    )annotations)datetime)DictListType	TypedDict) IngestWithConfigDataChannelValue)ChannelConfig)
FlowConfig)Self)
AsProtobuf)r
   ChannelValuechannel_fqnc                  R    e Zd ZU dZded<   ded<   ded<   ddZdd	Zedd
       Zy)r   ax  
    Describes a flow which is a set of channels whose values are often ingested together, allowing
    users to send multiple data points for multiple channels in a single request.

    `channel_by_fqn`:
        A mapping of a channel's fully-qualified name to the index of the `sift_py.ingestion.channel.ChannelConfig`
        as it appears in the `channels` attribute.
    strnameList[ChannelConfig]channelszDict[str, int]channel_by_fqnc                    || _         || _        t        |      D ci c]  \  }}t        |      | c}}| _        y c c}}w )N)r   r   	enumerater   r   )selfr   r   ics        [/home/www/backend.miabetepe.com/venv/lib/python3.12/site-packages/sift_py/ingestion/flow.py__init__zFlowConfig.__init__!   s8    	 =Fx=PQTQ{1~q0QQs   =c           	          || j                   | j                  D cg c]  }|j                  t               c}      S c c}w N)r   r   )r   r   as_pbChannelConfigPb)r   klassconfs      r   r   zFlowConfig.as_pb&   s4    >BmmLddjj1L
 	
L   A 
c           	          | |j                   |j                  D cg c]  }t        j                  |       c}      S c c}w r   )r   r   r
   from_pb)clsmessager   s      r   r%   zFlowConfig.from_pb,   s8    8?8H8HI1m++A.I
 	
Ir#   N)r   r   r   r   )r!   zType[FlowConfigPb]returnFlowConfigPb)r'   r)   r(   r   )	__name__
__module____qualname____doc____annotations__r   r   classmethodr%        r   r   r      s9     I!!""R

 
 
r1   r   c                  0    e Zd ZU dZded<   ded<   ded<   y)	FlowaU  
    Represents a single flow that will be sent to Sift. Because this class uses `sift_py.ingestion.channel.ChannelValue`
    which is a fully qualified channel value, a specific ordering of items in `channel_values` is not required. If a
    particular flow has 5 channels, it is okay to send only data for 3 channels using this class.
    r   	flow_namer   	timestampzList[ChannelValue]channel_valuesNr*   r+   r,   r-   r.   r0   r1   r   r3   r3   4   s     N&&r1   r3   c                  0    e Zd ZU dZded<   ded<   ded<   y)	FlowOrderedChannelValuesap  
    Represents a single flow that will be sent to Sift. Unlike `sift_py.ingestion.flow.Flow`, this class requires
    that the ordering of channel values in `channel_values` match what the flow associated with `flow_name` expects.
    If a channel doesn't have particular data to send for a particular time, `sift_py.ingestion.channel.empty_value` should be used
    r   r4   r   r5   z&List[IngestWithConfigDataChannelValue]r6   Nr7   r0   r1   r   r9   r9   @   s     N::r1   r9   N)
__future__r   r   typingr   r   r   r   sift.ingest.v1.ingest_pb2r	   /sift.ingestion_configs.v2.ingestion_configs_pb2r
   r    r   r)   typing_extensionsr   "sift_py._internal.convert.protobufr   sift_py.ingestion.channelr   r   r3   r9   r0   r1   r   <module>rA      sQ    "  . . F # 9 N N
 
B	'9 	'	;y 	;r1   