Class SpaceSystem
Defined in File SpaceSystem.h
Inheritance Relationships
Base Type
public csp::systems::SystemBase
(Class SystemBase)
Class Documentation
-
class SpaceSystem : public csp::systems::SystemBase
Public facing system that allows interfacing with Magnopus Connected Services’ concept of a Group.
Offers methods for creating, deleting and joining spaces.
Helper Functions
-
void EnterSpace(const csp::common::String &SpaceId, NullResultCallback Callback)
Enter a space if you have permission to, based on the Space settings.
This includes setting scopes (and toggling event listening in order to set the scope). It also retrieves all entities in the space. Ensure Connect is called prior to this.
- Parameters
Space – Space : space to enter into
Callback – EnterSpaceResultCallback : callback when asynchronous task finishes
-
void ExitSpace(NullResultCallback Callback)
Exits the space and deregisters from the space scope.
Asynchronous Calls
These are methods that perform WebClient calls and therefore operate asynchronously and require a callback to be passed for a completion result
-
void CreateSpace(const csp::common::String &Name, const csp::common::String &Description, SpaceAttributes Attributes, const csp::common::Optional<InviteUserRoleInfoCollection> &InviteUsers, const csp::common::Map<csp::common::String, csp::common::String> &Metadata, const csp::common::Optional<csp::systems::FileAssetDataSource> &FileThumbnail, const csp::common::Optional<csp::common::Array<csp::common::String>> &Tags, SpaceResultCallback Callback)
Creates a new space.
- Parameters
Name – csp::common::String : name for the new space
Description – csp::common::String : description for the new space
Type – csp::systems::SpaceType : type of the new space
InviteUsers – csp::common::Optional<InviteUserRoleInfoCollection> : Collection containing the email link URL and the users to invite with their emails and roles
Metadata – csp::common::String : metadata information for the new space
FileThumbnail – csp::systems::FileAssetDataSource : optional thumbnail image for the new space
Tags – csp::common::Array<csp::common::String : optional array of strings to set the metadata tags for the new space
Callback – csp::systems::SpaceResultCallback : callback when asynchronous task finishes
-
void CreateSpaceWithBuffer(const csp::common::String &Name, const csp::common::String &Description, SpaceAttributes Attributes, const csp::common::Optional<InviteUserRoleInfoCollection> &InviteUsers, const csp::common::Map<csp::common::String, csp::common::String> &Metadata, const csp::systems::BufferAssetDataSource &Thumbnail, const csp::common::Optional<csp::common::Array<csp::common::String>> &Tags, SpaceResultCallback Callback)
Creates a new space Using BufferAssetDataSource.
- Parameters
Name – csp::common::String : name for the new space
Description – csp::common::String : description for the new space
Type – csp::systems::SpaceType : type of the new space
InviteUsers – csp::common::Optional<InviteUserRoleInfoCollection> : Collection containing the email link URL and the users to invite with their emails and roles
Metadata – csp::common::String : metadata information for the new space
Thumbnail – csp::systems::BufferAssetDataSource : thumbnail image buffer for the new space
Tags – csp::common::Array<csp::common::String : optional array of strings to set the metadata tags for the new space
Callback – csp::systems::SpaceResultCallback : callback when asynchronous task finishes
-
void UpdateSpace(const csp::common::String &SpaceId, const csp::common::Optional<csp::common::String> &Name, const csp::common::Optional<csp::common::String> &Description, const csp::common::Optional<SpaceAttributes> &Type, BasicSpaceResultCallback Callback)
Updates the name and/or the description of a Space.
- Parameters
Name – csp::common::Optional<csp::common::String> : if a new name is provided it will be used to update the Space name
Description – csp::common::Optional<csp::common::String> : if a new description is provided it will be used to update the Space description
Type – csp::common::Optional<csp::systems::SpaceType> : if a new type is provided it will be used to update the Space type
Callback – BasicSpaceResultCallback : callback when asynchronous task finishes
-
void DeleteSpace(const csp::common::String &SpaceId, NullResultCallback Callback)
Deletes a given space and the corresponding UserService group.
- Parameters
Space – Space : space to delete
Callback – NullResultCallback : callback when asynchronous task finishes
-
void GetSpaces(SpacesResultCallback Callback)
Retrieves all spaces corresponding to the currently logged in user.
- Parameters
Callback – SpacesResultCallback : callback when asynchronous task finishes
-
void GetSpacesByAttributes(const csp::common::Optional<bool> &IsDiscoverable, const csp::common::Optional<bool> &IsArchived, const csp::common::Optional<bool> &RequiresInvite, const csp::common::Optional<int> &ResultsSkip, const csp::common::Optional<int> &ResultsMax, BasicSpacesResultCallback Callback)
Retrieves basic space details for the spaces with the given attributes available to the logged in user.
Results pagination is supported through the use of ResultsSkip and ResultsMax.
- Parameters
IsDiscoverable – csp::common::Optional<bool> :
true
orfalse
to filter by IsDiscoverable attribute value.IsArchived – csp::common::Optional<bool> :
true
orfalse
to filter by IsArchived attribute value.RequiresInvite – csp::common::Optional<bool> :
true
orfalse
to filter by RequiresInvite attribute value.ResultsSkip – csp::common::Optional<int> : number of result entries that will be skipped from the result. For no skip pass nullptr.
ResultsMax – csp::common::Optional<int> : maximum number of result entries to be retrieved. For all available result entries pass nullptr.
Callback – SpacesResultCallback : callback when asynchronous task finishes
-
void GetSpacesByIds(const csp::common::Array<csp::common::String> &RequestedSpaceIDs, SpacesResultCallback Callback)
Retrieves space details corresponding to the provided Space IDs.
- Parameters
RequestedSpaceIDs – csp::common::Array<csp::common::String> : array of Space IDs for which the space details will be retrieved
Callback – SpacesResultCallback : callback when asynchronous task finishes
-
void GetSpacesForUserId(const csp::common::String &UserId, SpacesResultCallback Callback)
Retrieves all spaces corresponding to the provided user ID.
- Parameters
UserId – csp::common::String : unique ID of user
Callback – SpacesResultCallback : callback when asynchronous task finishes
-
void GetSpace(const csp::common::String &SpaceId, SpaceResultCallback Callback)
Retrieves a space by its unique ID.
- Parameters
SpaceId – csp::common::String : unique ID of Space
Callback – SpaceResultCallback : callback when asynchronous task finishes
-
void InviteToSpace(const csp::common::String &SpaceId, const csp::common::String &Email, const csp::common::Optional<bool> &IsModeratorRole, const csp::common::Optional<csp::common::String> &EmailLinkUrl, const csp::common::Optional<csp::common::String> &SignupUrl, NullResultCallback Callback)
Invites a given email to a specific space.
- Parameters
Space – Space : space to invite to
Email – csp::common::String : email to invite to space
IsModeratorRole – csp::common::Optional<bool> : if present and true sets the user’s role in the space to “Moderator”, pass false or nullptr to leave role as default
EmailLinkUrl – csp::common::Optional<csp::common::String> : link that will be provided in the invite email
SignupUrl – csp::common::Optional<csp::common::String> : destination link that will be provided in the invite email
Callback – NullResultCallback : callback when asynchronous task finishes
-
void BulkInviteToSpace(const csp::common::String &SpaceId, const InviteUserRoleInfoCollection &InviteUsers, NullResultCallback Callback)
Invites all the given emails to a specific space.
- Parameters
Space – Space : space to invite to
InviteUsers – InviteUserRoleInfoCollection : Collection containing the email link URL and the users to invite with their emails and roles
Callback – NullResultCallback : callback when asynchronous task finishes
-
void GetPendingUserInvites(const csp::common::String &SpaceId, PendingInvitesResultCallback Callback)
Returns an array of obfuscated email addresses, addresses of users that have not yet accepted the space invite.
-
void RemoveUserFromSpace(const csp::common::String &SpaceId, const csp::common::String &UserId, NullResultCallback Callback)
Removes a user from a space by the user’s unique ID.
- Parameters
Space – Space : space to remove user from
UserId – csp::common::String : unique ID of user
Callback – NullResultCallback : callback when asynchronous task finishes
-
void AddUserToSpace(const csp::common::String &SpaceId, const csp::common::String &UserId, SpaceResultCallback Callback)
Adds a user to a space by the user’s unique ID.
- Parameters
Space – Space : space to add user to
UserId – csp::common::String : unique ID of user
Callback – SpaceResultCallback : callback when asynchronous task finishes
-
void AddSiteInfo(const csp::common::String &SpaceId, Site &SiteInfo, SiteResultCallback Callback)
Creates new Site information and associates it with the Space.
-
void RemoveSiteInfo(const csp::common::String &SpaceId, Site &SiteInfo, NullResultCallback Callback)
-
void GetSitesInfo(const csp::common::String &SpaceId, SitesCollectionResultCallback Callback)
Retrieves the Sites information associated with a Space.
-
void UpdateUserRole(const csp::common::String &SpaceId, const UserRoleInfo &NewUserRoleInfo, NullResultCallback Callback)
Updates the space role for a particular user.
- Parameters
Space – Space : The space that the requested user is part of
NewUserRoleInfo – UserRoleInfo : New user role information containing the new role for the specified user
Callback – NullResultCallback : callback when asynchronous task finishes
-
void GetUsersRoles(const csp::common::String &SpaceId, const csp::common::Array<csp::common::String> &RequestedUserIds, UserRoleCollectionCallback Callback)
Retrieves the User role information for the User Ids that have been passed in.
- Parameters
Space – Space : Space for which the User Roles will be retrieved
RequestedUserIds – csp::common::Array<csp::common::String> : Array of User Ids for which the User Roles will be retrieved
Callback – UserRoleCollectionCallback : callback when asynchronous task finishes
-
void UpdateSpaceMetadata(const csp::common::String &SpaceId, const csp::common::Map<csp::common::String, csp::common::String> &NewMetadata, const csp::common::Optional<csp::common::Array<csp::common::String>> &Tags, NullResultCallback Callback)
Updates the Space metadata information with the new one provided.
- Parameters
SpaceId – csp::common::String : ID of Space for which the metadata will be updated
NewMetadata – csp::common::String : New metadata information that will replace the previous one
Tags – csp::common::Array<csp::common::String> : Array of strings that will replace the tags on the space. If unset, the existing tags on the AssetCollection will be unmodified.
Callback – NullResultCallback : callback when asynchronous task finishes
-
void GetSpacesMetadata(const csp::common::Array<csp::common::String> &Spaces, SpacesMetadataResultCallback Callback)
Retrieves Spaces metadata information.
- Parameters
Spaces – csp::common::Array<Space> : Spaces for which metadata will be retrieved
Callback – SpacesMetadataResultCallback : callback when asynchronous task finishes
-
void GetSpaceMetadata(const csp::common::String &SpaceId, SpaceMetadataResultCallback Callback)
Retrieves the Space metadata information.
-
void UpdateSpaceThumbnail(const csp::common::String &SpaceId, const csp::systems::FileAssetDataSource &NewThumbnail, NullResultCallback Callback)
Updates the Space thumbnail image or adds one if it didn’t have it previously using FileAssetDataSource.
- Parameters
Space – Space : Space for which the thumbnail will be updated
NewThumbnail – csp::systems::FileAssetDataSource : New thumbnail information
Callback – NullResultCallback : callback when asynchronous task finishes
-
void UpdateSpaceThumbnailWithBuffer(const csp::common::String &SpaceId, const csp::systems::BufferAssetDataSource &NewThumbnail, NullResultCallback Callback)
Updates the Space thumbnail image or adds one if it didn’t have it previously using BufferAssetDataSource.
- Parameters
Space – Space : Space for which the thumbnail will be updated
NewThumbnail – csp::systems::BufferAssetDataSource : New thumbnail information
Callback – NullResultCallback : callback when asynchronous task finishes
-
void GetSpaceThumbnail(const csp::common::String &SpaceId, UriResultCallback Callback)
Retrieves the space thumbnail information associated with the space If the space does not have a thumbnail associated with it the result callback will be successful, the HTTP res code will be ResponseNotFound and the Uri field inside the UriResult will be empty.
-
void AddUserToSpaceBanList(const csp::common::String &SpaceId, const csp::common::String &RequestedUserId, NullResultCallback Callback)
Adds user to group banned list.
Banned list can be retrieved from the space
- Parameters
RequestedUserId – csp::common::String : User id to be banned from the space
Callback – NullResultCallback : callback when asynchronous task finishes
-
void DeleteUserFromSpaceBanList(const csp::common::String &SpaceId, const csp::common::String &RequestedUserId, NullResultCallback Callback)
Deletes user from group banned list.
Banned list can be retrieved from the space
- Parameters
Space – Space : Space for which the Space for which the ban will be removed on
RequestedUserId – csp::common::String : User id to have ban removed from the space
Callback – NullResultCallback : callback when asynchronous task finishes
-
void UpdateSpaceGeoLocation(const csp::common::String &SpaceId, const csp::common::Optional<GeoLocation> &Location, const csp::common::Optional<float> &Orientation, const csp::common::Optional<csp::common::Array<GeoLocation>> &GeoFence, SpaceGeoLocationResultCallback Callback)
Add or update a GeoLocation for the space.
- Parameters
SpaceId – csp::common::String : Id of the space to udpate
Location – csp::common::Optional<GeoLocation> : The latitude and longitude of the geo location
Orientation – csp::common::Optional<double> : The compass direction the space points. Must be between 0 (north) and 360 (inclusive)
GeoFence – csp::common::Optional<csp::common::Array<GeoLocation>> : Array of points that creates a geo fence for the space. Must be in clockwise order and start and end with the same value.
Callback – SpaceGeoLocationResultCallback : callback when asynchronous task finishes
-
void GetSpaceGeoLocation(const csp::common::String &SpaceId, SpaceGeoLocationResultCallback Callback)
Get the geo location details for the given space id.
- Parameters
SpaceId – csp::common::String : Id of the space
Callback – NullResultCallback : callback when asynchronous task finishes
-
void DeleteSpaceGeoLocation(const csp::common::String &SpaceId, NullResultCallback Callback)
Delete the geo location information of the space.
- Parameters
SpaceId – csp::common::String : Id of the space to be udpated
Callback – NullResultCallback : callback when asynchronous task finishes
-
void DuplicateSpace(const csp::common::String &SpaceId, const csp::common::String &NewName, SpaceAttributes NewAttributes, const csp::common::Optional<csp::common::Array<csp::common::String>> &MemberGroupIds, bool ShallowCopy, SpaceResultCallback Callback)
Duplicate an existing space and assign it to the current user.
- Parameters
SpaceId – csp::common::String : Id of the space to duplicate.
NewName – csp::common::String : A unique name for the duplicated space.
NewAttributes – csp::systems::SpaceAttributes : Attributes to apply to the duplicated space.
MemberGroupIds – csp::common::Array<csp::common::String> : An optional array of group (space) IDs to copy users from.
ShallowCopy – bool : If true, the duplicated space will reference the assets of the original space. Otherwise, all assets will be duplicated.
Callback – NullResultCallback : callback when asynchronous task finishes
-
void EnterSpace(const csp::common::String &SpaceId, NullResultCallback Callback)