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

Public Member Functions

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...
 
- 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...
 

Member Function Documentation

◆ AddQuery()

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

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

Parameters
query
key
value
Returns

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ CheckAvailability()

Promise< AvailabilityResponse > Beamable.Common.Api.Groups.IGroupsApi.CheckAvailability ( 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.

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ ClaimDonations()

Promise< EmptyResponse > Beamable.Common.Api.Groups.IGroupsApi.ClaimDonations ( 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.

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ CreateGroup()

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

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ DisbandGroup()

Promise< EmptyResponse > Beamable.Common.Api.Groups.IGroupsApi.DisbandGroup ( 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.

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ Donate()

Promise< EmptyResponse > Beamable.Common.Api.Groups.IGroupsApi.Donate ( 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".

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ GetGroup()

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

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ GetRecommendations()

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

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ GetUser()

Promise< GroupUser > Beamable.Common.Api.Groups.IGroupsApi.GetUser ( 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.

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ JoinGroup()

Promise< GroupMembershipResponse > Beamable.Common.Api.Groups.IGroupsApi.JoinGroup ( 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.

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ Kick()

Promise< GroupMembershipResponse > Beamable.Common.Api.Groups.IGroupsApi.Kick ( 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.

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ LeaveGroup()

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

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ MakeDonationRequest()

Promise< EmptyResponse > Beamable.Common.Api.Groups.IGroupsApi.MakeDonationRequest ( 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.

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ Petition()

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

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ Search()

Promise< GroupSearchResponse > Beamable.Common.Api.Groups.IGroupsApi.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 
)

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

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ SetGroupProps()

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

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.

◆ SetRole()

Promise< EmptyResponse > Beamable.Common.Api.Groups.IGroupsApi.SetRole ( 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.

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.

Implemented in Beamable.Common.Api.Groups.GroupsApi.


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