Delete the object from the server
return promise object.
Delete the object body from the server. If the KiiObject has not saved on the cloud or deleted or exist but does not have body object, request will be failed. If succeeded, The object body content type will be nullified.
return promise object.
Download body data of this object. If the KiiObject has not saved on the cloud or deleted or exist but does not have body object, request will be failed.
NOTE: this requires XMLHttpRequest Level 2, FileReader and Blob supports. Do not use it in server code.
return promise object.
NOTE: Promise will not handle progress event. Please pass callbacks with progress function to handle progress.
Gets the value associated with the given key
The key to retrieve
Get the body content-type. It will be updated after the success of KiiObject.uploadBody and KiiObject.downloadBody returns null or undefined when this object doesn't have body content-type information.
Get the bucket.
Get the server's creation date of this object
Gets the geo point associated with the given key.
The key of the geo point to retrieve.
KiiGeoPoint tied to the key. undefined if no exists.
Get Id of the object or null if the object ID hasn't been assigned.
Gets the array object that contains all keys of custom field. The array of keys from local cache will be returned. To get the latest array of keys from cloud, calling refresh() is necessary prior calling this method. The returned array object does not include reserved keys such as _created, _modified, etc.
keys An array of all keys of custom field.
Get the modified date of the given object, assigned by the server
Get the application-defined type name of the object
Get the UUID of the given object, assigned by the server
Move KiiObject body from an object to another object.
A KiiObject URI which KiiObject body is moved to.
return promise object.
Get the ACL handle for this file
Any KiiACLEntry objects added or revoked from this ACL object will be appended to/removed from the server on ACL save.
A KiiACL object associated with this KiiObject
Get a specifically formatted string referencing the object
The object must exist in the cloud (have a valid UUID).
A URI string based on the current object. null if a URI couldn't be generated.
ublish object body. Publish object body and obtain public URL links to the body. It doesn't expires. If the KiiObject has not saved on the cloud or deleted or exist but does not have body object, request will be failed.
return promise object.
Publish object body with expiration date. Publish object body and obtain public URL links to the body. Expires at specified date If the KiiObject has not saved on the cloud or deleted or exist but does not have body object, request will be failed.
expiration date. should specify future date.
return promise object.
Publish object body with expiration duration. Publish object body and obtain public URL links to the body. Expires in specified duration If the KiiObject has not saved on the cloud or deleted or exist but does not have body object, request will be failed.
duration in seconds. greater than 0.
return promise object.
Updates the local object's data with the user data on the server
The object must exist on the server. Local data will be overwritten.
return promise object.
Removes a pair of key/value from this object. This pair is also removed from server when saveAllFields() is succeeded.
The key to be removed
Create or update the KiiObject on KiiCloud.
When call this method for the object that has not saved on cloud, will send all fields. Call this method for the object that has saved on cloud, Update only updated fields. Do not send fields that has not updated locally. To send all fields regardless of updates, call KiiObject.saveAllFields.
return promise object.
Create or update the KiiObject on KiiCloud.
When call this method for the object that has not saved on cloud, will send all fields. Call this method for the object that has saved on cloud, Update all field of this object.
return promise object.
Sets a key/value pair to a KiiObject
If the key already exists, its value will be written over.
NOTE: Before involving floating point value, please consider using integer instead. For example, use percentage, permil, ppm, etc. The reason is:
The key to set. if null, empty string or string prefixed with '_' is specified, silently ignored and have no effect. We don't check if actual type is String or not. If non-string type is specified, it will be encoded as key by JSON.stringify()
The value to be set. Object must be JSON-encodable type (dictionary, array, string, number, boolean) We don't check actual type of the value. It will be encoded as value by JSON.stringify()
Set Geo point to this object with the specified key.
The key to set.
KiiGeoPoint to be tied to the specified key.
Upload body data of this object. If the KiiObject has not saved on the cloud or deleted, request will be failed.
NOTE: this requires XMLHttpRequest Level 2, FileReader and Blob supports. Do not use it in server code.
data to be uploaded. type is used to determin content-type managed in Kii Cloud. If type was not specified in the Blob, 'application/octet-stream' will be used.
return promise object.
NOTE: Promise will not handle progress event. Please pass callbacks with progress function to handle progress.
Check if given ID is valid for object ID. Valid pattern: ^[a-zA-Z0-9-_\.]{2,100}$
objectID to be checked.
true if given ID is valid, false otherwise.
Generate a new KiiObject based on a given URI
The URI of the object to be represented
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
A new KiiObject with its parameters filled in from the URI
Generated using TypeDoc
Represents a KiiObject object