
    9i                         S r SSKJr  SSKJr   " S S\5      r " S S\5      r " S S	\5      r " S
 S\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S  S!\5      r " S" S#\5      r " S$ S%\5      r " S& S'\5      r " S( S)\5      rg*)+z3
This module defines some Response classes for BTS
    )BceResponse)JSONEncoderc                   (    \ rS rSrSrSS jrS rSrg)Billing   a  
This class define billing.
param: paymentTiming:
        The pay time of the payment,
param: reservationLength:
        The duration to buy in specified time unit,
param: reservationTimeUnit:
        The time unit to specify the duration ,only "Month" can be used now.
c                 $    Xl         UUS.U l        g )N)reservationLengthreservationTimeUnitpaymentTimingreservation)self
pay_methodr	   r
   s       [/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/scs/model.py__init__Billing.__init__"   s    '!2#6
    c                     U R                   $ )z2
get instance current pay_method:Prepaid/Postpaid
)r   r   s    r   get_pay_methodBilling.get_pay_method)   s     !!!r   r   N)Prepaid   Month)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r   r      s    
"r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )	SubnetMap0   z*
SubnetMap:contains zoneName and subnetId
c                 j   > [         [        U ]  5         [        U5      U l        [        U5      U l        g N)superr#   r   str	zone_name	subnet_id)r   r)   r*   	__class__s      r   r   SubnetMap.__init__5   s&    i')YYr   )r*   r)   r   r   r   r   r   r   r    __classcell__r+   s   @r   r#   r#   0   s    ( (r   r#   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )CreateInstanceResponse;   z
Create Instance Response
c                 n   > [         [        U ]  5         UR                  U l        UR                  U l        g r&   )r'   r1   r   instance_idsorder_idr   bce_responser+   s     r   r   CreateInstanceResponse.__init__@   s,    $d46(55$--r   )r4   r5   r-   r/   s   @r   r1   r1   ;   s    . .r   r1   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListInstanceResponseF   z
List Instance Response
c                    > [         [        U ]  5         UR                  U l        [	        UR
                  5      U l        [	        UR                  5      U l        UR                  U l        UR                  U l        g r&   )	r'   r:   r   max_keysr(   markernext_markeris_truncated	instancesr6   s     r   r   ListInstanceResponse.__init__K   s^    "D24$--,--.|778(55%//r   )rA   r@   r>   r=   r?   r-   r/   s   @r   r:   r:   F   s    0 0r   r:   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )GetInstanceResponseT   z
Get Instance Response
c                 d  > [         [        U ]  5         [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l	        [        UR                  5      U l
        [        UR                  5      U l        UR                  U l        UR                  U l        UR                  U l        UR                  U l        [        UR                   5      U l        UR"                  U l        [        UR$                  5      U l        UR&                  U l        UR(                  U l        UR*                  U l        UR,                  U l        g r&   )r'   rD   r   r(   instance_idinstance_nameinstance_statuscluster_typeengineengine_versionvnet_ipportinstance_create_timeinstance_expire_timecapacityused_capacitypayment_timing
zone_namesvpc_idsubnets
auto_renew	shard_num
store_typer6   s     r   r   GetInstanceResponse.__init__Y   sC   !413|778 !;!;<"<#?#?@ 9 9:,--.!,"="=><//0))*	$0$E$E!$0$E$E!$--)77!,"="=>&11,--.#++&11%//&11r   )rW   rQ   rJ   rK   rL   rO   rP   rG   rH   rI   rS   rN   rX   rY   rV   rR   rM   rU   rT   r-   r/   s   @r   rD   rD   T   s    2 2r   rD   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListAvailableZoneResponsep   
List available zone.
c                 L   > [         [        U ]  5         UR                  U l        g r&   )r'   r\   r   zonesr6   s     r   r   "ListAvailableZoneResponse.__init__u   s    '79!''
r   )r`   r-   r/   s   @r   r\   r\   p   s    ( (r   r\   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListSubnetResponsez   r^   c                 v   > [         [        U ]  5         UR                  U l        U R                  c  / U l        g g r&   )r'   rc   r   rV   r6   s     r   r   ListSubnetResponse.__init__   s4     $02#++<<DL  r   )rV   r-   r/   s   @r   rc   rc   z   s     r   rc   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListNodeTypeResponse   z
List nodetypes for scs.
c                    > [         [        U ]  5         UR                  U l        UR                  U l        UR
                  U l        g r&   )r'   rh   r   default_node_type_listcluster_node_type_listhsdb_node_type_listr6   s     r   r   ListNodeTypeResponse.__init__   s;    "D24&2&I&I#&2&I&I##/#C#C r   )rl   rk   rm   r-   r/   s   @r   rh   rh      s    D Dr   rh   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )NodeType   z
NodeType model
c                   > [         [        U ]  5         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l	        [        UR                  5      U l
        [        UR                  5      U l        UR                  U l        UR                  U l        g r&   )r'   rp   r   r(   	node_typeintcpu_numinstance_flavorfloatnetwork_throughput_in_gbpspeak_qpsmax_connectionsallowed_node_num_listallowed_replication_num_listr   objr+   s     r   r   NodeType.__init__   s    h&(S]]+3;;'"3#6#67*/0N0N*O'CLL)"3#6#67%(%>%>",/,L,L)r   )r{   r|   ru   rv   rz   rx   rs   ry   r-   r/   s   @r   rp   rp      s    	M 	Mr   rp   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )Tag   z
Tag model
c                 j   > [         [        U ]  5         [        U5      U l        [        U5      U l        g r&   )r'   r   r   r(   tag_key	tag_value)r   keyvaluer+   s      r   r   Tag.__init__   s&    c4!#3xUr   c                 D    [        U R                  U R                  45      $ r&   )reprr   r   r   s    r   __repr__Tag.__repr__   s    T\\4>>233r   )r   r   )	r   r   r   r   r   r   r   r    r.   r/   s   @r   r   r      s    $
4 4r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListSecurityIpResponse   z6
List IP whitelist of instances which allow access to
c                 L   > [         [        U ]  5         UR                  U l        g r&   )r'   r   r   security_ipsr6   s     r   r   ListSecurityIpResponse.__init__   s    $d46(55r   )r   r-   r/   s   @r   r   r      s    6 6r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListParameterResponse   zF
List configuration parameters and runtime parameters of scs instance
c                 L   > [         [        U ]  5         UR                  U l        g r&   )r'   r   r   
parametersr6   s     r   r   ListParameterResponse.__init__   s    #T35&11r   )r   r-   r/   s   @r   r   r      s    2 2r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )	Parameter   zA
Configuration parameters and runtime parameters of scs instance
c                    > [         [        U ]  5         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r&   )	r'   r   r   r(   defaultrt   force_restartnamer   r}   s     r   r   Parameter.__init__   sQ    i')3;;' !2!23M	^
r   )r   r   r   r   r-   r/   s   @r   r   r      s    $ $r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ModifyParameterRequest   z.
A request model to modify instance parameter
c                    > [         [        U ]  5         [        UR                  5      U l        [        UR
                  5      U l        g r&   )r'   r   r   r(   r   r   r}   s     r   r   ModifyParameterRequest.__init__   s/    $d46M	^
r   )r   r   r-   r/   s   @r   r   r      s    $ $r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ListBackupResponse   z
List backups of instance.
c                 n   > [         [        U ]  5         UR                  U l        UR                  U l        g r&   )r'   r   r   total_countbackupsr6   s     r   r   ListBackupResponse.__init__   s,     $02'33#++r   )r   r   r-   r/   s   @r   r   r      s    , ,r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )Backup   z
Backup model
c                    > [         [        U ]  5         [        UR                  5      U l        [        UR
                  5      U l        UR                  U l        [        UR                  5      U l        g r&   )r'   r   r   r(   backup_typecommentrecords
start_timer}   s     r   r   Backup.__init__   sL    fd$&s/3;;'{{cnn-r   )r   r   r   r   r-   r/   s   @r   r   r      s    . .r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )BackupRecord   z
Backup record model
c                 b  > [         [        U ]  5         [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l	        [        UR                  5      U l
        g r&   )r'   r   r   r(   backup_record_idbackup_statusrt   durationobject_size
shard_namer   r}   s     r   r   BackupRecord.__init__   sw    lD*, #C$8$8 9 !2!23CLL)s/cnn-cnn-r   )r   r   r   r   r   r   r-   r/   s   @r   r   r      s    . .r   r   c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )GetBackupResponsei  z"
Get backup detail response model
c                    > [         [        U ]  5         [        UR                  5      U l        [        UR
                  5      U l        g r&   )r'   r   r   r(   urlurl_expirationr6   s     r   r   GetBackupResponse.__init__	  s6    /1|''(!,"="=>r   )r   r   r-   r/   s   @r   r   r     s    ? ?r   r   c                       \ rS rSrSrS rSrg)JsonWrapperi  z
custom json encoder for class
c                 $   [        U[        5      (       a
  [        USS9$ [        U[        5      (       a  UR                  UR
                  S.$ [        U[        5      (       a  UR                  UR                  S.$ [        R                  " X5      $ )Nzutf-8)encoding)zoneNamesubnetId)tagKeytagValue)
isinstancebytesr(   r#   r)   r*   r   r   r   r   r   )r   r~   s     r   r   JsonWrapper.default  s{    c5!!sW--c9%%MMMM  c3++MM  ""4--r   r!   N)r   r   r   r   r   r   r    r!   r   r   r   r     s    .r   r   N)r   baidubce.bce_responser   jsonr   objectr   r#   r1   r:   rD   r\   rc   rh   rp   r   r   r   r   r   r   r   r   r   r   r!   r   r   <module>r      s     . "f "2( (.[ .0; 02+ 28( (	 		D; 	DMv M"4& 46[ 62K 2
$ 
$$V $, ,
.V 
..6 .? ?.+ .r   