Package com.podio.space
Class SpaceAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.space.SpaceAPI
-
public class SpaceAPI extends BaseAPI
-
-
Constructor Summary
Constructors Constructor Description SpaceAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSpaceMembers(int spaceId, SpaceMemberAdd spaceMemberAdd)Adds a list of users (either through user_id or email) to the space.SpaceCreateResponsecreateSpace(SpaceCreate data)Add a new space to an organization.voidendSpaceMembership(int spaceId, int userId)Ends the users membership on the space, can also be called for members in state invited.List<SpaceMember>getActiveMembers(int spaceId)Returns the active members of the given space.List<SpaceMemberV2>getActiveMembersV2(int spaceId, int offset, int limit)Returns the active members of the given space ("v2").List<SpaceMemberV2>getActiveMembersV2(int spaceId, Map<String,String> options)Returns the active members of the given space ("v2").List<SpaceMember>getEndedMembers(int spaceId)Returns a list of the members that have been removed from the space.SpacegetSpace(int spaceId)Get the space with the given idSpaceWithOrganizationgetSpaceByURL(String url)Returns the space and organization with the given full URL.SpaceMembergetSpaceMembership(int spaceId, int userId)Used to get the details of an active users membership of a space.List<SpaceWithOrganization>getTopSpaces(Integer limit)Returns the top spaces for the uservoidupdateSpace(int spaceId, SpaceUpdate data)Updates the space with the given idvoidupdateSpaceMembership(int spaceId, int userId, Role role)Updates a space membership with another role-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
SpaceAPI
public SpaceAPI(ResourceFactory resourceFactory)
-
-
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 updatedata- 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 spacespaceMemberAdd- 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 spaceuserId- 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 spaceuserId- The id of the userrole- 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 spaceuserId- 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 spaceoffset- The offset into the user listlimit- 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 spaceoptions- 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
-
-