Example #1
0
 /// <summary>
 /// Returns a request to update the contents of a global storage item.
 /// </summary>
 /// <param name="key">The key that identifies the storage item.</param>
 /// <param name="operation">The operation to perform on the storage item's content.</param>
 /// <param name="value">The value to change the storage item content with.</param>
 public static GameJoltRequest <FetchResponse> Update(string key, StorageUpdateOperation operation, string value)
 => new GameJoltRequest <FetchResponse>("data-store/update",
                                        new Dictionary <string, string>()
 {
     { nameof(key), key },
     { nameof(value), value },
     { nameof(operation), operation.ToString().ToLowerInvariant() }
 });
Example #2
0
                /// <summary>
                /// Creates an API call that updates a value in the global data storage.
                /// </summary>
                public static APICall UpdateGlobal(string key, StorageUpdateOperation operation, string value)
                {
                    var parameters = new Dictionary <string, string>();

                    parameters.Add("key", key);
                    parameters.Add("value", value);
                    parameters.Add("operation", StorageUpdateOperationToString(operation));
                    return(new APICall("data-store/update", parameters));
                }
Example #3
0
 private static string StorageUpdateOperationToString(StorageUpdateOperation operation)
 {
     return operation.ToString().ToLowerInvariant();
 }
Example #4
0
 /// <summary>
 /// Creates an API call that updates a value in the global data storage.
 /// </summary>
 public static APICall UpdateGlobal(string key, StorageUpdateOperation operation, string value)
 {
     var parameters = new Dictionary<string, string>();
     parameters.Add("key", key);
     parameters.Add("value", value);
     parameters.Add("operation", StorageUpdateOperationToString(operation));
     return new APICall("data-store/update", parameters);
 }
Example #5
0
 private static string StorageUpdateOperationToString(StorageUpdateOperation operation)
 {
     return(operation.ToString().ToLowerInvariant());
 }