CloudVariables

The CloudVariables Service provides support for storing variables on the cloud. Variables can be optionally password-protected or stored only for the current user.

Cloud variables that are inactive (no reads or writes) for 30 days are subject to deletion.

RPCS

CloudVariables.deleteUserVariable(name: String)

Delete the user variable for the current user.

Arguments:

  • name: String (String) - Variable name
CloudVariables.deleteVariable(name: String, password: String?)

Delete a given cloud variable

Arguments:

  • name: String (String) - Variable to delete
  • password: String? (String) - Password (if password-protected)
CloudVariables.getUserVariable(name: String)

Get the value of a variable for the current user.

Arguments:

  • name: String (String) - Variable name

Returns: Any (Any) - the stored value

CloudVariables.getVariable(name: String, password: String?)

Get the value of a cloud variable

Arguments:

  • name: String (String) - Variable name
  • password: String? (String) - Password (if password-protected)

Returns: Any (Any) - the stored value

CloudVariables.listenToUserVariable(name: String, msgType: Any, duration: Duration?)

Identical to CloudVariables.listenToVariable() except that it listens for updates on a user variable.

Arguments:

  • name: String (String) - Variable name
  • msgType: Any (Any) - Message type to send each time the variable is updated
  • duration: Duration? (Duration) - The maximum duration to listen for updates on the variable (default 1hr).
CloudVariables.listenToVariable(name: String, msgType: String, password: String?, duration: Duration?)

Registers your client to receive messages each time the variable value is updated. name and password denote the variable to listen to. msgType is the name of the message that will be sent each time it is updated.

The variable must already exist prior to calling this RPC. Update events will cease when the variable is deleted.

Message Fields

  • name - the name of the variable that was updated
  • value - the new value of the variable

Arguments:

  • name: String (String) - Variable name
  • msgType: String (String) - Message type to send each time the variable is updated
  • password: String? (String) - Password (if password-protected)
  • duration: Duration? (Duration) - The maximum duration to listen for updates on the variable (default 1hr).
CloudVariables.lockVariable(name: String, password: String?)

Lock a given cloud variable.

A locked variable cannot be changed by anyone other than the person who locked it. A variable cannot be locked for more than 5 seconds.

Arguments:

  • name: String (String) - Variable to lock
  • password: String? (String) - Password (if password-protected)
CloudVariables.setUserVariable(name: String, value: Any)

Set the value of the user cloud variable for the current user.

Arguments:

  • name: String (String) - Variable name
  • value: Any (Any) - Value to store in variable
CloudVariables.setVariable(name: String, value: Any, password: String?)

Set a cloud variable. If a password is provided on creation, the variable will be password-protected.

Arguments:

  • name: String (String) - Variable name
  • value: Any (Any) - Value to store in variable
  • password: String? (String) - Password (if password-protected)
CloudVariables.unlockVariable(name: String, password: String?)

Unlock a given cloud variable.

A locked variable cannot be changed by anyone other than the person who locked it. A variable cannot be locked for more than 5 minutes.

Arguments:

  • name: String (String) - Variable to delete
  • password: String? (String) - Password (if password-protected)