
    9i -                        S r  " S S\5      rS r " S S\5      rS r " S S\5      rS	 r " S
 S\5      r " S S\5      r	 " S S\5      r
 " S S\5      r " S S\5      rS r " S S\5      rS r " S S\5      rS rg)z3
This module defines some Argument classes for BTS
c                   "    \ rS rSrSrSS jrSrg)CreateInstanceArgs   zs
Create Instance Args
:param storage_type  instance's storage type. eg.CommonPerformance
:type storage_type string
Nc                     Xl         g Nstorage_type)selfr   s     [/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/baidubce/services/bts/model.py__init__CreateInstanceArgs.__init__   s    (    r   r   __name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r   r
   r   r      s    
)r   r   c                     SU R                   0$ )z}
change create_instance_args to dict

:param args: create instance args
:type args: CreateInstanceArgs

:return:
:rtype dict
storageTyper   argss    r
   create_instance_args_2_dictr      s     	t(( r   c                   "    \ rS rSrSrSS jrSrg)CreateTableArgs*   at  
Create Table Args
:param table_version  table's version
:type table_version int64
:param compress_type  table's compress type. eg.SNAPPY_ALL
:type compress_type string
:param ttl  time to live
:type ttl int
:param storage_type  instance's storage type. eg.CommonPerformance
:type storage_type string
:param max_versions  table's max data versions.
:type max_versions int
Nc                 @    Xl         X l        X0l        X@l        XPl        g r   table_versioncompress_typettlr   max_versions)r	   r    r!   r"   r   r#   s         r
   r   CreateTableArgs.__init__8   s    **((r   )r!   r#   r   r    r"   )    Nr%   N   r   r   r   r
   r   r   *   s    )r   r   c                 v    U R                   U R                  U R                  U R                  U R                  S.$ )zt
change create_table_args to dict

:param args: create table args
:type args: CreateTableArgs

:return:
:rtype dict
)tableVersioncompressTyper"   r   maxVersionsr   r   s    r
   create_table_args_2_dictr+   @   s9     ****xx(((( r   c                   "    \ rS rSrSrSS jrSrg)UpdateTableArgsS   a  
Update Table Args
:param table_version  table's version
:type table_version int64
:param compress_type  table's compress type. eg.SNAPPY_ALL
:type compress_type string
:param ttl time to live
:type ttl int
:param max_versions  table's max data versions.
:type max_versions int
Nc                 4    Xl         X l        X0l        X@l        g r   r    r!   r"   r#   )r	   r    r!   r"   r#   s        r
   r   UpdateTableArgs.__init__`   s    **(r   )r!   r#   r    r"   )r&   NNNr   r   r   r
   r-   r-   S   s    
)r   r-   c                 `    U R                   U R                  U R                  U R                  S.$ )zt
change update_table_args to dict

:param args: update table args
:type args: UpdateTableArgs

:return:
:rtype dict
)r(   r)   r"   r*   r0   r   s    r
   update_table_args_2_dictr3   g   s0     ****xx((	 r   c                   (    \ rS rSrSrSS jrS rSrg)Celly   zH
Cell
:param column
:type column string
:param value
:type value string
c                     Xl         X l        g r   columnvalue)r	   r9   r:   s      r
   r   Cell.__init__   s    
r   c                 4    U R                   U R                  S.$ )z
Convert the Cell instance into a dictionary with keys for column and value.

:return: A dictionary with 'column' and 'value' as keys, representing
         the cell's data.
:rtype: dict
r8   r8   r	   s    r
   to_dictCell.to_dict   s     kkZZ
 	
r   r8   N) r@   r   r   r   r   r   r   r>   r   r   r   r
   r5   r5   y   s    
r   r5   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
Row   zC
Row
:param rowkey
:type rowkey string
:param cells
:type cells []
c                     Xl         / U l        g r   rowkeycells)r	   rG   s     r
   r   Row.__init__   s    
r   c                 :    U R                   R                  U5        gzL
append cell

:param cell: column & value
:type cell: Cell

:return:
:rtype
NrH   appendr	   cells     r
   append_cellRow.append_cell        	

$r   c                     U R                   $ z(
get cell

:return cells:
:rtype Cell[]
rH   r=   s    r
   get_cellRow.get_cell        zzr   c                    / nU R                    Ha  n[        U[        5      (       a!  UR                  UR	                  5       5        M9  [        U[
        5      (       d  MP  UR                  U5        Mc     U R                  US.$ )z
Convert the Row instance into a dictionary suitable for serialization.

:return: A dictionary with 'rowkey' as the unique identifier and 'cells'
         containing a list of cell data in dictionary form.
:rtype: dict
rF   )rH   
isinstancer5   rM   r>   dictrG   )r	   rH   rO   s      r
   r>   Row.to_dict   se     JJD$%%T\\^,D$''T"	  kk
 	
r   )rH   rG   Nr@   
r   r   r   r   r   r   rP   rV   r>   r   r   r   r
   rC   rC      s    
 
r   rC   c                   *    \ rS rSrSrS rS rS rSrg)BatchPutRowArgs   z.
Batch Put Row Args
:param rows
:type rows []
c                     / U l         g r   rowsr=   s    r
   r   BatchPutRowArgs.__init__   s	    	r   c                 :    U R                   R                  U5        gz9
append row

:param row:
:type row: Row

:return:
:rtype
Nrd   rM   r	   rows     r
   
append_rowBatchPutRowArgs.append_row        			r   c                     U R                   $ z%
get row

:return rows:
:rtype Row[]
rc   r=   s    r
   get_rowBatchPutRowArgs.get_row        yyr   rc   N)	r   r   r   r   r   r   rk   rp   r   r   r   r
   r`   r`      s    

r   r`   c                   (    \ rS rSrSrSS jrS rSrg)	QueryCell   z.
Query Cell
:param column
:type column string
c                     Xl         g r   r9   )r	   r9   s     r
   r   QueryCell.__init__   s    r   c                     SU R                   0$ )z
Convert the QueryCell instance into a dictionary

:return: A dictionary representation of the QueryCell, with 'column' as the key.
:rtype: dict
r9   rw   r=   s    r
   r>   QueryCell.to_dict   s     dkk
 	
r   rw   Nr]   rA   r   r   r
   rt   rt      s    
	
r   rt   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
QueryRowArgs   zx
Query Row Arg
:param rowkey
:type rowkey string
:param max_versions
:type max_versions int
:param cells
:type cells []
c                 *    Xl         X l        / U l        g r   rG   r#   rH   )r	   rG   r#   s      r
   r   QueryRowArgs.__init__  s    (
r   c                 :    U R                   R                  U5        grK   rL   rN   s     r
   rP   QueryRowArgs.append_cell
  rR   r   c                     U R                   $ rT   rU   r=   s    r
   rV   QueryRowArgs.get_cell  rX   r   c                     U R                    Vs/ s H&  n[        US5      (       a  UR                  5       OUPM(     nnU R                  US.$ s  snf )z
Convert the QueryRowArgs instance into a dictionary suitable for serialization.

:return: A dictionary representation of the QueryRowArgs, including the rowkey and cells.
:rtype: dict
r>   rF   )rH   hasattrr>   rG   )r	   rO   
cells_dicts      r
   r>   QueryRowArgs.to_dict  sS     X\WaWabWati(@(@dllndJWa
bkk
 	
 cs   -A)rH   r#   rG   N)r@   r%   r^   r   r   r
   r|   r|      s    

 
r   r|   c                 J    U R                   U R                  U R                  S.$ )zk
change query_row_args to dict

:param args: query row args
:type args: QueryRowArgs

:return:
:rtype dict
)rG   r*   rH   r   r   s    r
   query_row_args_2_dictr   -  s%     ++(( r   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)
BatchQueryRowArgsi>  z[
Batch Query Row Args
:param rows
:type rows []
:param max_versions
:type max_versions int
c                     / U l         Xl        g r   rd   r#   )r	   r#   s     r
   r   BatchQueryRowArgs.__init__F  s    	(r   c                 :    U R                   R                  U5        grg   rh   ri   s     r
   rk   BatchQueryRowArgs.append_rowJ  rm   r   c                     U R                   $ ro   rc   r=   s    r
   get_rowsBatchQueryRowArgs.get_rowsV  rr   r   c                     / nU R                    HQ  n[        U[        5      (       a  UR                  5       nO[        U[        5      (       a  UnUR                  W5        MS     UU R                  S.$ )a!  
Convert the BatchQueryRowArgs instance to a dictionary for JSON serialization.

:return: A dictionary representation of the BatchQueryRowArgs instance with
        'rows' key containing a list of rows and 'max_versions' key
        containing the maximum number of versions.
:rtype: dict
r   )rd   rZ   r|   r>   r[   rM   r#   )r	   	rows_datarow_argrow_datas       r
   r>   BatchQueryRowArgs.to_dict_  sh     	yyG'<00"??,GT**"X& !  --
 	
r   r#   rd   N)r%   )
r   r   r   r   r   r   rk   r   r>   r   r   r   r
   r   r   >  s    )

r   r   c                 4    U R                   U R                  S.$ )z|
change batch_query_row_args to dict

:param args: batch query row args
:type args: BatchQueryRowArgs

:return:
:rtype dict
)r*   rd   r   r   s    r
   batch_query_row_args_2_dictr   v  s     ((		 r   c                   8    \ rS rSrSr  S	S jrS rS rS rSr	g)
ScanArgsi  a)  
Scan Args
:param start_rowkey
:type start_rowkey string
:param include_start
:type include_start bool
:param stop_rowkey
:type stop_rowkey string
:param include_stop
:type include_stop bool
:param limit
:type limit int
:param max_versions
:type max_versions int
:param selector
:type selector []
c                 Z    Xl         X l        X0l        X@l        XPl        X`l        / U l        g r   )start_rowkeyinclude_startstop_rowkeyinclude_stoplimitr#   selector)r	   r   r   r   r   r   r#   s          r
   r   ScanArgs.__init__  s,    (*&(
(r   c                 :    U R                   R                  U5        g)zR
append selector

:param query_cell:
:type query_cell: QueryCell

:return:
:rtype
N)r   rM   )r	   
query_cells     r
   append_selectorScanArgs.append_selector  s     	Z(r   c                     U R                   $ )z5
get selector

:return selector:
:rtype query_cell[]
)r   r=   s    r
   get_selectorScanArgs.get_selector  s     }}r   c                 p   / nU R                    H_  n[        U[        5      (       a  UR                  SUR                  05        M7  [        U[
        5      (       d  MN  UR                  U5        Ma     U R                  U R                  U R                  U R                  UU R                  U R                  S.$ )z{
Convert the ScanArgs instance into a dictionary

:return: A dictionary representation of the scan arguments.
:rtype: dict
r9   )startRowkeyincludeStart
stopRowkeyincludeStopr   r*   r   )r   rZ   rt   rM   r9   r[   r   r   r   r   r#   r   )r	   r   items      r
   r>   ScanArgs.to_dict  s     MMD$	**4;; 78D$''%	 "  ,, ..**,, ,,ZZ
 	
r   )r   r   r   r#   r   r   r   N)r@   Tr@   Fr%   r%   )
r   r   r   r   r   r   r   r   r>   r   r   r   r
   r   r     s%    " IK;<
)
r   r   c                     U R                   U R                  U R                  U R                  U R                  U R
                  U R                  S.$ )za
change scan_args to dict

:param args: scan row args
:type args: ScanArgs

:return:
:rtype dict
)r   r   r   r   r   r   r*   )r   r   r   r   r   r   r#   r   s    r
   scan_args_2_dictr     sI     ((**&&((MM(( r   N)r   objectr   r   r   r+   r-   r3   r5   rC   r`   rt   r|   r   r   r   r   r   r   r   r
   <module>r      s   
) ))f ),&)f )($
6 
42
& 2
jf >
 
(/
6 /
d"5
 5
p G
v G
Tr   