o
    ҷhg                     @  s   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
 eG dd dZeG d	d
 d
ZeG dd dZd"ddZd#ddZd$ddZd%ddZedeG dd dZedeG d d! d!ZdS )&    )annotations   )event_classT_JSON_DICT)	dataclassN)pagec                   @  s>   e Zd ZU dZded< ded< ded< dd Zed	d
 ZdS )ApplicationCacheResourcez:
    Detailed application cache resource information.
    strurlintsizetype_c                 C  s(   t  }| j|d< | j|d< | j|d< |S )Nr
   r   type)dictr
   r   r   selfjson r   k/var/www/html/venv/lib/python3.10/site-packages/selenium/webdriver/common/devtools/v85/application_cache.pyto_json   s
   


z ApplicationCacheResource.to_jsonc                 C  s&   | t |d t|d t |d dS )Nr
   r   r   )r
   r   r   )r	   r   clsr   r   r   r   	from_json$   s
   


z"ApplicationCacheResource.from_jsonN__name__
__module____qualname____doc____annotations__r   classmethodr   r   r   r   r   r         
 r   c                   @  sN   e Zd ZU dZded< ded< ded< ded< ded	< d
d Zedd ZdS )ApplicationCachez1
    Detailed application cache information.
    r	   manifest_urlfloatr   creation_timeupdate_timez%typing.List[ApplicationCacheResource]	resourcesc                 C  sF   t  }| j|d< | j|d< | j|d< | j|d< dd | jD |d< |S )NmanifestURLr   creationTime
updateTimec                 S  s   g | ]}|  qS r   )r   .0ir   r   r   
<listcomp>G   s    z,ApplicationCache.to_json.<locals>.<listcomp>r&   )r   r"   r   r$   r%   r&   r   r   r   r   r   A   s   



zApplicationCache.to_jsonc                 C  s@   | t |d t|d t|d t|d dd |d D dS )	Nr'   r   r(   r)   c                 S     g | ]}t |qS r   )r   r   r*   r   r   r   r-   Q       z.ApplicationCache.from_json.<locals>.<listcomp>r&   )r"   r   r$   r%   r&   )r	   r#   r   r   r   r   r   J   s   



zApplicationCache.from_jsonNr   r   r   r   r   r!   -   s   
 	r!   c                   @  s>   e Zd ZU dZded< ded< ded< dd	 Zed
d ZdS )FrameWithManifestz/
    Frame identifier - manifest URL pair.
    page.FrameIdframe_idr	   r"   r   statusc                 C  s,   t  }| j |d< | j|d< | j|d< |S )NframeIdr'   r3   )r   r2   r   r"   r3   r   r   r   r   r   c   s
   

zFrameWithManifest.to_jsonc                 C  *   | t j|d t|d t|d dS Nr4   r'   r3   )r2   r"   r3   r   FrameIdr   r	   r   r   r   r   r   r   j   
   

zFrameWithManifest.from_jsonNr   r   r   r   r   r0   U   r    r0   return0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c                  c  s    ddi} | V }dS )z9
    Enables application cache domain notifications.
    methodzApplicationCache.enableNr   cmd_dictr   r   r   r   enables   s   
r?   r2   r1   <typing.Generator[T_JSON_DICT, T_JSON_DICT, ApplicationCache]c                 c  s2    t  }|  |d< d|d}|V }t|d S )a	  
    Returns relevant application cache data for the document in given frame.

    :param frame_id: Identifier of the frame containing document whose application cache is retrieved.
    :returns: Relevant application cache data for the document in given frame.
    r4   z,ApplicationCache.getApplicationCacheForFramer<   paramsapplicationCache)r   r   r!   r   r2   rB   r>   r   r   r   r   get_application_cache_for_frame}   s   	rE   Jtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[FrameWithManifest]]c                  c  s"    ddi} | V }dd |d D S )a  
    Returns array of frame identifiers with manifest urls for each frame containing a document
    associated with some application cache.

    :returns: Array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
    r<   z'ApplicationCache.getFramesWithManifestsc                 S  r.   r   )r0   r   r*   r   r   r   r-      r/   z-get_frames_with_manifests.<locals>.<listcomp>frameIdsr   r=   r   r   r   get_frames_with_manifests   s
   rH   /typing.Generator[T_JSON_DICT, T_JSON_DICT, str]c                 c  s0    t  }|  |d< d|d}|V }t|d S )z
    Returns manifest URL for document in the given frame.

    :param frame_id: Identifier of the frame containing document whose manifest is retrieved.
    :returns: Manifest URL for document in the given frame.
    r4   z$ApplicationCache.getManifestForFramerA   r'   )r   r   r	   rD   r   r   r   get_manifest_for_frame   s   	rJ   z.ApplicationCache.applicationCacheStatusUpdatedc                   @  s4   e Zd ZU ded< ded< ded< edd
dZdS )ApplicationCacheStatusUpdatedr1   r2   r	   r"   r   r3   r   r   r:   c                 C  r5   r6   r7   r   r   r   r   r      r9   z'ApplicationCacheStatusUpdated.from_jsonN)r   r   r:   rK   r   r   r   r   r   r   r   r   r   r   rK      s   
 rK   z$ApplicationCache.networkStateUpdatedc                   @  s$   e Zd ZU ded< ed	ddZdS )
NetworkStateUpdatedboolis_now_onliner   r   r:   c                 C  s   | t |d dS )NisNowOnline)rO   )rN   r   r   r   r   r      s   
zNetworkStateUpdated.from_jsonN)r   r   r:   rM   rL   r   r   r   r   rM      s   
 rM   )r:   r;   )r2   r1   r:   r@   )r:   rF   )r2   r1   r:   rI   )
__future__r   utilr   r   dataclassesr   enumtyping r   r   r!   r0   r?   rE   rH   rJ   rK   rM   r   r   r   r   <module>   s,   '




