o
    eM                      @   s   d Z G dd deZdd ZG dd deZdd ZG d	d
 d
eZdd ZG dd deZG dd deZ	G dd deZ
G dd deZG dd deZdd ZG dd deZdd ZG dd deZdd  Zd!S )"z3
This module defines some Argument classes for BTS
c                   @   s   e Zd ZdZdddZdS )CreateInstanceArgsz
    Create Instance Args
    :param storage_type  instance's storage type. eg.CommonPerformance
    :type storage_type string
    Nc                 C   
   || _ d S Nstorage_type)selfr    r   KD:\Projects\ConvertPro\env\Lib\site-packages\baidubce/services/bts/model.py__init__      
zCreateInstanceArgs.__init__r   __name__
__module____qualname____doc__r	   r   r   r   r   r          r   c                 C   s
   d| j iS )z
    change create_instance_args to dict

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

    :return:
    :rtype dict
    storageTyper   argsr   r   r   create_instance_args_2_dict   s   r   c                   @   s   e Zd ZdZdddZdS )CreateTableArgsa  
    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
        N   c                 C   s"   || _ || _|| _|| _|| _d S r   table_versioncompress_typettlr   max_versions)r   r   r   r   r   r   r   r   r   r	   8   s
   
zCreateTableArgs.__init__)r   Nr   Nr   r   r   r   r   r   r   *   s    r   c                 C   s   | j | j| j| j| jdS )z
    change create_table_args to dict

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

    :return:
    :rtype dict
    )tableVersioncompressTyper   r   maxVersionsr   r   r   r   r   create_table_args_2_dict@   s   r    c                   @   s   e Zd ZdZdddZdS )UpdateTableArgsa>  
    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
    r   Nc                 C   s   || _ || _|| _|| _d S r   r   r   r   r   )r   r   r   r   r   r   r   r   r	   `   s   
zUpdateTableArgs.__init__)r   NNNr   r   r   r   r   r!   S   s    r!   c                 C   s   | j | j| j| jdS )z
    change update_table_args to dict

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

    :return:
    :rtype dict
    )r   r   r   r   r"   r   r   r   r   update_table_args_2_dictg   s
   r#   c                   @      e Zd ZdZdddZdS )Cellz`
    Cell
    :param column
    :type column string
    :param value
    :type value string
     c                 C   s   || _ || _d S r   )columnvalue)r   r'   r(   r   r   r   r	         
zCell.__init__N)r&   r&   r   r   r   r   r   r%   y   s    r%   c                   @   *   e Zd ZdZd
ddZdd Zdd Zd	S )Rowz[
    Row
    :param rowkey
    :type rowkey string
    :param cells
    :type cells []
    r&   c                 C   s   || _ g | _d S r   )rowkeycells)r   r,   r   r   r   r	      r)   zRow.__init__c                 C      | j | dS z|
        append cell

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

        :return:
        :rtype
        Nr-   appendr   cellr   r   r   append_cell      
zRow.append_cellc                 C      | j S zH
        get cell

        :return cells:
        :rtype Cell[]
        r-   r   r   r   r   get_cell      zRow.get_cellNr&   r   r   r   r   r	   r4   r:   r   r   r   r   r+      
    
r+   c                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	BatchPutRowArgsz>
    Batch Put Row Args
    :param rows
    :type rows []
    c                 C   s
   g | _ d S r   rowsr9   r   r   r   r	      r
   zBatchPutRowArgs.__init__c                 C   r.   zi
        append row

        :param row:
        :type row: Row

        :return:
        :rtype
        NrA   r1   r   rowr   r   r   
append_row   r5   zBatchPutRowArgs.append_rowc                 C   r6   zE
        get row

        :return rows:
        :rtype Row[]
        r@   r9   r   r   r   get_row   r;   zBatchPutRowArgs.get_rowN)r   r   r   r   r	   rF   rH   r   r   r   r   r?      s
    r?   c                   @   r$   )	QueryCellz>
    Query Cell
    :param column
    :type column string
    r&   c                 C   r   r   )r'   )r   r'   r   r   r   r	      r
   zQueryCell.__init__Nr<   r   r   r   r   r   rI      r   rI   c                   @   s*   e Zd ZdZdddZdd Zdd	 Zd
S )QueryRowArgsz
    Query Row Arg
    :param rowkey
    :type rowkey string
    :param max_versions
    :type max_versions int
    :param cells
    :type cells []
    r&   r   c                 C   s   || _ || _g | _d S r   r,   r   r-   )r   r,   r   r   r   r   r	      s   
zQueryRowArgs.__init__c                 C   r.   r/   r0   r2   r   r   r   r4      r5   zQueryRowArgs.append_cellc                 C   r6   r7   r8   r9   r   r   r   r:      r;   zQueryRowArgs.get_cellN)r&   r   r=   r   r   r   r   rJ      s
    
	rJ   c                 C   s   | j | j| jdS )z
    change query_row_args to dict

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

    :return:
    :rtype dict
    )r,   r   r-   rK   r   r   r   r   query_row_args_2_dict   s   rL   c                   @   r*   )BatchQueryRowArgszs
    Batch Query Row Args
    :param rows
    :type rows []
    :param max_versions
    :type max_versions int
    r   c                 C   s   g | _ || _d S r   )rA   r   )r   r   r   r   r   r	     r)   zBatchQueryRowArgs.__init__c                 C   r.   rB   rC   rD   r   r   r   rF     r5   zBatchQueryRowArgs.append_rowc                 C   r6   rG   r@   r9   r   r   r   get_rows  r;   zBatchQueryRowArgs.get_rowsN)r   )r   r   r   r   r	   rF   rN   r   r   r   r   rM     r>   rM   c                 C   s   | j | jdS )z
    change batch_query_row_args to dict

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

    :return:
    :rtype dict
    )r   rA   )r   rA   r   r   r   r   batch_query_row_args_2_dict)  s   rO   c                   @   s.   e Zd ZdZ		dddZdd	 Zd
d ZdS )ScanArgsai  
    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 []
    r&   TFr   c                 C   s.   || _ || _|| _|| _|| _|| _g | _d S r   )start_rowkeyinclude_startstop_rowkeyinclude_stoplimitr   selector)r   rQ   rR   rS   rT   rU   r   r   r   r   r	   K  s   
zScanArgs.__init__c                 C   r.   )z
        append selector

        :param query_cell:
        :type query_cell: QueryCell

        :return:
        :rtype
        N)rV   r1   )r   Z
query_cellr   r   r   append_selectorU  r5   zScanArgs.append_selectorc                 C   r6   )zU
        get selector

        :return selector:
        :rtype query_cell[]
        )rV   r9   r   r   r   get_selectora  r;   zScanArgs.get_selectorN)r&   Tr&   Fr   r   )r   r   r   r   r	   rW   rX   r   r   r   r   rP   9  s    

rP   c                 C   s"   | j | j| j| j| j| j| jdS )zy
    change scan_args to dict

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

    :return:
    :rtype dict
    )ZstartRowkeyZincludeStartZ
stopRowkeyZincludeStoprV   rU   r   )rQ   rR   rS   rT   rV   rU   r   r   r   r   r   scan_args_2_dictk  s   rY   N)r   objectr   r   r   r    r!   r#   r%   r+   r?   rI   rJ   rL   rM   rO   rP   rY   r   r   r   r   <module>   s"   
"
%"2