Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.playfab.PlayFabGroupsAPI Maven / Gradle / Ivy
Go to download
PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience.
package com.playfab;
import com.playfab.internal.*;
import com.playfab.PlayFabGroupsModels.*;
import com.playfab.PlayFabErrors.*;
import com.playfab.PlayFabSettings;
import java.util.concurrent.*;
import java.util.*;
import com.google.gson.*;
import com.google.gson.reflect.*;
/**
* The Groups API is designed for any permanent or semi-permanent collections of Entities (players, or non-players). If you
* want to make Guilds/Clans/Corporations/etc., then you should use groups. Groups can also be used to make chatrooms,
* parties, or any other persistent collection of entities.
*/
public class PlayFabGroupsAPI {
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();
/**
* Accepts an outstanding invitation to to join a group
* @param request AcceptGroupApplicationRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> AcceptGroupApplicationAsync(final AcceptGroupApplicationRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAcceptGroupApplicationAsync(request);
}
});
}
/**
* Accepts an outstanding invitation to to join a group
* @param request AcceptGroupApplicationRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult AcceptGroupApplication(final AcceptGroupApplicationRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAcceptGroupApplicationAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Accepts an outstanding invitation to to join a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateAcceptGroupApplicationAsync(final AcceptGroupApplicationRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/AcceptGroupApplication"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Accepts an invitation to join a group
* @param request AcceptGroupInvitationRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> AcceptGroupInvitationAsync(final AcceptGroupInvitationRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAcceptGroupInvitationAsync(request);
}
});
}
/**
* Accepts an invitation to join a group
* @param request AcceptGroupInvitationRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult AcceptGroupInvitation(final AcceptGroupInvitationRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAcceptGroupInvitationAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Accepts an invitation to join a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateAcceptGroupInvitationAsync(final AcceptGroupInvitationRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/AcceptGroupInvitation"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Adds members to a group or role.
* @param request AddMembersRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> AddMembersAsync(final AddMembersRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAddMembersAsync(request);
}
});
}
/**
* Adds members to a group or role.
* @param request AddMembersRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult AddMembers(final AddMembersRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateAddMembersAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Adds members to a group or role. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateAddMembersAsync(final AddMembersRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/AddMembers"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Applies to join a group
* @param request ApplyToGroupRequest
* @return Async Task will return ApplyToGroupResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ApplyToGroupAsync(final ApplyToGroupRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateApplyToGroupAsync(request);
}
});
}
/**
* Applies to join a group
* @param request ApplyToGroupRequest
* @return ApplyToGroupResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ApplyToGroup(final ApplyToGroupRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateApplyToGroupAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Applies to join a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateApplyToGroupAsync(final ApplyToGroupRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ApplyToGroup"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ApplyToGroupResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Blocks a list of entities from joining a group.
* @param request BlockEntityRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> BlockEntityAsync(final BlockEntityRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateBlockEntityAsync(request);
}
});
}
/**
* Blocks a list of entities from joining a group.
* @param request BlockEntityRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult BlockEntity(final BlockEntityRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateBlockEntityAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Blocks a list of entities from joining a group. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateBlockEntityAsync(final BlockEntityRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/BlockEntity"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Changes the role membership of a list of entities from one role to another.
* @param request ChangeMemberRoleRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ChangeMemberRoleAsync(final ChangeMemberRoleRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateChangeMemberRoleAsync(request);
}
});
}
/**
* Changes the role membership of a list of entities from one role to another.
* @param request ChangeMemberRoleRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ChangeMemberRole(final ChangeMemberRoleRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateChangeMemberRoleAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Changes the role membership of a list of entities from one role to another. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateChangeMemberRoleAsync(final ChangeMemberRoleRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ChangeMemberRole"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a new group.
* @param request CreateGroupRequest
* @return Async Task will return CreateGroupResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateGroupAsync(final CreateGroupRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateGroupAsync(request);
}
});
}
/**
* Creates a new group.
* @param request CreateGroupRequest
* @return CreateGroupResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateGroup(final CreateGroupRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateGroupAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Creates a new group. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateGroupAsync(final CreateGroupRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/CreateGroup"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
CreateGroupResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Creates a new group role.
* @param request CreateGroupRoleRequest
* @return Async Task will return CreateGroupRoleResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> CreateRoleAsync(final CreateGroupRoleRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateRoleAsync(request);
}
});
}
/**
* Creates a new group role.
* @param request CreateGroupRoleRequest
* @return CreateGroupRoleResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult CreateRole(final CreateGroupRoleRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateCreateRoleAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Creates a new group role. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateCreateRoleAsync(final CreateGroupRoleRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/CreateRole"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
CreateGroupRoleResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes a group and all roles, invitations, join requests, and blocks associated with it.
* @param request DeleteGroupRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteGroupAsync(final DeleteGroupRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteGroupAsync(request);
}
});
}
/**
* Deletes a group and all roles, invitations, join requests, and blocks associated with it.
* @param request DeleteGroupRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteGroup(final DeleteGroupRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteGroupAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Deletes a group and all roles, invitations, join requests, and blocks associated with it. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteGroupAsync(final DeleteGroupRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/DeleteGroup"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Deletes an existing role in a group.
* @param request DeleteRoleRequest
* @return Async Task will return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> DeleteRoleAsync(final DeleteRoleRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteRoleAsync(request);
}
});
}
/**
* Deletes an existing role in a group.
* @param request DeleteRoleRequest
* @return EmptyResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult DeleteRole(final DeleteRoleRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateDeleteRoleAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Deletes an existing role in a group. */
@SuppressWarnings("unchecked")
private static PlayFabResult privateDeleteRoleAsync(final DeleteRoleRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/DeleteRole"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
EmptyResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Gets information about a group and its roles
* @param request GetGroupRequest
* @return Async Task will return GetGroupResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> GetGroupAsync(final GetGroupRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateGetGroupAsync(request);
}
});
}
/**
* Gets information about a group and its roles
* @param request GetGroupRequest
* @return GetGroupResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult GetGroup(final GetGroupRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateGetGroupAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Gets information about a group and its roles */
@SuppressWarnings("unchecked")
private static PlayFabResult privateGetGroupAsync(final GetGroupRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/GetGroup"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
GetGroupResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Invites a player to join a group
* @param request InviteToGroupRequest
* @return Async Task will return InviteToGroupResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> InviteToGroupAsync(final InviteToGroupRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateInviteToGroupAsync(request);
}
});
}
/**
* Invites a player to join a group
* @param request InviteToGroupRequest
* @return InviteToGroupResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult InviteToGroup(final InviteToGroupRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateInviteToGroupAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Invites a player to join a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateInviteToGroupAsync(final InviteToGroupRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/InviteToGroup"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
InviteToGroupResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Checks to see if an entity is a member of a group or role within the group
* @param request IsMemberRequest
* @return Async Task will return IsMemberResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> IsMemberAsync(final IsMemberRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateIsMemberAsync(request);
}
});
}
/**
* Checks to see if an entity is a member of a group or role within the group
* @param request IsMemberRequest
* @return IsMemberResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult IsMember(final IsMemberRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateIsMemberAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Checks to see if an entity is a member of a group or role within the group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateIsMemberAsync(final IsMemberRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/IsMember"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
IsMemberResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Lists all outstanding requests to join a group
* @param request ListGroupApplicationsRequest
* @return Async Task will return ListGroupApplicationsResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ListGroupApplicationsAsync(final ListGroupApplicationsRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupApplicationsAsync(request);
}
});
}
/**
* Lists all outstanding requests to join a group
* @param request ListGroupApplicationsRequest
* @return ListGroupApplicationsResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ListGroupApplications(final ListGroupApplicationsRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupApplicationsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Lists all outstanding requests to join a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateListGroupApplicationsAsync(final ListGroupApplicationsRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ListGroupApplications"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ListGroupApplicationsResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Lists all entities blocked from joining a group
* @param request ListGroupBlocksRequest
* @return Async Task will return ListGroupBlocksResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ListGroupBlocksAsync(final ListGroupBlocksRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupBlocksAsync(request);
}
});
}
/**
* Lists all entities blocked from joining a group
* @param request ListGroupBlocksRequest
* @return ListGroupBlocksResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ListGroupBlocks(final ListGroupBlocksRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupBlocksAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Lists all entities blocked from joining a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateListGroupBlocksAsync(final ListGroupBlocksRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ListGroupBlocks"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ListGroupBlocksResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Lists all outstanding invitations for a group
* @param request ListGroupInvitationsRequest
* @return Async Task will return ListGroupInvitationsResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ListGroupInvitationsAsync(final ListGroupInvitationsRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupInvitationsAsync(request);
}
});
}
/**
* Lists all outstanding invitations for a group
* @param request ListGroupInvitationsRequest
* @return ListGroupInvitationsResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ListGroupInvitations(final ListGroupInvitationsRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupInvitationsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Lists all outstanding invitations for a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateListGroupInvitationsAsync(final ListGroupInvitationsRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ListGroupInvitations"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ListGroupInvitationsResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Lists all members for a group
* @param request ListGroupMembersRequest
* @return Async Task will return ListGroupMembersResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ListGroupMembersAsync(final ListGroupMembersRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupMembersAsync(request);
}
});
}
/**
* Lists all members for a group
* @param request ListGroupMembersRequest
* @return ListGroupMembersResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ListGroupMembers(final ListGroupMembersRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListGroupMembersAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Lists all members for a group */
@SuppressWarnings("unchecked")
private static PlayFabResult privateListGroupMembersAsync(final ListGroupMembersRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ListGroupMembers"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ListGroupMembersResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult();
pfResult.Result = result;
return pfResult;
}
/**
* Lists all groups and roles for an entity
* @param request ListMembershipRequest
* @return Async Task will return ListMembershipResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask> ListMembershipAsync(final ListMembershipRequest request) {
return new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListMembershipAsync(request);
}
});
}
/**
* Lists all groups and roles for an entity
* @param request ListMembershipRequest
* @return ListMembershipResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult ListMembership(final ListMembershipRequest request) {
FutureTask> task = new FutureTask(new Callable>() {
public PlayFabResult call() throws Exception {
return privateListMembershipAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}
/** Lists all groups and roles for an entity */
@SuppressWarnings("unchecked")
private static PlayFabResult privateListMembershipAsync(final ListMembershipRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Group/ListMembership"), request, "X-EntityToken", PlayFabSettings.EntityToken);
task.run();
Object httpResult = task.get();
if (httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;
PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType());
ListMembershipResponse result = resultData.data;
PlayFabResult pfResult = new PlayFabResult