Repository navigation
Expand file tree
/
Copy path_types.py
More file actions
54 lines (35 loc) · 2.37 KB
/
Copy path_types.py
File metadata and controls
54 lines (35 loc) · 2.37 KB
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
from __future__ import annotations
from typing import Annotated, Literal
from pydantic import BaseModel, ConfigDict, Field
SupportedOperatingSystems = Literal['windows', 'macos', 'linux', 'android', 'ios']
SupportedDevices = Literal['desktop', 'mobile']
SupportedHttpVersion = Literal['1', '2']
SupportedBrowserType = Literal['chrome', 'firefox', 'safari', 'edge']
class ScreenOptions(BaseModel):
model_config = ConfigDict(extra='forbid', validate_by_name=True, validate_by_alias=True)
"""Defines the screen constrains for the fingerprint generator."""
min_width: Annotated[float | None, Field(alias='minWidth')] = None
"""Minimal screen width constraint for the fingerprint generator."""
max_width: Annotated[float | None, Field(alias='maxWidth')] = None
"""Maximal screen width constraint for the fingerprint generator."""
min_height: Annotated[float | None, Field(alias='minHeight')] = None
"""Minimal screen height constraint for the fingerprint generator."""
max_height: Annotated[float | None, Field(alias='maxHeight')] = None
"""Maximal screen height constraint for the fingerprint generator."""
class HeaderGeneratorOptions(BaseModel):
"""Collection of header related attributes that can be used by the fingerprint generator."""
model_config = ConfigDict(extra='forbid', validate_by_name=True, validate_by_alias=True)
browsers: list[SupportedBrowserType] | None = None
"""List of BrowserSpecifications to generate the headers for."""
operating_systems: Annotated[list[SupportedOperatingSystems] | None, Field(alias='operatingSystems')] = None
"""List of operating systems to generate the headers for."""
devices: list[SupportedDevices] | None = None
"""List of devices to generate the headers for."""
locales: list[str] | None = None
"""List of at most 10 languages to include in the [Accept-Language]
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) request header
in the language format accepted by that header, for example `en`, `en-US` or `de`."""
http_version: Annotated[SupportedHttpVersion | None, Field(alias='httpVersion')] = None
"""HTTP version to be used for header generation (the headers differ depending on the version)."""
strict: bool | None = None
"""If true, the generator will throw an error if it cannot generate headers based on the input."""