Class SpaceAPI


  • public class SpaceAPI
    extends BaseAPI
    • Method Detail

      • createSpace

        public SpaceCreateResponse createSpace​(SpaceCreate data)
        Add a new space to an organization.
        Parameters:
        data - The data for the new space
        Returns:
        The data about the new created space
      • getSpace

        public Space getSpace​(int spaceId)
        Get the space with the given id
        Parameters:
        spaceId - The id of the space
        Returns:
        The space with the given id
      • updateSpace

        public void updateSpace​(int spaceId,
                                SpaceUpdate data)
        Updates the space with the given id
        Parameters:
        spaceId - The id of the space to update
        data - The updated data of the space
      • getSpaceByURL

        public SpaceWithOrganization getSpaceByURL​(String url)
        Returns the space and organization with the given full URL.
        Parameters:
        url - The full URL of the space
        Returns:
        The space with organization
      • addSpaceMembers

        public void addSpaceMembers​(int spaceId,
                                    SpaceMemberAdd spaceMemberAdd)
        Adds a list of users (either through user_id or email) to the space.
        Parameters:
        spaceId - The id of the space
        spaceMemberAdd - Information about the user(s) to add
      • getSpaceMembership

        public SpaceMember getSpaceMembership​(int spaceId,
                                              int userId)
        Used to get the details of an active users membership of a space.
        Parameters:
        spaceId - The id of the space
        userId - The ud of the user
        Returns:
        The details about the space membership
      • updateSpaceMembership

        public void updateSpaceMembership​(int spaceId,
                                          int userId,
                                          Role role)
        Updates a space membership with another role
        Parameters:
        spaceId - The id of the space
        userId - The id of the user
        role - The new role for the membership
      • endSpaceMembership

        public void endSpaceMembership​(int spaceId,
                                       int userId)
        Ends the users membership on the space, can also be called for members in state invited.
        Parameters:
        spaceId - The id of the space
        userId - The id of the user
      • getActiveMembers

        public List<SpaceMember> getActiveMembers​(int spaceId)
        Returns the active members of the given space.
        Parameters:
        spaceId - The id of the space
        Returns:
        The active members of the space
      • getActiveMembersV2

        public List<SpaceMemberV2> getActiveMembersV2​(int spaceId,
                                                      int offset,
                                                      int limit)
        Returns the active members of the given space ("v2").
        Parameters:
        spaceId - The id of the space
        offset - The offset into the user list
        limit - The number of results to return (max 500)
        Returns:
        The active members of the space
      • getActiveMembersV2

        public List<SpaceMemberV2> getActiveMembersV2​(int spaceId,
                                                      Map<String,​String> options)
        Returns the active members of the given space ("v2").
        Parameters:
        spaceId - The id of the space
        options - The parameters for get space members v2
        Returns:
        The active members of the space
      • getEndedMembers

        public List<SpaceMember> getEndedMembers​(int spaceId)
        Returns a list of the members that have been removed from the space.
        Parameters:
        spaceId - The id of the space
        Returns:
        The active members of the space
      • getTopSpaces

        public List<SpaceWithOrganization> getTopSpaces​(Integer limit)
        Returns the top spaces for the user
        Parameters:
        limit - The max number of members to return, defaults to 6
        Returns:
        The top spaces for the user