1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
U
[±d^ ã@sddlmZddlmZmZddlmZddlZddlZGdd„de    ƒZ
Gdd    „d    ej ƒZ eGd
d „d ƒƒZ eGd d „d ƒƒZeGdd„dƒƒZeGdd„dƒƒZdddœdd„Zddddœdd„Zd)ddddœdd„Zdddd d!œd"d#„Zd*dd$d$dd%d&œd'd(„ZdS)+é)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassNcsBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) ÚCacheIdz0
    Unique identifier of the Cache object.
    Ústr)ÚreturncCs|S©N©©Úselfr r úld:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v112/cache_storage.pyÚto_jsonszCacheId.to_json)Újsonr    cCs||ƒSr
r ©Úclsrr r rÚ    from_jsonszCacheId.from_jsoncsd tƒ ¡¡S)Nz CacheId({}))ÚformatÚsuperÚ__repr__r ©Ú    __class__r rrszCacheId.__repr__)    Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚ classmethodrrÚ __classcell__r r rrr s
rc@s<eZdZdZdZdZdZdZdZdZ    dd    „Z
e d
d „ƒZ d S) ÚCachedResponseTypez&
    type of HTTP response cached
    ÚbasicZcorsÚdefaultÚerrorZopaqueResponseZopaqueRedirectcCs|jSr
)Úvaluer r r rr'szCachedResponseType.to_jsoncCs||ƒSr
r rr r rr*szCachedResponseType.from_jsonN) rrrrZBASICZCORSÚDEFAULTÚERRORZOPAQUE_RESPONSEZOPAQUE_REDIRECTrrrr r r rrsrc@sfeZdZUdZded<ded<ded<ded<d    ed
<ded <d ed <ded<dd„Zedd„ƒZdS)Ú    DataEntryz
    Data entry.
    rÚ request_urlÚrequest_methodútyping.List[Header]Úrequest_headersÚfloatÚ response_timeÚintÚresponse_statusÚresponse_status_textrÚ response_typeÚresponse_headerscCsrtƒ}|j|d<|j|d<dd„|jDƒ|d<|j|d<|j|d<|j|d<|j ¡|d    <d
d„|j    Dƒ|d <|S) NÚ
requestURLÚ requestMethodcSsg|] }| ¡‘qSr ©r©Ú.0Úir r rÚ
<listcomp>Psz%DataEntry.to_json.<locals>.<listcomp>ÚrequestHeadersÚ responseTimeÚresponseStatusÚresponseStatusTextÚ responseTypecSsg|] }| ¡‘qSr r4r5r r rr8UsÚresponseHeaders)
Údictr'r(r*r,r.r/r0rr1©r rr r rrLs
 
 
 
 
zDataEntry.to_jsonc Csf|t|dƒt|dƒdd„|dDƒt|dƒt|dƒt|dƒt |d    ¡d
d„|d Dƒd S) Nr2r3cSsg|]}t |¡‘qSr ©ÚHeaderrr5r r rr8]sz'DataEntry.from_json.<locals>.<listcomp>r9r:r;r<r=cSsg|]}t |¡‘qSr rAr5r r rr8bsr>)r'r(r*r,r.r/r0r1)rr+r-rrrr r rrXs
 
 
 
 
 øzDataEntry.from_jsonN©rrrrÚ__annotations__rrrr r r rr&/s
 r&c@sFeZdZUdZded<ded<ded<ded<dd    „Zed
d „ƒZd S) ÚCachez
    Cache identifier.
    rÚcache_idrÚsecurity_originÚ storage_keyÚ
cache_namecCs6tƒ}|j ¡|d<|j|d<|j|d<|j|d<|S)NÚcacheIdÚsecurityOriginÚ
storageKeyÚ    cacheName)r?rFrrGrHrIr@r r rrws 
 
 
z Cache.to_jsoncCs2|t |d¡t|dƒt|dƒt|dƒdS)NrJrKrLrM)rFrGrHrI)rrrrr r rrs  
 
 
üzCache.from_jsonNrCr r r rrEfs
rEc@s2eZdZUded<ded<dd„Zedd„ƒZdS)    rBrÚnamer#cCstƒ}|j|d<|j|d<|S)NrNr#)r?rNr#r@r r rrs
 
zHeader.to_jsoncCs|t|dƒt|dƒdS)NrNr#)rNr#©rrr r rr•s
 
þzHeader.from_jsonN)rrrrDrrrr r r rrB‰s
 
rBc@s.eZdZUdZded<dd„Zedd„ƒZdS)    ÚCachedResponsez
    Cached response
    rÚbodycCstƒ}|j|d<|S)NrQ)r?rQr@r r rr¥s
zCachedResponse.to_jsoncCs|t|dƒdS)NrQ)rQrOrr r rrªs
ÿzCachedResponse.from_jsonNrCr r r rrPs
 
rPz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])rFr    ccs&tƒ}| ¡|d<d|dœ}|V}dS)zJ
    Deletes a cache.
 
    :param cache_id: Id of cache for deletion.
    rJzCacheStorage.deleteCache©ÚmethodÚparamsN©r?r)rFrTÚcmd_dictrr r rÚ delete_cache±s  þrWr)rFÚrequestr    ccs.tƒ}| ¡|d<||d<d|dœ}|V}dS)z
    Deletes a cache entry.
 
    :param cache_id: Id of cache where the entry will be deleted.
    :param request: URL spec of the request.
    rJrXzCacheStorage.deleteEntryrRNrU)rFrXrTrVrr r rÚ delete_entryÂs
 þrYztyping.Optional[str]z>typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Cache]])rGrHr    ccsHtƒ}|dk    r||d<|dk    r&||d<d|dœ}|V}dd„|dDƒS)    a
    Requests cache names.
 
    :param security_origin: *(Optional)* At least and at most one of securityOrigin, storageKey must be specified. Security origin.
    :param storage_key: *(Optional)* Storage key.
    :returns: Caches for the security origin.
    NrKrLzCacheStorage.requestCacheNamesrRcSsg|]}t |¡‘qSr )rErr5r r rr8ësz'request_cache_names.<locals>.<listcomp>Úcaches)r?)rGrHrTrVrr r rÚrequest_cache_namesÖs þr[r)z:typing.Generator[T_JSON_DICT, T_JSON_DICT, CachedResponse])rFr'r*r    ccsJtƒ}| ¡|d<||d<dd„|Dƒ|d<d|dœ}|V}t |d¡S)    zê
    Fetches cache entry.
 
    :param cache_id: Id of cache that contains the entry.
    :param request_url: URL spec of the request.
    :param request_headers: headers of the request.
    :returns: Response read from the cache.
    rJr2cSsg|] }| ¡‘qSr r4r5r r rr8þsz+request_cached_response.<locals>.<listcomp>r9z"CacheStorage.requestCachedResponserRÚresponse)r?rrPr)rFr'r*rTrVrr r rÚrequest_cached_responseîs  þr]ztyping.Optional[int]zWtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DataEntry], float]])rFÚ
skip_countÚ    page_sizeÚ path_filterr    ccsptƒ}| ¡|d<|dk    r"||d<|dk    r2||d<|dk    rB||d<d|dœ}|V}dd    „|d
Dƒt|d ƒfS) aR
    Requests data from cache.
 
    :param cache_id: ID of cache to get entries from.
    :param skip_count: *(Optional)* Number of records to skip.
    :param page_size: *(Optional)* Number of records to fetch.
    :param path_filter: *(Optional)* If present, only return the entries containing this substring in the path
    :returns: A tuple with the following items:
 
        0. **cacheDataEntries** - Array of object store data entries.
        1. **returnCount** - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.
    rJNZ    skipCountZpageSizeZ
pathFilterzCacheStorage.requestEntriesrRcSsg|]}t |¡‘qSr )r&rr5r r rr8'sz#request_entries.<locals>.<listcomp>ZcacheDataEntriesZ returnCount)r?rr+)rFr^r_r`rTrVrr r rÚrequest_entriess þ
þra)NN)NNN)Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingrrÚEnumrr&rErBrPrWrYr[r]rar r r rÚ<module>s0  6"þü