
    9iJ                        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)z6
This module provides a client class for IPv6Gateway.
    N)bce_base_client)bce_v1_signer)bce_http_client)handler)http_methods)ipv6gateway_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\
\4S9  SS	 j5       r\	" \
\4S
9SS j5       r\	" \
\4S9S S j5       r\	" \
\4\
\4S9S S j5       r\	" \
\4\
\4S9 S S j5       r\	" \
\4S9SS j5       r\	" \
\4\
\4S9S S j5       r\	" \
\4\
\4\
\4\
\4S9 S S j5       r\	" \
\4S9SS j5       r\	" \
\4\
\4S9S S j5       r\	" \
\4\
\4\
\4\
\4S9 S S j5       rSrg)!IPv6GatewayClient-   z
IPv6Gateway sdk client
s   /v1Nc                 B    [         R                  R                  X5        g N)r   BceBaseClient__init__)selfconfigs     p/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/ipv6gateway/ipv6gateway_client.pyr   IPv6GatewayClient.__init__3   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IPv6GatewayClient._merge_config6   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IPv6GatewayClient._send_requestB   si     ##F+!,,K?"(13G++M&&)<)<k(Jtf6 	6r   )namevpc_idbandwidthInMbpsc                 z   [         R                  " U R                  S5      nUc
  [        5       nSU0nUc  [        n[
        R                  " U5      [
        R                  " U5      [
        R                  " U5      UR                  S.n	U R                  [        R                  U[        R                  " U	5      XS9$ )ao  
Create a ipv6-gateway with the specified options.

: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 ipv6-gateway that will be created.
:type name: string

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

:param bandwidthInMbps:
    The number of bandwidth.
:type bandwidthInMbps: int

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

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
IPv6Gateway   clientToken)r-   vpcIdr/   billing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.   r/   r4   client_tokenr   r&   r)   r'   s
             r   create_ipv6_gateway%IPv6GatewayClient.create_ipv6_gatewayO   s    F m<02L ,/?9G,,T2--f5%77H''	
 !!,"3"3"&TZZ-=)/ " @ 	@r   )r.   c                     [         R                  " U R                  S5      nSU0nU R                  [        R
                  UXBS9$ )a  
Return a list of ipv6-gateways, according to the VPC ID,
will return a full list of ipv6 gateways in VPC.

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

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r1   s   vpcIdr)   r   r	   r6   r7   r+   r   GET)r   r.   r   r&   r)   s        r   list_ipv6_gateways$IPv6GatewayClient.list_ipv6_gateways   sK      m<F#!!,"2"2D)/ " @ 	@r   )
gateway_idc                     [         R                  " U R                  SU5      nUc
  [        5       nSU0nU R	                  [
        R                  XEUS9$ )a  
delete a  specified ipv6-gateway.

:param gateway_id:
    The id of specified ipv6-gateway.
:type gateway_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
r1   r2   rC   r	   r6   r7   r8   r+   r   DELETE)r   rH   r?   r   r&   r)   s         r   delete_ipv6_gateway%IPv6GatewayClient.delete_ipv6_gateway   s_    , mZH02LL
 !!,"5"5"&f " F 	Fr   )rH   r/   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$ )aU  
resize a specified ipv6-gateway bandwidth.

:param gateway_id:
    The id of specified ipv6-gateway.
:type gateway_id: string

:param bandwidthInMbps:
    The number of bandwidth.
:type bandwidthInMbps: 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
r1   N)s   resizer2   r/   r5   r	   r6   r7   r8   r   r:   r+   r   PUTr=   r>   )r   rH   r/   r?   r   r&   r)   r'   s           r   resize_ipv6_gateway%IPv6GatewayClient.resize_ipv6_gateway   s    6 mZH02L(

 v77H
 !!,"2"2"&TZZ-=f " ] 	]r   )rH   cidrc                    [         R                  " U R                  SUS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$ )a  
Create a ipv6-gateway egress only rule with the specified options.

: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 gateway_id:
    The id of ipv6 gateway.
:type gateway_id: string

:param cidr:
    The cidr of egress only rule.
:type cidr: string

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r1   egressOnlyRuler2   rS   r5   r	   r6   r7   r8   r   r:   r+   r   r<   r=   r>   )r   rH   rS   r?   r   r&   r)   r'   s           r   $create_ipv6_gateway_egress_only_rule6IPv6GatewayClient.create_ipv6_gateway_egress_only_rule   s    4 mZIYZ02L ,/F,,T2
 !!,"3"3"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SUS5      n0 nUb  X&S'   Ub  X6S'   U R                  [        R
                  UXdS9$ )a?  
Return a list of ipv6-gateway egress only rules, according to the ipv6 gateway ID,
will return a full list of ipv6 gateway egress only rules in ipv6 gateway.

:param gateway_id:
    The id of ipv6 gateway.
:type gateway_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 config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r1   rU      marker   maxKeysrC   rD   r   rH   markermax_keysr   r&   r)   s          r   #list_ipv6_gateway_egress_only_rules5IPv6GatewayClient.list_ipv6_gateway_egress_only_rules  sg    < mZIYZ &9!):!!,"2"2D)/ " @ 	@r   )rH   egress_only_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$ )a  
delete a  specified ipv6-gateway egress only rule.

:param gateway_id:
    The id of specified ipv6-gateway.
:type gateway_id: string

:param egress_only_rule_id:
    The id of specified ipv6-gateway egress only rule.
:type egress_only_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
r1   rU   r2   rC   rJ   )r   rH   ra   r?   r   r&   r)   s          r   $delete_ipv6_gateway_egress_only_rule6IPv6GatewayClient.delete_ipv6_gateway_egress_only_rule,  se    6 mZIY[no02LL
 !!,"5"5"&f " F 	Fr   )rH   ipv6_addressingress_bandwidthInMbpsegress_bandwidthInMbpsc                 V   [         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      S.n	U R                  [        R                  U[        R                  " U	5      XS9$ )a  
Create a ipv6-gateway rate limit rule with the specified options.

: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 gateway_id:
    The id of ipv6 gateway.
:type gateway_id: string

:param ipv6_address:
    The ipv6 addrss of rate limit rule.
:type ipv6_address: string

:param ingress_bandwidthInMbps:
    The ingress bandwidth of rate limit rule.
:type ingress_bandwidthInMbps: int

:param egress_bandwidthInMbps:
    The egress bandwidth of rate limit rule.
:type egress_bandwidthInMbps: int

:param config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r1   rateLimitRuler2   )ipv6AddressingressBandwidthInMbpsegressBandwidthInMbpsr5   rV   )
r   rH   re   rf   rg   r?   r   r&   r)   r'   s
             r   #create_ipv6_gateway_rate_limit_rule5IPv6GatewayClient.create_ipv6_gateway_rate_limit_ruleQ  s    J mZY02L ,/!33LA&,&>&>?V&W%+%=%=>T%U

 !!,"3"3"&TZZ-=)/ " @ 	@r   c                     [         R                  " U R                  SUS5      n0 nUb  X&S'   Ub  X6S'   U R                  [        R
                  UXdS9$ )a=  
Return a list of ipv6-gateway rate limit rules, according to the ipv6 gateway ID,
will return a full list of ipv6 gateway rate limit rules in ipv6 gateway.

:param gateway_id:
    The id of ipv6 gateway.
:type gateway_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 config:
:type config: baidubce.BceClientConfiguration

:return:
:rtype baidubce.bce_response.BceResponse
r1   ri   rZ   r[   rC   rD   r\   s          r   "list_ipv6_gateway_rate_limit_rules4IPv6GatewayClient.list_ipv6_gateway_rate_limit_rules  sf    < mZY &9!):!!,"2"2D)/ " @ 	@r   )rH   rate_limit_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$ )a~  
delete a  specified ipv6-gateway rate limit rule.

:param gateway_id:
    The id of specified ipv6-gateway.
:type gateway_id: string

:param rate_limit_rule_id:
    The id of specified ipv6-gateway rate limit rule.
:type rate_limit_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
r1   ri   r2   rC   rJ   )r   rH   rr   r?   r   r&   r)   s          r   #delete_ipv6_gateway_rate_limit_rule5IPv6GatewayClient.delete_ipv6_gateway_rate_limit_rule  sd    6 mZZlm02LL
 !!,"5"5"&f " F 	Fr   )rH   rr   rf   rg   c                 .   [         R                  " U R                  SUSU5      nUc
  [        5       nSU0n[        R
                  " U5      [        R
                  " U5      S.n	U R                  [        R                  U[        R                  " U	5      XS9$ )a_  
update a  specified ipv6-gateway rate limit rule.

:param gateway_id:
    The id of specified ipv6-gateway.
:type gateway_id: string

:param rate_limit_rule_id:
    The id of specified ipv6-gateway rate limit rule.
:type rate_limit_rule_id: string

:param ingress_bandwidthInMbps:
    The ingress bandwidth of rate limit rule.
:type ingress_bandwidthInMbps: int

:param egress_bandwidthInMbps:
    The egress bandwidth of rate limit rule.
:type egress_bandwidthInMbps: 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
r1   ri   r2   )rk   rl   r5   rO   )
r   rH   rr   rf   rg   r?   r   r&   r)   r'   s
             r   #update_ipv6_gateway_rate_limit_rule5IPv6GatewayClient.update_ipv6_gateway_rate_limit_rule  s    N mZZlm02LL
 '-&>&>?V&W%+%=%=>T%U

 !!,"2"2"&TZZ-=)/ " @ 	@r    r   )NNNNN)NNN)NN)__name__
__module____qualname____firstlineno____doc__r7   r   r   r+   r
   bytesstrintr@   rF   rL   rQ   rW   r_   rc   rm   rp   rt   rw   __static_attributes__ry   r   r   r   r   -   s    G=
 7;/36 E3<S\$cl, JN6:.@,.@` eS\"@ #@( %&F 'F> %$cl,%],%]N %3<! HL!@!!@F %&$@ '$@L %#(#,0!F0!FF %!3<',cl&+S\3 GK,@	3,@\ %&$@ '$@L %"'/!F/!FF %"'',cl&+S\3 GK0@	30@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uuid4ry   r   r   generate_client_token_by_uuidr     s     tzz|r   )!r~   r   r=   loggingr   sysbaidubcer   baidubce.authr   baidubce.httpr   r   r   baidubce.services.ipv6gatewayr   r	   baidubce.utilsr
   r   r7   reloadsetdefaultencoding	getLoggerrz   _loggerBillingr9   $default_billing_to_purchase_reservedr   r   r   r8   ry   r   r   <module>r      s        
 $ ' ) ! & ;  # ;;
3K7#


H
%&7&?&?
&K #'8'@'@'B $V@55 V@r 6 r   