/// <summary> /// Initiates file uploads to an entity's profile. /// </summary> public static void InitiateFileUploads(InitiateFileUploadsRequest request, Action <InitiateFileUploadsResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer; PlayFabHttp.MakeApiCall("/File/InitiateFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context); }
/// <summary> /// Initiates file uploads to an entity's profile. /// </summary> public static void InitiateFileUploads(InitiateFileUploadsRequest request, Action<InitiateFileUploadsResponse> 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/InitiateFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings); }
/// <summary> /// Initiates 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 be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.' (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 <InitiateFileUploadsResponse> InitiateFileUploads(EntityKey Entity, List <string> FileNames, int?ProfileVersion = default, PlayFabAuthenticationContext customAuthContext = null, object customData = null, Dictionary <string, string> extraHeaders = null) { InitiateFileUploadsRequest request = new InitiateFileUploadsRequest() { Entity = Entity, FileNames = FileNames, ProfileVersion = ProfileVersion, }; var context = GetContext(customAuthContext); return(PlayFabHttp.MakeApiCallAsync <InitiateFileUploadsResponse>("/File/InitiateFileUploads", request, AuthType.EntityToken, customData, extraHeaders, context)); }
/// <summary> /// Initiates file uploads to an entity's profile. /// </summary> public async Task <PlayFabResult <InitiateFileUploadsResponse> > InitiateFileUploadsAsync(InitiateFileUploadsRequest 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/InitiateFileUploads", request, "X-EntityToken", PlayFabSettings.staticPlayer.EntityToken, extraHeaders, apiSettings); if (httpResult is PlayFabError) { var error = (PlayFabError)httpResult; PlayFabSettings.GlobalErrorHandler?.Invoke(error); return(new PlayFabResult <InitiateFileUploadsResponse> { Error = error, CustomData = customData }); } var resultRawJson = (string)httpResult; var resultData = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <InitiateFileUploadsResponse> >(resultRawJson); var result = resultData.data; return(new PlayFabResult <InitiateFileUploadsResponse> { Result = result, CustomData = customData }); }
/// <summary> /// Initiates file uploads to an entity's profile. /// </summary> public static void InitiateFileUploads(InitiateFileUploadsRequest request, Action <InitiateFileUploadsResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null) { PlayFabHttp.MakeApiCall("/File/InitiateFileUploads", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders); }