GroupsModule
public class GroupsModule
Undocumented
-
Initializer
Declaration
Swift
public init(boxClient: BoxClient)Parameters
boxClientRequired for communicating with Box
-
Retrieves a specified Group.
Declaration
Parameters
groupIdThe Id of the Group to retrieve.
fieldsComma-separated list of fields to include in the response.
completionReturns 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
nameThe name specifier for the new Group to create.
provenanceUsed to track the external source where the group is coming from
externalSyncIdentifierUsed as a group identifier for groups coming from an external source.
descriptionDescription of the Group
invitabilityLevelSpecifies who can invite this Group to folders.
memberViewabilityLevelSpecifies who can view the members of this Group.
fieldsComma-separated list of fields to include in the response.
completionReturns 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
groupIdThe id of the Group to update info for.
nameThe name specifier to update the specified Group with.
provenanceUsed to track the external source where the group is coming from
externalSyncIdentifierUsed as a group identifier for groups coming from an external source.
descriptionDescription of the Group
invitabilityLevelSpecifies who can invite this Group to folders.
memberViewabilityLevelSpecifies who can view the members of this Group.
fieldsComma-separated list of fields to include in the response.
completionReturns a full Group object or an error.
-
Deletes the specified Group.
Declaration
Swift
public func delete( groupId: String, completion: @escaping Callback<Void> )Parameters
groupIdThe ID of the Group to delete.
completionAn 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 ) -> PaginationIterator<Group>Parameters
nameOnly return groups whose name contains the given string (case insensitive).
offsetThe offset of the item at which to begin the response.
limitThe maximum number of items to return. The default is 100 and the maximum is 1,000.
fieldsComma-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
membershipIdThe Id of the Group Membership to retrieve.
fieldsComma-separated list of fields to include in the response.
completionReturns 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
userIdThe Id of the user to add to the Group.
groupIdThe Id of the group to add the user to.
roleThe role of the user within the group. Defaults to
member
. Can be set toadmin
.configurablePermissionThe set of permissions allowed to the admin of the group.
fieldsComma-separated list of fields to include in the response.
completionReturns 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
membershipIdThe ID of the Group Membership to update.
roleThe role of the user within the group. Defaults to
member
. Can be set toadmin
.configurablePermissionThe set of permissions allowed to the admin of the group.
fieldsComma-separated list of fields to include in the response.
completionReturns 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
membershipIdThe ID of the Group Membership to delete.
completionAn 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 ) -> PaginationIterator<GroupMembership>Parameters
groupIdThe ID of the group to return memberships for.
offsetThe offset of the item at which to begin the response.
limitThe maximum number of items to return. The default is 100 and the maximum is 1,000.
fieldsComma-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 ) -> PaginationIterator<GroupMembership>Parameters
userIdThe ID of the User to retrieve collaborations for.
offsetThe offset of the item at which to begin the response.
limitThe maximum number of items to return. The default is 100 and the maximum is 1,000.
fieldsComma-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 ) -> PaginationIterator<Collaboration>Parameters
groupIdThe ID of the Group to retrieve collaborations for.
offsetThe offset of the item at which to begin the response.
limitThe maximum number of items to return. The default is 100 and the maximum is 1,000.
fieldsComma-separated list of fields to include in the response.
GroupsModule Class Reference