GroupsModule
public class GroupsModule
Provides Group management
-
Retrieves a specified Group.
Declaration
Parameters
groupId
The Id of the Group to retrieve.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group object or an error.
-
create(name:
provenance: externalSyncIdentifier: description: invitabilityLevel: memberViewabilityLevel: fields: completion: ) Creates a new Group.
Declaration
Swift
public func create( name: String, provenance: String? = nil, externalSyncIdentifier: String? = nil, description: String? = nil, invitabilityLevel: GroupInvitabilityLevel? = nil, memberViewabilityLevel: GroupMemberViewabilityLevel? = nil, fields: [String]? = nil, completion: @escaping Callback<Group> )
Parameters
name
The name specifier for the new Group to create.
provenance
Used to track the external source where the group is coming from
externalSyncIdentifier
Used as a group identifier for groups coming from an external source.
description
Description of the Group
invitabilityLevel
Specifies who can invite this Group to folders.
memberViewabilityLevel
Specifies who can view the members of this Group.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group object or an error.
-
update(groupId:
name: provenance: externalSyncIdentifier: description: invitabilityLevel: memberViewabilityLevel: fields: completion: ) Updates the specified Group.
Declaration
Swift
public func update( groupId: String, name: String? = nil, provenance: NullableParameter<String>? = nil, externalSyncIdentifier: NullableParameter<String>? = nil, description: NullableParameter<String>? = nil, invitabilityLevel: GroupInvitabilityLevel? = nil, memberViewabilityLevel: GroupMemberViewabilityLevel? = nil, fields: [String]? = nil, completion: @escaping Callback<Group> )
Parameters
groupId
The id of the Group to update info for.
name
The name specifier to update the specified Group with.
provenance
Used to track the external source where the group is coming from
externalSyncIdentifier
Used as a group identifier for groups coming from an external source.
description
Description of the Group
invitabilityLevel
Specifies who can invite this Group to folders.
memberViewabilityLevel
Specifies who can view the members of this Group.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group object or an error.
-
Deletes the specified Group.
Declaration
Swift
public func delete( groupId: String, completion: @escaping Callback<Void> )
Parameters
groupId
The ID of the Group to delete.
completion
An empty response will be returned upon successful deletion.
-
Get all Groups for an enterprise.
Declaration
Swift
public func listForEnterprise( name: String? = nil, offset: Int? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PagingIterator<Group>
Parameters
name
Only return groups whose name contains the given string (case insensitive).
offset
The offset of the item at which to begin the response.
limit
The maximum number of items to return. The default is 100 and the maximum is 1,000.
fields
Comma-separated list of fields to include in the response.
-
Retrieves a specified Group Membership.
Declaration
Swift
public func getMembershipInfo( membershipId: String, fields: [String]? = nil, completion: @escaping Callback<GroupMembership> )
Parameters
membershipId
The Id of the Group Membership to retrieve.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group Membership object or an error.
-
Creates a Group Membership.
Declaration
Swift
public func createMembership( userId: String, groupId: String, role: GroupRole? = nil, configurablePermission: NullableParameter<ConfigurablePermissionData>? = nil, fields: [String]? = nil, completion: @escaping Callback<GroupMembership> )
Parameters
userId
The Id of the user to add to the Group.
groupId
The Id of the group to add the user to.
role
The role of the user within the group. Defaults to “member”. Can be set to “admin”.
configurablePermission
The set of permissions allowed to the admin of the group.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group Membership object or an error.
-
Updates the specified Group Membership.
Declaration
Swift
public func updateMembership( membershipId: String, role: GroupRole? = nil, configurablePermission: NullableParameter<ConfigurablePermissionData>? = nil, fields: [String]? = nil, completion: @escaping Callback<GroupMembership> )
Parameters
membershipId
The ID of the Group Membership to update.
role
The role of the user within the group. Defaults to “member”. Can be set to “admin”.
configurablePermission
The set of permissions allowed to the admin of the group.
fields
Comma-separated list of fields to include in the response.
completion
Returns a full Group Membership object or an error.
-
Deletes the specified Group Membership.
Declaration
Swift
public func deleteMembership( membershipId: String, completion: @escaping Callback<Void> )
Parameters
membershipId
The ID of the Group Membership to delete.
completion
An empty response will be returned upon successful deletion.
-
Get all Memberships for a specified Group.
Declaration
Swift
public func listMemberships( groupId: String, offset: Int? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PagingIterator<GroupMembership>
Parameters
groupId
The ID of the group to return memberships for.
offset
The offset of the item at which to begin the response.
limit
The maximum number of items to return. The default is 100 and the maximum is 1,000.
fields
Comma-separated list of fields to include in the response.
-
Returns all of the group memberships for a given user. Note this is only available to group admins.
Declaration
Swift
public func listMembershipsForUser( userId: String, offset: Int? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PagingIterator<GroupMembership>
Parameters
userId
The ID of the User to retrieve collaborations for.
offset
The offset of the item at which to begin the response.
limit
The maximum number of items to return. The default is 100 and the maximum is 1,000.
fields
Comma-separated list of fields to include in the response.
-
Returns all of the group collaborations for a given group. Note this is only available to group admins.
Declaration
Swift
public func listCollaborations( groupId: String, offset: Int? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PagingIterator<Collaboration>
Parameters
groupId
The ID of the Group to retrieve collaborations for.
offset
The offset of the item at which to begin the response.
limit
The maximum number of items to return. The default is 100 and the maximum is 1,000.
fields
Comma-separated list of fields to include in the response.