
    Li              	       V   d dl mZ d dlZd dlZd dlZd dlZd dlmZmZm	Z	 d dl
mZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZmZ ddlmZmZ  ej:                  d      Z	 d&de	ee ef   e!f   deee ef      dee ef   fdZ"	 d&de	ee ef   e!f   deee ef      dee ef   fdZ#	 d&de	ee ef   e!f   deee ef      dee ef   fdZ$	 d&de	ee ef   e!f   deee ef      dee ef   fdZ%	 d&de	ee ef   e!f   deee ef      dee ef   fdZ&	 d&de	ee ef   e!f   deee ef      dee ef   fdZ'	 d&de	ee ef   e!f   deee ef      dee ef   fdZ(	 d&de	ee ef   e!f   deee ef      dee ef   fdZ)	 d&de	ee ef   e!f   deee ef      dee ef   fdZ*	 d&de	ee ef   e!f   deee ef      dee ef   fdZ+	 d&de	ee ef   e!f   deee ef      dee ef   fdZ,	 d&de	ee ef   e!f   deee ef      dee ef   fdZ-	 d&de	ee ef   e!f   deee ef      dee ef   fdZ.	 d&de	ee ef   e!f   deee ef      dee ef   fd Z/	 d&de	ee ef   e!f   deee ef      dee ef   fd!Z0 G d" d#ejb                        Z2 G d$ d%ejb                        Z3y)'    )cached_propertyN)AnyOptionalUnion)	urlencode   )_api_module)_common)_extra_utils)types)get_value_by_path)set_value_by_path),_UploadToFileSearchStoreOperation_from_mldev)AsyncDocuments	Documents)
AsyncPagerPagerzgoogle_genai.filesearchstoresfrom_objectparent_objectreturnc                 V    i }t        | dg      t        |dgt        | dg             |S )Ndisplay_namedisplayNamegetvsetvr   r   	to_objects      ]/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/google/genai/file_search_stores.py%_CreateFileSearchStoreConfig_to_mldevr    (   s7     !)	+'(4kN;K)LM	    c                 R    i }t        | dg      t        t        | dg      |       |S Nconfig)r   r    r   s      r   )_CreateFileSearchStoreParameters_to_mldevr%   4   s6     !)	+z".)[8*%y 
r!   c                 X    i }t        | dg      t        |ddgt        | dg             |S )Nforce_queryr   r   s      r   %_DeleteFileSearchStoreConfig_to_mldevr)   A   s8     !)	+y!-7+T+y-IJ	r!   c                     i }t        | dg      t        |ddgt        | dg             t        | dg      t        t        | dg      |       |S )Nname_urlr$   )r   r   r)   r   s      r   )_DeleteFileSearchStoreParameters_to_mldevr-   M   s_     !)	+x ,VV$d;&AB	+z".)[8*%y 
r!   c                 X    i }t        | dg      t        |ddgt        | dg             |S )Nr+   r,   r   r   s      r   &_GetFileSearchStoreParameters_to_mldevr/   ]   s8     !)	+x ,VV$d;&AB	r!   c                     i }t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             |S c c}w )Ncustom_metadatacustomMetadatachunking_configchunkingConfigr   r   r   r   items       r   _ImportFileConfig_to_mldevr7   h   s     !)	+)*+7	{->,?@A$A 
+)*+7	[,-. 
 	Bs   	Ac           
         i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      #t        |dgt        t        | dg      |             |S )Nr+   metadatadoneerrorresponse)r   r   _ImportFileResponse_from_mldevr   s      r   _ImportFileOperation_from_mldevr>      s     !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+x ,VHd;9:	+y!-WItK';<	+
|$0	&zl+Y	
 
r!   c                     i }t        | dg      t        |ddgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        t        | dg      |       |S )Nfile_search_store_namer,   	file_namefileNamer$   )r   r   r7   r   s      r   _ImportFileParameters_to_mldevrC      s     !)	+012>	)*[345 
+}%1ZL${[M"BC	+z".tK(<iH	r!   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )NsdkHttpResponsesdk_http_responseparentdocumentNamedocument_namer   r   s      r   r=   r=      s     !)	+)*+7'(${=N<O*P 
+z".XJ[8* =>	+'(4_%tK.9I'JK	r!   c                     i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             |S )N	page_sizer(   pageSize
page_token	pageTokenr   r   s      r   $_ListFileSearchStoresConfig_to_mldevrO      sm     !)	+}%1*-tK+/O 
+~&2	;[<.) 
r!   c                 R    i }t        | dg      t        t        | dg      |       |S r#   )r   rO   r   s      r   (_ListFileSearchStoresParameters_to_mldevrQ      s6     !)	+z".([8*%y 
r!   c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w )NrE   rF   nextPageTokennext_page_tokenfileSearchStoresfile_search_storesr   r5   s       r   (_ListFileSearchStoresResponse_from_mldevrW      s     !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+*+,8	{-?,@AB$B 
 	Cs   3	Bc                 `   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             |S c c}w )	N	mime_typemimeTyper   r   r1   r2   r3   r4   r   r5   s       r   '_UploadToFileSearchStoreConfig_to_mldevr[      s     !)	+}%1d;&FG	+'(4kN;K)LM	+)*+7	{->,?@A$A 
+)*+7	[,-. 
 	Bs   3	B+c                     i }t        | dg      t        |ddgt        | dg             t        | dg      t        t        | dg      |       |S )Nr@   r,   r$   )r   r   r[   r   s      r   +_UploadToFileSearchStoreParameters_to_mldevr]     sk     !)	+012>	)*[345 
+z".+[8*%y 
r!   c                 V    i }t        | dg      t        |dgt        | dg             |S )NrE   rF   r   r   s      r   4_UploadToFileSearchStoreResumableResponse_from_mldevr_   .  s@     !)	+)*+7'(${=N<O*P 
r!   c            	          e Zd Zedefd       Zdddeej                     dej                  fdZ
dddedeej                     dej                  fdZdddedeej                     ddfd	Zdddeej                      dej"                  fd
Zdddedeej&                     dej(                  fdZdddededeej,                     dej.                  fdZdddedeeej6                  e   ej:                  f   deej&                     dej<                  fdZdddeej                      de ej                     fdZ!y)FileSearchStoresr   c                 ,    t        | j                        S N)r   _api_clientselfs    r   	documentszFileSearchStores.documents=  s    T%%&&r!   Nr$   r$   c                4   t        j                  |      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||      }|j                   si nt#        j$                  |j                         }	t         j&                  j)                  |	|j+                         
      }
| j                  j-                  |
       |
S zCreates a File Search Store.

    Args:
      config (CreateFileSearchStoreConfig | None): Optional parameters for the
        request.

    Returns:
      FileSearchStore
    rh   =This method is only supported in the Gemini Developer client.r,   rU   r(   ?r$   Npostr<   kwargs)r    _CreateFileSearchStoreParametersrd   vertexai
ValueErrorr%   get
format_mapr   popr$   http_optionsr
   convert_to_dictencode_unserializable_typesrequestbodyjsonloadsFileSearchStore_from_response
model_dump_verify_responserf   r$   parameter_modelrequest_dictrequest_url_dictpathquery_paramsrv   r<   response_dictreturn_values              r   createzFileSearchStores.createA  s{    <<O
   
I  ?Ol%))&1	!,,-=>!##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM((77'A'A'C 8 L 	%%l3r!   r+   c                6   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||      }	|	j                   si nt#        j$                  |	j                         }
t         j&                  j)                  |
|j+                         
      }| j                  j-                  |       |S aR  Gets metadata about a FileSearchStore.

    Args:
      name (str): The resource name of the FileSearchStore. Example:
        `FileSearchStores/my-file-search-store-123`
      config (GetFileSearchStoreConfig | None): Optional parameters for the
        request.

    Returns:
      A FileSearchStore object containing the metadata.
    r+   r$   rk   r,   {name}r(   rl   r$   Nrs   rn   )r   _GetFileSearchStoreParametersrd   rq   rr   r/   rs   rt   r   ru   r$   rv   r
   rw   rx   ry   rz   r{   r|   r}   r~   r   r   rf   r+   r$   r   r   r   r   r   rv   r<   r   r   s               r   rs   zFileSearchStores.get|  sy   $ 99O   
I  <OLl%))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''t\<PH&mmBHMM1JM((77'A'A'C 8 L 	%%l3r!   c                F   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||      }	y
a  Deletes a FileSearchStore.

    Args:
      name (str): The resource name of the FileSearchStore. Example:
        `FileSearchStores/my-file-search-store-123`
      config (DeleteFileSearchStoreConfig | None): Optional parameters for the
        request.

    Returns:
      None
    r   rk   r,   r   r(   rl   r$   Ndelete)r    _DeleteFileSearchStoreParametersrd   rq   rr   r-   rs   rt   r   ru   r$   rv   r
   rw   rx   ry   
rf   r+   r$   r   r   r   r   r   rv   r<   s
             r   r   zFileSearchStores.delete  s   $ <<O   
I  ?Ol%))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''$lHr!   c                v   t        j                  |      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||      }|j                   si nt#        j$                  |j                         }	| j                  j                  st'        |	      }	t         j(                  j+                  |	|j-                         
      }
| j                  j/                  |
       |
S a  Lists all FileSearchStore owned by the user.

    Args:
      config (ListFileSearchStoresConfig | None): Optional parameters for the
        request, such as page_size.

    Returns:
      ListFileSearchStoresResponse: A paginated list of FileSearchStore.
    rh   rk   r,   rU   r(   rl   r$   Nrs   rn   )r   _ListFileSearchStoresParametersrd   rq   rr   rQ   rs   rt   r   ru   r$   rv   r
   rw   rx   ry   rz   r{   r|   rW   ListFileSearchStoresResponser~   r   r   r   s              r   _listzFileSearchStores._list  s    ;;O
   
I  >oNl%))&1	!,,-=>!##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''t\<PH&mmBHMM1JM$$>}Mm55DD'A'A'C E L 	%%l3r!   r@   c                   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||      }	|@t!        |d	d       r3t        j"                  |	
      }
| j                  j%                  |
       |
S |	j&                  si nt)        j*                  |	j&                        }| j                  j                  st-        |      }t         j"                  j/                  ||j1                               }
| j                  j%                  |
       |
S Nr@   r$   rk   r,   z>upload/v1beta/{file_search_store_name}:uploadToFileSearchStorer(   rl   r$   rm   should_return_http_response)rF   rn   )r   "_UploadToFileSearchStoreParametersrd   rq   rr   r]   rs   rt   r   ru   r$   rv   r
   rw   rx   ry   getattr(UploadToFileSearchStoreResumableResponser   rz   r{   r|   r_   r~   r   rf   r@   r$   r   r   r   r   r   rv   r<   r   r   s               r   _upload_to_file_search_storez-FileSearchStores._upload_to_file_search_store/  s    >>5O   
I  A
l &))&1	LZ() 	
 P##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH g-t CC$l ''5&mmBHMM1JM$$J
m
 	66EE"?+E+E+G 	F 	
  	%%l3r!   rA   c                z   t        j                  |||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  st'        |      }t         j(                  j+                  ||j-                         
      }| j                  j/                  |       |S a  Imports a File from File Service to a FileSearchStore.

    This is a long-running operation, see aip.dev/151

    Args:
      file_search_store_name (str): The resource name of the FileSearchStore.
        Example: `fileSearchStores/my-file-search-store-123`
      file_name (str): The resource name of the File to import. Example:
        `files/abc-123`
      config (ImportFileConfig | None): Optional parameters for the request.

    Returns:
      ImportFileOperation.
    )r@   rA   r$   rk   r,   z#{file_search_store_name}:importFiler(   rl   r$   Nrm   rn   )r   _ImportFileParametersrd   rq   rr   rC   rs   rt   r   ru   r$   rv   r
   rw   rx   ry   rz   r{   r|   r>   ImportFileOperationr~   r   r   rf   r@   rA   r$   r   r   r   r   r   rv   r<   r   r   s                r   import_filezFileSearchStores.import_filey  s   , 115O   
I  4ODl%))&1	4??
 5##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM$$5mDm,,;;'A'A'C < L 	%%l3r!   filec                   | j                   j                  rt        d      |i }n.t        |t              rt	        |      }n|j                  d      }t        j                  ||j                  d      |j                  d            \  }}}i ||dd}| j                  |t        j                  di |      }	|	j                  F|	j                  j                  0d	|	j                  j                  vr#d
|	j                  j                  vrt        d      d	|	j                  j                  v r|	j                  j                  d	   }
n|	j                  j                  d
   }
t        |t        j                         r | j                   j#                  ||
||      }n4t%        j&                  |      }| j                   j#                  ||
||      }t)        |j*                        }t        j,                  j/                  |i       S )au  Calls the API to upload a file to the given file search store.

    Args:
      file_search_store_name: The resource name of the FileSearchStore. Example:
        `fileSearchStores/file-search-store-123`
      file: A path to the file or an `IOBase` object to be uploaded. If it's an
        IOBase object, it must be opened in blocking (the default) mode and
        binary mode. In other words, do not use non-blocking mode or text mode.
        The given stream must be seekable, that is, it must be able to call
        `seek()` on 'path'.
      config: Optional parameters to set `diplay_name`, `mime_type`, and others.
    rk   Texclude_unsetrv   rY   user_http_optionsuser_mime_typerv   r   r   x-goog-upload-urlX-Goog-Upload-URL`Failed to upload file to file search store. Upload URL did not returned from the upload request.rv   rn    )rd   rq   rr   
isinstancedictr   r   prepare_resumable_uploadrs   r   r   UploadToFileSearchStoreConfigrF   headersKeyErrorioIOBaseupload_fileosfspathr   r{    UploadToFileSearchStoreOperationr~   rf   r@   r   r$   user_config_dictrv   
size_bytes_final_config_dictr<   
upload_urlupload_responsefs_pathr   s                 r   upload_to_file_search_storez,FileSearchStores.upload_to_file_search_store  s   &   
I  ~)+	FD	!f***>"."G"G*..~>'++K8#L*a

$'+
 00522G5FG 1 H
 	""*%%--5x'A'A'I'II#8+E+E+M+MM /  
 : : B B	B--556IJj--556IJj$		"((44

J\ 5 o 		$g((44
:z 5 o AM 11@@r A  r!   c                R    t        d| j                  | j                  |      |      S )a  Lists FileSearchStores.

    Args:
      config (ListFileSearchStoresConfig): Optional configuration for the list
        request.

    Returns:
      A Pager object that contains one page of file search stores. When
      iterating over
      the pager, it automatically fetches the next page if there are more.

    Usage:

    .. code-block:: python
      for file_search_store in client.file_search_stores.list():
        print(f"file search store: {file_search_store.name} -
        {file_search_store.display_name}")
    rV   rh   )r   r   rf   r$   s     r   listzFileSearchStores.list  s,    * 



&
!	 r!   )"__name__
__module____qualname__r   r   rg   r   r   !CreateFileSearchStoreConfigOrDictr}   r   strGetFileSearchStoreConfigOrDictrs   !DeleteFileSearchStoreConfigOrDictr    ListFileSearchStoresConfigOrDictr   r   #UploadToFileSearchStoreConfigOrDictr   r   ImportFileConfigOrDictr   r   r   r   PathLiker   r   r   r   r   r   r   r!   r   ra   ra   ;  s   ' ' ' LP9 G GH99~ @D	= = u;;<	=
 =F CG	6 6 u>>?	6
 6r KO: F FG:)):@ EI	H "H u@@A	H
 55H^ 8<I "I 	I
 u334I   I` EIJ "J #r{{3'23	J
 u@@AJ --JZ KO F FGU""#r!   ra   c            	          e Zd Zedefd       Zdddeej                     dej                  fdZ
dddedeej                     dej                  fdZdddedeej                     ddfd	Zdddeej                      dej"                  fd
Zdddedeej&                     dej(                  fdZdddededeej,                     dej.                  fdZdddedeeej6                  e   ej:                  f   deej&                     dej<                  fdZdddeej                      de ej                     fdZ!y)AsyncFileSearchStoresr   c                 ,    t        | j                        S rc   )r   rd   re   s    r   rg   zAsyncFileSearchStores.documents/  s    $**++r!   Nrh   r$   c                P  K   t        j                  |      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||       d{   }|j                   si nt#        j$                  |j                         }	t         j&                  j)                  |	|j+                         
      }
| j                  j-                  |
       |
S 7 }wrj   )r   rp   rd   rq   rr   r%   rs   rt   r   ru   r$   rv   r
   rw   rx   async_requestrz   r{   r|   r}   r~   r   r   r   s              r   r   zAsyncFileSearchStores.create3  s     <<O
   
I  ?Ol%))&1	!,,-=>!##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM((77'A'A'C 8 L 	%%l3s   D$F&&F$'A>F&r+   c                R  K   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||       d{   }	|	j                   si nt#        j$                  |	j                         }
t         j&                  j)                  |
|j+                         
      }| j                  j-                  |       |S 7 }wr   )r   r   rd   rq   rr   r/   rs   rt   r   ru   r$   rv   r
   rw   rx   r   rz   r{   r|   r}   r~   r   r   r   s               r   rs   zAsyncFileSearchStores.getn  s    $ 99O   
I  <OLl%))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t\< H 'mmBHMM1JM((77'A'A'C 8 L 	%%l3s   D%F''F%(A>F'c                b  K   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||       d{   }	y7 wr   )r   r   rd   rq   rr   r-   rs   rt   r   ru   r$   rv   r
   rw   rx   r   r   s
             r   r   zAsyncFileSearchStores.delete  s+    $ <<O   
I  ?Ol%))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33$l H s   D%D/'D-(D/c                  K   t        j                  |      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d	|||       d{   }|j                   si nt#        j$                  |j                         }	| j                  j                  st'        |	      }	t         j(                  j+                  |	|j-                         
      }
| j                  j/                  |
       |
S 7 wr   )r   r   rd   rq   rr   rQ   rs   rt   r   ru   r$   rv   r
   rw   rx   r   rz   r{   r|   rW   r   r~   r   r   r   s              r   r   zAsyncFileSearchStores._list  s     ;;O
   
I  >oNl%))&1	!,,-=>!##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t\< H 'mmBHMM1JM$$>}Mm55DD'A'A'C E L 	%%l3s   D$G&G'BGr@   c                  K   t        j                  ||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||       d {   }	|@t!        |d	d       r3t        j"                  |	
      }
| j                  j%                  |
       |
S |	j&                  si nt)        j*                  |	j&                        }| j                  j                  st-        |      }t         j"                  j/                  ||j1                               }
| j                  j%                  |
       |
S 7 wr   )r   r   rd   rq   rr   r]   rs   rt   r   ru   r$   rv   r
   rw   rx   r   r   r   r   rz   r{   r|   r_   r~   r   r   s               r   r   z2AsyncFileSearchStores._upload_to_file_search_store%  s     >>5O   
I  A
l &))&1	LZ() 	
 P##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H g-t CC$l ''5&mmBHMM1JM$$J
m
 	66EE"?+E+E+G 	F 	
  	%%l37s   D%H
'H(C!H
rA   c                  K   t        j                  |||      }| j                  j                  rt	        d      t        |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  st'        |      }t         j(                  j+                  ||j-                         
      }| j                  j/                  |       |S 7 wr   )r   r   rd   rq   rr   rC   rs   rt   r   ru   r$   rv   r
   rw   rx   r   rz   r{   r|   r>   r   r~   r   r   r   s                r   r   z!AsyncFileSearchStores.import_fileo  s    , 115O   
I  4ODl%))&1	4??
 5##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM$$5mDm,,;;'A'A'C < L 	%%l3s   D&G	(G)BG	r   c                Z  K   | j                   j                  rt        d      |i }n.t        |t              rt	        |      }n|j                  d      }t        j                  ||j                  d      |j                  d            \  }}}i ||dd}| j                  |t        j                  di |	       d{   }	|	j                  F|	j                  j                  0d
|	j                  j                  vr#d|	j                  j                  vrt        d      d
|	j                  j                  v r|	j                  j                  d
   }
n|	j                  j                  d   }
t        |t        j                         r(| j                   j#                  ||
||       d{   }n<t%        j&                  |      }| j                   j#                  ||
||       d{   }t)        |j*                        }t        j,                  j/                  |i       S 7 a7 z7 ?w)at  Calls the API to upload a file to the given file search store.

    Args:
      file_search_store_name: The resource name of the FileSearchStore. Example:
        `fileSearchStores/file-search-store-123`
      file: A path to the file or an `IOBase` object to be uploaded. If it's an
        IOBase object, it must be opened in blocking (the default) mode and
        binary mode. In other words, do not use non-blocking mode or text mode.
        The given stream must be seekable, that is, it must be able to call
        `seek()` on 'path'.
      config: Optional parameters to set `diplay_name`, `mime_type` and others.
    rk   NTr   rv   rY   r   r   r   r   r   r   r   rn   r   )rd   rq   rr   r   r   r   r   r   rs   r   r   r   rF   r   r   r   r   async_upload_filer   r   r   r{   r   r~   r   s                 r   r   z1AsyncFileSearchStores.upload_to_file_search_store  s=    &   
I  ~)+	FD	!f***>"."G"G*..~>'++K8#L*a

$'+
 66522G5FG 7  H
 	""*%%--5x'A'A'I'II#8+E+E+M+MM /  
 : : B B	B--556IJj--556IJj$		""..@@

J\ A  o 		$g"..@@
:z A  o AM 11@@r A  A*
s7   CH+H$C(H+,H'-<H+)H)*;H+'H+)H+c                n   K   t        d| j                  | j                  |       d{   |      S 7 	w)a(  Lists FileSearchStores asynchronously.

    Args:
      config (ListFileSearchStoresConfig): Optional configuration for the list
        request.

    Returns:
      A Pager object that contains one page of FileSearchStores. When iterating
      over
      the pager, it automatically fetches the next page if there are more.

    Usage:

    .. code-block:: python
      async for file_search_store in await client.file_search_stores.list():
        print(f"file search store: {file_search_store.name} -
        {file_search_store.display_name}")
    rV   rh   N)r   r   r   s     r   r   zAsyncFileSearchStores.list  s8     * 

jjj''	  	(s   '53
5)"r   r   r   r   r   rg   r   r   r   r}   r   r   r   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r!   r   r   r   -  s   , , , LP9 G GH99~ @D	? ? u;;<	?
 ?J CG	6 6 u>>?	6
 6r KO< F FG<))<D EI	H "H u@@A	H
 55H^ 8<I "I 	I
 u334I   I` EIJ "J #r{{3'23	J
 u@@AJ --JZ KO F FG%''(r!   r   rc   )4	functoolsr   r   r{   loggingr   typingr   r   r   urllib.parser    r	   r
   r   r   r   r   r   r   _operations_convertersr   rg   r   r   pagersr   r   	getLoggerloggerr   r   objectr    r%   r)   r-   r/   r7   r>   rC   r=   rO   rQ   rW   r[   r]   r_   
BaseModulera   r   r   r!   r   <module>r      s  $ & 	   	 ' ' "     . . P 0 % 
		:	;
 /3	tCH~v-.	DcN+	 
#s(^	 /3
tCH~v-.
DcN+
 
#s(^
 /3	tCH~v-.	DcN+	 
#s(^	 /3tCH~v-.DcN+ 
#s(^$ /3tCH~v-.DcN+ 
#s(^ /3tCH~v-.DcN+ 
#s(^2 /3tCH~v-.DcN+ 
#s(^> /3tCH~v-.DcN+ 
#s(^. /3tCH~v-.DcN+ 
#s(^* /3tCH~v-.DcN+ 
#s(^. /3
tCH~v-.
DcN+
 
#s(^
 /3tCH~v-.DcN+ 
#s(^2 /3tCH~v-.DcN+ 
#s(^> /3tCH~v-.DcN+ 
#s(^, /3
tCH~v-.
DcN+
 
#s(^
o{-- odsK22 sr!   