com.playfab.PlayFabProfilesAPI Maven / Gradle / Ivy
package com.playfab;
import com.playfab.internal.*;
import com.playfab.PlayFabProfilesModels.*;
import com.playfab.PlayFabErrors.*;
import com.playfab.PlayFabSettings;
import java.util.concurrent.*;
import java.util.*;
import com.google.gson.*;
import com.google.gson.reflect.*;
    /**
     * All PlayFab entities have profiles, which hold top-level properties about the entity. These APIs give you the tools
     * needed to manage entity profiles.
     */
public class PlayFabProfilesAPI {
    private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();
    /**
     * Gets the global title access policy
     * @param request GetGlobalPolicyRequest
     * @return Async Task will return GetGlobalPolicyResponse
     */
    @SuppressWarnings("unchecked")
    public static FutureTask> GetGlobalPolicyAsync(final GetGlobalPolicyRequest request) {
        return new FutureTask(new Callable>() {
            public PlayFabResult call() throws Exception {
                return privateGetGlobalPolicyAsync(request);
            }
        });
    }
    /**
     * Gets the global title access policy
     * @param request GetGlobalPolicyRequest
     * @return GetGlobalPolicyResponse
     */
    @SuppressWarnings("unchecked")
    public static PlayFabResult GetGlobalPolicy(final GetGlobalPolicyRequest request) {
        FutureTask> task = new FutureTask(new Callable>() {
            public PlayFabResult call() throws Exception {
                return privateGetGlobalPolicyAsync(request);
            }
        });
        try {
            task.run();
            return task.get();
        } catch(Exception e) {
            return null;
        }
    }
    /** Gets the global title access policy */
    @SuppressWarnings("unchecked")
    private static PlayFabResult privateGetGlobalPolicyAsync(final GetGlobalPolicyRequest request) throws Exception {
        if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");
        FutureTask            © 2015 - 2025 Weber Informatics LLC | Privacy Policy