Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Common.Api.Groups.GroupsApi Class Reference
Inheritance diagram for Beamable.Common.Api.Groups.GroupsApi:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.Api.Groups.GroupsApi:
Collaboration graph
[legend]

Public Member Functions

 GroupsApi (IUserContext ctx, IBeamableRequester requester)
 
Promise< GroupUserGetUser (long gamerTag)
 Get the GroupUser for a player, which contains all the group metadata the player belongs to. Use the GetGroup method to resolve the full group data. More...
 
Promise< GroupGetGroup (long groupId)
 Get the Group data for some group. The resulting Group structure will be personalized for the current player making the call. More...
 
Promise< EmptyResponseDisbandGroup (long group)
 Disbanding a group will delete the group data from Beamable. This method can only be called by an admin, from a microservice, or by the group Leader that has the Group.canDisband permission. More...
 
Promise< GroupMembershipResponseLeaveGroup (long group)
 Remove the current player from a group. After a player leaves, the group will no longer appear in the GetUser method response. More...
 
Promise< GroupMembershipResponseJoinGroup (long group)
 Add the current player to a group. A player can only join a group when the group's Group.enrollmentType is set to "open". A player can only be in one group at a time. If the player is already in a group, they must use the LeaveGroup method before they can join a new group. More...
 
Promise< EmptyResponsePetition (long group)
 This will be removed in a future version of Beamable. Please do not use. More...
 
Promise< GroupSearchResponseGetRecommendations ()
 This will be removed in a future version of Beamable. Please do not use. More...
 
Promise< GroupSearchResponseSearch (string name=null, List< string > enrollmentTypes=null, bool? hasSlots=null, long? scoreMin=null, long? scoreMax=null, string sortField=null, int? sortValue=null, int? offset=null, int? limit=null)
 Get a list of Groups that match some criteria. The resulting Group structures will not be personalized to the current player, and as such, the various permission fields should not be trusted. More...
 
Promise< GroupCreateResponseCreateGroup (GroupCreateRequest request)
 Create a new group. The current player will become the group Leader for the new group. More...
 
Promise< AvailabilityResponseCheckAvailability (string name, string tag)
 Check if the given name and tag are available to be used. Names and tags are required to be unique, so if another group is already using the name or tag given to the CreateGroup or SetGroupProps methods, those requests will fail. More...
 
Promise< EmptyResponseSetGroupProps (long groupId, GroupUpdateProperties props)
 Update the group's data. Only the group Leader can update group data. More...
 
Promise< GroupMembershipResponseKick (long group, long gamerTag)
 A Member can be kicked from the group if the current player's Member.canKick field is true. The group Leader and all Officers can kick regular group members. Once a member is kicked, they will no longer be a member. More...
 
Promise< EmptyResponseSetRole (long group, long gamerTag, string role)
 Set a player's role within a group. Valid roles are "leader", "officer", or an empty string. A group can only have 1 Leader, and the request will fail if the SetRole operation would result in 0 group Leaders. A group can have arbitrary many Officers. This method can be used to change the group Leader. The existing group Leader must call this method and assign a different user the role of "leader". The player that is running this method must have sufficient permissions to grant the role. More...
 
Promise< EmptyResponseMakeDonationRequest (long group, Currency currency)
 Send a request to the rest of the group to request an amount Currency. Other members in the group may decide to donate their personal currency to the requester by calling the Donate method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". After a player makes a donation request, they must wait some number seconds (as configured in the donations.default) before making a new request. More...
 
Promise< EmptyResponseDonate (long group, long recipientId, long amount, bool autoClaim=true)
 Send an amount of player currency to fulfil a pending donation request. Members of a group can request currency by running the MakeDonationRequest method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". More...
 
Promise< EmptyResponseClaimDonations (long group)
 If a player has requested a donation with the MakeDonationRequest method, and other players have donated with the Donate method without autoClaim enabled, then this method must be called by the original player to complete the donation. More...
 
string AddQuery (string query, string key, string value)
 This will be removed in a future version of Beamable. Please do not use. More...
 
virtual Promise< GroupsViewGetCurrent (string scope="")
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< GroupsView >
Promise< TData > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 

Properties

IUserContext Ctx [get]
 
IBeamableRequester Requester [get]
 

Member Function Documentation

◆ AddQuery()

string Beamable.Common.Api.Groups.GroupsApi.AddQuery ( string  query,
string  key,
string  value 
)
inline

This will be removed in a future version of Beamable. Please do not use.

Parameters
query
key
value
Returns

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ CheckAvailability()

Promise< AvailabilityResponse > Beamable.Common.Api.Groups.GroupsApi.CheckAvailability ( string  name,
string  tag 
)
inline

Check if the given name and tag are available to be used. Names and tags are required to be unique, so if another group is already using the name or tag given to the CreateGroup or SetGroupProps methods, those requests will fail.

Parameters
nameThe name to check if other groups are using yet.
tagThe tag to check if other groups are using yet.
Returns
A Promise<T> containing a AvailabilityResponse that has information about the name and tag's availability.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ ClaimDonations()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.ClaimDonations ( long  group)
inline

If a player has requested a donation with the MakeDonationRequest method, and other players have donated with the Donate method without autoClaim enabled, then this method must be called by the original player to complete the donation.

This method will claim all outstanding donations for the current player. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default".

Parameters
groupthe group id.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ CreateGroup()

Promise< GroupCreateResponse > Beamable.Common.Api.Groups.GroupsApi.CreateGroup ( GroupCreateRequest  request)
inline

Create a new group. The current player will become the group Leader for the new group.

Parameters
requestThe GroupCreateRequest that will be used to seed the initial properties of the group.
Returns
A Promise<T> containing the GroupCreateResponse information the resulting group, including the see GroupMetaData.id

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ DisbandGroup()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.DisbandGroup ( long  group)
inline

Disbanding a group will delete the group data from Beamable. This method can only be called by an admin, from a microservice, or by the group Leader that has the Group.canDisband permission.

Parameters
groupThe group id to disband.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ Donate()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.Donate ( long  group,
long  recipientId,
long  amount,
bool  autoClaim = true 
)
inline

Send an amount of player currency to fulfil a pending donation request. Members of a group can request currency by running the MakeDonationRequest method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default".

Parameters
groupThe group id
recipientIdThe gamertag of the player that is asking for a donation.
amountThe amount of currency to donate to the player.
autoClaimWhen true, the currency will automatically be transferred into the recipient's inventory. When false, the recipient will need to call ClaimDonations. However, the currency will leave the sender's inventory immediately.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ GetGroup()

Promise< Group > Beamable.Common.Api.Groups.GroupsApi.GetGroup ( long  groupId)
inline

Get the Group data for some group. The resulting Group structure will be personalized for the current player making the call.

Parameters
groupIdThe id of a group. The group id can be found with the GetUser or Search methods.
Returns
A Promise<T> containing the Group data

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ GetRecommendations()

Promise< GroupSearchResponse > Beamable.Common.Api.Groups.GroupsApi.GetRecommendations ( )
inline

This will be removed in a future version of Beamable. Please do not use.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ GetUser()

Promise< GroupUser > Beamable.Common.Api.Groups.GroupsApi.GetUser ( long  gamerTag)
inline

Get the GroupUser for a player, which contains all the group metadata the player belongs to. Use the GetGroup method to resolve the full group data.

Parameters
gamerTagThe gamertag of a player
Returns
A Promise<T> containing the player's GroupUser data

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ JoinGroup()

Promise< GroupMembershipResponse > Beamable.Common.Api.Groups.GroupsApi.JoinGroup ( long  group)
inline

Add the current player to a group. A player can only join a group when the group's Group.enrollmentType is set to "open". A player can only be in one group at a time. If the player is already in a group, they must use the LeaveGroup method before they can join a new group.

Parameters
groupThe group id to join
Returns
A Promise<T> containing a GroupMembershipResponse to check that the Join operation occurred correctly.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ Kick()

Promise< GroupMembershipResponse > Beamable.Common.Api.Groups.GroupsApi.Kick ( long  group,
long  gamerTag 
)
inline

A Member can be kicked from the group if the current player's Member.canKick field is true. The group Leader and all Officers can kick regular group members. Once a member is kicked, they will no longer be a member.

Parameters
groupThe group id to kick the member from.
gamerTagThe gamertag of the member to kick from the group.
Returns
A Promise<T> containing a GroupMembershipResponse to check that the Kick operation occurred correctly.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ LeaveGroup()

Promise< GroupMembershipResponse > Beamable.Common.Api.Groups.GroupsApi.LeaveGroup ( long  group)
inline

Remove the current player from a group. After a player leaves, the group will no longer appear in the GetUser method response.

Parameters
groupThe group id to leave
Returns
A Promise<T> containing a GroupMembershipResponse to check that the Leave operation occurred correctly.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ MakeDonationRequest()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.MakeDonationRequest ( long  group,
Currency  currency 
)
inline

Send a request to the rest of the group to request an amount Currency. Other members in the group may decide to donate their personal currency to the requester by calling the Donate method. The status of donations can be observed in the Group.donations list. ATTENTION! For group donations to work, you must configure a GroupDonationsContent content object called "default". After a player makes a donation request, they must wait some number seconds (as configured in the donations.default) before making a new request.

Parameters
groupThe group id
currencyA Currency structure to describe what type of donation the player is requesting.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ Petition()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.Petition ( long  group)
inline

This will be removed in a future version of Beamable. Please do not use.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ Search()

Promise< GroupSearchResponse > Beamable.Common.Api.Groups.GroupsApi.Search ( string  name = null,
List< string >  enrollmentTypes = null,
bool?  hasSlots = null,
long?  scoreMin = null,
long?  scoreMax = null,
string  sortField = null,
int?  sortValue = null,
int?  offset = null,
int?  limit = null 
)
inline

Get a list of Groups that match some criteria. The resulting Group structures will not be personalized to the current player, and as such, the various permission fields should not be trusted.

Parameters
nameAn optional group name. This text will be a fuzzy text match
enrollmentTypesvalid values include "open", "closed", and "restricted".
hasSlotsBy default, will be true. When true, only search for groups that still have room left for new members to join.
scoreMinThis will be removed in a future version of Beamable.
scoreMaxThis will be removed in a future version of Beamable.
sortFieldSort the resulting groups on a particular field name. When this field is used, you must also specify a sortValue
sortValueUse a positive number to sort the resulting groups from highest to lowest. Use a negative number to sort the resulting groups from lowest to highest. When this field is used, you must also specify a sortField
offsetThe number of resulting groups to skip in the response. This can be used with limit to page the groups.
limitThe maximum number of resulting groups for the response. This can be used with the offset to page the groups.
Returns

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ SetGroupProps()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.SetGroupProps ( long  groupId,
GroupUpdateProperties  props 
)
inline

Update the group's data. Only the group Leader can update group data.

Parameters
groupIdThe id of the group to update
propsA GroupUpdateProperties structure that contains the data to update. The update can be partial. Any fields that are null will not cause updates.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.

◆ SetRole()

Promise< EmptyResponse > Beamable.Common.Api.Groups.GroupsApi.SetRole ( long  group,
long  gamerTag,
string  role 
)
inline

Set a player's role within a group. Valid roles are "leader", "officer", or an empty string. A group can only have 1 Leader, and the request will fail if the SetRole operation would result in 0 group Leaders. A group can have arbitrary many Officers. This method can be used to change the group Leader. The existing group Leader must call this method and assign a different user the role of "leader". The player that is running this method must have sufficient permissions to grant the role.

Parameters
groupThe group id
gamerTagthe gamertag of the player whose role will be changed.
roleThe role to assign the player to. Valid options are "leader", "officer", or ""
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Groups.IGroupsApi.


The documentation for this class was generated from the following file: