
    Ji׍                    h   d dl Zd dlZd dlZd dlmZ d dlZddlm	Z	 ddl
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 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$ 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/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z< ddl=m>Z> ddl?m@Z@ dd lAmBZB dd!lCmDZD dd"lEmFZF dd#lGmHZH dd$lImJZJ dd%lKmLZL dd&lMmNZN dd'lOmPZP dd(lQmRZR dd)lSmTZT dd*lUmVZV dd+lWmXZX dd,lYmZZZ dd-l[m\Z\ dd.l]m^Z^ dd/l_m`Z` dd0lambZb dd1lcmdZd dd2lemfZf dd3lgmhZh dd4limjZj dd5lkmlZl d6d7lmmnZn 	 d dloZoeoj                  j                  d8      rerd dlsmtZo  ej                  ej                  d9      Zw G d: d;      Zx G d< d=      Zyy# er$ r d dloZoY =w xY w)>    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)jsonable_encoder)remove_none_from_dict)UnprocessableEntityError)	AgentData)BatchFileStatus)BatchItemListResponse)BatchJobCancelResponse)BatchJobQueryResponse)BatchJobResponse)BatchJobStatus)BatchJobStatusResponse)BatchJobType)DeleteResponse)DirectoryFileQueryResponse)DirectoryFileResponse)DirectoryQueryResponse)DirectoryResponse)DirectorySyncJobResponse)File)
FileCreate)
FileFilter)FileQueryResponse)FilterOperation)HttpValidationError)ItemProcessingResultsResponse)LlamaParseParameters)PaginatedResponseAgentData)PaginatedResponseAggregateGroup)#PaginatedResponseQuotaConfiguration)PaginatedResponseSpreadsheetJob)ParseConfiguration)ParseConfigurationQueryResponse)ParseJobQueryResponse)ParseJobResponse)ParseJobResultResponse)PresignedUrl)SplitCategory)SplitDocumentInput)SplitJobQueryResponse)SplitJobResponse)SplitStrategy)SpreadsheetJob)SpreadsheetParsingConfig)SpreadsheetResultType)%SrcParseSchemasWorkflowParseJobConfig)UsageMetric)UsageMetricQueryResponse)WebhookConfiguration   )BatchJobCreateRequestJobConfigz1..c                      e Zd ZdefdZddeddej                  e   dej                  e   dej                  e   dej                  eej                  f   d	ed
efdZddeeeeeeeeeddej                  e   dej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      dej                  e   dej                  ej                  e      dej                  e   dej                  e   dej                  e   dej                  e   d
efdZddeeddej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      d
efdZddeeeeeeed	dej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      dej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
efdZddddedej                  e   dej                  e   d
efdZddddedej                  e   dej                  e   dej                  eej                  f   d
ef
dZddddedej                  e   dej                  e   d
ej                  eef   fdZdddddddd d!ej                  e   d"ej                  e   d#ej                  e   d$ej                  e   dej                  e   dej                  e   dej                  e   d
efd%Zddeeeedd&dej                  e   dej                  e   d'ej                  e   d!ej                  e   d(ej                  ej                  e      d)edej                  e   d*ej                  e   d
efd+Z dddd,ded"ej                  e   dej                  e   dej                  e   d
e!f
d-Z"dddd.edej                  e   dej                  e   d
e#fd/Z$ddedd0d.edej                  e   dej                  e   d1ej                  e   d*ej                  e   d
e%fd2Z&dddddd3d.ed#ej                  e'   d$ej                  e   dej                  e   dej                  e   dej                  e   d
e(fd4Z)dddddddd5dej                  e   dej                  e   d6ej                  e   d7ej                  e   d8ej                  e   dej                  e   dej                  e   d
e*fd9Z+ddeed:dej                  e   dej                  e   d7ej                  e   d;ej                  e   d6ed
e,fd<Z-dddd!edej                  e   dej                  e   d
e,fd=Z.dddd!edej                  e   dej                  e   d
dfd>Z/ddeed?d!edej                  e   dej                  e   d;ej                  e   d6ej                  e   d
e,fd@Z0ddddddddddA	d!edej                  e   dej                  e   dBej                  e   dCej                  e   dDej                  e   dEej                  e   d8ej                  e   dej                  e   dej                  e   d
e1fdFZ2ddeedGd!edej                  e   dej                  e   dBej                  e   dEedDej                  e   d
e3fdHZ4ddddddId!edej                  e   dej                  e   dBej                  e   dJej                  e   dDej                  e   dKejj                  d
e3fdLZ6dddd!edMedej                  e   dej                  e   d
e3f
dNZ7dddd!edMedej                  e   dej                  e   d
df
dOZ8ddeedGd!edMedej                  e   dej                  e   dBej                  e   dDej                  e   d
e3fdPZ9ddddej                  e   dej                  e   d!ed
e:fdQZ;dddd.edej                  e   dej                  e   d
e:fdRZ<ddddej                  e   dej                  e   dSe=d
e>fdTZ?ddddej                  e   dej                  e   dSe=d
e>fdUZ@ddeeeedVdej                  e   dej                  e   dej                  eA   dej                  e   dej                  e   dej                  e   d
eBfdWZCddddEedej                  e   dej                  e   d
dfdXZDddddddddYdej                  e   dej                  e   d6ej                  e   dZej                  e   d[ej                  e   dej                  e   dej                  e   d
eEfd\ZFddeeed]dej                  e   dej                  e   dZej                  e   d6ed^eGd_ej                  e   d`ej                  e   d[ed
eHfdaZIddddbedej                  e   dej                  e   d
eHfdcZJddedddbedej                  e   dej                  e   d^ej                  eG   d
eHf
deZKddddbedej                  e   dej                  e   d
dfdfZLddddddgd#ej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
eMfdhZNddeeeeeeeedi
dej                  e   dej                  e   djej                  e   dkej                  eOj                     dleQj                  dm   d^ej                  eS   dnej                  e   doej                  eef   dpej                  e   dqej                  e   drej                  e   dsej                  ej                  eT      d
eUfdtZVdddd.edej                  e   dej                  e   d
eUfduZWdddd.edej                  e   dej                  e   d
ej                  eX   fdvZYdddd.edwedej                  e   dej                  e   d
ej                  f
dxZZdddyd`eQj                  dz   d_ed{ej                  e   dej                  e   d
e[f
d|Z\dddddd}d~ej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
e]fdZ^ddeddej                  e   dej                  e   dej                  e_   dEed
e`f
dZaddddded~ej                  e   dej                  e   dej                  e   d
e`f
dZbddddedej                  e   dej                  e   d
ej                  fdZcdddddedededdej                  e   dej                  e   dej                  e   d
eefdZfddddddej                  e   dej                  e   dej                  e   dej                  e   d
egf
dZhddeddej                  e   dej                  e   dej                  ei   dejdej                  ek   d
elfdZmddddedej                  e   dej                  e   d
elfdZndddddddddddddej                  e   dej                  e   dej                  e   dej                  e   drej                  e   dej                  ej                  eej                  e   f      dej                  ej                  eej                  e   f      dej                  e   dej                  e   dej                  e   dej                  e   ded
epfdZqded
erfdZsy)
BetaClientclient_wrapperc                    || _         y N_client_wrapperselfr<   s     s/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/llama_cloud/resources/beta/client.py__init__zBetaClient.__init__K   
    -    N
project_idorganization_id
collectionrH   rI   rJ   datadeployment_namereturnc          	         ||d}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a*  
        Create new agent data.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str].

            - data: typing.Dict[str, typing.Any].

            - deployment_name: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_agent_data(
            data={"string": {}},
            deployment_name="string",
        )
        rK   rL   rJ   POST/api/v1/beta/agent-datarH   rI   <   paramsjsonheaderstimeout   ,    status_codebodyOMITr@   httpx_clientrequesturllibparseurljoinget_base_urlr	   r   get_headersr^   pydanticparse_obj_asr   rW   r
   r   r   r   text	rB   rH   rI   rJ   rK   rL   _request	_response_response_jsons	            rC   create_agent_datazBetaClient.create_agent_dataN   sN   B ;?Sb1cT!%/H\"((55==LL  D$8$8$E$E$G#H!JLde(
Wf)gh!(+((446 > 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   %E +E7rH   rI   rJ   countfilterfirstgroup_byoffsetorder_by	page_size
page_tokenrs   rt   ru   rv   rw   rx   ry   rz   c          	         d|i}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   |t         ur||d	<   |t         ur||d
<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)aQ  
        Aggregate agent data with grouping and optional counting/first item retrieval.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to aggregate data for

            - count: typing.Optional[bool].

            - deployment_name: str. The agent deployment's name to aggregate data for

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].

            - first: typing.Optional[bool].

            - group_by: typing.Optional[typing.List[str]].

            - offset: typing.Optional[int].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
            deployment_name="string",
        )
        rL   rJ   rs   rt   ru   rv   rw   rx   ry   rz   rP   rQ   !api/v1/beta/agent-data/:aggregaterS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r#   rW   r
   r   r   r   rk   rB   rH   rI   rJ   rs   rL   rt   ru   rv   rw   rx   ry   rz   rm   rn   ro   s                   rC   ;aggregate_agent_data_api_v_1_beta_agent_data_aggregate_postzFBetaClient.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post   s   j 3D_1UT!%/H\" %HW!'HX %HW4#+HZ !'HX4#+HZ D $-H[!T!%/H\"((55==LL  D$8$8$E$E$G#H!JLop(
Wf)gh!(+((446 > 
	 )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   F3 3+GrH   rI   rJ   rt   c          	         d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	      }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Bulk delete agent data by query (deployment_name, collection, optional filters).

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to delete from

            - deployment_name: str. The agent deployment's name to delete data for

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_agent_data_by_query_api_v_1_beta_agent_data_delete_post(
            deployment_name="string",
        )
        rL   rJ   rt   rP   rQ   api/v1/beta/agent-data/:deleterS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   	rB   rH   rI   rJ   rL   rt   rm   rn   ro   s	            rC   >delete_agent_data_by_query_api_v_1_beta_agent_data_delete_postzIBetaClient.delete_agent_data_by_query_api_v_1_beta_agent_data_delete_post   s`   @ 3D_1UT!%/H\"!'HX((55==LL  D$8$8$E$E$G#H!JLlm(
Wf)gh!(+((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   1E +F	rH   rI   rJ   rt   include_totalrw   rx   ry   rz   r   c       
   	         d|i}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   | j                  j                  j                  d	t        j
                  j                  | j                  j                          d
d      t        ||d      t        |      | j                  j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a	  
        Search agent data with filtering, sorting, and pagination.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to search within

            - deployment_name: str. The agent deployment's name to search within

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].

            - include_total: typing.Optional[bool]. Whether to include the total number of items in the response

            - offset: typing.Optional[int].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.search_agent_data_api_v_1_beta_agent_data_search_post(
            deployment_name="string",
        )
        rL   rJ   rt   r   rw   rx   ry   rz   rP   rQ   api/v1/beta/agent-data/:searchrS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r"   rW   r
   r   r   r   rk   rB   rH   rI   rJ   rL   rt   r   rw   rx   ry   rz   rm   rn   ro   s                 rC   5search_agent_data_api_v_1_beta_agent_data_search_postz@BetaClient.search_agent_data_api_v_1_beta_agent_data_search_post  s   ^ 3D_1UT!%/H\"!'HX$(5H_%!'HX4#+HZ D $-H[!T!%/H\"((55==LL  D$8$8$E$E$G#H!JLlm(
Wf)gh!(+((446 > 
	 )''-#-(()CY^^EUVV  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   2F +GrS   item_idc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get agent data by ID.

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_agent_data(
            item_id="string",
        )
        GETrQ   api/v1/beta/agent-data/rS   rT   rV   rX   rY   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   rH   rI   rn   ro   s         rC   get_agent_datazBetaClient.get_agent_datae  s1   , ((55==LL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh((446 > 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D3 3+Ec          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      t        d|i      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)a  
        Update agent data by ID (overwrites).

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - data: typing.Dict[str, typing.Any].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.update_agent_data(
            item_id="string",
            data={"string": {}},
        )
        PUTrQ   r   rS   rK   rT   rU   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   rH   rI   rK   rn   ro   s          rC   update_agent_datazBetaClient.update_agent_data  s=   < ((55==LL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh!64.1((446 > 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D? ?+E*c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  rBn n?t        j                  t        j                  t        t        f   |j                               S |j                  d	k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |
      # t$        $ r" t'        |j                  |j(                  
      w xY w)a  
        Delete agent data by ID.

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_agent_data(
            item_id="string",
        )
        DELETErQ   r   rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   typingDictstrrW   r
   r   r   r   rk   r   s         rC   delete_agent_datazBetaClient.delete_agent_data  s>   , ((55==LL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh((446 > 
	 )''-#-((S#X)>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   #E
 
+E5directory_idjob_typestatuslimitrw   rH   rI   r   r   r   r   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        List all batch processing jobs for a project with optional filtering.

        Returns a paginated list of batch jobs with filters for directory, job type, and status.
        Useful for viewing job history, monitoring progress, and finding specific jobs.

        Parameters:
            - directory_id: typing.Optional[str]. Filter by directory ID

            - job_type: typing.Optional[BatchJobType]. Filter by job type (PARSE, EXTRACT, CLASSIFY)

            - status: typing.Optional[BatchJobStatus]. Filter by job status (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED)

            - limit: typing.Optional[int]. Maximum number of jobs to return

            - offset: typing.Optional[int]. Number of jobs to skip for pagination

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchJobStatus, BatchJobType
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_batch_jobs(
            job_type=BatchJobType.PARSE,
            status=BatchJobStatus.PENDING,
        )
        r   rQ   api/v1/beta/batch-processingr   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   
rB   r   r   r   r   rw   rH   rI   rn   ro   s
             rC   list_batch_jobszBetaClient.list_batch_jobs  s@   V ((55==LL  D$8$8$E$E$G#H!JLjk($0 ($"$",'6
 ((446 > 
	" )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D5 5+E rH   rI   continue_as_new_thresholdr   item_idsry   temporal_namespacer   r   
job_configr   c                ^   d|i}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d	      t        |	      t        i | j                  j                         d
|i      d      }
d|
j                  cxk  rdk  r+n n(t        j                  t        |
j                               S |
j                  dk(  r1t!        t        j                  t"        |
j                                     	 |
j                         }t'        |
j                  |      # t$        $ r" t'        |
j                  |
j(                        w xY w)a(  
        Create a new batch processing job for a directory.

        Processes all files in the specified directory according to the job configuration.
        The job runs asynchronously and you can monitor progress using the job status endpoint.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - continue_as_new_threshold: typing.Optional[int].

            - directory_id: typing.Optional[str].

            - item_ids: typing.Optional[typing.List[str]].

            - job_config: BatchJobCreateRequestJobConfig. Job configuration for batch processing. Can be BatchParseJobRecordCreate or ClassifyJob.

            - page_size: typing.Optional[int]. Number of files to fetch per batch from the directory (only used in directory mode)

            - temporal_namespace: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_batch_job()
        r   r   r   r   ry   rP   rQ   r   rS   temporal-namespacerT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   rH   rI   r   r   r   r   ry   r   rm   rn   ro   s               rC   create_batch_jobzBetaClient.create_batch_job)  s   T 3?
1K$D04MH01t#'3H^$4#+HZ D $-H[!((55==LL  D$8$8$E$E$G#H!JLjk(
Wf)gh!(+)`4''335`7KM_`  > 	
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   F +F,r   rH   rI   c          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||d      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      # t         $ r" t#        |j                  |j$                        w xY w)a  
        Get all processing results for a specific item (lineage query).

        Shows complete processing history including what operations have been performed,
        with what parameters, and where outputs are stored. Useful for understanding
        what processing has already been done to avoid redundant work. Optionally filter
        by job type to see only specific processing operations.

        Parameters:
            - item_id: str.

            - job_type: typing.Optional[BatchJobType]. Filter results by job type

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchJobType
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_item_processing_results(
            item_id="string",
            job_type=BatchJobType.PARSE,
        )
        r   rQ   #api/v1/beta/batch-processing/items//processing-resultsr   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r    rW   r
   r   r   r   rk   rB   r   r   rH   rI   rn   ro   s          rC   get_item_processing_resultsz&BetaClient.get_item_processing_resultsp  s@   H ((55==LL  ''4467q95gY>QR )%ZTcd ((446 > 
	 )''-#-(()F	HXYY  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   job_idc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get detailed status of a batch processing job.

        Returns current progress, file counts, and estimated completion time.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_batch_job_status(
            job_id="string",
        )
        r   rQ   api/v1/beta/batch-processing/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   rH   rI   rn   ro   s         rC   get_batch_job_statuszBetaClient.get_batch_job_status  s2   0 ((55==LL  D$8$8$E$E$G#H!JNklrksLtu(
Wf)gh((446 > 
	 )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   reasonr   r   c                   i }|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d      t        ||d      t        |      t        i | j                  j                         d|i      d	      }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Cancel a running batch processing job.

        Stops processing and marks all pending items as cancelled. Items currently
        being processed may complete depending on their state.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - reason: typing.Optional[str].

            - temporal_namespace: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.cancel_batch_job(
            job_id="string",
        )
        r   rP   rQ   r   /cancelrS   r   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   	rB   r   rH   rI   r   r   rm   rn   ro   s	            rC   cancel_batch_jobzBetaClient.cancel_batch_job  sr   F 24!'HX((55==LL  ''4467q9=Z[aZbbi;j )
Wf)gh!(+)`4''335`7KM_`  > 
	 )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   5E +Fr   r   rw   rH   rI   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||||d      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      # t         $ r" t#        |j                  |j$                        w xY w)a  
        List items in a batch job with optional status filtering.

        Useful for finding failed items, viewing completed items, or debugging issues.
        Results are paginated for performance with configurable limit and offset parameters.

        Parameters:
            - job_id: str.

            - status: typing.Optional[BatchFileStatus]. Filter items by status

            - limit: typing.Optional[int]. Maximum number of items to return

            - offset: typing.Optional[int]. Number of items to skip

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchFileStatus
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_batch_job_items(
            job_id="string",
            status=BatchFileStatus.PENDING,
        )
        r   rQ   r   /itemsr   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   	rB   r   r   r   rw   rH   rI   rn   ro   s	            rC   list_batch_job_itemszBetaClient.list_batch_job_items  sK   P ((55==LL  ''4467q9=Z[aZbbh;i )$"$",'6 ((446 > 
	" )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D7 7+E"rH   rI   namedata_source_idinclude_deletedry   rz   r   r   r   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	
      # t         $ r" t#        |j                  |j$                  
      w xY w)a(  
        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: typing.Optional[str].

            - data_source_id: typing.Optional[str].

            - include_deleted: typing.Optional[bool].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_directories()
        r   rQ   api/v1/beta/directoriesr   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   
rB   rH   rI   r   r   r   ry   rz   rn   ro   s
             rC   list_directorieszBetaClient.list_directoriesR  s@   D ((55==LL  D$8$8$E$E$G#H!JLef(",'6 &4'6!*",
 ((446 > 
	" )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   r   descriptionr   c          	         d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	      }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Create a new directory within the specified project.

        If data_source_id is provided, validates that the data source exists
        and belongs to the same project.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - data_source_id: typing.Optional[str].

            - description: typing.Optional[str].

            - name: str. Human-readable name for the directory.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_directory(
            name="string",
        )
        r   r   r   rP   rQ   r   rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   	rB   rH   rI   r   r   r   rm   rn   ro   s	            rC   create_directoryzBetaClient.create_directory  s`   F 39$%)7H%&d"&1H]#((55==LL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 > 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Retrieve a directory by its identifier.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_directory(
            directory_id="string",
        )
        r   rQ   api/v1/beta/directories/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   rH   rI   rn   ro   s         rC   get_directoryzBetaClient.get_directory  s2   4 ((55==LL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh((446 > 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   c          	      p   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  ry	 |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)a  
        Permanently delete a directory.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_directory(
            directory_id="string",
        )
        r   rQ   r   rS   rT   r   rZ   r[   Nr\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   r
   ri   rj   r   rW   r   r   rk   r   s         rC   delete_directoryzBetaClient.delete_directory  s   4 ((55==LL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh((446 > 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   #D
 
+D5rH   rI   r   r   c          	         i }|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd|       t        ||d      t        |      | j                  j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Update directory metadata.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - description: typing.Optional[str].

            - name: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.update_directory(
            directory_id="string",
        )
        r   r   PATCHrQ   r   rS   rT   rU   rZ   r[   r\   r]   r   	rB   r   rH   rI   r   r   rm   rn   ro   s	            rC   update_directoryzBetaClient.update_directory  sd   @ 24d"&1H]#t#HV((55==LL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh!(+((446 > 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   2E +F	rH   rI   display_namedisplay_name_contains	unique_idfile_idr   ry   rz   r   r   r   r   c       	            | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||||||||	|
d	      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      # t         $ r" t#        |j                  |j$                        w xY w)aF  
        List all files within the specified directory with optional filtering and pagination.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - display_name_contains: typing.Optional[str].

            - unique_id: typing.Optional[str].

            - file_id: typing.Optional[str].

            - include_deleted: typing.Optional[bool].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_directory_files(
            directory_id="string",
        )
        r   rQ   r   /filesr   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   rH   rI   r   r   r   r   r   ry   rz   rn   ro   s                rC   list_directory_fileszBetaClient.list_directory_filesV  sW   ^ ((55==LL  ''4467q9=UVbUcci;j )",'6$0-B!*&'6!*",
 ((446' > 
	* )''-#-(()CY^^EUVV  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D; ;+E&rH   rI   r   r   c          	         d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d      t        ||d      t        |      | j                  j                         d	
      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Create a new file within the specified directory.

        The directory must exist and belong to the project passed in.
        The file_id must be provided and exist in the project.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - file_id: str. File ID for the storage location (required).

            - unique_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.add_directory_file(
            directory_id="string",
            file_id="string",
        )
        r   r   r   rP   rQ   r   r   rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   
rB   r   rH   rI   r   r   r   rm   rn   ro   s
             rC   add_directory_filezBetaClient.add_directory_file  sq   N 3<W1Et#'3H^$D $-H[!((55==LL  ''4467q9=UVbUcci;j )
Wf)gh!(+((446 > 	
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   r   external_file_idr   r   upload_filec                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      t        |||d      d|i| j                   j                         d	      }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }	t%        |j                  |	      # t"        $ r" t%        |j                  |j&                        w xY w)L  
        Upload a file directly to a directory.

        Uploads a file and creates a directory file entry in a single operation.
        If unique_id or display_name are not provided, they will be derived from the file metadata.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - external_file_id: typing.Optional[str].

            - unique_id: typing.Optional[str].

            - upload_file: typing.IO.
        rP   rQ   r   /files/uploadrS   r   r   r   r  rT   rV   rK   filesrX   rY   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   
rB   r   rH   rI   r   r   r   r  rn   ro   s
             rC   upload_file_to_directoryz#BetaClient.upload_file_to_directory  sY   @ ((55==LL  ''4467q9=UVbUccp;q )
Wf)gh!!-CSbkl !+.((446 > 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   E +E0directory_file_idc          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d|       t        ||d      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      # t         $ r" t#        |j                  |j$                        w xY w)az  
        Get a file by its directory_file_id within the specified directory. If you're trying to get a file by its unique_id, use the list endpoint with a filter instead.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   rQ   r   /files/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   r   r  rH   rI   rn   ro   s          rC   get_directory_filezBetaClient.get_directory_file  s=   < ((55==LL  ''4467q9*<.@Q?RS )
Wf)gh((446 > 	
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D6 6+E!c          
      v   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d|       t        ||d      | j                   j                         d      }d|j                  cxk  rd	k  ry
 |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)a  
        Delete a file from the specified directory.

        Note: This endpoint uses directory_file_id (the internal ID). If you're trying to delete a file by its unique_id, use the list endpoint with a filter to find the directory_file_id first.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   rQ   r   r  rS   rT   r   rZ   r[   Nr\   r]   r   r  s          rC   delete_directory_filez BetaClient.delete_directory_fileM  s+   @ ((55==LL  ''4467q9*<.@Q?RS )
Wf)gh((446 > 	
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   &D +D8c          
         i }|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d|       t        ||d      t        |      | j                  j                         d	      }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      # t$        $ r" t'        |j                  |j(                        w xY w)a7  
        Update file metadata within the specified directory.

        Note: This endpoint uses directory_file_id (the internal ID). If you're trying to update a file by its unique_id, use the list endpoint with a filter to find the directory_file_id first.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - unique_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.update_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   r   r   rQ   r   r  rS   rT   rU   rZ   r[   r\   r]   r   
rB   r   r  rH   rI   r   r   rm   rn   ro   s
             rC   update_directory_filez BetaClient.update_directory_file  so   L 24t#'3H^$D $-H[!((55==LL  ''4467q9*<.@Q?RS )
Wf)gh!(+((446 > 

	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        d|i      | j                   j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)a  
        Create a new directory sync job.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - directory_id: str. Directory being processed
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_directory_sync_job_api_v_1_beta_directory_sync_jobs_post(
            directory_id="string",
        )
        rP   rQ   api/v1/beta/directory-sync-jobsrS   r   rT   rU   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   rH   rI   r   rn   ro   s         rC   ?create_directory_sync_job_api_v_1_beta_directory_sync_jobs_postzJBetaClient.create_directory_sync_job_api_v_1_beta_directory_sync_jobs_post  s6   4 ((55==LL  D$8$8$E$E$G#H!JLmn(
Wf)gh!><"@A((446 > 
	 )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D< <+E'c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get a directory sync job by ID.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_directory_sync_job(
            job_id="string",
        )
        r   rQ    api/v1/beta/directory-sync-jobs/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   r   s         rC   get_directory_sync_jobz!BetaClient.get_directory_sync_job  s7   , ((55==LL  ''4467q9=]^d]e;f )
Wf)gh((446 > 
	 )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rc   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |
      # t"        $ r" t%        |j                  |j&                  
      w xY w)a  
        Create a new file in the project.

        Args:
        file_create: File creation data
        project: Validated project from dependency
        db: Database session

        Returns:
        The created file

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: FileCreate.
        ---
        from llama_cloud import FileCreate
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_file(
            request=FileCreate(
                name="string",
            ),
        )
        rP   rQ   api/v1/beta/filesrS   rT   rU   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   rB   rH   rI   rc   rn   ro   s         rC   create_filezBetaClient.create_file  s1   J ((55==LL  D$8$8$E$E$G#H!JL_`(
Wf)gh!'*((446 > 
	 )''-#-((y~~/?@@  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D: :+E%c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |
      # t"        $ r" t%        |j                  |j&                  
      w xY w)a  
        Upsert a file (create or update if exists) in the project.

        Args:
        file_create: File creation/update data
        project: Validated project from dependency
        db: Database session

        Returns:
        The upserted file

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: FileCreate.
        ---
        from llama_cloud import FileCreate
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.upsert_file(
            request=FileCreate(
                name="string",
            ),
        )
        r   rQ   r!  rS   rT   rU   rZ   r[   r\   r]   r"  r#  s         rC   upsert_filezBetaClient.upsert_fileM  s1   J ((55==LL  D$8$8$E$E$G#H!JL_`(
Wf)gh!'*((446 > 
	 )''-#-((y~~/?@@  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr%  rH   rI   rt   rx   ry   rz   c          	      <   i }|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	
      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      # t$        $ r" t'        |j                  |j(                        w xY w)aW  
        Query files with flexible filtering and pagination.

        Args:
        request: The query request with filters and pagination
        project: Validated project from dependency
        db: Database session

        Returns:
        Paginated response with files

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - filter: typing.Optional[FileFilter].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud import FileFilter
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.query_files(
            filter=FileFilter(),
        )
        rt   rx   ry   rz   rP   rQ   api/v1/beta/files/queryrS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r   rW   r
   r   r   r   rk   
rB   rH   rI   rt   rx   ry   rz   rm   rn   ro   s
             rC   query_fileszBetaClient.query_files  s   X 24!'HX4#+HZ D $-H[!T!%/H\"((55==LL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 > 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   	E0 0+Fc          	      p   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  ry	 |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)ag  
        Delete a single file from the project.

        Args:
        file_id: The ID of the file to delete
        project: Validated project from dependency
        db: Database session

        Returns:
        None (204 No Content on success)

        Parameters:
            - file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_file(
            file_id="string",
        )
        r   rQ   api/v1/beta/files/rS   rT   r   rZ   r[   Nr\   r]   r   rB   r   rH   rI   rn   ro   s         rC   delete_filezBetaClient.delete_file  s   < ((55==LL  D$8$8$E$E$G#H!JN`ah`iLjk(
Wf)gh((446 > 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   ry   rz   r   creatorversionrH   rI   r3  r4  c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        List parse configurations for the current project.

        Args:
        project: Validated project from dependency
        user: Current user
        db: Database session
        page_size: Number of items per page
        page_token: Token for pagination
        name: Filter by configuration name
        creator: Filter by creator
        version: Filter by version

        Returns:
        Paginated response with parse configurations

        Parameters:
            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].

            - name: typing.Optional[str].

            - creator: typing.Optional[str].

            - version: typing.Optional[str].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_parse_configurations()
        r   rQ    api/v1/beta/parse-configurationsr2  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r'   rW   r
   r   r   r   rk   
rB   ry   rz   r   r3  r4  rH   rI   rn   ro   s
             rC   list_parse_configurationsz$BetaClient.list_parse_configurations  s@   b ((55==LL  D$8$8$E$E$G#H!JLno(!*", &&",'6
 ((446 > 
	" )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   r3  	source_idsource_type
parametersr;  r<  c          	      *   |||d}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |	      | j                  j                         d	
      }
d|
j                  cxk  rdk  r+n n(t        j                  t        |
j                               S |
j                  dk(  r1t!        t        j                  t"        |
j                                     	 |
j                         }t'        |
j                  |      # t$        $ r" t'        |
j                  |
j(                        w xY w)a  
        Create a new parse configuration.

        Args:
        config_create: Parse configuration creation data
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The created parse configuration

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - creator: typing.Optional[str].

            - name: str. Name of the parse configuration

            - parameters: LlamaParseParameters. LlamaParseParameters configuration

            - source_id: typing.Optional[str].

            - source_type: typing.Optional[str].

            - version: str. Version of the configuration
        ---
        from llama_cloud import (
            FailPageMode,
            LlamaParseParameters,
            LlamaParseParametersPriority,
            ParsingMode,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_parse_configuration(
            name="string",
            parameters=LlamaParseParameters(
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=LlamaParseParametersPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
            ),
            version="string",
        )
        r   r=  r4  r3  r;  r<  rP   rQ   r6  rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r&   rW   r
   r   r   r   rk   rB   rH   rI   r3  r   r=  r;  r<  r4  rm   rn   ro   s               rC   create_parse_configurationz%BetaClient.create_parse_configurationF  su   | ;?jel1m$")HYD $-H[!d"&1H]#((55==LL  D$8$8$E$E$G#H!JLno(
Wf)gh!(+((446 > 
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss    E' '+F	config_idc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get a parse configuration by ID.

        Args:
        config_id: The ID of the parse configuration
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The parse configuration

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_parse_configuration(
            config_id="string",
        )
        r   rQ   !api/v1/beta/parse-configurations/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r&   rW   r
   r   r   r   rk   rB   rC  rH   rI   rn   ro   s         rC   get_parse_configurationz"BetaClient.get_parse_configuration  s7   > ((55==LL  ''4467q9=^_h^i;j )
Wf)gh((446 > 
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   r=  c          	         i }|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd|       t        ||d      t        |      | j                  j                         d      }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Update a parse configuration.

        Args:
        config_id: The ID of the parse configuration to update
        config_update: Update data
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The updated parse configuration

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - parameters: typing.Optional[LlamaParseParameters].
        ---
        from llama_cloud import (
            FailPageMode,
            LlamaParseParameters,
            LlamaParseParametersPriority,
            ParsingMode,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.update_parse_configuration(
            config_id="string",
            parameters=LlamaParseParameters(
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=LlamaParseParametersPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
            ),
        )
        r=  r   rQ   rE  rS   rT   rU   rZ   r[   r\   r]   r@  rB   rC  rH   rI   r=  rm   rn   ro   s           rC   update_parse_configurationz%BetaClient.update_parse_configuration  sW   d 24T!%/H\"((55==LL  ''4467q9=^_h^i;j )
Wf)gh!(+((446 > 	
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srq   c          	      p   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  ry	 |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      # t        $ r" t!        |j                  |j"                        w xY w)ab  
        Delete a parse configuration.

        Args:
        config_id: The ID of the parse configuration to delete
        project: Validated project from dependency
        user: Current user
        db: Database session

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_parse_configuration(
            config_id="string",
        )
        r   rQ   rE  rS   rT   r   rZ   r[   Nr\   r]   r   rG  s         rC   delete_parse_configurationz%BetaClient.delete_parse_configuration  s$   8 ((55==LL  ''4467q9=^_h^i;j )
Wf)gh((446 > 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   r   ry   rz   rH   rI   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        List parse jobs with optional filtering and pagination.

        Parameters:
            - status: typing.Optional[str]. Filter by job status (pending, running, completed, failed, cancelled)

            - page_size: typing.Optional[int]. Maximum number of jobs to return

            - page_token: typing.Optional[str]. Page token for cursor-based pagination

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_parse_jobs()
        r   rQ   api/v1/beta/parsing-temporalrO  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r(   rW   r
   r   r   r   rk   rB   r   ry   rz   rH   rI   rn   ro   s           rC   list_parse_jobszBetaClient.list_parse_jobsG  s9   < ((55==LL  D$8$8$E$E$G#H!JLjk($!*",",'6 ((446 > 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   
rH   rI   correlation_id
created_atr=  parent_job_execution_id"parse_job_record_create_project_id
session_iduser_idwebhook_configurationsrV  rW  job_nameparse_raw_file_jobrX  
partitionsrY  rZ  r[  r\  c          	         ||d}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   |t         ur||d<   |t         ur||d	<   | j                  j                  j                  d
t        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Create a new parse job.

        Processes a document asynchronously. Use the job ID to check status and retrieve results.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - correlation_id: typing.Optional[str].

            - created_at: typing.Optional[dt.datetime]. Creation datetime

            - job_name: typing_extensions.Literal["parse_raw_file_job"].

            - parameters: typing.Optional[SrcParseSchemasWorkflowParseJobConfig].

            - parent_job_execution_id: typing.Optional[str].

            - partitions: typing.Dict[str, str]. The partitions for this execution. Used for determining where to save job output.

            - parse_job_record_create_project_id: typing.Optional[str].

            - session_id: typing.Optional[str].

            - user_id: typing.Optional[str].

            - webhook_configurations: typing.Optional[typing.List[WebhookConfiguration]].
        ---
        from llama_cloud import (
            FailPageMode,
            ParsingMode,
            SrcParseSchemasWorkflowParseJobConfig,
            SrcParseSchemasWorkflowParseJobConfigPriority,
        )
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_parse_job(
            job_name="parse_raw_file_job",
            parameters=SrcParseSchemasWorkflowParseJobConfig(
                file_key="string",
                file_name="string",
                lang="string",
                original_file_name="string",
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=SrcParseSchemasWorkflowParseJobConfigPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
                type="parse",
            ),
            partitions={"string": "string"},
        )
        r]  r_  rV  rW  r=  rX  rH   rZ  r[  r\  rP   rQ   rQ  rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r)   rW   r
   r   r   r   rk   rB   rH   rI   rV  rW  r]  r=  rX  r_  rY  rZ  r[  r\  rm   rn   ro   s                   rC   create_parse_jobzBetaClient.create_parse_job~  s   P ?GV`1a%)7H%&T!%/H\"T!%/H\""$.2IH./-T9%GH\"T!%/H\"$")HY!-1GH-.((55==LL  D$8$8$E$E$G#H!JLjk(
Wf)gh!(+((446 > 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss    F' '+Gc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get a parse job by ID.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_parse_job(
            job_id="string",
        )
        r   rQ   api/v1/beta/parsing-temporal/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r)   rW   r
   r   r   r   rk   r   s         rC   get_parse_jobzBetaClient.get_parse_job  s2   , ((55==LL  D$8$8$E$E$G#H!JNklrksLtu(
Wf)gh((446 > 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   c          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      | j                   j                         d      }d|j                  cxk  rd	k  r<n n9t        j                  t        j                  t           |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a^  
        Get results for a parse job.

        Returns a single result object containing the full OutputFiles JSON with all output types
        (full_text, md, json_output, job_info, xlsx, output_pdf, structured, images, charts).

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_parse_job_results(
            job_id="string",
        )
        r   rQ   rf  /resultsrS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   Optionalr*   rW   r
   r   r   r   rk   r   s         rC   get_parse_job_resultsz BetaClient.get_parse_job_results	  sF   2 ((55==LL  ''4467q9=Z[aZbbj;k )
Wf)gh((446 > 
	 )''-#-((9O)PR[R`R`Rbcc  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr  result_typec                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d| d      t        ||d      | j                   j                         d      }d	|j                  cxk  rd
k  r5n n2t        j                  t        j                  |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      # t"        $ r" t%        |j                  |j&                        w xY w)a  
        Stream parse result content from storage.

        The result_type should be one of: fullText, md, json, jobInfo, xlsx, outputPDF, structured.
        For images and charts, use the index-based approach (e.g., images[0], charts[1]).

        Parameters:
            - job_id: str.

            - result_type: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.stream_parse_job_result_content(
            job_id="string",
            result_type="string",
        )
        r   rQ   rf  	/results//contentrS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r   AnyrW   r
   r   r   r   rk   rB   r   rn  rH   rI   rn   ro   s          rC   stream_parse_job_result_contentz*BetaClient.stream_parse_job_result_content<	  sA   B ((55==LL  ''4467q9/xyXV )
Wf)gh((446 > 	
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   E +E,pagery   organizationrw  c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a8  
        Retrieve a paginated list of quota configurations with optional filtering.

        Parameters:
            - source_type: typing_extensions.Literal["organization"].

            - source_id: str.

            - page: typing.Optional[int].

            - page_size: typing.Optional[int].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_quota_configurations(
            source_type="organization",
            source_id="string",
        )
        r   rQ   api/v1/beta/quota-managementr<  r;  rw  ry   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r$   rW   r
   r   r   r   rk   rB   r<  r;  rw  ry   rn   ro   s          rC   list_quota_configurationsz$BetaClient.list_quota_configurationsq	  s2   < ((55==LL  D$8$8$E$E$G#H!JLjk( +)T`ij ((446 > 
	 )''-#-(()LinnN^__  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	S   D2 2+Einclude_resultsrH   rI   ry   rz   r  c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)ac  
        List spreadsheet parsing jobs.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - include_results: typing.Optional[bool].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_spreadsheet_jobs()
        r   rQ   api/v1/beta/sheets/jobsr  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r%   rW   r
   r   r   r   rk   rB   r  rH   rI   ry   rz   rn   ro   s           rC   list_spreadsheet_jobsz BetaClient.list_spreadsheet_jobs	  s9   > ((55==LL  D$8$8$E$E$G#H!JLef('6",'6!*", ((446 > 
	 )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   rH   rI   configr  c          	         d|i}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Create a spreadsheet parsing job.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - config: typing.Optional[SpreadsheetParsingConfig]. Configuration for the parsing job

            - file_id: str. The ID of the file to parse
        ---
        from llama_cloud import SpreadsheetParsingConfig
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_spreadsheet_job(
            config=SpreadsheetParsingConfig(),
            file_id="string",
        )
        r   r  rP   rQ   r  rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r1   rW   r
   r   r   r   rk   rB   rH   rI   r  r   rm   rn   ro   s           rC   create_spreadsheet_jobz!BetaClient.create_spreadsheet_job	  sM   @ 3<W1E!'HX((55==LL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 > 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   $E +E6r  rH   rI   spreadsheet_job_idc          
         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        |||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get a spreadsheet parsing job.

        When include_results=True (default), the response will include extracted regions and results
        if the job is complete, eliminating the need for a separate /results call.

        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - include_results: typing.Optional[bool].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_spreadsheet_job(
            spreadsheet_job_id="string",
        )
        r   rQ   api/v1/beta/sheets/jobs/r  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r1   rW   r
   r   r   r   rk   rB   r  r  rH   rI   rn   ro   s          rC   get_spreadsheet_jobzBetaClient.get_spreadsheet_job
  s>   D ((55==LL  ''4467q9=UVhUi;j )$3:bqr ((446 > 

	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D4 4+Ec          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  d	k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |
      # t"        $ r" t%        |j                  |j&                  
      w xY w)aA  
        Delete a spreadsheet parsing job and its associated data.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.delete_spreadsheet_job(
            spreadsheet_job_id="string",
        )
        r   rQ   r  rS   rT   r   rZ   r[   r\   r]   rr  rB   r  rH   rI   rn   ro   s         rC   delete_spreadsheet_jobz!BetaClient.delete_spreadsheet_jobF
  s:   6 ((55==LL  ''4467q9=UVhUi;j )
Wf)gh((446 > 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   D= =+E(expires_at_secondsrH   rI   	region_idregion_typer  c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d| d|       t        |||d      | j                   j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      # t         $ r" t#        |j                  |j$                        w xY w)aZ  
        Generate a presigned URL to download a specific extracted region.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - region_id: str.

            - region_type: SpreadsheetResultType.

            - expires_at_seconds: typing.Optional[int].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import SpreadsheetResultType
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_result_region(
            spreadsheet_job_id="string",
            region_id="string",
            region_type=SpreadsheetResultType.TABLE,
        )
        r   rQ   r  	/regions//result/r  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r+   rW   r
   r   r   r   rk   	rB   r  r  r  r  rH   rI   rn   ro   s	            rC   get_result_regionzBetaClient.get_result_regiont
  sM   N ((55==LL  ''4467q9*+=*>i	{RZ[fZgh )'9hwx ((446 > 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr%  rH   rI   ry   rz   c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a!  
        List document split jobs.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_split_jobs()
        r   rQ   api/v1/beta/split/jobsr  rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r.   rW   r
   r   r   r   rk   rB   rH   rI   ry   rz   rn   ro   s          rC   list_split_jobszBetaClient.list_split_jobs
  s6   8 ((55==LL  D$8$8$E$E$G#H!JLde(",'6!*",	 ((446 > 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr  rH   rI   splitting_strategy
categoriesdocument_inputr  c          	         ||d}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d      }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      # t$        $ r" t'        |j                  |j(                        w xY w)a  
        Create a document split job.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - categories: typing.List[SplitCategory]. Categories to split the document into.

            - document_input: SplitDocumentInput. Document to be split.

            - splitting_strategy: typing.Optional[SplitStrategy]. Strategy for splitting the document.
        ---
        from llama_cloud import SplitDocumentInput, SplitStrategy
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.create_split_job(
            categories=[],
            document_input=SplitDocumentInput(
                type="string",
                value="string",
            ),
            splitting_strategy=SplitStrategy(),
        )
        r  r  r  rP   rQ   r  rS   rT   rU   rZ   r[   r\   r]   ra   r@   rb   rc   rd   re   rf   rg   r	   r   rh   r^   ri   rj   r/   rW   r
   r   r   r   rk   	rB   rH   rI   r  r  r  rm   rn   ro   s	            rC   create_split_jobzBetaClient.create_split_job
  sR   N AK^l1mT)-?H)*((55==LL  D$8$8$E$E$G#H!JLde(
Wf)gh!(+((446 > 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Srq   split_job_idc          	         | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a  
        Get a document split job.

        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - split_job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_split_job(
            split_job_id="string",
        )
        r   rQ   api/v1/beta/split/jobs/rS   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r/   rW   r
   r   r   r   rk   rB   r  rH   rI   rn   ro   s         rC   get_split_jobzBetaClient.get_split_job!  s2   8 ((55==LL  D$8$8$E$E$G#H!JNefresLtu(
Wf)gh((446 > 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr   ry   rz   r   rH   r[  event_typesdaysday_on_or_beforeday_on_or_afterevent_aggregation_typeevent_aggregation_keyr  r  r  r  r  r  c                   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||||	|
||d      | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |
      # t         $ r" t#        |j                  |j$                  
      w xY w)a(  
        List usage metrics with filtering and pagination.

        Parameters:
            - page_size: typing.Optional[int]. Number of items per page

            - page_token: typing.Optional[str]. Token for pagination

            - include_total: typing.Optional[bool]. Include total count in response

            - project_id: typing.Optional[str]. Filter by project ID

            - user_id: typing.Optional[str]. Filter by user ID

            - event_types: typing.Optional[typing.Union[str, typing.List[str]]]. Filter by event types

            - days: typing.Optional[typing.Union[str, typing.List[str]]]. Filter by specific days (YYYY-MM-DD)

            - day_on_or_before: typing.Optional[str]. Filter by days on or before this date (YYYY-MM-DD)

            - day_on_or_after: typing.Optional[str]. Filter by days on or after this date (YYYY-MM-DD)

            - event_aggregation_type: typing.Optional[str]. Filter by event aggregation type

            - event_aggregation_key: typing.Optional[str]. Filter by event aggregation key

            - organization_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.list_usage_metrics(
            organization_id="string",
        )
        r   rQ   api/v1/beta/usage-metricsry   rz   r   rH   r[  r  r  r  r  r  r  rI   rT   r   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   r	   rh   r^   ri   rj   r6   rW   r
   r   r   r   rk   rB   ry   rz   r   rH   r[  r  r  r  r  r  r  rI   rn   ro   s                  rC   list_usage_metricszBetaClient.list_usage_metricsN  sO   j ((55==LL  D$8$8$E$E$G#H!JLgh(!*",%2",&#. (8'6.D-B'6  ((446) > 
	, )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Sr%  usage_metric_idc                    | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d      }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |	      # t        $ r" t!        |j                  |j"                  	      w xY w)
a@  
        Get a usage metric by ID.

        Parameters:
            - usage_metric_id: str.
        ---
        from llama_cloud.client import LlamaCloud

        client = LlamaCloud(
            token="YOUR_TOKEN",
        )
        client.beta.get_usage_metric(
            usage_metric_id="string",
        )
        r   rQ   api/v1/beta/usage-metrics/rT   rX   rY   rZ   r[   r\   r]   r@   rb   rc   rd   re   rf   rg   rh   r^   ri   rj   r5   rW   r
   r   r   r   rk   rB   r  rn   ro   s       rC   get_usage_metriczBetaClient.get_usage_metric  s(     ((55==LL  ''4467q9=WXgWh;i ((446 > 
	 )''-#-((inn6FGG  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN  	Sy'<'<9>>RR	Ss   ?D& &+E)t__name__
__module____qualname__r   rD   ra   r   rl  r   r   rs  r   rp   boolr   Listintr#   r   r   r   r"   r   r   r   r   r   r   r   r   r9   r   r   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   IOr
  r  r  r  r   r  r  r   r   r$  r'  r   r   r-  r1  r'   r9  r!   r&   rB  rH  rL  rN  r(   rT  dtdatetimetyping_extensionsLiteralr4   r7   r)   rd  rh  r*   rm  ru  r$   r~  r%   r  r2   r1   r  r  r  r3   r+   r  r.   r  r,   r-   r0   r/   r  r  Unionr6   r  r5   r   rF   rC   r;   r;   J   s   .*; . ,004+/4O OOC(4O  -	4O
 OOC(4O kk#vzz/*4O 4O 
4Or ,004+/'+VZ'+6:'+)-*.+/XO OOC(XO  -	XO
 OOC(XO t$XO XO C1Q,Q RSXO t$XO //&++c"23XO $XO //#&XO ??3'XO OOC(XO 
)XOz ,004+/VZ5O OOC(5O  -	5O
 OOC(5O 5O C1Q,Q RS5O 
5Ot ,004+/VZ/3'+)-*.+/NO OOC(NO  -	NO
 OOC(NO NO C1Q,Q RSNO t,NO $NO //#&NO ??3'NO OOC(NO 
$NOb CGpt%O%O+1??3+?%OY_YhYhilYm%O	%OV ,004.O.O OOC(	.O
  -.O kk#vzz/*.O 
.Ob CGpt%O%O+1??3+?%OY_YhYhilYm%O	S#X	%OT .22626&*'++/04DO ooc*DO //,/	DO
 /DO s#DO $DO OOC(DO  -DO 
DOR ,004:>-16:*.37EO OOC(EO  -	EO
 $*??3#7EO ooc*EO //&++c"23EO 3EO ??3'EO #OOC0EO 
EOV 37+/048O8O //,/	8O
 OOC(8O  -8O 
'8Ov BFos'O'O*0//#*>'OX^XgXghkXl'O	'OZ ,004'+37:O:O OOC(	:O
  -:O $:O #OOC0:O 
 :O@ 48&*'++/04AOAO 0	AO
 s#AO $AO OOC(AO  -AO 
AOL ,004%)/315*.+/;O OOC(;O  -	;O
 ooc";O ,;O  .;O ??3';O OOC(;O 
 ;O@ ,004/3,08O OOC(8O  -	8O
 ,8O __S)8O 8O 
8O| ,004)O)O OOC(	)O
  -)O 
)O^ ,004)O)O OOC(	)O
  -)O 
)O^ ,004,0%)5O5O OOC(	5O
  -5O __S)5O ooc"5O 
5Ov ,004-16:*.(,15*.+/LOLO OOC(	LO
  -LO ooc*LO  &s3LO ??3'LO %LO  .LO ??3'LO OOC(LO 
$LOd ,004-1*.>O>O OOC(	>O
  ->O ooc*>O >O ??3'>O 
>OH ,004-115*.5O5O OOC(	5O
  -5O ooc*5O !//#.5O ??3'5O YY5O 
5Ox ,0040O0O 0O
 OOC(0O  -0O 
0On ,0042O2O 2O
 OOC(2O  -2O 
2Or ,004-1*.>O>O >O
 OOC(>O  ->O ooc*>O ??3'>O 
>OF ,004	*O OOC(*O  -	*O
 *O 
"*OZ BFos'O'O*0//#*>'OX^XgXghkXl'O	!'OX ,004	5O OOC(5O  -	5O
 5O 
5Ot ,004	5O OOC(5O  -	5O
 5O 
5Ot ,004.2)-*.+/EO OOC(EO  -	EO
 
+EO //#&EO ??3'EO OOC(EO 
EOP CGpt-O-O+1??3+?-OY_YhYhilYm-O	-Od +/+/%)(,(,+/04JO ??3'JO OOC(	JO
 ooc"JO %JO %JO OOC(JO  -JO 
)JO^ ,004(, +/,0UO OOC(UO  -	UO
 %UO UO )UO ??3'UO __S)UO UO 
UOp EIrv0O0O-3__S-A0O[a[j[jkn[o0O	0Ol ,004<@GOGO OOC(	GO
  -GO OO$89GO 
GOT EIrv-O-O-3__S-A-O[a[j[jkn[o-O	-Od (,*.+/+/045O $5O ??3'	5O
 OOC(5O OOC(5O  -5O 
5Ot ,004/337MQ8<CG+/(,UYiO OOC(iO  -	iO
 ,iO OOBKK0iO $++,@AiO OO$IJiO "(!5iO KKS)iO -3OOC,@iO OOC(iO %iO !'<P0Q RiO 
iOX BFos%O%O*0//#*>%OX^XgXghkXl%O	%OP BFos*O*O*0//#*>*OX^XgXghkXl*O	/	0*Ob ,0043O3O 3O
 OOC(3O  -3O 
3Ot &**./O '..~>/O 	/O
 ooc"/O ??3'/O 
-/Oh 26+/04*.+/6O  .6O OOC(	6O
  -6O ??3'6O OOC(6O 
)6Ov ,004<@3O OOC(3O  -	3O
  893O 3O 
3Or 26+/045O5O  .	5O
 OOC(5O  -5O 
5Ov ,004,O,O OOC(	,O
  -,O 
,Oh 48+/04;O;O ;O +	;O #OOC0;O OOC(;O  -;O 
;O@ ,004*.+/2O OOC(2O  -	2O
 ??3'2O OOC(2O 
2On ,004 >B:O OOC(:O  -	:O
 KK.:O +:O #OOM::O 
:O@ ,004+O+O OOC(	+O
  -+O 
+O` +/+//3+/(,LPEI15047;6:SO ??3'SO OOC(	SO
 t,SO OOC(SO %SO __V\\#v{{37G2G%HISO oofll3C0@+@ABSO !//#.SO  -SO !' 4SO  &s3SO SO 
"SOj O  O  OrF   r;   c                      e Zd ZdefdZddeddej                  e   dej                  e   dej                  e   dej                  eej                  f   d	ed
efdZddeeeeeeeeeddej                  e   dej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      dej                  e   dej                  ej                  e      dej                  e   dej                  e   dej                  e   dej                  e   d
efdZddeeddej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      d
efdZddeeeeeeed	dej                  e   dej                  e   dej                  e   d	edej                  ej                  eej                  e   f      dej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
efdZddddedej                  e   dej                  e   d
efdZddddedej                  e   dej                  e   dej                  eej                  f   d
ef
dZddddedej                  e   dej                  e   d
ej                  eef   fdZdddddddd d!ej                  e   d"ej                  e   d#ej                  e   d$ej                  e   dej                  e   dej                  e   dej                  e   d
efd%Zddeeeedd&dej                  e   dej                  e   d'ej                  e   d!ej                  e   d(ej                  ej                  e      d)edej                  e   d*ej                  e   d
efd+Z dddd,ded"ej                  e   dej                  e   dej                  e   d
e!f
d-Z"dddd.edej                  e   dej                  e   d
e#fd/Z$ddedd0d.edej                  e   dej                  e   d1ej                  e   d*ej                  e   d
e%fd2Z&dddddd3d.ed#ej                  e'   d$ej                  e   dej                  e   dej                  e   dej                  e   d
e(fd4Z)dddddddd5dej                  e   dej                  e   d6ej                  e   d7ej                  e   d8ej                  e   dej                  e   dej                  e   d
e*fd9Z+ddeed:dej                  e   dej                  e   d7ej                  e   d;ej                  e   d6ed
e,fd<Z-dddd!edej                  e   dej                  e   d
e,fd=Z.dddd!edej                  e   dej                  e   d
dfd>Z/ddeed?d!edej                  e   dej                  e   d;ej                  e   d6ej                  e   d
e,fd@Z0ddddddddddA	d!edej                  e   dej                  e   dBej                  e   dCej                  e   dDej                  e   dEej                  e   d8ej                  e   dej                  e   dej                  e   d
e1fdFZ2ddeedGd!edej                  e   dej                  e   dBej                  e   dEedDej                  e   d
e3fdHZ4ddddddId!edej                  e   dej                  e   dBej                  e   dJej                  e   dDej                  e   dKejj                  d
e3fdLZ6dddd!edMedej                  e   dej                  e   d
e3f
dNZ7dddd!edMedej                  e   dej                  e   d
df
dOZ8ddeedGd!edMedej                  e   dej                  e   dBej                  e   dDej                  e   d
e3fdPZ9ddddej                  e   dej                  e   d!ed
e:fdQZ;dddd.edej                  e   dej                  e   d
e:fdRZ<ddddej                  e   dej                  e   dSe=d
e>fdTZ?ddddej                  e   dej                  e   dSe=d
e>fdUZ@ddeeeedVdej                  e   dej                  e   dej                  eA   dej                  e   dej                  e   dej                  e   d
eBfdWZCddddEedej                  e   dej                  e   d
dfdXZDddddddddYdej                  e   dej                  e   d6ej                  e   dZej                  e   d[ej                  e   dej                  e   dej                  e   d
eEfd\ZFddeeed]dej                  e   dej                  e   dZej                  e   d6ed^eGd_ej                  e   d`ej                  e   d[ed
eHfdaZIddddbedej                  e   dej                  e   d
eHfdcZJddedddbedej                  e   dej                  e   d^ej                  eG   d
eHf
deZKddddbedej                  e   dej                  e   d
dfdfZLddddddgd#ej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
eMfdhZNddeeeeeeeedi
dej                  e   dej                  e   djej                  e   dkej                  eOj                     dleQj                  dm   d^ej                  eS   dnej                  e   doej                  eef   dpej                  e   dqej                  e   drej                  e   dsej                  ej                  eT      d
eUfdtZVdddd.edej                  e   dej                  e   d
eUfduZWdddd.edej                  e   dej                  e   d
ej                  eX   fdvZYdddd.edwedej                  e   dej                  e   d
ej                  f
dxZZdddyd`eQj                  dz   d_ed{ej                  e   dej                  e   d
e[f
d|Z\dddddd}d~ej                  e   dej                  e   dej                  e   dej                  e   dej                  e   d
e]fdZ^ddeddej                  e   dej                  e   dej                  e_   dEed
e`f
dZaddddded~ej                  e   dej                  e   dej                  e   d
e`f
dZbddddedej                  e   dej                  e   d
ej                  fdZcdddddedededdej                  e   dej                  e   dej                  e   d
eefdZfddddddej                  e   dej                  e   dej                  e   dej                  e   d
egf
dZhddeddej                  e   dej                  e   dej                  ei   dejdej                  ek   d
elfdZmddddedej                  e   dej                  e   d
elfdZndddddddddddddej                  e   dej                  e   dej                  e   dej                  e   drej                  e   dej                  ej                  eej                  e   f      dej                  ej                  eej                  e   f      dej                  e   dej                  e   dej                  e   dej                  e   ded
epfdZqded
erfdZsy)AsyncBetaClientr<   c                    || _         y r>   r?   rA   s     rC   rD   zAsyncBetaClient.__init__  rE   rF   NrG   rH   rI   rJ   rK   rL   rM   c          	        K   ||d}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a:  
        Create new agent data.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str].

            - data: typing.Dict[str, typing.Any].

            - deployment_name: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_agent_data(
            data={"string": {}},
            deployment_name="string",
        )
        rO   rJ   rP   rQ   rR   rS   rT   rU   NrZ   r[   r\   r]   r`   rl   s	            rC   rp   z!AsyncBetaClient.create_agent_data  s\    B ;?Sb1cT!%/H\"..;;CCLL  D$8$8$E$E$G#H!JLde(
Wf)gh!(+((446 D 
 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   B'F)E*BF/E ?F+FFrr   rs   rt   ru   rv   rw   rx   ry   rz   c          	        K   d|i}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   |t         ur||d	<   |t         ur||d
<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)aa  
        Aggregate agent data with grouping and optional counting/first item retrieval.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to aggregate data for

            - count: typing.Optional[bool].

            - deployment_name: str. The agent deployment's name to aggregate data for

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].

            - first: typing.Optional[bool].

            - group_by: typing.Optional[typing.List[str]].

            - offset: typing.Optional[int].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post(
            deployment_name="string",
        )
        rL   rJ   rs   rt   ru   rv   rw   rx   ry   rz   rP   rQ   r|   rS   rT   rU   NrZ   r[   r\   r]   r}   r~   s                   rC   r   zKAsyncBetaClient.aggregate_agent_data_api_v_1_beta_agent_data_aggregate_post   s    j 3D_1UT!%/H\" %HW!'HX %HW4#+HZ !'HX4#+HZ D $-H[!T!%/H\"..;;CCLL  D$8$8$E$E$G#H!JLop(
Wf)gh!(+((446 D 
 
	 )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   DG-F=BG-F? &G-?+G**G-r   c          	      (  K   d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	       d
{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a	  
        Bulk delete agent data by query (deployment_name, collection, optional filters).

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to delete from

            - deployment_name: str. The agent deployment's name to delete data for

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_agent_data_by_query_api_v_1_beta_agent_data_delete_post(
            deployment_name="string",
        )
        rL   rJ   rt   rP   rQ   r   rS   rT   rU   NrZ   r[   r\   r]   r   r   s	            rC   r   zNAsyncBetaClient.delete_agent_data_by_query_api_v_1_beta_agent_data_delete_postZ  sn    @ 3D_1UT!%/H\"!'HX..;;CCLL  D$8$8$E$E$G#H!JLlm(
Wf)gh!(+((446 D 
 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   B3F5E"6BF;E$ F$+FFr   r   c       
   	        K   d|i}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   | j                  j                  j                  d	t        j
                  j                  | j                  j                          d
d      t        ||d      t        |      | j                  j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Search agent data with filtering, sorting, and pagination.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - collection: typing.Optional[str]. The logical agent data collection to search within

            - deployment_name: str. The agent deployment's name to search within

            - filter: typing.Optional[typing.Dict[str, typing.Optional[FilterOperation]]].

            - include_total: typing.Optional[bool]. Whether to include the total number of items in the response

            - offset: typing.Optional[int].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.search_agent_data_api_v_1_beta_agent_data_search_post(
            deployment_name="string",
        )
        rL   rJ   rt   r   rw   rx   ry   rz   rP   rQ   r   rS   rT   rU   NrZ   r[   r\   r]   r   r   s                 rC   r   zEAsyncBetaClient.search_agent_data_api_v_1_beta_agent_data_search_post  s    ^ 3D_1UT!%/H\"!'HX$(5H_%!'HX4#+HZ D $-H[!T!%/H\"..;;CCLL  D$8$8$E$E$G#H!JLlm(
Wf)gh!(+((446 D 
 
	 )''-#-(()CY^^EUVV  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   C4G6F#7BG<F% G%+GGrS   r   c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get agent data by ID.

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_agent_data(
            item_id="string",
        )
        r   rQ   r   rS   rT   r   NrZ   r[   r\   r]   r   r   s         rC   r   zAsyncBetaClient.get_agent_data  s?    , ..;;CCLL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh((446 D 
 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	S+   BE-D=BE-D? &E-?+E**E-c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      t        d|i      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Update agent data by ID (overwrites).

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - data: typing.Dict[str, typing.Any].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.update_agent_data(
            item_id="string",
            data={"string": {}},
        )
        r   rQ   r   rS   rK   rT   rU   NrZ   r[   r\   r]   r   r   s          rC   r   z!AsyncBetaClient.update_agent_data  sK    < ..;;CCLL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh!64.1((446 D 
 
	 )''-#-((INN4DEE  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   BE9E	BE9"E 2E9+E66E9c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  rBn n?t        j                  t        j                  t        t        f   |j                               S |j                  d
k(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Delete agent data by ID.

        Parameters:
            - item_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_agent_data(
            item_id="string",
        )
        r   rQ   r   rS   rT   r   NrZ   r[   r\   r]   r   r   s         rC   r   z!AsyncBetaClient.delete_agent_data8  sL    , ..;;CCLL  D$8$8$E$E$G#H!JNefmenLop(
Wf)gh((446 D 
 
	 )''-#-((S#X)>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Ss+   BFEBF-E =F+FFr   r   r   r   r   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        List all batch processing jobs for a project with optional filtering.

        Returns a paginated list of batch jobs with filters for directory, job type, and status.
        Useful for viewing job history, monitoring progress, and finding specific jobs.

        Parameters:
            - directory_id: typing.Optional[str]. Filter by directory ID

            - job_type: typing.Optional[BatchJobType]. Filter by job type (PARSE, EXTRACT, CLASSIFY)

            - status: typing.Optional[BatchJobStatus]. Filter by job status (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED)

            - limit: typing.Optional[int]. Maximum number of jobs to return

            - offset: typing.Optional[int]. Number of jobs to skip for pagination

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchJobStatus, BatchJobType
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_batch_jobs(
            job_type=BatchJobType.PARSE,
            status=BatchJobStatus.PENDING,
        )
        r   rQ   r   r   rT   r   NrZ   r[   r\   r]   r   r   s
             rC   r   zAsyncBetaClient.list_batch_jobs_  sN    V ..;;CCLL  D$8$8$E$E$G#H!JLjk($0 ($"$",'6
 ((446 D 
 
	" )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN3
.  	Sy'<'<9>>RR	S+   BE/D?BE/E (E/+E,,E/r   r   r   r   r   c                z  K   d|i}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d	      t        |	      t        i | j                  j                         d
|i      d       d{   }
d|
j                  cxk  rdk  r+n n(t        j                  t        |
j                               S |
j                  dk(  r1t!        t        j                  t"        |
j                                     	 |
j                         }t'        |
j                  |      7 # t$        $ r" t'        |
j                  |
j(                        w xY ww)a8  
        Create a new batch processing job for a directory.

        Processes all files in the specified directory according to the job configuration.
        The job runs asynchronously and you can monitor progress using the job status endpoint.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - continue_as_new_threshold: typing.Optional[int].

            - directory_id: typing.Optional[str].

            - item_ids: typing.Optional[typing.List[str]].

            - job_config: BatchJobCreateRequestJobConfig. Job configuration for batch processing. Can be BatchParseJobRecordCreate or ClassifyJob.

            - page_size: typing.Optional[int]. Number of files to fetch per batch from the directory (only used in directory mode)

            - temporal_namespace: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_batch_job()
        r   r   r   r   ry   rP   rQ   r   rS   r   rT   rU   NrZ   r[   r\   r]   r   r   s               rC   r   z AsyncBetaClient.create_batch_job  s    T 3?
1K$D04MH01t#'3H^$4#+HZ D $-H[!..;;CCLL  D$8$8$E$E$G#H!JLjk(
Wf)gh!(+)`4''335`7KM_`  D 	
 	
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Ss+   CF;FBF;$F 4F;+F88F;r   c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get all processing results for a specific item (lineage query).

        Shows complete processing history including what operations have been performed,
        with what parameters, and where outputs are stored. Useful for understanding
        what processing has already been done to avoid redundant work. Optionally filter
        by job type to see only specific processing operations.

        Parameters:
            - item_id: str.

            - job_type: typing.Optional[BatchJobType]. Filter results by job type

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchJobType
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_item_processing_results(
            item_id="string",
            job_type=BatchJobType.PARSE,
        )
        r   rQ   r   r   r   rT   r   NrZ   r[   r\   r]   r   r   s          rC   r   z+AsyncBetaClient.get_item_processing_results  sN    H ..;;CCLL  ''4467q95gY>QR )%ZTcd ((446 D 
 
	 )''-#-(()F	HXYY  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN)
$  	Sy'<'<9>>RR	Sr  r   c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get detailed status of a batch processing job.

        Returns current progress, file counts, and estimated completion time.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_batch_job_status(
            job_id="string",
        )
        r   rQ   r   rS   rT   r   NrZ   r[   r\   r]   r   r   s         rC   r   z$AsyncBetaClient.get_batch_job_status&  s@    0 ..;;CCLL  D$8$8$E$E$G#H!JNklrksLtu(
Wf)gh((446 D 
 
	 )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr  r   r   c                0  K   i }|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d      t        ||d      t        |      t        i | j                  j                         d|i      d	       d
{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Cancel a running batch processing job.

        Stops processing and marks all pending items as cancelled. Items currently
        being processed may complete depending on their state.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - reason: typing.Optional[str].

            - temporal_namespace: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.cancel_batch_job(
            job_id="string",
        )
        r   rP   rQ   r   r   rS   r   rT   rU   NrZ   r[   r\   r]   r   r   s	            rC   r   z AsyncBetaClient.cancel_batch_jobO  s    F 24!'HX..;;CCLL  ''4467q9=Z[aZbbi;j )
Wf)gh!(+)`4''335`7KM_`  D 
 
	 )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN)
$  	Sy'<'<9>>RR	S+   B7F9E&:BF?E( F(+FFr   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        |||||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        List items in a batch job with optional status filtering.

        Useful for finding failed items, viewing completed items, or debugging issues.
        Results are paginated for performance with configurable limit and offset parameters.

        Parameters:
            - job_id: str.

            - status: typing.Optional[BatchFileStatus]. Filter items by status

            - limit: typing.Optional[int]. Maximum number of items to return

            - offset: typing.Optional[int]. Number of items to skip

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import BatchFileStatus
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_batch_job_items(
            job_id="string",
            status=BatchFileStatus.PENDING,
        )
        r   rQ   r   r   r   rT   r   NrZ   r[   r\   r]   r   r   s	            rC   r   z$AsyncBetaClient.list_batch_job_items  sY    P ..;;CCLL  ''4467q9=Z[aZbbh;i )$"$",'6 ((446 D 
 
	" )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN3
.  	Sy'<'<9>>RR	Ss+   BE1EBE1E *E1+E..E1r   r   r   r   c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	      7 # t         $ r" t#        |j                  |j$                        w xY ww)a8  
        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - name: typing.Optional[str].

            - data_source_id: typing.Optional[str].

            - include_deleted: typing.Optional[bool].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_directories()
        r   rQ   r   r   rT   r   NrZ   r[   r\   r]   r   r   s
             rC   r   z AsyncBetaClient.list_directories  sN    D ..;;CCLL  D$8$8$E$E$G#H!JLef(",'6 &4'6!*",
 ((446 D 
 
	" )''-#-(()?AQRR  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN3
.  	Sy'<'<9>>RR	Sr  r   r   c          	      (  K   d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	       d
{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Create a new directory within the specified project.

        If data_source_id is provided, validates that the data source exists
        and belongs to the same project.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - data_source_id: typing.Optional[str].

            - description: typing.Optional[str].

            - name: str. Human-readable name for the directory.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_directory(
            name="string",
        )
        r   r   r   rP   rQ   r   rS   rT   rU   NrZ   r[   r\   r]   r   r   s	            rC   r   z AsyncBetaClient.create_directory  sn    F 39$%)7H%&d"&1H]#..;;CCLL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 D 
 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Sr  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Retrieve a directory by its identifier.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_directory(
            directory_id="string",
        )
        r   rQ   r   rS   rT   r   NrZ   r[   r\   r]   r   r   s         rC   r   zAsyncBetaClient.get_directoryE  s@    4 ..;;CCLL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh((446 D 
 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  ry |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)a  
        Permanently delete a directory.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_directory(
            directory_id="string",
        )
        r   rQ   r   rS   rT   r   NrZ   r[   r\   r]   r   r   s         rC   r   z AsyncBetaClient.delete_directoryp  s-    4 ..;;CCLL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh((446 D 
 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	S+   BEDAE-D =E+EEr   c          	      *  K   i }|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd|       t        ||d      t        |      | j                  j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Update directory metadata.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - description: typing.Optional[str].

            - name: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.update_directory(
            directory_id="string",
        )
        r   r   r   rQ   r   rS   rT   rU   NrZ   r[   r\   r]   r   r   s	            rC   r   z AsyncBetaClient.update_directory  sr    @ 24d"&1H]#t#HV..;;CCLL  D$8$8$E$E$G#H!JNfgsftLuv(
Wf)gh!(+((446 D 
 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   B4F6E#7BF<E% F%+FFr   r   r   r   r   c       	           K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||||||||	|
d	      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)aV  
        List all files within the specified directory with optional filtering and pagination.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - display_name_contains: typing.Optional[str].

            - unique_id: typing.Optional[str].

            - file_id: typing.Optional[str].

            - include_deleted: typing.Optional[bool].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_directory_files(
            directory_id="string",
        )
        r   rQ   r   r   r   rT   r   NrZ   r[   r\   r]   r   r   s                rC   r   z$AsyncBetaClient.list_directory_files  se    ^ ..;;CCLL  ''4467q9=UVbUcci;j )",'6$0-B!*&'6!*",
 ((446' D 
 
	* )''-#-(()CY^^EUVV  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN;
6  	Sy'<'<9>>RR	Ss+   BE5EBE5E .E5+E22E5r   c          	      0  K   d|i}|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d      t        ||d      t        |      | j                  j                         d	
       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Create a new file within the specified directory.

        The directory must exist and belong to the project passed in.
        The file_id must be provided and exist in the project.

        Parameters:
            - directory_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - file_id: str. File ID for the storage location (required).

            - unique_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.add_directory_file(
            directory_id="string",
            file_id="string",
        )
        r   r   r   rP   rQ   r   r   rS   rT   rU   NrZ   r[   r\   r]   r   r   s
             rC   r   z"AsyncBetaClient.add_directory_file   s    N 3<W1Et#'3H^$D $-H[!..;;CCLL  ''4467q9=UVbUcci;j )
Wf)gh!(+((446 D 	
 	
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Sr  r   r   r  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      t        |||d      d|i| j                   j                         d	       d
{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }	t%        |j                  |	      7 # t"        $ r" t%        |j                  |j&                        w xY ww)r  rP   rQ   r   r  rS   r  r  rT   r  NrZ   r[   r\   r]   r  r	  s
             rC   r
  z(AsyncBetaClient.upload_file_to_directory`  sg    @ ..;;CCLL  ''4467q9=UVbUccp;q )
Wf)gh!!-CSbkl !+.((446 D 
 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN+
&  	Sy'<'<9>>RR	Ss+   B E?"E#BE?(E 8E?+E<<E?r  c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d|       t        ||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get a file by its directory_file_id within the specified directory. If you're trying to get a file by its unique_id, use the list endpoint with a filter instead.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   rQ   r   r  rS   rT   r   NrZ   r[   r\   r]   r  r  s          rC   r  z"AsyncBetaClient.get_directory_file  sK    < ..;;CCLL  ''4467q9*<.@Q?RS )
Wf)gh((446 D 	
 	
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Ss+   BE0E BE0E )E0+E--E0c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d|       t        ||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  ry |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)a  
        Delete a file from the specified directory.

        Note: This endpoint uses directory_file_id (the internal ID). If you're trying to delete a file by its unique_id, use the list endpoint with a filter to find the directory_file_id first.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   rQ   r   r  rS   rT   r   NrZ   r[   r\   r]   r   r  s          rC   r  z%AsyncBetaClient.delete_directory_file  s9    @ ..;;CCLL  ''4467q9*<.@Q?RS )
Wf)gh((446 D 	
 	
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Ss+   BEDAE0D  E+EEc          
      0  K   i }|t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd| d|       t        ||d      t        |      | j                  j                         d	       d
{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      7 # t$        $ r" t'        |j                  |j(                        w xY ww)aG  
        Update file metadata within the specified directory.

        Note: This endpoint uses directory_file_id (the internal ID). If you're trying to update a file by its unique_id, use the list endpoint with a filter to find the directory_file_id first.

        Parameters:
            - directory_id: str.

            - directory_file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - display_name: typing.Optional[str].

            - unique_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.update_directory_file(
            directory_id="string",
            directory_file_id="string",
        )
        r   r   r   rQ   r   r  rS   rT   rU   NrZ   r[   r\   r]   r   r  s
             rC   r  z%AsyncBetaClient.update_directory_file  s}    L 24t#'3H^$D $-H[!..;;CCLL  ''4467q9*<.@Q?RS )
Wf)gh!(+((446 D 

 

	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN'

"  	Sy'<'<9>>RR	Sr  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        d|i      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Create a new directory sync job.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - directory_id: str. Directory being processed
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_directory_sync_job_api_v_1_beta_directory_sync_jobs_post(
            directory_id="string",
        )
        rP   rQ   r  rS   r   rT   rU   NrZ   r[   r\   r]   r  r  s         rC   r  zOAsyncBetaClient.create_directory_sync_job_api_v_1_beta_directory_sync_jobs_post=  sD    4 ..;;CCLL  D$8$8$E$E$G#H!JLmn(
Wf)gh!><"@A((446 D 
 
	 )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   BE6EBE6E /E6+E33E6c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get a directory sync job by ID.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_directory_sync_job(
            job_id="string",
        )
        r   rQ   r  rS   rT   r   NrZ   r[   r\   r]   r  r   s         rC   r  z&AsyncBetaClient.get_directory_sync_jobi  sE    , ..;;CCLL  ''4467q9=]^d]e;f )
Wf)gh((446 D 
 
	 )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Sr  rc   c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Create a new file in the project.

        Args:
        file_create: File creation data
        project: Validated project from dependency
        db: Database session

        Returns:
        The created file

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: FileCreate.
        ---
        from llama_cloud import FileCreate
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_file(
            request=FileCreate(
                name="string",
            ),
        )
        rP   rQ   r!  rS   rT   rU   NrZ   r[   r\   r]   r"  r#  s         rC   r$  zAsyncBetaClient.create_file  s?    J ..;;CCLL  D$8$8$E$E$G#H!JL_`(
Wf)gh!'*((446 D 
 
	 )''-#-((y~~/?@@  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	S+   BE4EBE4E -E4+E11E4c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||d      t        |      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Upsert a file (create or update if exists) in the project.

        Args:
        file_create: File creation/update data
        project: Validated project from dependency
        db: Database session

        Returns:
        The upserted file

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - request: FileCreate.
        ---
        from llama_cloud import FileCreate
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.upsert_file(
            request=FileCreate(
                name="string",
            ),
        )
        r   rQ   r!  rS   rT   rU   NrZ   r[   r\   r]   r"  r#  s         rC   r'  zAsyncBetaClient.upsert_file  s?    J ..;;CCLL  D$8$8$E$E$G#H!JL_`(
Wf)gh!'*((446 D 
 
	 )''-#-((y~~/?@@  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Sr  r(  c          	      X  K   i }|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d	
       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }	t'        |j                  |	      7 # t$        $ r" t'        |j                  |j(                        w xY ww)ag  
        Query files with flexible filtering and pagination.

        Args:
        request: The query request with filters and pagination
        project: Validated project from dependency
        db: Database session

        Returns:
        Paginated response with files

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - filter: typing.Optional[FileFilter].

            - order_by: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud import FileFilter
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.query_files(
            filter=FileFilter(),
        )
        rt   rx   ry   rz   rP   rQ   r*  rS   rT   rU   NrZ   r[   r\   r]   r+  r,  s
             rC   r-  zAsyncBetaClient.query_files   s    X 24!'HX4#+HZ D $-H[!T!%/H\"..;;CCLL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 D 
 
	 )''-#-(():INN<LMM  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   CF*E:BF*E< #F*<+F''F*c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  ry |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)aw  
        Delete a single file from the project.

        Args:
        file_id: The ID of the file to delete
        project: Validated project from dependency
        db: Database session

        Returns:
        None (204 No Content on success)

        Parameters:
            - file_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_file(
            file_id="string",
        )
        r   rQ   r/  rS   rT   r   NrZ   r[   r\   r]   r   r0  s         rC   r1  zAsyncBetaClient.delete_fileG  s-    < ..;;CCLL  D$8$8$E$E$G#H!JN`ah`iLjk(
Wf)gh((446 D 
 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr  r2  r3  r4  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }	t#        |j                  |	      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        List parse configurations for the current project.

        Args:
        project: Validated project from dependency
        user: Current user
        db: Database session
        page_size: Number of items per page
        page_token: Token for pagination
        name: Filter by configuration name
        creator: Filter by creator
        version: Filter by version

        Returns:
        Paginated response with parse configurations

        Parameters:
            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].

            - name: typing.Optional[str].

            - creator: typing.Optional[str].

            - version: typing.Optional[str].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_parse_configurations()
        r   rQ   r6  r2  rT   r   NrZ   r[   r\   r]   r7  r8  s
             rC   r9  z)AsyncBetaClient.list_parse_configurationsv  sN    b ..;;CCLL  D$8$8$E$E$G#H!JLno(!*", &&",'6
 ((446 D 
 
	" )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN3
.  	Sy'<'<9>>RR	Sr  r:  r=  r;  r<  c          	      F  K   |||d}	|t         ur||	d<   |t         ur||	d<   |t         ur||	d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |	      | j                  j                         d	
       d{   }
d|
j                  cxk  rdk  r+n n(t        j                  t        |
j                               S |
j                  dk(  r1t!        t        j                  t"        |
j                                     	 |
j                         }t'        |
j                  |      7 # t$        $ r" t'        |
j                  |
j(                        w xY ww)a  
        Create a new parse configuration.

        Args:
        config_create: Parse configuration creation data
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The created parse configuration

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - creator: typing.Optional[str].

            - name: str. Name of the parse configuration

            - parameters: LlamaParseParameters. LlamaParseParameters configuration

            - source_id: typing.Optional[str].

            - source_type: typing.Optional[str].

            - version: str. Version of the configuration
        ---
        from llama_cloud import (
            FailPageMode,
            LlamaParseParameters,
            LlamaParseParametersPriority,
            ParsingMode,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_parse_configuration(
            name="string",
            parameters=LlamaParseParameters(
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=LlamaParseParametersPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
            ),
            version="string",
        )
        r?  r3  r;  r<  rP   rQ   r6  rS   rT   rU   NrZ   r[   r\   r]   r@  rA  s               rC   rB  z*AsyncBetaClient.create_parse_configuration  s    | ;?jel1m$")HYD $-H[!d"&1H]#..;;CCLL  D$8$8$E$E$G#H!JLno(
Wf)gh!(+((446 D 
 
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   CF!E1BF!
E3 F!3+FF!rC  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get a parse configuration by ID.

        Args:
        config_id: The ID of the parse configuration
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The parse configuration

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_parse_configuration(
            config_id="string",
        )
        r   rQ   rE  rS   rT   r   NrZ   r[   r\   r]   rF  rG  s         rC   rH  z'AsyncBetaClient.get_parse_configuration  sE    > ..;;CCLL  ''4467q9=^_h^i;j )
Wf)gh((446 D 
 
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Sr  rI  c          	        K   i }|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd|       t        ||d      t        |      | j                  j                         d       d{   }d	|j                  cxk  rd
k  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Update a parse configuration.

        Args:
        config_id: The ID of the parse configuration to update
        config_update: Update data
        project: Validated project from dependency
        user: Current user
        db: Database session

        Returns:
        The updated parse configuration

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - parameters: typing.Optional[LlamaParseParameters].
        ---
        from llama_cloud import (
            FailPageMode,
            LlamaParseParameters,
            LlamaParseParametersPriority,
            ParsingMode,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.update_parse_configuration(
            config_id="string",
            parameters=LlamaParseParameters(
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=LlamaParseParametersPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
            ),
        )
        r=  r   rQ   rE  rS   rT   rU   NrZ   r[   r\   r]   r@  rK  s           rC   rL  z*AsyncBetaClient.update_parse_configurationK  se    d 24T!%/H\"..;;CCLL  ''4467q9=^_h^i;j )
Wf)gh!(+((446 D 	
 	
	 )''-#-(();Y^^=MNN  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Sr  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  ry |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |      7 # t        $ r" t!        |j                  |j"                        w xY ww)ar  
        Delete a parse configuration.

        Args:
        config_id: The ID of the parse configuration to delete
        project: Validated project from dependency
        user: Current user
        db: Database session

        Parameters:
            - config_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_parse_configuration(
            config_id="string",
        )
        r   rQ   rE  rS   rT   r   NrZ   r[   r\   r]   r   rG  s         rC   rN  z*AsyncBetaClient.delete_parse_configuration  s2    8 ..;;CCLL  ''4467q9=^_h^i;j )
Wf)gh((446 D 
 
	 )''-#- .  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Sr  rO  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        List parse jobs with optional filtering and pagination.

        Parameters:
            - status: typing.Optional[str]. Filter by job status (pending, running, completed, failed, cancelled)

            - page_size: typing.Optional[int]. Maximum number of jobs to return

            - page_token: typing.Optional[str]. Page token for cursor-based pagination

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_parse_jobs()
        r   rQ   rQ  rO  rT   r   NrZ   r[   r\   r]   rR  rS  s           rC   rT  zAsyncBetaClient.list_parse_jobs  sG    < ..;;CCLL  D$8$8$E$E$G#H!JLjk($!*",",'6 ((446 D 
 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN/
*  	Sy'<'<9>>RR	Sr  rU  rV  rW  r]  r^  rX  r_  rY  rZ  r[  r\  c          	        K   ||d}|t         ur||d<   |t         ur||d<   |t         ur||d<   |t         ur||d<   |	t         ur|	|d<   |
t         ur|
|d<   |t         ur||d<   |t         ur||d	<   | j                  j                  j                  d
t        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Create a new parse job.

        Processes a document asynchronously. Use the job ID to check status and retrieve results.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - correlation_id: typing.Optional[str].

            - created_at: typing.Optional[dt.datetime]. Creation datetime

            - job_name: typing_extensions.Literal["parse_raw_file_job"].

            - parameters: typing.Optional[SrcParseSchemasWorkflowParseJobConfig].

            - parent_job_execution_id: typing.Optional[str].

            - partitions: typing.Dict[str, str]. The partitions for this execution. Used for determining where to save job output.

            - parse_job_record_create_project_id: typing.Optional[str].

            - session_id: typing.Optional[str].

            - user_id: typing.Optional[str].

            - webhook_configurations: typing.Optional[typing.List[WebhookConfiguration]].
        ---
        from llama_cloud import (
            FailPageMode,
            ParsingMode,
            SrcParseSchemasWorkflowParseJobConfig,
            SrcParseSchemasWorkflowParseJobConfigPriority,
        )
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_parse_job(
            job_name="parse_raw_file_job",
            parameters=SrcParseSchemasWorkflowParseJobConfig(
                file_key="string",
                file_name="string",
                lang="string",
                original_file_name="string",
                parse_mode=ParsingMode.PARSE_PAGE_WITHOUT_LLM,
                priority=SrcParseSchemasWorkflowParseJobConfigPriority.LOW,
                replace_failed_page_mode=FailPageMode.RAW_TEXT,
                type="parse",
            ),
            partitions={"string": "string"},
        )
        ra  rV  rW  r=  rX  rH   rZ  r[  r\  rP   rQ   rQ  rS   rT   rU   NrZ   r[   r\   r]   rb  rc  s                   rC   rd  z AsyncBetaClient.create_parse_job  s    P ?GV`1a%)7H%&T!%/H\"T!%/H\""$.2IH./-T9%GH\"T!%/H\"$")HY!-1GH-...;;CCLL  D$8$8$E$E$G#H!JLjk(
Wf)gh!(+((446 D 
 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   DG!F1BG!
F3 G!3+GG!c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get a parse job by ID.

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_parse_job(
            job_id="string",
        )
        r   rQ   rf  rS   rT   r   NrZ   r[   r\   r]   rg  r   s         rC   rh  zAsyncBetaClient.get_parse_jobe  s@    , ..;;CCLL  D$8$8$E$E$G#H!JNklrksLtu(
Wf)gh((446 D 
 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d      t        ||d      | j                   j                         d       d{   }d	|j                  cxk  rd
k  r<n n9t        j                  t        j                  t           |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)an  
        Get results for a parse job.

        Returns a single result object containing the full OutputFiles JSON with all output types
        (full_text, md, json_output, job_info, xlsx, output_pdf, structured, images, charts).

        Parameters:
            - job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_parse_job_results(
            job_id="string",
        )
        r   rQ   rf  rj  rS   rT   r   NrZ   r[   r\   r]   rk  r   s         rC   rm  z%AsyncBetaClient.get_parse_job_results  sT    2 ..;;CCLL  ''4467q9=Z[aZbbj;k )
Wf)gh((446 D 
 
	 )''-#-((9O)PR[R`R`Rbcc  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss+   BE?EBE?(E 8E?+E<<E?rn  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d| d      t        ||d      | j                   j                         d       d	{   }d
|j                  cxk  rdk  r5n n2t        j                  t        j                  |j                               S |j                  dk(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)a  
        Stream parse result content from storage.

        The result_type should be one of: fullText, md, json, jobInfo, xlsx, outputPDF, structured.
        For images and charts, use the index-based approach (e.g., images[0], charts[1]).

        Parameters:
            - job_id: str.

            - result_type: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.stream_parse_job_result_content(
            job_id="string",
            result_type="string",
        )
        r   rQ   rf  rp  rq  rS   rT   r   NrZ   r[   r\   r]   rr  rt  s          rC   ru  z/AsyncBetaClient.stream_parse_job_result_content  sO    B ..;;CCLL  ''4467q9/xyXV )
Wf)gh((446 D 	
 	
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN%	
   	Sy'<'<9>>RR	Ss+   BE;EBE;$E 4E;+E88E;rv  rx  rw  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)aH  
        Retrieve a paginated list of quota configurations with optional filtering.

        Parameters:
            - source_type: typing_extensions.Literal["organization"].

            - source_id: str.

            - page: typing.Optional[int].

            - page_size: typing.Optional[int].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_quota_configurations(
            source_type="organization",
            source_id="string",
        )
        r   rQ   rz  r{  rT   r   NrZ   r[   r\   r]   r|  r}  s          rC   r~  z)AsyncBetaClient.list_quota_configurations  s@    < ..;;CCLL  D$8$8$E$E$G#H!JLjk( +)T`ij ((446 D 
 
	 )''-#-(()LinnN^__  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	S+   BE,D<BE,D> %E,>+E))E,r  r  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)as  
        List spreadsheet parsing jobs.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - include_results: typing.Optional[bool].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_spreadsheet_jobs()
        r   rQ   r  r  rT   r   NrZ   r[   r\   r]   r  r  s           rC   r  z%AsyncBetaClient.list_spreadsheet_jobs  sG    > ..;;CCLL  D$8$8$E$E$G#H!JLef('6",'6!*", ((446 D 
 
	 )''-#-(()H)..JZ[[  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN/
*  	Sy'<'<9>>RR	Sr  r  r  c          	        K   d|i}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Create a spreadsheet parsing job.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - config: typing.Optional[SpreadsheetParsingConfig]. Configuration for the parsing job

            - file_id: str. The ID of the file to parse
        ---
        from llama_cloud import SpreadsheetParsingConfig
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_spreadsheet_job(
            config=SpreadsheetParsingConfig(),
            file_id="string",
        )
        r   r  rP   rQ   r  rS   rT   rU   NrZ   r[   r\   r]   r  r  s           rC   r  z&AsyncBetaClient.create_spreadsheet_jobV  s[    @ 3<W1E!'HX..;;CCLL  D$8$8$E$E$G#H!JLef(
Wf)gh!(+((446 D 
 
	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   B&F(E)BF.E >F+FFr  r  c          
        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        |||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a$  
        Get a spreadsheet parsing job.

        When include_results=True (default), the response will include extracted regions and results
        if the job is complete, eliminating the need for a separate /results call.

        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - include_results: typing.Optional[bool].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_spreadsheet_job(
            spreadsheet_job_id="string",
        )
        r   rQ   r  r  rT   r   NrZ   r[   r\   r]   r  r  s          rC   r  z#AsyncBetaClient.get_spreadsheet_job  sL    D ..;;CCLL  ''4467q9=UVhUi;j )$3:bqr ((446 D 

 

	 )''-#-((9IJJ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN'

"  	Sy'<'<9>>RR	Ss+   BE.D>BE.E  'E. +E++E.c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r5n n2t        j                  t        j                  |j                               S |j                  d
k(  r1t        t        j                  t         |j                                     	 |j                         }t%        |j                  |      7 # t"        $ r" t%        |j                  |j&                        w xY ww)aQ  
        Delete a spreadsheet parsing job and its associated data.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.delete_spreadsheet_job(
            spreadsheet_job_id="string",
        )
        r   rQ   r  rS   rT   r   NrZ   r[   r\   r]   rr  r  s         rC   r  z&AsyncBetaClient.delete_spreadsheet_job  sH    6 ..;;CCLL  ''4467q9=UVhUi;j )
Wf)gh((446 D 
 
	 )''-#-((Y^^5EFF  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN#
  	Sy'<'<9>>RR	Ss+   BE7EBE7 E	 0E7	+E44E7r  r  r  r  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd| d| d|       t        |||d      | j                   j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)aj  
        Generate a presigned URL to download a specific extracted region.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - spreadsheet_job_id: str.

            - region_id: str.

            - region_type: SpreadsheetResultType.

            - expires_at_seconds: typing.Optional[int].

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud import SpreadsheetResultType
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_result_region(
            spreadsheet_job_id="string",
            region_id="string",
            region_type=SpreadsheetResultType.TABLE,
        )
        r   rQ   r  r  r  r  rT   r   NrZ   r[   r\   r]   r  r  s	            rC   r  z!AsyncBetaClient.get_result_region  s[    N ..;;CCLL  ''4467q9*+=*>i	{RZ[fZgh )'9hwx ((446 D 
 
	 )''-#-((y~~7GHH  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN)
$  	Sy'<'<9>>RR	Sr  r  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        ||||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a1  
        List document split jobs.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - page_size: typing.Optional[int].

            - page_token: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_split_jobs()
        r   rQ   r  r  rT   r   NrZ   r[   r\   r]   r  r  s          rC   r  zAsyncBetaClient.list_split_jobs-  sD    8 ..;;CCLL  D$8$8$E$E$G#H!JLde(",'6!*",	 ((446 D 
 
	 )''-#-(()>	@PQQ  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN-
(  	Sy'<'<9>>RR	Sr
  r  r  r  r  c          	        K   ||d}|t         ur||d<   | j                  j                  j                  dt        j
                  j                  | j                  j                          dd      t        ||d      t        |      | j                  j                         d       d	{   }d
|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  dk(  r1t!        t        j                  t"        |j                                     	 |j                         }t'        |j                  |      7 # t$        $ r" t'        |j                  |j(                        w xY ww)a  
        Create a document split job.
        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].

            - categories: typing.List[SplitCategory]. Categories to split the document into.

            - document_input: SplitDocumentInput. Document to be split.

            - splitting_strategy: typing.Optional[SplitStrategy]. Strategy for splitting the document.
        ---
        from llama_cloud import SplitDocumentInput, SplitStrategy
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.create_split_job(
            categories=[],
            document_input=SplitDocumentInput(
                type="string",
                value="string",
            ),
            splitting_strategy=SplitStrategy(),
        )
        r  r  rP   rQ   r  rS   rT   rU   NrZ   r[   r\   r]   r  r  s	            rC   r  z AsyncBetaClient.create_split_joba  s`    N AK^l1mT)-?H)*..;;CCLL  D$8$8$E$E$G#H!JLde(
Wf)gh!(+((446 D 
 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Sr  r  c          	        K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       t        ||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a  
        Get a document split job.

        Experimental: This endpoint is not yet ready for production use and is subject to change at any time.

        Parameters:
            - split_job_id: str.

            - project_id: typing.Optional[str].

            - organization_id: typing.Optional[str].
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_split_job(
            split_job_id="string",
        )
        r   rQ   r  rS   rT   r   NrZ   r[   r\   r]   r  r  s         rC   r  zAsyncBetaClient.get_split_job  s@    8 ..;;CCLL  D$8$8$E$E$G#H!JNefresLtu(
Wf)gh((446 D 
 
	 )''-#-(()99>>;KLL  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN
  	Sy'<'<9>>RR	Sr  r  r  r  r  r  r  r  c                  K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd      t        |||||||||	|
||d      | j                   j                         d       d{   }d|j                  cxk  rd	k  r+n n(t        j                  t        |j                               S |j                  d
k(  r1t        t        j                  t        |j                                     	 |j                         }t#        |j                  |      7 # t         $ r" t#        |j                  |j$                        w xY ww)a8  
        List usage metrics with filtering and pagination.

        Parameters:
            - page_size: typing.Optional[int]. Number of items per page

            - page_token: typing.Optional[str]. Token for pagination

            - include_total: typing.Optional[bool]. Include total count in response

            - project_id: typing.Optional[str]. Filter by project ID

            - user_id: typing.Optional[str]. Filter by user ID

            - event_types: typing.Optional[typing.Union[str, typing.List[str]]]. Filter by event types

            - days: typing.Optional[typing.Union[str, typing.List[str]]]. Filter by specific days (YYYY-MM-DD)

            - day_on_or_before: typing.Optional[str]. Filter by days on or before this date (YYYY-MM-DD)

            - day_on_or_after: typing.Optional[str]. Filter by days on or after this date (YYYY-MM-DD)

            - event_aggregation_type: typing.Optional[str]. Filter by event aggregation type

            - event_aggregation_key: typing.Optional[str]. Filter by event aggregation key

            - organization_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.list_usage_metrics(
            organization_id="string",
        )
        r   rQ   r  r  rT   r   NrZ   r[   r\   r]   r  r  s                  rC   r  z"AsyncBetaClient.list_usage_metrics  s]    j ..;;CCLL  D$8$8$E$E$G#H!JLgh(!*",%2",&#. (8'6.D-B'6  ((446) D 
 
	, )''-#-(()A9>>CSTT  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN=
8  	Sy'<'<9>>RR	Sr  r  c                   K   | j                   j                  j                  dt        j                  j                  | j                   j                          dd|       | j                   j                         d       d{   }d|j                  cxk  rdk  r+n n(t        j                  t        |j                               S |j                  d	k(  r1t        t        j                  t        |j                                     	 |j                         }t!        |j                  |
      7 # t        $ r" t!        |j                  |j"                  
      w xY ww)aP  
        Get a usage metric by ID.

        Parameters:
            - usage_metric_id: str.
        ---
        from llama_cloud.client import AsyncLlamaCloud

        client = AsyncLlamaCloud(
            token="YOUR_TOKEN",
        )
        await client.beta.get_usage_metric(
            usage_metric_id="string",
        )
        r   rQ   r  rT   r  NrZ   r[   r\   r]   r  r  s       rC   r  z AsyncBetaClient.get_usage_metric  s6      ..;;CCLL  ''4467q9=WXgWh;i ((446 D 
 
	 )''-#-((inn6FGG  C'*8+@+@ATV_VdVdVf+ghh	S&^^-N 9#8#8~NN!
  	Sy'<'<9>>RR	Ss+   BE D0BE 	D2 E 2+EE )tr  r  r  r   rD   ra   r   rl  r   r   rs  r   rp   r  r   r  r  r#   r   r   r   r"   r   r   r   r   r   r   r   r   r9   r   r   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r   r  r  r   r   r$  r'  r   r   r-  r1  r'   r9  r!   r&   rB  rH  rL  rN  r(   rT  r  r  r  r  r4   r7   r)   rd  rh  r*   rm  ru  r$   r~  r%   r  r2   r1   r  r  r  r3   r+   r  r.   r  r,   r-   r0   r/   r  r  r  r6   r  r5   r  r  rF   rC   r  r    s   .*< . ,004+/4O OOC(4O  -	4O
 OOC(4O kk#vzz/*4O 4O 
4Or ,004+/'+VZ'+6:'+)-*.+/XO OOC(XO  -	XO
 OOC(XO t$XO XO C1Q,Q RSXO t$XO //&++c"23XO $XO //#&XO ??3'XO OOC(XO 
)XOz ,004+/VZ5O OOC(5O  -	5O
 OOC(5O 5O C1Q,Q RS5O 
5Ot ,004+/VZ/3'+)-*.+/NO OOC(NO  -	NO
 OOC(NO NO C1Q,Q RSNO t,NO $NO //#&NO ??3'NO OOC(NO 
$NOb CGpt%O%O+1??3+?%OY_YhYhilYm%O	%OV ,004.O.O OOC(	.O
  -.O kk#vzz/*.O 
.Ob CGpt%O%O+1??3+?%OY_YhYhilYm%O	S#X	%OT .22626&*'++/04DO ooc*DO //,/	DO
 /DO s#DO $DO OOC(DO  -DO 
DOR ,004:>-16:*.37EO OOC(EO  -	EO
 $*??3#7EO ooc*EO //&++c"23EO 3EO ??3'EO #OOC0EO 
EOV 37+/048O8O //,/	8O
 OOC(8O  -8O 
'8Ov BFos'O'O*0//#*>'OX^XgXghkXl'O	'OZ ,004'+37:O:O OOC(	:O
  -:O $:O #OOC0:O 
 :O@ 48&*'++/04AOAO 0	AO
 s#AO $AO OOC(AO  -AO 
AOL ,004%)/315*.+/;O OOC(;O  -	;O
 ooc";O ,;O  .;O ??3';O OOC(;O 
 ;O@ ,004/3,08O OOC(8O  -	8O
 ,8O __S)8O 8O 
8O| ,004)O)O OOC(	)O
  -)O 
)O^ ,004)O)O OOC(	)O
  -)O 
)O^ ,004,0%)5O5O OOC(	5O
  -5O __S)5O ooc"5O 
5Ov ,004-16:*.(,15*.+/LOLO OOC(	LO
  -LO ooc*LO  &s3LO ??3'LO %LO  .LO ??3'LO OOC(LO 
$LOd ,004-1*.>O>O OOC(	>O
  ->O ooc*>O >O ??3'>O 
>OH ,004-115*.5O5O OOC(	5O
  -5O ooc*5O !//#.5O ??3'5O YY5O 
5Ox ,0040O0O 0O
 OOC(0O  -0O 
0On ,0042O2O 2O
 OOC(2O  -2O 
2Or ,004-1*.>O>O >O
 OOC(>O  ->O ooc*>O ??3'>O 
>OF ,004	*O OOC(*O  -	*O
 *O 
"*OZ BFos'O'O*0//#*>'OX^XgXghkXl'O	!'OX ,004	5O OOC(5O  -	5O
 5O 
5Ot ,004	5O OOC(5O  -	5O
 5O 
5Ot ,004.2)-*.+/EO OOC(EO  -	EO
 
+EO //#&EO ??3'EO OOC(EO 
EOP CGpt-O-O+1??3+?-OY_YhYhilYm-O	-Od +/+/%)(,(,+/04JO ??3'JO OOC(	JO
 ooc"JO %JO %JO OOC(JO  -JO 
)JO^ ,004(, +/,0UO OOC(UO  -	UO
 %UO UO )UO ??3'UO __S)UO UO 
UOp EIrv0O0O-3__S-A0O[a[j[jkn[o0O	0Ol ,004<@GOGO OOC(	GO
  -GO OO$89GO 
GOT EIrv-O-O-3__S-A-O[a[j[jkn[o-O	-Od (,*.+/+/045O $5O ??3'	5O
 OOC(5O OOC(5O  -5O 
5Ot ,004/337MQ8<CG+/(,UYiO OOC(iO  -	iO
 ,iO OOBKK0iO $++,@AiO OO$IJiO "(!5iO KKS)iO -3OOC,@iO OOC(iO %iO !'<P0Q RiO 
iOX BFos%O%O*0//#*>%OX^XgXghkXl%O	%OP BFos*O*O*0//#*>*OX^XgXghkXl*O	/	0*Ob ,0043O3O 3O
 OOC(3O  -3O 
3Ot &**./O '..~>/O 	/O
 ooc"/O ??3'/O 
-/Oh 26+/04*.+/6O  .6O OOC(	6O
  -6O ??3'6O OOC(6O 
)6Ov ,004<@3O OOC(3O  -	3O
  893O 3O 
3Or 26+/045O5O  .	5O
 OOC(5O  -5O 
5Ov ,004,O,O OOC(	,O
  -,O 
,Oh 48+/04;O;O ;O +	;O #OOC0;O OOC(;O  -;O 
;O@ ,004*.+/2O OOC(2O  -	2O
 ??3'2O OOC(2O 
2On ,004 >B:O OOC(:O  -	:O
 KK.:O +:O #OOM::O 
:O@ ,004+O+O OOC(	+O
  -+O 
+O` +/+//3+/(,LPEI15047;6:SO ??3'SO OOC(	SO
 t,SO OOC(SO %SO __V\\#v{{37G2G%HISO oofll3C0@+@ABSO !//#.SO  -SO !' 4SO  &s3SO SO 
"SOj Oc  Ok  OrF   r  )zr  r  r   urllib.parserd   json.decoderr   r  core.api_errorr   core.client_wrapperr   r   core.jsonable_encoderr   core.remove_none_from_dictr	   !errors.unprocessable_entity_errorr
   types.agent_datar   types.batch_file_statusr   types.batch_item_list_responser   types.batch_job_cancel_responser   types.batch_job_query_responser   types.batch_job_responser   types.batch_job_statusr   types.batch_job_status_responser   types.batch_job_typer   types.delete_responser   #types.directory_file_query_responser   types.directory_file_responser   types.directory_query_responser   types.directory_responser   !types.directory_sync_job_responser   
types.filer   types.file_creater   types.file_filterr   types.file_query_responser   types.filter_operationr   types.http_validation_errorr   &types.item_processing_results_responser    types.llama_parse_parametersr!   #types.paginated_response_agent_datar"   (types.paginated_response_aggregate_groupr#   ,types.paginated_response_quota_configurationr$   (types.paginated_response_spreadsheet_jobr%   types.parse_configurationr&   (types.parse_configuration_query_responser'   types.parse_job_query_responser(   types.parse_job_responser)   types.parse_job_result_responser*   types.presigned_urlr+   types.split_categoryr,   types.split_document_inputr-   types.split_job_query_responser.   types.split_job_responser/   types.split_strategyr0   types.spreadsheet_jobr1    types.spreadsheet_parsing_configr2   types.spreadsheet_result_typer3   1types.src_parse_schemas_workflow_parse_job_configr4   types.usage_metricr5   !types.usage_metric_query_responser6   types.webhook_configurationr7   )types.batch_job_create_request_job_configr9   ri   __version__
startswithImportErrorpydantic.v1v1castrs  ra   r;   r  r  rF   rC   <module>rP     s       (  & H 5 ? I ) 6 C E C 8 4 E 0 3 M B D 9 I  + + : 5 > S @ M W _ W ; W C 8 E / 1 < C 8 1 3 H B f - I ? U&&t,"
 v{{6::s#y-O y-Ox[y-O y-OG\  s   'F% %	F10F1