예제 #1
0
        /// <summary>
        /// Abort pending file uploads to an entity's profile.
        /// </summary>
        public static void AbortFileUploads(AbortFileUploadsRequest request, Action <AbortFileUploadsResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;


            PlayFabHttp.MakeApiCall("/File/AbortFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context);
        }
예제 #2
0
        /// <summary>
        /// Abort pending file uploads to an entity's profile.
        /// </summary>
        public static void AbortFileUploads(AbortFileUploadsRequest request, Action<AbortFileUploadsResponse> resultCallback, Action<PlayFabError> errorCallback, object customData = null, Dictionary<string, string> extraHeaders = null)
        {
            var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;
            var callSettings = PlayFabSettings.staticSettings;
            if (!context.IsEntityLoggedIn()) throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn,"Must be logged in to call this method");


            PlayFabHttp.MakeApiCall("/File/AbortFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings);
        }
예제 #3
0
        /// <summary>
        /// Abort pending file uploads to an entity's profile.
        /// </summary>
        /// <param name="Entity">The entity to perform this action on. (Required)</param>
        /// <param name="FileNames">Names of the files to have their pending uploads aborted. (Required)</param>
        /// <param name="ProfileVersion">The expected version of the profile, if set and doesn't match the current version of the profile the operation will not be performed. (Optional)</param>
        public static Task <AbortFileUploadsResponse> AbortFileUploads(EntityKey Entity, List <string> FileNames, int?ProfileVersion = default,
                                                                       PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            AbortFileUploadsRequest request = new AbortFileUploadsRequest()
            {
                Entity         = Entity,
                FileNames      = FileNames,
                ProfileVersion = ProfileVersion,
            };

            var context = GetContext(customAuthContext);

            return(PlayFabHttp.MakeApiCallAsync <AbortFileUploadsResponse>("/File/AbortFileUploads", request,
                                                                           AuthType.EntityToken,
                                                                           customData, extraHeaders, context));
        }
        /// <summary>
        /// Abort pending file uploads to an entity's profile.
        /// </summary>
        public async Task <PlayFabResult <AbortFileUploadsResponse> > AbortFileUploadsAsync(AbortFileUploadsRequest request, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            if ((request?.AuthenticationContext?.EntityToken ?? PlayFabSettings.staticPlayer.EntityToken) == null)
            {
                throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call GetEntityToken before calling this method");
            }

            var httpResult = await PlayFabHttp.DoPost("/File/AbortFileUploads", request, "X-EntityToken", PlayFabSettings.staticPlayer.EntityToken, extraHeaders, apiSettings);

            if (httpResult is PlayFabError)
            {
                var error = (PlayFabError)httpResult;
                PlayFabSettings.GlobalErrorHandler?.Invoke(error);
                return(new PlayFabResult <AbortFileUploadsResponse> {
                    Error = error, CustomData = customData
                });
            }

            var resultRawJson = (string)httpResult;
            var resultData    = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <AbortFileUploadsResponse> >(resultRawJson);
            var result        = resultData.data;

            return(new PlayFabResult <AbortFileUploadsResponse> {
                Result = result, CustomData = customData
            });
        }
예제 #5
0
 /// <summary>
 /// Abort pending file uploads to an entity's profile.
 /// </summary>
 public static void AbortFileUploads(AbortFileUploadsRequest request, Action <AbortFileUploadsResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null)
 {
     PlayFabHttp.MakeApiCall("/File/AbortFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders);
 }