benchling_sdk.services.v2.stable.organization_service module¶

class OrganizationService¶

Bases: benchling_sdk.services.v2.base_service.BaseService

Organizations.

View organization objects.

See https://benchling.com/api/reference#/Organizations

create_membership(organization_id: str, membership: MembershipCreate) → Membership¶

Create organization membership.

See https://benchling.com/api/reference#/Organizations/createOrganizationMembership

delete_membership(organization_id: str, user_id: str) → None¶

Delete a single team membership.

See https://benchling.com/api/reference#/Organizations/deleteOrganizationMembership

get_by_id(organization_id: str) → Organization¶

Get an organization by ID.

Returns an organization by ID if the caller has permission to view. The following roles have view permission: * tenant admins * members of the organization

See https://benchling.com/api/reference#/Organizations/getOrganization

get_membership(organization_id: str, user_id: str) → Membership¶

Get organization membership.

See https://benchling.com/api/reference#/Organizations/getOrganizationMembership

list(*, ids: Optional[Iterable[str]] = None, name: Optional[str] = None, name_includes: Optional[str] = None, names_any_of: Optional[Iterable[str]] = None, names_any_of_case_sensitive: Optional[Iterable[str]] = None, modified_at: Optional[str] = None, has_members: Optional[Iterable[str]] = None, has_admins: Optional[Iterable[str]] = None, sort: Optional[Union[str, ListOrganizationsSort]] = None, page_size: Optional[int] = 50, mentioned_in: Optional[List[str]] = None) → PageIterator[Organization]¶

List organizations.

Returns all organizations that the caller has permission to view. The following roles have view permission: * tenant admins * members of the organization

See https://benchling.com/api/reference#/Organizations/listOrganizations

list_memberships(organization_id: str, role: Optional[str] = None, page_size: Optional[int] = None) → PageIterator[MembershipsPaginatedList]¶

Return all organization memberships in the given organization.

See https://benchling.com/api/reference#/Organizations/listOrganizationMemberships

update_membership(organization_id: str, user_id: str, membership: MembershipUpdate) → Membership¶

Update organization membership by user ID and organization ID.

See https://benchling.com/api/reference#/Organizations/updateOrganizationMembership