Skip to content

Types

Contains shared types for properties.

File

Contains information for file uploads

Source code in eth_2_key_manager_api_client/types.py
20
21
22
23
24
25
26
27
28
29
30
@attr.s(auto_attribs=True)
class File:
    """Contains information for file uploads"""

    payload: BinaryIO
    file_name: Optional[str] = None
    mime_type: Optional[str] = None

    def to_tuple(self) -> FileJsonType:
        """Return a tuple representation that httpx will accept for multipart/form-data"""
        return self.file_name, self.payload, self.mime_type

to_tuple()

Return a tuple representation that httpx will accept for multipart/form-data

Source code in eth_2_key_manager_api_client/types.py
28
29
30
def to_tuple(self) -> FileJsonType:
    """Return a tuple representation that httpx will accept for multipart/form-data"""
    return self.file_name, self.payload, self.mime_type

Response

Bases: Generic[T]

A response from an endpoint

Source code in eth_2_key_manager_api_client/types.py
36
37
38
39
40
41
42
43
@attr.s(auto_attribs=True)
class Response(Generic[T]):
    """A response from an endpoint"""

    status_code: HTTPStatus
    content: bytes
    headers: MutableMapping[str, str]
    parsed: Optional[T]