
    g                        d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddl	mZ e G d d	             Ze G d
 d             Ze G d d             Z	 	 	 	 ddZy)    )annotations   )event_classT_JSON_DICT)	dataclassN)network)storagec                  L    e Zd ZU ded<   ded<   ded<   ded<   d Zed	        Zy
)Filestrnameznetwork.TimeSinceEpochlast_modifiedfloatsizetype_c                    t               }| j                  |d<   | j                  j                         |d<   | j                  |d<   | j
                  |d<   |S )Nr   lastModifiedr   type)dictr   r   to_jsonr   r   )selfjsons     f/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v129/file_system.pyr   zFile.to_json   sN    vyyV#1199;^yyVzzV    c           	          | t        |d         t        j                  j                  |d         t	        |d         t        |d               S )Nr   r   r   r   )r   r   r   r   )r   r   TimeSinceEpoch	from_jsonr   )clsr   s     r   r   zFile.from_json$   sL    T&\"!00::4;OPtF|$d6l#	
 	
r   N__name__
__module____qualname____annotations__r   classmethodr    r   r   r   r      s4    
I *) KJ 
 
r   r   c                  B    e Zd ZU ded<   ded<   ded<   d Zed        Zy	)
	Directoryr   r   typing.List[str]nested_directoriesztyping.List[File]nested_filesc                    t               }| j                  |d<   | j                  D cg c]  }| c}|d<   | j                  D cg c]  }|j	                          c}|d<   |S c c}w c c}w )Nr   nestedDirectoriesnestedFiles)r   r   r)   r*   r   r   r   is      r   r   zDirectory.to_json7   sa    vyyV040G0G$H1Q$H !484E4EFqqyy{F] %IFs   	A$A)c           
          | t        |d         |d   D cg c]  }t        |       c}|d   D cg c]  }t        j                  |       c}      S c c}w c c}w )Nr   r,   r-   )r   r)   r*   )r   r   r   r   r   r/   s      r   r   zDirectory.from_json>   sU    T&\"045H0IJ1AJ59-5HI$..+I
 	
JIs
   A
ANr   r%   r   r   r'   r'   .   s.    
I(( $# 
 
r   r'   c                  F    e Zd ZU ded<   ded<   dZded<   d Zed	        Zy)
BucketFileSystemLocatorzstorage.SerializedStorageKeystorage_keyr(   path_componentsNztyping.Optional[str]bucket_namec                    t               }| j                  j                         |d<   | j                  D cg c]  }| c}|d<   | j                  | j                  |d<   |S c c}w )N
storageKeypathComponents
bucketName)r   r4   r   r5   r6   r.   s      r   r   zBucketFileSystemLocator.to_jsonR   se    v!--557\-1-A-A!B!!B'!%!1!1D "Cs   	A"c           	          | t         j                  j                  |d         |d   D cg c]  }t        |       c}d|v rt        |d               S d       S c c}w )Nr8   r9   r:   )r4   r5   r6   )r	   SerializedStorageKeyr   r   r1   s      r   r   z!BucketFileSystemLocator.from_jsonZ   sh    44>>tL?QR-12B-CDSVD3?43GD./
 	
 NR
 	
Ds   A
)r    r!   r"   r#   r6   r   r$   r   r%   r   r   r3   r3   G   s8     .- &% )-K%, 
 
r   r3   c              #     K   t               }| j                         |d<   d|d}|}t        j                  |d         S w)zd
    :param bucket_file_system_locator:
    :returns: Returns the directory object at the path.
    bucketFileSystemLocatorzFileSystem.getDirectory)methodparams	directory)r   r   r'   r   )bucket_file_system_locatorr@   cmd_dictr   s       r   get_directoryrD   c   sO      &F(B(J(J(LF$%+H >DtK011s   ?A)rB   r3   returnz5typing.Generator[T_JSON_DICT, T_JSON_DICT, Directory])
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r   r'   r3   rD   r%   r   r   <module>rL      s|    # * !     
 
 
: 
 
 
0 
 
 
62$;2	<2r   