Skip to content

incident_io_client.types

Contains some shared types for properties

File

Contains information for file uploads

Source code in incident_io_client/types.py
@define
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

to_tuple() -> FileJsonType

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

Source code in incident_io_client/types.py
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 incident_io_client/types.py
@define
class Response(Generic[T]):
    """A response from an endpoint"""

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