
    dh'                        S SK JrJrJrJrJr  S SKJr  S SKJ	r	  S SK
Jr  \\\\   /\4   r " S S\5      r " S S\5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)    )AnyCallableIteratorMappingOptional)Document)guard_import)
BaseLoaderc                       \ rS rSrSr  SS\\\4   S\S\S\\	   S\\   S	S4S
 jjr
S	\\   4S jr\S	\4S j5       rSrg)AirbyteCDKLoader   zDLoad with an `Airbyte` source connector implemented using the `CDK`.Nconfigsource_classstream_namerecord_handlerstatereturnc                    ^^	 SSK Jm	  SSKJn  SSKJn   " U	U4S jSU5      nU" UU" U" 5       UR                  S9S9U l        X0l        XPl	        g	)
a  Initializes the loader.

Args:
    config: The config to pass to the source connector.
    source_class: The source connector class.
    stream_name: The name of the stream to load.
    record_handler: A function that takes in a record and an optional id and
        returns a Document. If None, the record will be used as the document.
        Defaults to None.
    state: The state to pass to the source connector. Defaults to None.
r   )AirbyteRecordMessage)BaseEmbeddedIntegration)	CDKRunnerc                   >   > \ rS rSrSrS Y S\\   S\4U4S jjrSr	g)	1AirbyteCDKLoader.__init__.<locals>.CDKIntegration'   z%A wrapper around the CDK integration.recordidr   c                 J   > T(       a  T" X5      $ [        SUR                  S9$ )N )page_contentmetadata)r   data)selfr   r   r   s      d/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/document_loaders/airbyte.py_handle_record@AirbyteCDKLoader.__init__.<locals>.CDKIntegration._handle_record*   s$     ")&55R&++FF     N)
__name__
__module____qualname____firstlineno____doc__r   strr   r$   __static_attributes__)r   r   s   r#   CDKIntegrationr   '   s1    7G2G8@GG Gr&   r/   )sourcename)r   runnerN)
#airbyte_cdk.models.airbyte_protocolr   -airbyte_cdk.sources.embedded.base_integrationr   #airbyte_cdk.sources.embedded.runnerr   r(   _integration_stream_name_state)
r"   r   r   r   r   r   r   r   r/   r   s
       `    @r#   __init__AirbyteCDKLoader.__init__   sZ    & 	M	
 	B	G 	G4 	G +LN9N9NO
 (r&   c                 ^    U R                   R                  U R                  U R                  S9$ )N)r   r   )r6   
_load_datar7   r8   r"   s    r#   	lazy_loadAirbyteCDKLoader.lazy_load8   s/      ++)) , 
 	
r&   c                 .    U R                   R                  $ )N)r6   
last_stater=   s    r#   rA   AirbyteCDKLoader.last_state=   s      +++r&   )r6   r8   r7   NN)r(   r)   r*   r+   r,   r   r-   r   r   RecordHandlerr9   r   r   r>   propertyrA   r.   r'   r&   r#   r   r      s    N 37#(S!( ( 	(
 !/( }( 
(T
8H- 

 ,C , ,r&   r   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteHubspotLoaderB   z8Load from `Hubspot` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)  Initializes the loader.

Args:
    config: The config to pass to the source connector.
    stream_name: The name of the stream to load.
    record_handler: A function that takes in a record and an optional id and
        returns a Document. If None, the record will be used as the document.
        Defaults to None.
    state: The state to pass to the source connector. Defaults to None.
source_hubspotzairbyte-source-hubspotpip_namer   r   r   r   r   N)r	   SourceHubspotsuperr9   r"   r   r   r   r   r   	__class__s         r#   r9   AirbyteHubspotLoader.__init__E   @    " $'?

- 	 	%#) 	 	
r&   r'   rC   r(   r)   r*   r+   r,   r   r-   r   r   rD   r9   r.   __classcell__rR   s   @r#   rG   rG   B   Z    B 37#
S!
 
 !/	

 }
 

 
r&   rG   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteStripeLoaderb   z7Load from `Stripe` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_stripezairbyte-source-striperL   rN   N)r	   SourceStriperP   r9   rQ   s         r#   r9   AirbyteStripeLoader.__init__e   s@    " $&=

, 	 	%#) 	 	
r&   r'   rC   rU   rW   s   @r#   rZ   rZ   b   sZ    A 37#
S!
 
 !/	

 }
 

 
r&   rZ   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteTypeformLoader   z9Load from `Typeform` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_typeformzairbyte-source-typeformrL   rN   N)r	   SourceTypeformrP   r9   rQ   s         r#   r9   AirbyteTypeformLoader.__init__   s@    " $(A

. 	 	%#) 	 	
r&   r'   rC   rU   rW   s   @r#   ra   ra      sZ    C 37#
S!
 
 !/	

 }
 

 
r&   ra   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteZendeskSupportLoader   z@Load from `Zendesk Support` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_zendesk_supportzairbyte-source-zendesk-supportrL   rN   N)r	   SourceZendeskSupportrP   r9   rQ   s         r#   r9   $AirbyteZendeskSupportLoader.__init__   sA    " $$/O


 	 	%#) 	 	
r&   r'   rC   rU   rW   s   @r#   rh   rh      sZ    J 37#
S!
 
 !/	

 }
 

 
r&   rh   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteShopifyLoader   z8Load from `Shopify` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_shopifyzairbyte-source-shopifyrL   rN   N)r	   SourceShopifyrP   r9   rQ   s         r#   r9   AirbyteShopifyLoader.__init__   rT   r&   r'   rC   rU   rW   s   @r#   ro   ro      rX   r&   ro   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteSalesforceLoader   z;Load from `Salesforce` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_salesforcezairbyte-source-salesforcerL   rN   N)r	   SourceSalesforcerP   r9   rQ   s         r#   r9    AirbyteSalesforceLoader.__init__   sA    " $*E


 	 	%#) 	 	
r&   r'   rC   rU   rW   s   @r#   rv   rv      sZ    E 37#
S!
 
 !/	

 }
 

 
r&   rv   c                   b   ^  \ rS rSrSr  SS\\\4   S\S\\	   S\\   SS4
U 4S	 jjjr
S
rU =r$ )AirbyteGongLoaderi  z5Load from `Gong` using an `Airbyte` source connector.Nr   r   r   r   r   c                 P   > [        SSS9R                  n[        TU ]  UUUUUS9  g)rJ   source_gongzairbyte-source-gongrL   rN   N)r	   
SourceGongrP   r9   rQ   s         r#   r9   AirbyteGongLoader.__init__  s@    " $$9

* 	 	%#) 	 	
r&   r'   rC   rU   rW   s   @r#   r}   r}     sZ    ? 37#
S!
 
 !/	

 }
 

 
r&   r}   N)typingr   r   r   r   r   langchain_core.documentsr   langchain_core.utils.utilsr	   )langchain_community.document_loaders.baser
   r-   rD   r   rG   rZ   ra   rh   ro   rv   r}   r'   r&   r#   <module>r      s    = = - 3 @#x}-x784,z 4,n
+ 
@
* 
@
, 
@
"2 
@
+ 
@
. 
@
( 
r&   