Skip to content

membership

Pydantic models related to organization memberships.

A membership links a user to an organization with a role.

MemberOut pydantic-model

Bases: BaseModel

A member of an organization, as listed to its other members.

Config:

  • frozen: True

Fields:

created_at pydantic-field

When the member joined.

email pydantic-field

The member's email address.

id pydantic-field

The membership id; the id to address for role changes and removal.

name = None pydantic-field

The member's display name, if set.

role pydantic-field

The member's role in the organization.

user_id pydantic-field

The member's user id.

MemberRemoval pydantic-model

Bases: FreshCheck

End a membership, another member's or the caller's own, with a fresh check.

Fields:

MemberRoleUpdate pydantic-model

Bases: FreshCheck

Change a member's role between admin and member, with a fresh check.

Ownership is not a role to assign; it moves through an ownership transfer.

Fields:

Validators:

  • _not_owner → role

role pydantic-field

The member's new role: admin or member.