ó
    
û!iÿ  ã                  ón   • S r SSKJr  SSKrSSKJr  SS jr " S S5      r " S S	5      r " S
 S5      r	g)z<Module for classes related to identifying a Sheets document.é    )ÚannotationsN)Úsheets_sanitize_urlc                ór   • [         R                  " SU 5      (       d  [        SR                  U 5      5      eU $ )Nz[a-zA-Z0-9_-]+z"{}" is not a valid Sheets key)ÚreÚ	fullmatchÚ
ValueErrorÚformat)Úkeys    Ú`/home/james-whalen/.local/lib/python3.13/site-packages/google/generativeai/notebook/sheets_id.pyÚ_sanitize_keyr      s0   € Ü<Š<Ð(¨#×.Ñ.ÜÐ9×@Ñ@ÀÓEÓFÐFØ€Jó    c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	Ú	SheetsURLé   z?Class that enforces safety by ensuring that URLs are sanitized.c                ó:   • [         R                  " U5      U l        g ©N)r   Úsanitize_sheets_urlÚ_url)ÚselfÚurls     r   Ú__init__ÚSheetsURL.__init__   s   € Ü,×@Ò@ÀÓEˆ	r   c                ó   • U R                   $ r   ©r   ©r   s    r   Ú__str__ÚSheetsURL.__str__"   ó   € Øy‰yÐr   r   N)r   Ústr©Úreturnr   ©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__© r   r   r   r      s   † ÙIôF÷r   r   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	Ú	SheetsKeyé&   z?Class that enforces safety by ensuring that keys are sanitized.c                ó$   • [        U5      U l        g r   )r   Ú_key)r   r
   s     r   r   ÚSheetsKey.__init__)   s   € Ü& sÓ+ˆ	r   c                ó   • U R                   $ r   ©r.   r   s    r   r   ÚSheetsKey.__str__,   r   r   r1   N)r
   r   r    r"   r)   r   r   r+   r+   &   s   † ÙIô,÷r   r+   c                  óZ   • \ rS rSrSr   S
     SS jjrSS jrSS jrSS jrS r	S	r
g)ÚSheetsIdentifieré0   zØEncapsulates a means to identify a Sheets document.

The gspread library provides three ways to look up a Sheets document: by name,
by url and by key. An instance of this class represents exactly one of the
methods.
Nc                ó  • Xl         X l        X0l        [        [	        U R                   5      5      [        [	        U R                  5      5      -   [        [	        U R                  5      5      -   nUS:w  a  [        S5      eg)a”  Constructor.

Exactly one of the arguments should be provided.

Args:
  name: The name of the Sheets document. More-than-one Sheets documents can
    have the same name, so this is the least precise method of identifying
    the document.
  key: The key of the Sheets document
  url: The url to the Sheets document

Raises:
  ValueError: If the caller does not specify exactly one of name, url or
  key.
é   z(Must set exactly one of name, key or urlN)Ú_namer.   r   ÚintÚboolr   )r   Únamer
   r   Ú
num_inputss        r   r   ÚSheetsIdentifier.__init__8   sd   € ð* Œ
ØŒ	ØŒ	ô œ˜dŸj™jÓ)Ó*¬S´°d·i±i³Ó-AÑAÄCÌÈTÏYÉYËÓDXÑXˆ
Ø˜‹?ÜÐGÓHÐHð r   c                ó   • U R                   $ r   )r8   r   s    r   r;   ÚSheetsIdentifier.nameV   s   € Øz‰zÐr   c                ó   • U R                   $ r   r1   r   s    r   r
   ÚSheetsIdentifier.keyY   r   r   c                ó   • U R                   $ r   r   r   s    r   r   ÚSheetsIdentifier.url\   r   r   c                óè   • U R                   (       a  SR                  U R                   5      $ U R                  (       a  SR                  U R                  5      $ SR                  U R                  5      $ )Nzname={}zkey={}zurl={})r8   r	   r.   r   r   s    r   r   ÚSheetsIdentifier.__str___   sK   € Ø::Ø×#Ñ# D§J¡JÓ/Ð/ØYYØ—?‘? 4§9¡9Ó-Ð-à—?‘? 4§9¡9Ó-Ð-r   )r.   r8   r   )NNN)r;   ú
str | Noner
   úSheetsKey | Noner   úSheetsURL | None)r!   rF   )r!   rG   )r!   rH   )r#   r$   r%   r&   r'   r   r;   r
   r   r   r(   r)   r   r   r4   r4   0   sK   † ñð  Ø $Ø $ð	IàðIð ðIð õ	Iô<ôôõ.r   r4   )r
   r   r!   r   )
r'   Ú
__future__r   r   Úgoogle.generativeai.notebookr   r   r   r+   r4   r)   r   r   Ú<module>rK      s7   ðñ CÝ "ã 	Ý <ô÷ñ ÷ñ ÷5.ò 5.r   