class Response(CustomizedDataClassJsonMixin): status: int status_text: str http_version: str cookies: List[Cookie] headers: List[Header] content: Content headers_size: int body_size: int redirect_url: str = field(metadata=config(field_name="redirectURL")) comment: Optional[str] = None _transfer_size: Optional[int] = field( default=None, metadata=config(field_name="_transferSize"))
class Page(CustomizedDataClassJsonMixin): started_date_time: datetime = field(metadata=config( encoder=datetime_encoder)) id: str title: str page_timings: PageTimings comment: Optional[str] = None
class Entry(CustomizedDataClassJsonMixin): started_date_time: datetime = field( metadata=config(encoder=datetime_encoder, )) time: Union[int, float] request: Request response: Response cache: Cache timings: Timings pageref: Optional[str] = None server_ip_address: Optional[str] = field( default=None, metadata=config(field_name="serverIPAddress")) comment: Optional[str] = None _server_port: Optional[int] = field( default=None, metadata=config(field_name="_serverPort")) _security_details: Optional[SecurityDetails] = field( default=None, metadata=config(field_name="_securityDetails"))
class Cookie(CustomizedDataClassJsonMixin): name: str value: str path: Optional[str] = None domain: Optional[str] = None expires: Optional[datetime] = field( default=None, metadata=config(encoder=datetime_encoder, ), ) http_only: bool = False secure: bool = False same_site: Optional[str] = None
def _process_class(cls, letter_case, undefined): if letter_case is not None or undefined is not None: cls.dataclass_json_config = config( letter_case=letter_case, undefined=undefined)['dataclasses_json'] cls.to_json = DataClassJsonMixin.to_json # unwrap and rewrap classmethod to tag it to cls rather than the literal # DataClassJsonMixin ABC cls.from_json = classmethod(DataClassJsonMixin.from_json.__func__) cls.to_dict = DataClassJsonMixin.to_dict cls.from_dict = classmethod(DataClassJsonMixin.from_dict.__func__) cls.schema = classmethod(DataClassJsonMixin.schema.__func__) cls.__init__ = _handle_undefined_parameters_safe(cls, kvs=(), usage="init") # register cls as a virtual subclass of DataClassJsonMixin DataClassJsonMixin.register(cls) return cls
class Response(CustomizedDataClassJsonMixin): url: str status: int status_text: str headers: Dict[str, Any] mime_type: str connection_reused: bool connection_id: int encoded_data_length: int security_state: str response_time: Optional[float] = None request_headers: Optional[Dict[str, Any]] = None request_headers_text: Optional[str] = None remote_ip_address: Optional[str] = field( default=None, metadata=config(field_name="remoteIPAddress")) remote_port: Optional[int] = None from_disk_cache: Optional[bool] = None from_service_worker: Optional[bool] = None from_prefetch_cache: Optional[bool] = None timing: Optional[Dict[str, float]] = None protocol: Optional[str] = None headers_text: Optional[str] = None
class CustomizedDataClassJsonMixin(DataClassJsonMixin): dataclass_json_config = config( letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE, exclude=lambda f: f is None, )["dataclasses_json"]
class DataClassWithConfigHelper: id: float = field(metadata=config(encoder=str))