
    9iV                        S r SSKrSSK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  SS	KJr  SS
KJr  SSKJr  \R(                  S:  a  \" \5        \R,                  " S5        \R.                  " \5      r\R4                  " S5      r\R4                  " 5       r " S S\R:                  5      rS r\r g)z.
This module provides a client class for NAT.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_methods)	nat_model)utils)required)compat3zutf-8Postpaidc                      \ rS rSrSrSrS.S jrS.S jr  S/S jr\	" \
\4\
\4S9  S0S	 j5       r\	" \
\4S
9  S1S j5       r\	" \
\4S9S.S j5       r\	" \
\4\
\4S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4S9S2S j5       r\	" \
\4S9  S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\S9S2S j5       r\	" \
\4\
\4\
\4\S9S2S j5       r\	" \
\4\S9S2S  j5       r\	" \
\4\
\4S!9S2S" j5       r\	" \
\4\
\4S!9  S/S# j5       r \	" \
\4S9S3S$ j5       r!\	" \
\4\
\4\
\4\
\4S%9  S/S& j5       r"\	" \
\4\S'9S2S( j5       r#\	" \
\4\
\4S!9S2S) j5       r$\	" \
\4\
\4S*9   S4S+ j5       r%\	" \
\4S9S3S, j5       r&S-r'g)5	NatClient1   z
NAT sdk client
s   /v1Nc                 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/vpc/nat_client.pyr   NatClient.__init__7   s    %%..t<    c                     Uc  U R                   $ [        R                  " U R                   5      nUR                  U5        U$ )z>
:param config:
:type config: baidubce.BceClientConfiguration
)r   copymerge_non_none_values)r   r   
new_configs      r   _merge_configNatClient._merge_config:   s9    
 >;;4;;/J,,V4r   c           
          U R                  U5      nUc  [        R                  nUc  SSS.n[        R                  " U[
        R                  [        R                  U/XX4U5      $ )Ns   */*s   application/json;charset=utf-8)s   Accepts   Content-Type)r   r   
parse_jsonr   send_requestr   signparse_error)r   http_methodpathbodyheadersparamsr   body_parsers           r   _send_requestNatClient._send_requestF   si     ##F+!,,K?"(13G++M&&)<)<k(Jtf6 	6r   )namevpc_idc                 T   [         R                  " U R                  S5      nUc
  [        5       nSU0nUc  [        n[
        R                  " U5      [
        R                  " U5      UR                  US.nUb  UUS'   Ub  UUS'   Ub  UUS'   U
b  [
        R                  " U
5      US'   Ub  [
        R                  " U5      US'   Ub!  U Vs/ s H  nUR                  PM     nnUUS	'   Ub  UUS
'   U R                  [        R                  U[        R                  " U5      XS9$ s  snf )a  
Create a nat-gateway with the specified options.
A nat gateway can bind only one public EIP,
but can bind one or more EIPs in shared-bandwidth group

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if client token is provided.
:type client_token: string

:param name:
    The name of nat-gateway that will be created.
:type name: string

:param vpc_id:
    The id of VPC.
:type vpc_id: string

:param spec:
    The size of nat-gateway that needs to be created.
    It includes the following three types:
        small: support 5 public-IP-bindings at most,
        medium: support 10 public-IP-bindings at most,
        large: support 15 public-IP-bindings at most.
:type spec: string

:param cu_num:  The number of CU.
:type cu_num: int

:param billing:
    Billing information.
:type billing: nat_model.Billing

:param eips:
    A public EIP or one/more EIPs in shared-bandwidth group,
    which will be bound with nat-gateway.
:type eips: list<String>

:param dnat_eips:
:type dnat_eips: list<String>

:param bind_eips:
    A public EIP or one/more EIPs in shared-bandwidth group,
    which will be bound with nat-gateway, only for enhance nat.
:type bind_eips: list<String>

:param tags:
    The tags of nat-gateway that will be created.
:type tags: list<String>

:param resource_group_id:
    The resource group id of nat-gateway that will be created.
:type resource_group_id: string

:param delete_protect:
    The delete protect switch of nat-gateway that will be created.
:type delete_protect: bool

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
nat   clientToken)r-   vpcIdbillingdeleteProtecteipsdnatEipsbindEipscuNumspectagsresourceGroupIdr'   r)   r   )r	   
append_uriversiongenerate_client_token#default_billing_to_purchase_createdr   convert_to_string__dict__r+   r   POSTjsondumps)r   r-   r.   r9   r3   r5   	dnat_eips	bind_eipsclient_tokenr   cu_numr:   resource_group_iddelete_protectr&   r)   r'   tagtag_lists                      r   
create_natNatClient.create_natS   sA   H e402L ,/?9G,,T2--f5''+	
 DL (D (D"44V<DM!33D9DL045H5#DL(&7D"#!!,"3"3"&TZZ-=)/ " @ 	@	 6s   D%)r.   c                     [         R                  " U R                  S5      n0 n	Ub  XS'   Ub  X)S'   Ub  X9S'   Ub  XIS'   Ub  XYS'   Ub  XiS'   U R                  [        R
                  UXS9$ )	a  
Return a list of nat-gateways, according to the ID,
name or bound EIP of nat-gateways. If not specified,
will return a full list of nat gateways in VPC.

:param vpc_id:
    The id of VPC.
:type vpc_id: string

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param name:
    The name of specified nat-gateway.
:type name: string

:param ip:
    The EIP associated with nat-gateway.
:type ip: string

:param marker:
    The optional parameter marker specified in the original
    request to specify where in the results to begin listing.
    Together with the marker, specifies the list result which
    listing should begin. If the marker is not specified,
    the list result will listing from the first one.
:type marker: string

:param max_keys:
    The optional parameter to specifies the max number of list
    result to return.
    The default value is 1000.
:type max_keys: int

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   s   vpcIds   natIds   names   ip   marker   maxKeysr)   r   r	   r=   r>   r+   r   GET)
r   r.   nat_idr-   ipmarkermax_keysr   r&   r)   s
             r   	list_natsNatClient.list_nats   s    X e4%8%8"7O>5M &9!):!!,"2"2D)/ " @ 	@r   )rV   c                     [         R                  " U R                  SU5      nU R                  [        R
                  X2S9$ )z
Get the detail information of a specified nat-gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   )r   rT   )r   rV   r   r&   s       r   get_natNatClient.get_nat   s8     eV<!!,"2"2D!HHr   )rV   r-   c                     [         R                  " U R                  SU5      nUc
  [        5       nSU0nS[        R
                  " U5      0nU R                  [        R                  U[        R                  " U5      XdS9$ )aA  
Update the name of a specified nat-gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param name:
    The new name of the nat-gateway
:type name: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r1   r-   r<   r	   r=   r>   r?   r   rA   r+   r   PUTrD   rE   )r   rV   r-   rH   r   r&   r)   r'   s           r   
update_natNatClient.update_nat  s    4 eV<02LL
 F,,T2
 !!,"2"2"&TZZ-=)/ " @ 	@r   )rV   r5   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )a'  
Bind EIPs to a specified nat gateway.
If a EIP is already bound to the nat gateway, unbind it first.
If a shared_bandwidth EIP is bound to the nat gateway,
one can bind more shared_bandwidth EIPs.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param eips:
    A public EIP or one/more EIPs in shared-bandwidth group,
    which will be bound with the nat-gateway.
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Ns   bindr1   r5   r<   	r	   r=   r>   r?   r+   r   ra   rD   rE   r   rV   r5   rH   r   r&   r)   r'   s           r   bind_eipNatClient.bind_eip-  sz    < eV<02L(

 D
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )aB  
Unbind EIPs of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param eips:
    EIP address list to be unbound
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Ns   unbindr1   r5   r<   rf   rg   s           r   
unbind_eipNatClient.unbind_eipY  sz    4 eV<02L(

 D
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSU0nU R	                  [
        R                  XEUS9$ )a+  
Delete specified nat-gateway.
If prepaid nat-gateway is not expired, it cannot be deleted.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r1   rS   r	   r=   r>   r?   r+   r   DELETE)r   rV   rH   r   r&   r)   s         r   
delete_natNatClient.delete_nat  s_    . eV<02LL
 !!,"5"5"&f " F 	Fr   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nUc  [        nSUR
                  0nU R                  [        R                  U[        R                  " U5      XdS9$ )aW  
Renew specified nat-gateway. Postpaid NAT cannot be renewed

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param billing:
    Billing information.
:type billing: nat_model.Billing

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   N)s   purchaseReservedr1   r3   r<   )r	   r=   r>   r?   $default_billing_to_purchase_reservedrB   r+   r   ra   rD   rE   )r   rV   r3   rH   r   r&   r)   r'   s           r   purchase_reserved_natNatClient.purchase_reserved_nat  s    6 eV<02L!%(
 ?:Gw''
 !!,"2"2"&TZZ-=)/ " @ 	@r   )rV   rI   c                    [         R                  " U R                  SU5      nUc
  [        5       nSUS.nS[        R
                  " U5      0nU R                  [        R                  U[        R                  " U5      XdS9$ )a8  
Resize a specified enhance nat-gateway.

:param nat_id:
    The id of specified enhance nat-gateway.
:type nat_id: string

:param cu_num:
    The number of CU.
:type cu_num: int

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   N)s   resizer1   r8   r<   r`   )r   rV   rI   rH   r   r&   r)   r'   s           r   
resize_natNatClient.resize_nat  s    4 eV<02L(

 V--f5
 !!,"2"2"&TZZ-=)/ " @ 	@r   )rV   rK   c                     [         R                  " U R                  SUS5      n0 nUc  [        5       US'   OX6S'   SU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )z
:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param delete_protect:
    Whether to enable deletion protection on the nat.
:type delete_protect: bool

:return:
:rtype baidubce.bce_response.BceResponse
r0   r4   r1   r<   rf   )r   rV   rK   rH   r   r&   r)   r'   s           r   update_delete_protectNatClient.update_delete_protect  s     eV_M%:%<F>"%1>"^
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )a,  
Bind Dnat EIPs to a specified nat gateway.
If a EIP is already bound to nat gateway, need unbind it first.
If a shared_bandwidth EIP is bound to the nat gateway,
one can bind more shared_bandwidth EIPs.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param eips:
    Public EIPs or one/more EIPs in shared-bandwidth group,
    which will be bound with the nat-gateway.
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Nre   r6   r<   rf   rg   s           r   bind_dnat_eipNatClient.bind_dnat_eip  sz    < eV<02L(

 
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )aG  
Unbind Dnat EIPs of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param eips:
    EIP address list to be unbound
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Nrk   r6   r<   rf   rg   s           r   unbind_dnat_eipNatClient.unbind_dnat_eip=  sz    4 eV<02L(

 
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )a  
Bind EIPs to a specified enhance nat gateway.

:param nat_id:
    The id of specified enhance nat-gateway.
:type nat_id: string

:param bind_eips:
    Public EIPs or one/more EIPs in shared-bandwidth group,
    which will be bound with the nat-gateway.
:type bind_eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Nre   r7   r<   rf   r   rV   rG   rH   r   r&   r)   r'   s           r   enhance_nat_bind_eipNatClient.enhance_nat_bind_eipe  sz    6 eV<02L(

 	
 !!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SU5      nUc
  [        5       nSUS.nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )aT  
Unbind EIPs of a specified enhance nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param bind_eips:
    EIP address list to be unbound
:type bind_eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   Nrk   r7   r<   rf   r   s           r   enhance_nat_unbind_eip NatClient.enhance_nat_unbind_eip  sz    4 eV<02L(

 	
 !!,"2"2"&TZZ-=)/ " @ 	@r   )rV   	rule_namesource_cidrpublic_ip_addressc                 .   [         R                  " U R                  SUS5      nUc
  [        5       nSU0n[        R
                  " U5      U[        R
                  " U5      S.n	U R                  [        R                  U[        R                  " U	5      XS9$ )a  
create snat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param rule_name:
    The name of snat rule.
:type rule_name: string

:param source_cidr:
    The source cidr of this snat rule.
:type source_cidr: string

:param public_ip_address:
    EIP address list to be bound
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   snatRuler1   )ruleNamepublicIpsAddress
sourceCIDRr<   r	   r=   r>   r?   r   rA   r+   r   rC   rD   rE   )
r   rV   r   r   r   rH   r   r&   r)   r'   s
             r   create_snat_ruleNatClient.create_snat_rule  s    J eVZH02LL
 00; 1 22;?

 !!,"3"3"&TZZ-=)/ " @ 	@r   )rV   
snat_rulesc                    [         R                  " U R                  SSS5      nUc
  [        5       nSU0n[        R
                  " U5      US.nU R                  [        R                  U[        R                  " U5      XdS9$ )a  
batch create snat rules of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param snat_rules:
    Snat rules, every rule contains ruleName, sourceCIDR and publicIpsAddress.
:type snat_rules: list<dict>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   batchCreater1   )natId	snatRulesr<   r   )r   rV   r   rH   r   r&   r)   r'   s           r   batch_create_snat_rule NatClient.batch_create_snat_rule  s    4 eZO02LL
 --f5#
 !!,"3"3"&TZZ-=)/ " @ 	@r   )rV   snat_rule_idc                     [         R                  " U R                  SUSU5      nUc
  [        5       nSU0nU R	                  [
        R                  XVUS9$ )aQ  
delete snat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param snat_rule_id:
    The id of specified snat rule.
:type snat_rule_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   rS   ro   )r   rV   r   rH   r   r&   r)   s          r   delete_snat_ruleNatClient.delete_snat_rule  c    4 eVZV02LL
 !!,"5"5"&f " F 	Fr   c                 V   [         R                  " U R                  SUSU5      nUc
  [        5       nSU0n	0 n
Ub  [        R
                  " U5      U
S'   Ub  XZS'   Ub  [        R
                  " U5      U
S'   U R                  [        R                  U[        R                  " U
5      XS9$ )aD  
update snat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param snat_rule_id:
    The id of specified snat rule.
:type snat_rule_id: string

:param rule_name:
    The name of snat rule.
:type rule_name: string

:param source_cidr:
    The source cidr of this snat rule.
:type source_cidr: string

:param public_ip_address:
    EIP address list to be update.
:type eips: list<String>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   r   r   r   r<   r`   )r   rV   r   r   r   r   rH   r   r&   r)   r'   s              r   update_snat_ruleNatClient.update_snat_rule6  s    N eVZV02LL
  %77	BD('8#$"!'!9!9+!FD!!,"2"2"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SUS5      nUc
  [        5       nSU0nUb  X'S'   Ub  X7S'   U R	                  [
        R                  XgUS9$ )a  
list snat rules of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param marker:
    The optional parameter marker specified in the original
    request to specify where in the results to begin listing.
    Together with the marker, specifies the list result which
    listing should begin. If the marker is not specified,
    the list result will listing from the first one.
:type marker: string

:param max_keys:
    The optional parameter to specifies the max number of list
    result to return.
    The default value is 1000.
:type max_keys: int

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   rQ   rR   rS   r	   r=   r>   r?   r+   r   rU   r   rV   rX   maxKeysrH   r   r&   r)   s           r   list_snat_ruleNatClient.list_snat_ruleo  ~    H eVZH02LL
  &9!(:!!,"2"2"&f " F 	Fr   )rV   r   private_ip_addressprotocolc
                    [         R                  " U R                  SUS5      n
Uc
  [        5       nSU0n[        R
                  " U5      [        R
                  " U5      [        R
                  " U5      [        R
                  " U5      S.nUb  [        R
                  " U5      US'   Ub  [        R
                  " U5      US'   U R                  [        R                  U
[        R                  " U5      XS9$ )u  
create dnat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param rule_name:
    The name of this dnat rule.
:type rule_name: string

:param public_ip_address:
    The public ip address of this dnat rule.
:type public_ip_address: string

:param private_ip_address:
    The private ip address of this dnat rule.
:type private_ip_address: string

:param protocol:
    protocol, support TCP、UDP、all
:type protocol: string

:param public_port:
    public port
:type public_port: string

:param private_port:
    private port
:type private_port: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   dnatRuler1   )r   publicIpAddressprivateIpAddressr   
publicPortprivatePortr<   r   )r   rV   r   r   r   r   public_portprivate_portrH   r   r&   r)   r'   s                r   create_dnat_ruleNatClient.create_dnat_rule  s    d eVZH02LL
 00;%778IJ & 8 89K L00:	
 "!'!9!9+!FD#"(":":<"HD!!,"3"3"&TZZ-=)/ " @ 	@r   )rV   
dnat_rulesc                     [         R                  " U R                  SUSS5      nUc
  [        5       nSU0nSU0nU R	                  [
        R                  U[        R                  " U5      XdS9$ )a  
batch create dnat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param dnat_rules:
    Dnat rules, every rule contains ruleName, publicIpAddress, privateIpAddress, protocol, privatePort, publicPort.
:type snat_rules: list<dict>

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r   r1   rulesr<   )	r	   r=   r>   r?   r+   r   rC   rD   rE   )r   rV   r   rH   r   r&   r)   r'   s           r   batch_create_dnat_rule NatClient.batch_create_dnat_rule  s}    4 eVZW02LL
 Z
 !!,"3"3"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SUSU5      nUc
  [        5       nSU0nU R	                  [
        R                  XVUS9$ )aQ  
delete dnat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param dnat_rule_id:
    The id of specified snat rule.
:type snat_rule_id: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   rS   ro   )r   rV   dnat_rule_idrH   r   r&   r)   s          r   delete_dnat_ruleNatClient.delete_dnat_rule  r   r   )rV   rule_idc                 (   [         R                  " U R                  SUSU5      nU	c
  [        5       n	SU	0n0 nUb  [        R
                  " U5      US'   Ub  [        R
                  " U5      US'   Ub  [        R
                  " U5      US'   Ub  [        R
                  " U5      US'   Ub  [        R
                  " U5      US'   Ub  [        R
                  " U5      US	'   U R                  [        R                  U[        R                  " U5      XS
9$ )a  
update dnat rule of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param rule_id:
    The id of specified dnat rule.
:type rule_id: string

:param rule_name:
    The name of dnat rule.
:type rule_name: string

:param public_ip_address:
    The public ip address of this dnat rule.
:type public_ip_address: string

:param private_ip_address:
    The private ip address of this dnat rule.
:type private_ip_address: string

:param protocol:
    protocol
:type protocol: string

:param public_port:
    public port
:type public_port: string

:param private_port:
    private port
:type private_port: string

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   s   ruleNames   protocols   publicIpAddresss   privateIpAddresss
   publicPorts   privatePortr<   r   )r   rV   r   r   r   r   r   r   r   rH   r   r&   r)   r'   s                 r   update_dnat_ruleNatClient.update_dnat_rule2  s   j eVZV02LL
   & 8 8 CD & 8 8 BD('-'?'?@Q'RD#$)(.(@(@AS(TD$%""(":":;"GD##)#;#;L#ID !!,"3"3"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SUS5      nUc
  [        5       nSU0nUb  X'S'   Ub  X7S'   U R	                  [
        R                  XgUS9$ )a  
list dnat rules of a specified nat gateway.

:param nat_id:
    The id of specified nat-gateway.
:type nat_id: string

:param marker:
    The optional parameter marker specified in the original
    request to specify where in the results to begin listing.
    Together with the marker, specifies the list result which
    listing should begin. If the marker is not specified,
    the list result will listing from the first one.
:type marker: string

:param max_keys:
    The optional parameter to specifies the max number of list
    result to return.
    The default value is 1000.
:type max_keys: int

:param client_token:
    An ASCII string whose length is less than 64.
    The request will be idempotent if clientToken is provided.
    If the clientToken is not specified by user,
    a random String generated by default algorithm will be used.
:type client_token: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r0   r   r1   rQ   rR   rS   r   r   s           r   list_dnat_ruleNatClient.list_dnat_rule  r   r    r   )NNNNN)NNNNNNNNNNN)NNNNNNN)NN)NNNN)NNNNNNNN)(__name__
__module____qualname____firstlineno____doc__r>   r   r   r+   r
   bytesstrrN   rZ   r]   rb   listrh   rl   rq   ru   intrx   boolr{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__r   r   r   r   r   1   s    G=
 7;/36 E3<S\#eirv_@#_@B eS\"7;>B:@ #:@x eS\"I #I" eS\5%@ 6%@N eS\-)@ .)@V eS\-%@ .%@N eS\"F #F> eS\"BF%)(@ #(@T eS\#.&@ /&@P eS\$7@ 8@6 eS\-)@ .)@V eS\-%@ .%@N eS\-&@ .&@P eS\-%@ .%@N eS\ #, $&.@	&.@` eS\d3%@ 4%@N eS\=!F >!FF eS\=QUKO6@ >6@p eS\"/F #/Fb eS\!&"'s|% cgX\@@	%@@D eS\d3$@ 4$@L eS\=!F >!FF eS\E3<8DHDHFJK@ 9K@Z eS\"/F #/Fr   r   c                  >    [        [        R                  " 5       5      $ )z
The default method to generate the random string for client_token
if the optional parameter client_token is not specified by the user.

:return:
:rtype string
)r   uuiduuid4r   r   r   generate_client_token_by_uuidr     s     tzz|r   )!r   r   rD   loggingr   sysbaidubcer   baidubce.authr   baidubce.httpr   r   r   baidubce.services.vpcr   r	   baidubce.utilsr
   r   r>   reloadsetdefaultencoding	getLoggerr   _loggerBillingr@   rt   r   r   r   r?   r   r   r   <module>r      s   $     
 $ ' ) ! & +  # ;;
3K7#


H
% '0&7&7
&C #'0'8'8': $F-- F@$ 6 r   