SponsorEntity

Who pays: the signed-in user or an organization they belong to.

On this page

Class in sponsorkit.models.

from sponsorkit import SponsorEntity

Also importable from sponsorkit.models.

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

Who pays: the signed-in user or an organization they belong to.

Constructor#

SponsorEntity(
    type: Literal['user', 'organization'],
    provider: Provider,
    id: str,
    handle: str | None,
) -> None

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

Fields#

type#

type: Literal['user', 'organization']

user or organization.

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.

Methods#

from_dict()#

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

Parse the JSON form.

to_dict()#

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

The JSON form.