
    9i'                     v    S r SSKrSSKrSSKrSSKJr  SSKJrJrJ	r	  SSK
Jr   " S S\R                  5      rg)z.
This module provides a client class for OOS.
    N)bce_v1_signer)handlerbce_http_clienthttp_methods)bce_base_clientc                       \ rS rSrSrSr\R                  " 5       SS.rSS jr	SS jr
  SS	 jrSS jrSS jrSS jrSS jrSS jrSS jrSS jr0 S
/ S4S jrSS jrSrg)	OosClient   z
OOS base sdk client
s   /api/logic/ooss   application/json;charset=utf-8)s   x-bce-request-ids   content-typeNc                 B    [         R                  R                  X5        g N)r   BceBaseClient__init__)selfconfigs     `/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/oos/oos_client.pyr   OosClient.__init__&   s    %%..t<    c                     Uc  U R                   $ [        R                  " U R                   5      nUR                  U5        U$ r   )r   copymerge_non_none_values)r   r   
new_configs      r   _merge_configOosClient._merge_config)   s7    >;;4;;/J,,V4r   c           
          U R                  U5      nUc  [        R                  n[        R                  " U[
        R                  [        R                  U/U[        R                  U-   X4U5      $ r   )
r   r   
parse_jsonr   send_requestr   signparse_errorr	   prefix)r   http_methodpathbodyheadersparamsr   body_parsers           r   _send_requestOosClient._send_request1   sf     ##F+!,,K++M&&)<)<k(J))D0$I 	Ir    c                     SnUUUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a  
Create oos template.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param name:
    Template name.
:type name: string

:param operators:
    Include template operators to execute.
:type operators: OperatorModel array

:param description:
    Template description.
:type description: string

:param linear:
    Operator execute linearly.
:type linear: bool

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
   /v2/templatedescriptionname	operatorslinearr"   r#   r   r&   r   POSTjsondumpsr	   r#   r   r-   r.   r,   r/   r   r!   r"   s           r   create_templateOosClient.create_template<   sX    8 &"	
 !!,"3"3T

4@P*3*;*;F " L 	Lr   c                     SnUUUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a  
Check oos template.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param name:
    Template name.
:type name: string

:param operators:
    Include template operators to execute.
:type operators: OperatorModel array

:param description:
    Template description.
:type description: string

:param linear:
    Operator execute linearly.
:type linear: bool

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
s   /v2/template/checkr+   r0   r1   r5   s           r   check_templateOosClient.check_templateb   sX    8 %&"	
 !!,"3"3T

4@P*3*;*;F " L 	Lr   c                     SnUUUUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a.  
Update oos template.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param template_id:
    Template id.
:type template_id: string

:param name:
    Template name.
:type name: string

:param operators:
    Include template operators to execute.
:type operators: OperatorModel array

:param description:
    Template description.
:type description: string

:param linear:
    Operator execute linearly.
:type linear: bool

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r*   )idr,   r-   r.   r/   r0   )r&   r   PUTr3   r4   r	   r#   )	r   template_idr-   r.   r,   r/   r   r!   r"   s	            r   update_templateOosClient.update_template   s\    @ &"
 !!,"2"2Dtzz$?O*3*;*;F " L 	Lr   c                 j    SnSU0nU R                  [        R                  X4[        R                  US9$ )a  
Delete oos template by template id.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param template_id:
    Template id.
:type template_id: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r*   r<   r$   r#   r   )r&   r   DELETEr	   r#   )r   r>   r   r!   r$   s        r   delete_templateOosClient.delete_template   s?      +
 !!,"5"5tT]TeTent!uur   c                 j    SnSU0nU R                  [        R                  X4[        R                  US9$ )a  
Get template detail by template name.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param name:
    Template name.
:type name: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r*   r-   rB   r&   r   GETr	   r#   )r   r-   r   r!   r$   s        r   get_template_detailOosClient.get_template_detail   s?      D
 !!,"2"2DQZQbQbkq!rrr   c                     SnUUUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a  
Get template list.

This site may help you: https://cloud.baidu.com/doc/OOS/s/lli1cjcjh

:param page_no:
    Page number.
:type page_no: int

:param page_size:
    Page size.
:type page_size: int

:param sort:
    Template list sort by.
:type sort: string

:param ascending:
    ascend or not.
:type ascending: bool

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
s   /v2/template/list)sort	ascendingpageNopageSizer0   r1   )r   page_no	page_sizerL   rM   r   r!   r"   s           r   get_template_listOosClient.get_template_list   sX    8 $"!	
 !!,"3"3T

4@P*3*;*;F " L 	Lr   c                     SnUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a6  
Get operator list.

This site may help you: https://cloud.baidu.com/doc/OOS/s/Oli1pd1bq

:param page_no:
    Page number.
:type page_no: int

:param page_size:
    Page size.
:type page_size: int

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
s   /v1/operator/list)rN   rO   r0   r1   )r   rP   rQ   r   r!   r"   s         r   get_operator_listOosClient.get_operator_list  sR    ( $!
 !!,"3"3T

4@P*3*;*;F " L 	Lr   c                     SnUUUUS.nU R                  [        R                  U[        R                  " U5      [
        R                  US9$ )a  
Create oos execution by template.

This site may help you: https://cloud.baidu.com/doc/OOS/s/fli1q43ih

:param template:
    Template to execute.
:type template: TemplateModel

:param properties:
    Template execute global parameters.
:type properties: dict

:param description:
    Template description.
:type description: string

:param tags:
    Execution binding tags.
:type tags: TagModel array

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
   /v2/execution)template
propertiesr,   tagsr0   r1   )r   rY   rZ   r,   r[   r   r!   r"   s           r   create_executionOosClient.create_execution!  sX    8   $&	
 !!,"3"3T

4@P*3*;*;F " L 	Lr   c                 j    SnSU0nU R                  [        R                  X4[        R                  US9$ )a   
Get execution detail by execution id.

This site may help you: https://cloud.baidu.com/doc/OOS/s/fli1q43ih

:param execution_id:
    Execution id.
:type execution_id: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
rX   r<   rB   rG   )r   execution_idr   r!   r$   s        r   get_execution_detailOosClient.get_execution_detailG  s?       ,
 !!,"2"2DQZQbQbkq!rrr    r   )NNNNN)r(   TN)
createTimeFN)__name__
__module____qualname____firstlineno____doc__r   uuiduuid4r#   r   r   r&   r6   r9   r?   rD   rI   rR   rU   r\   r`   __static_attributes__rb   r   r   r	   r	      s     F "ZZ\:G
= 7;/3	I$LL$LL)LVv,s,$LLL8 57BRX\ $LLsr   r	   )rh   r   r3   ri   baidubce.authr   baidubce.httpr   r   r   baidubcer   r   r	   rb   r   r   <module>ro      s7       ' @ @ $@s-- @sr   