o
    l>j	                     @  s   d Z ddlmZ ddlmZmZ ddlmZmZm	Z	m
Z
 ddlmZmZ d+ddZd,ddZd-ddZd.d/ddZddd0d!d"Zejd#d1d%d&Zd2d'd(Zd3d)d*ZdS )4zGQuery builders for Photos CloudKit indexes observed in the HAR capture.    )annotations)IterableOptional)	CKFVInt64
CKFVStringCKQueryFilterByCKQueryObject   )DirectionEnumListTypeEnum
field_namestrvaluereturnr   c                 C     t d| td|ddS )NEQUALSSTRINGtyper   
comparator	fieldName
fieldValue)r   r   r   r    r   ^/home/thesage/.local/lib/python3.10/site-packages/pyicloud/services/photos_cloudkit/queries.py_string_filter   
   
r   intc                 C  r   )Nr   INT64r   r   )r   r   r   r   r   r   _int_filter   r   r    r   c                   C  s
   t ddS )z'Return the Photos indexing-state query.CheckIndexingState)
recordType)r   r   r   r   r   check_indexing_state_query!      
r#   N	parent_id
str | Nonec                 C  s    d}| r
t d| g}td|dS )z&Return the album/folder listing query.NparentIdCPLAlbumByPositionLiver"   filterBy)r   r   )r%   	filter_byr   r   r   album_query'   s   r,   )extra_filters	list_typer   	directionr
   offsetr-   #Optional[Iterable[CKQueryFilterBy]]c                 C  s6   t d|jtd|g}|r|t| t| j|dS )zReturn an asset listing query.r/   	startRankr)   )r   r   r    extendlistr   )r.   r/   r0   r-   filtersr   r   r   
list_query0   s   

r6   )r/   photo_idc                 C  s   t | |dtd|gdS )z7Return a single-photo lookup query within a list index.r   
recordName)r.   r/   r0   r-   )r6   r   )r.   r7   r/   r   r   r   photo_lookup_queryB   s   
r9   c                 C  
   t d| S )z'Return the smart-album selector filter.
smartAlbumr   )r   r   r   r   smart_album_filterR   r$   r=   c                 C  r:   )z#Return a parent-id selector filter.r'   r<   )r%   r   r   r   parent_filterX   r$   r>   )r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   )N)r%   r&   r   r   )
r.   r   r/   r
   r0   r   r-   r1   r   r   )r.   r   r7   r   r/   r
   r   r   )r   r   r   r   )r%   r   r   r   )__doc__
__future__r   typingr   r   pyicloud.common.cloudkitr   r   r   r   	constantsr
   r   r   r    r#   r,   r6   	ASCENDINGr9   r=   r>   r   r   r   r   <module>   s    



