
    9is                         S r SSKrSSKrSSKrSSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SSKJr  SSKJr  \R                  " \5      r " S	 S
\R"                  5      rS rS rg)z.
This module provides a client class for CDN.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_methods)requiredc                   h    \ rS rSrSrS
S jr\" \\4\\4\	S9SS j5       r
\S 5       r  SS jrS	rg)DumapClient   z
DumapClient
Nc                 B    [         R                  R                  X5        g N)r   BceBaseClient__init__)selfconfigs     d/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/dumap/dumap_client.pyr   DumapClient.__init__$   s    %%..t<    )app_iduriparamsc           	          U R                  UUUUSU0US9nUR                  (       a  UR                  R                  S5      $ U$ )a  
call open_api
:param app_id: app_id
:type app_id: string
:param uri: open api uri
:type uri: string
:param params: dict
:type params:request params
:param body: request body (default: None)
:type body: string
:param method: http method (default GET)
:type method: http_methods
:param config: None
:type config: baidubce.BceClientConfiguration

:return:
:rtype: baidubce.bce_response.BceResponse
           x-app-id)http_methodpathr   bodyheadersr   zutf-8)_send_requestr   decode)r   r   r   r   r   methodr   responses           r   call_open_apiDumapClient.call_open_api'   sS    ( %% &) & 
 ====''00Or   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DumapClient._merge_configI   s7    >;;4;;/J,,V4r   c           
          U R                  X5      n[        R                  " 5       US'   SUS'   [        R                  " U[        / SQ5      [        R                  [        /XX4U5      $ )N   x-bce-request-ids   application/json;charset=utf-8s   Content-Type)s   hosts
   x-bce-dater+   r   )	r(   uuiduuid4r   send_requestsign_wrapperr   parse_error
parse_none)r   r   r   r   r   r   r   s          r   r   DumapClient._send_requestR   sb     ##D1'+zz|#$#D ++L![\  *-tf6 	6r    r   )NNNNs   GETN)NNNN)__name__
__module____qualname____firstlineno____doc__r   r   bytesstrdictr"   staticmethodr(   r   __static_attributes__r3   r   r   r
   r
      sT    = eS\s|DA BB   -16r   r
   c                    ^  U 4S jnU$ )z!wrapper the bce_v1_signer.sign().c           	      2   > [         R                  " XX#UTS9$ )N)headers_to_sign)r   sign)credentialsr   r   r   r   r@   s        r   _wrappersign_wrapper.<locals>._wrapperc   s!    !!+D62AC 	Cr   r3   )r@   rC   s   ` r   r/   r/   `   s    C Or   c                 ^    U R                  5       nU(       a  X!l        U R                  5         g)a  If the body is not empty, convert it to a python object and set as the value of
response.body. http_response is always closed if no error occurs.

:param http_response: the http_response object returned by HTTPConnection.getresponse()
:type http_response: httplib.HTTPResponse

:param response: general response object which will be returned to the caller
:type response: baidubce.BceResponse

:return: always true
:rtype bool
T)readr   close)http_responser!   r   s      r   r1   r1   j   s)     Dr   )r8   r%   loggingr,   baidubcer   baidubce.authr   baidubce.httpr   r   r   baidubce.utilsr   	getLoggerr4   _loggerr   r
   r/   r1   r3   r   r   <module>rP      sT       $ ' ) ! & #


H
%>6/// >6Br   