@@ -43,8 +43,7 @@ def to_dict(self) -> dict:
4343 """Converts the BytesValue to a dictionary.
4444
4545 Returns:
46- -------
47- Dict: A dictionary representation of the BytesValue.
46+ A dictionary representation of the BytesValue.
4847 """
4948 return {"type" : self .type , "value" : self .value }
5049
@@ -78,13 +77,11 @@ def __init__(
7877 def from_dict (cls , data : dict ) -> "Cookie" :
7978 """Creates a Cookie instance from a dictionary.
8079
81- Parameters:
82- -----------
80+ Args:
8381 data: A dictionary containing the cookie information.
8482
8583 Returns:
86- -------
87- Cookie: A new instance of Cookie.
84+ A new instance of Cookie.
8885 """
8986 # Validation for empty strings
9087 name = data .get ("name" )
@@ -137,8 +134,7 @@ def to_dict(self) -> dict[str, Any]:
137134 """Converts the CookieFilter to a dictionary.
138135
139136 Returns:
140- -------
141- Dict: A dictionary representation of the CookieFilter.
137+ A dictionary representation of the CookieFilter.
142138 """
143139 result : dict [str , Any ] = {}
144140 if self .name is not None :
@@ -173,13 +169,11 @@ def __init__(self, user_context: Optional[str] = None, source_origin: Optional[s
173169 def from_dict (cls , data : dict ) -> "PartitionKey" :
174170 """Creates a PartitionKey instance from a dictionary.
175171
176- Parameters:
177- -----------
172+ Args:
178173 data: A dictionary containing the partition key information.
179174
180175 Returns:
181- -------
182- PartitionKey: A new instance of PartitionKey.
176+ A new instance of PartitionKey.
183177 """
184178 return cls (
185179 user_context = data .get ("userContext" ),
@@ -198,7 +192,6 @@ def to_dict(self) -> dict:
198192 """Converts the BrowsingContextPartitionDescriptor to a dictionary.
199193
200194 Returns:
201- -------
202195 Dict: A dictionary representation of the BrowsingContextPartitionDescriptor.
203196 """
204197 return {"type" : self .type , "context" : self .context }
@@ -216,7 +209,6 @@ def to_dict(self) -> dict:
216209 """Converts the StorageKeyPartitionDescriptor to a dictionary.
217210
218211 Returns:
219- -------
220212 Dict: A dictionary representation of the StorageKeyPartitionDescriptor.
221213 """
222214 result = {"type" : self .type }
@@ -286,13 +278,11 @@ def __init__(self, cookies: list[Cookie], partition_key: PartitionKey):
286278 def from_dict (cls , data : dict ) -> "GetCookiesResult" :
287279 """Creates a GetCookiesResult instance from a dictionary.
288280
289- Parameters:
290- -----------
281+ Args:
291282 data: A dictionary containing the get cookies result information.
292283
293284 Returns:
294- -------
295- GetCookiesResult: A new instance of GetCookiesResult.
285+ A new instance of GetCookiesResult.
296286 """
297287 cookies = [Cookie .from_dict (cookie ) for cookie in data .get ("cookies" , [])]
298288 partition_key = PartitionKey .from_dict (data .get ("partitionKey" , {}))
@@ -309,13 +299,11 @@ def __init__(self, partition_key: PartitionKey):
309299 def from_dict (cls , data : dict ) -> "SetCookieResult" :
310300 """Creates a SetCookieResult instance from a dictionary.
311301
312- Parameters:
313- -----------
302+ Args:
314303 data: A dictionary containing the set cookie result information.
315304
316305 Returns:
317- -------
318- SetCookieResult: A new instance of SetCookieResult.
306+ A new instance of SetCookieResult.
319307 """
320308 partition_key = PartitionKey .from_dict (data .get ("partitionKey" , {}))
321309 return cls (partition_key = partition_key )
@@ -331,13 +319,11 @@ def __init__(self, partition_key: PartitionKey):
331319 def from_dict (cls , data : dict ) -> "DeleteCookiesResult" :
332320 """Creates a DeleteCookiesResult instance from a dictionary.
333321
334- Parameters:
335- -----------
322+ Args:
336323 data: A dictionary containing the delete cookies result information.
337324
338325 Returns:
339- -------
340- DeleteCookiesResult: A new instance of DeleteCookiesResult.
326+ A new instance of DeleteCookiesResult.
341327 """
342328 partition_key = PartitionKey .from_dict (data .get ("partitionKey" , {}))
343329 return cls (partition_key = partition_key )
@@ -354,16 +340,20 @@ def get_cookies(
354340 filter : Optional [CookieFilter ] = None ,
355341 partition : Optional [Union [BrowsingContextPartitionDescriptor , StorageKeyPartitionDescriptor ]] = None ,
356342 ) -> GetCookiesResult :
357- """Retrieves cookies that match the given parameters .
343+ """Gets cookies matching the specified filter .
358344
359- Parameters:
360- -----------
361- filter: Optional filter to match cookies.
362- partition: Optional partition descriptor.
345+ Args:
346+ filter: Optional filter to specify which cookies to retrieve.
347+ partition: Optional partition key to limit the scope of the operation.
363348
364349 Returns:
365- -------
366- GetCookiesResult: The result of the get cookies command.
350+ A GetCookiesResult containing the cookies and partition key.
351+
352+ Example:
353+ result = await storage.get_cookies(
354+ filter=CookieFilter(name="sessionId"),
355+ partition=PartitionKey(...)
356+ )
367357 """
368358 params = {}
369359 if filter is not None :
@@ -381,14 +371,12 @@ def set_cookie(
381371 ) -> SetCookieResult :
382372 """Sets a cookie in the browser.
383373
384- Parameters:
385- -----------
374+ Args:
386375 cookie: The cookie to set.
387376 partition: Optional partition descriptor.
388377
389378 Returns:
390- -------
391- SetCookieResult: The result of the set cookie command.
379+ The result of the set cookie command.
392380 """
393381 params = {"cookie" : cookie .to_dict ()}
394382 if partition is not None :
@@ -404,14 +392,12 @@ def delete_cookies(
404392 ) -> DeleteCookiesResult :
405393 """Deletes cookies that match the given parameters.
406394
407- Parameters:
408- -----------
395+ Args:
409396 filter: Optional filter to match cookies to delete.
410397 partition: Optional partition descriptor.
411398
412399 Returns:
413- -------
414- DeleteCookiesResult: The result of the delete cookies command.
400+ The result of the delete cookies command.
415401 """
416402 params = {}
417403 if filter is not None :
0 commit comments