Identity

A provider account the supporter signed in with.

On this page

Class in sponsorkit.models.

from sponsorkit import Identity

Also importable from sponsorkit.models.

@dataclass(frozen=True)
class Identity:
    ...

A provider account the supporter signed in with.

Constructor#

Identity(provider: Provider, id: str, handle: str | None, needs_reconnect: bool) -> None

Instances are immutable; every field below is a constructor parameter.

Fields#

provider#

provider: Provider

github or open-collective.

id#

id: str

The provider's id for the account.

handle#

handle: str | None

The provider login or slug, when known.

needs_reconnect#

needs_reconnect: bool

The provider token expired; sign_in(provider=...) reconnects it.

Methods#

from_dict()#

@classmethod
def from_dict(cls, d: Mapping[str, Any]) -> Identity

Parse the JSON form.

to_dict()#

def to_dict(self) -> dict[str, Any]

The JSON form.