DeleteSingleton
Deletes the specified custom entity singleton, owned by the session's user, for the specified entity type, on the server.
Service | Operation |
---|---|
customEntity | DELETE_SINGLETON |
Method Parameters
Parameter | Description |
---|---|
entityType | The type of custom entity singleton being deleted. Custom entity type must have option isOwned set to true. |
version | Version of the custom entity singleton being deleted. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string entityType = "athletes";
int version = 1;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.CustomEntityService.DeleteSingleton(entityType, version, successCallback, failureCallback);
const char *entityType = "athletes";
int version = 1;
_bc->getCustomEntityService()->deleteSingleton(entityType, version, this);
NSString *entityType = @"athletes";
int version = 1;
NSString *fieldsJson = "{\"goals\":3,\"assists\":5}";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc customEntityService] deleteSingleton:entityType
version:version
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String entityType = "athletes";
int version = 1;
this; // implements IServerCallback
_bc.getCustomEntityService().deleteSingleton(entityType, version, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var entityType = "athletes";
var version = 1;
_bc.customEntity.deleteSingleton(entityType, version, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var entityType = "athletes";
var version = 1;
ServerResponse result = await _bc.customEntityService.deleteSingleton(entityType:entityType, version:version);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var entityType = "athletes";
var version = 1;
var customEntityProxy = bridge.getCustomEntityServiceProxy();
var postResult = customEntityProxy.deleteSingleton(entityType, version);
if (postResult.status == 200) {
// Success!
}
{
"service": "customEntity",
"operation": "DELETE_SINGLETON",
"data": {
"entityType": "athletes",
"version": 1
}
}
JSON Response
{
"data": null,
"status": 200
}