Wrapper class for responses returned by :py:class:`.CachedSession`. This mainly exists to provide type hints for extra cache-related attributes that are added to non-cached responses.
| 27 | |
| 28 | @define(auto_attribs=False, repr=False, slots=False) |
| 29 | class BaseResponse(Response): |
| 30 | """Wrapper class for responses returned by :py:class:`.CachedSession`. This mainly exists to |
| 31 | provide type hints for extra cache-related attributes that are added to non-cached responses. |
| 32 | """ |
| 33 | |
| 34 | created_at: datetime = field(factory=utcnow) |
| 35 | expires: Optional[datetime] = field(default=None) |
| 36 | cache_key: str = '' # Not serialized; set by BaseCache.get_response() |
| 37 | revalidated: bool = False # Not serialized; set by CacheActions.update_revalidated_response() |
| 38 | |
| 39 | @property |
| 40 | def from_cache(self) -> bool: |
| 41 | return False |
| 42 | |
| 43 | @property |
| 44 | def is_expired(self) -> bool: |
| 45 | return False |
| 46 | |
| 47 | |
| 48 | @define(auto_attribs=False, repr=False, slots=False, init=False) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…